Updating OpenWRT from factory firmware

81 views
Skip to first unread message

blueglowey

unread,
May 4, 2012, 4:13:20 AM5/4/12
to Bifferboard
Hi All,

I've having some trouble updating OpenWRT on my BB from the factory
firmware to the OpenWRT version at git://github.com/bifferos/bb.git.
I am looking to connect an Arduino to my BB via USB and need some
additional kernel modules (kmod-usb-serial and kmod-usb-serial-ftdi).
I have downloaded the bb.git tree and used menu config to add in these
modules and can run 'make' successfully to give a new firmware.

After the make I can load the new firmware in qemu fine with 'make
run' but when I come to upload it to the board with

python bb_eth_upload8.py eth0 00:b3:f6:00:8d:87 openwrt-rdc-jffs2-64k-
bifferboard.img

It writes the blocks but then does not request a DHCP address at all.
As I have no serial cable I cannot see what is going on but after
talking on IRC I am told that I need to configure the bootloader
Kernel cmndline variable in order to boot my new image.

I have been following https://sites.google.com/site/bifferboard/Home/bootloader/bb_eth_setconfig-py
in an attempt to do this but would like confirmation on what values i
should be using and the correct cmndline variable for openWRT on my
dual USB BB as it does not seem to work.

Any help would be greatly appreciated.

Cheers

James

Nicolas Le Falher

unread,
May 4, 2012, 5:53:02 AM5/4/12
to biffe...@googlegroups.com
Hi,

>It writes the blocks but then does not request a DHCP address at all.
Because your image not booting.
Factory firmware have an embedded cmnd_line in kernel, no on git.

>I am told that I need to configure the bootloader Kernel cmndline variable in order to boot my new image.
You can add cmnd_line in kernel directly (and no edit to Biffboot configuration).
Take a look at : https://groups.google.com/d/msg/bifferboard/yUEN4H5FP98/RP4234B6uyoJ

Nicolas

James Sweet

unread,
May 4, 2012, 8:24:40 AM5/4/12
to biffe...@googlegroups.com
Thanks for the link. I'm still somewhat confused though as to where to add the cmnd_line in to the kernel. Your link says run 'make kernel_menuconfig'
but this does not work on the openwrt version in git://github.com/bifferos/bb.git that I'm using. Is there a file that I could add it to?

Is there a preferred place to put the cmnd_line - biffboot or compiled into the kernel itself?

Also just to confirm I want to use this cmnd_line to boot openwrt from the bb.git on a dual USB BB?
> console=uart,io,0x3f8 init=/etc/preinit root=/dev/sda1 rootwait
It is the default entry as used in the bb_eth_setconfig.py utility.

James

Andrew Scheller

unread,
May 4, 2012, 8:49:31 AM5/4/12
to biffe...@googlegroups.com
> the cmnd_line in to the kernel. Your link says run 'make kernel_menuconfig'
> but this does not work on the openwrt version in
> git://github.com/bifferos/bb.git that I'm using. Is there a file that I

Try 'cd openwrt' before 'make kernel_menuconfig'

> Is there a preferred place to put the cmnd_line - biffboot or compiled into
> the kernel itself?

That depends how often you'll want to change the kernel cmndline, cos
if it's embedded in the kernel the only way to change it is by
recompiling and then reflashing a new kernel.

> Also just to confirm I want to use this cmnd_line to boot openwrt from the
> bb.git on a dual USB BB?
> console=uart,io,0x3f8 init=/etc/preinit root=/dev/sda1 rootwait

No, that will try to load the rootfs from /dev/sda1 (i.e. a USB flash
drive) which won't work with openwrt, which has it's rootfs embedded
in flash.
The cmnd_line to use with openwrt can be found on
https://sites.google.com/site/bifferboard/Home/openwrt-git

Lurch

Nicolas Le Falher

unread,
May 4, 2012, 8:59:00 AM5/4/12
to biffe...@googlegroups.com
> Is there a preferred place to put the cmnd_line - biffboot or compiled into the kernel itself?
For you, embed cmnd_line in kernel is prefered.
More easiest to return to factory firmware with that.

Nicolas

James Sweet

