Bug 4104 - Need a method for install/update of bzImage
Summary: Need a method for install/update of bzImage
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: deployment (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ enhancement
Target Milestone: 1.6
Assignee: Hongxu Jia
QA Contact:
URL:
Whiteboard:
: 4756 (view as bug list)
Depends on: 4756
Blocks: 4106 4694
  Show dependency tree
 
Reported: 2013-03-25 16:22 UTC by Jason Wessel
Modified: 2013-11-26 12:30 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Wessel 2013-03-25 16:22:31 UTC
Presently the installer automatically copies the bzImage and optional initrd into the /boot area and populates the initial boot menu.

This should be managed by a post deploy method such that a board can get an new kernel but also have the previous fall back kernel as well.  A good example would be the Fedora Linux updates where you receive and rpm which has the kernel and when installed it will update the boot area and the boot menu with the kernel as the priority but allow you to fall back to the original kernel as well.
Comment 1 Song Liu 2013-04-08 21:55:01 UTC
This should be 'enhancement' since it's a feature request.
Comment 2 Darren Hart 2013-07-24 15:57:44 UTC
4756 calls out a problem with using symlinks when a FAT partition is involved. I suspect that will be a problem here as well, marking is dependent.
Comment 3 Bruce Ashfield 2013-07-24 19:39:31 UTC
I'm not the right person to work on this, I'll be updating to the new
kernel in M4 and won't have the cycles. I'm looking for a new assignee and
will get the case updated.
Comment 4 Darren Hart 2013-09-18 15:13:26 UTC
*** Bug 4756 has been marked as a duplicate of this bug. ***
Comment 5 Darren Hart 2013-09-18 15:14:03 UTC
From 4756, now a dup of this, Holger Freyther said:



Currently I am using the "boot-directdisk" bbclass to create a raw image for an x86 based system. My target system does not have EFI support which means that syslinux is used. I am using the boot-directdisk because this allows me to "install" the image using wget -O/dd on the compact flash card before assembling the unit.

The issue with this approach is that currently I am unable to upgrade the kernel image (which results in still shipping a kernel with many known security issues). By default the kernel recipe will use update-alternatives to create/update a symlink to point to the new kernel image. If I update the kernel package the installed kernel and the modules will not match.

My proposal would be to use another boot loader. I asked about grub but Darren Hart pointed me to extlinux. In case of extlinux I could do one of the following:

I could either have a dedicated /boot partition for extlinux or include it directly in my system.
Comment 6 Hongxu Jia 2013-11-07 01:24:55 UTC
Merged into master ecf98b4288870be7ab62c3b040896b7877b50b35
Comment 7 Hongxu Jia 2013-11-07 01:27:03 UTC
Testing Case:
-----------------
1. Do configure and build a new kernel image rpm package.

2. Prepare a deployed target, and make sure your boot area has enough disk
   space (free space >= 5MB).

3. Download the new kernel image rpm to the target.

4. Before install/update, check boot area and menu
root@qemux86-64:~# ls /boot/
grub        vmlinuz

root@qemux86-64:~# cat /boot/grub/grub.cfg
menuentry "Linux" {
    set root=(hd0,1)
    linux /vmlinuz root=/dev/hdb2  rw  console=tty0  quiet
}

4. Install/update bzImage
root@qemux86-64:~# rpm -i kernel-image-3.10.11-yocto-standard-3.10.12+git0+285f93bf94_702040ac7c-r0.qemux86_64.rpm 
Caution! Update kernel may affect kernel-module!
update-alternatives: Linking //boot/bzImage to bzImage-3.10.11-yocto-standard

5. After install/update, check boot area and menu
root@qemux86-64:~# ls /boot/ -al
drwxr-xr-x    4 root     root          1024 Sep 18 06:58 .
drwxr-xr-x   17 root     root          4096 Sep 18 06:41 ..
lrwxrwxrwx    1 root     root            30 Sep 18 06:58 bzImage -> bzImage-3.10.11-yocto-standard
-rw-r--r--    1 root     root       5601808 Sep 18 06:45 bzImage-3.10.11-yocto-standard
drwxr-xr-x    4 root     root          1024 Sep 18 06:58 grub
-rwxr-x---    1 root     root       5601776 Sep 18 06:38 vmlinuz

root@qemux86-64:~# cat /boot/grub/grub.cfg 
menuentry "Update bzImage-3.10.11-yocto-standard-3.10.12+gitAUTOINC+285f93bf94_702040ac7c" {
    set root=(hd0,1)
    linux /bzImage-3.10.11-yocto-standard root=/dev/hdb2  rw  console=tty0  quiet
}
menuentry "Linux" {
    set root=(hd0,1)
    linux /vmlinuz root=/dev/hdb2  rw  console=tty0  quiet
}


6. Reboot target, 'Update bzImage-3.10.11-yocto-standard-3.10.12+gitAUTOINC+285f93bf94_702040ac7c'
   will be in the boot menu.

7. It supports GRUB 0.97 in which use menu.lst rather than grub.cfg as config
   file.

8. If you install the same rpm more than one time with '--force', there will
   be multiple kernel images in boot area and menu.
Comment 8 Hongxu Jia 2013-11-07 01:28:34 UTC
(In reply to comment #7)
> Testing Case:
> -----------------
> 1. Do configure and build a new kernel image rpm package.
> 
Add INHERIT_append = " kernel-grub" in local.conf and build
Comment 9 Ionut Chisanovici 2013-11-26 12:30:37 UTC
Tested and verified.
Multiple kernels are there, grub.cfg is updated, the option to choose between the kernels is available.

Ionut C.