Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1023779: linux: deleting the kernel image package leaves back /lib/modules/<version> when a kernel package was built

13 views
Skip to first unread message

Christoph Anton Mitterer

unread,
Nov 9, 2022, 9:40:04 PM11/9/22
to
Source: linux
Version: 6.0.7-1
Severity: normal


Hey.

When I tried out some recent patch from the intel folks for i915,
I built a custom kernel as described in:
https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-common-official


Now before I installed the custom built debs, I wanted to make
sure the Debian ones are gone completely so I purged them, causing
apt to:
Purging configuration files for linux-image-6.0.0-3-amd64 (6.0.7-1) ...
W: Last kernel image has been removed, so removing the default symlinks
rmdir: failed to remove '/lib/modules/6.0.0-3-amd64': Directory not empty

$ diff -qr --no-dereference /lib/modules/6.0.0-3-amd64/ 6.0.0-3-amd64/
Only in 6.0.0-3-amd64/: build
Only in 6.0.0-3-amd64/: source

with the former being again a completely fresh installation of the
Debian package, and the latter begin a copy from the Debian package's
dir, after I had built my custom kernel and before I purged the package.

l 6.0.0-3-amd64/build 6.0.0-3-amd64/source
lrwxrwxrwx 1 calestyo calestyo 36 Nov 5 14:41 6.0.0-3-amd64/build -> /usr/src/linux-headers-6.0.0-3-amd64
lrwxrwxrwx 1 calestyo calestyo 37 Nov 5 14:41 6.0.0-3-amd64/source -> /usr/src/linux-headers-6.0.0-3-common

I guess something during the build process creates these symlinks?


So either, that shouldn't happen in the first place. Or removing the
package should clean it up.
I'd guess the former?


Thanks,
Chris.




-- System Information:
Debian Release: bookworm/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'unstable')
merged-usr: no
Architecture: amd64 (x86_64)

Kernel: Linux 6.0.0-3-amd64 (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_DE.UTF-8, LC_CTYPE=en_DE.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Christoph Anton Mitterer

unread,
Nov 9, 2022, 9:50:04 PM11/9/22
to
Just noted, that part of what I wrote is probably bollocks. ^^


On Thu, 2022-11-10 at 03:37 +0100, Christoph Anton Mitterer wrote:
> $ ls -al 6.0.0-3-amd64/build 6.0.0-3-amd64/source
> lrwxrwxrwx 1 calestyo calestyo 36 Nov 5 14:41 6.0.0-3-amd64/build -> /usr/src/linux-headers-6.0.0-3-amd64
> lrwxrwxrwx 1 calestyo calestyo 37 Nov 5 14:41 6.0.0-3-amd64/source -> /usr/src/linux-headers-6.0.0-3-common

The date of the symlinks is November the 5th, however I built the
custom kernel this night.

So there must have been something else that created them (dkms? - at
least not me personally)... or is there some date mangling somewhere
for making reproducible builds?

Diederik de Haas

unread,
Nov 10, 2022, 5:10:03 AM11/10/22
to
On donderdag 10 november 2022 03:42:36 CET Christoph Anton Mitterer wrote:
> On Thu, 2022-11-10 at 03:37 +0100, Christoph Anton Mitterer wrote:
> > $ ls -al 6.0.0-3-amd64/build 6.0.0-3-amd64/source
> > lrwxrwxrwx 1 calestyo calestyo 36 Nov 5 14:41 6.0.0-3-amd64/build ->
> > /usr/src/linux-headers-6.0.0-3-amd64 lrwxrwxrwx 1 calestyo calestyo 37
> > Nov 5 14:41 6.0.0-3-amd64/source ->
> > /usr/src/linux-headers-6.0.0-3-common
> The date of the symlinks is November the 5th, however I built the
> custom kernel this night.

https://tracker.debian.org/news/1381949/accepted-linux-607-1-source-into-unstable/
Shows that 6.0.0-3 was accepted into Unstable on Nov 5 ...

> So there must have been something else that created them (dkms? - at
> least not me personally)... or is there some date mangling somewhere
> for making reproducible builds?

https://tracker.debian.org/pkg/linux does say "Does not build reproducibly"
But in the aforemention link you can also see this line:
"Date: Sat, 05 Nov 2022 14:41:22 +0100"
It _could_ be a coincidence, but I doubt it. So it looks like it's not fully
reproducible (yet), but using that date is a step towards it.

Getting (back) to the actual subject of the bug report, it seems quite likely
that you also have linux-headers-X.Y.Z installed.
And IIRC, it needs/creates those 'source' and 'build' dirs/links.
signature.asc

Bastian Blank

unread,
Nov 10, 2022, 7:10:04 AM11/10/22
to
On Thu, Nov 10, 2022 at 03:37:16AM +0100, Christoph Anton Mitterer wrote:
> l 6.0.0-3-amd64/build 6.0.0-3-amd64/source
> lrwxrwxrwx 1 calestyo calestyo 36 Nov 5 14:41 6.0.0-3-amd64/build -> /usr/src/linux-headers-6.0.0-3-amd64
> lrwxrwxrwx 1 calestyo calestyo 37 Nov 5 14:41 6.0.0-3-amd64/source -> /usr/src/linux-headers-6.0.0-3-common
> I guess something during the build process creates these symlinks?

Those symlinks are included in linux-headers-6.0.0-3-amd64, see
https://packages.debian.org/sid/amd64/linux-headers-6.0.0-3-amd64/filelist

Did you remove that package as well?

Bastian

--
There's coffee in that nebula!
-- Capt. Kathryn Janeway, Star Trek: Voyager, "The Cloud"

Christoph Anton Mitterer

unread,
Nov 10, 2022, 8:20:03 AM11/10/22
to
Hey Diederik and Bastian

On Thu, 2022-11-10 at 13:07 +0100, Bastian Blank wrote:
> Those symlinks are included in linux-headers-6.0.0-3-amd64, see
> https://packages.debian.org/sid/amd64/linux-headers-6.0.0-3-amd64/filelist
>
> Did you remove that package as well?


You are both right, I have linux-headers-6.0.0-3-amd64 and totally
forgotten about that.

But nevertheless, shouldn't that then contain those files and dpkg not
print out an error then?
And indeed:
$ dpkg -L linux-headers-6.0.0-3-amd64 | grep '^/lib'
/lib
/lib/modules
/lib/modules/6.0.0-3-amd64
/lib/modules/6.0.0-3-amd64/build
/lib/modules/6.0.0-3-amd64/source

So I'm a bit surprised why I saw some error at all in that case.


Thanks,
Chris.
0 new messages