Kernelimage

From InCircuit
Revision as of 15:50, 19 December 2013 by Raik (Talk | contribs)

Jump to: navigation, search

As stated in Generated Images, buildroot provides a dedicated kernel-image called uImage. As the bootloader can not read all filesystems by default, this has to be flashed into a separate partition of the NAND-Flash.


Writing the image into flash

While booting via NFS, a new kernel can be flashed by first erasing the first NAND-partition and write the Image directly into that partition afterwards. This can be done by using the following commands:

 flash_eraseall /dev/mtd0
 dd if=/boot/uImage of=/dev/mtdblock0 bs=131072

This would write the kernelimage found at /boot/uImage into the first partition. The parameter bs specifies the blocksize to use and should match the sector-size of the flash in use. It would work with other sizes, too, but would unnecessarily stress the device and take a larger amount of time.

Booting the new image

With the default environment, the device will automatically boot the new kernel, the next time it is started. If the environment has changed, eg. for booting via NFS, the following line can be used to boot the new kernel from flash once

 mtdparts default; nand read 0x70400000 nand0,0; bootm

To store this configration and making the kernel being loaded from flash by default, the following lines can be used:

 askenv bootcmd
 mtdparts default; nand read 0x70400000 nand0,0; bootm
 saveenv
Personal tools