Add detection support for Rocky Linux (CentOS/RHEL-like)

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2030709
Thanks: label@rockylinux.org

---

RWMJ notes: I fixed the original patch so it compiled.  This patch
sets osinfo to "rocky8", which doesn't exist in the osinfo db yet.
Arguably we might want to set this to "centos8", but we can see what
libosinfo decides to do.  Here is partial virt-inspector output on a
Rocky Linux disk image:

$ ./run virt-inspector -a disk.img
<?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>
This commit is contained in:
Neil Hanlon
2021-12-10 08:50:48 +00:00
committed by Richard W.M. Jones
parent d6773c102d
commit 631962c0e8
7 changed files with 26 additions and 1 deletions

View File

@@ -259,6 +259,7 @@ and check_package_format { distro } =
| None -> None
| Some DISTRO_ALTLINUX
| Some DISTRO_CENTOS
| Some DISTRO_ROCKY
| Some DISTRO_FEDORA
| Some DISTRO_MAGEIA
| Some DISTRO_MANDRIVA
@@ -329,6 +330,7 @@ and check_package_management { distro; version } =
Some PACKAGE_MANAGEMENT_DNF
| Some DISTRO_CENTOS
| Some DISTRO_ROCKY
| Some DISTRO_ORACLE_LINUX
| Some DISTRO_REDHAT_BASED
| Some DISTRO_RHEL