Skip to content

Commit 0baf22b

Browse files
committed
init: use char device for jffs2 format on config
1 parent ee72ebc commit 0baf22b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

overlay/lower/init

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ mount -t proc proc /proc || exit 1
1111
grep -q 'root=.*nfs\|mmcblk\|ram' /proc/cmdline && exit 0
1212
grep -q overlay /proc/filesystems || exit 1
1313

14-
configfs_dev=$(awk '$4 ~ /"config"/ {gsub(":","",$1); print "/dev/mtdblock" substr($1,4)}' /proc/mtd)
14+
configfs_dev=$(awk -F ':' '/config/ {print $1}' /proc/mtd)
15+
configfs_blk=$(awk '$4 ~ /"config"/ {gsub(":","",$1); print "/dev/mtdblock" substr($1,4)}' /proc/mtd)
1516
if [ -n "$configfs_dev" ]; then
16-
mount -t jffs2 "$configfs_dev" /config
17+
mount -t jffs2 "$configfs_block" /config
1718
if ! grep -q " /config " /proc/mounts; then
1819
echo "Init: Invalid config partition detected. Formatting..."
1920
flash_eraseall -j "$configfs_dev"
20-
mount -t jffs2 "$configfs_dev" /config
21+
mount -t jffs2 "$configfs_blk" /config
2122
grep -q " /config " /proc/mounts || \
2223
echo "Init: ERROR: Failed to mount config partition after format!"
2324
fi

0 commit comments

Comments
 (0)