recovery-initramfs: add script and mdev rule for UBI volumes
On systems with a single MTD system partition and multiple UBI volumes, the initramdisk doesn't mount the 'update' partition because mdev rules only trigger events for MTD partitions. This commit adds a rule to trigger an event for every /dev/ubi0_x (every UBI volume on ubi0 device) and call the new automount_ubi.sh script. The script checks if the volume is called 'update' and if so, it creates /mnt/update mountpoint and mounts the volume. Signed-off-by: Hector Palacios <hector.palacios@digi.com> https://onedigi.atlassian.net/browse/DEL-8297 (cherry picked from commit df9c622b1bf0a7307c61deda12cf1f67d4f630f0)
This commit is contained in:
parent
f6eeb0fdfb
commit
8b8f9560af
|
|
@ -15,6 +15,7 @@ SRC_URI = " \
|
|||
file://swupdate.cfg \
|
||||
file://automount_block.sh \
|
||||
file://automount_mtd.sh \
|
||||
file://automount_ubi.sh \
|
||||
file://mdev.conf \
|
||||
${@bb.utils.contains('STORAGE_MEDIA', 'mmc', 'file://mount_cryptrootfs.sh', '', d)} \
|
||||
"
|
||||
|
|
@ -31,6 +32,7 @@ do_install() {
|
|||
install -d ${D}${base_libdir}/mdev
|
||||
install -m 0755 ${WORKDIR}/automount_block.sh ${D}${base_libdir}/mdev/automount_block.sh
|
||||
install -m 0755 ${WORKDIR}/automount_mtd.sh ${D}${base_libdir}/mdev/automount_mtd.sh
|
||||
install -m 0755 ${WORKDIR}/automount_ubi.sh ${D}${base_libdir}/mdev/automount_ubi.sh
|
||||
install -m 0644 ${WORKDIR}/mdev.conf ${D}${sysconfdir}
|
||||
|
||||
# If Trustfence is enabled, copy the public key that is going to be used into the
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2023, Digi International Inc.
|
||||
#
|
||||
|
||||
UPDATE_MOUNTPOINT="/mnt/update"
|
||||
PARTITION_NAME="update"
|
||||
|
||||
# Check if there is a UBI volume called 'update'
|
||||
# (for single MTD systems).
|
||||
volname="$(ubinfo ${MDEV} | awk '$1=="Name:" {print $2}')"
|
||||
if [ "${volname}" = "${PARTITION_NAME}" ]; then
|
||||
if mkdir -p ${UPDATE_MOUNTPOINT} && ! mountpoint -q ${UPDATE_MOUNTPOINT}; then
|
||||
# Mount the volume.
|
||||
if ! mount -t ubifs "${MDEV}" "${UPDATE_MOUNTPOINT}"; then
|
||||
echo "ERROR: Could not mount '${PARTITION_NAME}' partition"
|
||||
rmdir --ignore-fail-on-non-empty ${UPDATE_MOUNTPOINT}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
|
@ -2,3 +2,4 @@
|
|||
sd[a-z][0-9]+ 0:0 660 */lib/mdev/automount_block.sh
|
||||
mmcblk[0-9]+p[0-9]+ 0:0 660 */lib/mdev/automount_block.sh
|
||||
mtd[0-9]+ 0:0 660 */lib/mdev/automount_mtd.sh
|
||||
ubi0_[0-9]+ 0:0 660 */lib/mdev/automount_ubi.sh
|
||||
|
|
|
|||
Loading…
Reference in New Issue