Kernel Flashing

From BUG Wiki

Jump to: navigation, search

So you want to upgrade your kernel. In R1.2 of the BUG rootfs we have a brand new kernel upgrade user-space utility that allows you to upgrade the kernel from the comfort of your very own user console.

Upgrading your Kernel via bug_kflash

  • Download and burn R1.2 of the rootfs to your MMC. See (See Flash Your MMC Card for detailed instructions.)
  • Boot your BUG.
  • Get to a console by using either telnet or ssh.
  • Download the new kernel into your /root directory and rename it to new_zImage_bug (what the bug_kflash program expects).
# cd /root
# wget http://bugcommunity.com/downloads/files/zImage_bug 
# mv zImage_bug new_zImage_bug
  • Insert the bug_kflash kernel module.
# modprobe bug_kflash 
  • Mount a char device at /dev/bug_kflash with the major number provided by /proc/devices
# cd /root
# mknod /dev/bug_kflash c `grep KFLASH /proc/devices | sed "s/ .*$//"` 0
  • After the setup is complete, execute bug_kflash and you should see the following output:
# /sbin/bug_kflash 

Name           FLASH addr       Mem addr        FIS len         Entry pt        Image len
RedBoot        0xa0000000       0xa0000000      0x40000
RedBoot config 0xa1fff000       0xa1fff000      0x1000
FIS directory  0xa1ffc000       0xa1ffc000      0x3000
kernel         0xa0100000       0x100000        0x200000        0x100000        0x200000
image2         0xa0400000       0x100000        0x18c000        0x100000        0x18bc28

clock 532
fis load kernel
exec -b 0x100000 -l 0x200000 -c "noinitrd console=ttymxc4,115200 rootdelay=1 init=/linuxrc root=/dev/mmcblk0p1 ip=192.168.0.111:192.168.0.121:192.168.0.121:255 jtag=on"


>>> CAUTION - ERASING FLASH (WAIT ...) <<<

bug_kflash.c: erasing FLASH block at address 0x400000 ...
bug_kflash.c: erasing FLASH block at address 0x410000 ...
bug_kflash.c: erasing FLASH block at address 0x420000 ...
...
>>> CAUTION - PROGRAMMING FLASH (WAIT ...) <<< 

programming block at offset 0x0 ...
programming block at offset 0x10000 ...
...
>>> CAUTION - PROGRAMMING FLASH (WAIT ...) <<< 

bug_kflash.c: wait 2.5 seconds for block erase

Name           FLASH addr       Mem addr        FIS len         Entry pt        Image len
RedBoot        0xa0000000       0xa0000000      0x40000
RedBoot config 0xa1fff000       0xa1fff000      0x1000
FIS directory  0xa1ffc000       0xa1ffc000      0x3000
kernel         0xa0100000       0x100000        0x200000        0x100000        0x200000
image2         0xa0400000       0x100000        0x18c000        0x100000        0x18bc28 

clock 532
fis load image2
exec -b 0x100000 -l 0x200000 -c "noinitrd console=ttymxc4,115200 rootdelay=1 init=/linuxrc root=/dev/mmcblk0p1 ip=192.168.0.111:192.168.0.121:192.168.0.121:255 jtag=on"
 
>>> PROGRAMMING COMPLETE <<< 

  • You're done. Reboot your BUG and enjoy the new kernel fabulousness.

Further Notes

There are a number of ways to upgrade the kernel, although two of the three ways require additional equipment (see Handylink_to_RS232 and here).

Unfortunately we're not yet selling the daughter card required for network access. TFTP upgrading requires the daughter card. The serial cable can be used, and in combination with either kermit or minicom (or your serial console of choice), you can upgrade the kernel via ymodem.

See here Kernel Flashing supplement for detailed information about how to do this.