From 341a40975dc6e332caaca9e4dc47257af9511f9e Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Fri, 23 Sep 2022 08:50:09 +0200 Subject: [PATCH] shellcheck fixes --- usr/bin/archboot-quickinst.sh | 1 + usr/lib/archboot/installer/autoconfiguration.sh | 2 +- usr/lib/archboot/installer/pacman.sh | 3 ++- usr/lib/archboot/iso.sh | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/usr/bin/archboot-quickinst.sh b/usr/bin/archboot-quickinst.sh index a6bad6126..42008c5bd 100755 --- a/usr/bin/archboot-quickinst.sh +++ b/usr/bin/archboot-quickinst.sh @@ -49,6 +49,7 @@ prepare_pacman() { ${PACMAN} -Sy KEYRING="archlinux-keyring" [[ "$(uname -m)" == "aarch64" ]] && KEYRING="${KEYRING} archlinuxarm-keyring" + #shellcheck disable=SC2086 pacman -Sy ${PACMAN_CONF} --noconfirm --noprogressbar ${KEYRING} || exit 1 } diff --git a/usr/lib/archboot/installer/autoconfiguration.sh b/usr/lib/archboot/installer/autoconfiguration.sh index 7e721b639..f050057d3 100644 --- a/usr/lib/archboot/installer/autoconfiguration.sh +++ b/usr/lib/archboot/installer/autoconfiguration.sh @@ -120,7 +120,7 @@ auto_mkinitcpio() { reader="cat" # try if the image is gzip compressed [[ $(file -b --mime-type "${DESTDIR}/boot/${VMLINUZ}") == 'application/gzip' ]] && reader="zcat" - read _ _ HWKVER _ < <($reader "${DESTDIR}/boot/${VMLINUZ}" | grep -m1 -aoE 'Linux version .(\.[-[:alnum:]]+)+') + read -r _ _ HWKVER _ < <($reader "${DESTDIR}/boot/${VMLINUZ}" | grep -m1 -aoE 'Linux version .(\.[-[:alnum:]]+)+') fi # arrange MODULES for mkinitcpio.conf HWDETECTMODULES="$(hwdetect --kernel_directory="${DESTDIR}" --kernel_version="${HWKVER}" --hostcontroller --filesystem ${FBPARAMETER})" diff --git a/usr/lib/archboot/installer/pacman.sh b/usr/lib/archboot/installer/pacman.sh index cd27d6b0c..11c11f450 100644 --- a/usr/lib/archboot/installer/pacman.sh +++ b/usr/lib/archboot/installer/pacman.sh @@ -116,7 +116,8 @@ prepare_pacman() { DIALOG --infobox "Update Arch Linux keyring ..." 3 40 KEYRING="archlinux-keyring" [[ "${RUNNING_ARCH}" == "aarch64" ]] && KEYRING="${KEYRING} archlinuxarm-keyring" - pacman -Sy ${PACMAN_CONF} --noconfirm --noprogressbar ${KEYRING} > "${LOG}" 2>&1 || (DIALOG --msgbox "Keyring update failed! Check ${LOG} for errors." 6 60; return 1) + #shellcheck disable=SC2086 + pacman -Sy "${PACMAN_CONF}" --noconfirm --noprogressbar ${KEYRING} > "${LOG}" 2>&1 || (DIALOG --msgbox "Keyring update failed! Check ${LOG} for errors." 6 60; return 1) } # Set PACKAGES parameter before running to install wanted packages diff --git a/usr/lib/archboot/iso.sh b/usr/lib/archboot/iso.sh index 0eae29808..1e9c306d7 100644 --- a/usr/lib/archboot/iso.sh +++ b/usr/lib/archboot/iso.sh @@ -89,8 +89,9 @@ _prepare_kernel_initramfs_files() { # - only left option is extlinux support in u-boot loader _prepare_kernel_initramfs_files_RISCV64() { echo "Prepare RISCV64 u-boot ..." + #shellcheck disable=SC1090 source "${_PRESET}" - mkdir -p ${_ISODIR}/boot/extlinux + mkdir -p "${_ISODIR}"/boot/extlinux install -m644 "${ALL_kver}" "${_ISODIR}/boot/vmlinuz_${_RUNNING_ARCH}" mkinitcpio -c "${MKINITCPIO_CONFIG}" -k "${ALL_kver}" -g "${_ISODIR}/boot/initramfs_${_RUNNING_ARCH}.img" || exit 1 }