Kernel postrm calls /etc/kernel/postinst.d/*

Bug #1475662 reported by Philipp Kern
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Looking at linux-image-extra-3.19.0-18-generic here, but I expect this to be pretty pervasive. This is its postrm:

#!/bin/sh
set -e

case "$0::$1" in
*.postinst::configure|*.postrm::remove)
        depmod -a -F /boot/System.map-3.19.0-18-generic 3.19.0-18-generic || true
        for dir in "/etc/kernel/postinst.d" "/etc/kernel/postinst.d/3.19.0-18-generic"
        do
                if [ -d "$dir" ]; then
                        run-parts --verbose --exit-on-error --arg="3.19.0-18-generic" --arg="/boot/vmlinuz-3.19.0-18-generic" "$dir"
                fi
        done
        ;;
esac

As you can see it executes /etc/kernel/postinst.d/* instead of /etc/kernel/postrm.d/* even if it's called as a postrm script. Why? The problem for us is that this re-executes dkms's autoinstaller, which recompiles certain modules even if the kernel is being removed. But I find this behavior pretty surprising regardless of this.

Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1475662

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Philipp Kern (pkern) wrote :

This is a straightforward coding error that does not require any logs.

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Andy Whitcroft (apw) wrote :

This is intentional. This only occurs with the -extras package, and is correct for that, as when you remove it you have not removed the underlying kernel but you are essentially in the same position you would have been having just installed the base package. This means you need to run the post installation handling for the now "skinny" kernel on disk.

Yes, this is unfortuanate when you are next going to remove that kernel too. This would be fixed (I beleive) by correctly using triggers for these rebuilds. But right now there are no triggers for those.

Tim Gardner (timg-tpi)
Changed in linux (Ubuntu):
status: Confirmed → Invalid
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.