From f40da43d30f85c51b7ec67338cb951ae96d2999b Mon Sep 17 00:00:00 2001 From: bill-auger Date: Wed, 27 Feb 2019 10:26:06 -0500 Subject: housekeeping - sq - rebuild.sh --- configs/profile/build.sh | 3 ++- configs/profile/rebuild.sh | 27 +++++++++++++++++++-------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/configs/profile/build.sh b/configs/profile/build.sh index a20824e..31672e7 100755 --- a/configs/profile/build.sh +++ b/configs/profile/build.sh @@ -149,6 +149,7 @@ make_packages() { _cache_base_packages=${_cache_base_packages// /} _install_gui_packages=${_install_gui_packages// /} _cache_gui_packages=${_cache_gui_packages// /} + # display results local _install_packages="${_install_base_packages} ${_install_gui_packages}" local _cache_packages="${_cache_base_packages} ${_cache_gui_packages}" @@ -346,7 +347,7 @@ make_aitab() { # Build all filesystem images specified in aitab (.fs.sfs .sfs) make_prepare() { cp -a -l -f ${work_dir}/${arch}/root-image ${work_dir} - setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir} -D ${iso_dirname} pkglist + setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir} -D ${iso_dirname} -C ${pacman_conf} pkglist setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir} -D ${iso_dirname} -C ${pacman_conf} ${offline_switch} prepare rm -rf ${work_dir}/root-image diff --git a/configs/profile/rebuild.sh b/configs/profile/rebuild.sh index 416b947..a7e1af3 100755 --- a/configs/profile/rebuild.sh +++ b/configs/profile/rebuild.sh @@ -4,23 +4,29 @@ readonly MODE='wipe' # total wipe of work dir optionally preservi readonly PRESERVE_CACHE='false' # preserve package cache in 'wipe' mode # readonly MODE='rebuild' # full update rebuild preserving work dir # readonly MODE='tweak' # apply chroot customization tweaks only -readonly TARGET='dual' # dual-arch (default) -# readonly TARGET='i686' # i686 target only +#readonly TARGET='dual' # dual-arch (default) +readonly TARGET='i686' # i686 target only # readonly TARGET='x86_64' # x86_64 target only # readonly EDITION='OpenRC/CLI' # OpenRC/CLI init/WM-DE pair -# readonly EDITION='OpenRC/LXDE' # OpenRC/LXDE init/WM-DE pair -readonly EDITION='SystemD/CLI' # SystemD/CLI init/WM-DE pair (default) +readonly EDITION='OpenRC/LXDE' # OpenRC/LXDE init/WM-DE pair +# readonly EDITION='SystemD/CLI' # SystemD/CLI init/WM-DE pair (default) # readonly EDITION='SystemD/LXDE' # SystemD/LXDE init/WM-DE pair readonly TALKING='' # speech and braille disabled (default) -# readonly TALKING='-S' # speech and braille enabled +#readonly TALKING='-S' # speech and braille enabled readonly CACHE='' # net-install (default) -# readonly CACHE='-O' # offline install +#readonly CACHE='-O' # offline install readonly VERSION="`date +%Y.%m.%d`" # for ISO filename (default) # readonly VERSION="`date +%Y.%m.%d-%H.%M`-alpha" +# prepare build command +readonly CMD="./build.sh -v -E $EDITION -T $TARGET $TALKING $CACHE -V $VERSION $*" + + +# sanity checks ((`id -u`)) && echo "This script must be run with root privileges." && exit + # cleanup in case of previous aborted run while pids=$(pidof ./rebuild.sh || pidof sudo ./rebuild.sh) && pids=${pids/$PPID/} && [ "$pids" ] do for pid in ${pids/$PPID/} ; do sudo kill -9 $pid ; done ; sleep 1 ; @@ -34,6 +40,8 @@ do declare -a mountpoints=() for mountpoint in ${mountpoints[@]} ; do umount "${mountpoint}" ; done ; done + +# prepare environment if [ "$MODE" == 'wipe' ] then if [ "$PRESERVE_CACHE" == 'true' ] then for arch in i686 x86_64 @@ -69,10 +77,13 @@ then rm work/build.make_customize_root_image_$TARGET \ fi -CMD="./build.sh -v -E $EDITION -T $TARGET $TALKING $CACHE -V $VERSION $*" +# start build if ${CMD} then echo "success" ; rm ./continue.sh 2> /dev/null -else echo -e "failure executing:\n\t${CMD}\ncontinue with:\n\t./continue.sh [args-to-build.sh]" +else echo -e "failure executing:\n\t${CMD}\ncontinue with:\n\t./continue.sh [extra-args-to-build.sh]" echo -e "#!/bin/bash\n\n${CMD} \$*" > ./continue.sh chmod a+x ./continue.sh fi + + +sudo chgrp -R wheel ./root-image/ -- cgit v1.2.2