From 5e43a63b3c28f124db39440fcac31aeea779fe78 Mon Sep 17 00:00:00 2001 From: David Runge Date: Tue, 30 Jun 2020 19:35:56 +0200 Subject: Fixing issues with variable quoting and arrays archiso/mkarchiso: Calls to _pacman() need to be done with multiple parameters (e.g. array) instead of one string, as string splitting is not done in that function anymore. Turning _iso_efi_boot_args from string into an array to have an easier time of passing it to xorriso. Calling xorriso within the if statements instead of providing -quiet via variable. Fixing command_install() to provide packages separately to _pacman() configs/releng/build.sh: Replacing all newlines when retrieving the packages from packages.x86_64 with spaces so they will be properly provided to "mkarchiso install". --- archiso/mkarchiso | 63 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 23 deletions(-) (limited to 'archiso/mkarchiso') diff --git a/archiso/mkarchiso b/archiso/mkarchiso index 38d6eb5..5e229a4 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -43,7 +43,7 @@ _msg_error() { _chroot_init() { mkdir -p ${work_dir}/airootfs - _pacman "base syslinux" + _pacman base syslinux } _chroot_run() { @@ -279,7 +279,7 @@ command_pkglist () { # Create an ISO9660 filesystem from "iso" directory. command_iso () { - local _iso_efi_boot_args="" + local _iso_efi_boot_args=() if [[ ! -f "${work_dir}/iso/isolinux/isolinux.bin" ]]; then _msg_error "The file '${work_dir}/iso/isolinux/isolinux.bin' does not exist." 1 @@ -290,10 +290,12 @@ command_iso () { # If exists, add an EFI "El Torito" boot image (FAT filesystem) to ISO-9660 image. if [[ -f "${work_dir}/iso/EFI/archiso/efiboot.img" ]]; then - _iso_efi_boot_args="-eltorito-alt-boot - -e EFI/archiso/efiboot.img - -no-emul-boot - -isohybrid-gpt-basdat" + _iso_efi_boot_args+=( + '-eltorito-alt-boot' + '-e' 'EFI/archiso/efiboot.img' + '-no-emul-boot' + '-isohybrid-gpt-basdat' + ) fi _show_config iso @@ -302,22 +304,36 @@ command_iso () { _msg_info "Creating ISO image..." local _qflag="" if [[ "${quiet}" == "y" ]]; then - _qflag="-quiet" + xorriso -as mkisofs -quiet \ + -iso-level 3 \ + -full-iso9660-filenames \ + -volid "${iso_label}" \ + -appid "${iso_application}" \ + -publisher "${iso_publisher}" \ + -preparer "prepared by mkarchiso" \ + -eltorito-boot isolinux/isolinux.bin \ + -eltorito-catalog isolinux/boot.cat \ + -no-emul-boot -boot-load-size 4 -boot-info-table \ + -isohybrid-mbr "${work_dir}/iso/isolinux/isohdpfx.bin" \ + "${_iso_efi_boot_args[@]}" \ + -output "${out_dir}/${img_name}" \ + "${work_dir}/iso/" + else + xorriso -as mkisofs \ + -iso-level 3 \ + -full-iso9660-filenames \ + -volid "${iso_label}" \ + -appid "${iso_application}" \ + -publisher "${iso_publisher}" \ + -preparer "prepared by mkarchiso" \ + -eltorito-boot isolinux/isolinux.bin \ + -eltorito-catalog isolinux/boot.cat \ + -no-emul-boot -boot-load-size 4 -boot-info-table \ + -isohybrid-mbr "${work_dir}/iso/isolinux/isohdpfx.bin" \ + "${_iso_efi_boot_args[@]}" \ + -output "${out_dir}/${img_name}" \ + "${work_dir}/iso/" fi - xorriso -as mkisofs "${_qflag}" \ - -iso-level 3 \ - -full-iso9660-filenames \ - -volid "${iso_label}" \ - -appid "${iso_application}" \ - -publisher "${iso_publisher}" \ - -preparer "prepared by mkarchiso" \ - -eltorito-boot isolinux/isolinux.bin \ - -eltorito-catalog isolinux/boot.cat \ - -no-emul-boot -boot-load-size 4 -boot-info-table \ - -isohybrid-mbr "${work_dir}/iso/isolinux/isohdpfx.bin" \ - "${_iso_efi_boot_args}" \ - -output "${out_dir}/${img_name}" \ - "${work_dir}/iso/" _msg_info "Done! | $(ls -sh "${out_dir}/${img_name}")" } @@ -351,7 +367,7 @@ command_install () { _show_config install - _pacman "${pkg_list[*]}" + _pacman "${pkg_list[@]}" } command_init() { @@ -374,7 +390,8 @@ while getopts 'p:r:C:L:P:A:D:w:o:s:c:g:vh' arg; do case "${arg}" in p) read -r -a opt_pkg_list <<< "${OPTARG}" - pkg_list+=("${opt_pkg_list[@]}") ;; + pkg_list+=("${opt_pkg_list[@]}") + ;; r) run_cmd="${OPTARG}" ;; C) pacman_conf="${OPTARG}" ;; L) iso_label="${OPTARG}" ;; -- cgit v1.2.3-54-g00ecf