flash-kernel failure during kernel upgrade
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
flash-kernel (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Critical
|
Unassigned |
Bug Description
[Impact]
In version 3.98ubuntu10 of flash-kernel (f-k henceforth), when both f-k and the kernel are upgraded in the same cycle, depending on the ordering of dpkg trigger execution, f-k may find the content of /boot "inconsistent" causing it to fail and exit with code 2.
This causes build failures of, for instance, our server-live images.
[Test Case]
* Flash an old image (with an out of date kernel) to an SD card
* Boot the card on a pi with no network access (to ensure unattended-upgrades doesn't do anything until wanted)
* Login and change password
* Disable u-u
* Connect ethernet
* sudo apt update/upgrade
* Observe failure with 3.98ubuntu10 (and check existence of /tmp/flash-
* Reflash same old image
* Boot the card without network access
* Disable u-u
* Connect ethernet
* sudo add-apt-repository ppa:waveform/
* sudo apt update/upgrade
* Upgrade should proceed without issue
[Regression Potential]
As with the previous flash-kernel uploads, it is possible that a breakage in the changed code can lead to issues with upgrading kernels (due to f-k being executed via a trigger at the end) or with pi devices in the field not upgrading correctly. We will test all the changes extensively though.
[Original Description]
In version 3.98ubuntu10 of flash-kernel (f-k henceforth), when both f-k and the kernel are upgraded in the same cycle, depending on the ordering of dpkg trigger execution, f-k may find the content of /boot "inconsistent" causing it to fail and exit with code 2:
ubuntu@ubuntu:~$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
libdns-export1104 libdns1104 libisc-export1100 libisc1100
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
libctf-nobfd0 libctf0 libdns-export1107 libdns1107 libisc-export1104 libisc1104 linux-headers-
python3-distutils python3-
The following packages will be upgraded:
bind9-host binutils binutils-
glib-
libext2fs2 libfribidi0 libgcc1 libgeoip1 libirs161 libisccc161 libisccfg163 liblvm2cmd2.03 liblwres161 liblzo2-2 libmagic-mgc libmagic1 libnss-systemd libpam-systemd libpci3 libpcsclite1 libss2 libssh-4
libssl1.1 libstdc++6 libsystemd0 libudev1 libxml2 linux-headers-
pciutils python3-blinker python3-
79 upgraded, 17 newly installed, 0 to remove and 0 not upgraded.
Need to get 71.3 MB of archives.
After this operation, 227 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://
Get:2 http://
Get:3 http://
Get:4 http://
Get:5 http://
Get:6 http://
Get:7 http://
Get:8 http://
Get:9 http://
...
Setting up python3-
Setting up pci.ids (0.0~2020.01.25-1) ...
Setting up u-boot-rpi:armhf (2019.07+
Setting up linux-raspi2-
Setting up libmagic-mgc (1:5.38-4) ...
Setting up libssl1.1:armhf (1.1.1d-2ubuntu3) ...
Setting up binutils-
Setting up libmagic1:armhf (1:5.38-4) ...
Setting up libctf-nobfd0:armhf (2.33.90.
Setting up python3-yaml (5.3-1ubuntu1) ...
Setting up liblzo2-2:armhf (2.10-2) ...
Setting up systemd (244.1-0ubuntu2) ...
Setting up libcom-err2:armhf (1.45.3-4ubuntu3) ...
Setting up file (1:5.38-4) ...
Setting up libassuan0:armhf (2.5.3-7ubuntu2) ...
Setting up python3-zipp (1.0.0-1) ...
Setting up landscape-common (19.12-0ubuntu3) ...
Setting up libisc-
Setting up linux-modules-
Setting up python3-
Setting up liblwres161:armhf (1:9.11.
Setting up libfribidi0:armhf (1.0.8-2) ...
Setting up linux-headers-
Setting up udev (244.1-0ubuntu2) ...
update-initramfs: deferring update (trigger activated)
Setting up libss2:armhf (1.45.3-4ubuntu3) ...
Setting up libpcsclite1:armhf (1.8.26-2ubuntu2) ...
Setting up logsave (1.45.3-4ubuntu3) ...
Setting up libssh-4:armhf (0.9.3-2ubuntu1) ...
Setting up libpci3:armhf (1:3.6.4-1) ...
Setting up libdevmapper1.
Setting up python3-
Setting up dmsetup (2:1.02.
update-initramfs: deferring update (trigger activated)
Setting up python3-
Setting up libgeoip1:armhf (1.6.12-6) ...
Setting up isc-dhcp-common (4.4.1-2ubuntu6) ...
Setting up libdns-export1107 (1:9.11.
Setting up glib-networking
Setting up libbinutils:armhf (2.33.90.
Setting up geoip-database (20191224-2) ...
Setting up openssl (1.1.1d-2ubuntu3) ...
Setting up python3-lib2to3 (3.8.0-1) ...
Setting up libelf1:armhf (0.176-1.1build1) ...
Setting up libxml2:armhf (2.9.4+
Setting up info (6.7.0.dfsg.2-5) ...
Setting up python3-nacl (1.3.0-4) ...
Setting up mdadm (4.1-5ubuntu1) ...
update-initramfs: deferring update (trigger activated)
mdcheck_
Setting up python3-blinker (1.4+dfsg1-
Setting up libctf0:armhf (2.33.90.
Setting up python3-distutils (3.8.0-1) ...
Setting up glib-networking
Setting up systemd-sysv (244.1-0ubuntu2) ...
Setting up libisc1104:armhf (1:9.11.
Setting up flash-kernel (3.98ubuntu10) ...
Using DTB: bcm2710-rpi-3-b.dtb
Installing /lib/firmware/
Installing new bcm2710-
flash-kernel: deferring update (trigger activated)
Setting up python3-
Setting up libdevmapper-
Setting up python3-setuptools (44.0.0-1) ...
Setting up openssh-client (1:8.1p1-5) ...
Setting up isc-dhcp-client (4.4.1-2ubuntu6) ...
Setting up libnss-
Setting up e2fsprogs (1.45.3-4ubuntu3) ...
update-initramfs: deferring update (trigger activated)
e2scrub_all.service is a disabled or a static unit not running, not starting it.
Setting up libappstream4:armhf (0.12.10-1) ...
Setting up linux-image-
I: /boot/vmlinuz is now a symlink to vmlinuz-
I: /boot/initrd.img is now a symlink to initrd.
Setting up linux-headers-
Setting up python3-jsonschema (3.2.0-0ubuntu2) ...
Setting up pciutils (1:3.6.4-1) ...
Setting up linux-image-raspi2 (5.3.0.1017.14) ...
Setting up libpam-
Setting up libisccc161:armhf (1:9.11.
Setting up libdns1107:armhf (1:9.11.
Setting up libisccfg163:armhf (1:9.11.
Setting up glib-networking
Setting up binutils-
Setting up openssh-sftp-server (1:8.1p1-5) ...
Setting up openssh-server (1:8.1p1-5) ...
rescue-ssh.target is a disabled or a static unit, not starting it.
Setting up ubuntu-minimal (1.443) ... [10/476]
Setting up libbind9-161:armhf (1:9.11.
Setting up binutils (2.33.90.
Setting up libirs161:armhf (1:9.11.
Setting up linux-raspi2 (5.3.0.1017.14) ...
Setting up u-boot-tools (2019.07+
Setting up bind9-host (1:9.11.
Setting up dnsutils (1:9.11.
Setting up ubuntu-standard (1.443) ...
Setting up liblvm2cmd2.
Setting up dmeventd (2:1.02.
dm-event.service is a disabled or a static unit not running, not starting it.
Setting up lvm2 (2.03.02-2ubuntu8) ...
update-initramfs: deferring update (trigger activated)
Setting up ubuntu-server (1.443) ...
Processing triggers for install-info (6.7.0.dfsg.2-5) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for libglib2.0-0:armhf (2.63.3-1) ...
Processing triggers for libc-bin (2.30-0ubuntu3) ...
Processing triggers for ufw (0.36-1ubuntu6) ...
Processing triggers for man-db (2.9.0-2) ...
Processing triggers for dbus (1.12.16-2ubuntu2) ...
Processing triggers for initramfs-tools (0.133ubuntu12) ...
update-initramfs: Generating /boot/initrd.
Using DTB: bcm2710-rpi-3-b.dtb
Installing /lib/firmware/
Installing new bcm2710-
Ignoring old or unknown version 5.3.0-1015-raspi2 (latest is 5.3.0-1017-raspi2)
Processing triggers for flash-kernel (3.98ubuntu10) ...
Using DTB: bcm2710-rpi-3-b.dtb
Installing /lib/firmware/
Taking backup of bcm2710-
Installing new bcm2710-
dpkg: error processing package flash-kernel (--configure):
installed flash-kernel package post-installation script subprocess returned error exit status 2
Processing triggers for linux-image-
/etc/kernel/
update-initramfs: Generating /boot/initrd.
Using DTB: bcm2710-rpi-3-b.dtb
Installing /lib/firmware/
Taking backup of bcm2710-
Installing new bcm2710-
Installing /lib/firmware/
Taking backup of bcm2710-
Installing new bcm2710-
flash-kernel: deferring update (trigger activated)
/etc/kernel/
Using DTB: bcm2710-rpi-3-b.dtb
Installing /lib/firmware/
Taking backup of bcm2710-
Installing new bcm2710-
Installing /lib/firmware/
Taking backup of bcm2710-
Installing new bcm2710-
flash-kernel: deferring update (trigger activated)
Errors were encountered while processing:
flash-kernel
E: Sub-process /usr/bin/dpkg returned an error code (1)
This is caused by code under line 832 of "functions" (https:/
+ ls -l /boot/vmlinuz-
-rw------- 1 root root 7430656 Jan 15 21:09 /boot/vmlinuz-
+ ls -l /boot/initrd.
ls: cannot access '/boot/
A subsequent run of "apt install -f" fixed things because, by that point, the kernel's own trigger had executed, ensuring that update-initramfs had been run. In the case that f-k is run "prematurely" and finds itself in this situation (/boot/
description: | updated |
Changed in flash-kernel (Ubuntu Bionic): | |
importance: | Undecided → Critical |
description: | updated |
description: | updated |
tags: |
added: verification-done verification-done-bionic removed: verification-needed verification-needed-bionic |
This bug was fixed in the package flash-kernel - 3.98ubuntu11
---------------
flash-kernel (3.98ubuntu11) focal; urgency=medium
* Permit flash-kernel to workaround an inconsistent /boot directory when
triggered prior to the kernel finishing its triggers (LP: #1861292)
-- Dave Jones <email address hidden> Wed, 29 Jan 2020 16:15:05 +0000