OpenWrt Forum Archive

Topic: Building firmware from scratch - kernel 2.6

The content of this topic has been archived on 29 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I'm new to the OpenWRT forums and I'm trying to solve a couple of issues with my Asus WL-500g router. I've been reading countless posts for the past two days and so far, stock firmwares from the whiterussian branch work ok with the router, custom made ones with kamikaze do not. I know it's a leap from whiterussian to kamikaze but I was hoping I could make a custom firmware, now knowing that the concept really works. I'm a bit stuck and would like some help understanding if my failures are due to bad configuration on my part or the fact that it's the development branch I am in.

I want to make a specific usb modem work with the router. From my laptop, the modem uses the "anydata" driver and so far it has only worked with 2.6 kernel. Furthermore, the driver needs to be patched to correct certain bugs (all very recent).

So I decided to go with kamikaze and the buildroot process, in order to gain access to the 2.6 kernel, enable this specific driver in the build process and patch it to correct the bugs.

Following the buildroot wiki, I've been able to:

get the SVN stuff
1st make (topdir): creates the whole build tree
patch the 2.6.16.7 kernel that comes along with it (the anydata driver is present)
2nd make (topdir): build the firmware (successfully)
upload it to the router using the TFTP process

...and afterwards, the router reboots and I can't even access neither through telnet nor web interface. ping to the router ip address obtains replies, though.

Since the router is an Asus WL-500g, after the make process I upload the openwrt-brcm-2.6-squashfs.trx ( also tried the openwrt-brcm-2.6-jffs2-4MB.trx, none seems to work)

I've even tried the basic stuff, no kernel patching, just getting everything from SVN, then make menuconfig then make. the images are generated and afer successfully uploading, the router pings from time to time but I can't get in and start taking notes on what to do next...

I'm sorry if this post is silly, I was very excited with this project and still hope I can get it to work. Thanks in advance for any tips you may have!

Try a fresh checkout from the 'buildroot-ng' branch

Wow, thanks - I was just doing that, to see how it goes - anyways, if there is another (simpler) way to go about my quest, let me know guys!

Thanks once again for the reply!

Another note on the buildroot-ng stuff: The IP that it'll use after booting is always 192.168.1.1 after flashing. It does not use nvram at all...

I've tried buildroot-ng and the same thing happened, after the successfull build and upload, the router won't allow for telnet or web interface access - but it replies to ping.

Its IP address was previously set to 192.168.1.254, it didn't change to 192.168.1.1 as expected - which leads me to believe that I'm the one doing something not so right...

Anyways, afterwards I tried buildroot with Whiterussian and web interface / telnet works, I can access and configure the router...

Assuming this has to do with stable / development, I think the next step would be to somehow include the needed driver to the Whiterussian 2.4 kernel and see how it goes - still I'll try some other configurations on kamikaze before giving up.

I can confirm that I also have problems with latest buildroot-ng flashing a toshiba wrc-1000.  wr-rc5 works like a charm, but neither 2.4 or 2.6 .trx's from builtroot-ng get me a ping.  No jtag to further debug the problem sorry.

(Last edited by acoul on 3 Aug 2006, 12:39)

Last time I tried 2.6 kernel from buildroot-ng on ASUS WL-500G, it ended with a kernel panic (via serial console) - it was on 18.07.2006:


CFE version 1.0.37 for BCM947XX (32bit,SP,LE)
Build Date: .G  3.? 1 16:49:41 CST 2005 (root@PaNLinux)
Copyright (C) 2000,2001,2002,2003 Broadcom Corporation.

Initializing Arena.
Initializing Devices.
et0: Broadcom BCM47xx 10/100 Mbps Ethernet Controller 1.3.2.0
rndis0: Broadcom USB RNDIS Network Adapter (P-t-P)
CPU type 0x29007: 200MHz
Total memory: 0x2000000 bytes (32MB)

Total memory used by CFE:  0x80300000 - 0x80436F10 (1273616)
Initialized Data:          0x803313D0 - 0x80333760 (9104)
BSS Area:                  0x80333760 - 0x80334F10 (6064)
Local Heap:                0x80334F10 - 0x80434F10 (1048576)
Stack Area:                0x80434F10 - 0x80436F10 (8192)
Text (code) segment:       0x80300000 - 0x803313D0 (201680)
Boot area (physical):      0x00437000 - 0x00477000
Relocation Factor:         I:00000000 - D:00000000

