From b37cbc26c30e7acb556819da3be8636365194f5b Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 26 Jul 2016 12:23:26 +0200 Subject: [PATCH] base-files: fix resize-ext4fs script to work with DM devices This is needed so the encrypted rootfs is properly resized to the partition size. https://jira.digi.com/browse/DEL-2765 Signed-off-by: Javier Viguera --- .../recipes-core/base-files/base-files/resize-ext4fs.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta-digi-dey/recipes-core/base-files/base-files/resize-ext4fs.sh b/meta-digi-dey/recipes-core/base-files/base-files/resize-ext4fs.sh index 1f726b37a..74ce0a3f3 100755 --- a/meta-digi-dey/recipes-core/base-files/base-files/resize-ext4fs.sh +++ b/meta-digi-dey/recipes-core/base-files/base-files/resize-ext4fs.sh @@ -26,9 +26,12 @@ get_emmc_block_device() { } RESIZE2FS="$(which resize2fs)" +DM_BLOCK_DEVICE="/dev/dm-" EMMC_BLOCK_DEVICE="$(get_emmc_block_device)" if [ -x "${RESIZE2FS}" -a -n "${EMMC_BLOCK_DEVICE}" ]; then PARTITIONS="$(blkid | sed -ne "{s,\(^${EMMC_BLOCK_DEVICE}[^:]\+\):.*TYPE=\"ext4\".*,\1,g;T;p}" | sort -u)" + # Add possible device mapper devices + PARTITIONS="${PARTITIONS} $(blkid | sed -ne "{s,\(^${DM_BLOCK_DEVICE}[^:]\+\):.*TYPE=\"ext4\".*,\1,g;T;p}" | sort -u)" for i in ${PARTITIONS}; do if ! ${RESIZE2FS} ${i} 2>/dev/null; then echo "ERROR: resize2fs ${i}"