i.mx28 2.6.35.2 - updating kernel whilst running

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.mx28 2.6.35.2 - updating kernel whilst running

1,372 Views
davee
Contributor III

Hi all,

CPU: i.mx287

kernel: 2.6.35.3

LTIB

using boot stream but could use uboot.

I have an i.mx28 board based on the 28evk it has 2 sd cards slots, 1 for the booting (root fs and running kernel etc) and the other for application config file and sometimes kernel/driver updates.

What I'm seeking is a method to update/change a running kernel from the second sd card, how could i do this, is there a general method?

On a desktop I could replace/rename files in /boot and update /lib/modules whilst running (I think).

I've read a little about kexec as a possible solution.

Is there a better way to do this?

Any help or pointer links would be most appreciated.

Regards,

Dave

0 Kudos
8 Replies

990 Views
olistudent
Contributor I

Hi Dave.

As Leonardo already wrote you have to clarify your question...

You can update the kernel on your sd card like with any other Linux system, too. Just copy the files into the right place.

Or do you realy want to load a new kernel without rebooting the system? Then kexec is the way to go.

Regards

Oliver

0 Kudos

990 Views
davee
Contributor III

I suppose what I'm really after is a way of loading a new kernel and rootfs onto a running system and then reboot into the new version.

Current thinking is for a to have a read only filesystem and a compressed kernel and rootfs on a partition of a second sd card, check its version etc then uncompress onto the previously read only filesystem on the primary card, then  reboot.

Does this sound reasonable?

I still have to decided whether to use bootlets or u-boot.

Am I missing or not understanding this in some way?

0 Kudos

990 Views
LeonardoSandova
Specialist I

Hi Dave, it did not full understand your goal. What you need is to upgrade the kernel in a reboot? This is what I think

1. while running your old kernel, check somehow if there is a need for a update.

2. if yes, do a 'dd' to the region where u-boot loads the kernel

3. boot the system (reboot)

Leo

0 Kudos

990 Views
davee
Contributor III

Thanks for your response Leo.

I don't need to update the kernel during the reboot, if I wanted to do that I think I'd hack u-boot :smileyhappy:

I guess I've gained some clarification of what I need to do since I posed the initial question, which is update the kernel and rootfs from a secondary card in one go. configuration files etc used by any applications/daemons will be stored in a separate partition on the primary sd card. hence why I'm thinking of have the rootfs ro only on boot. and a compressed rootfs/kernel on the secondary card which simply gets uncompressed on to the primary.

???

0 Kudos

990 Views
YixingKong
Senior Contributor IV

Dave

This discussion is closed since no activity. If you still need help, please feel free to reply with an update to this discussion, or create another discussion.

Thanks,

Yixing

0 Kudos

990 Views
YixingKong
Senior Contributor IV

Dave

Had your issue got resolved? If yes, we are going to close the discussion in 3 days. If you still need help please feel free to contact Freescale.

Thanks,
Yixing

0 Kudos

990 Views
robby
NXP Employee
NXP Employee

I think the factor is very important whether we need to reboot the system after kernel update.

if non-reboot is required, then kexec might be an option. If reboot is required, then things would be much easier;

U-boot or a running OS (with rootfs) can do this. Depends on your requirement.

I think it's not a big deal to reboot the system in consumer electronics.

One more word, mx28 has the redundant boot feature (for NAND and SD) which might also be useful

when it come to this topic.

Robby

0 Kudos

990 Views
LeonardoSandova
Specialist I

Hi Dave. In case you do changes on the kernel itself (not drivers), I believe kexec is the only option, although I have never tried it (let me know if it works). For updating modules,  the only way I know is to re-modprobe these manually, because placing them in the /lib/modules wont have any effect of modules already loaded.

Leo

0 Kudos