Bug 1993842
Summary: | RFE: virt-inspector fails to detect the distro on Pardus-19.5 image | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 9 | Reporter: | YongkuiGuo <yoguo> |
Component: | libguestfs | Assignee: | Laszlo Ersek <lersek> |
Status: | CLOSED ERRATA | QA Contact: | YongkuiGuo <yoguo> |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | 9.0 | CC: | kkiwi, lersek, rjones, virt-maint |
Target Milestone: | beta | Keywords: | FutureFeature, RFE, Triaged |
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libguestfs-1.46.0-1.el9 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2022-05-17 12:28:37 UTC | Type: | Feature Request |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 2011711 | ||
Bug Blocks: |
Description
YongkuiGuo
2021-08-16 09:13:04 UTC
I'm setting this as a low-priority RFE for now, but the changes should be minor (patches welcome). Pardus detection was introduced in commit 233530d3541d ("inspect: Add detection of Pardus.", 2010-10-29). A guest installed from the pardus 19.5 ISO does not have "/etc/pardus-release", only "/etc/os-release", with the following contents: NAME="Pardus GNU/Linux" VERSION="19.5 (Ondokuz)" ID=pardus ID_LIKE=debian PRETTY_NAME="Pardus GNU/Linux Ondokuz" VERSION_ID="19.5" HOME_URL="https://www.pardus.org.tr/" SUPPORT_URL="https://forum.pardus.org.tr/" BUG_REPORT_URL="https://talep.pardus.org.tr/" VERSION_CODENAME=ondokuz PARDUS_CODENAME=ondokuz In libguestfs's "daemon/inspect_fs_unix.ml", the first record in the "linux_root_tests" list is (* systemd distros include /etc/os-release which is reasonably * standardized. This entry should be first. *) "/etc/os-release", parse_os_release; and the "parse_os_release" function associates the "ID" key in the "/etc/os-release" file with the "distro_of_os_release_id" function. The "distro_of_os_release_id" currently lacks a match for "pardus". What must have happened is that new Pardus releases adopted the generic "/etc/os-release".ID notation, so this BZ should be solvable by: diff --git a/daemon/inspect_fs_unix.ml b/daemon/inspect_fs_unix.ml index 557f328333f0..d96e434e57ee 100644 --- a/daemon/inspect_fs_unix.ml +++ b/daemon/inspect_fs_unix.ml @@ -152,6 +152,7 @@ and distro_of_os_release_id = function | "opensuse" -> Some DISTRO_OPENSUSE | s when String.is_prefix s "opensuse-" -> Some DISTRO_OPENSUSE | "pld" -> Some DISTRO_PLD_LINUX + | "pardus" -> Some DISTRO_PARDUS | "rhel" -> Some DISTRO_RHEL | "sles" | "sled" -> Some DISTRO_SLES | "ubuntu" -> Some DISTRO_UBUNTU The old way should be preserved for recognizing earlier Pardus releases. I'll try this out later and if it works, I'll submit an upstream patch. (In reply to Laszlo Ersek from comment #6) > diff --git a/daemon/inspect_fs_unix.ml b/daemon/inspect_fs_unix.ml > index 557f328333f0..d96e434e57ee 100644 > --- a/daemon/inspect_fs_unix.ml > +++ b/daemon/inspect_fs_unix.ml > @@ -152,6 +152,7 @@ and distro_of_os_release_id = function > | "opensuse" -> Some DISTRO_OPENSUSE > | s when String.is_prefix s "opensuse-" -> Some DISTRO_OPENSUSE > | "pld" -> Some DISTRO_PLD_LINUX > + | "pardus" -> Some DISTRO_PARDUS > | "rhel" -> Some DISTRO_RHEL > | "sles" | "sled" -> Some DISTRO_SLES > | "ubuntu" -> Some DISTRO_UBUNTU pld<->pardus are in wrong alphabetical order of course; I'll correct that. With the patch applied on top of e2f8db27d0af: --- before 2021-10-01 14:42:11.425011461 +0200 +++ after 2021-10-01 14:44:17.503078940 +0200 @@ -4,14 +4,14 @@ <root>/dev/sda1</root> <name>linux</name> <arch>x86_64</arch> - <distro>debian</distro> - <product_name>10.8</product_name> - <major_version>10</major_version> - <minor_version>8</minor_version> - <package_format>deb</package_format> - <package_management>apt</package_management> + <distro>pardus</distro> + <product_name>Pardus GNU/Linux Ondokuz</product_name> + <major_version>19</major_version> + <minor_version>5</minor_version> + <package_format>pisi</package_format> + <package_management>pisi</package_management> <hostname>pardus</hostname> - <osinfo>debian10</osinfo> + <osinfo>pardus19.5</osinfo> <mountpoints> <mountpoint dev="/dev/sda1">/</mountpoint> </mountpoints> No regressions found in the upstream libguestfs and guestfs-tools "make check" suites; posted the patch. Subject: [PATCH] daemon/inspect_fs_unix: recognize modern Pardus GNU/Linux releases Message-Id: <20211001125338.8956-1-lersek> https://listman.redhat.com/archives/libguestfs/2021-October/msg00005.html (In reply to Laszlo Ersek from comment #9) > No regressions found in the upstream libguestfs and guestfs-tools "make > check" suites; posted the patch. > > Subject: [PATCH] daemon/inspect_fs_unix: recognize modern Pardus GNU/Linux releases > Message-Id: <20211001125338.8956-1-lersek> > https://listman.redhat.com/archives/libguestfs/2021-October/msg00005.html Merged up-stream as commit 3f6f2fb8f699. I (accidentally) pulled in the fix for this to RHEL 9 GA. Test with package: libguestfs-1.46.0-1.el9.x86_64 Steps: 1. On rhel9 host $ virt-inspector -a Pardus-19.5.qcow2 --no-applications --no-icon <?xml version="1.0"?> <operatingsystems> <operatingsystem> <root>/dev/pardus-vg/root</root> <name>linux</name> <arch>x86_64</arch> <distro>pardus</distro> <product_name>Pardus GNU/Linux Ondokuz</product_name> <major_version>19</major_version> <minor_version>5</minor_version> <package_format>pisi</package_format> <package_management>pisi</package_management> <hostname>pardus</hostname> <osinfo>pardus19.5</osinfo> <mountpoints> <mountpoint dev="/dev/pardus-vg/root">/</mountpoint> <mountpoint dev="/dev/sda1">/boot</mountpoint> <mountpoint dev="/dev/pardus-vg/home">/home</mountpoint> </mountpoints> <filesystems> <filesystem dev="/dev/pardus-vg/home"> <type>ext4</type> <uuid>f66da380-0fbf-4b55-b516-cd83f8774d19</uuid> </filesystem> <filesystem dev="/dev/pardus-vg/root"> <type>ext4</type> <uuid>a83f041c-e85c-4774-b2c1-f0247e029638</uuid> </filesystem> <filesystem dev="/dev/pardus-vg/swap_1"> <type>swap</type> <uuid>6f127125-6321-4d20-83d7-f234a9d01ece</uuid> </filesystem> <filesystem dev="/dev/sda1"> <type>ext2</type> <uuid>9a8def40-7ec5-44e1-917f-38551919b92c</uuid> </filesystem> </filesystems> </operatingsystem> </operatingsystems> The info including distro, production_name, major_version ... and osinfo is correct. The issue is fixed on the latest RHEL9 compose which contains the libguestfs-1.46.0-1.el9 package. So set the status to VERIFIED. 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 |