flash-kernel causes postinsts to fail when it happens to be installed on an unsupported system
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
flash-kernel (Ubuntu) |
Fix Released
|
High
|
Newell Jensen | ||
Trusty |
Fix Released
|
High
|
dann frazier | ||
Vivid |
Fix Released
|
High
|
dann frazier | ||
Wily |
Fix Released
|
High
|
dann frazier | ||
Xenial |
Fix Released
|
High
|
Newell Jensen |
Bug Description
[Impact]
For xgene-2 soc on UEFI system, flash-kernel is failing with:
root@(none):/# apt-get --reinstall install linux-image-
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/24.2 MB of archives.
After this operation, 0 B of additional disk space will be used.
dpkg-preconfigure: unable to re-open stdin: No such file or directory
(Reading database ... 39873 files and directories currently installed.)
Preparing to unpack .../linux-
Unpacking linux-image-
Setting up linux-image-
/etc/kernel/
update-initramfs: Generating /boot/initrd.
flash-kernel: deferring update (trigger activated)
/etc/kernel/
flash-kernel: deferring update (trigger activated)
/etc/kernel/
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
done
Processing triggers for flash-kernel (3.50) ...
Unsupported platform.
dpkg: error processing package flash-kernel (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
flash-kernel
E: Sub-process /usr/bin/dpkg returned an error code (1)
100
The patch landed in upstream debian's flash-kernel works like this:
If the machine is found to be unsupported (i.e. is not added to the db file), it then checks if the system is EFI and if it is, it prints a warning and exits instead of erroring out.
This enables us to exit gracefully for all EFI systems if they are not added to the db file and will also allow us to enable UEFI systems if we do add them to the db file.
This change needs to be back-ported for MAAS certification for this hardware.
[Test Case]
To test the bug fix, with the patched flash-kernel in place, you should be able to reinstall the current kernel on an xgene-2 SOC system by running:
# apt-get --reinstall install linux-image-
You will get a warning message that you are on an unsupported system and that it is an EFI system, instead of erroring out.
[Regression Potential]
Regression potential is extremely low as this has already been tested and landed upstream in debian's flash-kernel package and most importantly because of where the code change occurs. The code change occurs where the program is already exiting with an error. This combination makes it very unlikely for a regression to occur.
Changed in flash-kernel (Ubuntu): | |
assignee: | nobody → Newell Jensen (newell-jensen) |
description: | updated |
description: | updated |
Changed in flash-kernel (Ubuntu Wily): | |
assignee: | nobody → Newell Jensen (newell-jensen) |
Changed in flash-kernel (Ubuntu Vivid): | |
assignee: | nobody → Newell Jensen (newell-jensen) |
Changed in flash-kernel (Ubuntu Trusty): | |
assignee: | nobody → Newell Jensen (newell-jensen) |
Changed in flash-kernel (Ubuntu Trusty): | |
status: | New → Confirmed |
Changed in flash-kernel (Ubuntu Vivid): | |
status: | New → Confirmed |
Changed in flash-kernel (Ubuntu Wily): | |
status: | New → Confirmed |
Changed in flash-kernel (Ubuntu Trusty): | |
assignee: | Newell Jensen (newell-jensen) → dann frazier (dannf) |
Changed in flash-kernel (Ubuntu Vivid): | |
assignee: | Newell Jensen (newell-jensen) → dann frazier (dannf) |
Changed in flash-kernel (Ubuntu Wily): | |
assignee: | Newell Jensen (newell-jensen) → dann frazier (dannf) |
Changed in flash-kernel (Ubuntu Xenial): | |
importance: | Undecided → High |
Changed in flash-kernel (Ubuntu Wily): | |
importance: | Undecided → High |
Changed in flash-kernel (Ubuntu Vivid): | |
importance: | Undecided → High |
Changed in flash-kernel (Ubuntu Trusty): | |
importance: | Undecided → High |
Changed in flash-kernel (Ubuntu Wily): | |
status: | Confirmed → In Progress |
tags: | added: verification-done |
The following should fix the issue of flash-kernel, could anyone give a test in MAAS?
diff --git a/functions b/functions suffix= $(get_kfile_ suffix "$kfile")
index 97bbdd9..e753054 100644
--- a/functions
+++ b/functions
@@ -429,6 +429,10 @@ fi
kfile_
if ! check_supported "$machine"; then
+ # do nothing if one unsupported platform is booted from EFI
+ if [ -d /sys/firmware/efi ]; then
+ exit 0
+ fi
error "Unsupported platform."
fi