Message ID | dd0af28b84c5baf56e9b86237768262f2ef51803.1733151072.git.jan.kiszka@siemens.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Various initramfs hook improvements | expand |
diff --git a/recipes-initramfs/initramfs-crypt-hook/files/encrypt_partition.script b/recipes-initramfs/initramfs-crypt-hook/files/encrypt_partition.script index 2cd6798d..28548502 100644 --- a/recipes-initramfs/initramfs-crypt-hook/files/encrypt_partition.script +++ b/recipes-initramfs/initramfs-crypt-hook/files/encrypt_partition.script @@ -62,7 +62,7 @@ service_watchdog() { } reencrypt_existing_partition() { - part_size_blocks="$(cat /sys/class/block/"$(awk -v dev="$1" 'BEGIN{split(dev,a,"/"); print a[3]}' )"/size)" + part_size_blocks="$(cat /sys/class/block/"${1##*/}"/size)" # reduce the filesystem and partition by 32M to fit the LUKS header partition_fstype=$(get_fstype "${1}") reduce_device_size=32768