diff options
Diffstat (limited to 'configs/profile/build.sh')
-rwxr-xr-x | configs/profile/build.sh | 93 |
1 files changed, 53 insertions, 40 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 <iso_edition> Release edition (init/WM pair e.g. 'SystemD/CLI')" - echo " Default: ${iso_edition}" - echo " -T <iso_arch> Target architecture (one of 'i686', 'x86_64', or 'dual')" + echo " -A <iso_arch> Target architecture - one of: [ 'dual' , 'i686' , 'x86_64' ]" echo " Default: ${iso_arch}" - echo " -V <iso_version> Set the iso version in the filename" + echo " -I <iso_init> Init system - one of: [ 'openrc' , 'systemd' ]" + echo " Default: ${iso_init}" + echo " -W <iso_wmde> 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 <iso_version> Release version string" echo " Default: ${iso_version}" echo " -L <iso_label> Set the iso volume label" echo " Default: ${iso_label}" echo " -D <iso_dirname> 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 <work_dir> 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 |