Separate out additional cmd line args to chroot

This fix separates out any additional command line arguments given to
the enter_chroot.sh script when passed to the interior chroot.  This
allows one to pass environment variable settings to the interior
chroot shell such as:

./enter_chroot.sh -- CHROME_ORIGIN=LOCAL_SOURCE emerge-x86-generic ...

Before this fix any of these variable settings will be sucked up by
the shell launching the chroot, not the interior shell.

BUG=chromium-os:2457
TEST=ran test cases detailed in bug report

Review URL: http://codereview.chromium.org/2855034
This commit is contained in:
Allen Martin 2010-07-13 15:44:59 -07:00
parent bebf3798e5
commit 07bfc7aa9d

View File

@ -264,7 +264,7 @@ CHROOT_PASSTHRU="CHROMEOS_REVISION=$REVISION BUILDBOT_BUILD=$FLAGS_build_number
# the source trunk for scripts that may need to print it (e.g. # the source trunk for scripts that may need to print it (e.g.
# build_image.sh). # build_image.sh).
sudo chroot "$FLAGS_chroot" sudo -i -u $USER $CHROOT_PASSTHRU \ sudo chroot "$FLAGS_chroot" sudo -i -u $USER $CHROOT_PASSTHRU \
EXTERNAL_TRUNK_PATH="${FLAGS_trunk}" LANG=C "$@" EXTERNAL_TRUNK_PATH="${FLAGS_trunk}" LANG=C -- "$@"
# Remove trap and explicitly unmount # Remove trap and explicitly unmount
trap - EXIT trap - EXIT