summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Reynolds <fauno@kiwwwi.com.ar>2011-09-07 11:21:32 -0300
committerNicolas Reynolds <fauno@kiwwwi.com.ar>2011-09-07 11:21:32 -0300
commit6033c0d7a587ea65d124a84146eba8e8cfff4095 (patch)
tree4b2147e14ba53e2de85427901cbbc29f2e06525d
parentd220266566780795b2cad867253ac75b99c59604 (diff)
My build environment
I run buildenv from my current user to bind mount all the needed files on the clean chroot. It's like having the current user home and makepkg.conf under a clean environment. PKGBUILD edition is done outside the chroot. Chcleanup is the script to cleanup the installed packages, used by the mipsrelease hook to return the chroot to a clean state. The user is called 'abs', PKGDEST is /home/pkgdest and SRCDEST /home/srcdest. On libretools.conf: FULLBUILDCMD="sudo libremakepkg -cumL -M --noconfirm -M"
-rwxr-xr-xbuildenv26
-rwxr-xr-xchcleanup7
2 files changed, 33 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 $?
diff --git a/chcleanup b/chcleanup
new file mode 100755
index 0000000..83c9f3f
--- /dev/null
+++ b/chcleanup
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+[ ! -f ~/cleansystem ] && exit 1
+
+sudo pacman --noconfirm -Rcs $(comm -23 <(pacman -Qq | sort) <(sort ~/cleansystem))
+
+exit $?