summaryrefslogtreecommitdiff
path: root/buildenv
diff options
context:
space:
mode:
Diffstat (limited to 'buildenv')
-rwxr-xr-xbuildenv26
1 files changed, 26 insertions, 0 deletions
diff --git a/buildenv b/buildenv
new file mode 100755
index 0000000..1a9fff6
--- /dev/null
+++ b/buildenv
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+trap "umount_all" 0 ERR TERM KILL
+
+umount_all() {
+ for mp in home/pkgdest home/srcdest home/abs; do
+ msg "Umounting /$mp"
+ umount $CHROOTDIR/$CHCOPY/$mp || error "Couldn't umount"
+ done
+}
+
+source /etc/libretools.conf
+
+for mp in home/pkgdest home/srcdest home/abs var/lib/toru; do
+ msg "Binding /$mp"
+ mount -o bind /$mp $CHROOTDIR/$CHCOPY/$mp || exit 1
+done
+
+for etc in etc/makepkg.conf etc/abs.conf etc/mtab; do
+ msg "Copying config /$etc"
+ cp --remove-destination /$etc $CHROOTDIR/$CHCOPY/$etc || exit 1
+done
+
+$(dirname $0)/librechroot $CHCOPY
+
+exit $?