shellcheck fixes

This commit is contained in:
Tobias Powalowski 2024-09-07 12:42:58 +02:00
parent 56ba8297c6
commit 955763a7b2
4 changed files with 11 additions and 9 deletions

View file

@ -171,7 +171,7 @@ _prepare_memtest() {
_prepare_background() { _prepare_background() {
echo "Preparing grub background..." echo "Preparing grub background..."
[[ -d "${_ISODIR}/boot/grub" ]] || mkdir -p "${_ISODIR}/boot/grub" [[ -d "${_ISODIR}/boot/grub" ]] || mkdir -p "${_ISODIR}/boot/grub"
cp ${_GRUB_BACKGROUND} "${_ISODIR}/boot/grub/archboot-background.png" cp "${_GRUB_BACKGROUND}" "${_ISODIR}/boot/grub/archboot-background.png"
} }
_prepare_uefi_image() { _prepare_uefi_image() {

View file

@ -137,6 +137,7 @@ _run_autorun() {
echo "Waiting for pacman keyring..." echo "Waiting for pacman keyring..."
_pacman_keyring _pacman_keyring
echo "Updating pacman keyring..." echo "Updating pacman keyring..."
#shellcheck disable=SC2086
pacman -Sy --noconfirm ${_KEYRING} &>"${_LOG}" pacman -Sy --noconfirm ${_KEYRING} &>"${_LOG}"
chmod 755 /etc/archboot/run/autorun.sh chmod 755 /etc/archboot/run/autorun.sh
echo "Running custom autorun.sh..." echo "Running custom autorun.sh..."

View file

@ -34,7 +34,7 @@ _create_iso() {
. "${_W_DIR}/etc/archboot/${_ARCH}.conf" . "${_W_DIR}/etc/archboot/${_ARCH}.conf"
#shellcheck disable=SC2116,SC2046,2086 #shellcheck disable=SC2116,SC2046,2086
_KERNEL="$(echo ${_W_DIR}${_KERNEL})" _KERNEL="$(echo ${_W_DIR}${_KERNEL})"
_NAME="archboot-$(date +%Y.%m.%d-%H.%M)-$(_kver ${_KERNEL})" _NAME="archboot-$(date +%Y.%m.%d-%H.%M)-$(_kver "${_KERNEL}")"
if ! [[ "${_RUNNING_ARCH}" == "${_ARCH}" ]]; then if ! [[ "${_RUNNING_ARCH}" == "${_ARCH}" ]]; then
### to speedup build for riscv64 and aarch64 on x86_64, run compressor on host system ### to speedup build for riscv64 and aarch64 on x86_64, run compressor on host system
echo "Generating initramdisks..." echo "Generating initramdisks..."
@ -83,7 +83,7 @@ _create_iso() {
if [[ "${_ARCH}" == "riscv64" ]]; then if [[ "${_ARCH}" == "riscv64" ]]; then
for i in *.img; do for i in *.img; do
if echo "${i}" | rg -v 'local' | rg -vq 'latest'; then if echo "${i}" | rg -v 'local' | rg -vq 'latest'; then
mv ${_KERNEL} boot/ mv "${_KERNEL}" boot/
mcopy -m -i "${i}"@@1048576 ::/"${_INITRD}" ./"${_INITRD}" mcopy -m -i "${i}"@@1048576 ::/"${_INITRD}" ./"${_INITRD}"
elif echo "${i}" | rg -q 'latest'; then elif echo "${i}" | rg -q 'latest'; then
mcopy -m -i "${i}"@@1048576 ::/"${_INITRD}" ./"${_INITRD_LATEST}" mcopy -m -i "${i}"@@1048576 ::/"${_INITRD}" ./"${_INITRD_LATEST}"
@ -99,7 +99,7 @@ _create_iso() {
if [[ "${_ARCH}" == "aarch64" ]]; then if [[ "${_ARCH}" == "aarch64" ]]; then
# replace aarch64 Image.gz with Image kernel for UKI # replace aarch64 Image.gz with Image kernel for UKI
# compressed image is not working at the moment # compressed image is not working at the moment
_KERNEL="$(echo ${_KERNEL} | sd '\.gz' '')" _KERNEL="$(echo "${_KERNEL}" | sd '\.gz' '')"
mv "${_KERNEL}" boot/ mv "${_KERNEL}" boot/
else else
mv "${_W_DIR}/${_INTEL_UCODE}" boot/ mv "${_W_DIR}/${_INTEL_UCODE}" boot/
@ -130,9 +130,9 @@ _create_iso() {
[[ "${initrd}" == "${_INITRD_LATEST}" ]] && _UKI="boot/${_NAME}-latest-${_ARCH}.efi" [[ "${initrd}" == "${_INITRD_LATEST}" ]] && _UKI="boot/${_NAME}-latest-${_ARCH}.efi"
[[ "${initrd}" == "${_INITRD_LOCAL}" ]] && _UKI="boot/${_NAME}-local-${_ARCH}.efi" [[ "${initrd}" == "${_INITRD_LOCAL}" ]] && _UKI="boot/${_NAME}-local-${_ARCH}.efi"
#shellcheck disable=SC2086 #shellcheck disable=SC2086
${_NSPAWN} "${_W_DIR}" /usr/lib/systemd/ukify build --linux=${_KERNEL} \ ${_NSPAWN} "${_W_DIR}" /usr/lib/systemd/ukify build --linux="${_KERNEL}" \
${_INTEL_UCODE} ${_AMD_UCODE} --initrd=${initrd} --cmdline="${_CMDLINE}" \ ${_INTEL_UCODE} ${_AMD_UCODE} --initrd="${initrd}" --cmdline="${_CMDLINE}" \
--os-release=@${_OSREL} --splash=${_SPLASH} --output=${_UKI} &>"${_NO_LOG}" || exit 1 --os-release=@"${_OSREL}" --splash="${_SPLASH}" --output="${_UKI}" &>"${_NO_LOG}" || exit 1
done done
# fix permission and timestamp # fix permission and timestamp
mv "${_W_DIR}"/boot ./ mv "${_W_DIR}"/boot ./

View file

@ -62,9 +62,10 @@ _systemd_ukify() {
cd "${_UKIDIR}" &>"${_NO_LOG}" || exit 1 cd "${_UKIDIR}" &>"${_NO_LOG}" || exit 1
[[ -n "/${_INTEL_UCODE}" ]] && _INTEL_UCODE="--initrd=/${_INTEL_UCODE}" [[ -n "/${_INTEL_UCODE}" ]] && _INTEL_UCODE="--initrd=/${_INTEL_UCODE}"
_AMD_UCODE="--initrd=/${_AMD_UCODE}" _AMD_UCODE="--initrd=/${_AMD_UCODE}"
/usr/lib/systemd/ukify build --linux=${_KERNEL} \ #shellcheck disable=SC2086
/usr/lib/systemd/ukify build --linux="${_KERNEL}" \
${_INTEL_UCODE} ${_AMD_UCODE} --initrd="${_INITRD}" --cmdline="${_CMDLINE}" \ ${_INTEL_UCODE} ${_AMD_UCODE} --initrd="${_INITRD}" --cmdline="${_CMDLINE}" \
--os-release=@${_OSREL} --splash=${_SPLASH} --output="../${_UKI}" &>"${_NO_LOG}" || exit 1 --os-release=@"${_OSREL}" --splash="${_SPLASH}" --output="../${_UKI}" &>"${_NO_LOG}" || exit 1
cd ../ &>"${_NO_LOG}" || exit 1 cd ../ &>"${_NO_LOG}" || exit 1
} }