Hi,

could somebody please review this patch?

It is needed for Netgear, which has one more partition, so that
mtdblock5 is not the data partition.

bye
 Waldemar

-- 
don't open your wrt, free it
http://www.freewrt.org
Index: target/linux/brcm-2.4/squashfs-overlay/files/sbin/mount_root
===================================================================
--- target/linux/brcm-2.4/squashfs-overlay/files/sbin/mount_root        
(revision 942)
+++ target/linux/brcm-2.4/squashfs-overlay/files/sbin/mount_root        
(working copy)
@@ -57,7 +57,8 @@
 is_dirty
 [ $? != 0 ] && {
        echo "switching to overlay filesystem"
-       mount /dev/mtdblock/5 /jffs -t jffs2
+       datanr=$(awk -F : '/data/ { print $1 }' /proc/mtd |sed "s#mtd##")
+       mount /dev/mtdblock/$datanr /jffs -t jffs2
        mount -t mini_fo -o base=/,sto=/jffs /jffs /mnt
        pivot /mnt /rom
 } || {
Index: target/linux/brcm-2.4/squashfs-symlinks/files/sbin/mount_root
===================================================================
--- target/linux/brcm-2.4/squashfs-symlinks/files/sbin/mount_root       
(revision 942)
+++ target/linux/brcm-2.4/squashfs-symlinks/files/sbin/mount_root       
(working copy)
@@ -45,16 +45,17 @@
 size=$(awk '/Mem:/ {l=5242880;print((s=$2/2)<l)?$2-l:s}' /proc/meminfo)
 mount none /tmp -t tmpfs -o size=$size
 
+datanr=$(awk -F : '/data/ { print $1 }' /proc/mtd |sed "s#mtd##")
 mtd unlock linux
 is_dirty
 [ $? != 0 ] && {
        echo "switching to jffs2 filesystem"
-       mount -t jffs2 /dev/mtdblock/5 /jffs
+       mount -t jffs2 /dev/mtdblock/$datanr /jffs
        pivot /jffs /rom
 } || {
        echo "jffs2 unusable; setting up symlinks"
        mtd erase data
-       mount -t jffs2 /dev/mtdblock/5 /jffs
+       mount -t jffs2 /dev/mtdblock/$datanr /jffs
        dupe /jffs /
        pivot /jffs /rom
        jffs2root --clean
_______________________________________________
freewrt-developers mailing list
[email protected]
https://www.freewrt.org/lists/listinfo/freewrt-developers

Reply via email to