Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archiso/mkarchiso
diff options
context:
space:
mode:
authorDavid Runge <dvzrv@archlinux.org>2020-06-30 19:35:56 +0200
committerDavid Runge <dvzrv@archlinux.org>2020-06-30 19:35:56 +0200
commit5e43a63b3c28f124db39440fcac31aeea779fe78 (patch)
treef847040df377b31ad95d7aa26ae265cd225c551a /archiso/mkarchiso
parent511ca9d95d9a120e6d5eec080a23c03453e51856 (diff)
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".
Diffstat (limited to 'archiso/mkarchiso')
-rwxr-xr-xarchiso/mkarchiso63
1 files changed, 40 insertions, 23 deletions
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}" ;;