How to update to the latest kernel from chroot

Asked by Sayantan Das

I am inside chroot and want to upgrade my custom iso to the latest kernel. after upgrading to the kernel i want to remove the old kernel. is that possible?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Customization Kit Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Wolf Geldmacher (wolf-womaro) said :
#1

Radio Yerevan answers: Yes, but it is not that simple.

Things you need to know:

- The kernel on an Ubuntu CD/DVD actually lives inside *and* outside the rootfs.
- The kernel (and corresponding initramfs!) lives *outside* the rootfs and
  can be found in the "casper" directory.
- The vmlinuz and initrd.lz found there are used when booting from the CD/DVD
  via the syslinux/isolinux/gfxboot framework found in the "isolinux" directory on
  the CD/DVD. (More recent Ubuntu versions seem to be able to use grub2, too)
- Once the rootfs contained in casper/filesystem.squashfs has been mounted,
  all additional modules required for operation are fetched from the /lib/modules/
  directory *inside* of the rootfs.
- The original Ubuntu CDs save some space by not having a copy of vmlinuz/initrd.lz
  in the rootfs at all. UCK does not bother to remove the extra kernel.

Therefore:

- You will need to update the kernel in the rootfs (this is to get all the kernel
  modules up to date and to get the new kernel and initrd)
- You need to copy/move the kernel and initramfs from /boot of the updated
  rootfs to the appropriate place (i.e. casper) on the ISO (Note: You need to make
  triple sure that you are not mixing kernels/initrds and that you keep the name
  and formats appropriately - this is what quite a bit of code in UCK's
  customize_iso procedure is about)
- Once you have done the first step you can get rid of the old kernel if you want
  to.

Revision history for this message
timur (ba.timur) said :
#2

Use UCK-FLOW. It already has UPDATE template which does all this. Check documentation at http://uck.svn.sourceforge.net/viewvc/uck/trunk/uck/docs/html/index.html.

Can you help with this problem?

Provide an answer of your own, or ask Sayantan Das for more information if necessary.

To post a message you must log in.