|
|
@ -48,9 +48,8 @@ disk_get_part_value() { |
|
|
|
# |
|
|
|
# $1 - path to disk image |
|
|
|
disk_get_part_nums() { |
|
|
|
partx --show $1 | tail -n +2 | |
|
|
|
while read line |
|
|
|
do |
|
|
|
partx --show $1 | tail -n +2 \ |
|
|
|
| while read line; do |
|
|
|
echo $line | awk '{printf "%d\n", $1}' |
|
|
|
done |
|
|
|
} |
|
|
@ -185,7 +184,6 @@ disk_root_part() { |
|
|
|
echo "${root_part}" |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Check if supplied argument is valid partuuid device path. |
|
|
|
# Supports both dos and gpt paths |
|
|
|
# |
|
|
@ -194,7 +192,6 @@ disk_is_valid_partuuid_device() { |
|
|
|
disk_is_valid_partuuid_gpt_device "$1" || disk_is_valid_partuuid_dos_device "$1" |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Check if supplied argument is valid gpt partuuid device path. |
|
|
|
# |
|
|
|
# Example: /dev/disk/by-partuuid/26445670-f37c-408b-be2c-3ef419866620 |
|
|
@ -204,7 +201,6 @@ disk_is_valid_partuuid_gpt_device() { |
|
|
|
echo "${1}" | grep -qE '^/dev/disk/by-partuuid/([0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12})$' |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Check if supplied argument is valid dos partuuid device path. |
|
|
|
# |
|
|
|
# Example: /dev/disk/by-partuuid/26445670-01 |
|
|
@ -214,7 +210,6 @@ disk_is_valid_partuuid_dos_device() { |
|
|
|
echo "${1}" | grep -qE '^/dev/disk/by-partuuid/[0-9a-f]{8}-[0-9a-f]{2}$' |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Get partuuid from supplied device path. |
|
|
|
# Supports both dos and gpt paths |
|
|
|
# |
|
|
@ -226,7 +221,6 @@ disk_get_partuuid_from_device() { |
|
|
|
echo "${1}" | sed "s:/dev/disk/by-partuuid/::" |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Get dos disk identifier from supplied device path. |
|
|
|
# |
|
|
|
# $1 - dos compatible partuuid device path |
|
|
@ -238,7 +232,6 @@ disk_get_partuuid_dos_diskid_from_device() { |
|
|
|
echo "$partuuid" | cut -d- -f1 |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Get dos partuuid number from supplied device path. |
|
|
|
# |
|
|
|
# $1 - dos compatible partuuid device path |
|
|
@ -283,7 +276,6 @@ disk_root_part_b_device() { |
|
|
|
disk_get_part_device "${MENDER_ROOTFS_PART_B_NUMBER}" "MENDER_ROOTFS_PART_B" |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Get device partition number from device path. |
|
|
|
# Unrecognized or unsupported device paths will generate an error |
|
|
|
# |
|
|
@ -350,7 +342,6 @@ disk_get_device_base() { |
|
|
|
fi |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Conditionally redefine partition number/device if fine grained variable set. |
|
|
|
# |
|
|
|
# $1 - variable name |
|
|
|