diff options
author | John Klug <john.klug@multitech.com> | 2021-10-05 13:52:03 -0500 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2021-10-05 13:52:35 -0500 |
commit | 657fc2cdcdfdc9d1e5db99d710ebe5af528ce62f (patch) | |
tree | c8a7e3a690869c1d18877703aabf7c449fd9114b /recipes-core | |
parent | a6cdadf7e033b59f17613e17dea46d411b14f5dd (diff) | |
download | meta-mlinux-657fc2cdcdfdc9d1e5db99d710ebe5af528ce62f.tar.gz meta-mlinux-657fc2cdcdfdc9d1e5db99d710ebe5af528ce62f.tar.bz2 meta-mlinux-657fc2cdcdfdc9d1e5db99d710ebe5af528ce62f.zip |
Add multiple rootfs/config/oem support
Diffstat (limited to 'recipes-core')
-rw-r--r-- | recipes-core/multitech/overlayfs-init-ubi/overlayfs.init | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/recipes-core/multitech/overlayfs-init-ubi/overlayfs.init b/recipes-core/multitech/overlayfs-init-ubi/overlayfs.init index 0000f29..7fc7f7e 100644 --- a/recipes-core/multitech/overlayfs-init-ubi/overlayfs.init +++ b/recipes-core/multitech/overlayfs-init-ubi/overlayfs.init @@ -128,8 +128,25 @@ 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 |