summaryrefslogtreecommitdiff
path: root/recipes-core/multitech
diff options
context:
space:
mode:
authorJeff Hatch <jhatch@multitech.com>2020-06-04 14:22:33 -0500
committerJeff Hatch <jhatch@multitech.com>2020-06-04 14:22:33 -0500
commit44b321b521cf857f6cf3cd8bb7ba8baf8dae1182 (patch)
treebc36b243d8f4ef9535c7c500b9ffcb96885df61e /recipes-core/multitech
parent683182b8eb2fa4cee10369d068d88084864d8be9 (diff)
parent432af19f672a64228e1b70b0b25abb5a0ee7ee30 (diff)
downloadmeta-mlinux-44b321b521cf857f6cf3cd8bb7ba8baf8dae1182.tar.gz
meta-mlinux-44b321b521cf857f6cf3cd8bb7ba8baf8dae1182.tar.bz2
meta-mlinux-44b321b521cf857f6cf3cd8bb7ba8baf8dae1182.zip
Merge branch 'test-split'
Merge changes for the move to Yocto Thud
Diffstat (limited to 'recipes-core/multitech')
-rw-r--r--recipes-core/multitech/config/config.init36
-rw-r--r--recipes-core/multitech/config_2.3.bb2
2 files changed, 30 insertions, 8 deletions
diff --git a/recipes-core/multitech/config/config.init b/recipes-core/multitech/config/config.init
index d821f4c..27b067f 100644
--- a/recipes-core/multitech/config/config.init
+++ b/recipes-core/multitech/config/config.init
@@ -41,10 +41,21 @@ mount_config() {
mkdir -p ${CONFIG_DIR}
mount ${CONFIG_DIR}
- # Prepare flash for JFFS2 if mount fails
+ # Prepare flash for JFFS2 or EXT4 if mount fails
if [ $? -ne 0 ]; then
echo "Creating ${CONFIG_DIR}"
- flash_erase -j ${CONFIG_MTDC} 0 0
+ fs=$(mount -fvn ${CONFIG_DIR})
+ if [[ $fs =~ [[:space:]]*(/dev/(...)[^[:space:]]*) ]] ; then
+ if [[ ${BASH_REMATCH[2]} == mmc ]] ; then
+ # One more check for empty
+ mdev="${BASH_REMATCH[1]}"
+ if [[ $(dd if=$mdev count=4 2>/dev/null | tr -d '\0' | wc -c) == 0 ]] ; then
+ mkfs.ext4 -O 64bit ${mdev}
+ fi
+ else
+ flash_erase -j ${CONFIG_MTDC} 0 0
+ fi
+ fi
mount ${CONFIG_DIR}
fi
}
@@ -54,10 +65,21 @@ mount_oem() {
mkdir -p ${OEM_DIR}
mount ${OEM_DIR}
- # Prepare flash for JFFS2 if mount fails
+ # Prepare flash for JFFS2 or EXT4 if mount fails
+ # Prepare flash for JFFS2 or EXT4 if mount fails
if [ $? -ne 0 ]; then
echo "Creating ${OEM_DIR}"
- flash_erase -j ${OEM_MTDC} 0 0
+ fs=$(mount -fvn ${OEM_DIR})
+ if [[ $fs =~ [[:space:]]*(/dev/(...)[^[:space:]]*) ]] ; then
+ if [[ ${BASH_REMATCH[2]} == mmc ]] ; then
+ mdev="${BASH_REMATCH[1]}"
+ if [[ $(dd if=$mdev count=4 2>/dev/null | tr -d '\0' | wc -c) == 0 ]] ; then
+ mkfs.ext4 -O 64bit ${mdev}
+ fi
+ else
+ flash_erase -j ${OEM_MTDC} 0 0
+ fi
+ fi
mount ${OEM_DIR}
fi
}
@@ -65,15 +87,15 @@ mount_oem() {
case $1 in
start)
# mount config if not already mounted
- if ! grep -q "^${CONFIG_MTDB} " /proc/mounts; then
+ if ! grep -q " ${CONFIG_DIR} " /proc/mounts; then
mount_config
else
echo "$CONFIG_DIR already mounted"
fi
# mount oem if specified in /etc/fstab and it isn't already mounted
- if grep -qE "^${OEM_MTDB}\s+${OEM_DIR}\s+" /etc/fstab; then
- if ! grep -q "^${OEM_MTDB} " /proc/mounts; then
+ if mount -fvn "${OEM_DIR}" ; then
+ if ! grep -q " ${OEM_DIR} " /proc/mounts; then
mount_oem
else
echo "$OEM_DIR already mounted"
diff --git a/recipes-core/multitech/config_2.3.bb b/recipes-core/multitech/config_2.3.bb
index 3e9733a..629cd72 100644
--- a/recipes-core/multitech/config_2.3.bb
+++ b/recipes-core/multitech/config_2.3.bb
@@ -3,10 +3,10 @@ SECTION = "base"
LICENSE = "MIT"
RDEPENDS_${PN} += "bash"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
-PACKAGE_ARCH = "all"
PR = "r7"
PACKAGES =+ "${PN}-mths"
inherit update-rc.d
+inherit allarch
INITSCRIPT_NAME = "config"
INITSCRIPT_PARAMS = "start 31 S ."