From 859b25f8af367b2e4e3dabc236c099ca85fe77ac Mon Sep 17 00:00:00 2001 From: bill-auger Date: Sun, 16 Feb 2020 00:01:42 -0500 Subject: housekeeping --- configs/profile/build.sh | 93 ++++++++++++---------- configs/profile/rebuild.sh | 14 ++-- configs/profile/root-image/root/.language.sh | 37 +++++---- .../root/customize_root_image-constants.inc | 25 +++--- .../root-image/root/customize_root_image.sh | 93 +++++++++++----------- parabolaiso/mkmetadata | 35 ++++---- 6 files changed, 158 insertions(+), 139 deletions(-) diff --git a/configs/profile/build.sh b/configs/profile/build.sh index 3ae1a61..f115345 100755 --- a/configs/profile/build.sh +++ b/configs/profile/build.sh @@ -11,8 +11,7 @@ readonly END_COLOR='\033[00m' # edition-specific data declare -ar VALID_INITS=('openrc' 'systemd') -declare -ar VALID_GUIS=('cli' 'lxde' 'mate') -iso_title="Parabola GNU/Linux-libre Live" # $iso_edition and $iso_version appended +declare -ar VALID_WMDES=('cli' 'lxde' 'mate') # environment data_dir=/usr/share/parabolaiso/data @@ -22,23 +21,28 @@ packages_dir=${releng_dir}/packages [ "`which mkparabolaiso 2> /dev/null`" ] || export PATH=$PATH:"${releng_dir}/../../parabolaiso" # CLI option defaults -iso_edition="SystemD/CLI" -iso_arch='dual' +iso_arch='x86_64' +iso_init='systemd' +iso_wmde='cli' +enable_tts_brltty='false' +enable_offline_install='false' iso_version=$(date +%Y.%m.%d) iso_label="PARA_$(date +%Y%m)" iso_dirname='parabola' -enable_offline_install='false' -enable_tts_brltty='false' pacman_conf_in=${releng_dir}/pacman.conf work_dir=./work out_dir=./out verbose='' -# computed params, per CLI options +# computed vars, pending CLI options +edition_init='' # deferred +edition_wmde='' # deferred +iso_edition='' # deferred archs='' # deferred +launch_msg='' # deferred +iso_title='' # deferred +release_id='' # deferred iso_filename='' # deferred -iso_init='' # deferred -iso_gui='' # deferred arch='' # deferred pacman_conf='' # deferred @@ -48,20 +52,22 @@ _usage () echo "usage ${0} [options]" echo echo " General options:" - echo " -E Release edition (init/WM pair e.g. 'SystemD/CLI')" - echo " Default: ${iso_edition}" - echo " -T Target architecture (one of 'i686', 'x86_64', or 'dual')" + echo " -A Target architecture - one of: [ 'dual' , 'i686' , 'x86_64' ]" echo " Default: ${iso_arch}" - echo " -V Set the iso version in the filename" + echo " -I Init system - one of: [ 'openrc' , 'systemd' ]" + echo " Default: ${iso_init}" + echo " -W Graphical environment - one of: [ 'cli' , 'lxde' , 'mini' ]" + echo " Default: ${iso_wmde}" + echo " -S Enable speech and braille." + echo " Default: '${enable_tts_brltty}'" + echo " -O Enable offline install." + echo " Default: '' (net-install only)" + echo " -V Release version string" echo " Default: ${iso_version}" echo " -L Set the iso volume label" echo " Default: ${iso_label}" echo " -D Set the name of the directory inside the ISO" echo " Default: ${iso_dirname}" - echo " -O Enable offline install." - echo " Default: '' (net-install only)" - echo " -S Enable speech and braille." - echo " Default: '${enable_tts_brltty}'" echo " -C Specify the pacman.conf file used for chroot install." echo " Default: '${pacman_conf_in}'" echo " -w Set the working directory" @@ -131,8 +137,8 @@ make_packages() { local _install_initgui_lists=$(ls ${packages_dir}/packages-${iso_init}-gui.{all,${arch}} 2> /dev/null || true) local _cache_initgui_lists=$( ls ${packages_dir}/cache-${iso_init}-gui.{all,${arch}} 2> /dev/null || true) # wmde-specific package lists - local _install_gui_lists=$( ls ${packages_dir}/packages-${iso_gui}.{all,${arch}} 2> /dev/null || true) - local _cache_gui_lists=$( ls ${packages_dir}/cache-${iso_gui}.{all,${arch}} 2> /dev/null || true) + local _install_gui_lists=$( ls ${packages_dir}/packages-${iso_wmde}.{all,${arch}} 2> /dev/null || true) + local _cache_gui_lists=$( ls ${packages_dir}/cache-${iso_wmde}.{all,${arch}} 2> /dev/null || true) _install_base_lists=${_install_base_lists// /} _cache_base_lists=${_cache_base_lists// /} _install_basegui_lists=${_install_basegui_lists// /} @@ -153,7 +159,7 @@ make_packages() { # collect wmde-specific packages local _install_gui_packages=$( [ "${_install_gui_lists}" ] && grep -hv ^# ${_install_gui_lists}) local _cache_gui_packages=$( [ "${_cache_gui_lists}" ] && grep -hv ^# ${_cache_gui_lists}) - if [[ "${iso_gui}" != 'cli' ]]; then + if [[ "${iso_wmde}" != 'cli' ]]; then _gui_packages_msg="${_gui_packages_msg/non-graphical/graphical}" _install_gui_lists="${_install_basegui_lists} ${_install_initgui_lists} ${_install_gui_lists}" _cache_gui_lists="${_cache_basegui_lists} ${_cache_initgui_lists} ${_cache_gui_lists}" @@ -224,7 +230,8 @@ make_customize_root_image() { echo "Customizing root image" ISO_TITLE="${iso_title}" \ ISO_INIT="${iso_init}" \ - ISO_GUI="${iso_gui}" \ + ISO_WMDE="${iso_wmde}" \ + ISO_ARCH="${iso_arch}" \ ENABLE_OFFLINE_INSTALL="${enable_offline_install}" \ ENABLE_TTS_BRLTTY="${enable_tts_brltty}" \ setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir}/${arch} \ @@ -378,16 +385,17 @@ make_iso() { ## prepare state ## -# set CLI options -while getopts 'E:T:V:L:D:OSC:w:o:vh' arg; do +# collect CLI options +while getopts 'A:I:W:SOV:L:D:C:w:o:vh' arg; do case "${arg}" in - E) iso_edition="${OPTARG}" ;; - T) iso_arch="${OPTARG}" ;; + A) iso_arch="${OPTARG}" ;; + I) iso_init="${OPTARG}" ;; + W) iso_wmde="${OPTARG}" ;; + S) enable_tts_brltty='true' ;; + O) enable_offline_install='true' ;; V) iso_version="${OPTARG}" ;; L) iso_label="${OPTARG}" ;; D) iso_dirname="${OPTARG}" ;; - O) enable_offline_install='true' ;; - S) enable_tts_brltty='true' ;; C) pacman_conf_in="${OPTARG}" ;; w) work_dir="${OPTARG}" ;; o) out_dir="${OPTARG}" ;; @@ -400,7 +408,10 @@ while getopts 'E:T:V:L:D:OSC:w:o:vh' arg; do esac done -# set target arch, GRUB title, ISO filename, and pacman.conf sources +# compute build configuration +edition_init=$( case "${iso_init}" in 'openrc') echo 'OpenRC' ;; 'systemd') echo 'SystemD' ;; esac ) +edition_wmde=${iso_wmde^^} +iso_edition=${edition_init}/${edition_wmde} case "${iso_arch}" in 'i686'|'x86_64') archs=${iso_arch} @@ -419,27 +430,29 @@ else iso_type='netinstall' launch_msg="${launch_msg} (net install only)" fi -iso_title="${iso_title} - ${iso_edition} Edition ${iso_version}" -iso_filename="parabola-${iso_edition}-${iso_arch}-${iso_type}-${iso_version}.iso" -release_dirname="${iso_edition}-${iso_arch}-${iso_version}" -iso_filename=$( echo ${iso_filename} | tr '[:upper:]/' '[:lower:]-') -out_dir=${out_dir}/$(echo ${release_dirname} | 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_title="Parabola GNU/Linux-libre Live - ${iso_edition} Edition ${iso_version}" +release_id=${iso_arch}-${iso_init}-${iso_wmde}-${iso_version} +iso_filename=parabola-${release_id}-${iso_type}.iso [[ "${archs}" == 'i686' ]] && arch='i686' || arch='x86_64' pacman_conf=${work_dir}/pacman.conf +out_dir=${out_dir}/${release_id} ## sanity checks ## -# sanitize paths +# sanitize mkparabolaiso args +iso_init=${iso_init// /} +iso_wmde=${iso_wmde// /} +iso_arch=${iso_arch// /} +iso_version=${iso_version// /} iso_label=${iso_label// /} iso_dirname=${iso_dirname// /} -iso_filename=${iso_filename// /} -iso_init=${iso_init// /} -iso_gui=${iso_gui// /} +enable_offline_install=${enable_offline_install// /} +enable_tts_brltty=${enable_tts_brltty// /} +pacman_conf_in=${pacman_conf_in// /} work_dir=${work_dir// /} out_dir=${out_dir// /} +iso_filename=${iso_filename// /} pacman_conf=${pacman_conf// /} # validate build environment @@ -456,7 +469,7 @@ elif ! pacman -Qi parabolaiso-data > /dev/null; then LOG_ERROR "This script needs the 'parabolaiso-data' package to be installed." exit 1 elif ! echo "${VALID_INITS[@]}" | tr " " "\n" | grep -E "^${iso_init}$" > /dev/null || \ - ! echo "${VALID_GUIS[@]}" | tr " " "\n" | grep -E "^${iso_gui}$" > /dev/null; then + ! echo "${VALID_WMDES[@]}" | tr " " "\n" | grep -E "^${iso_wmde}$" > /dev/null ; then LOG_ERROR "Invalid init/wm combination: '${iso_edition}'." exit 1 fi diff --git a/configs/profile/rebuild.sh b/configs/profile/rebuild.sh index 29c47e1..dc5796c 100755 --- a/configs/profile/rebuild.sh +++ b/configs/profile/rebuild.sh @@ -7,13 +7,13 @@ readonly MODE='wipe' # total wipe of work dir, optionally preservi # readonly MODE='tweak' # apply chroot customization tweaks only ## build.sh options ## -readonly TARGET='dual' # dual-arch (default) +# readonly TARGET='dual' # dual-arch # 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 TARGET='x86_64' # x86_64 target only (default) +# readonly INIT='openrc' # OpenRC initsystem +readonly INIT='systemd' # SystemD initsystem (default) +readonly WMDE='cli' # CLI (default) +# readonly WMDE='LXDE' # LXDE readonly TALKING='' # speech and braille disabled (default) # readonly TALKING='-S' # speech and braille enabled readonly CACHE='' # net-install (default) @@ -24,7 +24,7 @@ readonly OUT_DIR=./out/new/ # prepare build command -readonly CMD="./build.sh -v -E $EDITION -T $TARGET $TALKING $CACHE -V $VERSION -o $OUT_DIR $*" +readonly CMD="./build.sh -v -A $TARGET -I $INIT -W $WMDE $TALKING $CACHE -V $VERSION -o $OUT_DIR $*" # sanity checks diff --git a/configs/profile/root-image/root/.language.sh b/configs/profile/root-image/root/.language.sh index 53f69ee..f3f6950 100755 --- a/configs/profile/root-image/root/.language.sh +++ b/configs/profile/root-image/root/.language.sh @@ -4,20 +4,22 @@ readonly TIMEOUT=30 readonly H=15 readonly W=40 readonly N_ITEMS=10 -readonly DEFAULT_LANG='en_US.UTF-8' + readonly LANG_TITLE="System language selection" readonly LANG_PROMPT="Choose your language:" -readonly DEFAULT_KEYMAP='us' +readonly LANG_DEFAULT='en_US.UTF-8' readonly KEYMAP_TITLE="System keymap selection" readonly KEYMAP_PROMPT="Choose your keymap:" -readonly -a LANGUAGES=( 'en_US.UTF-8' "English" \ - 'eo' "Esperanto" \ - 'es_ES.UTF-8' "Spanish" \ - 'fr_FR.UTF-8' "French" \ - 'gl_ES.UTF-8' "Galego" \ - 'it_IT.UTF-8' "Italian" \ - 'pl_PL.UTF-8' "Polish" \ - 'pt_BR.UTF-8' "Brazilian-Portuguese" ) +readonly KEYMAP_DEFAULT='us' + +readonly -a LANGUAGES=( 'en_US.UTF-8' "English" \ + 'eo' "Esperanto" \ + 'fr_FR.UTF-8' "French" \ + 'gl_ES.UTF-8' "Galego" \ + 'it_IT.UTF-8' "Italian" \ + 'pl_PL.UTF-8' "Polish" \ + 'pt_BR.UTF-8' "Portuguese" \ + 'es_ES.UTF-8' "Spanish" ) readonly -a ESPERANTO_LANG_PACKS=( 'iceweasel-l10n-es-eo' ) readonly -a SPANISH_LANG_PACKS=( 'iceweasel-l10n-es-ar' 'icedove-l10n-es-ar' 'iceweasel-l10n-es-cl' @@ -28,6 +30,7 @@ readonly -a GALEGO_LANG_PACKS=( 'iceweasel-l10n-gl' 'icedove-l10n-gl' readonly -a ITALIAN_LANG_PACKS=( 'iceweasel-l10n-it' 'icedove-l10n-it' ) readonly -a POLISH_LANG_PACKS=( 'iceweasel-l10n-pl' 'icedove-l10n-pl' ) readonly -a PORTUGUESE_LANG_PACKS=( 'iceweasel-l10n-pt-br' 'icedove-l10n-pt-br' ) + readonly -a KEYMAPS=( 'af' "Afrikaans-Lang" \ 'al' "Albanian" \ 'am' "Amharic" \ @@ -142,12 +145,12 @@ Prompt() # (title , prompt , default_option , options) } -### prompt for language if not already selected ### +## prompt for language if not already selected ## language=$(grep 'LANG=' /root/.codecheck | cut -d '=' -f 2) if [ "${language// /}" == '_UNDEFINED_' ] -then language=$(Prompt "$LANG_TITLE" "$LANG_PROMPT" $DEFAULT_LANG "${LANGUAGES[@]}") - [ "${language}" == "" ] && language=$DEFAULT_LANG +then language=$(Prompt "$LANG_TITLE" "$LANG_PROMPT" $LANG_DEFAULT "${LANGUAGES[@]}") + [ "${language}" == "" ] && language=$LANG_DEFAULT logger "$0: selected language='$language'" # prepare locale @@ -164,12 +167,12 @@ then language=$(Prompt "$LANG_TITLE" "$LANG_PROMPT" $DEFAULT_LANG "${LANGUAGES[@ for installer_dir in ${INSTALLER_DIRS[@]} do case ${language} in 'eo') echo "${ESPERANTO_LANG_PACKS[@]}" >> ${installer_dir}/packages ;; - 'es') echo "${SPANISH_LANG_PACKS[@]}" >> ${installer_dir}/packages ;; 'fr') echo "${FRENCH_LANG_PACKS[@]}" >> ${installer_dir}/packages ;; 'gl') echo "${GALEGO_LANG_PACKS[@]}" >> ${installer_dir}/packages ;; 'it') echo "${ITALIAN_LANG_PACKS[@]}" >> ${installer_dir}/packages ;; 'pl') echo "${POLISH_LANG_PACKS[@]}" >> ${installer_dir}/packages ;; 'pt') echo "${PORTUGUESE_LANG_PACKS[@]}" >> ${installer_dir}/packages ;; + 'es') echo "${SPANISH_LANG_PACKS[@]}" >> ${installer_dir}/packages ;; esac done @@ -178,12 +181,12 @@ then language=$(Prompt "$LANG_TITLE" "$LANG_PROMPT" $DEFAULT_LANG "${LANGUAGES[@ fi -### prompt for X11 keymap if not already selected ### +## prompt for X11 keymap if not already selected ## keymap=$(grep 'XKBMAP=' /root/.codecheck | cut -d '=' -f 2) if [ "${keymap// /}" == '_UNDEFINED_' ] -then keymap=$(Prompt "$KEYMAP_TITLE" "$KEYMAP_PROMPT" $DEFAULT_KEYMAP "${KEYMAPS[@]}") - [ "${keymap}" == "" ] && keymap=$DEFAULT_KEYMAP +then keymap=$(Prompt "$KEYMAP_TITLE" "$KEYMAP_PROMPT" $KEYMAP_DEFAULT "${KEYMAPS[@]}") + [ "${keymap}" == "" ] && keymap=$KEYMAP_DEFAULT logger "$0: selected keymap='$keymap'" # set keymap diff --git a/configs/profile/root-image/root/customize_root_image-constants.inc b/configs/profile/root-image/root/customize_root_image-constants.inc index a3c992e..69d60a7 100644 --- a/configs/profile/root-image/root/customize_root_image-constants.inc +++ b/configs/profile/root-image/root/customize_root_image-constants.inc @@ -1,7 +1,8 @@ # environment vars from build.sh: # ISO_TITLE # ISO_INIT -# ISO_GUI +# ISO_WMDE +# ISO_ARCH # ENABLE_OFFLINE_INSTALL # ENABLE_TTS_BRLTTY @@ -50,10 +51,10 @@ readonly SYSTEMD_SERVICES_ACC="bluetooth.service \ livecd-alsa-unmuter.service " readonly SYSTEMD_SERVICES_GUI="NetworkManager.service" readonly OPENRC_SERVICES="${OPENRC_SERVICES_ALL} \ - $([[ "${ISO_GUI}" != 'cli' ]] && echo " ${OPENRC_SERVICES_GUI}")" -readonly SYSTEMD_SERVICES="${SYSTEMD_SERVICES_ALL} \ - $([[ "${ISO_GUI}" != 'cli' ]] && echo " ${SYSTEMD_SERVICES_GUI}") \ - $([[ "${ENABLE_TTS_BRLTTY}" == 'yes' ]] && echo " ${SYSTEMD_SERVICES_ACC}")" + $([[ "${ISO_WMDE}" != 'cli' ]] && echo " ${OPENRC_SERVICES_GUI}")" +readonly SYSTEMD_SERVICES="${SYSTEMD_SERVICES_ALL} \ + $([[ "${ISO_WMDE}" != 'cli' ]] && echo " ${SYSTEMD_SERVICES_GUI}") \ + $([[ "${ENABLE_TTS_BRLTTY}" == 'yes' ]] && echo " ${SYSTEMD_SERVICES_ACC}") " ## system defaults and root user ## @@ -81,14 +82,18 @@ readonly OPENRC_USER_GROUPS="disk,sys" [[ "${ISO_INIT}" == 'openrc' ]] && readonly LIVE_USER_GROUPS="${DEFAULT_USER_GROUPS},${OPENRC_USER_GROUPS}" || readonly LIVE_USER_GROUPS="${DEFAULT_USER_GROUPS}" -readonly TITLE_REGEX="^(.+) - (.+) (.+)$" +readonly TITLE_REGEX="^(.+) - (.+ Edition) (.+)$" readonly TITLE_ERROR_MSG="malformed ISO title:\n\t'${ISO_TITLE}'" ! [[ "${ISO_TITLE}" =~ ${TITLE_REGEX} ]] && echo -e "${TITLE_ERROR_MSG}" && exit 1 -readonly OS_PRETTY_NAME="${BASH_REMATCH[ 1]}" -readonly OS_VERSION="${BASH_REMATCH[ 3]}" +readonly PRETTY_NAME="${BASH_REMATCH[ 1]}" +readonly EDITION="${BASH_REMATCH[ 2]}" +readonly VERSION=${BASH_REMATCH[ 3]} +readonly RELEASE_ID=${ISO_ARCH}-${ISO_INIT}-${ISO_WMDE} +readonly OS_PRETTY_NAME="${PRETTY_NAME}" +readonly OS_VERSION=${VERSION} readonly OS_VERSION_ID="$(tr '.' '-' <<<${OS_VERSION})" -readonly OS_VARIANT="${BASH_REMATCH[ 2]} - (${INSTALL_TYPE})" -readonly OS_VARIANT_ID="${ISO_INIT}-${ISO_GUI}-${INSTALL_TYPE,,}" +readonly OS_VARIANT="${ISO_ARCH} ${EDITION} - (${INSTALL_TYPE})" +readonly OS_VARIANT_ID=${RELEASE_ID} LOG_CONFIG() { printf "\033[01;34mconfiguring: %s\033[00m\n" "$(echo -e $*)" ; } diff --git a/configs/profile/root-image/root/customize_root_image.sh b/configs/profile/root-image/root/customize_root_image.sh index f82fe5f..92e4617 100755 --- a/configs/profile/root-image/root/customize_root_image.sh +++ b/configs/profile/root-image/root/customize_root_image.sh @@ -24,10 +24,6 @@ LOG_CONFIG "pacman" [[ "${ISO_INIT}" == 'openrc' ]] && sed -i "$NONSYSTEMD_REGEX" /etc/pacman-online.conf [[ "${INSTALL_TYPE}" == 'Complete' ]] && cp /etc/pacman-offline.conf /etc/pacman.conf || \ cp /etc/pacman-online.conf /etc/pacman.conf -# FIXME: https://labs.parabola.nu/issues/2576 -# this LOC can be removed eventually after the new 'base' meta-package is stabilized -pacman -R $(pacman -Qq | grep ^systemd-) - LOG_CONFIG "services" @@ -70,45 +66,50 @@ sed -i "s|_EDITION_TITLE_|${ISO_TITLE}|" /etc/motd sed -i "s|_NETWORK_MOTD_MSG_|${NETWORK_MOTD_MSG}|" /etc/motd sed -i "s|_ENABLE_TTS_BRLTTY_|${ENABLE_TTS_BRLTTY}|" /etc/skel/.bash_profile -if [[ "${ISO_GUI}" == 'cli' ]] -then # configure CLI login session - cp ${ROOT_SKEL_FILES} /root/ - sed -i "s|_DESKTOP_SESSION_||" /root/.bash_profile - -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 "${LIVE_USER_GROUPS}" -s ${DEFAULT_SHELL} ${LIVE_USER} - - # configure auto-login - if [[ "${ISO_INIT}" == 'openrc' ]] - then sed -i "s|--autologin root|--autologin ${LIVE_USER}|" /etc/conf.d/agetty.tty1 - - elif [[ "${ISO_INIT}" == 'systemd' ]] - then sed -i "s|--autologin root|--autologin ${LIVE_USER}|" /etc/systemd/system/getty@tty1.service.d/autologin.conf - fi - - # configure welcome news alert - sed -i "s|_EDITION_TITLE_|${OS_PRETTY_NAME}| ; \ - s|,Don't show this again:0|| ; \ - s|620x460|620x520| " /usr/bin/autostart.sh - - # configure desktop environment - sed -i "s|/issue-tracker/|/isos/|" /home/${LIVE_USER}/Desktop/bug-tracker.desktop - if [[ "${ISO_GUI}" == 'lxde' ]] - then rm -f /etc/xdg/autostart/octopi-notifier.desktop 2> /dev/null # FIXME: issue #1850 - for desktop_file in parabola-installer.desktop parabola-irc.desktop bug-tracker.desktop - do sleep 2 ; touch /home/${LIVE_USER}/Desktop/${desktop_file} ; # sort - done - sed -i "s|_DESKTOP_SESSION_|LXDE|" /home/${LIVE_USER}/.bash_profile - sed -i "s|_DESKTOP_SESSION_|LXDE|" /home/${LIVE_USER}/.dmrc - - elif [[ "${ISO_GUI}" == 'mate' ]] - then sed -i "s|_DESKTOP_SESSION_|mate|" /home/${LIVE_USER}/.bash_profile - sed -i "s|_DESKTOP_SESSION_|mate|" /home/${LIVE_USER}/.dmrc - - else echo "invalid \$ISO_GUI for _DESKTOP_SESSION_ '${ISO_GUI}'" - exit 1 - fi -fi +case "${ISO_WMDE}" in +'cli' ) # configure CLI login session + cp ${ROOT_SKEL_FILES} /root/ + sed -i "s|_DESKTOP_SESSION_||" /root/.bash_profile + ;; + +* ) # 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 "${LIVE_USER_GROUPS}" -s ${DEFAULT_SHELL} ${LIVE_USER} + + # configure auto-login + case "${ISO_INIT}" in + 'openrc' ) sed -i "s|--autologin root|--autologin ${LIVE_USER}|" /etc/conf.d/agetty.tty1 ;; + 'systemd' ) sed -i "s|--autologin root|--autologin ${LIVE_USER}|" /etc/systemd/system/getty@tty1.service.d/autologin.conf ;; + esac + + # configure desktop environment + sed -i "s|/issue-tracker/|/isos/|" /home/${LIVE_USER}/Desktop/bug-tracker.desktop + case "${ISO_WMDE}" in + 'lxde' ) + rm -f /etc/xdg/autostart/octopi-notifier.desktop 2> /dev/null # FIXME: issue #1850 + for desktop_file in parabola-installer.desktop parabola-irc.desktop bug-tracker.desktop + do sleep 2 ; touch /home/${LIVE_USER}/Desktop/${desktop_file} ; # sort + done + sed -i "s|_DESKTOP_SESSION_|LXDE|" /home/${LIVE_USER}/.bash_profile + sed -i "s|_DESKTOP_SESSION_|LXDE|" /home/${LIVE_USER}/.dmrc + ;; + + 'mate' ) + sed -i "s|_DESKTOP_SESSION_|mate|" /home/${LIVE_USER}/.bash_profile + sed -i "s|_DESKTOP_SESSION_|mate|" /home/${LIVE_USER}/.dmrc + ;; + + * ) + echo "invalid \$ISO_WMDE for _DESKTOP_SESSION_ '${ISO_WMDE}'" + exit 1 + ;; + esac + + # configure welcome news alert + sed -i "s|_EDITION_TITLE_|${OS_PRETTY_NAME}| ; \ + s|,Don't show this again:0|| ; \ + s|620x460|620x520| " /usr/bin/autostart.sh + ;; +esac diff --git a/parabolaiso/mkmetadata b/parabolaiso/mkmetadata index 263f63b..01ab721 100755 --- a/parabolaiso/mkmetadata +++ b/parabolaiso/mkmetadata @@ -2,10 +2,10 @@ readonly OUT_DIR=$1 readonly IMG_NAME=$2 -readonly PKGLIST="$(readlink -f $3 2> /dev/null)" +readonly PKGLIST="$( readlink -f $3 2> /dev/null)" readonly THIS_DIR="$(readlink -f "$(dirname $0)")" -# if an optional .torrent file is desired, see ./TORRENT_METADATA.sample +# if a .torrent file is desired, see ./TORRENT_METADATA.sample [[ -f "$THIS_DIR/TORRENT_METADATA" ]] && source "$THIS_DIR/TORRENT_METADATA" which mktorrent &> /dev/null && readonly HAS_MKTORRENT=1 || readonly HAS_MKTORRENT=0 @@ -13,39 +13,36 @@ which rhash &> /dev/null && readonly HAS_RHASH=1 || readonly HAS_RHASH=0 [[ -n "${TORRENT_ANNOUNCE_URL}" ]] && readonly SHOULD_MKTORRENT=${HAS_MKTORRENT} || \ readonly SHOULD_MKTORRENT=0 -[[ -n "${ISOS_URL}" ]] && readonly PUBLIC_URL="${ISOS_URL}/$(basename ${OUT_DIR})" -[[ -n "${ISOS_URL}" ]] && readonly SIG_URL="${PUBLIC_URL}/${IMG_NAME}.sig" -[[ -n "${ISOS_URL}" ]] && readonly PUBLISH_MSG="The directory: '${OUT_DIR}' should be copied to the repo server entirely, preserving the directory name; such that it is accessible via the URL:\n\t${PUBLIC_URL}/\nThe GPG signature of the ISO should be added to that directory; such that it is accessible at the URL:\n\t${SIG_URL}" +[[ -n "${ISOS_URL}" ]] && readonly IMG_URL="${ISOS_URL}/$(basename ${OUT_DIR})/${IMG_NAME}" +[[ -n "${ISOS_URL}" ]] && readonly PUBLISH_MSG="The directory: '${OUT_DIR}' should be copied to the repo server entirely, preserving the directory name; such that it is accessible via the URL:\n\t${IMG_URL}/\nThe GPG signature of the ISO should be added to that directory; such that it is accessible at the URL:\n\t${IMG_URL}.sig" readonly ISO_HOST_PATH=$(echo "$(basename ${OUT_DIR})/${IMG_NAME}" | sed 's|\s|%20|') readonly WEBSEEDS_CSV=$(echo ${TORRENT_WEBSEED_URLS} | sed -E "s|([^ ]+)|\1${ISO_HOST_PATH}|g" | tr ' ' ',') +readonly RELEASE_DEV_CMD='s|[^-]*-\(.*\)-\(.*\)-\(.*\)-\(.*\)-\(.*\)\.iso|\L\1 \u\2/\U\3 \4 \L\5|' readonly PKGLIST_SUCCESS_MSG="\t=> copied $(basename ${PKGLIST} 2> /dev/null)" -readonly SHA512SUMS_SUCCESS_MSG="\t=> SHA512SUMS appended" -readonly WHIIRLPOOLSUMS_SUCCESS_MSG="\t=> WHIRLPOOLSUMS appended" -readonly MAGNET_SUCCESS_MSG="\t=> ${IMG_NAME}.magnet saved" -readonly TORRENT_SUCCESS_MSG="\t=> ${IMG_NAME}.torrent saved" -readonly RHASH_NOT_FOUND_MSG="[mkmetadata]: 'rhash' is not installed - metadata files will not be created" +readonly SHA512SUMS_SUCCESS_MSG="\t=> SHA512SUMS $( [[ -f "${OUT_DIR}/SHA512SUMS" ]] && echo 'appended' || echo 'generated' )" +readonly MAGNET_SUCCESS_MSG="\t=> ${IMG_NAME}.magnet generated" +readonly TORRENT_SUCCESS_MSG="\t=> ${IMG_NAME}.torrent generated" +readonly RHASH_NOT_FOUND_MSG="[mkmetadata]: 'rhash' is not installed - metadata files will not be generated" readonly MAKE_METADATA_MSG="[mkmetadata]: preparing metadata" MakeMetadata() { # copy package lists and generate checksums and optional torrent file - (( ${SHOULD_MKTORRENT} )) && MakeTorrent && echo -e ${TORRENT_SUCCESS_MSG} - [[ -f "${PKGLIST}" ]] && cp ${PKGLIST} . && echo -e ${PKGLIST_SUCCESS_MSG} - rhash --sha512 "${IMG_NAME}" >> SHA512SUMS && echo -e ${SHA512SUMS_SUCCESS_MSG} - rhash --whirlpool "${IMG_NAME}" >> WHIRLPOOLSUMS && echo -e ${WHIIRLPOOLSUMS_SUCCESS_MSG} - rhash --magnet "${IMG_NAME}" > "${IMG_NAME}.magnet" && echo -e ${MAGNET_SUCCESS_MSG} + (( ${SHOULD_MKTORRENT} )) && MakeTorrent && echo -e ${TORRENT_SUCCESS_MSG} + [[ -f "${PKGLIST}" ]] && cp ${PKGLIST} . && echo -e ${PKGLIST_SUCCESS_MSG} + rhash --sha512 "${IMG_NAME}" >> SHA512SUMS && echo -e ${SHA512SUMS_SUCCESS_MSG} + rhash --magnet "${IMG_NAME}" > "${IMG_NAME}.magnet" && echo -e ${MAGNET_SUCCESS_MSG} - sort SHA512SUMS --key=2 --output=SHA512SUMS - sort WHIRLPOOLSUMS --key=2 --output=WHIRLPOOLSUMS + sort SHA512SUMS --key=2 --output=SHA512SUMS } MakeTorrent() { - local release=$( sed 's|[^-]*-\(.*\)-\(.*\)-\(.*\)-\(.*\)-\(.*\)\.iso|\u\1/\U\2 \L\3 \u\4 \5|' <<<${IMG_NAME}) - local sig="$( [[ -n "${ISOS_URL}" ]] && echo "GPG signature: '${SIG_URL}")" + local release=$( sed "${RELEASE_DEV_CMD}" <<<${IMG_NAME}) + local sig="$( [[ -n "${ISOS_URL}" ]] && echo "GPG signature: '${IMG_URL}.sig")" local comment="$(sed 's|_RELEASE_|'"${release}"'|' <<<${TORRENT_COMMENT})\n${sig}" # generate torrent file -- cgit v1.2.2