summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2021-03-04 11:58:38 +0100
committerMax Krummenacher <max.krummenacher@toradex.com>2021-03-04 20:22:28 +0100
commit800cf9fa2d4b023a55637a8b0f59904373476633 (patch)
tree35bb4e3e54991e6a7fe4507e3a99606fe6af892b
parentd87faee758c3b37797f0dc53e4486d5f82a48173 (diff)
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 <max.krummenacher@toradex.com>
-rw-r--r--recipes-core/udev/files/mount.sh2
1 files changed, 1 insertions, 1 deletions
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