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 <gabriel.valcazar@digi.com>
(cherry picked from commit 9a7ea10a4dfb74651f865f125372604fe6840a10)
This commit is contained in:
Gabriel Valcazar 2022-04-05 12:34:51 +02:00
parent bdbcadb44e
commit 600c3d7790
1 changed files with 4 additions and 2 deletions

View File

@ -3,7 +3,7 @@
# #
# mount_bootparts.sh # mount_bootparts.sh
# #
# Copyright (C) 2014-2019 by Digi International Inc. # Copyright (C) 2014-2022 by Digi International Inc.
# All rights reserved. # All rights reserved.
# #
# This program is free software; you can redistribute it and/or modify it # This program is free software; you can redistribute it and/or modify it
@ -56,6 +56,8 @@ else
fi fi
fi fi
SINGLEMTDSYS="$(fw_printenv -n singlemtdsys 2>/dev/null)"
# Create mount point if needed # Create mount point if needed
MOUNTPOINT="/mnt/${PARTNAME}" MOUNTPOINT="/mnt/${PARTNAME}"
[ -d "${MOUNTPOINT}" ] || mkdir -p ${MOUNTPOINT} [ -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" logger -t udev "ERROR: Could not mount '${PARTNAME}' partition, volume not found"
rmdir --ignore-fail-on-non-empty ${MOUNTPOINT} rmdir --ignore-fail-on-non-empty ${MOUNTPOINT}
fi fi
elif [ "${SUBSYSTEM}" = "ubi" ]; then elif [ "${SUBSYSTEM}" = "ubi" ] && [ "${SINGLEMTDSYS}" = "yes" ]; then
# In the case of a 'system' partition with many UBI volumes, the device # In the case of a 'system' partition with many UBI volumes, the device
# is always /dev/ubi0 # is always /dev/ubi0
# Mount the volume. # Mount the volume.