replacing a kernel in A20 to newer or Armel

Started by RFranta, September 12, 2014, 06:15:13 PM

Previous topic - Next topic

RFranta

Hello,

is there some way how to change kernel on the latest a20 Debian image, without making image from scratch?
I would like to try Armel kernel and also newest Armhf kernel 3.90, main reason is because I need
to have mono completely working on Olinuxino and only working way to have fully working mono was
A13 Armel image, but I need this in on A20.

Thanks

MBR

I'm not sure if you want to replace the kernel in the SD card image (the file to be written on SD card) or you just want to change the kernel on a running system. You can do both. The image can be mounted using loopback (but you have to specify the max_part parameter) and modify it as a normal fylesystem. When the filesystems are mounted, the procedure is the same - replace the kernel file uImage on first partition and write new modules in /lib/modules on the root (probably the second) partition (unless you don't use modules). But if you don't compile your own kernel, you may lose some A20-specific features (frequency scalling, AXP209 support etc.).

RFranta

Hello, thank you for answer, both solutions are allright for me.
I dont know what you mean by loopback, I searched on google but loopback is very popular word :o)
What is Loopback? Software?
You are writing it like its easy, but honestly I dont understand how to do lot of things
that you are describing, because I am not expert in this field.
I will try it and come with more questions. Thank you very much.


klausbm

Hello RFranta,

if you really want to edit the image file of the SD card I suggest that you read about the commands losetup, kpartx and mount. Using the image file as a loopback device means that the image file is considered a real HDD with partitions and filesystem and size limitation.

Klaus

MBR

Yes, that right, loopback is the loopback device, which can make a block device from a file. If you want to edit an image with multiple partitions, first make sure if you have set the max_part parameter to sane value, for example by creating file /etc/modprobe.d/loop.conf with content e.g. options loop max_loop=16 max_part=16 (you will probably need to remove and re-insert the module by rmmod loop ; modprobe loop as root).

After that, attach the file to loop device using the command losetup (as root), for examply by someting like losetup /dev/loop0 name_of_the_image.img. The new device nodes will appear in /dev, probably /dev/loop0p1 and /dev/loop0p2. You can mount them as normal block device, e.g. SD cards or flash drives, by mount /dev/loop0p1 /mnt/something. After you are done, unmout all "partitons" and dettach the loop device by losetup -d /dev/loop0.

And of course, you can use the kpartx, but since the loopback supports partitions by itsels (if activated by max-part option), you will probably not need to.