OpenWrt Forum Archive

Topic: USB-rootfs on boot on Edimax BR-6104KP (ADM5120) [WORKS]

The content of this topic has been archived between 7 Oct 2014 and 5 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

nunojpg wrote:

So...is there any thing that helps?

Yeah - fix the config files :-).

Seriously, I remember deleting the contents of a directory somewhere and it fixed it.  Try checking out Squidge package directory contents after an 'ipkg update' and comparing with what you've got - [i|o]pkg directories under /var?  There may be some kind of cache somewhere.

I'm sorry I can't be more specific.  Been a long time since I had this.

I've been learning a lot about openwrt in the last few days.

Now I'm having a problem, if I include libstdcpp in make menuconfig, make no longer creates openwrt-adm5120-br-6104kp-squashfs-xmodem.bin.

I've checked this with the configuration on first post, with both trunk and 8.09 checkouts this morning...

Nuno

To nunojpg

How did you fix the opkg problem?
I have the same problem. I followed this topic to build my OpenWrt with usb root.

Oszyx

I didn't.

I'm including all the packages that I need on compile.
But as I'm having that strange problem when including some packages, I end up installing some packages manually...

heruan wrote:

Finally I've found how to mount USB stick at boot without patching /etc/preinit or anything else.
These the step I've followed (revision 14152):

