ref: e40d32e250bb129e1c70da428cd9eaca5d5907ea
parent: 92f7de1033a4ba068e93870dea8332faf0b3f70e
author: psykose <alice@ayaya.dev>
date: Thu Apr 13 23:19:56 CDT 2023
initramfs-init: fix posix -f glob SC2144 (error): -f doesn't work with globs. Use a for loop.
--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -773,11 +773,16 @@
fi
# enable support for modloop verification
-if [ -f "$ROOT"/var/cache/misc/*modloop*.SIGN.RSA.*.pub ]; then
+for _pubkey in "$ROOT"/var/cache/misc/*modloop*.SIGN.RSA.*.pub; do
+ # check only if the glob matched something
+ [ -f "$_pubkey" ] || continue
+
+ # then do it in one iteration anyway
mkdir -p "$sysroot"/var/cache/misc
cp "$ROOT"/var/cache/misc/*modloop*.SIGN.RSA.*.pub "$sysroot"/var/cache/misc
pkgs="$pkgs openssl"
-fi
+ break
+done
apkflags="--initramfs-diskless-boot --progress"
if [ -z "$MAC_ADDRESS" ]; then