x86: search PARTUUID in any block device
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
9f422eba7c
commit
924fb794bd
1 changed files with 2 additions and 1 deletions
|
@ -17,7 +17,8 @@ platform_export_bootpart() {
|
||||||
PARTUUID=[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]-02)
|
PARTUUID=[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]-02)
|
||||||
uuid="${disk#PARTUUID=}"
|
uuid="${disk#PARTUUID=}"
|
||||||
uuid="${uuid%-02}"
|
uuid="${uuid%-02}"
|
||||||
for disk in /dev/[hsv]d[a-z] /dev/xvd[a-z]; do
|
for disk in /dev/*; do
|
||||||
|
[ -b "$disk" ] || continue
|
||||||
set -- $(dd if=$disk bs=1 skip=440 count=4 2>/dev/null | hexdump -v -e '4/1 "%02x "')
|
set -- $(dd if=$disk bs=1 skip=440 count=4 2>/dev/null | hexdump -v -e '4/1 "%02x "')
|
||||||
if [ "$4$3$2$1" = "$uuid" ]; then
|
if [ "$4$3$2$1" = "$uuid" ]; then
|
||||||
export BOOTPART="${disk}1"
|
export BOOTPART="${disk}1"
|
||||||
|
|
Loading…
Reference in a new issue