Raspberry Pi libs check fails kernel version

Bug #1904807 reported by Adam Goryachev
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
hobbit-plugins (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

The standard libs check when running on Raspberry Pi (this seems to work on amd64) fails the kernel version check for two reasons. The first is known (permissions on the image file), but the second seems to be a difference in the way the kernel test results are provided.
Specifically, based on my looking at the perl code, I think this is the command run to collect the information:
strings vmlinuz-5.8.0-1007-raspi | egrep ^5.8.0-1007-raspi\|"^Linux version"
Linux version 5.8.0-1007-raspi (buildd@bos02-arm64-039) (gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0, GNU ld (GNU Binutils for Ubuntu) 2.35.1) #10-Ubuntu SMP PREEMPT Thu Nov 5 17:52:40 UTC 2020 (Ubuntu 5.8.0-1007.10-raspi 5.8.14)
5.8.0-1007-raspi SMP preempt mod_unload aarch64
5.8.0-1007-raspi
5.8.0-1007-raspi

The problem seems to be on the first line, where after the expected version string, is an extra " (Ubuntu 5.8.0-1007.10-raspi 5.8.14)" text.
Editing the libs file as follows seems to solve the problem for me:
--- libs 2020-11-19 02:07:12.716041097 +0000
+++ libs.local 2020-11-19 02:05:20.625963787 +0000
@@ -104,7 +104,7 @@
                                 "$newest_kernel_image. Can't check kernel version!\n\n");
             }
         } else {
- if ($kernel_image_version =~ /^(Linux version )?\Q$running_kernel_release\E \(.*\) \Q$running_kernel_version\E$/) {
+ if ($kernel_image_version =~ /^(Linux version )?\Q$running_kernel_release\E \(.*\) \Q$running_kernel_version\E/) {
                 $bb->color_line('green',
                                 sprintf("Newest kernel is running: %s, version %s\n\n",
                                         $running_kernel_release,

Alternatively, adding .* before the $ would also resolve this issue. I'm not sure how to collect and repeat the other version information to resolve this, nor how this might affect other platforms, so the above seems to be the simplest solution (to just ignore any extraneous text) that should work on any platform that it worked on before.

Regards,
Adam

Tags: patch

CVE References

Revision history for this message
Adam Goryachev (webmanaus) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Fix libs check for kernel version" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Axel Beckert (xtaran)
Changed in hobbit-plugins (Ubuntu):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.3 KiB)

This bug was fixed in the package hobbit-plugins - 20230211

---------------
hobbit-plugins (20230211) unstable; urgency=medium

  [ Axel Beckert ]
  * dirtyvcs: Automatically add existing repositories from
    /etc/xymon/dirty_vcs_dirs to /var/lib/xymon/.gitconfig's
    safe.directory setting to handle fallout of the fix for
    CVE-2022-24765. Thanks to Christian Herzog for the bug report!
    + Change owner and group of /var/lib/xymon/ to xymon:xymon.
  * Remove postinst code relevant for hobbit to xymon migration.
  * Remove debian/maintscript completely. Was relevant for migrations
    before 2015, i.e. before oldoldstable.
  * Replace all occurrences of egrep and fgrep with grep -E/-F.
    Thanks tarzeau for reporting this!
  * Fix typo in comment in libs.yaml.
  * yum: Don't count "Errno" as alert if it is prepended by a dash or
    followed by a full stop, e.g. in package names like perl-Errno.x86_64.
  * Mention explicitly in the package description that hard dependencies
    of plugins enabled by default are listed in Recommends and
    dependencies of plugins disabled by default are listed in
    Suggests. Based on the according comment in debian-goodies' package
    description. (Closes: #1016162)
  * Fix bogus "Last apt update: -0.0 day(s) ago" warning by adding a small
    tolerance. (Closes: #1021775)
  * Split off the kernel/reboot check from the libs check into a separate
    check. (Closes: #752776)
    + Do not warn (and just report "clear") if the kernel image can't be
      parsed. This doesn't prompt for an action by the administrator.
      (Currently a common, but non-trivial issue on armhf, see
      /usr/share/doc/hobbit-plugins/TODO.)
  * temp:
    + Suppress grep error message if a host has no
      /sys/class/scsi_generic/.
    + Also support more than 26 (and up to 676) disks, i.e. disks named
      /dev/sdaa to /dev/sdzz).
    + Support NVMe block devices via drivetemp.
    + Consistent paths below /sys/devices/platform/ and /sys/devices/pci*.
    + Completely remove hddtemp support. (Really closes: #1001950)
    + Report "clear" if no thermal zones or hwmons are found. Avoids going
      purple after hddtemp has been removed.
    + Report "yellow" if no thermal zones or hwmons are found and
      "drivetemp" driver is not loaded.
    + Fix "Use of uninitialized value" errors in exception handling.
  * Declare compliance with Debian Policy 4.6.2.
  * Add new server-side "xcl" check to query Lenovo XClarity API for
    hardware failure events. (disabled by default; add Suggests and B-D on
    libmojolicious-perl for usage of Mojo::JSON and Mojo::UserAgent)
  * Use more precise Files stanzas and update years in debian/copyright.
  * Also update my copyright years in some plugins.

  [ Adam Goryachev ]
  * kern: Be less strict in parsing kernel versions, allow trailing
    garbage as present on Ubuntu for Raspberry Pi. (LP: #1904807)

  [ Adam Thorn ]
  * apt: Properly parse phased packages on Ubuntu. (LP: #2002391,
    #2003062, #1995481)

  [ Debian Janitor ]
  * Remove constraints unnecessary since buster (oldstable):
    + Drop versioned build-dependency on essential package dpkg-dev.
    + Drop versioned pre-d...

Read more...

Changed in hobbit-plugins (Ubuntu):
status: Fix Committed → Fix Released
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.