From 1bc568b2b7b6285fa4c6962316282294d232cf42 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Mon, 30 Jan 2012 14:15:23 +0000 Subject: run-bootstrap-in-chroot: make a script and run that to chroot It is often useful to be able to chroot into the system it is easier to investigate build problems there So run-bootstrap-in-chroot will write a script to do this which can then be used to enter the squeeze chroot with ./do-squeeze-chroot bash or enter the baserock chroot with ./do-squeeze-chroot ./do-chroot --- run-bootstrap-in-chroot | 46 +++++++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 27 deletions(-) (limited to 'run-bootstrap-in-chroot') diff --git a/run-bootstrap-in-chroot b/run-bootstrap-in-chroot index ad7b5168..f172165e 100755 --- a/run-bootstrap-in-chroot +++ b/run-bootstrap-in-chroot @@ -2,12 +2,6 @@ set -e -mount_virtual() -{ - mount -t proc proc "$1/proc" - mount -t sysfs sysfs "$1/sys" -} - unmount_virtual() { umount "$1/proc" || true @@ -26,6 +20,21 @@ else snapshot=true snapshotdir="$1" fi + +if [ ! -x ./do-squeeze-chroot ]; then + cat >"./do-squeeze-chroot" <&2) || ([ "x$LFS_MIRROR" = x ] && echo LFS_MIRROR is unspecified >&2) then @@ -63,7 +72,6 @@ cat < "$dir/etc/hosts" 127.0.1.1 `hostname` EOF -cp baserock-bootstrap "$dir/." if [ "x$LFS_MIRROR" = x ]; then cp wget-list "$dir/wget-list" else @@ -76,17 +84,10 @@ fi if "$snapshot" && [ -e "$snapshotdir/pass1-snapshot.tar" ] then tar -C "$dir" -xf "$snapshotdir/pass1-snapshot.tar" + cp baserock-bootstrap "$dir/." #update bootstrap script else - if mount_virtual "$dir" && - chroot "$dir" bash -x baserock-bootstrap true && - unmount_virtual "$dir" - then - : - else - unmount_virtual "$dir" - exit 1 - fi - + cp baserock-bootstrap "$dir/." + "./do-squeeze-chroot" bash -x baserock-bootstrap true || exit 1 if "$snapshot" then tar -C "$dir" -caf "$snapshotdir/pass1-snapshot.tar" . @@ -100,13 +101,4 @@ cp -rl "$HOME/baserock/gits" "$dir/tree/baserock/gits" # Run pass2 of bootstrap. This actually runs pass1 too, but quickly, since # it's already built. -if mount_virtual "$dir" && - chroot "$dir" bash -x baserock-bootstrap false && - unmount_virtual "$dir" -then - : -else - unmount_virtual "$dir" - exit 1 -fi - +"./do-squeeze-chroot" bash -x baserock-bootstrap false || exit 1 -- cgit v1.2.1