RPi-Distro / repo

Issue tracking for the archive.raspberrypi.org repo
37 stars 1 forks source link

linux-version list - does not list anything #320

Closed CarlFK closed 1 year ago

CarlFK commented 1 year ago

On Debians:

$ linux-version list
3.13.0-141-generic
4.19.0-12-amd64
4.19.0-16-amd64
5.10.0-20-amd64

On RaspiOS:

$ linux-version list
(nothing)
CarlFK commented 1 year ago

If someone will point me to the RaspiOS source of libdpkg-perl.deb, I'll submit a patch

Replace the code that gets version strings from the file names in /boot/

sub image_list {
    my @results;

    for (glob("/boot/vmlinu[xz]-*")) {
    next if /\.sig$/;  # skip detached signatures
    push @results, [substr($_, length("/boot/vmlinu?-")), $_];
    }
    return @results;
}

https://sources.debian.org/src/linux-base/4.9/lib/DebianLinux.pm/#L87-L95

Get version strings from the file names in /var/lib/dpkg/info/raspberrypi-kernel.list

$ grep "/lib/modules/[^/]*/kernel$" /var/lib/dpkg/info/raspberrypi-kernel.list  | grep --only-matching -P "\d[^/]*"
5.15.84+
5.15.84-v7+
5.15.84-v7l+
5.15.84-v8+

If someone knows the perl to do that, good as I don't :D

extra credit: add an optional command line parameter: [--package-name [raspberrypi-kernel]]

So that this can be upstreamed to Debian but for now I am happy to create a Raspios version and make sure it works.

CarlFK commented 1 year ago

extra extra: dpkg -L raspberrypi-kernel gives the same as cat /var/lib/dpkg/info/raspberrypi-kernel.list so maybe more elegant to use https://metacpan.org/dist/Dpkg

XECDesign commented 1 year ago

We will entirely rework the way we package the kernel before the bookworm release, which should resolve all the usual initramfs woes.

So I'll close this for now, since there are no plans to fix it in the existing setup.

CarlFK commented 1 year ago

In the event someone wants a fix for bullseye:

https://github.com/CarlFK/pici/blob/main/ansible/roles/onpi/files/DebianLinux.pm#L88-L101