summaryrefslogtreecommitdiff
path: root/librechroot
diff options
context:
space:
mode:
authorNicolás Reynolds <apoyosis@correo.inta.gob.ar>2010-11-18 14:32:50 -0300
committerNicolás Reynolds <apoyosis@correo.inta.gob.ar>2010-11-18 14:32:50 -0300
commit750fb2354ee41ae92c6c7cde5ae577cf8d8a610c (patch)
treed877902ae6a7ef654c557f67814906ee158f3b0e /librechroot
parent8ed3399a01a2259b82459af5247fa6731630d256 (diff)
Added librepatch for generating -libre patches (useful for abs-libre)
Fixed librechroot
Diffstat (limited to 'librechroot')
-rwxr-xr-xlibrechroot21
1 files changed, 13 insertions, 8 deletions
diff --git a/librechroot b/librechroot
index e43a3ee..9532214 100755
--- a/librechroot
+++ b/librechroot
@@ -37,16 +37,21 @@ else
source /etc/libretools.conf
fi
-mount -t proc proc $CHROOTDIR/$root/proc/
-mount -t sysfs sys $CHROOTDIR/$root/sys/
-mount -o bind /dev $CHROOTDIR/$root/dev/
+[[ ! -d $CHROOTDIR/$1/ ]] && {
+ echo "There's no $CHROOTDIR/$1"
+ exit 3
+}
+
+mount -t proc proc $CHROOTDIR/$1/proc/
+mount -t sysfs sys $CHROOTDIR/$1/sys/
+mount -o bind /dev $CHROOTDIR/$1/dev/
-cp -L /etc/resolv.conf $CHROOTDIR/$root/etc/resolv.conf
+cp -L /etc/resolv.conf $CHROOTDIR/$1/etc/resolv.conf
-chroot $CHROOTDIR/$root /bin/bash
+chroot $CHROOTDIR/$1 /bin/bash
-umount $CHROOTDIR/$root/proc/
-umount $CHROOTDIR/$root/sys/
-umount $CHROOTDIR/$root/dev/
+umount $CHROOTDIR/$1/proc/
+umount $CHROOTDIR/$1/sys/
+umount $CHROOTDIR/$1/dev/
exit 0