deploy-shell-efi.sh: Fix partition num breaking on nvme0n1p1

It was just getting all digits from the disk name,
so  nvm0n1p1 resulted in part num `011` which was
interpreted as partiion number 11 resulting in
a broken boot entry in the UEFI boot manager.

Now only the last sequence of digits is taken
into account and returns `1` for both
`sda1` and `nvme0n1p1` creating
bootable UEFI Shell boot entries.

Signed-off-by: Filip Gołaś <filip.golas@3mdeb.com>
This commit is contained in:
Filip Gołaś
2025-07-25 12:17:56 +02:00
parent ae13c11c0a
commit 7e30b06e93
+1 -1
View File
@@ -36,7 +36,7 @@ cp "$SHELL_EFI_SRC" "$DEST_EFI"
PART_DEV=$(findmnt -no SOURCE "$ESP")
DISK=$(lsblk -no PKNAME "$PART_DEV" | head -n1)
PART_NUM=$(echo "$PART_DEV" | sed 's/[^0-9]*//g')
PART_NUM=$(echo "$PART_DEV" | sed -E 's/.*[^0-9]([0-9]+)$/\1/')
DISK_DEV="/dev/$DISK"
echo "Registering UEFI boot entry..."