[no ci] Overlay: update init

pull/1546/head
viktorxda 2024-09-09 23:51:07 +02:00 committed by GitHub
parent 88d3b1486b
commit 4686b962b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -17,6 +17,7 @@ if ! grep -q 'root=.*nfs\|mmcblk\|ram' /proc/cmdline; then
mtdblkdev=$(awk -F ':' '/rootfs_data/ {print $1}' /proc/mtd | sed 's/mtd/mtdblock/') mtdblkdev=$(awk -F ':' '/rootfs_data/ {print $1}' /proc/mtd | sed 's/mtd/mtdblock/')
mtdchrdev=$(grep 'rootfs_data' /proc/mtd | cut -d: -f1) mtdchrdev=$(grep 'rootfs_data' /proc/mtd | cut -d: -f1)
if ! mount -t jffs2 /dev/$mtdblkdev /overlay || dmesg | grep -q "jffs2.*: Magic bitmask.*not found"; then if ! mount -t jffs2 /dev/$mtdblkdev /overlay || dmesg | grep -q "jffs2.*: Magic bitmask.*not found"; then
mountpoint -q /overlay && umount /overlay
echo "Formatting flash..." echo "Formatting flash..."
grep -q 'nand' /proc/cmdline || jffs2="-j" grep -q 'nand' /proc/cmdline || jffs2="-j"
flash_eraseall $jffs2 /dev/$mtdchrdev flash_eraseall $jffs2 /dev/$mtdchrdev