From 1b1621bee189a09f331ff71fd0e43c548b2b3901 Mon Sep 17 00:00:00 2001 From: bill-auger Date: Wed, 27 Feb 2019 17:59:08 -0500 Subject: sq - housekeeping --- configs/profile/build.sh | 12 ++++++------ configs/profile/rebuild.sh | 20 +++++++++++--------- .../profile/root-image/root/customize_root_image.sh | 10 +++++----- parabolaiso/mkparabolaiso | 1 + 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/configs/profile/build.sh b/configs/profile/build.sh index 31672e7..9e5960e 100755 --- a/configs/profile/build.sh +++ b/configs/profile/build.sh @@ -19,8 +19,8 @@ iso_dirname='parabola' enable_offline_install='false' enable_tts_brltty='false' offline_switch='' -work_dir=./work -out_dir=./out/$(echo "${iso_edition}-${iso_version}" | tr '[:upper:]/' '[:lower:]-') +work_dir=./work/ +out_dir=./out/ target='' verbose='' efi_img_kbytes=40000 @@ -405,10 +405,10 @@ else fi iso_title="${iso_title} - ${iso_edition} Edition ${iso_version}" iso_filename="parabola-${iso_edition}-${iso_arch}-${iso_type}-${iso_version}.iso" -iso_filename=$( echo ${iso_filename} | tr '[:upper:]/' '[:lower:]-') -out_dir=./out/$(echo ${iso_edition}-${iso_version} | tr '[:upper:]/' '[:lower:]-') -iso_init=$( echo ${iso_edition} | cut -d '/' -f 1 | tr '[:upper:]' '[:lower:]' ) -iso_gui=$( echo ${iso_edition} | cut -d '/' -f 2 | tr '[:upper:]' '[:lower:]' ) +iso_filename=$( echo ${iso_filename} | tr '[:upper:]/' '[:lower:]-') +out_dir=${out_dir}$(echo ${iso_edition}-${iso_version} | tr '[:upper:]/' '[:lower:]-') +iso_init=$( echo ${iso_edition} | cut -d '/' -f 1 | tr '[:upper:]' '[:lower:]' ) +iso_gui=$( echo ${iso_edition} | cut -d '/' -f 2 | tr '[:upper:]' '[:lower:]' ) [[ "${iso_init}" == 'openrc' ]] && base_group='base-openrc' || base_group='base' [[ "${archs}" == 'i686' ]] && arch='i686' || arch='x86_64' diff --git a/configs/profile/rebuild.sh b/configs/profile/rebuild.sh index a7e1af3..02f9999 100755 --- a/configs/profile/rebuild.sh +++ b/configs/profile/rebuild.sh @@ -4,27 +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='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 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='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" +readonly OUT_DIR=./out/new/ # prepare build command -readonly CMD="./build.sh -v -E $EDITION -T $TARGET $TALKING $CACHE -V $VERSION $*" +readonly CMD="./build.sh -v -E $EDITION -T $TARGET $TALKING $CACHE -V $VERSION -o $OUT_DIR $*" # sanity checks -((`id -u`)) && echo "This script must be run with root privileges." && exit +((`id -u`)) && echo "This script must be run with root privileges." && exit || \ + echo "Preparing (${MODE} mode): ${CMD}" # cleanup in case of previous aborted run diff --git a/configs/profile/root-image/root/customize_root_image.sh b/configs/profile/root-image/root/customize_root_image.sh index 4ce914a..eda5c64 100755 --- a/configs/profile/root-image/root/customize_root_image.sh +++ b/configs/profile/root-image/root/customize_root_image.sh @@ -1,6 +1,6 @@ #!/bin/bash -### post-install chroot customization script ### +## post-install chroot customization script ## set -e -u source /root/customize_root_image-constants.inc @@ -35,9 +35,9 @@ then # delete files that are specific to other init systems # enable services for service in ${OPENRC_SERVICES} ; do rc-update add ${service} default ; done ; - # create the dbus user and group if it does not exist - if [[ "$(grep 'dbus' /etc/group )" = "" ]] ; then groupadd -g 81 dbus ; fi ; - if [[ "$(grep 'dbus' /etc/passwd)" = "" ]] ; then useradd -r -s /sbin/nologin -g 81 -u 81 dbus ; fi ; + # create the 'dbus' group and user if they do not exist + if ! grep 'dbus' /etc/group > /dev/null ; then groupadd -g 81 dbus ; fi ; + if ! grep 'dbus' /etc/passwd > /dev/null ; then useradd -r -s /sbin/nologin -u 81 -g 81 dbus ; fi ; elif [[ "${ISO_INIT}" == 'systemd' ]] then # delete files that are specific to other init systems @@ -76,7 +76,7 @@ else # configure GUI login session # configure live user [[ -n "$(id ${LIVE_USER} 2> /dev/null)" ]] && userdel -r ${LIVE_USER} 2> /dev/null - useradd -m -p "" -g users -G "${USER_GROUPS}" -s ${DEFAULT_SHELL} ${LIVE_USER} + useradd -m -p "" -g users -G "${LIVE_USER_GROUPS}" -s ${DEFAULT_SHELL} ${LIVE_USER} # configure auto-login if [[ "${ISO_INIT}" == 'openrc' ]] diff --git a/parabolaiso/mkparabolaiso b/parabolaiso/mkparabolaiso index eb2366e..da34304 100755 --- a/parabolaiso/mkparabolaiso +++ b/parabolaiso/mkparabolaiso @@ -228,6 +228,7 @@ _show_config () { pkglist) ;; iso) + _msg_info " Output directory: ${out_dir}" _msg_info " Image name: ${img_name}" _msg_info " Disk label: ${iso_label}" _msg_info " Disk publisher: ${iso_publisher}" -- cgit v1.2.2