Page 2 of 5 FirstFirst 1234 ... LastLast
Results 16 to 30 of 75

Thread: Using HDD drive for Root on OpenWRT

  1. #16
    Quote Originally Posted by MoD
    anyway, today there will be a much better way how to mount HDD.
    Are you going to replace JFFS root completely? What I did was editing mount_root and firstboot to duplicate JFFS init but use HDD+EXT3 instead. Also added couple if's to fall-back to flash+jffs if HDD is not present.

  2. #17

    better way how to mount HDD

    As always, USE ON YOUR OWN RISK!

    I took the idea from here: http://openwrt.pbwiki.com/WGT634U_USB_root

    I. The concept

    I really like Oleg's firmware concept to use NVAM variable boot_dev. As we have not much space, HDD root fs can be only ext3.

    II. What has been changed and how

    (if you dont want to build an image, skip this section. Read the section III. How to use all this and use already created image)

    I changed the mount_root script (the script is here).

    What the modified mount_root does:

    1. it looks for NVRAM variable boot_dev
    2. it tries to mount that partition at mount point /mnt
    3. it checks if there are directories /sbin and /rom and file /sbin/hotplug.failsafe on mounted partition. If everything looks ok, it does pivot_root. The old root fs is in /rom.
    4. if something fails (partition is not mounted or it does not have directories /sbin and /rom and file /sbin/hotplug.failsafe ), customized mount_root acts as the original OpenWRT mount_root and mounts jffs2 filesystem.

    To avoid mounting jffs2 fs, mount_root has to be on squashfs. So we have to compile it into trx image. Do the following:

    1. Build the firmware with:
    cd trunk
    make
    this will create trunk/build_mipsel directory.

    2. replace mount_root script in trunk/build_mipsel/target/sbin

    3. rebuild the firmware with new mount_root :
    cd trunk
    make target/install
    III. How to use all this

    1. Create and format an ext3 partition on the HDD drive using:
    # play with fdisk if you need to repartition drive
    fdisk fdisk /dev/discs/disc0/disc
    # "format" partition
    mke2fs -j /dev/discs/disc0/part1
    2. Download my root2hdd.sh script and copy it to the router /tmp directory. You may want to customize boot_partition variable in the script acoording your HDD boot partition.

    3. execute the /tmp/root2hdd.sh script to create root fs on HDD. It will also set NVRAM variable boot_dev.

    # /tmp/root2hdd.sh
    4. reboot the router. If you want to boot jffs2 filesystem, simply:
    nvram unset boot_dev
    nvram commit

  3. #18
    I would like to see two things working on this OpenWRT box:

    1. WIFI
    2. posibility to use VFAT filesystem

    it seems that power button and copy button are useless right now. But I dont care about that
    Last edited by MoD; 23-01-2007 at 15:13.

  4. #19
    OpwneWRT WL-700gE by default there is no bridge included, so logread shows an error:

    Jan 1 00:00:15 (none) user.info : /sbin/hotplug: /etc/hotplug.d/net/10-net: 1: brctl: not found

  5. #20
    When you build custom firmware just put "<M>" instead of "<*>" or "< >" to Wifi, bridge, iptables etc. and install resulting ipkgs after HDD is mounted as root.

    Power and Copy button both work. You need to create hotplug script to handle events they generate.

  6. #21
    Quote Originally Posted by johu View Post
    When you build custom firmware just put "<M>" instead of "<*>" or "< >" to Wifi, bridge, iptables etc. and install resulting ipkgs after HDD is mounted as root.

    Power and Copy button both work. You need to create hotplug script to handle events they generate.
    1) do you have wi-fi running?
    2) could you give an example for hotplug scripts?
    Last edited by MoD; 23-01-2007 at 20:40.

  7. #22
    when drivers are installed, wifi is found on device, but is not configured:

    root@OpenWrt:/# ifconfig
    br-lan Link encap:Ethernet HWaddr 00:17:31:BA:E4:B0
    inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    eth0 Link encap:Ethernet HWaddr 00:17:31:BA:E4:B0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:73 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:27471 (26.8 KiB)
    Interrupt:4

    eth0.0 Link encap:Ethernet HWaddr 00:17:31:BA:E4:B0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    eth0.1 Link encap:Ethernet HWaddr 00:17:31:BA:E4:B1
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:68 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:0 (0.0 B) TX bytes:21964 (21.4 KiB)

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    root@OpenWrt:/# /sbin/wifi detect
    config wifi-device wl0
    option type broadcom
    option channel 5

    config wifi-iface
    option device wl0
    option mode ap
    option ssid OpenWrt
    option hidden 0
    option encryption none

    root@OpenWrt:/# iwconfig
    lo no wireless extensions.

    eth0 no wireless extensions.

    eth1 no wireless extensions.

    eth0.0 no wireless extensions.

    eth0.1 no wireless extensions.

    br-lan no wireless extensions.

    wl0 IEEE 802.11-DS ESSID:""
    Mode:Managed Frequency:2.412 GHz Tx-Power:off
    To initialize WI-FI, simply run:
    # /sbin/wifi detect > /etc/config/wireless
    # reboot
    Last edited by MoD; 24-01-2007 at 07:37.

  8. #23

    it is possible to use VFAT

    ipkg shows that it depends on nls_base. However you can extract the source and install modules and script manually.

    not sure about nls_base, but iso nls modules can be used from WhiteRussian. Can be downloaded here:

    http://downloads.openwrt.org/people/...gtest/packages

  9. #24
    You can do whatever you want with buttons and leds. Even switch wi-fi on/off by copy button.

    Examples are here:
    http://forum.openwrt.org/viewtopic.php?pid=37413 and
    http://forum.openwrt.org/viewtopic.php?pid=37453

    in short:
    mkdir /etc/hotplug.d
    mkdir /etc/hotplug.d/button

    touch /etc/hotplug.d/button/script
    echo '#!/bin/sh

    echo \"action: $ACTION, button: $BUTTON, seen: $SEEN\" >> /tmp/diagVars.log

    ' > /etc/hotplug.d/button/script

    chmod a+x /etc/hotplug.d/button/script
    and watch output in /tmp/diagVars.log

  10. #25
    I tried the changes listed by MoD they work great except I can't write to nvram when I boot from the Hard Drive. I unset the boot_dev variable and I do an nvram commit and see that is has disappeared from the list of nvram vairables, but when I reboot I boot from the hard drive and that value is set to its previous setting. Anybody else have this problem?

  11. #26
    Right, finally gotten round to installing this!

    Does anyone have bridge working correctly so that local-side router ports get their IP's off the wl-700Ge and then connections from them are forwarded to the eth0.1 interface (ie the WAN)?

  12. #27
    Quote Originally Posted by d3viant View Post
    Right, finally gotten round to installing this!

    Does anyone have bridge working correctly so that local-side router ports get their IP's off the wl-700Ge and then connections from them are forwarded to the eth0.1 interface (ie the WAN)?
    haven't tried to use it as router. i got wifi card running, but it seems that it also does not respond to IP address 192.168.1.1

  13. #28
    I have gotten dnsmasq going on the br-lan bridge, this seems to work fine (in that it assigns IP addresses) If I add eth0.1 to that bridge, packets get forwarded straight across to my adsl modem, as if the wl-700ge were invisible (I can no longer ping 192.168.1.1 in that situation)

    It may be a case of using iptables to forward packets, although I am not sure - I don't think the original asus firmware did this...

  14. #29
    Quote Originally Posted by MoD View Post
    haven't tried to use it as router. i got wifi card running, but it seems that it also does not respond to IP address 192.168.1.1
    Just got that bit working - you have to add wl0 to your br-lan bridge,

    Code:
    brctl addif br-lan wl0
    If you have dnsmasq running on the br-lan interface (put interface=br-lan in dnsmasq.conf) then wireless devices start getting IP addresses too.

    The only thing left to get this router working properly for me is to have it actually route packets to it's eth0.1 device from br-lan (without making the router invisible!)

  15. #30
    Quote Originally Posted by d3viant View Post
    The only thing left to get this router working properly for me is to have it actually route packets to it's eth0.1 device from br-lan (without making the router invisible!)
    I guess you have to set up iptables properly?! just a quick search:
    http://forum.openwrt.org/viewtopic.php?pid=1991#p1991
    http://forum.openwrt.org/viewtopic.php?pid=3301#p3301
    http://forum.openwrt.org/viewtopic.php?id=57
    http://forum.openwrt.org/viewtopic.php?id=20
    http://forum.openwrt.org/viewtopic.php?id=6541
    http://forum.openwrt.org/viewtopic.php?id=6247
    http://forum.openwrt.org/viewtopic.php?id=6387
    http://forum.openwrt.org/viewtopic.php?id=2299
    Last edited by MoD; 27-01-2007 at 14:34.

Page 2 of 5 FirstFirst 1234 ... LastLast

Similar Threads

  1. Lost Access to HDD
    By cokeman in forum WL-500g Q&A
    Replies: 0
    Last Post: 12-10-2006, 08:39
  2. Mirroring WL-700g external USB hard drive
    By Joho in forum WL-700g Q&A
    Replies: 0
    Last Post: 11-09-2006, 14:49
  3. twonky media server, network drive with oleg firmware
    By black_bottom in forum WL-HDD Q&A
    Replies: 3
    Last Post: 22-03-2006, 07:15
  4. Flashing Oleg's Firmware in WL HDD
    By hugo in forum WL-HDD Custom Development
    Replies: 29
    Last Post: 21-10-2004, 14:55
  5. USB HDD connects as Webcam
    By Oldchatterman in forum WL-500g Q&A
    Replies: 12
    Last Post: 19-10-2004, 17:54

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •