Use 'find' instead of 'ls' to find kernel image

This commit is contained in:
Aleksey Samoilov 2023-02-26 21:59:37 +04:00
parent c460a9f058
commit 8390bad7f1

View file

@ -266,7 +266,7 @@ mount -o bind "${basedir}/bootp/" ubuntusway-$architecture/boot/firmware
# Copy Raspberry Pi specific files
cp -rv "${rootdir}"/rpi/rootfs/system-boot/* ubuntusway-${architecture}/boot/firmware/
NEW_KERNEL=$(ls -1 ubuntusway-$architecture/boot/vmlinuz-* | tail -n1 | awk -F/ '{print $NF}' | cut -d'-' -f2-4)
NEW_KERNEL=$(find ubuntusway-$architecture/boot/vmlinuz-* | tail -n1 | awk -F/ '{print $NF}' | cut -d'-' -f2-4)
if [ -z "${NEW_KERNEL}" ]; then
echo "ERROR! Could not detect the new kernel version"
exit 1