Make $HOME in the chroot be reasonable.
With sudo -E $HOME is inherited, which is nearly always wrong. Change-Id: Ic77b9c2892c19a2fc08a07d35f76da79a346ebac
This commit is contained in:
parent
c7d80ddeed
commit
d6d941a8f1
@ -60,7 +60,10 @@ function run_in_target () {
|
|||||||
# will preserve the PATH syntax until after the sh command runs
|
# will preserve the PATH syntax until after the sh command runs
|
||||||
cmd="PATH=\$PATH:/usr/local/bin ; $@"
|
cmd="PATH=\$PATH:/usr/local/bin ; $@"
|
||||||
# -E to preserve http_proxy
|
# -E to preserve http_proxy
|
||||||
|
ORIG_HOME=$HOME
|
||||||
|
export HOME=/root
|
||||||
sudo -E chroot $TMP_MOUNT_PATH sh -c "$cmd"
|
sudo -E chroot $TMP_MOUNT_PATH sh -c "$cmd"
|
||||||
|
export HOME=$ORIG_HOME
|
||||||
}
|
}
|
||||||
|
|
||||||
# Helper function to run a directory of scripts inside the chroot
|
# Helper function to run a directory of scripts inside the chroot
|
||||||
|
Loading…
x
Reference in New Issue
Block a user