> I've just updated my trunk tree to the latest and I'm looking at the
> patches that I'm carrying in my tree wondering what's still relevant and
> what's not.  One of the bigger ones is a patch to mount a USB device
> on / in mount_root.

> Is this still needed or has some official support for this functionality
> been merged in recently.

AFAIK it's still needed.  BTW, it looks like this is partly taken from
the code I posted here, so FWIW I've slightly improved/simplified it:

   mount_drive () {
       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
       }
   }
   
   (cd /etc/modules.d && load_modules *)
   # GPIO 6 on WL-700gE is the `copy' button; if the button is released,
   # gpioctl returns 0, and it return 64 if it is pressed.
   # GPIO 4 on WL-700gE is the `ezsetup' button; if the button is released,
   # gpioctl returns 0, and it return 16 if it is pressed.
   if gpioctl get 6 >/dev/null && gpioctl get 4 >/dev/null; then
      # FIXME: This device name should come from a CONFIG_setting.
      mount_drive /dev/hde1
      mount_drive /dev/sda1
   fi

I personally add the above to /sbin/mount_root just after jffs2_ready.
The main difference is that I simply load all the modules included in
the squashfs, which makes this code more portable while making it
simpler at the same time.

OTOH, clearly, the `gpioctl' part of the code is not portable so you'll
probably want to get rid of it (tho I find it very convenient, since
I can then circumvent a messed up /dev/hde1 by pressing the ezsetup
button during the boot process; kind of like a built-in rescue-CD).

As mentioned, I think this code could be integrated at some point, and
for that we'll want to be able to specify the root device (/dev/hde1 in
the case of WL700gE) via a CONFIG_* variable.


        Stefan

_______________________________________________
openwrt-devel mailing list
[email protected]
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to