From 4ba74645423192072cb2c603a261d89081f3a4e7 Mon Sep 17 00:00:00 2001 From: bill-auger Date: Mon, 16 Oct 2017 21:06:07 -0400 Subject: add options to specify iso edition and pacman.conf --- configs/profile/build.sh | 37 ++++++++++---- configs/profile/packages.both | 58 ---------------------- configs/profile/packages.i686 | 0 configs/profile/packages.x86_64 | 1 - configs/profile/packages/packages-cli.both | 2 + configs/profile/packages/packages-systemd.both | 62 ++++++++++++++++++++++++ configs/profile/packages/packages-systemd.i686 | 3 ++ configs/profile/packages/packages-systemd.x86_64 | 5 ++ 8 files changed, 100 insertions(+), 68 deletions(-) delete mode 100644 configs/profile/packages.both delete mode 100644 configs/profile/packages.i686 delete mode 100644 configs/profile/packages.x86_64 create mode 100644 configs/profile/packages/packages-cli.both create mode 100644 configs/profile/packages/packages-systemd.both create mode 100644 configs/profile/packages/packages-systemd.i686 create mode 100644 configs/profile/packages/packages-systemd.x86_64 (limited to 'configs/profile') diff --git a/configs/profile/build.sh b/configs/profile/build.sh index fe2bdfb..830a760 100755 --- a/configs/profile/build.sh +++ b/configs/profile/build.sh @@ -3,8 +3,9 @@ set -e -u # edition-specific strings -iso_edition="SystemD/CLI" -iso_title="Parabola GNU/Linux-libre Live - ${iso_edition} Edition" # $iso_version appended +iso_edition="SystemD/CLI" # default init/wm pair +iso_title="Parabola GNU/Linux-libre Live" # $iso_edition and $iso_version appended +base_group='base' # default base package group # CLI option defaults archs='i686 x86_64' @@ -25,6 +26,7 @@ chroot_customization_script=/root/customize_root_image.sh data_dir=/usr/share/parabolaiso/data releng_dir=$(readlink -f ${0%/*}) initcpio_dir=${releng_dir}/../../parabolaiso/initcpio +packages_dir=${releng_dir}/packages [ "`which mkparabolaiso 2> /dev/null`" ] || export PATH=$PATH:"${releng_dir}/../../parabolaiso" @@ -33,6 +35,8 @@ _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 " Default: ${iso_arch}" echo " -V Set the iso version in the filename" @@ -43,6 +47,8 @@ _usage () echo " Default: ${iso_dirname}" echo " -O Enable offline install." echo " Default: '${enable_offline_install}'" + echo " -C Specify the pacman.conf file used for chroot install." + echo " Default: '${pacman_conf}'" echo " -w Set the working directory" echo " Default: ${work_dir}" echo " -o Set the output directory" @@ -68,13 +74,14 @@ make_pacman_conf() { # Base installation, plus needed packages (root-image) make_basefs() { - setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir}/${arch} -C ${pacman_conf} -D ${iso_dirname} init + setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir}/${arch} -C ${pacman_conf} -D ${iso_dirname} -B ${base_group} init setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir}/${arch} -C ${pacman_conf} -D ${iso_dirname} -p "memtest86+ mkinitcpio-nfs-utils nbd" install } # Additional packages (root-image) make_packages() { - setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir}/${arch} -C ${pacman_conf} -D ${iso_dirname} -p "$(grep -h -v ^# ${releng_dir}/packages.{both,${arch}})" install + packages=$(grep -h -v ^# ${packages_dir}/packages-{${iso_init},${iso_gui},${iso_wm}}.{both,${arch}} 2> /dev/null || true) + setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir}/${arch} -C ${pacman_conf} -D ${iso_dirname} -p "${packages}" install # create live environment local repo if [[ "$enable_offline_install" == 'true' ]]; then @@ -105,6 +112,8 @@ make_customize_root_image() { echo "Customizing root image" iso_title="${iso_title}" \ + iso_init="${iso_init}" \ + iso_wm="${iso_wm}" \ enable_offline_install="${enable_offline_install}" \ setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir}/${arch} \ -C ${pacman_conf} \ @@ -249,8 +258,6 @@ 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_filename} } @@ -259,13 +266,15 @@ make_iso() { ## prepare state ## # set CLI options -while getopts 'T:V:L:D:Ow:o:vh' arg; do +while getopts 'E:T:V:L:D:OC:w:o:vh' arg; do case "${arg}" in + E) iso_edition="${OPTARG}" ;; T) target="${OPTARG}" ;; V) iso_version="${OPTARG}" ;; L) iso_label="${OPTARG}" ;; D) iso_dirname="${OPTARG}" ;; O) enable_offline_install='true' ;; + C) pacman_conf="${OPTARG}" ;; w) work_dir="${OPTARG}" ;; o) out_dir="${OPTARG}" ;; v) verbose="-v" ;; @@ -295,9 +304,13 @@ else iso_arch="${iso_arch}-netinstall" launch_msg="${launch_msg} (net-install only)" fi -[ "${archs}" == 'i686' ] && arch='i686' || arch='x86_64' +iso_title="${iso_title}${iso_edition} Edition ${iso_version}" iso_filename="parabola-${iso_edition}-${iso_arch}-${iso_version}.iso" -iso_title="${iso_title} ${iso_version}" +iso_filename=$(echo ${iso_filename} | tr '[:upper:]/' '[:lower:]-') +iso_init=$(echo ${iso_edition} | cut -d '/' -f 1 | tr '[:upper:]' '[:lower:]') +iso_wm=$( echo ${iso_edition} | cut -d '/' -f 2 | tr '[:upper:]' '[:lower:]') +[[ "${iso_wm}" == 'cli' ]] && iso_gui='' || iso_gui='gui' +[[ "${archs}" == 'i686' ]] && arch='i686' || arch='x86_64' ## sanity checks ## @@ -305,6 +318,9 @@ iso_title="${iso_title} ${iso_version}" # sanitize paths iso_label=${iso_label// /} iso_dirname=${iso_dirname// /} +iso_filename=${iso_filename// /} +iso_init=${iso_init// /} +iso_wm=${iso_wm// /} work_dir=${work_dir// /} out_dir=${out_dir// /} pacman_conf=${pacman_conf// /} @@ -322,6 +338,9 @@ elif ! pacman --version | grep libalpm > /dev/null; then elif ! pacman -Qi parabolaiso-data > /dev/null; then echo "This script needs the 'parabolaiso-data' package to be installed." exit 1 +elif ! ls ${packages_dir}/packages-{${iso_init},${iso_wm}}.both > /dev/null; then + echo "Invalid init/wm combination: '${iso_edition}'." + exit 1 fi # detect previously completed build diff --git a/configs/profile/packages.both b/configs/profile/packages.both deleted file mode 100644 index efb0573..0000000 --- a/configs/profile/packages.both +++ /dev/null @@ -1,58 +0,0 @@ -arch-install-scripts -btrfs-progs -crda -darkhttpd -ddrescue -dhclient -dialog -dmraid -dnsmasq -dnsutils -dosfstools -elinks -ethtool -f2fs-tools -fsarchiver -gnu-netcat -gpm -gptfdisk -grml-zsh-config -grub -haveged -hdparm -irssi -lftp -linux-atm -lynx -mc -mtools -nfs-utils -nilfs-utils -nmap -ntfs-3g -ntp -openconnect -openssh -openvpn -partclone -parted -partimage -pptpclient -ppp -rfkill -rp-pppoe -rsync -smartmontools -sudo -tcpdump -testdisk -usb_modeswitch -vpnc -wget -wireless_tools -wpa_actiond -wpa_supplicant -zile -wvdial -xl2tpd -zsh diff --git a/configs/profile/packages.i686 b/configs/profile/packages.i686 deleted file mode 100644 index e69de29..0000000 diff --git a/configs/profile/packages.x86_64 b/configs/profile/packages.x86_64 deleted file mode 100644 index 804cc93..0000000 --- a/configs/profile/packages.x86_64 +++ /dev/null @@ -1 +0,0 @@ -refind-efi diff --git a/configs/profile/packages/packages-cli.both b/configs/profile/packages/packages-cli.both new file mode 100644 index 0000000..f3fc35e --- /dev/null +++ b/configs/profile/packages/packages-cli.both @@ -0,0 +1,2 @@ +# this file specifies the packages that are to be installed in all CLI live environments +# regardless of the init system and graphical environment diff --git a/configs/profile/packages/packages-systemd.both b/configs/profile/packages/packages-systemd.both new file mode 100644 index 0000000..8c600a3 --- /dev/null +++ b/configs/profile/packages/packages-systemd.both @@ -0,0 +1,62 @@ +# this file specifies the packages that are to be installed +# in all SystemD live environments, regardless of the graphical environment +# these packages are not to be installed with other init systems + +arch-install-scripts +btrfs-progs +crda +darkhttpd +ddrescue +dhclient +dialog +dmraid +dnsmasq +dnsutils +dosfstools +elinks +ethtool +f2fs-tools +fsarchiver +gnu-netcat +gpm +gptfdisk +grml-zsh-config +grub +haveged +hdparm +irssi +lftp +linux-atm +lynx +mc +mtools +nfs-utils +nilfs-utils +nmap +ntfs-3g +ntp +openconnect +openssh +openvpn +partclone +parted +partimage +pptpclient +ppp +rfkill +rp-pppoe +rsync +smartmontools +sudo +tcpdump +testdisk +usb_modeswitch +vpnc +wget +wireless_tools +wpa_actiond +wpa_supplicant +zile +wvdial +xl2tpd +zsh diff --git a/configs/profile/packages/packages-systemd.i686 b/configs/profile/packages/packages-systemd.i686 new file mode 100644 index 0000000..a3bd1cd --- /dev/null +++ b/configs/profile/packages/packages-systemd.i686 @@ -0,0 +1,3 @@ +# this file specifies the packages that are to be installed +# only in the SystemD i686 live environment +# these packages are not to be installed in any other targets diff --git a/configs/profile/packages/packages-systemd.x86_64 b/configs/profile/packages/packages-systemd.x86_64 new file mode 100644 index 0000000..11db863 --- /dev/null +++ b/configs/profile/packages/packages-systemd.x86_64 @@ -0,0 +1,5 @@ +# this file specifies the packages that are to be installed +# only in the SystemD x86_64 live environment +# these packages are not to be installed in any other targets + +refind-efi -- cgit v1.2.2