From 7f34912c094f05ccf4a46ccbf97af3220fc9c61c Mon Sep 17 00:00:00 2001 From: Fleshless Builder Date: Tue, 21 Nov 2017 17:52:50 +0300 Subject: [PATCH] cleanup --- makepkg-overlay | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/makepkg-overlay b/makepkg-overlay index 92adefa..24b5323 100755 --- a/makepkg-overlay +++ b/makepkg-overlay @@ -1,4 +1,7 @@ #!/usr/bin/env bash +# Depends on lxf + +cleanup() { lxf umount "$cnt"; } buildscript() { cat <<- EOF @@ -24,29 +27,25 @@ buildscript() { EOF } +# Config wrk_dir='/home/lxc' + +# Parameters pkg_url=$1 pkg_dest=$2 - cnt="_makepkg.$$" cnt_dir="$wrk_dir/containers/$cnt" -# Unmount the thing in any case -cleanup() { lxf umount "$cnt"; } -trap 'cleanup' INT TERM EXIT - # Create new container lxf -r builder -i base new "$cnt" +# Unmount the thing in any case +trap 'cleanup' INT TERM EXIT + # Add the build script buildscript > "$cnt_dir/rootfs/init" chmod 755 "$cnt_dir/rootfs/init" -# Tell it where to fetch the package -echo "$pkg_url" > "$cnt_dir/rootfs/repo" - -export PKG_GIT_URL="$pkg_url" - # Start the container lxc-start -n "$cnt" -F /init; lxc_exit=$? (( lxc_exit )) && exit "$lxc_exit"