flash-kernel can't be properly disabled

Bug #2039468 reported by Juerg Haefliger
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flash-kernel (Ubuntu)
New
Undecided
Unassigned

Bug Description

Per the man page:

/etc/flash-kernel/machine
  If present this can be used to override the machine autodetection. The contents must be a
  string which matches an entry in the database. Or `none' to disable flash-kernel.

However, if that file contains 'none, flash-kernel bombs out with a non-0 exit status:

$ cat /etc/flash-kernel/machine
none

$ sudo flash-kernel
Unsupported platform 'none'.
$ echo $?
1

If disabled, the exit status should be 0. Otherwise installation of packages that call flash-kernel in a postinst hook will fail.

Tags: patch
Revision history for this message
Juerg Haefliger (juergh) wrote :

Processing triggers for linux-image-6.2.0-1016-raspi (6.2.0-1016.18) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.2.0-1016-raspi
flash-kernel: deferring update (trigger activated)
/etc/kernel/postinst.d/zz-flash-kernel:
flash-kernel: deferring update (trigger activated)
Processing triggers for flash-kernel (3.106ubuntu14) ...
Unsupported platform 'none'.
dpkg: error processing package flash-kernel (--configure):
 installed flash-kernel package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 flash-kernel
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

Hello Juerg,

get_machine() and its caller would have to be changed in file 'functions'.

I wonder why you have to use 'none' in /etc/flash-kernel/machine. Could you, please, describe your usage scenario. In which situation do you have neither a valid value in /proc/device-tree/model nor in /etc/flash-kernel/machine? What would write 'none' to /etc/flash-kernel/machine?

Would it help to return $? = 0 if /proc/device-tree/model does not exist? This would allow to use the same image (with flash-kernel) both on a system with ACPI as well as on one with a device-tree.

Best regards

Heinrich

Revision history for this message
Juerg Haefliger (juergh) wrote :

I just want to disable flash-kernel manually as I'm testing/installing different kernels and don't want it to run after every package installation.

The man page says I can do that but the code won't let me, so it's broken. Looking at the code, it does the correct thing if env variable FK_MACHINE == none so should also exit 0 after echo none > /etc/flash-kernel/machine.

I've opened this but it probably doesn't go anywhere: https://salsa.debian.org/installer-team/flash-kernel/-/merge_requests/51

Revision history for this message
Juerg Haefliger (juergh) wrote :
Revision history for this message
Juerg Haefliger (juergh) wrote :
tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.