Debian Bug report logs - #1121366
linux-run-hooks uses wrong directory name for headers postinst

version graph

Package: linux-base; Maintainer for linux-base is Debian Kernel Team <debian-kernel@lists.debian.org>; Source for linux-base is src:linux-base (PTS, buildd, popcon).

Reported by: Andras Korn <korn-debbugs@elan.rulez.org>

Date: Tue, 25 Nov 2025 10:41:01 UTC

Severity: normal

Tags: patch, pending

Found in version linux-base/4.12

Forwarded to https://salsa.debian.org/kernel-team/linux-base/-/merge_requests/19

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Dynamic Kernel Module System Team <dkms@packages.debian.org> (dkms for {1121366}):
Bug#1121366; Package dkms. (Tue, 25 Nov 2025 10:41:01 GMT) (full text, mbox, link).


Acknowledgement sent to Andras Korn <korn-debbugs@elan.rulez.org>:
New Bug report received and forwarded. Copy sent to dkms@packages.debian.org. (Tue, 25 Nov 2025 10:41:01 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Andras Korn <korn-debbugs@elan.rulez.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Ships /etc/kernel/header_postinst.d instead of /etc/kernel/headers_postinst.d
Date: Tue, 25 Nov 2025 11:38:26 +0100
Package: dkms
Version: 3.2.2-1
Severity: normal

Hi,

dkms ships a /etc/kernel/header_postinst.d/dkms file, which I suppose is expected to run when the linux-headers postinst scripts call:

linux-run-hooks headers postinst $version -- "$@"

However, linux-run-hooks doesn't use /etc/kernel/header_postinst.d, only /etc/kernel/headers_postinst.d, so the shipped /etc/kernel/header_postinst.d/dkms is never run.

(I verified this by adding --verbose --debug to the run-parts invocation in linux-run-hooks.)

András

-- System Information:
Debian Release: forky/sid
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (350, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.16.12+deb14+1-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=hu_HU.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8
Shell: /bin/sh linked to /usr/bin/dash
Init: runit (via /run/runit.stopit)
LSM: AppArmor: enabled

Versions of packages dkms depends on:
ii  build-essential  12.12
ii  dpkg-dev         1.22.21
ii  kmod             34.2-2
ii  make             4.4.1-3
ii  patch            2.8-2

Versions of packages dkms recommends:
ii  fakeroot             1.37.1.2-1
ii  gcc [c-compiler]     4:15.2.0-4
ii  gcc-12 [c-compiler]  12.5.0-6
ii  gcc-13 [c-compiler]  13.4.0-4
ii  gcc-14 [c-compiler]  14.3.0-10
ii  gcc-15 [c-compiler]  15.2.0-9
ii  sudo                 1.9.17p2-1

Versions of packages dkms suggests:
ii  e2fsprogs  1.47.2-3+b3
ii  menu       2.1.51

-- no debconf information

-- 
               How come the AT&T logo looks like the Death Star?



Information forwarded to debian-bugs-dist@lists.debian.org, Dynamic Kernel Module System Team <dkms@packages.debian.org> (dkms for {1121366}):
Bug#1121366; Package dkms. (Wed, 26 Nov 2025 23:59:01 GMT) (full text, mbox, link).


Acknowledgement sent to Andreas Beckmann <anbe@debian.org>:
Extra info received and forwarded to list. Copy sent to dkms@packages.debian.org. (Wed, 26 Nov 2025 23:59:01 GMT) (full text, mbox, link).


Message #10 received at 1121366@bugs.debian.org (full text, mbox, reply):

From: Andreas Beckmann <anbe@debian.org>
To: Andras Korn <korn-debbugs@elan.rulez.org>, 1121366@bugs.debian.org, Salvatore Bonaccorso <carnil@debian.org>, Ben Hutchings <benh@debian.org>
Subject: Re: Bug#1121366: Ships /etc/kernel/header_postinst.d instead of /etc/kernel/headers_postinst.d
Date: Thu, 27 Nov 2025 00:56:32 +0100
On 11/25/25 11:38, Andras Korn wrote:
> Package: dkms
> Version: 3.2.2-1

> dkms ships a /etc/kernel/header_postinst.d/dkms file, which I suppose is expected to run when the linux-headers postinst scripts call:
> 
> linux-run-hooks headers postinst $version -- "$@"
> 
> However, linux-run-hooks doesn't use /etc/kernel/header_postinst.d, only /etc/kernel/headers_postinst.d, so the shipped /etc/kernel/header_postinst.d/dkms is never run.
> 
> (I verified this by adding --verbose --debug to the run-parts invocation in linux-run-hooks.)

This is an uncommunicated (maybe even unintended) path change on the 
src:linux side. Older kernels had this in linux-headers-*.postinst:

 system ("run-parts --report --exit-on-error --arg=$version " .
          "/etc/kernel/header_postinst.d") &&
            die "Failed to process /etc/kernel/header_postinst.d";

This change went unnoticed so long since nowadays linux-headers-* 
depends on linux-image-* which already triggers dkms via 
/etc/kernel/postinst.d/dkms (making 
/etc/kernel/header{,s}_postinst.d/dkms more or less a no-op).


Andreas



Information forwarded to debian-bugs-dist@lists.debian.org, Dynamic Kernel Module System Team <dkms@packages.debian.org> (dkms for {1121366}):
Bug#1121366; Package dkms. (Thu, 27 Nov 2025 11:25:01 GMT) (full text, mbox, link).


Acknowledgement sent to Ben Hutchings <benh@debian.org>:
Extra info received and forwarded to list. Copy sent to dkms@packages.debian.org. (Thu, 27 Nov 2025 11:25:01 GMT) (full text, mbox, link).


Message #15 received at 1121366@bugs.debian.org (full text, mbox, reply):

From: Ben Hutchings <benh@debian.org>
To: Andreas Beckmann <anbe@debian.org>, Andras Korn <korn-debbugs@elan.rulez.org>, 1121366@bugs.debian.org, Salvatore Bonaccorso <carnil@debian.org>
Subject: Re: Bug#1121366: Ships /etc/kernel/header_postinst.d instead of /etc/kernel/headers_postinst.d
Date: Thu, 27 Nov 2025 12:23:39 +0100
[Message part 1 (text/plain, inline)]
Control: reassign -1 linux-base 4.12

On Thu, 2025-11-27 at 00:56 +0100, Andreas Beckmann wrote:
> On 11/25/25 11:38, Andras Korn wrote:
> > Package: dkms
> > Version: 3.2.2-1
> 
> > dkms ships a /etc/kernel/header_postinst.d/dkms file, which I suppose is expected to run when the linux-headers postinst scripts call:
> > 
> > linux-run-hooks headers postinst $version -- "$@"
> > 
> > However, linux-run-hooks doesn't use /etc/kernel/header_postinst.d, only /etc/kernel/headers_postinst.d, so the shipped /etc/kernel/header_postinst.d/dkms is never run.
> > 
> > (I verified this by adding --verbose --debug to the run-parts invocation in linux-run-hooks.)
> 
> This is an uncommunicated (maybe even unintended) path change on the 
> src:linux side. Older kernels had this in linux-headers-*.postinst:
[...]

This was an unintended change when I reimplemented hook handling in
linux-run-hooks (in linux-base).  I just didn't notice that the
directory prefix was previously "header_" and not "headers_" (like the
package names).

Since nothing appears to install a hook in the new directories
(/{etc,usr/share}/kernel/headers_postinst.d) yet, I will change this
back rather than trying to support both.

Ben.

-- 
Ben Hutchings - Debian developer, member of kernel, installer and LTS
teams
[signature.asc (application/pgp-signature, inline)]

Bug reassigned from package 'dkms' to 'linux-base'. Request was from Ben Hutchings <benh@debian.org> to 1121366-submit@bugs.debian.org. (Thu, 27 Nov 2025 11:25:01 GMT) (full text, mbox, link).


No longer marked as found in versions dkms/3.2.2-1. Request was from Ben Hutchings <benh@debian.org> to 1121366-submit@bugs.debian.org. (Thu, 27 Nov 2025 11:25:01 GMT) (full text, mbox, link).


Marked as found in versions linux-base/4.12. Request was from Ben Hutchings <benh@debian.org> to 1121366-submit@bugs.debian.org. (Thu, 27 Nov 2025 11:25:02 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org> (linux-base for {1121366}):
Bug#1121366; Package linux-base. (Thu, 27 Nov 2025 11:53:02 GMT) (full text, mbox, link).


Acknowledgement sent to Ben Hutchings <benh@debian.org>:
Extra info received and forwarded to list. Copy sent to debian-kernel@lists.debian.org. (Thu, 27 Nov 2025 11:53:02 GMT) (full text, mbox, link).


Message #26 received at 1121366@bugs.debian.org (full text, mbox, reply):

From: Ben Hutchings <benh@debian.org>
To: Andreas Beckmann <anbe@debian.org>, Andras Korn <korn-debbugs@elan.rulez.org>, 1121366@bugs.debian.org, Salvatore Bonaccorso <carnil@debian.org>
Subject: Re: Bug#1121366: Ships /etc/kernel/header_postinst.d instead of /etc/kernel/headers_postinst.d
Date: Thu, 27 Nov 2025 12:50:05 +0100
[Message part 1 (text/plain, inline)]
On Thu, 2025-11-27 at 00:56 +0100, Andreas Beckmann wrote:
[...]
> This change went unnoticed so long since nowadays linux-headers-* 
> depends on linux-image-* which already triggers dkms via 
> /etc/kernel/postinst.d/dkms (making 
> /etc/kernel/header{,s}_postinst.d/dkms more or less a no-op).

To make this more of a problem, and to test a fix, I ran (in a trixie
container):

   apt install acpi-call-dkms linux-headers-6.12.57+deb13-amd64
   dkms unbuild -m acpi-call -v 1.2.2 -k 6.12.57+deb13-amd64
   apt install --reinstall linux-headers-6.12.57+deb13-amd64

Ben.

-- 
Ben Hutchings - Debian developer, member of kernel, installer and LTS
teams
[signature.asc (application/pgp-signature, inline)]

Changed Bug title to 'linux-run-hooks uses wrong directory name for headers postinst' from 'Ships /etc/kernel/header_postinst.d instead of /etc/kernel/headers_postinst.d'. Request was from Ben Hutchings <benh@debian.org> to control@bugs.debian.org. (Thu, 27 Nov 2025 12:35:02 GMT) (full text, mbox, link).


Set Bug forwarded-to-address to 'https://salsa.debian.org/kernel-team/linux-base/-/merge_requests/19'. Request was from Ben Hutchings <benh@debian.org> to control@bugs.debian.org. (Thu, 27 Nov 2025 12:35:02 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org> (linux-base for {1121366}):
Bug#1121366; Package linux-base. (Thu, 27 Nov 2025 14:07:01 GMT) (full text, mbox, link).


Acknowledgement sent to Andras Korn <korn-debbugs@elan.rulez.org>:
Extra info received and forwarded to list. Copy sent to debian-kernel@lists.debian.org. (Thu, 27 Nov 2025 14:07:01 GMT) (full text, mbox, link).


Message #35 received at 1121366@bugs.debian.org (full text, mbox, reply):

From: Andras Korn <korn-debbugs@elan.rulez.org>
To: Ben Hutchings <benh@debian.org>
Cc: Andreas Beckmann <anbe@debian.org>, 1121366@bugs.debian.org, Salvatore Bonaccorso <carnil@debian.org>
Subject: Re: Bug#1121366: Ships /etc/kernel/header_postinst.d instead of /etc/kernel/headers_postinst.d
Date: Thu, 27 Nov 2025 14:58:57 +0100
On Thu, Nov 27, 2025 at 12:23:39PM +0100, Ben Hutchings wrote:

Hi,

> On Thu, 2025-11-27 at 00:56 +0100, Andreas Beckmann wrote:
> > On 11/25/25 11:38, Andras Korn wrote:
> > > Package: dkms
> > > Version: 3.2.2-1
> > 
> > > dkms ships a /etc/kernel/header_postinst.d/dkms file, which I suppose is expected to run when the linux-headers postinst scripts call:
> > > 
> > > linux-run-hooks headers postinst $version -- "$@"
> > > 
> > > However, linux-run-hooks doesn't use /etc/kernel/header_postinst.d, only /etc/kernel/headers_postinst.d, so the shipped /etc/kernel/header_postinst.d/dkms is never run.
> > > 
> > > (I verified this by adding --verbose --debug to the run-parts invocation in linux-run-hooks.)
> > 
> > This is an uncommunicated (maybe even unintended) path change on the 
> > src:linux side. Older kernels had this in linux-headers-*.postinst:
> [...]
> 
> This was an unintended change when I reimplemented hook handling in
> linux-run-hooks (in linux-base).  I just didn't notice that the
> directory prefix was previously "header_" and not "headers_" (like the
> package names).
> 
> Since nothing appears to install a hook in the new directories
> (/{etc,usr/share}/kernel/headers_postinst.d) yet, I will change this
> back rather than trying to support both.

I also found no package other than dkms install anything there, and dkms's
script hasn't actually run all this time with apparently nobody noticing
(because the same script is shipped in install.d as well).

I think it would be better to keep the name of
/etc/kernel/headers_postinst.d consistent with the -headers in the package
names, rather than modify linux-run-hooks to use the previous,
inconsistently-named directory.

Rationale: principle of least surprise. You don't know how many custom
setups that created /etc/kernel/headers_postinst.d/ (because people found
out that's what linux-run-hooks used) you'd be breaking by changing it.
Probably not many (I know of a total of 3 :), but I don't think there is a
compelling reason to do it.

If the dkms script shipped in /etc/kernel/header_postinst.d is not needed,
the dkms package can just drop it.

Summary: making a change risks breaking existing systems that depend on the
existing behaviour without any obvious benefit; not changing linux-run-hooks
carries no such risk.

Just my 2 cents.

András

-- 
            A bug is a feature that didn't make it into the manual.



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org> (linux-base for {1121366}):
Bug#1121366; Package linux-base. (Thu, 27 Nov 2025 14:45:06 GMT) (full text, mbox, link).


Acknowledgement sent to Ben Hutchings <benh@debian.org>:
Extra info received and forwarded to list. Copy sent to debian-kernel@lists.debian.org. (Thu, 27 Nov 2025 14:45:06 GMT) (full text, mbox, link).


Message #40 received at 1121366@bugs.debian.org (full text, mbox, reply):

From: Ben Hutchings <benh@debian.org>
To: Andras Korn <korn-debbugs@elan.rulez.org>
Cc: Andreas Beckmann <anbe@debian.org>, 1121366@bugs.debian.org, Salvatore Bonaccorso <carnil@debian.org>
Subject: Re: Bug#1121366: Ships /etc/kernel/header_postinst.d instead of /etc/kernel/headers_postinst.d
Date: Thu, 27 Nov 2025 15:42:10 +0100
[Message part 1 (text/plain, inline)]
On Thu, 2025-11-27 at 14:58 +0100, Andras Korn wrote:
> On Thu, Nov 27, 2025 at 12:23:39PM +0100, Ben Hutchings wrote:
> 
> Hi,
> 
> > On Thu, 2025-11-27 at 00:56 +0100, Andreas Beckmann wrote:
> > > On 11/25/25 11:38, Andras Korn wrote:
> > > > Package: dkms
> > > > Version: 3.2.2-1
> > > 
> > > > dkms ships a /etc/kernel/header_postinst.d/dkms file, which I suppose is expected to run when the linux-headers postinst scripts call:
> > > > 
> > > > linux-run-hooks headers postinst $version -- "$@"
> > > > 
> > > > However, linux-run-hooks doesn't use /etc/kernel/header_postinst.d, only /etc/kernel/headers_postinst.d, so the shipped /etc/kernel/header_postinst.d/dkms is never run.
> > > > 
> > > > (I verified this by adding --verbose --debug to the run-parts invocation in linux-run-hooks.)
> > > 
> > > This is an uncommunicated (maybe even unintended) path change on the 
> > > src:linux side. Older kernels had this in linux-headers-*.postinst:
> > [...]
> > 
> > This was an unintended change when I reimplemented hook handling in
> > linux-run-hooks (in linux-base).  I just didn't notice that the
> > directory prefix was previously "header_" and not "headers_" (like the
> > package names).
> > 
> > Since nothing appears to install a hook in the new directories
> > (/{etc,usr/share}/kernel/headers_postinst.d) yet, I will change this
> > back rather than trying to support both.
> 
> I also found no package other than dkms install anything there, and dkms's
> script hasn't actually run all this time with apparently nobody noticing
> (because the same script is shipped in install.d as well).
> 
> I think it would be better to keep the name of
> /etc/kernel/headers_postinst.d consistent with the -headers in the package
> names, rather than modify linux-run-hooks to use the previous,
> inconsistently-named directory.
>
> Rationale: principle of least surprise. You don't know how many custom
> setups that created /etc/kernel/headers_postinst.d/ (because people found
> out that's what linux-run-hooks used) you'd be breaking by changing it.
> Probably not many (I know of a total of 3 :), but I don't think there is a
> compelling reason to do it.

My rationale:

- The old directory name was supported for 15 years and in 7 stable
releases, so many local packages and scripts may depend on it.  We must
not stop supporting it without a transition plan.

- The new directory name has been supported for 6 months, and it has
been in a stable release for 3.5 months.  Reverting to the old name
post-release is not great, but it will cause less breakage.

> If the dkms script shipped in /etc/kernel/header_postinst.d is not needed,
> the dkms package can just drop it.

Currently linux-headers-* packages depend on the corresponding linux-
image-* packages, but in future that will stop being the case.  So in
some use cases that hook script will be important again.

> Summary: making a change risks breaking existing systems that depend on the
> existing behaviour without any obvious benefit; not changing linux-run-hooks
> carries no such risk.

I think you have it backwards.

Ben.

-- 
Ben Hutchings - Debian developer, member of kernel, installer and LTS
teams
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org> (linux-base for {1121366}):
Bug#1121366; Package linux-base. (Fri, 28 Nov 2025 09:35:01 GMT) (full text, mbox, link).


Acknowledgement sent to Andras Korn <korn-debbugs@elan.rulez.org>:
Extra info received and forwarded to list. Copy sent to debian-kernel@lists.debian.org. (Fri, 28 Nov 2025 09:35:01 GMT) (full text, mbox, link).


Message #45 received at 1121366@bugs.debian.org (full text, mbox, reply):

From: Andras Korn <korn-debbugs@elan.rulez.org>
To: Ben Hutchings <benh@debian.org>
Cc: Andreas Beckmann <anbe@debian.org>, 1121366@bugs.debian.org, Salvatore Bonaccorso <carnil@debian.org>
Subject: Re: Bug#1121366: Ships /etc/kernel/header_postinst.d instead of /etc/kernel/headers_postinst.d
Date: Fri, 28 Nov 2025 10:32:36 +0100
On Thu, Nov 27, 2025 at 03:42:10PM +0100, Ben Hutchings wrote:

Hi,

> > > Since nothing appears to install a hook in the new directories
> > > (/{etc,usr/share}/kernel/headers_postinst.d) yet, I will change this
> > > back rather than trying to support both.
> > 
> > I also found no package other than dkms install anything there, and dkms's
> > script hasn't actually run all this time with apparently nobody noticing
> > (because the same script is shipped in install.d as well).
> > 
> > I think it would be better to keep the name of
> > /etc/kernel/headers_postinst.d consistent with the -headers in the package
> > names, rather than modify linux-run-hooks to use the previous,
> > inconsistently-named directory.
> >
> > Rationale: principle of least surprise. You don't know how many custom
> > setups that created /etc/kernel/headers_postinst.d/ (because people found
> > out that's what linux-run-hooks used) you'd be breaking by changing it.
> > Probably not many (I know of a total of 3 :), but I don't think there is a
> > compelling reason to do it.
> 
> My rationale:
> 
> - The old directory name was supported for 15 years and in 7 stable
> releases, so many local packages and scripts may depend on it.  We must
> not stop supporting it without a transition plan.

OK, fair enough. I had no idea what the timeline was.

András

-- 
If I'm ever on life support, unplug me, then plug me back in. See if that works.



Added tag(s) patch and pending. Request was from Ben Hutchings <benh@debian.org> to control@bugs.debian.org. (Wed, 03 Dec 2025 14:03:01 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Jan 2 07:40:58 2026; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.