OpenWrt Forum Archive

Topic: Has anybody succeeded to use kexec on brcm47xx platform?

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

Hi All,

I need to use the kexec to boot the kernel from the USB storage connected to my router.
Has anybody succesfully used kexec on the brcm47xx platform (namely Asus WL500gP V2)?

The idea is to have a simple kernel and basic system on the internal flash, and use it only for booting of the kernel provided on the external disk.
The solution should speed up development without continuous reflashing of the device...
--
TIA, WZab

I have compiled kernel with kexec support.
However when I try to use it, I get the following:

# kexec -f --command-line="root=/dev/nfs nfsroot=172.17.1.1:/usr/local/nfs/asus init=/etc/preinit noinitrd console=ttyS0,115200 ip=dhcp" ll.elf                                                                             
br-lan: port 1(eth0.0) entering disabled state                                 
Starting new kernel                                                             
Will call new kernel at 003fa000                                               
Bye ...

Then my router hangs until power off...

any luck with loading another kernel?

/Regards
Henrik

wzab wrote:

I have compiled kernel with kexec support.
However when I try to use it, I get the following:

# kexec -f --command-line="root=/dev/nfs nfsroot=172.17.1.1:/usr/local/nfs/asus init=/etc/preinit noinitrd console=ttyS0,115200 ip=dhcp" ll.elf                                                                             
br-lan: port 1(eth0.0) entering disabled state                                 
Starting new kernel                                                             
Will call new kernel at 003fa000                                               
Bye ...

Then my router hangs until power off...

same problem here, there is a problem with the start address, but can not figure out why and how to fix this

This is something I would like to see,  i use the flash on the system for my kernel and a usb-rootfs - that way if I stuff something up I can remove the usb and have a bootable system (presuming I don't touch the system flash), but having kexec would be excelent

i managed (with some help) to lead and execute a kernel using kexec. the last existing problem is, that the command-line parameters of the kernel are hardcoded. i ll see what i can do.

wurststulle wrote:

i managed (with some help) to lead and execute a kernel using kexec. the last existing problem is, that the command-line parameters of the kernel are hardcoded. i ll see what i can do.

Want to give a bit more info on how to (or patches), the hardcoded options can be change in the build environment

i ll publish the patches later this week, maybe weekend.

the problem with the hardcoded options is, that this code has to be rewritten:
if no options are given(normal boot), the kernel has to use the hardcoded ones, but if they are given(kexec), the given ones have to be used.

regards

to solve the problem of the hardcoded command-line options i m using two trunks, one for the native image, and one for the kexec image.
i used the patch posted http://www.nabble.com/kexec-on-mips---a … 58033.html an included it by hand into both trunks. (i ll post some ready-to-use patches, as said, at weekend, or when its working^^)

now you should be able to execute the new kernel. to let it boot from an external device the commandline options must be changed in make kernel_menuconfig.
so far its working. now there is the problem to include support for your external device in the kernel. so i have added support for all things that could have something to do with usb.

all in all i have no luck getting my usb device recogniced. it also may be, that my device name /dev/sda2 is wrong.

Kernel command line: root=/dev/sda2 rootfstype=ext2 init=/etc/preinit noinitrd console=ttyS0,115200

ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
PCI: Enabling device 0000:00:02.2 (0000 -> 0002)
PCI: Fixing up device 0000:00:02.2
ehci_hcd 0000:00:02.2: EHCI Host Controller
ehci_hcd 0000:00:02.2: new USB bus registered, assigned bus number 1
ehci_hcd 0000:00:02.2: irq 5, io mem 0x40002000
ehci_hcd 0000:00:02.2: USB 2.0 started, EHCI 1.00
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 4 ports detected
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: EHCI Host Controller
usb usb1: Manufacturer: Linux 2.6.28.7 ehci_hcd
usb usb1: SerialNumber: 0000:00:02.2
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver libusual
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
TCP vegas registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Cannot open root device "sda2" or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00             256 mtdblock0 (driver?)
1f01            3776 mtdblock1 (driver?)
1f02            3002 mtdblock2 (driver?)
1f03             960 mtdblock3 (driver?)
1f04              64 mtdblock4 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

i hope, this will help someone.

(Last edited by wurststulle on 25 Feb 2009, 17:13)

Thanks for that.

I was thinking there used to be a tool to set the kernel boot options - it would modify a built kernel.  That might be better than building 2 kernels.

The discussion might have continued from here.