> regarding WL-700gE, I couldn't yet find where exactly it does what you
> describe, but I didn't yet have time to spend more time on it.
It's not in the Svn (the code there just does a minimal install and
then expects you to change the init file to do something else, which is
explained in some web pages). The alternative was discussed in this
mailing-list a few months ago (by yours truly).
The patch below is the hack I use right now.
Stefan
Index: package/base-files/files/sbin/mount_root
===================================================================
--- package/base-files/files/sbin/mount_root (révision 13122)
+++ package/base-files/files/sbin/mount_root (copie de travail)
@@ -2,15 +2,66 @@
# Copyright (C) 2006 OpenWrt.org
. /etc/functions.sh
+echo mount_root >>/tmp/stef
+
jffs2_ready () {
mtdpart="$(find_mtd_part rootfs_data)"
magic=$(hexdump $mtdpart -n 4 -e '4/1 "%02x"')
[ "$magic" != "deadc0de" ]
}
+### Try to mount some drive. ####################
+mount_drive () {
+ for m in jbd ext3; do
+ echo "mount_drive $m" >>/tmp/stef
+ insmod "$m" >>/tmp/stef 2>&1
+ done
+
+ rootdev="$1"
+
+ COUNTER=0
+ while [ ! -b "$rootdev" ] && [ $COUNTER -lt 10 ]; do
+ echo "mount sleep for $rootdev" >>/tmp/stef
+ sleep 1
+ let COUNTER=COUNTER+1
+ done
+
+ mount "$rootdev" /mnt && [ -x /mnt/sbin/init ] && {
+ echo "mounted $rootdev" >>/tmp/stef
+ . /bin/firstboot
+ pivot /mnt /rom
+ exit
+ }
+}
+
+mount_ide () {
+ echo mount_ide >>/tmp/stef
+ for m in ide-core aec62xx ide-generic ide-disk; do
+ insmod "$m" >>/tmp/stef 2>&1
+ done
+ mount_drive "/dev/hde1"
+}
+
+mount_usb () {
+ echo mount_usb >>/tmp/stef
+ # ehci-hcd is for USB2, ohci-hcd and uhci-hcd are both for USB1 but only
+ # one of them works. For WRTSL54GS, it's ohci, for WL700gE it's uhci.
+ for m in usbcore ohci-hcd uhci-hcd ehci-hcd scsi_mod sd_mod usb-storage; do
+ echo "mount_usb $m" >>/tmp/stef
+ insmod "$m" >>/tmp/stef 2>&1
+ done
+ mount_drive "/dev/sda1"
+}
+
+mount_usb
+mount_ide
+
+### If no drve, mount the JFFS2 partition or a ramdisk. ####################
grep rootfs_data /proc/mtd >/dev/null 2>/dev/null && {
+ echo mount_root-11 >>/tmp/stef
. /bin/firstboot
mtd unlock rootfs_data
+ echo mount_root-12 >>/tmp/stef
jffs2_ready && {
echo "switching to jffs2"
mount "$(find_mtd_part rootfs_data)" /jffs -t jffs2 && \
_______________________________________________
openwrt-devel mailing list
[email protected]
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel