Difference between revisions of "Kernelimage"
(→Writing the image into flash) |
|||
Line 8: | Line 8: | ||
flash_eraseall /dev/mtd0 | flash_eraseall /dev/mtd0 | ||
dd if=/boot/uImage of=/dev/mtdblock0 bs=131072 | dd if=/boot/uImage of=/dev/mtdblock0 bs=131072 | ||
+ | |||
+ | If your Kernel Version does not support the flash_eraseall Command, use | ||
+ | flash_erase /dev/mtd0 0 0 | ||
+ | instead. This should work on newer Versions. | ||
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. | 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. |
Revision as of 18:21, 6 March 2014
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
If your Kernel Version does not support the flash_eraseall Command, use
flash_erase /dev/mtd0 0 0
instead. This should work on newer Versions.
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