summaryrefslogtreecommitdiff
path: root/recipes-core/multitech
diff options
context:
space:
mode:
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 20080c1..fcb7f8b 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 ."