Package: systemtap
Version: 4.8-2
Severity: minor
Tags: upstream
X-Debbugs-Cc: [email protected]

Hey,

`stap-prep` installs all necessary debug packages on Debian 12, but
prints confusing warnings:

        $ sudo stap-prep
        Configuring for kernel release 6.1.0-10-amd64
        Debuginfo automatic downloading is not configured via $DEBUGINFOD_URLS
        dpkg: warning: version 'Debian' has bad syntax: version number does not 
start with digit

        6.1.37-1 = Debian

        Package linux-image-6.1.0-10-amd64 version 6.1.37-1 does not match 
version of currently running kernel: Debian
         Consider apt-get upgrade && reboot
        dpkg: warning: version 'Debian' has bad syntax: version number does not 
start with digit

        6.1.37-1 = Debian

        Package linux-headers-6.1.0-10-amd64 version 6.1.37-1 does not match 
version of currently running kernel: Debian
         Consider apt-get upgrade && reboot
        dpkg: warning: version 'Debian' has bad syntax: version number does not 
start with digit

        6.1.37-1 = Debian

        Package linux-image-6.1.0-10-amd64-dbg version 6.1.37-1 does not match 
version of currently running kernel: Debian
         Consider apt-get upgrade && reboot

These are caused by:

        # Debian 11
        $ uname -v
        #1 SMP Debian 5.10.179-1 (2023-05-12)

        # Debian 12
        $ uname -v
        #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03)

i.e., simple:

        $ git diff
        diff --git a/stap-prep b/stap-prep
        index 6b1bf9e99..f6e398529 100755
        --- a/stap-prep
        +++ b/stap-prep
        @@ -113,7 +113,7 @@ export DEBIAN_FRONTEND
         case "$DISTRO" in 
             Debian) # 2.6.32-39
                if uname -v | grep -q Debian; then
        -           VERSION="$(uname -v | cut -d " " -f 4)"
        +           VERSION="$(uname -v | cut -d " " -f 5)"
                else
                     VERSION="$(cut -d " " -f 3 /proc/version)"
                fi

fixes this on my system. However, I'm not sure if all Debian 12 kernel
builds are PREEMPT_DYNAMIC and this might break on some other systems.
Other option is to use the second to last field instead:

        $ git diff
        diff --git a/stap-prep b/stap-prep
        index 6b1bf9e99..475746dec 100755
        --- a/stap-prep
        +++ b/stap-prep
        @@ -113,7 +113,8 @@ export DEBIAN_FRONTEND
         case "$DISTRO" in
             Debian) # 2.6.32-39
                if uname -v | grep -q Debian; then
        -           VERSION="$(uname -v | cut -d " " -f 4)"
        +           # Second to last field
        +           VERSION="$(uname -v | rev | cut -d " " -f 2 | rev)"
                else
                     VERSION="$(cut -d " " -f 3 /proc/version)"
                fi

While this works with and without PREEMPT_DYNAMIC, there's the same
fundamental problem of cutting `uname -v` output, which doesn't make
this the most robust solution in the world.

Cheers,
Juho Kuisma

-- System Information:
Debian Release: 12.0
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-10-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_GB.UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages systemtap depends on:
ii  libavahi-client3   0.8-10
ii  libavahi-common3   0.8-10
ii  libc6              2.36-9
ii  libdw1             0.188-2.1
ii  libelf1            0.188-2.1
ii  libgcc-s1          12.2.0-14
ii  libnspr4           2:4.35-1
ii  libnss3            2:3.87.1-1
ii  libsqlite3-0       3.40.1-2
ii  libstdc++6         12.2.0-14
ii  lsb-release        12.0-1
ii  make               4.3-4.1
ii  python3            3.11.2-1+b1
ii  systemtap-common   4.8-2
ii  systemtap-runtime  4.8-2

systemtap recommends no packages.

Versions of packages systemtap suggests:
pn  systemtap-doc      <none>
pn  vim-addon-manager  <none>

-- no debconf information

Reply via email to