[Bug 1356569] Re: flash-kernel should not consider ignored kernels as latest

Manoj Iyer 1356569 at bugs.launchpad.net
Mon Sep 15 17:13:44 UTC 2014


Testing on Slayton with -proposed flash-kernel
=======================================

Installing new kernel on slayton flash-kernel pickup linux-keystone and
setup boot.scr correctly:

ubuntu at ubuntu:~$ sudo apt-get install linux-keystone
sudo: unable to resolve host ubuntu
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-3.13.0-33 linux-headers-3.13.0-33-generic-lpae
  linux-headers-generic-lpae
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  linux-headers-3.13.0-11-keystone linux-headers-keystone
  linux-image-3.13.0-11-keystone linux-image-keystone
Suggested packages:
  fdutils linux-keystone-doc-3.13.0 linux-keystone-source-3.13.0
  linux-keystone-tools
The following NEW packages will be installed:
  linux-headers-3.13.0-11-keystone linux-image-3.13.0-11-keystone
The following packages will be upgraded:
  linux-headers-keystone linux-image-keystone linux-keystone
3 upgraded, 2 newly installed, 0 to remove and 29 not upgraded.
Need to get 55.8 MB of archives.

< skipping some lines here >

update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-11-keystone /boot/vmlinuz-3.13.0-11-keystone
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-11-keystone /boot/vmlinuz-3.13.0-11-keystone
update-initramfs: Generating /boot/initrd.img-3.13.0-11-keystone
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.13.0-11-keystone /boot/vmlinuz-3.13.0-11-keystone
run-parts: executing /etc/kernel/postinst.d/x-grub-legacy-ec2 3.13.0-11-keystone /boot/vmlinuz-3.13.0-11-keystone
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Ignoring non-Xen Kernel on Xen domU host: vmlinuz-3.13.0-11-keystone
Ignoring non-Xen Kernel on Xen domU host: vmlinuz-3.13.0-9-keystone
Updating /boot/grub/menu.lst ... done

run-parts: executing /etc/kernel/postinst.d/zz-flash-kernel 3.13.0-11-keystone /boot/vmlinuz-3.13.0-11-keystone
flash-kernel: deferring update (trigger activated)
Setting up linux-headers-3.13.0-11-keystone (3.13.0-11.18) ...
Setting up linux-image-keystone (3.13.0.11.10) ...
Setting up linux-headers-keystone (3.13.0.11.10) ...
Setting up linux-keystone (3.13.0.11.10) ...
Processing triggers for flash-kernel (3.0~rc.4ubuntu49.3) ...
flash-kernel: installing version 3.13.0-11-keystone
Generating boot script u-boot image... done.
Taking backup of boot.scr.
Installing new boot.scr.

ubuntu at ubuntu:~$ ls -lh /boot
total 87M
-rw------- 1 root root 2.0M Sep  4 10:24 System.map-3.13.0-11-keystone
-rw------- 1 root root 2.7M Sep  4 00:30 System.map-3.13.0-36-generic
-rw------- 1 root root 2.0M Aug  6 16:20 System.map-3.13.0-9-keystone
-rw-r--r-- 1 root root 1.1M Sep  4 10:24 abi-3.13.0-11-keystone
-rw-r--r-- 1 root root 1.1M Sep  4 00:30 abi-3.13.0-36-generic
-rw-r--r-- 1 root root 1.1M Aug  6 16:20 abi-3.13.0-9-keystone
-rw-r--r-- 1 root root  261 Sep 15 16:57 boot.scr
-rw-r--r-- 1 root root  261 Sep 15 16:50 boot.scr.bak
-rw-r--r-- 1 root root 140K Sep  4 10:24 config-3.13.0-11-keystone
-rw-r--r-- 1 root root 159K Sep  4 00:30 config-3.13.0-36-generic
-rw-r--r-- 1 root root 140K Aug  6 16:20 config-3.13.0-9-keystone
drwxr-xr-x 2 root root 4.0K Sep 15 17:05 grub
-rw-r--r-- 1 root root  21M Sep 15 16:57 initrd.img-3.13.0-11-keystone
-rw-r--r-- 1 root root  22M Sep 15 17:05 initrd.img-3.13.0-36-generic
-rw-r--r-- 1 root root  21M Sep 12 04:11 initrd.img-3.13.0-9-keystone
-rw------- 1 root root 4.5M Sep  4 10:24 vmlinuz-3.13.0-11-keystone
-rw------- 1 root root 5.3M Sep  4 00:30 vmlinuz-3.13.0-36-generic
-rw------- 1 root root 4.5M Aug  6 16:20 vmlinuz-3.13.0-9-keystone
ubuntu at ubuntu:~$

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to flash-kernel in Ubuntu.
https://bugs.launchpad.net/bugs/1356569

Title:
  flash-kernel should not consider ignored kernels as latest

Status in The Lomond project:
  New
Status in “flash-kernel” package in Ubuntu:
  Fix Released
Status in “flash-kernel” source package in Trusty:
  Fix Committed
Status in “flash-kernel” source package in Utopic:
  Fix Released

