aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorStanislav Ochotnicky <sochotnicky@gmail.com>2009-06-29 11:06:03 +0200
committerStanislav Ochotnicky <sochotnicky@gmail.com>2009-06-29 11:06:03 +0200
commit01f0c1c1c471f5c1e4f1775c9558daefaabfcf29 (patch)
tree73a5735d9927750e2145f73c6adaf08b841e9dab /util
parentAdded --one-file-system to `rm` (diff)
downloadcollagen-01f0c1c1c471f5c1e4f1775c9558daefaabfcf29.tar.gz
collagen-01f0c1c1c471f5c1e4f1775c9558daefaabfcf29.tar.bz2
collagen-01f0c1c1c471f5c1e4f1775c9558daefaabfcf29.zip
Changed lot of stuff to mount -o bind
especially /usr/portage is remounted read only inside chroot instead of copying it around (silly idea from the beginning)
Diffstat (limited to 'util')
-rwxr-xr-xutil/mktinderboxchroot.sh28
1 files changed, 19 insertions, 9 deletions
diff --git a/util/mktinderboxchroot.sh b/util/mktinderboxchroot.sh
index 4394f0a..83f5bdf 100755
--- a/util/mktinderboxchroot.sh
+++ b/util/mktinderboxchroot.sh
@@ -31,6 +31,10 @@ clean_work_chroot()
if [ -d $WORK_CHROOT ];then
umount "$WORK_CHROOT/dev"
umount "$WORK_CHROOT/proc"
+ umount "$WORK_CHROOT/sys"
+ umount "$WORK_CHROOT/usr/portage/distfiles"
+ umount "$WORK_CHROOT/usr/portage"
+ umount "$WORK_CHROOT/etc/portage"
rm -rf --one-file-system "$WORK_CHROOT"
fi
echo Done
@@ -103,15 +107,8 @@ else
fi
echo Done
- echo -n "RSyncing portage dir to $BASE_CHROOT..."
- rsync -va "$PORTAGE_DIR" "$BASE_CHROOT/usr"
-
- if [ $? -ne 0 ];then
- echo "Errors syncing portage directory, bailing out!!!"
- rm -rf "$BASE_CHROOT"
- exit 1
- fi
- echo Done
+ rm -rf --one-file-system "$BASE_CHROOT/etc/portage/"
+ mkdir -p "$BASE_CHROOT/etc/portage"
fi
@@ -146,6 +143,19 @@ echo Done
echo -n "Mounting filesystems..."
mount -t proc none "$WORK_CHROOT/proc"
mount -o bind /dev "$WORK_CHROOT/dev"
+mount -o bind /sys "$WORK_CHROOT/sys"
+
+mkdir -p "$WORK_CHROOT/usr/portage"
+mount -o bind "$PORTAGE_DIR" "$WORK_CHROOT/usr/portage"
+# this is bug/issue with current kernels, ro binds don't work so we have to remount
+mount -o remount,ro "$WORK_CHROOT/usr/portage"
+
+mount -o bind "$PORTAGE_DIR/distfiles" "$WORK_CHROOT/usr/portage/distfiles"
+
+
+mount -o bind /etc/portage "$WORK_CHROOT/etc/portage"
+mount -o remount,ro "$WORK_CHROOT/etc/portage"
+
echo Done