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"