shellcheck fix for read

This commit is contained in:
Tobias Powalowski 2022-04-30 17:50:05 +02:00
parent 679b6c3120
commit 2ec4b2445f

View file

@ -118,10 +118,10 @@ auto_mkinitcpio() {
offset=$(hexdump -s 526 -n 2 -e '"%0d"' "${DESTDIR}/boot/${VMLINUZ}")
read -r HWKVER _ < <(dd if="${DESTDIR}/boot/${VMLINUZ}" bs=1 count=127 skip=$(( offset + 0x200 )) 2>/dev/null)
elif [[ "${RUNNING_ARCH}" == "aarch64" ]]; then
read _ _ HWKVER _ < <(grep -m1 -aoE 'Linux version .(\.[-[:alnum:]]+)+' "${DESTDIR}/boot/${VMLINUZ}")
read -r _ _ HWKVER _ < <(grep -m1 -aoE 'Linux version .(\.[-[:alnum:]]+)+' "${DESTDIR}/boot/${VMLINUZ}")
# try if the image is gzip compressed
if [[ -z "${HWKVER}" ]]; then
read _ _ HWKVER _ < <(gzip -c -d "${DESTDIR}/boot/${VMLINUZ}" | grep -m1 -aoE 'Linux version .(\.[-[:alnum:]]+)+')
read -r _ _ HWKVER _ < <(gzip -c -d "${DESTDIR}/boot/${VMLINUZ}" | grep -m1 -aoE 'Linux version .(\.[-[:alnum:]]+)+')
fi
fi
# arrange MODULES for mkinitcpio.conf