From ba35462741987d9aac561272ce72c8bc0ee650bd Mon Sep 17 00:00:00 2001 From: Serhii Voloshynov Date: Fri, 26 Nov 2021 11:33:41 +0200 Subject: add udev rules for ubi partitions. it creates links /dev/ubi_config1 -> ubi0_4 /dev/ubi_config2 -> ubi0_5 /dev/ubi_oem1 -> ubi0_6 /dev/ubi_oem2 -> ubi0_7 /dev/ubi_rootfs1 -> ubi0_2 /dev/ubi_rootfs2 -> ubi0_3 /dev/ubi_uenv1 -> ubi0_0 /dev/ubi_uenv2 -> ubi0_1 /dev/ubi_user-data -> ubi0_8 --- recipes-core/udev/eudev/ubi.rules | 7 +++++++ recipes-core/udev/eudev_%.bbappend | 4 ++++ 2 files changed, 11 insertions(+) create mode 100644 recipes-core/udev/eudev/ubi.rules (limited to 'recipes-core') diff --git a/recipes-core/udev/eudev/ubi.rules b/recipes-core/udev/eudev/ubi.rules new file mode 100644 index 0000000..f681e27 --- /dev/null +++ b/recipes-core/udev/eudev/ubi.rules @@ -0,0 +1,7 @@ +SUBSYSTEM!="ubi", GOTO="ubi_end" +# only ubi devices +KERNEL!="ubi*", GOTO="ubi_end" + +SUBSYSTEM=="ubi", KERNEL=="ubi*_*", SYMLINK+="ubi_%s{name}" + +LABEL="ubi_end" diff --git a/recipes-core/udev/eudev_%.bbappend b/recipes-core/udev/eudev_%.bbappend index 364288e..539cfb2 100644 --- a/recipes-core/udev/eudev_%.bbappend +++ b/recipes-core/udev/eudev_%.bbappend @@ -6,6 +6,7 @@ PR .= ".mlinux7" # add custom rules for persistent modem device names SRC_URI += "file://cellular_radios.rules \ file://cellular_radios.sh \ + file://ubi.rules \ file://${MACHINE}.rules" do_install_append() { @@ -15,4 +16,7 @@ do_install_append() { install -m 755 ${WORKDIR}/cellular_radios.sh ${D}${sysconfdir}/udev/scripts/ } +do_install_append_mtcap3() { + install -m 644 ${WORKDIR}/ubi.rules ${D}${sysconfdir}/udev/rules.d/ +} -- cgit v1.2.3 From 3908aa3d25d583420d36976bc1a2f11f38b5410d Mon Sep 17 00:00:00 2001 From: Serhii Voloshynov Date: Fri, 26 Nov 2021 11:33:41 +0200 Subject: remove fstab manipulation --- .../multitech/overlayfs-init-ubi/overlayfs.init | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'recipes-core') diff --git a/recipes-core/multitech/overlayfs-init-ubi/overlayfs.init b/recipes-core/multitech/overlayfs-init-ubi/overlayfs.init index 7fc7f7e..0000f29 100644 --- a/recipes-core/multitech/overlayfs-init-ubi/overlayfs.init +++ b/recipes-core/multitech/overlayfs-init-ubi/overlayfs.init @@ -128,25 +128,8 @@ do_rw_mount() { done } - -TMP=/var/volatile -# Set the suffix number in /var/oem and /var/config to match root -fix_volume_names() { - if ! [[ $(cat /proc/cmdline) =~ root=ubi0:rootfs([0-9]+) ]] ; then - loginfo "Cannot find root=ubi0:rootfs in /proc/cmdline" - fi - vol_suffix=${BASH_REMATCH[1]} - echo $vol_suffix - sed -r "s/(ubi0:(oem|config))([0-9]*)/\1${vol_suffix}/" /etc/fstab >${TMP}/fstab - if ! cmp ${TMP}/fstab /etc/fstab ; then - loginfo "Updating fstab with new volume names" - cp ${TMP}/fstab /etc/fstab - fi -} - do_start() { do_rw_mount - fix_volume_names } case $1 in -- cgit v1.2.3 From 1049c2fd703c28fb688d3e75538534cc6e32445f Mon Sep 17 00:00:00 2001 From: Serhii Kostiuk Date: Mon, 6 Dec 2021 16:02:44 +0200 Subject: MTCAP3: Fix fstab after introducing reduntant partitions Commit 3908aa3d25d583420d36976bc1a2f11f38b5410d removes the fstab manipulation. In mPower the configuration partition is selected during boot time from config.init, without modifying fstab, which in turn saves the flash erase cycles by not making nay changes on rootfs/overlay. This commit updates the fstab to permanently use the first configuration partition as /var/config. The second partition is not used in mLinux. This approach is similar to the one for mLinux on MTCDT3. If one needs a config partition switchover on mLinux - please implement it in a similar manner to mPower, wihout making changes on rootfs during boot. --- recipes-core/base-files/fstab-ubifs/fstab | 4 ++-- recipes-core/base-files/fstab-ubifs_1.0.bb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'recipes-core') diff --git a/recipes-core/base-files/fstab-ubifs/fstab b/recipes-core/base-files/fstab-ubifs/fstab index 8cca798..4560bb3 100644 --- a/recipes-core/base-files/fstab-ubifs/fstab +++ b/recipes-core/base-files/fstab-ubifs/fstab @@ -6,5 +6,5 @@ tmpfs /run tmpfs mode=0755,nodev,nosuid,stri tmpfs /var/volatile tmpfs defaults 0 0 configfs /sys/kernel/config configfs defaults 0 0 -ubi0:config /var/config ubifs defaults 0 0 -ubi0:oem /var/oem ubifs defaults,ro 0 0 +ubi0:config1 /var/config ubifs defaults 0 0 +ubi0:oem1 /var/oem ubifs defaults,ro 0 0 diff --git a/recipes-core/base-files/fstab-ubifs_1.0.bb b/recipes-core/base-files/fstab-ubifs_1.0.bb index cd2102a..533293a 100644 --- a/recipes-core/base-files/fstab-ubifs_1.0.bb +++ b/recipes-core/base-files/fstab-ubifs_1.0.bb @@ -1,7 +1,7 @@ LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" inherit allarch -PR = "r1" +PR = "r2" FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" PROVIDES = "fstab" DEPENDS = "base-files" -- cgit v1.2.3