]> git.proxmox.com Git - pve-kernel-meta.git/commitdiff
pve-efiboot-tool: format: fix handling of disk/by-id
authorAaron Lauterer <a.lauterer@proxmox.com>
Tue, 19 May 2020 07:59:43 +0000 (09:59 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 2 Jun 2020 10:29:54 +0000 (12:29 +0200)
The format command will fail when using other paths like
/dev/disk/by-id/<part> instead of /dev/sdXY directly. It cannot find
the path /sys/block/<disk>/<part>/partition path.

The part name in /dev/disk/by-id is a symlink to /dev/sdXY. At that
point we already have the symlink resolved to the real path. It is
stored in `bdev`.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
bin/pve-efiboot-tool

index eab01d75a1d61452230a5d8cbe7c91cad57879ab..d54b443663952fc0e6e394d616eb7557dc930b5b 100755 (executable)
@@ -96,7 +96,7 @@ format() {
                fi
        fi
 
-       part_basename=$(basename "$part")
+       part_basename=$(basename "$bdev")
        if [ -z "$part_basename" ]; then
                warn "E: unable to determine basename of '$part'"
                exit 1