diff options
author | Ming Liu <ming.liu@toradex.com> | 2022-07-26 18:11:32 +0200 |
---|---|---|
committer | Ming Liu <ming.liu@toradex.com> | 2022-07-26 18:11:32 +0200 |
commit | 99d111468f748f55bbe2afaeb7cb4ef4b756e469 (patch) | |
tree | 502c979442e67a91c6a5a31f367c2f2c17f88045 | |
parent | a403bdf1785b7975411acc7c3a920bd52cfee5f2 (diff) |
udev-toradex-rules: fix a mountpoint issue
When toradex-mount-bootpart.sh is triggered by
bootpart-automount.rules, the mountpoint of boot partition might not be
created yet since "$MOUNT --no-block" is being used in
/etc/udev/scripts/mount.sh.
Let's change to calculate mountpoint from label and device name
instead.
Related-to: ELB-4620
Signed-off-by: Ming Liu <ming.liu@toradex.com>
-rwxr-xr-x | recipes-core/udev/files/toradex-mount-bootpart.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/recipes-core/udev/files/toradex-mount-bootpart.sh b/recipes-core/udev/files/toradex-mount-bootpart.sh index 965d747..8e2e596 100755 --- a/recipes-core/udev/files/toradex-mount-bootpart.sh +++ b/recipes-core/udev/files/toradex-mount-bootpart.sh @@ -8,8 +8,8 @@ BASEUUID=$(sed -r 's/^.*\broot=PARTUUID=([0-9a-f]+)-02.*$/\1/' /proc/cmdline) BOOTPART=$(readlink -f /dev/disk/by-partuuid/"${BASEUUID}-01") if [ x"$DEVNAME" = x"$BOOTPART" ]; then - MOUNTPOINT="$(lsblk -o MOUNTPOINT -nr "$DEVNAME" | head -1)" - MOUNTNAME="$(basename "$MOUNTPOINT")" + MOUNTNAME="$(/sbin/blkid | grep "$DEVNAME:" | grep -o 'LABEL=".*"' | cut -d '"' -f2)-$(basename "$DEVNAME")" + MOUNTPOINT="$(sed -n 's/MOUNT_BASE=\"\(.*\)\"/\1/p' /etc/udev/scripts/mount.sh)/$MOUNTNAME" BASE_INIT="$(readlink -f "@base_sbindir@/init")" INIT_SYSTEMD="@systemd_unitdir@/systemd" |