Bug description:
  
  SRU REQUEST
  ============
  [ Impact ]
  Currently if the platform uses flavor kernels, and the cloud image has a -generic version that is newer than the flavor version, nothing gets installed and boot.scr is not generated.

  [ Test Case ]
  To reproduce this bug, download the latest c-i for armhf, chroot into it and install linux-keystone. flash-kernel will not generate a boot.scr.

  With the proposed patch you will see the following:
  + basename /usr/sbin/flash-kernel
  + self=flash-kernel
  + mktemp -dt flash-kernel.XXXXXXXX
  + tmpdir=/tmp/flash-kernel.YDX2TwaC
  + kernel=/boot/vmlinuz-3.13.0-9-keystone
  + initrd=/boot/initrd.img-3.13.0-9-keystone
  + [ -n ]
  + [ -n /boot/boot.scr ]
  + boot_script_path=//boot/boot.scr
  + boot_script=/usr/share/flash-kernel/bootscript/bootscr.keystone2
  + mkimage_script 0x0 boot script /usr/share/flash-kernel/bootscript/bootscr.keystone2 /tmp/flash-kernel.YDX2TwaC/boot.scr
  + local saddr=0x0
  + local sdesc=boot script
  + local sdata=/usr/share/flash-kernel/bootscript/bootscr.keystone2
  + local script=/tmp/flash-kernel.YDX2TwaC/boot.scr
  + basename /usr/share/flash-kernel/bootscript/bootscr.keystone2
  + local tdata=/tmp/flash-kernel.YDX2TwaC/bootscr.keystone2
  + mktemp --tmpdir=/tmp/flash-kernel.YDX2TwaC
  + local ubootenv=/tmp/flash-kernel.YDX2TwaC/tmp.roGZAJGKP2
  + gen_ubootenv
  + ENVSTUBDIRS=/etc/flash-kernel/ubootenv.d /usr/share/flash-kernel/ubootenv.d
  + LC_ALL=C+ sortfind -u
   /etc/flash-kernel/ubootenv.d /usr/share/flash-kernel/ubootenv.d -type f -regex .*/[0-9a-zA-Z_-]+ -printf %f\n
  + ENVSTUBS=
  + printf Generating boot script u-boot image...
  Generating boot script u-boot image... + sed -e /@@UBOOT_ENV_EXTRA@@/{
    s/@@UBOOT_ENV_EXTRA@@//g
    r /tmp/flash-kernel.YDX2TwaC/tmp.roGZAJGKP2
    }
  + mkimage -A arm -O linux -T script -C none -a 0x0 -e 0x0 -n boot script -d /tmp/flash-kernel.YDX2TwaC/bootscr.keystone2 /tmp/flash-kernel.YDX2TwaC/boot.scr
  + echo done.
  done.
  + boot_script=/tmp/flash-kernel.YDX2TwaC/boot.scr
  + backup_and_install /tmp/flash-kernel.YDX2TwaC/boot.scr //boot/boot.scr
  + local source=/tmp/flash-kernel.YDX2TwaC/boot.scr
  + local dest=//boot/boot.scr
  + [ -e //boot/boot.scr ]
  + basename //boot/boot.scr
  + echo Installing new boot.scr.
  Installing new boot.scr.
  + mv /tmp/flash-kernel.YDX2TwaC/boot.scr //boot/boot.scr
  + cleanups
  + rm -rf /tmp/flash-kernel.YDX2TwaC
  + [ -d ]

  [ Regression Potential ]
  NA

  === Original Report ===

  flash-kernel has logic that tries to determine "is this kernel the latest", so that it will only flash the latest kernel.
  It also has logic that white-lists certain kernel flavors.

  However, when it determines "is this the latest kernel", it does not apply the whitelist.
  This causes issues if you have other kernels installed that are "newer" but would be ignored.

  See the maas/curtin install log at http://paste.ubuntu.com/7955339/

  Specifically, it says:
  | Examining /etc/kernel/postinst.d.
  | run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-8-keystone /boot/vmlinuz-3.13.0-8-keystone
  | run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-8-keystone /boot/vmlinuz-3.13.0-8-keystone
  | update-initramfs: Generating /boot/initrd.img-3.13.0-8-keystone
  | df: Warning: cannot read table of mounted file systems: No such file or directory
  | run-parts: executing /etc/kernel/postinst.d/update-notifier 3.13.0-8-keystone /boot/vmlinuz-3.13.0-8-keystone
  | run-parts: executing /etc/kernel/postinst.d/x-grub-legacy-ec2 3.13.0-8-keystone /boot/vmlinuz-3.13.0-8-keystone
  | Searching for GRUB installation directory ... found: /boot/grub
  | Searching for default file ... found: /boot/grub/default
  | Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
  | Searching for splash image ... none found, skipping ...
  | Ignoring non-Xen Kernel on Xen domU host: vmlinuz-3.13.0-8-keystone
  | Found kernel: /boot/vmlinuz-3.13.0-32-generic
  | Updating /boot/grub/menu.lst ... done
  |
  | run-parts: executing /etc/kernel/postinst.d/zz-flash-kernel 3.13.0-8-keystone /boot/vmlinuz-3.13.0-8-keystone
  | Ignoring old or unknown version 3.13.0-8-keystone (latest is 3.13.0-32-generic)
  | Setting up linux-headers-3.13.0-8-keystone (3.13.0-8.12) ...
  | Setting up linux-headers-keystone (3.13.0.8.7) ...
  | Setting up linux-image-keystone (3.13.0.8.7) ...
  | Setting up linux-keystone (3.13.0.8.7) ...
  | Leaving 'diversion of /etc/init/ureadahead.conf to /etc/init/ureadahead.conf.disabled by cloud-init'
  | update-initramfs: Generating /boot/initrd.img-3.13.0-32-generic
  | df: Warning: cannot read table of mounted file systems: No such file or directory
  | Kernel suffix generic does not match any of the expected flavors (keystone), therefore not writing it to flash.

  Note that it decides not to flash -generic kernel because it is not in
  the whitelist, but does ignores keystone kernel because it is not the
  newest.  Result is that nothing is installed.

To manage notifications about this bug go to:
https://bugs.launchpad.net/lomond/+bug/1356569/+subscriptions



More information about the foundations-bugs mailing list