From 600c3d77902809c76c3a2237199468ccc3aeec88 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Tue, 5 Apr 2022 12:34:51 +0200 Subject: [PATCH] mount_digiparts.sh: run single MTD layout code path only when appropriate This code path was added in the context of single MTD layout support for ccimx6ul boards, but it was being executed in the default storage layout use case as well. This could trigger a race condition in which one code path deletes the mount point while the other one is still setting it up, causing partitions to not be mounted automatically (specifically, the "update" partition). Since both code paths are mutually exclusive in our implementation, reflect this by making sure that the single MTD layout path is executed only when said layout is enabled in the U-Boot environment. https://onedigi.atlassian.net/browse/DEL-7827 Signed-off-by: Gabriel Valcazar (cherry picked from commit 9a7ea10a4dfb74651f865f125372604fe6840a10) --- .../recipes-core/udev/udev-extraconf/mount_digiparts.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meta-digi-arm/recipes-core/udev/udev-extraconf/mount_digiparts.sh b/meta-digi-arm/recipes-core/udev/udev-extraconf/mount_digiparts.sh index a7a706f53..b45c46351 100644 --- a/meta-digi-arm/recipes-core/udev/udev-extraconf/mount_digiparts.sh +++ b/meta-digi-arm/recipes-core/udev/udev-extraconf/mount_digiparts.sh @@ -3,7 +3,7 @@ # # mount_bootparts.sh # -# Copyright (C) 2014-2019 by Digi International Inc. +# Copyright (C) 2014-2022 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -56,6 +56,8 @@ else fi fi +SINGLEMTDSYS="$(fw_printenv -n singlemtdsys 2>/dev/null)" + # Create mount point if needed MOUNTPOINT="/mnt/${PARTNAME}" [ -d "${MOUNTPOINT}" ] || mkdir -p ${MOUNTPOINT} @@ -91,7 +93,7 @@ elif [ "${SUBSYSTEM}" = "mtd" ]; then logger -t udev "ERROR: Could not mount '${PARTNAME}' partition, volume not found" rmdir --ignore-fail-on-non-empty ${MOUNTPOINT} fi -elif [ "${SUBSYSTEM}" = "ubi" ]; then +elif [ "${SUBSYSTEM}" = "ubi" ] && [ "${SINGLEMTDSYS}" = "yes" ]; then # In the case of a 'system' partition with many UBI volumes, the device # is always /dev/ubi0 # Mount the volume.