Opened 11 years ago

Last modified 9 years ago

#132 assigned enhancement

Kernel upgrade from within a running system

Reported by: Adi Kriegisch <adi@… Owned by: amain
Priority: minor Milestone: milestone:unscheduled
Component: openwrt Version: 2.0
Severity: severity 4 Keywords:


I recently created a new kernel image (with kernel mods and headers). Now I want to flash the kernel image to the corresponding flash device (/dev/mtd1 according to /proc/mtd), but I am unable to do so:

  • Squeeze version of mtd-utils does not know my flash
  • mtd from openwrt does not work/does nothing
  • backported version of mtd-utils seem to work (nandwrite flashes the chip), but my image is too big: 1376664 byte vs. 1114112 byte.

Do I need to repartition before flashing? If so, how?
A dd image of /dev/mtd1 shows that there is no such header in the current kernel than there is in the new image:


Will nandflash remove that part?
Is there any way to find out how I may upgrade the kernel of my RSPro?

Attachments (0)

Change History (9)

comment:1 Changed 11 years ago by anonymous

Any update? If so I believe this info would also be useful to #135.

comment:2 Changed 11 years ago by amain

  • Status changed from new to accepted

comment:3 Changed 11 years ago by amain

Investigating in porting the mtd utils, researching RedBoot etc. I will be porting the mtd tools including some other tools from OpenWrt.

So far I can tell right now is that indeed the kernel partition on the RSPRO has length 0x00110000 ( 1114112 ) bytes. The current DebWrt image seems to fit in there. (e.g. images are always padded to the max size )

So, your kernel is to big. Can't you put more into modules? One way to go is to attach the serial console, press CTRL-C during power on and enter RedBoot bootprompt. You can load an image from a remote location using tftp directly into memory and test it, before actually writing it to flash. With RedBoot you can also repartion the FIS and write images (from tftp locations) to partitions. Quite cool stuff btw.

From the top of my head in RedBoot:

  • use fconfig to do some configing
  • load debwrt-firmware-ar71xx-generic-vmlinux.elf ( will load from default tftp location )
  • exec ( boot te kernel )
  • fis ... ( to change partitions and load images )

Hope this gives you an alternative...

comment:4 Changed 11 years ago by Adi Kriegisch <adi@…

My image is just fine for being flashed via tftp. My issue was (besides getting working mtd tools which I backported from sid) to extract the kernel partition from the image I had.
When flashing with tftp this is done automagically somehow... :-)
After posting this bug report I tried to manually rip out the necessary bits of the kernel image I had, but I obviously missed a bit and though flashing did not work. Therefor I had to reflash the kernel by tftp.
So, having a "sysupgrade" like openwrt has, that is able to just do the right thing with a "tftp image" would be great! ;-)

-- Adi

comment:5 Changed 11 years ago by amain

You can have a look into build/openwrt-brcm47xx-Broadcom-wl-trunk-default/target/linux/ar71xx/image/Makefile. It will show how the kernel + rootfs are created. Note: the kernel and the rootfs can be found in the bin/ directory after build.

Note: mtd etc, including an howto will be ported to DebWrt, to facilitate upgrades. When depends on how much time I have.

comment:6 Changed 9 years ago by amain

  • Milestone set to unscheduled

comment:7 Changed 9 years ago by amain

  • Owner amain deleted
  • Status changed from accepted to assigned

comment:8 Changed 9 years ago by amain

  • Owner set to amain

comment:9 Changed 9 years ago by amain

  • Component changed from other to openwrt

Add Comment

Modify Ticket

as assigned The owner will remain amain.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.