From 7e1649aa0c82b99dcdec85549bc56afb795a3f47 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Mon, 4 Sep 2023 09:47:58 +0200 Subject: [PATCH] shellcheck fixes --- usr/lib/initcpio/install/archboot_base_common | 26 +++++++++---------- usr/lib/initcpio/install/archboot_filesystems | 2 +- usr/lib/initcpio/install/archboot_firmware | 6 ++--- usr/lib/initcpio/install/archboot_init | 1 + .../install/archboot_installer_common | 2 +- usr/lib/initcpio/install/archboot_motd | 2 +- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/usr/lib/initcpio/install/archboot_base_common b/usr/lib/initcpio/install/archboot_base_common index 8307db311..9b9bdb3a9 100644 --- a/usr/lib/initcpio/install/archboot_base_common +++ b/usr/lib/initcpio/install/archboot_base_common @@ -62,14 +62,14 @@ build () add_file /etc/locale.gen _LANG="be bg cs da de en el es fi fr hu it lt lv mk nl nn pl pt ro ru sk sr sv uk" for i in ${_LANG}; do - add_full_dir /usr/share/locale/${i} + add_full_dir "/usr/share/locale/${i}" done add_file /usr/share/locale/locale.alias add_full_dir /usr/share/i18n/locales # only support UTF-8 add_file /usr/share/i18n/charmaps/UTF-8.gz # remove conflicting files from not installed packages: binutils, grub and gdbm - find ${BUILDROOT}/usr/share/locale/ -type f \( -name 'grub*' -o -name 'binutils*' -o -name 'gdbm*' -o -name 'bfd*' \ + find "${BUILDROOT}/usr/share/locale/" -type f \( -name 'grub*' -o -name 'binutils*' -o -name 'gdbm*' -o -name 'bfd*' \ -o -name 'gettext*' -o -name 'gas*' -o -name 'gold*' -o -name 'gprof*' -o -name 'ld*' \ -o -name 'opcodes*' \) -delete fi @@ -161,7 +161,7 @@ build () # proc-sys-fs-binfmt_misc.automount add_symlink "/etc/systemd/system/proc-sys-fs-binfmt_misc.automount" "/dev/null" # remove multi-user.target.wants - rm -rf ${BUILDROOT}/etc/systemd/system/multi-user.target.wants + rm -rf "${BUILDROOT}/etc/systemd/system/multi-user.target.wants" # disable lastlog add_symlink "/var/log/lastlog" "/dev/null" add_file "/usr/share/archboot/base/etc/tmpfiles.d/var.conf" "/etc/tmpfiles.d/var.conf" @@ -172,7 +172,7 @@ build () map add_file "/usr/lib/libnss_compat.so.2" "/usr/lib/libnsl.so.1" ## fix for systemd >=245 set default.target # remove initrd-release to allow normal systemd boot without initrd.target - rm -f ${BUILDROOT}/etc/initrd-release + rm -f "${BUILDROOT}/etc/initrd-release" # mask systemd-gpt-auto-generator, errors out on initramfs usage add_symlink "/etc/systemd/system-generators/systemd-gpt-auto-generator" "/dev/null" ### add udev @@ -204,7 +204,7 @@ build () memtest86+-efi mkinitcpio-busybox mtools libsysprof-capture libnsl libksba gdbm binutils \ cdrtools systemd-ukify python python-pefile limine man-pages libev libpipeline groff db db5.3" for i in ${_RM_PACMAN_DB}; do - rm -rf ${BUILDROOT}/var/lib/pacman/local/"${i}"-[0-9]* &>"${_NO_LOG}" + rm -rf "${BUILDROOT}"/var/lib/pacman/local/"${i}"-[0-9]* &>"${_NO_LOG}" done fi ### add nss p11-kit and ca certificates @@ -223,14 +223,14 @@ build () add_file /usr/share/p11-kit/modules/p11-kit-trust.module ### remove conflicting mkinitcpio files and grub - rm ${BUILDROOT}/usr/lib/systemd/system/mkinitcpio-generate-shutdown-ramfs.service \ - ${BUILDROOT}/usr/lib/systemd/system/shutdown.target.wants/mkinitcpio-generate-shutdown-ramfs.service \ - ${BUILDROOT}/usr/lib/systemd/ukify \ - ${BUILDROOT}/usr/lib/tmpfiles.d/mkinitcpio.conf \ - ${BUILDROOT}/usr/share/bash-completion/completions/lsinitcpio \ - ${BUILDROOT}/usr/share/bash-completion/completions/mkinitcpio \ - ${BUILDROOT}/usr/share/bash-completion/completions/grub \ - ${BUILDROOT}/usr/lib/modules-load.d/cdrecord.conf + rm "${BUILDROOT}/usr/lib/systemd/system/mkinitcpio-generate-shutdown-ramfs.service" \ + "${BUILDROOT}/usr/lib/systemd/system/shutdown.target.wants/mkinitcpio-generate-shutdown-ramfs.service" \ + "${BUILDROOT}/usr/lib/systemd/ukify" \ + "${BUILDROOT}/usr/lib/tmpfiles.d/mkinitcpio.conf" \ + "${BUILDROOT}/usr/share/bash-completion/completions/lsinitcpio" \ + "${BUILDROOT}/usr/share/bash-completion/completions/mkinitcpio" \ + "${BUILDROOT}/usr/share/bash-completion/completions/grub" \ + "${BUILDROOT}/usr/lib/modules-load.d/cdrecord.conf" ### fix licenses map add_file /usr/share/licenses/shadow/COPYING /usr/share/licenses/iana-etc/LICENSE \ diff --git a/usr/lib/initcpio/install/archboot_filesystems b/usr/lib/initcpio/install/archboot_filesystems index 647cdf978..dd6d1736f 100644 --- a/usr/lib/initcpio/install/archboot_filesystems +++ b/usr/lib/initcpio/install/archboot_filesystems @@ -26,7 +26,7 @@ build () map add_full_dir /etc/cifs-utils /etc/request-key.d /etc/nvme # fix libinih for plasma wallpaper for i in /usr/lib/libINI*; do - add_file ${i} + add_file "${i}" done # fix licenses add_file "/usr/share/licenses/e2fsprogs/MIT-LICENSE" diff --git a/usr/lib/initcpio/install/archboot_firmware b/usr/lib/initcpio/install/archboot_firmware index a1ef4a302..6a05ce7de 100644 --- a/usr/lib/initcpio/install/archboot_firmware +++ b/usr/lib/initcpio/install/archboot_firmware @@ -8,9 +8,9 @@ build () map add_full_dir "/lib/firmware" "/usr/share/licenses/linux-firmware" add_all_modules "/firmware/" # remove not used firmware - rm -rf ${BUILDROOT}/lib/firmware/{amphion,as102*,atusb,av7110,cadence,cavium,cmmb*,cis,cpia2,cnm,ct*,cxgb*,cmmb*,dabusb,dpaa2,dsp56k,dvb*,edgeport,emi26,emi62,ess,f2255usb*,go7007,hfi1*,inside-secure,isdbt*,keyspan*,korg,meson,lgs8g75*,lt9611uxc*,moxa,mts*,myri10ge*,myricom,nxp,ositech,qat*,sb16,s2250*,s5p-*,sms1*,rtl_bt,tdmb*,ttusb-budget,ueagle-atm,usbdux*,ti,ti-keystone,v4l*,vicam,vxge,whiteheat*,yam,yamaha} - find ${BUILDROOT}/lib/firmware -type f -name "*txt*" -exec rm {} \; - find ${BUILDROOT}/lib/firmware -type f -name "*README*" -exec rm {} \; + rm -rf "${BUILDROOT}"/lib/firmware/{amphion,as102*,atusb,av7110,cadence,cavium,cmmb*,cis,cpia2,cnm,ct*,cxgb*,cmmb*,dabusb,dpaa2,dsp56k,dvb*,edgeport,emi26,emi62,ess,f2255usb*,go7007,hfi1*,inside-secure,isdbt*,keyspan*,korg,meson,lgs8g75*,lt9611uxc*,moxa,mts*,myri10ge*,myricom,nxp,ositech,qat*,sb16,s2250*,s5p-*,sms1*,rtl_bt,tdmb*,ttusb-budget,ueagle-atm,usbdux*,ti,ti-keystone,v4l*,vicam,vxge,whiteheat*,yam,yamaha} + find "${BUILDROOT}/lib/firmware" -type f -name "*txt*" -exec rm {} \; + find "${BUILDROOT}/lib/firmware" -type f -name "*README*" -exec rm {} \; } help () diff --git a/usr/lib/initcpio/install/archboot_init b/usr/lib/initcpio/install/archboot_init index d659a5d97..910a251ad 100644 --- a/usr/lib/initcpio/install/archboot_init +++ b/usr/lib/initcpio/install/archboot_init @@ -25,6 +25,7 @@ build() { done # add custom bash options echo ". /root/.bashrc" >> "${BUILDROOT}/etc/bash.bashrc" + #shellcheck disable=SC2129 echo ". /etc/profile.d/custom-bash-options.sh" >> "${BUILDROOT}/root/.bashrc" echo "alias reboot='echo b >/proc/sysrq-trigger'" >> "${BUILDROOT}/root/.bashrc" echo "alias poweroff='echo o >/proc/sysrq-trigger'" >> "${BUILDROOT}/root/.bashrc" diff --git a/usr/lib/initcpio/install/archboot_installer_common b/usr/lib/initcpio/install/archboot_installer_common index 4c4702d36..f2cee2d6c 100644 --- a/usr/lib/initcpio/install/archboot_installer_common +++ b/usr/lib/initcpio/install/archboot_installer_common @@ -11,7 +11,7 @@ build () add_file "/usr/bin/archboot-update.sh" "/usr/bin/update" add_file "/usr/share/archboot/gpg/tpowa.gpg" # use /etc/profile to launch login.sh - echo ". /usr/lib/archboot/login.sh" >> ${BUILDROOT}/root/.bashrc + echo ". /usr/lib/archboot/login.sh" >> "${BUILDROOT}/root/.bashrc" } help () diff --git a/usr/lib/initcpio/install/archboot_motd b/usr/lib/initcpio/install/archboot_motd index 9f7e47d2f..cbddfe891 100644 --- a/usr/lib/initcpio/install/archboot_motd +++ b/usr/lib/initcpio/install/archboot_motd @@ -21,9 +21,9 @@ if echo "${HOOKS[@]}" | grep -qw archboot_net; then echo -e " - Use the \e[1;92m'weechat'\e[m IRC client." >> "${MOTD}" fi if echo "${HOOKS[@]}" | grep -qw archboot_installer; then + #shellcheck disable=SC2129 echo -e "\e[1mManage Archboot Environment:\e[m" >> "${MOTD}" echo -e " - Use the \e[1;92m'launcher'\e[m or the expert \e[1;92m'update'\e[m script." >> "${MOTD}" - #shellcheck disable=SC2129 echo -e "\e[1mInstallation:\e[m" >> "${MOTD}" echo -e " - Use the \e[1;92m'setup'\e[m or the expert \e[1;92m'quickinst'\e[m script." >> "${MOTD}" fi