From 6033c0d7a587ea65d124a84146eba8e8cfff4095 Mon Sep 17 00:00:00 2001 From: Nicolas Reynolds Date: Wed, 7 Sep 2011 11:21:32 -0300 Subject: 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" --- buildenv | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 buildenv (limited to 'buildenv') 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 $? -- cgit v1.2.3-54-g00ecf From d3056495cdab4c03e1a5a73c303b4cc25337597d Mon Sep 17 00:00:00 2001 From: Nicolas Reynolds Date: Wed, 7 Sep 2011 11:26:53 -0300 Subject: Instead of 'abs', now buildenv uses ${USER}. --- buildenv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'buildenv') diff --git a/buildenv b/buildenv index 1a9fff6..dc41e19 100755 --- a/buildenv +++ b/buildenv @@ -3,7 +3,7 @@ trap "umount_all" 0 ERR TERM KILL umount_all() { - for mp in home/pkgdest home/srcdest home/abs; do + for mp in home/pkgdest home/srcdest home/${USER}; do msg "Umounting /$mp" umount $CHROOTDIR/$CHCOPY/$mp || error "Couldn't umount" done @@ -11,7 +11,7 @@ umount_all() { source /etc/libretools.conf -for mp in home/pkgdest home/srcdest home/abs var/lib/toru; do +for mp in home/pkgdest home/srcdest home/${USER} var/lib/toru; do msg "Binding /$mp" mount -o bind /$mp $CHROOTDIR/$CHCOPY/$mp || exit 1 done -- cgit v1.2.3-54-g00ecf From 6082f831bbacb174c050915d3b301910fb2ea261 Mon Sep 17 00:00:00 2001 From: Nicolas Reynolds Date: Wed, 21 Sep 2011 13:26:21 -0300 Subject: Use SUDO_USER or specified user on $1 --- buildenv | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'buildenv') diff --git a/buildenv b/buildenv index dc41e19..1cb07de 100755 --- a/buildenv +++ b/buildenv @@ -2,8 +2,10 @@ trap "umount_all" 0 ERR TERM KILL +user=${SUDO_USER:-${1}} + umount_all() { - for mp in home/pkgdest home/srcdest home/${USER}; do + for mp in home/pkgdest home/srcdest home/${user}; do msg "Umounting /$mp" umount $CHROOTDIR/$CHCOPY/$mp || error "Couldn't umount" done @@ -11,7 +13,7 @@ umount_all() { source /etc/libretools.conf -for mp in home/pkgdest home/srcdest home/${USER} var/lib/toru; do +for mp in home/pkgdest home/srcdest home/${user} var/lib/toru; do msg "Binding /$mp" mount -o bind /$mp $CHROOTDIR/$CHCOPY/$mp || exit 1 done -- cgit v1.2.3-54-g00ecf From 22a9fdddd1f6fd02e1b8d8ca9022398cd64c68b2 Mon Sep 17 00:00:00 2001 From: Nicolas Reynolds Date: Thu, 24 Nov 2011 11:08:54 -0300 Subject: change CHCOPY to CHROOT --- buildenv | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'buildenv') diff --git a/buildenv b/buildenv index 1cb07de..84a1fc2 100755 --- a/buildenv +++ b/buildenv @@ -7,7 +7,7 @@ user=${SUDO_USER:-${1}} umount_all() { for mp in home/pkgdest home/srcdest home/${user}; do msg "Umounting /$mp" - umount $CHROOTDIR/$CHCOPY/$mp || error "Couldn't umount" + umount $CHROOTDIR/$CHROOT/$mp || error "Couldn't umount" done } @@ -15,14 +15,14 @@ source /etc/libretools.conf for mp in home/pkgdest home/srcdest home/${user} var/lib/toru; do msg "Binding /$mp" - mount -o bind /$mp $CHROOTDIR/$CHCOPY/$mp || exit 1 + mount -o bind /$mp $CHROOTDIR/$CHROOT/$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 + cp --remove-destination /$etc $CHROOTDIR/$CHROOT/$etc || exit 1 done -$(dirname $0)/librechroot $CHCOPY +$(dirname $0)/librechroot $CHROOT exit $? -- cgit v1.2.3-54-g00ecf