unread,
May 4, 2012, 12:50:20 PM5/4/12
to biffe...@googlegroups.com
I have added the command line into the kernel in make kernel_menuconfig as shown
> [*] Built-in kernel command line
> (console=uart,io,0x3f8 rootfstype=squashfs,jffs2) Built-in kernel command string
> [*] Built-in command line overrides boot loader arguments
and compilled successfully. However when I try to run the new firmware in qemu it does the following, repeating the 'Linux version' line forever but
I'm not sure if that is as a result of me using the built-in kernel command line option or another problem.
> BIFFBOOT v3.6 (Qemu) 32-bit Loader by bifferos (c) 2011
> Redistribution prohibited, all rights reserved.
> Press <ESC>
> Booting...
> 00100000 loaded from flash.
> Booting Linux with: console=uart,io,0x3f8 rootfstype=squashfs,jffs2 init=/etc/preinit
> Linux version 2.6.37.6 (jsweet@ubuntuvm) (gcc version 4.5.4 20110808 (prerelease) (Linaro GCC 4.5-2011.08) ) #1 Fri May 4 14:57:13 BST 2012
> BIOS-provided physical RAM map:
> BIOS-e801: 0000000000000000 - 000000000009f000 (usable)
> BIOS-e801: 0000000000100000 - 0000000002000000 (usable)
> Early serial console at I/O port 0x3f8 (options '115200')
> bootconsole [uart0] enabled
> Linux version 2.6.37.6 (jsweet@ubuntuvm) (gcc version 4.5.4 20110808 (prerelease) (Linaro GCC 4.5-2011.08) ) #1 Fri May 4 14:57:13 BST 2012
> Linux version 2.6.37.6 (jsweet@ubuntuvm) (gcc version 4.5.4 20110808 (prerelease) (Linaro GCC 4.5-2011.08) ) #1 Fri May 4 14:57:13 BST 2012
> Linux version 2.6.37.6 (jsweet@ubuntuvm) (gcc version 4.5.4 20110808 (prerelease) (Linaro GCC 4.5-2011.08) ) #1 Fri May 4 14:57:13 BST 2012
> Linux version 2.6.37.6 (jsweet@ubuntuvm) (gcc version 4.5.4 20110808 (prerelease) (Linaro GCC 4.5-2011.08) ) #1 Fri May 4 14:57:13 BST 2012
> Linux version 2.6.37.6 (jsweet@ubuntuvm) (gcc version 4.5.4 20110808 (prerelease) (Linaro GCC 4.5-2011.08) ) #1 Fri May 4 14:57:13 BST 2012
> Linux version 2.6.37.6 (jsweet@ubuntuvm) (gcc version 4.5.4 20110808 (prerelease) (Linaro GCC 4.5-2011.08) ) #1 Fri May 4 14:57:13 BST 2012
> Linux version 2.6.37.6 (jsweet@ubuntuvm) (gcc version 4.5.4 20110808 (prerelease) (Linaro GCC 4.5-2011.08) ) #1 Fri May 4 14:57:13 BST 2012
Using bb_eth_setconfig.py I configured the bootloader as follows

Flash Size: 8Mb
Config Chunk: 1015
boot source: Flash
serial console: enabled
Network Console: enabled
Boot image type: Linux
Load Address: 0x400000
Kernel cmndline: [blank]
Kernel max: 0x200000

I uploaded the firmware, waited at least 5 minutes for a DHCP request but to no avail. Now I cannot even load the factory firmware. What settings
should I use in bb_eth_setconfig.py to set the bootloader back to be able to boot factory firmware (which as no cmndline built in?)?

I'm recompiling bb.git now from scratch to make sure that its a problem from a previous compile.

Thanks

James

Nicolas Le Falher

unread,
May 4, 2012, 1:08:41 PM5/4/12
to biffe...@googlegroups.com
>However when I try to run the new firmware in qemu it does the following, repeating the 'Linux version' line forever
Normal, because qemu send cmnd_line, and kernel got it.

> Kernel max: 0x200000
Normal ? Base is 0x10.
Have you edited kernelmax in menuconfig to 0x20 ?

Nicolas

James Sweet

unread,
May 4, 2012, 2:09:20 PM5/4/12
to biffe...@googlegroups.com, Nicolas Le Falher
>> Kernel max: 0x200000
> Normal ? Base is 0x10.
> Have you edited kernelmax in menuconfig to 0x20 ?
The kernel max value changes depending what amount of flash i choose. Could you explain what this value is and what I should set it to in
bb_eth_setconfg.py

What is 'Base'?

James

James Sweet

unread,
May 4, 2012, 7:22:54 PM5/4/12
to biffe...@googlegroups.com
I'd just like to say thanks for all the help as i have now got it booting my firmware. For some reason the cmnd_line in the bootloader was not being
stored correctly after I changed it. I definitely know more about kernel config that I used to!

Cheers

James

On 04/05/2012 18:08, Nicolas Le Falher wrote:

Andrew Scheller

unread,
May 5, 2012, 8:42:40 AM5/5/12
to biffe...@googlegroups.com
>>> Kernel max: 0x200000
>> Normal ? Base is 0x10.
>> Have you edited kernelmax in menuconfig to 0x20 ?
> The kernel max value changes depending what amount of flash i choose. Could
> you explain what this value is and what I should set it to in
> bb_eth_setconfg.py

Broadly speaking, kernelmax (kmax) determines where in flash the
kernel finishes, and where the rootfs starts. It's mentioned on
https://sites.google.com/site/bifferboard/Home/bootloader/changelog
and briefly on https://sites.google.com/site/bifferboard/Home/kernel-flashing-in-detail
As explained on
https://sites.google.com/site/bifferboard/Home/openwrt-git you need to
make sure that the value in the openwrt config matches the value set
in your bootloader.

It only changes in bb_eth_setconfig.py when you change the flash size,
as these were once the default values, a long time ago.

Lurch
Reply all
Reply to author
Forward
0 new messages