From 2443fdd62e3da3f3bd6815c98f76d7d7c9c4e471 Mon Sep 17 00:00:00 2001 From: Luigi Semenzato Date: Tue, 29 May 2012 10:34:04 -0700 Subject: [PATCH] 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 Tested-by: Luigi Semenzato Commit-Ready: Luigi Semenzato --- sdk_lib/make_chroot.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk_lib/make_chroot.sh b/sdk_lib/make_chroot.sh index 8f402a99c3..e0ddd0b964 100755 --- a/sdk_lib/make_chroot.sh +++ b/sdk_lib/make_chroot.sh @@ -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.