mount_digiparts.sh: add support to dualboot volumes on read-only mode
This commit allows to mount only the linux partition active in read-only mode. https://onedigi.atlassian.net/browse/DEL-8193 Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
This commit is contained in:
parent
5be7db1f9f
commit
4d07069448
|
|
@ -26,12 +26,25 @@ elif [ "${SUBSYSTEM}" = "ubi" ]; then
|
||||||
PARTNAME="$(cat /sys/${DEVPATH}/name)"
|
PARTNAME="$(cat /sys/${DEVPATH}/name)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
MOUNT_FOLDER=${PARTNAME}
|
||||||
MOUNT_PARAMS="-o silent"
|
MOUNT_PARAMS="-o silent"
|
||||||
# Mount 'linux' partition as read-only
|
# Mount 'linux' partition as read-only
|
||||||
if [ "${PARTNAME}" = "linux" ]; then
|
if [ "${PARTNAME}" = "linux" ] || [ "${PARTNAME}" = "linux_a" ] || [ "${PARTNAME}" = "linux_b" ]; then
|
||||||
|
MOUNT_FOLDER="linux"
|
||||||
MOUNT_PARAMS="${MOUNT_PARAMS} -o ro"
|
MOUNT_PARAMS="${MOUNT_PARAMS} -o ro"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
DUALBOOT_MODE="$(fw_printenv -n dualboot 2>/dev/null)"
|
||||||
|
if [ "${DUALBOOT_MODE}" = "yes" ]; then
|
||||||
|
if [ "${PARTNAME}" = "linux_a" ] || [ "${PARTNAME}" = "linux_b" ]; then
|
||||||
|
ACTIVE_SYSTEM="$(fw_printenv -n active_system 2>/dev/null)"
|
||||||
|
if [ "${ACTIVE_SYSTEM}" != "${PARTNAME}" ]; then
|
||||||
|
logger "Skip mount partition '${PARTNAME}', because it is not the active system"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "x$BASE_INIT" = "x$INIT_SYSTEMD" ];then
|
if [ "x$BASE_INIT" = "x$INIT_SYSTEMD" ];then
|
||||||
# systemd as init uses systemd-mount to mount block devices
|
# systemd as init uses systemd-mount to mount block devices
|
||||||
MOUNT="/usr/bin/systemd-mount"
|
MOUNT="/usr/bin/systemd-mount"
|
||||||
|
|
@ -57,7 +70,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create mount point if needed
|
# Create mount point if needed
|
||||||
MOUNTPOINT="/mnt/${PARTNAME}"
|
MOUNTPOINT="/mnt/${MOUNT_FOLDER}"
|
||||||
[ -d "${MOUNTPOINT}" ] || mkdir -p ${MOUNTPOINT}
|
[ -d "${MOUNTPOINT}" ] || mkdir -p ${MOUNTPOINT}
|
||||||
|
|
||||||
if [ "${SUBSYSTEM}" = "block" ]; then
|
if [ "${SUBSYSTEM}" = "block" ]; then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue