[06/17] meta-isar: deploy-image: Improve root mountpoint discovery

Message ID 4f3c5e331c7d117a5066bb804e83b98a698427f6.1719927511.git.jan.kiszka@siemens.com
State Accepted, archived
Headers show
Series Reworks, fixes and unattended mode for image installer | expand

Commit Message

Jan Kiszka July 2, 2024, 1:38 p.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

The rootfs mountpoint may only appear as /dev/root in /proc/mounts.
Therefore, reuse the pattern we have in expand-on-first-boot already and
switch to findmnt.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 .../recipes-installer/deploy-image/files/deploy-image-wic.sh    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/meta-isar/recipes-installer/deploy-image/files/deploy-image-wic.sh b/meta-isar/recipes-installer/deploy-image/files/deploy-image-wic.sh
index d27a0189..f73a48a9 100644
--- a/meta-isar/recipes-installer/deploy-image/files/deploy-image-wic.sh
+++ b/meta-isar/recipes-installer/deploy-image/files/deploy-image-wic.sh
@@ -25,7 +25,7 @@  DISK_BMAP=$(find "$installdata" -type f -iname "${DISK_IMAGE%.wic*}.wic.bmap")
 # inspired by poky/meta/recipes-core/initrdscripts/files/install-efi.sh
 
 target_device_list=""
-current_root_dev=$(grep "[[:blank:]]/[[:blank:]]" /proc/mounts | awk '{print $1}')
+current_root_dev=$(readlink -f "$(findmnt / -o source -n)")
 current_root_dev=${current_root_dev#\/dev/}
 case $current_root_dev in
     mmcblk*)