Device eth0:  hwaddr 00-15-F2-6A-E8-34, ipaddr 192.168.1.1, mask 255.255.255.0
        gateway not set, nameserver not set
Rescue Flag disable.
Reading :: TFTP Server.
Failed.: Timeout occured
Loader:raw Filesys:raw Dev:flash0.os File: Options:(null)
Loading: .. 3740 bytes read
Entry at 0x80001000
Closing network.
Starting program at 0x80001000
Linux version 2.6.17 (root@tomek) (gcc version 4.1.1) #3 Tue Jul 18 12:59:38 CEST 2006
CPU revision is: 00029007
Determined physical RAM map:
memory: 02000000 @ 00000000 (usable)
Built 1 zonelists
Kernel command line: root=/dev/sda1 rootdelay=10 console=ttyS0,115200
Primary instruction cache 8kB, physically tagged, 2-way, linesize 16 bytes.
Primary data cache 4kB, 2-way, linesize 16 bytes.
Synthesized TLB refill handler (19 instructions).
Synthesized TLB load handler fastpath (31 instructions).
Synthesized TLB store handler fastpath (31 instructions).
Synthesized TLB modify handler fastpath (30 instructions).
PID hash table entries: 256 (order: 8, 1024 bytes)
Using 100.000 MHz high precision timer.
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 29892k/32768k available (1992k kernel code, 2860k reserved, 291k data, 132k init, 0k highmem)
Mount-cache hash table entries: 512
Checking for 'wait' instruction...  unavailable.
NET: Registered protocol family 16
SCSI subsystem initialized
usbcore: registered new driver usbfs
usbcore: registered new driver hub
PCI: fixing up bridge
PCI: Fixing up device 0000:01:00.0
Data bus error, epc == 800079b4, ra == 800079ac
Oops[#1]:
Cpu 0
$ 0   : 00000000 10008000 ac020000 a0000000
$ 4   : ac020000 00000004 0c020003 00000004
$ 8   : 00000007 00000000 00000004 80270000
$12   : 80270000 80289cfa 8026c743 00000000
$16   : 00000004 00000000 80289e98 8107e400
$20   : 00000000 00000000 00000000 00000000
$24   : 00000000 801f7b84
$28   : 80288000 80289e30 00000000 800079ac
Hi    : 00000061
Lo    : cac01200
epc   : 800079b4     Not tainted
ra    : 800079ac Status: 10008002    KERNEL EXL
Cause : 0000001c
PrId  : 00029007
Modules linked in:
Process swapper (pid: 1, threadinfo=80288000, task=8104ec00)
Stack : 0c020000 8107e400 00000400 80289e60 00000000 800ea0f8 10008000 80289ecc
        00000008 80002454 802d9400 80114cdc 00000000 802d95fc 00000000 80289e98
        00000004 80114d1c 10008001 800f7a14 802d9400 8107e400 802d94ec 800f8cd4
        80289e98 8107e400 00000000 00000000 00000008 00000000 800f8dd0 800f8fa8
        802dea80 0000a1ff 00000000 00000001 00000000 00000000 00000100 536514e4
        ...
Call Trace: [<800ea0f8>]  [<80002454>]  [<80114cdc>]  [<80114d1c>]  [<800f7a14>]  [<800f8cd4>]  [<800f8dd0>]  [<800f8fa8>]  [<800f9158>]

Code: 24060400  10400008  00402021 <8c430000> 00001021  14400004  001110c0  08001e77  00433006
Kernel panic - not syncing: Attempted to kill init!

The broadcom system code doesn't work with gcc 4.1.1 yet. Try the default and it should work...

On latest buildroot-ng, default settings,  brcm-2.6,  on toshiba wrc-1000 no go. Sorry no debug messages due to lack of serial console :-(

Edit: actually we have a go: http://forum.openwrt.org/viewtopic.php?pid=35070#p35070

(Last edited by acoul on 8 Oct 2006, 22:30)

The discussion might have continued from here.