RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2030709 - [RFE] libguestfs: Add Rocky Linux support
Summary: [RFE] libguestfs: Add Rocky Linux support
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libguestfs
Version: CentOS Stream
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Virtualization Maintenance
QA Contact: YongkuiGuo
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-09 14:32 UTC by Neil Hanlon
Modified: 2022-05-17 12:38 UTC (History)
7 users (show)

Fixed In Version: libguestfs-1.46.1-2.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-17 12:28:38 UTC
Type: Feature Request
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch to add Rocky Linux (6.45 KB, patch)
2021-12-09 14:52 UTC, Neil Hanlon
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-105269 0 None None None 2021-12-09 14:37:14 UTC
Red Hat Product Errata RHBA-2022:2317 0 None None None 2022-05-17 12:28:58 UTC

Description Neil Hanlon 2021-12-09 14:32:42 UTC
Description of problem:

Detection of distro missing from libguestfs.


Additional info:

Patch set sent to libguestfs

Comment 2 Neil Hanlon 2021-12-09 14:52:22 UTC
Created attachment 1845484 [details]
Patch to add Rocky Linux

Adding patch here in case the email was badly formatted

Comment 3 YongkuiGuo 2021-12-10 04:35:07 UTC
Try to detect Rocky linux with virt-inspector:

1. Download Rocky linux iso and install it
# wget https://download.rockylinux.org/pub/rocky/8/isos/x86_64/Rocky-8.5-x86_64-minimal.iso

2.
# virt-inspector -a /var/lib/libvirt/images/Rocky-8.5.qcow2
<?xml version="1.0"?>
<operatingsystems>
  <operatingsystem>
    <root>/dev/rl/root</root>
    <name>linux</name>
    <arch>x86_64</arch>
    <distro>redhat-based</distro>
    <product_name>Rocky Linux release 8.5 (Green Obsidian)</product_name>
    <major_version>8</major_version>
    <minor_version>5</minor_version>
    <package_format>rpm</package_format>
    <package_management>dnf</package_management>
    <hostname>localhost.localdomain</hostname>
    <osinfo>redhat-based8.5</osinfo>
    <mountpoints>
      <mountpoint dev="/dev/rl/root">/</mountpoint>
      <mountpoint dev="/dev/sda1">/boot</mountpoint>
    </mountpoints>
    <filesystems>
      <filesystem dev="/dev/rl/root">
        <type>xfs</type>
        <uuid>5a21c461-b629-4e25-a709-7eecea6dd5e8</uuid>
      </filesystem>
      <filesystem dev="/dev/rl/swap">
        <type>swap</type>
        <uuid>8d79255a-b2ba-489a-bbc5-50c639c20308</uuid>
      </filesystem>
      <filesystem dev="/dev/sda1">
        <type>xfs</type>
        <uuid>d7a342d4-9989-4abf-bde8-25750539878e</uuid>
      </filesystem>
    </filesystems>
    <applications>
      <application>
        <name>NetworkManager</name>
        <epoch>1</epoch>
        <version>1.32.10</version>
        <release>4.el8</release>
        <arch>x86_64</arch>
...

The distro and osinfo are not correct.

Comment 4 Richard W.M. Jones 2021-12-10 08:45:34 UTC
Upstream patch:
https://listman.redhat.com/archives/libguestfs/2021-December/msg00126.html

Comment 5 Richard W.M. Jones 2021-12-10 09:11:33 UTC
The patch didn't compile but I've fixed it up, tested and applied it:

https://github.com/libguestfs/libguestfs/commit/631962c0e88a321646846be91d0fbea1ba14e263

