Add hook for personalizing chroot.

This places a simple hook in cros_sdk by executing commands
in $HOME/.cros_chroot_init when a chroot is built.  This
lets users copy files to the chroot (for instance, scripts), as
well as add lines to .bash_profile and other rc files.

BUG=chromium-os:31295
TEST=tested manually and verified .cros_chroot_init is executed when present

Change-Id: I2a5b070a9827272f7bb7b3d340ad6937b0bef329
Reviewed-on: https://gerrit.chromium.org/gerrit/23668
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Ready: Luigi Semenzato <semenzato@chromium.org>
This commit is contained in:
Luigi Semenzato 2012-05-29 10:34:04 -07:00 committed by Gerrit
parent db0a3903d1
commit 2443fdd62e

View File

@ -298,6 +298,10 @@ EOF
echo "Copying ~/.gitconfig into chroot"
cp $HOME/.gitconfig "$FLAGS_chroot/home/$USER/"
fi
if [[ -f $HOME/.cros_chroot_init ]]; then
/bin/bash $HOME/.cros_chroot_init "${FLAGS_chroot}"
fi
}
# Handle deleting an existing environment.