aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
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