* make menuconfig
** Target System -> Infineon/ADMtek ADM5120 [2.6]
** Target Profile -> Edimax BR-6104KP (Unofficial)
** busybox -> Configuration -> Coreutil -> stty (don't know if necessary)
** removed some packages (to fit firmware size): dnsmasq, dropbear, iptables (will be installed later with opkg)
* make kernel_menuconfig
** Machine selection -> Infineon/ADMtek ADM5120 SoC based machines
** Device drivers -> Memory Technology Device (MTD) support:
*** disable Automatically set 'rootfs' partition to be root filesystem
*** disable Automatically split 'rootfs' partition for squashfs
*** disable Automatically find and split TRX partitions
** Device drivers -> SCSI device support:
*** {*} SCSI device support
*** <*> SCSI disk support
** Device drivers -> [*] USB support:
*** <*> Support for Host-side USB
*** [*] USB device filesystem
*** <*> USB Storage support
*** <*> ADM5120 HCD support (EXPERIMENTAL)
** File systems -> <*> Ext3 journalling filsystem support
** Kernel hacking -> Default kernel command string (last setting): console=ttyS0,115200 root=/dev/sda1 init=/etc/preinit ro rootdelay=10

Then run make and wait for OpenWRT to be built. Then under bin/ you'll find:
* openwrt-adm5120-br-6104kp-squashfs-webui.bin
* openwrt-adm5120-br-6104kp-squashfs-xmodem.bin
* openwrt-adm5120-rootfs.tgz

Format a USB-stick with ext3 fs (assuming /dev/sdb1) and untar the rootfs:
# mkfs.ext3 /dev/sdb1
# mount /dev/sdb1 /mnt
# cd /mnt
# tar -xzf /path/to/openwrt/bin/openwrt-adm5120-rootfs.tgz

So basically what you are doing is remove the kernel ability to see the MTD files and to find the USB devices and the first device is sda so it mounts that and moves forward. Cool I like that idea

Any one tried it with an asus in particular 500w

i used to modify preinit to look for a preinit.usb if it existed


and then do something like

# load the proper modules

# Does The drive Exist
echo "- is $MNTDEV there -"
if [ -e "$MNTDEV" ]
then
    echo "- yes  -"
    # Can we mount it
    if  mount -o rw,noatime "$MNTDEV" /mnt
    then
        echo "- mounted  -"
        # Is there a usb.boot file and an executable /mnt/sbin/init file
        if [ -e /mnt/.usb.boot ] && [ -x /mnt/sbin/init ]
        then
            echo "- Files exist about to pivot  -"
            mount -o move /proc /mnt/proc && \
            pivot_root /mnt /mnt/rom && {
                mount -o move /rom/sys /sys
                mount -o move /rom/tmp /tmp
                mount -o move /rom/dev /dev
                mount -o move /rom/dev/pts /dev/pts
                
                echo "- pivot successful  -"
                rc=0
            }
        else
            echo "- files not there ! -"
            # files doesn't exist umount drive
            umount /mnt
        fi
    
    fi
fi

kill $H
echo "- return  -"
set +x
return $rc

(Last edited by alexsamad on 18 Feb 2009, 11:23)

Hi

I build OpenWrt 8.09rc2 and 8.09. By following this topic but i get this error when i try to install a package.

This is the 8.09 output.

root@OpenWrt:/# opkg update
Downloading http://downloads.openwrt.org/kamikaze/8.09/adm5120/packages/Packages.gz
Connecting to downloads.openwrt.org (195.56.146.238:80)

Packages.gz            0% |                               |     0  --:--:-- ETA
Packages.gz          100% |*******************************|   287k --:--:-- ETA
Inflating http://downloads.openwrt.org/kamikaze/8.09/adm5120/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/snapshots
root@OpenWrt:/# opkg install nano
Installing nano (2.0.7-1) to root...
Downloading http://downloads.openwrt.org/kamikaze/8.09/adm5120/packages/./nano_2.0.7-1_mipsel.ipk
xsystem: ERROR: fork failed before execution: `wget --passive-ftp    -P /tmp/opkg-99cRut http://downloads.openwrt.org/kamikaze/8.09/adm5120/packages/./nano_2.0.7-1_mipsel.ipk'
Collected errors:
 * Failed to download nano. Perhaps you need to run 'opkg update'?
root@OpenWrt:/# opkg update
Downloading http://downloads.openwrt.org/kamikaze/8.09/adm5120/packages/Packages.gz
xsystem: ERROR: fork failed before execution: `wget --passive-ftp    -P /tmp/opkg-dwu7Fx http://downloads.openwrt.org/kamikaze/8.09/adm5120/packages/Packages.gz'
An error ocurred, return value: 1.

I can use some help. How do i get rid of this error?

Oscar

Isn't there a option to not include rootfs in "openwrt-adm5120-br-6104kp-squashfs-xmodem.bin"?

I have to install the packages after building the image because otherwise it will go over 2MB...

How can I create an 4Mb squashfs image for BR 6104 KP target image?
What I have to modify in order to make the image if it gets bigger than 2Mb?

I've checked out 8.09 from svn://svn.openwrt.org/openwrt/branches/8.09 ( Revision: 15231 )
And the usb support doesn't work. I can't find:

** Device drivers -> [*] USB support:
*** <*> Support for Host-side USB
*** [*] USB device filesystem
*** <*> USB Storage support
*** <*> ADM5120 HCD support (EXPERIMENTAL)

in make kernel_menuconfig, but I can check kmod-usb_core in make menuconfig =>
the kmod-usb-core.ipk it's built but it's not included in the image.
Can anyone guide me where to look?

Have you done "make" after configuring the profile with "make menuconfig", and only then the "make kernel_menuconfig"?

Yes. I've done that. If you don;t run make the kernel patches aren;'t applyed and you don;t see ADM5120 target.
I've downloaded the development trunk and it's working with this ( ie: the usb support desn;t disapear anymore from the kernel menuconfig).

cj_man wrote:

I've checked out 8.09 from svn://svn.openwrt.org/openwrt/branches/8.09 ( Revision: 15231 )
And the usb support doesn't work. I can't find:

** Device drivers -> [*] USB support:
*** <*> Support for Host-side USB
*** [*] USB device filesystem
*** <*> USB Storage support
*** <*> ADM5120 HCD support (EXPERIMENTAL)

in make kernel_menuconfig, but I can check kmod-usb_core in make menuconfig =>
the kmod-usb-core.ipk it's built but it's not included in the image.
Can anyone guide me where to look?

I'm having the exact same trouble too. I've triple checked both menuconfigs with no luck. I would appreciate some help as quickly as possible because my company is seriously considering using OpenWRT in a project.

svn co svn://svn.openwrt.org/openwrt/trunk trunk

And it will work

cj_man wrote:

svn co svn://svn.openwrt.org/openwrt/trunk trunk

And it will work

Thank you. This did the trick.

Checking out trunk (8.0.9-1) doesn't work for me ...
Is there anyone who could provide me with Openwrt...xmodem.bin and rootfs.tar.gz ?

oszyx wrote:

Hi

I build OpenWrt 8.09rc2 and 8.09. By following this topic but i get this error when i try to install a package.

This is the 8.09 output.

root@OpenWrt:/# opkg update
Downloading http://downloads.openwrt.org/kamikaze/8.09/adm5120/packages/Packages.gz
Connecting to downloads.openwrt.org (195.56.146.238:80)

Packages.gz            0% |                               |     0  --:--:-- ETA
Packages.gz          100% |*******************************|   287k --:--:-- ETA
Inflating http://downloads.openwrt.org/kamikaze/8.09/adm5120/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/snapshots
root@OpenWrt:/# opkg install nano
Installing nano (2.0.7-1) to root...
Downloading http://downloads.openwrt.org/kamikaze/8.09/adm5120/packages/./nano_2.0.7-1_mipsel.ipk
xsystem: ERROR: fork failed before execution: `wget --passive-ftp    -P /tmp/opkg-99cRut http://downloads.openwrt.org/kamikaze/8.09/adm5120/packages/./nano_2.0.7-1_mipsel.ipk'
Collected errors:
 * Failed to download nano. Perhaps you need to run 'opkg update'?
root@OpenWrt:/# opkg update
Downloading http://downloads.openwrt.org/kamikaze/8.09/adm5120/packages/Packages.gz
xsystem: ERROR: fork failed before execution: `wget --passive-ftp    -P /tmp/opkg-dwu7Fx http://downloads.openwrt.org/kamikaze/8.09/adm5120/packages/Packages.gz'
An error ocurred, return value: 1.

I can use some help. How do i get rid of this error?

Oscar

Hi Oscar. This is because it has to little memory. You need to make/enable a swap partition. First make a swap partition and then install swap utils package (it is swaputils or swap_utils, I don't remember). After that you give command swapon <name of partition> (for example: swapon /dev/sdb1). Then, try to install something.
You need to download the swap utils package by hand (maybe put it on a pendrive via a computer). It has some dependecies, download and install them first. Doing this will prevent using the "autoinstaller" of opkg that gives that error.
Hope this helps.

heruan wrote:

Finally I've found how to mount USB stick at boot without patching /etc/preinit or anything else.
These the step I've followed (revision 14152):

Great guide, thanks Heruan. In case it's of use to anyone, I've written up all of the steps I took setting up the development environment on an Ubuntu machine (including setting up the network, SSH server and installing a Python interpreter) here:
http://www.kelvinsthunderstorm.com/omni … d-openwrt/

Anyone got this to work with recent trunk (kernel 2.6.32)?
My build from trunk stops at the last line of the excerpt.

EDIT: Nevermind

(Last edited by Kajeci on 2 Mar 2010, 18:35)

I am having Kernel panic too...what can I do?? It can't boot anymore... sad

kthunder wrote:
heruan wrote:

Finally I've found how to mount USB stick at boot without patching /etc/preinit or anything else.
These the step I've followed (revision 14152):

Great guide, thanks Heruan. In case it's of use to anyone, I've written up all of the steps I took setting up the development environment on an Ubuntu machine (including setting up the network, SSH server and installing a Python interpreter) here:
http://www.kelvinsthunderstorm.com/omni … d-openwrt/

Hi Guys,
I have followed both the posts to the letter, I am now getting the make process to work but in the /bin directory when finished I only get two files.
openwrt-adm5120-br-6104kp-squashfs-webui.bin
openwrt-adm5120-br-6104kp-squashfs-xmodem.bin

I appear to be missing openwrt-adm5120-rootfs.tgz

Don't know if it's just me

Any Ideas?

Thanks

freddyk wrote:

I appear to be missing openwrt-adm5120-rootfs.tgz

You need to instruct the toolchain to build also the tgz image.
run make menuconfig and go to Target Image and choose tar.gz also

Hi,

I've checked out

svn://svn.openwrt.org/openwrt/branches/backfire

and I'm also missing the USB host options, even after "make menuconfig && make && make kernel_menuconfig". Is this only supported in trunk, or am I missing something else?

Thanks,
Floe

EDIT: sorry for the noise. I've realized that most of these options have been included in the regular menuconfig by now.

(Last edited by floe on 5 Jul 2010, 21:57)

I have the same problem : in the kernel_menlconfig i don't have an item USB-Host to select. I have tested now all different verssions of configuration which are described here and on other places, but i couldn't succeed. The board and the USB-Interfaces are ok. When i use a midge-distribution everything works fine. But with the kamikaze-distribution it doesn't boot from the usb-stick, it even doesn't show that the usb-host-driver is installed and the startup-process ends with a kernel-panic.
Does anybody has a secure configuration ?

best regards

Andreas