From ea8efb8444c0fd31948c55efe0ec010945df9ac8 Mon Sep 17 00:00:00 2001 From: David P Date: Tue, 25 Aug 2020 18:35:00 -0400 Subject: sync with archiso Imported changes: 4b40193 (HEAD -> master, tag: v47.1, origin/master, origin/HEAD) Add missing declaration of override_install_dir d90184a (tag: v47) Pass profile directory as parameter to mkarchiso e2c5b45 archiso/mkarchiso: reduce duplication and add more info messages Signed-off-by: David P --- parabolaiso/mkparabolaiso | 462 +++++++++++++++++++++++++++------------------- 1 file changed, 268 insertions(+), 194 deletions(-) (limited to 'parabolaiso') diff --git a/parabolaiso/mkparabolaiso b/parabolaiso/mkparabolaiso index 51251f5..8d7c710 100755 --- a/parabolaiso/mkparabolaiso +++ b/parabolaiso/mkparabolaiso @@ -20,17 +20,23 @@ img_name="${app_name}.iso" sfs_mode="sfs" sfs_comp="xz" gpg_key="" +override_gpg_key="" # profile defaults profile="" iso_name="${app_name}" iso_label="${app_name^^}" +override_iso_label="" iso_publisher="${app_name}" +override_iso_publisher="" iso_application="${app_name} iso" +override_iso_application="" iso_version="" install_dir="${app_name}" -arch="${arch:-$(uname -m)}" +override_install_dir="" +arch="${arch:-$(uname -m)}" # leave $(uname -m) only in parabolaiso v49+ pacman_conf="/etc/pacman.conf" +override_pacman_conf="" bootmodes=() @@ -39,14 +45,13 @@ bootmodes=() _msg_info() { local _msg="${1}" [[ "${quiet}" == "y" ]] || printf '[%s] INFO: %s\n' "${app_name}" "${_msg}" - } # Show a WARNING message # $1: message string _msg_warning() { local _msg="${1}" - printf '\n[%s] WARNING: %s\n\n' "${app_name}" "${_msg}" >&2 + printf '[%s] WARNING: %s\n' "${app_name}" "${_msg}" >&2 } # Show an ERROR message then exit with status @@ -55,14 +60,14 @@ _msg_warning() { _msg_error() { local _msg="${1}" local _error=${2} - printf '\n[%s] ERROR: %s\n\n' "${app_name}" "${_msg}" >&2 + printf '[%s] ERROR: %s\n' "${app_name}" "${_msg}" >&2 if (( _error > 0 )); then exit "${_error}" fi } _chroot_init() { - mkdir -p -- "${airootfs_dir}" + install -d -m 0755 -o 0 -g 0 -- "${airootfs_dir}" _pacman base syslinux } @@ -72,96 +77,146 @@ _chroot_run() { _mount_airootfs() { trap "_umount_airootfs" EXIT HUP INT TERM - mkdir -p -- "${work_dir}/mnt/airootfs" - _msg_info "Mounting '${airootfs_dir}.img' on '${work_dir}/mnt/airootfs'" + install -d -m 0755 -- "${work_dir}/mnt/airootfs" + _msg_info "Mounting '${airootfs_dir}.img' on '${work_dir}/mnt/airootfs'..." mount -- "${airootfs_dir}.img" "${work_dir}/mnt/airootfs" _msg_info "Done!" } _umount_airootfs() { - _msg_info "Unmounting '${work_dir}/mnt/airootfs'" + _msg_info "Unmounting '${work_dir}/mnt/airootfs'..." umount -d -- "${work_dir}/mnt/airootfs" _msg_info "Done!" rmdir -- "${work_dir}/mnt/airootfs" trap - EXIT HUP INT TERM } +_mount_efibootimg() { + trap "_umount_efibootimg" EXIT HUP INT TERM + install -d -m 0755 -- "${work_dir}/mnt/efiboot" + _msg_info "Mounting '${isofs_dir}/EFI/parabolaiso/efiboot.img' on '${work_dir}/mnt/efiboot'..." + mount -- "${isofs_dir}/EFI/parabolaiso/efiboot.img" "${work_dir}/mnt/efiboot" + _msg_info "Done!" +} + +_umount_efibootimg() { + _msg_info "Unmounting '${work_dir}/mnt/efiboot'..." + umount -d -- "${work_dir}/mnt/efiboot" + _msg_info "Done!" + rmdir -- "${work_dir}/mnt/efiboot" + trap - EXIT HUP INT TERM +} + # Show help usage, with an exit status. # $1: exit status number. -_usage () { +_usage() { IFS='' read -r -d '' usagetext < - general options: - -B Directory of the parabolaiso profile to build - -p PACKAGE(S) Package(s) to install, can be used multiple times - -C Config file for pacman. - Default: '${pacman_conf}' - -L