summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigs/profile/build.sh74
-rw-r--r--configs/profile/packages/packages-all.all1
-rw-r--r--configs/profile/packages/packages-gui.all2
-rwxr-xr-xconfigs/profile/rebuild.sh35
-rw-r--r--configs/profile/root-image/etc/skel/Desktop/parabola-installer.desktop2
-rw-r--r--configs/profile/root-image/root/customize_root_image-constants.inc27
-rwxr-xr-xconfigs/profile/root-image/root/customize_root_image.sh5
-rwxr-xr-xparabolaiso/mkparabolaiso3
8 files changed, 90 insertions, 59 deletions
diff --git a/configs/profile/build.sh b/configs/profile/build.sh
index 27fea9f..efdadce 100755
--- a/configs/profile/build.sh
+++ b/configs/profile/build.sh
@@ -2,6 +2,12 @@
set -e -u
+# misc constants
+readonly EFI_IMG_KBYTES=40000
+readonly LOG_COLOR='\033[01;34m'
+readonly ERR_COLOR='\033[00;31m'
+readonly END_COLOR='\033[00m'
+
# editions
declare -ar VALID_INITS=('openrc' 'systemd')
declare -ar VALID_GUIS=('cli' 'lxde' 'mate')
@@ -17,14 +23,21 @@ iso_version=$(date +%Y.%m.%d)
iso_label="PARA_$(date +%Y%m)"
iso_dirname='parabola'
enable_offline_install='false'
-enable_tts_brltty='false'
offline_switch=''
-work_dir=./work/
-out_dir=./out/
+enable_tts_brltty='false'
+pacman_conf=${work_dir}/pacman.conf
+work_dir=./work
+out_dir=./out
target=''
verbose=''
-efi_img_kbytes=40000
-pacman_conf=${work_dir}/pacman.conf
+
+# computed params, per CLI args
+archs='' # deferred
+iso_filename='' # deferred
+iso_init='' # deferred
+iso_gui='' # deferred
+base_pkgs='' # deferred
+arch='' # deferred
# environment
data_dir=/usr/share/parabolaiso/data
@@ -64,9 +77,8 @@ _usage ()
exit ${1}
}
-LOG_STEP() { printf "\033[01;34m%s\033[00m\n" "$(echo -e $*)" ; }
-LOG_ERROR() { printf "\033[00;31m%s\033[00m\n" "$(echo -e $*)" ; }
-
+LOG_STEP() { printf "${LOG_COLOR}%s${END_COLOR}\n" "$(echo -e $*)" ; }
+LOG_ERROR() { printf "${ERR_COLOR}%s${END_COLOR}\n" "$(echo -e $*)" ; }
# Helper function to run make_*() only one time per architecture.
run_once() {
@@ -268,9 +280,9 @@ make_syslinux() {
make_isolinux() {
mkdir -p ${work_dir}/iso/isolinux
sed "s|%INSTALL_DIR%|${iso_dirname}|g" ${releng_dir}/isolinux/isolinux.cfg > ${work_dir}/iso/isolinux/isolinux.cfg
- cp ${work_dir}/${arch}/root-image/usr/lib/syslinux/bios/isolinux.bin ${work_dir}/iso/isolinux/
- cp ${work_dir}/${arch}/root-image/usr/lib/syslinux/bios/isohdpfx.bin ${work_dir}/iso/isolinux/
- cp ${work_dir}/${arch}/root-image/usr/lib/syslinux/bios/ldlinux.c32 ${work_dir}/iso/isolinux/
+ cp ${work_dir}/${arch}/root-image/usr/lib/syslinux/bios/isolinux.bin ${work_dir}/iso/isolinux/
+ cp ${work_dir}/${arch}/root-image/usr/lib/syslinux/bios/isohdpfx.bin ${work_dir}/iso/isolinux/
+ cp ${work_dir}/${arch}/root-image/usr/lib/syslinux/bios/ldlinux.c32 ${work_dir}/iso/isolinux/
}
# Prepare /EFI
@@ -281,7 +293,7 @@ make_efi() {
fi
mkdir -p ${work_dir}/iso/loader/entries
- cp ${releng_dir}/efiboot/loader/loader.conf ${work_dir}/iso/loader/
+ cp ${releng_dir}/efiboot/loader/loader.conf ${work_dir}/iso/loader/
cp ${releng_dir}/efiboot/loader/entries/uefi-shell-v2-x86_64.conf ${work_dir}/iso/loader/entries/
cp ${releng_dir}/efiboot/loader/entries/uefi-shell-v1-x86_64.conf ${work_dir}/iso/loader/entries/
@@ -303,7 +315,7 @@ make_efiboot() {
# create EFI image
mkdir -p ${work_dir}/iso/EFI/parabolaiso
- truncate -s ${efi_img_kbytes}K ${work_dir}/iso/EFI/parabolaiso/efiboot.img
+ truncate -s ${EFI_IMG_KBYTES}K ${work_dir}/iso/EFI/parabolaiso/efiboot.img
mkfs.vfat -n PARABOLAISO_EFI ${work_dir}/iso/EFI/parabolaiso/efiboot.img
mkdir -p ${work_dir}/efiboot
@@ -311,7 +323,7 @@ make_efiboot() {
mount ${work_dir}/iso/EFI/parabolaiso/efiboot.img ${work_dir}/efiboot
mkdir -p ${work_dir}/efiboot-staging/EFI/parabolaiso
- cp ${work_dir}/iso/${iso_dirname}/boot/x86_64/vmlinuz ${work_dir}/efiboot-staging/EFI/parabolaiso/vmlinuz.efi
+ cp ${work_dir}/iso/${iso_dirname}/boot/x86_64/vmlinuz ${work_dir}/efiboot-staging/EFI/parabolaiso/vmlinuz.efi
cp ${work_dir}/iso/${iso_dirname}/boot/x86_64/parabolaiso.img ${work_dir}/efiboot-staging/EFI/parabolaiso/parabolaiso.img
mkdir -p ${work_dir}/efiboot-staging/EFI/boot
@@ -320,10 +332,9 @@ make_efiboot() {
fi
mkdir -p ${work_dir}/efiboot-staging/loader/entries
- cp ${releng_dir}/efiboot/loader/loader.conf ${work_dir}/efiboot-staging/loader/
- cp ${releng_dir}/efiboot/loader/entries/uefi-shell-v2-x86_64.conf ${work_dir}/efiboot-staging/loader/entries/
- cp ${releng_dir}/efiboot/loader/entries/uefi-shell-v1-x86_64.conf ${work_dir}/efiboot-staging/loader/entries/
-
+ cp ${releng_dir}/efiboot/loader/loader.conf ${work_dir}/efiboot-staging/loader/
+ cp ${releng_dir}/efiboot/loader/entries/uefi-shell-v2-x86_64.conf ${work_dir}/efiboot-staging/loader/entries/
+ cp ${releng_dir}/efiboot/loader/entries/uefi-shell-v1-x86_64.conf ${work_dir}/efiboot-staging/loader/entries/
sed "s|%PARABOLAISO_LABEL%|${iso_label}|g;
s|%INSTALL_DIR%|${iso_dirname}|g" \
${releng_dir}/efiboot/loader/entries/parabolaiso-x86_64-cd.conf > ${work_dir}/efiboot-staging/loader/entries/parabolaiso-x86_64.conf
@@ -331,14 +342,14 @@ make_efiboot() {
cp ${work_dir}/iso/EFI/shellx64_v2.efi ${work_dir}/efiboot-staging/EFI/
cp ${work_dir}/iso/EFI/shellx64_v1.efi ${work_dir}/efiboot-staging/EFI/
- efi_kbytes=$(($(du -ks ${work_dir}/efiboot-staging | cut -f 1) + 32))
- if [[ ${efi_kbytes} -lt $((${efi_img_kbytes})) ]]; then
+ local efi_kbytes=$(($(du -ks ${work_dir}/efiboot-staging | cut -f 1) + 32))
+ if [[ ${efi_kbytes} -lt $(( ${EFI_IMG_KBYTES} )) ]]; then
echo "Populating EFI image (${efi_kbytes}KB)"
cp -rT ${work_dir}/efiboot-staging ${work_dir}/efiboot
rm -rf ${work_dir}/efiboot-staging
umount ${work_dir}/efiboot
else
- echo "Error: Not enough space on EFI image (${efi_img_kbytes}KB - need ${efi_kbytes}KB)"
+ echo "Error: Not enough space on EFI image (${EFI_IMG_KBYTES}KB - need ${efi_kbytes}KB)"
umount ${work_dir}/efiboot
exit 1
fi
@@ -352,9 +363,9 @@ make_aitab() {
# Build all filesystem images specified in aitab (.fs.sfs .sfs)
make_prepare() {
- cp -a -l -f ${work_dir}/${arch}/root-image ${work_dir}
- setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir} -D ${iso_dirname} -C ${pacman_conf} pkglist
- setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir} -D ${iso_dirname} -C ${pacman_conf} ${offline_switch} prepare
+ cp -a -l -f ${work_dir}/${arch}/root-image ${work_dir}/
+ setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir}/ -D ${iso_dirname} -C ${pacman_conf} pkglist
+ setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir}/ -D ${iso_dirname} -C ${pacman_conf} ${offline_switch} prepare
rm -rf ${work_dir}/root-image
# rm -rf ${work_dir}/${arch}/root-image (if low space, this helps)
@@ -362,8 +373,8 @@ make_prepare() {
# Build ISO
make_iso() {
- setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir} -D ${iso_dirname} checksum
- setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir} -D ${iso_dirname} -L ${iso_label} -o ${out_dir} iso ${iso_filename}
+ setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir}/ -D ${iso_dirname} checksum
+ setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir}/ -D ${iso_dirname} -L ${iso_label} -o ${out_dir}/ iso ${iso_filename}
}
@@ -411,10 +422,11 @@ 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_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:]' )
+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_init}" == 'openrc' ]] && base_group='base-openrc' || base_group='base'
[[ "${archs}" == 'i686' ]] && arch='i686' || arch='x86_64'
@@ -505,3 +517,5 @@ done
# build ISO
run_once make_iso
+
+LOG_STEP "done - ISO: '${iso_filename}' created successfully"
diff --git a/configs/profile/packages/packages-all.all b/configs/profile/packages/packages-all.all
index 6cbc0ad..c57c28e 100644
--- a/configs/profile/packages/packages-all.all
+++ b/configs/profile/packages/packages-all.all
@@ -18,7 +18,6 @@ elinks
ethtool
f2fs-tools
fsarchiver
-gnu-netcat
gptfdisk
grub
irssi
diff --git a/configs/profile/packages/packages-gui.all b/configs/profile/packages/packages-gui.all
index a4f3d6c..ff7c0e2 100644
--- a/configs/profile/packages/packages-gui.all
+++ b/configs/profile/packages/packages-gui.all
@@ -37,11 +37,11 @@ gnumeric
gparted
icedove
iceweasel
+jami
leafpad
octopi
pidgin
qtox
-ring
smplayer
diff --git a/configs/profile/rebuild.sh b/configs/profile/rebuild.sh
index f896460..29c47e1 100755
--- a/configs/profile/rebuild.sh
+++ b/configs/profile/rebuild.sh
@@ -1,21 +1,24 @@
#!/bin/bash
-readonly MODE='wipe' # total wipe of work dir optionally preserving package cache
-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 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 CACHE='' # net-install (default)
-# readonly CACHE='-O' # offline install
-readonly VERSION="`date +%Y.%m.%d`" # for ISO filename (default)
+## rebuild.sh options ##
+readonly PRESERVE_CACHE='false' # preserve package cache in 'wipe' mode
+readonly MODE='wipe' # total wipe of work dir, optionally preserving package cache
+# readonly MODE='rebuild' # full update rebuild preserving work dir
+# readonly MODE='tweak' # apply chroot customization tweaks only
+
+## build.sh options ##
+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 CACHE='' # net-install (default)
+# readonly CACHE='-O' # offline install
+readonly VERSION="$(date +%Y.%m)" # for ISO filename (default)
# readonly VERSION="`date +%Y.%m.%d-%H.%M`-alpha"
readonly OUT_DIR=./out/new/
diff --git a/configs/profile/root-image/etc/skel/Desktop/parabola-installer.desktop b/configs/profile/root-image/etc/skel/Desktop/parabola-installer.desktop
index a5d96b6..a46c6f1 100644
--- a/configs/profile/root-image/etc/skel/Desktop/parabola-installer.desktop
+++ b/configs/profile/root-image/etc/skel/Desktop/parabola-installer.desktop
@@ -9,7 +9,7 @@ Name[pt_BR]=Instalador do Parabola
GenericName=System Installer
Keywords=calamares;system;installer
TryExec=calamares
-Exec=sudo /usr/bin/calamares
+Exec=sudo /usr/bin/calamares -D 6
Comment=Distribution-independent installer framework - Parabola edition
Icon=calamares
Terminal=false
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 8d2902c..d24b3ed 100644
--- a/configs/profile/root-image/root/customize_root_image-constants.inc
+++ b/configs/profile/root-image/root/customize_root_image-constants.inc
@@ -6,7 +6,7 @@
# HAS_BRLTTY_TTS
-readonly NONSYSTEMD_REGEX='N ; s|^#\[nonsystemd\].*#Include|\[nonsystemd\]\nInclude|'
+/* timezone and locales */
readonly LOCALES="en_US\.UTF-8 \
eo \
@@ -17,6 +17,14 @@ readonly LOCALES="en_US\.UTF-8 \
pt_BR\.UTF-8 \
pl_PL\.UTF-8 "
+
+/* pacman */
+
+readonly NONSYSTEMD_REGEX='N ; s|^#\[nonsystemd\].*#Include|\[nonsystemd\]\nInclude|'
+
+
+/* services */
+
readonly OPENRC_DELETE_FILES="/etc/hostname \
/etc/systemd/scripts/choose-mirror \
/etc/systemd/system/choose-mirror.service \
@@ -47,6 +55,9 @@ readonly SYSTEMD_SERVICES="${SYSTEMD_SERVICES_ALL}
$([[ "${ISO_GUI}" != 'cli' ]] && echo " ${SYSTEMD_SERVICES_GUI}") \
$([[ "${ENABLE_TTS_BRLTTY}" == 'yes' ]] && echo " ${SYSTEMD_SERVICES_ACC}")"
+
+/* system defaults and root user */
+
readonly DEFAULT_SHELL=/bin/bash
readonly NETINSTALL_MSG="To install Parabola, the system must be connected to the internet."
@@ -69,11 +80,15 @@ readonly DEFAULT_USER_GROUPS="adm,audio,floppy,log,network,rfkill,scanner,storag
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 OS_PRETTY_NAME="$(echo ${ISO_TITLE} | cut -d ' ' -f -5) - (${INSTALL_TYPE})"
-readonly OS_VERSION=$( echo ${ISO_TITLE} | cut -d ' ' -f 6 )
-readonly OS_VERSION_ID=$( echo ${ISO_TITLE} | cut -d ' ' -f 6 )
-readonly OS_VARIANT="$( echo ${OS_PRETTY_NAME} | cut -d ' ' -f -3 --complement )"
-readonly OS_VARIANT_ID=${ISO_INIT}-${ISO_GUI}
+
+readonly TITLE_REGEX="^(.+) - (.+) (.+)"
+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 OS_VERSION_ID="$(tr '.' '-' <<<${OS_VERSION})"
+readonly OS_VARIANT="${BASH_REMATCH[ 2]} - (${INSTALL_TYPE})"
+readonly OS_VARIANT_ID="${ISO_INIT}-${ISO_GUI}-${INSTALL_TYPE,,}"
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 c4b59eb..5496535 100755
--- a/configs/profile/root-image/root/customize_root_image.sh
+++ b/configs/profile/root-image/root/customize_root_image.sh
@@ -21,7 +21,6 @@ chmod 440 /etc/sudoers.d/g_wheel
LOG_CONFIG "pacman"
-sed -i "s|#Server|Server|" /etc/pacman.d/mirrorlist
[[ "${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
@@ -55,8 +54,6 @@ fi
LOG_CONFIG "system defaults and root user"
usermod -s ${DEFAULT_SHELL} root 2> /dev/null
-sed -i "s|_EDITION_TITLE_|${ISO_TITLE}|" /etc/motd
-sed -i "s|_NETWORK_MOTD_MSG_|${NETWORK_MOTD_MSG}|" /etc/motd
sed -i "s|PRETTY_NAME=.*|PRETTY_NAME=\"${OS_PRETTY_NAME}\"|" /usr/lib/os-release
echo "VERSION=\"${OS_VERSION}\"" >> /usr/lib/os-release
echo "VERSION_ID=\"${OS_VERSION_ID}\"" >> /usr/lib/os-release
@@ -66,6 +63,8 @@ echo "VARIANT_ID=\"${OS_VARIANT_ID}\"" >> /usr/lib/os-release
LOG_CONFIG "login session and live user"
+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' ]]
diff --git a/parabolaiso/mkparabolaiso b/parabolaiso/mkparabolaiso
index da34304..0947860 100755
--- a/parabolaiso/mkparabolaiso
+++ b/parabolaiso/mkparabolaiso
@@ -13,7 +13,7 @@ quiet="y"
pacman_conf="/etc/pacman.conf"
export iso_label="PARA_$(date +%Y%m)"
iso_publisher="Parabola GNU/Linux-libre <https://www.parabola.nu>"
-iso_application="Parabola GNU/Linux-libre Live/Rescue CD"
+iso_application="Parabola GNU/Linux-libre Live/Rescue ISO"
install_dir="parabola"
work_dir="work"
out_dir="out"
@@ -518,6 +518,7 @@ command_iso () {
# copy package lists and create checksums and optional torrent files
pkglist="${work_dir}/iso/${install_dir}/pkglist.${arch}.txt"
mkmetadata "${out_dir}" "${img_name}" "${pkglist}" || true
+ chmod 444 ${out_dir}/*
fi
}