acpi-override-initramfs makes update-initramfs fail when /var/lib/acpi-override/ is empty

Bug #1892035 reported by Manfred Hampl
44
This bug affects 7 people
Affects Status Importance Assigned to Milestone
acpi-override (Debian)
New
Unknown
acpi-override (Ubuntu)
In Progress
High
YIN Renlong

Bug Description

Ubuntu 20.04, but the same version is also in 20.10

user@system:~$ sudo apt install acpi-override-initramfs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  acpi-override-initramfs
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/2.640 B of archives.
After this operation, 17,4 kB of additional disk space will be used.
Selecting previously unselected package acpi-override-initramfs.
(Reading database ... 206064 files and directories currently installed.)
Preparing to unpack .../acpi-override-initramfs_0.1+nmu1_all.deb ...
Unpacking acpi-override-initramfs (0.1+nmu1) ...
Setting up acpi-override-initramfs (0.1+nmu1) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.136ubuntu6.2) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-42-generic
cp: cannot stat '/var/lib/acpi-override/*': No such file or directory
E: /usr/share/initramfs-tools/hooks/acpi-override failed with return 1.
update-initramfs: failed for /boot/initrd.img-5.4.0-42-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned
error exit status 1
Errors were encountered while processing:
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

I assume the problematic statement is in line 18 in /usr/share/initramfs-tools/hooks/acpi-override
cp -a /var/lib/acpi-override/* "$ACPI/kernel/firmware/acpi/" || exit 1

If there is no file in /var/lib/acpi-override/ (which is to be expected at initial installation of that package) the cp command gives return code 1 and dpkg ends with an error.

In my opinion the cp command should only be executed when files exist, so it probably has to be put into some kind of "if" clause (or needs an "ignore-if-empty" option).

Manfred Hampl (m-hampl)
summary: - acpi-override-initramfs makes update-initramsfs fail as long as
- /var/lib/acpi-override/* does not exist
+ acpi-override-initramfs makes update-initramsfs fail as long as
+ /var/lib/acpi-override/ is empty
Manfred Hampl (m-hampl)
summary: - acpi-override-initramfs makes update-initramsfs fail as long as
+ acpi-override-initramfs makes update-initramfs fail as long as
/var/lib/acpi-override/ is empty
summary: - acpi-override-initramfs makes update-initramfs fail as long as
- /var/lib/acpi-override/ is empty
+ acpi-override-initramfs makes update-initramfs fail when /var/lib/acpi-
+ override/ is empty
Changed in acpi-override (Debian):
status: Unknown → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in acpi-override (Ubuntu):
status: New → Confirmed
Benjamin Drung (bdrung)
Changed in acpi-override (Ubuntu):
importance: Undecided → High
Revision history for this message
Mask (brock-weller) wrote :

Any updates on this bug? Just ran into this now and seeing this is rated high and its 2 years on i assume theres a solution that I havent managed to track down.

Revision history for this message
YIN Renlong (renlong) wrote (last edit ):

Patch attached. This resolves the failure in the initramfs hook where an unconditional copy command causes update-initramfs to abort when the override directory is empty. The fix implements a defensive check to ensure the directory contains files before execution.

I have verified the solution using a clean-room environment on Ubuntu Noble (arm64). The package was rebuilt from source, and the resulting artifact was validated via A/B testing against the upstream version. This confirmed that the patch successfully repairs the broken package state while preserving functionality for populated directories. Detailed reproduction steps and raw verification logs: https://github.com/YIN-Renlong/ubuntu-launchpad-patch-log/tree/main/acpi-override/bug-1892035

Update: Apologies, I accidentally set the status to "Fix Released" while trying to select "In Progress". I do not have permission to revert it. Could a Bug Supervisor please revert the status to "In Progress"? Thanks.

Changed in acpi-override (Ubuntu):
assignee: nobody → YIN Renlong (renlong)
status: Confirmed → Fix Released
Benjamin Drung (bdrung)
Changed in acpi-override (Ubuntu):
status: Fix Released → In Progress
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.