Re: [OpenWrt-Devel] replace /jffs with usb stick

2009-08-19 Thread Brian J. Murrell
On Tue, 2009-08-18 at 20:38 -0400, Stefan Monnier wrote:
  I am having a hard time to find the place where mounting root / really
  happens ..
 
 It's in /sbin/mount_root.  And yes, it is not exactly trivial to find
 (although in retrospect I had to admit that the name should have made it
 pretty obvious).
 
 See below the patch I use on my WL-700gE to mount the IDE drive's partition.

I really wish we could get some form of official support upstream for /
mounted on USB devices.  It seems that more and more people are
re-inventing this wheel.  Sadly.

b.



signature.asc
Description: This is a digitally signed message part
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] replace /jffs with usb stick

2009-08-19 Thread bud . dhay
I am in for that. I want to use an sd-modded wrt54gl and a usbsticked 
wl500w this way.


Therefore I'd also like to put the optimized mmc module for kernel2.4 in 
the trunk. Any opinions? Should we keep the old and setup a 
kmod-broadcom-mmc2 or replace the old one (which doesn't work with my 
setup).


How about:
device node/fs/modules uci configurable
if everything goes well the device is used instead of root_fs_data.

While trying I came to a point where /etc/passwd was created on the 
stick only. This is problematic. I think the router should be able to 
work basically also without the extra filespace.
Therefore I currently think it would make sense to overlay an existing 
jffs data partition. As the wl500w has 8MB space I currently tryout a 
setup without squashfs. But this might be impossible on 4MB devices.


result would be:
squashfs OVERLAYEDBY jffs (OVERLAYEDBY usb/mmc if exists)

... could anybody offer some help? I am really not experienced in the 
matter, but I am definitely interested in improving the situation. The 
result should be a switch on/works solution without fiddling the start 
scripts.


.. bud


On 19.08.2009 16:23, Brian J. Murrell wrote:

On Tue, 2009-08-18 at 20:38 -0400, Stefan Monnier wrote:

I am having a hard time to find the place where mounting root / really
happens ..


It's in /sbin/mount_root.  And yes, it is not exactly trivial to find
(although in retrospect I had to admit that the name should have made it
pretty obvious).

See below the patch I use on my WL-700gE to mount the IDE drive's partition.


I really wish we could get some form of official support upstream for /
mounted on USB devices.  It seems that more and more people are
re-inventing this wheel.  Sadly.

b.





___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] replace /jffs with usb stick

2009-08-18 Thread Stefan Monnier
 I am having a hard time to find the place where mounting root / really
 happens ..

It's in /sbin/mount_root.  And yes, it is not exactly trivial to find
(although in retrospect I had to admit that the name should have made it
pretty obvious).

See below the patch I use on my WL-700gE to mount the IDE drive's partition.


Stefan


Index: mount_root
===
--- mount_root  (révision 14605)
+++ mount_root  (copie de travail)
@@ -2,15 +2,75 @@
 # 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 21
+# 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 21
+# 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 21
+# done
+# mount_drive /dev/sda1
+# }
+
+#mount_usb
+#mount_ide
+(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
+fi
+
+###  If no drive, 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
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] replace /jffs with usb stick

2009-08-17 Thread Daniel Dickinson
On Mon, 17 Aug 2009 20:05:19 +0200
bud.d...@suisse.org wrote:

 Hi all,
 
 I am having a hard time to find the place where mounting root /
 really happens ..
 http://oldwiki.openwrt.org/OpenWrtDocs%282f%29OpenWrtDocs%282f%29lKamikazeBootHowTo.html
 is not helpful
 https://forum.openwrt.org/viewtopic.php?id=10816
 seems to be out of date.
 I added comments to /sbin/mount_root (but it doesn't seem to be
 executed at all) e.g. 'echo comment  /tmp/test' or echo comment
 or logger comment
 I only get feedback from /etc/init.d/boot .. but everything seems to
 be mounted there already.
 
 I want to replace the jffs partition with the ext3 on an usb stick 
 during boot on brcm-2.4. Any help appreciated :)

On first boot it is mounted in /bin/firstboot.  On subsequent boots it
is mounted in /sbin/mount_root

-- 
And that's my crabbing done for the day.  Got it out of the way early, 
now I have the rest of the afternoon to sniff fragrant tea-roses or 
strangle cute bunnies or something.   -- Michael Devore
GnuPG Key Fingerprint 86 F5 81 A5 D4 2E 1F 1C  http://gnupg.org
The C Shore (Daniel Dickinson's Website) http://www.bmts.com/~cshore


signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel