Difference between revisions of "Kernelimage"
(→Writing the image into flash) |
|||
(3 intermediate revisions by one user not shown) | |||
Line 6: | Line 6: | ||
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: | 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/ | + | flash_eraseall /dev/mtdX |
− | dd if=/boot/uImage of=/dev/ | + | dd if=/boot/uImage of=/dev/mtdblockX bs=131072 |
− | This would write the kernelimage found at ''/boot/uImage'' into the | + | where mtdX and mtdblockX specify the flash partition in which the kernel resides. More information about the mtd devices may be available from the command "mtdinfo /dev/mtdX". |
+ | |||
+ | This would write the kernelimage found at ''/boot/uImage'' into the partition X. 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. | ||
+ | |||
+ | On some devices the command flashcp is available which is a better alternative to dd. Use it as following: | ||
+ | flashcp /boot/uImage /dev/mtdX | ||
+ | |||
+ | If your Kernel Version does not support the flash_eraseall Command, use | ||
+ | flash_erase /dev/mtdX 0 0 | ||
+ | instead. This should work on newer Versions. | ||
== Booting the new image == | == Booting the new image == |
Latest revision as of 17:46, 28 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.
[edit] 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/mtdX dd if=/boot/uImage of=/dev/mtdblockX bs=131072
where mtdX and mtdblockX specify the flash partition in which the kernel resides. More information about the mtd devices may be available from the command "mtdinfo /dev/mtdX".
This would write the kernelimage found at /boot/uImage into the partition X. 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.
On some devices the command flashcp is available which is a better alternative to dd. Use it as following:
flashcp /boot/uImage /dev/mtdX
If your Kernel Version does not support the flash_eraseall Command, use
flash_erase /dev/mtdX 0 0
instead. This should work on newer Versions.
[edit] 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