$ ./run virt-inspector -a disk.img --no-applications
<?xml version="1.0"?>
<operatingsystems>
  <operatingsystem>
    <root>/dev/rl/root</root>
    <name>linux</name>
    <arch>x86_64</arch>
    <distro>rocky</distro>
    <product_name>Rocky Linux 8.5 (Green Obsidian)</product_name>
    <major_version>8</major_version>
    <minor_version>5</minor_version>
    <package_format>rpm</package_format>
    <package_management>dnf</package_management>
    <hostname>localhost.localdomain</hostname>
    <osinfo>rocky8</osinfo>
    <mountpoints>
      <mountpoint dev="/dev/rl/root">/</mountpoint>
      <mountpoint dev="/dev/sda1">/boot</mountpoint>
    </mountpoints>
    <filesystems>
      <filesystem dev="/dev/rl/root">
        <type>xfs</type>
        <uuid>fed8331f-9f25-40cd-883e-090cd640559d</uuid>
      </filesystem>
      <filesystem dev="/dev/rl/swap">
        <type>swap</type>
        <uuid>6da2c121-ea7d-49ce-98a3-14a37fceaadd</uuid>
      </filesystem>
      <filesystem dev="/dev/sda1">
        <type>xfs</type>
        <uuid>4efafe61-2d20-4d93-8055-537e09bfd033</uuid>
      </filesystem>
    </filesystems>
...

Comment 6 Neil Hanlon 2021-12-10 13:50:00 UTC
Thank you for fixing up my patch. I should have tested it more thoroughly before sending it in.

With respect to your comment on the patch re: osinfodb -- Rocky should have support in future releases, if we aren't directly in there now: https://gitlab.com/libosinfo/osinfo-db/-/tree/master/data/os/rockylinux.org

Thank you again for your assistance with this patch.

Best regards,
Neil

Comment 7 Richard W.M. Jones 2021-12-10 14:22:10 UTC
Thanks - I wonder if the osinfo short ID needs to be rocky%d.%d instead of
rocky%d ?

https://github.com/libguestfs/libguestfs/blob/1941593585574849dd72c458535cd80b4d858266/lib/inspect-osinfo.c#L52

Comment 8 Louis Abel 2021-12-10 16:26:00 UTC
I believe that may be the case (rocky%d.%d vs rocky%d). Rocky uses major.minor in its /etc/os-release and /etc/rocky-release files, if that matters/helps.

Comment 10 YongkuiGuo 2021-12-24 11:50:53 UTC
Test with packages:
libguestfs-1.46.1-2.el9.x86_64
guestfs-tools-1.46.1-6.el9.x86_64
qemu-kvm-6.2.0-1.el9.x86_64


Steps:

1. On rhel9 host
# virt-inspector -a /var/lib/libvirt/images/Rocky-8.5.qcow2
<?xml version="1.0"?>
<operatingsystems>
  <operatingsystem>
    <root>/dev/rl/root</root>
    <name>linux</name>
    <arch>x86_64</arch>
    <distro>rocky</distro>
    <product_name>Rocky Linux 8.5 (Green Obsidian)</product_name>
    <major_version>8</major_version>
    <minor_version>5</minor_version>
    <package_format>rpm</package_format>
    <package_management>dnf</package_management>
    <hostname>localhost.localdomain</hostname>
    <osinfo>rocky8</osinfo>
    <mountpoints>
      <mountpoint dev="/dev/rl/root">/</mountpoint>
      <mountpoint dev="/dev/sda1">/boot</mountpoint>
    </mountpoints>
    <filesystems>
      <filesystem dev="/dev/rl/root">
        <type>xfs</type>
        <uuid>5a21c461-b629-4e25-a709-7eecea6dd5e8</uuid>
      </filesystem>
      <filesystem dev="/dev/rl/swap">
        <type>swap</type>
        <uuid>8d79255a-b2ba-489a-bbc5-50c639c20308</uuid>
      </filesystem>
      <filesystem dev="/dev/sda1">
        <type>xfs</type>
        <uuid>d7a342d4-9989-4abf-bde8-25750539878e</uuid>
      </filesystem>
    </filesystems>
    <applications>
      <application>
        <name>NetworkManager</name>
...

The info is correct.

Comment 13 YongkuiGuo 2022-01-20 03:16:39 UTC
Verified this bug since it is fixed in the latest RHEL9 compose.

Comment 15 errata-xmlrpc 2022-05-17 12:28:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: libguestfs), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2317


Note You need to log in before you can comment on or make changes to this bug.