mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-04 19:56:32 +02:00
toolchain_util: fix bash syntax when running as root
Apparently expanding an empty string before a variable assignment forces that assignment to be interpreted as a command instead. Instead of an empty string use env as our sudo alternative when running as root.
This commit is contained in:
parent
9f79898507
commit
b3ecb2c550
@ -192,7 +192,7 @@ _configure_sysroot() {
|
||||
local profile="$1"
|
||||
|
||||
# may be called from either catalyst (root) or setup_board (user)
|
||||
local sudo=
|
||||
local sudo="env"
|
||||
if [[ $(id -u) -ne 0 ]]; then
|
||||
sudo="sudo -E"
|
||||
fi
|
||||
@ -234,7 +234,7 @@ install_cross_toolchain() {
|
||||
cross_flags+=( --portage "${safe_flags[*]}" )
|
||||
|
||||
# may be called from either catalyst (root) or upgrade_chroot (user)
|
||||
local sudo=
|
||||
local sudo="env"
|
||||
if [[ $(id -u) -ne 0 ]]; then
|
||||
sudo="sudo -E"
|
||||
fi
|
||||
@ -273,7 +273,7 @@ install_cross_libs() {
|
||||
local package_provided="$ROOT/etc/portage/profile/package.provided"
|
||||
|
||||
# may be called from either catalyst (root) or setup_board (user)
|
||||
local sudo=
|
||||
local sudo="env"
|
||||
if [[ $(id -u) -ne 0 ]]; then
|
||||
sudo="sudo -E"
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user