From 20c147f1c67dad50e3618bb9b2826860cf5bb06d Mon Sep 17 00:00:00 2001 From: bill-auger Date: Mon, 16 Oct 2017 20:50:25 -0400 Subject: add iso edition to filename, boot menu title, and motd --- configs/profile/build.sh | 57 ++++++++++++++-------- configs/profile/root-image/etc/motd | 7 ++- .../root-image/root/customize_root_image.sh | 2 +- configs/profile/syslinux/parabolaiso_head.cfg | 2 +- 4 files changed, 41 insertions(+), 27 deletions(-) diff --git a/configs/profile/build.sh b/configs/profile/build.sh index b18ea6e..b882d39 100755 --- a/configs/profile/build.sh +++ b/configs/profile/build.sh @@ -2,18 +2,25 @@ set -e -u -iso_name=parabola -iso_label="PARA_$(date +%Y%m)" -iso_version=$(date +%Y.%m.%d) -iso_dirname=parabola -work_dir=work -out_dir=out -data_dir=/usr/share/parabolaiso/data +# edition-specific strings +iso_edition="SystemD/CLI" +iso_title="Parabola GNU/Linux-libre Live - ${iso_edition} Edition" # $iso_version appended +# CLI option defaults +iso_version=$(date +%Y.%m.%d) +iso_label="PARA_$(date +%Y%m)" +iso_dirname='parabola' +work_dir=./work +out_dir=./out arch=$(uname -m) -verbose="" +target='' +verbose='' efi_img_kbytes=40000 pacman_conf=${work_dir}/pacman.conf +chroot_customization_script=/root/customize_root_image.sh + +# environment +data_dir=/usr/share/parabolaiso/data releng_dir=$(readlink -f ${0%/*}) initcpio_dir=${releng_dir}/../../parabolaiso/initcpio [ "`which mkparabolaiso 2> /dev/null`" ] || export PATH=$PATH:"${releng_dir}/../../parabolaiso" @@ -24,13 +31,11 @@ _usage () echo "usage ${0} [options]" echo echo " General options:" - echo " -N Set an iso filename (prefix)" - echo " Default: ${iso_name}" - echo " -V Set an iso version (in filename)" + echo " -V Set the iso version in the filename" echo " Default: ${iso_version}" - echo " -L Set an iso label (disk label)" + echo " -L Set the iso volume label" echo " Default: ${iso_label}" - echo " -D Set an iso_dirname (directory inside iso)" + echo " -D Set the name of the directory inside the ISO" echo " Default: ${iso_dirname}" echo " -w Set the working directory" echo " Default: ${work_dir}" @@ -41,6 +46,7 @@ _usage () exit ${1} } + # Helper function to run make_*() only one time per architecture. run_once() { if [[ ! -e ${work_dir}/build.${1}_${arch} ]]; then @@ -84,11 +90,13 @@ make_setup_mkinitcpio() { make_customize_root_image() { cp -af ${releng_dir}/root-image ${work_dir}/${arch} - iso_version="${iso_version}" setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir}/${arch} \ - -C ${pacman_conf} \ - -D ${iso_dirname} \ - -r '/root/customize_root_image.sh' run - rm ${work_dir}/${arch}/root-image/root/customize_root_image.sh + echo "Customizing root image" + iso_title="${iso_title}" \ + setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir}/${arch} \ + -C ${pacman_conf} \ + -D ${iso_dirname} \ + -r ${chroot_customization_script} run + rm ${work_dir}/${arch}/root-image${chroot_customization_script} } # Prepare kernel/initramfs ${iso_dirname}/boot/ @@ -118,6 +126,9 @@ make_syslinux() { mkdir -p ${work_dir}/iso/${iso_dirname}/boot/syslinux/hdt gzip -c -9 ${work_dir}/${arch}/root-image/usr/share/hwdata/pci.ids > ${work_dir}/iso/${iso_dirname}/boot/syslinux/hdt/pciids.gz gzip -c -9 ${work_dir}/${arch}/root-image/usr/lib/modules/*-gnu-*/modules.alias > ${work_dir}/iso/${iso_dirname}/boot/syslinux/hdt/modalias.gz + + # inject edition title + sed -i "s|_EDITION_TITLE_|${iso_title}|" ${work_dir}/iso/${iso_dirname}/boot/syslinux/parabolaiso_head.cfg } # Prepare /isolinux @@ -214,8 +225,10 @@ make_prepare() { # Build ISO make_iso() { + iso_filename=$(echo $iso_filename | tr '[:upper:]/' '[:lower:]-' | sed 's/\s//g') + mkparabolaiso ${verbose} -w ${work_dir} -D ${iso_dirname} checksum - mkparabolaiso ${verbose} -w ${work_dir} -D ${iso_dirname} -L ${iso_label} -o ${out_dir} iso ${iso_name} + mkparabolaiso ${verbose} -w ${work_dir} -D ${iso_dirname} -L ${iso_label} -o ${out_dir} iso ${iso_filename} } if [[ ${EUID} -ne 0 ]]; then @@ -228,9 +241,8 @@ if [[ ${arch} != x86_64 ]]; then _usage 1 fi -while getopts 'N:V:L:D:w:o:vh' arg; do +while getopts 'V:L:D:w:o:vh' arg; do case "${arg}" in - N) iso_name="${OPTARG}" ;; V) iso_version="${OPTARG}" ;; L) iso_label="${OPTARG}" ;; D) iso_dirname="${OPTARG}" ;; @@ -245,11 +257,14 @@ while getopts 'N:V:L:D:w:o:vh' arg; do esac done + iso_label=${iso_label// /} iso_dirname=${iso_dirname// /} work_dir=${work_dir// /} out_dir=${out_dir// /} pacman_conf=${pacman_conf// /} +iso_title="${iso_title} ${iso_version}" +iso_filename="parabola-${iso_edition}-${iso_type}-${iso_version}.iso" chown -R 0:0 "${releng_dir}/root-image/" diff --git a/configs/profile/root-image/etc/motd b/configs/profile/root-image/etc/motd index a126999..a2bf698 100644 --- a/configs/profile/root-image/etc/motd +++ b/configs/profile/root-image/etc/motd @@ -1,14 +1,13 @@ =============================================================================== - Parabola live media _DATE_ + _EDITION_TITLE_ To install Parabola, the system must be connected to the internet. - For instructions, enter this command: - lynx network.html + For help establishing an internet connection, enter this command: +  lynx network.html  Press the function keys while holding Alt to switch virtual terminals. - This allows entering commands without closing lynx. ===============================================================================  diff --git a/configs/profile/root-image/root/customize_root_image.sh b/configs/profile/root-image/root/customize_root_image.sh index 2c677a6..de5481b 100755 --- a/configs/profile/root-image/root/customize_root_image.sh +++ b/configs/profile/root-image/root/customize_root_image.sh @@ -20,4 +20,4 @@ sed -i "s/#Server/Server/g" /etc/pacman.d/mirrorlist systemctl enable multi-user.target pacman-init.service choose-mirror.service -sed -i "s/_DATE_/${iso_version}/" /etc/motd +sed -i "s|_EDITION_TITLE_|${iso_title}|" /etc/motd diff --git a/configs/profile/syslinux/parabolaiso_head.cfg b/configs/profile/syslinux/parabolaiso_head.cfg index a245309..8267a7a 100644 --- a/configs/profile/syslinux/parabolaiso_head.cfg +++ b/configs/profile/syslinux/parabolaiso_head.cfg @@ -1,6 +1,6 @@ SERIAL 0 38400 UI boot/syslinux/vesamenu.c32 -MENU TITLE Parabola GNU/Linux-libre +MENU TITLE _EDITION_TITLE_ MENU BACKGROUND boot/syslinux/splash.png MENU WIDTH 78 -- cgit v1.2.2