summaryrefslogtreecommitdiff
path: root/recipes-core
diff options
context:
space:
mode:
authorJeff Hatch <jhatch@multitech.com>2022-05-24 12:36:48 -0500
committerJeff Hatch <jhatch@multitech.com>2022-05-24 12:36:48 -0500
commit6f469742726c76af64736215ed34e1349be233fe (patch)
tree33dcc332265c0966b87d094bac85e40228b15f18 /recipes-core
parentb2214bae4b5bb177642eeb9f4a27f8b9bcf9c36f (diff)
parent92044fca6a009f99af1fb9df1eb86d3992d7c7eb (diff)
downloadmeta-mlinux-6f469742726c76af64736215ed34e1349be233fe.tar.gz
meta-mlinux-6f469742726c76af64736215ed34e1349be233fe.tar.bz2
meta-mlinux-6f469742726c76af64736215ed34e1349be233fe.zip
Merge branch 'mpower-dev-nxp' into 6
Diffstat (limited to 'recipes-core')
-rw-r--r--recipes-core/base-files/fstab-ubifs/fstab4
-rw-r--r--recipes-core/base-files/fstab-ubifs_1.0.bb2
-rw-r--r--recipes-core/multitech/overlayfs-init-ubi/overlayfs.init27
-rw-r--r--recipes-core/multitech/overlayfs-init-ubi_0.1.bb2
-rw-r--r--recipes-core/sysvinit/sysvinit/bootlogd-support-more-console-names.patch66
-rw-r--r--recipes-core/sysvinit/sysvinit_2.96.bbappend10
-rw-r--r--recipes-core/udev/eudev/ubi.rules7
-rw-r--r--recipes-core/udev/eudev_%.bbappend4
8 files changed, 96 insertions, 26 deletions
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"
diff --git a/recipes-core/multitech/overlayfs-init-ubi/overlayfs.init b/recipes-core/multitech/overlayfs-init-ubi/overlayfs.init
index 7fc7f7e..f19abef 100644
--- a/recipes-core/multitech/overlayfs-init-ubi/overlayfs.init
+++ b/recipes-core/multitech/overlayfs-init-ubi/overlayfs.init
@@ -12,7 +12,7 @@ USER_PARTITION="ubi0:user-data"
# Erase the file system
DO_ERASE_PERSISTENT="/mnt/user/.persistent/mts_do_erase_persistent"
# Remove files not hidden
-DO_CLEAR_PERSISTENT="/mnt/user/.persistent/mts_do_clear_persistent"
+DO_CLEAR_PERSISTENT=$(fw_printenv default_reset_f | cut -d '"' -f2 | grep -Eo '[0-9]+$' || true)
pid=$$
prefix="<3>overlayrootfs-generator[${pid}]: "
@@ -31,7 +31,7 @@ mnt_user() {
mount -t ubifs $USER_PARTITION $MNT_USER
}
-fs="/run /dev /proc /sys /sys/kernel/security /dev/shm /dev/pts /run /sys/fs/cgroup /sys/fs/cgroup/unified
+fs="/run /dev /proc /sys /sys/kernel/security /dev/shm /dev/pts /sys/fs/cgroup /sys/fs/cgroup/unified
/sys/fs/cgroup/systemd /sys/fs/cgroup/devices /sys/fs/cgroup/freezer /sys/fs/cgroup/pids /sys/fs/cgroup/memory
/dev/mqueue /sys/kernel/debug /tmp /sys/fs/fuse/connections /sys/kernel/config /var/volatile"
@@ -69,7 +69,7 @@ do_clear_old() {
mv "$FILE_PATH" "$MNT_USER/$FILE_NAME.old" 2>&1 | logpipe
done
do_remove_old
- rm -f $DO_CLEAR_PERSISTENT
+ fw_setenv default_reset_f 0
}
# Most efficient way to clear UBIFS file system
@@ -99,7 +99,7 @@ do_rw_mount() {
if [[ -f $DO_ERASE_PERSISTENT ]] ; then
do_erase_old
- elif [[ -f $DO_CLEAR_PERSISTENT ]] ; then
+ elif [[ "$DO_CLEAR_PERSISTENT" -eq 1 ]] ; then
do_clear_old
fi
@@ -122,31 +122,14 @@ do_rw_mount() {
umount -l /var/volatile >/dev/null 2>&1
cgroupmnts=$(sed -r -e 's/[^[:space:]]*[[:space:]]//' -e 's/[[:space:]]+.*//g' /proc/mounts | grep '^/orig')
for mp in ${cgroupmnts} ; do
- if [[ $mp != /orig ]] && [[ -d $mp ]] ; then
+ if [[ $mp != /orig ]] && [[ $mp != /orig/mnt* ]] && [[ -d $mp ]] ; then
umount -l $mp >/dev/null 2>&1
fi
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
diff --git a/recipes-core/multitech/overlayfs-init-ubi_0.1.bb b/recipes-core/multitech/overlayfs-init-ubi_0.1.bb
index a14ed2e..b2d98af 100644
--- a/recipes-core/multitech/overlayfs-init-ubi_0.1.bb
+++ b/recipes-core/multitech/overlayfs-init-ubi_0.1.bb
@@ -3,7 +3,7 @@ HOMEPAGE = "http://www.multitech.com/"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
PACKAGE_ARCH = "all"
-PR = "r5"
+PR = "7"
RDEPENDS_${PN} += "bash"
SRC_URI = " \
diff --git a/recipes-core/sysvinit/sysvinit/bootlogd-support-more-console-names.patch b/recipes-core/sysvinit/sysvinit/bootlogd-support-more-console-names.patch
new file mode 100644
index 0000000..2286750
--- /dev/null
+++ b/recipes-core/sysvinit/sysvinit/bootlogd-support-more-console-names.patch
@@ -0,0 +1,66 @@
+From 8a085ea9b7f2d8e59cbf17e9c04b155fddab4dd9 Mon Sep 17 00:00:00 2001
+From: Jesse Smith <jsmith@resonatingmedia.com>
+Date: Tue, 3 Aug 2021 18:21:16 -0300
+Subject: Applied patch from Matthias Schiffer which allows bootlogd to read
+ from a wider range of consoles. The console name is already passed in from
+ the kernel command line using "console=". We no longer filter out names as
+ strictly but do now check to confirm the "console=" device points to a valid
+ TTY.
+
+---
+ src/bootlogd.c | 25 ++++++++++++++++++++++++-
+ 1 file changed, 24 insertions(+), 1 deletion(-)
+
+diff --git a/src/bootlogd.c b/src/bootlogd.c
+index 787db87..78e4c81 100644
+--- a/src/bootlogd.c
++++ b/src/bootlogd.c
+@@ -212,6 +212,22 @@ int findpty(int *master, int *slave, char *name)
+
+ return 0;
+ }
++
++static int istty(const char *dev)
++{
++ int fd, ret;
++
++ fd = open(dev, O_RDONLY|O_NONBLOCK);
++ if (fd < 0)
++ return 0;
++
++ ret = isatty(fd);
++
++ close(fd);
++
++ return ret;
++}
++
+ /*
+ * See if a console taken from the kernel command line maps
+ * to a character device we know about, and if we can open it.
+@@ -228,7 +244,7 @@ int isconsole(char *s, char *res, int rlen)
+ l = strlen(c->cmdline);
+ if (sl <= l) continue;
+ p = s + l;
+- if (strncmp(s, c->cmdline, l) != 0 || !isdigit(*p))
++ if (strncmp(s, c->cmdline, l) != 0)
+ continue;
+ for (i = 0; i < 2; i++) {
+ snprintf(res, rlen, i ? c->dev1 : c->dev2, p);
+@@ -239,6 +255,13 @@ int isconsole(char *s, char *res, int rlen)
+ }
+ }
+ }
++
++ /* Fallback: accept any TTY device */
++ snprintf(res, rlen, "/dev/%s", s);
++ if ((q = strchr(res, ',')) != NULL) *q = 0;
++ if (istty(res))
++ return 1;
++
+ return 0;
+ }
+
+--
+cgit v1.1
+
diff --git a/recipes-core/sysvinit/sysvinit_2.96.bbappend b/recipes-core/sysvinit/sysvinit_2.96.bbappend
new file mode 100644
index 0000000..1f30887
--- /dev/null
+++ b/recipes-core/sysvinit/sysvinit_2.96.bbappend
@@ -0,0 +1,10 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+# Backport from sysvinit 3.00. Remove bbappend when updating the main recipe to
+# 3.00 or newer.
+
+PR = "r0"
+
+SRC_URI_append = " \
+ file://bootlogd-support-more-console-names.patch \
+"
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 f669a76..a7b0d67 100644
--- a/recipes-core/udev/eudev_%.bbappend
+++ b/recipes-core/udev/eudev_%.bbappend
@@ -6,6 +6,7 @@ PR .= ".mlinux8"
# 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/
+}