summaryrefslogtreecommitdiff
path: root/configs/profile/rebuild.sh
diff options
context:
space:
mode:
Diffstat (limited to 'configs/profile/rebuild.sh')
-rwxr-xr-xconfigs/profile/rebuild.sh27
1 files changed, 19 insertions, 8 deletions
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/