From 800cf9fa2d4b023a55637a8b0f59904373476633 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Thu, 4 Mar 2021 11:58:38 +0100 Subject: udev: mount.sh: fix cmdline parsing On cmdlines with "root=" not at first position the current sed script fails to only provide the root partitions PARTUUID. Fix that. Fixes c8651fe ("udev: mount.sh: create a symlink to the partition with the bootfiles") Additionally add a word boundary \b before root and simplify sed script. This prevents nfsroot, extroot matching. Related-to: ELB-3337 Signed-off-by: Max Krummenacher --- recipes-core/udev/files/mount.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-core/udev/files/mount.sh b/recipes-core/udev/files/mount.sh index e179ec4..1e8bfa4 100644 --- a/recipes-core/udev/files/mount.sh +++ b/recipes-core/udev/files/mount.sh @@ -15,7 +15,7 @@ # expects 'root=PARTUUID=fe6beb3d-02' in /proc/cmdline -BASEUUID=$(sed 's/root=\([^[:space:]]*\).*/\1/ ; s/PARTUUID=\([0-9a-f]*\)-02/\1/' /proc/cmdline) +BASEUUID=$(sed -r 's/^.*\broot=PARTUUID=([0-9a-f]+)-02.*$/\1/' /proc/cmdline) if [ -b /dev/disk/by-partuuid/${BASEUUID}-02 ]; then BOOTPART=$(readlink -f /dev/disk/by-partuuid/${BASEUUID}-01) if [ x$DEVNAME = x$BOOTPART ]; then -- cgit v1.2.3