diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2021-03-04 11:58:38 +0100 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2021-03-23 17:35:47 +0100 |
commit | 9e73d9e41c263a066f92a169432fdf89e0e859b1 (patch) | |
tree | d5a1bd614e1224ffe5ada7869ab94a0438f5a75e /recipes-core/udev/files/mount.sh | |
parent | 6de3a976f695452c18c960c15d471d0f14262213 (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>
(cherry picked from commit 800cf9fa2d4b023a55637a8b0f59904373476633)
Diffstat (limited to 'recipes-core/udev/files/mount.sh')
-rw-r--r-- | recipes-core/udev/files/mount.sh | 2 |
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 |