Bug 1995391
| Summary: | RFE: virt-inspector fails to detect the distro and applications on Kylin-Desktop-V10 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, Triaged | ||||||
| Target Release: | --- | Flags: | pm-rhel:
mirror+
|
||||||
| Hardware: | x86_64 | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | libguestfs-1.46.0-5.el9 | Doc Type: | If docs needed, set a value | ||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | |||||||||
| : | 2025950 (view as bug list) | 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: | |||||||||
| Bug Blocks: | 2025950 | ||||||||
| Attachments: |
|
||||||||
"Kylin" seems to be a proprietary operating system from China that happens to use the Linux kernel. Also known as NeoKylin: https://en.wikipedia.org/wiki/Kylin_(operating_system)#Kylin_Linux_(NeoKylin) libguestfs seems to have added support for recognizing this OS under BZ#1476081 / upstream commit cd08039d2427 ("daemon: inspection: Add support for NeoKylin (RHBZ#1476081).", 2017-10-12). [*] Side discussion: wikipedia calls this OS "proprietary", and in <https://bugzilla.redhat.com/show_bug.cgi?id=1476081#c2>, Pino called it "a commercial distribution". I don't think that should interfere with our testing: the distro is surely chock-full of free -- GPL -- software, so *once* the producers distribute the OS to *someone*, they cannot prevent that recipient from distributing the OS *further*, such as giving an image of it to me for patch verification. (What the producers can do at worst is to deny further business, such as OS updates, to the original recipient.) Attachment 1337488 [details] from bug 1476081 comment 10 contained the following "/etc/os-release" file: > NAME="NeoKylin Linux Advanced Server" > VERSION="V7Update2 (Potassium)" > ID="neokylin" > ID_LIKE="fedora" > VERSION_ID="V7Update2" > PRETTY_NAME="NeoKylin Linux Advanced Server V7Update2 (Potassium)" > ANSI_COLOR="0;31" > CPE_NAME="cpe:/o:neokylin:enterprise_linux:V7Update2:GA:server" > HOME_URL="https://www.cs2c.com.cn/" > BUG_REPORT_URL="https://bugzilla.cs2c.com.cn/" > > NEOKYLIN_BUGZILLA_PRODUCT="NeoKylin Linux Advanced Server 7" > NEOKYLIN_BUGZILLA_PRODUCT_VERSION=V7Update2 > NEOKYLIN_SUPPORT_PRODUCT="NeoKylin Linux Advanced Server" > NEOKYLIN_SUPPORT_PRODUCT_VERSION="V7Update2" Commit cd08039d2427 seems to have done two things: - it would recognize this OS from ID=neokylin, - for parsing the major/minor release numbers, it hooked the VERSION_ID detection with a special regular expression. The producers of Kylin now appear to have broken their own scheme, and to set: > ID="kylin" > VERSION_ID="v10" at least based on attachemnt 1815401 in comment 0 on the present bug, namely > check_tests: checking /etc/os-release > chroot: /sysroot: running 'is_file: /etc/os-release' > chroot: /sysroot: running 'parse_os_release' > /etc/os-release: unknown ID=kylin <------ see here > parse_version_from_major_minor: parsing 'v10' <------ and here > check_tests: checking /etc/lsb-release > chroot: /sysroot: running 'is_file: /etc/lsb-release' > chroot: /sysroot: running 'parse_lsb_release' > parse_lsb_release: parsing: DISTRIB_ID=Kylin > lsb-release: unknown DISTRIB_ID=Kylin > parse_lsb_release: parsing: DISTRIB_RELEASE=V10 > parse_version_from_major_minor: parsing 'V10' > parse_lsb_release: parsing: DISTRIB_CODENAME=kylin > parse_lsb_release: parsing: DISTRIB_DESCRIPTION=Kylin V10 SP1 > parse_lsb_release: parsing: DISTRIB_KYLIN_RELEASE=V10 > parse_lsb_release: parsing: DISTRIB_VERSION_TYPE=enterprise > parse_lsb_release: parsing: DISTRIB_VERSION_MODE=normal In fact, the function "parse_version_from_major_minor" copes with "v10" just fine, thanks to "re_major_no_minor", but ID=neokylin from commit cd08039d2427 no longer matches. I can try a simple (~ one-liner) patch for this, but I can't verify it without having access to the qcow2 image from comment#0. YongkuiGuo: please give me access to your image, or else I'll have to build scratch RHEL9 RPMs with the prospective upstream patch(es) applied, and play ping-pong with you until the patches happen to recognize the image. I'd rather not do the latter. Thanks. A possible way to test this without Kylin could be: $ virt-builder fedora-34 --upload attachment.txt:/etc/os-release $ ./run virt-inspector fedora-34.img (where attachment.txt is the attachment of this bug) (In reply to Richard W.M. Jones from comment #5) > A possible way to test this without Kylin could be: > > $ virt-builder fedora-34 --upload attachment.txt:/etc/os-release > $ ./run virt-inspector fedora-34.img > > (where attachment.txt is the attachment of this bug) Thanks! Unfortunately, unlike under bug 1993842 (or original Kyling-enablement bug 1476081), the attachment here does not contain a pristine copy of /etc/os-release. The attachment on comment 0 is a virt-inspector log. It contains some snippets from /etc/os-release, but not the whole file intact. YongkuiGuo: can you please attach the /etc/os-release file from your Kylin v10 image? Thanks. (In reply to Laszlo Ersek from comment #6) > (In reply to Richard W.M. Jones from comment #5) > > A possible way to test this without Kylin could be: > > > > $ virt-builder fedora-34 --upload attachment.txt:/etc/os-release > > $ ./run virt-inspector fedora-34.img > > > > (where attachment.txt is the attachment of this bug) > > Thanks! Unfortunately, unlike under bug 1993842 (or original > Kyling-enablement bug 1476081), the attachment here does not contain a > pristine copy of /etc/os-release. The attachment on comment 0 is a > virt-inspector log. It contains some snippets from /etc/os-release, but not > the whole file intact. > > YongkuiGuo: can you please attach the /etc/os-release file from your Kylin > v10 image? Thanks. Hi Laszlo, sorry for my late reply. Just come back from the National Day holiday. The /etc/os-release file is attached. If you still need the Kylin-Desktop-V10.qcow2 image, let me know. (In reply to Laszlo Ersek from comment #3) > "Kylin" seems to be a proprietary operating system from China that > happens to use the Linux kernel. Also known as NeoKylin: > > > https://en.wikipedia.org/wiki/Kylin_(operating_system)#Kylin_Linux_(NeoKylin) > > libguestfs seems to have added support for recognizing this OS under > BZ#1476081 / upstream commit cd08039d2427 ("daemon: inspection: Add > support for NeoKylin (RHBZ#1476081).", 2017-10-12). > > [*] Side discussion: wikipedia calls this OS "proprietary", and in > <https://bugzilla.redhat.com/show_bug.cgi?id=1476081#c2>, Pino > called it "a commercial distribution". I don't think that should > interfere with our testing: the distro is surely chock-full of free > -- GPL -- software, so *once* the producers distribute the OS to > *someone*, they cannot prevent that recipient from distributing the > OS *further*, such as giving an image of it to me for patch > verification. (What the producers can do at worst is to deny further > business, such as OS updates, to the original recipient.) > > Attachment 1337488 [details] from bug 1476081 comment 10 contained the > following > "/etc/os-release" file: > > > NAME="NeoKylin Linux Advanced Server" > > VERSION="V7Update2 (Potassium)" > > ID="neokylin" > > ID_LIKE="fedora" > > VERSION_ID="V7Update2" > > PRETTY_NAME="NeoKylin Linux Advanced Server V7Update2 (Potassium)" > > ANSI_COLOR="0;31" > > CPE_NAME="cpe:/o:neokylin:enterprise_linux:V7Update2:GA:server" > > HOME_URL="https://www.cs2c.com.cn/" > > BUG_REPORT_URL="https://bugzilla.cs2c.com.cn/" > > > > NEOKYLIN_BUGZILLA_PRODUCT="NeoKylin Linux Advanced Server 7" > > NEOKYLIN_BUGZILLA_PRODUCT_VERSION=V7Update2 > > NEOKYLIN_SUPPORT_PRODUCT="NeoKylin Linux Advanced Server" > > NEOKYLIN_SUPPORT_PRODUCT_VERSION="V7Update2" > > Commit cd08039d2427 seems to have done two things: > > - it would recognize this OS from ID=neokylin, > Seems Kylin is another Linux operation system that is different from NeoKylin. (In reply to YongkuiGuo from comment #9) > Seems Kylin is another Linux operation system that is different from > NeoKylin. I wonder why the distributors of this operating system are so attached to the name Kylin. It is incredibly confusing. Based on the file you uploaded, this OS is derived from *Ubuntu* (and so Debian), not Fedora. And so from the earlier-linked wikipedia article, the following section applies: https://en.wikipedia.org/wiki/Kylin_(operating_system)#Ubuntu_Kylin > In 2013, Canonical reached an agreement with the Ministry of Industry > and Information Technology of the People's Republic of China to > release an Ubuntu-based Linux OS with features targeted at the Chinese > market. Ubuntu Kylin has been described as "a loose continuation of > China's Kylin OS". Which Ubuntu release is "Kylin V10 SP1" based upon? Because, considering Rich's testing recommendation from comment 5: > $ virt-builder fedora-34 --upload attachment.txt:/etc/os-release > $ ./run virt-inspector fedora-34.img I'll have to replace the base OS identifier ("fedora-34") with *some* Ubuntu release identifier. But I don't know which one. (Also, the table at <https://en.wikipedia.org/wiki/Ubuntu_Kylin#Release_History> does not associate Ubuntu releases with Kylin codenames.) Please make the full disk image available. Thanks. That's because I didn't realise it was based on Ubuntu. Maybe a reproducer based on an Ubuntu image might be better: $ virt-builder -l | grep ubuntu- ubuntu-10.04 x86_64 Ubuntu 10.04 (Lucid) ubuntu-12.04 x86_64 Ubuntu 12.04 (Precise) ubuntu-14.04 x86_64 Ubuntu 14.04 (Trusty) ubuntu-16.04 x86_64 Ubuntu 16.04 (Xenial) ubuntu-18.04 x86_64 Ubuntu 18.04 (bionic) ubuntu-20.04 x86_64 Ubuntu 20.04 (focal) (In reply to Laszlo Ersek from comment #10) > (In reply to YongkuiGuo from comment #9) > > > Seems Kylin is another Linux operation system that is different from > > NeoKylin. > > I wonder why the distributors of this operating system are so attached > to the name Kylin. It is incredibly confusing. Based on the file you > uploaded, this OS is derived from *Ubuntu* (and so Debian), not Fedora. > And so from the earlier-linked wikipedia article, the following section > applies: > > https://en.wikipedia.org/wiki/Kylin_(operating_system)#Ubuntu_Kylin > Indeed it's confusing. In the above link: https://en.wikipedia.org/wiki/Kylin_(operating_system)#Ubuntu_Kylin 1. This line: By 2019 NeoKylin variant is compatible with more than 4,000 software and hardware products and it ships pre-installed on most computers sold in China. This is 'Neokylin' 2. This line: A separate project using Ubuntu as the base Linux operating system was announced in 2013. The first version of Ubuntu Kylin was released in April 2013. This is 'Ubuntu Kylin' 3. This line: In August 2020, v10 of Kylin OS was launched. It is compatible with 10,000 hardware and software products and it "supports Google's Android ecosystem". This should be 'Kylin' This bug is about 'Kylin V10'. So actually there are three operation systems. Inspect these three images respectively: 1. # virt-inspector -a NeoKylin-Linux-Desktop-6.0.qcow2 --no-applications <?xml version="1.0"?> <operatingsystems> <operatingsystem> <root>/dev/sda3</root> <name>linux</name> <arch>x86_64</arch> <distro>neokylin</distro> <product_name>NeoKylin Linux Desktop 6.0</product_name> <major_version>6</major_version> <minor_version>0</minor_version> <package_format>rpm</package_format> <package_management>dnf</package_management> <hostname>localhost.localdomain</hostname> <osinfo>neokylin6.0</osinfo> <mountpoints> <mountpoint dev="/dev/sda3">/</mountpoint> <mountpoint dev="/dev/sda1">/boot</mountpoint> </mountpoints> <filesystems> <filesystem dev="/dev/sda1"> <type>ext4</type> <uuid>e9327527-57a9-494e-9863-06be3476d974</uuid> </filesystem> <filesystem dev="/dev/sda2"> <type>swap</type> <uuid>17c2e163-468c-4a31-a797-02ff5307d954</uuid> </filesystem> <filesystem dev="/dev/sda3"> <type>ext4</type> <uuid>1202e66d-acca-43eb-8c0a-701a5bb87356</uuid> </filesystem> </filesystems> </operatingsystem> </operatingsystems> It works. 2. # virt-inspector -a ubuntukylin-20.04-basic.qcow2 --no-applications <?xml version="1.0"?> <operatingsystems> <operatingsystem> <root>/dev/vgubuntu-kylin/root</root> <name>linux</name> <arch>x86_64</arch> <distro>ubuntu</distro> <product_name>Ubuntu 20.04.2 LTS</product_name> <major_version>20</major_version> <minor_version>4</minor_version> <package_format>deb</package_format> <package_management>apt</package_management> <hostname>yoguo-Standard-PC-Q35-ICH9-2009</hostname> <osinfo>ubuntu20.04</osinfo> <mountpoints> <mountpoint dev="/dev/vgubuntu-kylin/root">/</mountpoint> <mountpoint dev="/dev/sda1">/boot/efi</mountpoint> </mountpoints> <filesystems> <filesystem dev="/dev/sda1"> <type>vfat</type> <uuid>43C0-7B5C</uuid> </filesystem> <filesystem dev="/dev/vgubuntu-kylin/root"> <type>ext4</type> <uuid>34b6b0ec-5a0a-495d-a1dc-f28b9f05350b</uuid> </filesystem> <filesystem dev="/dev/vgubuntu-kylin/swap_1"> <type>swap</type> <uuid>6ddfaf81-cf59-46b5-80e2-2a6e3c3c35d5</uuid> </filesystem> </filesystems> </operatingsystem> </operatingsystems> # virt-cat -a ubuntukylin-20.04-basic.qcow2 /etc/os-release NAME="Ubuntu Kylin" VERSION="20.04.2 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.2 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal The Ubuntu Kylin is almost the same as Ubuntu. 3. This is the bug I reported # virt-inspector -a Kylin-Desktop-V10.qcow2 --no-applications <?xml version="1.0"?> <operatingsystems> <operatingsystem> <root>/dev/sda3</root> <name>linux</name> <arch>x86_64</arch> <product_name>Kylin V10 SP1</product_name> <major_version>10</major_version> <minor_version>0</minor_version> <hostname>yoguo-Standard-PC</hostname> <mountpoints> <mountpoint dev="/dev/sda3">/</mountpoint> <mountpoint dev="/dev/sda1">/boot</mountpoint> </mountpoints> <filesystems> <filesystem dev="/dev/sda1"> <type>ext4</type> <uuid>b09bcfbf-480e-4338-9ff5-1304c591dbe3</uuid> </filesystem> <filesystem dev="/dev/sda2"> <type>swap</type> <uuid>3e8bcddc-5b2f-4459-a82e-6cdb41b24d74</uuid> </filesystem> <filesystem dev="/dev/sda3"> <type>ext4</type> <uuid>b664095d-dbf1-4476-b759-3266b67e74bc</uuid> </filesystem> </filesystems> </operatingsystem> </operatingsystems> Created attachment 1832394 [details] proposed upstream patches (look for the base commit IDs in the patches), included in the comment 13 builds Test the scratch builds from comment 13: Steps: 1. # rpm -q libguestfs libguestfs-1.46.0-1.bz1995391.1.el9.x86_64 # rpm -q guestfs-tools guestfs-tools-1.46.1-4.bz1995391.1.el9.1.x86_64 2. # virt-inspector -a Kylin-Desktop-V10.qcow2 <?xml version="1.0"?> <operatingsystems> <operatingsystem> <root>/dev/sda3</root> <name>linux</name> <arch>x86_64</arch> <distro>kylin</distro> <product_name>Kylin V10 SP1</product_name> <major_version>10</major_version> <minor_version>0</minor_version> <package_format>deb</package_format> <package_management>apt</package_management> <hostname>yoguo-Standard-PC</hostname> <osinfo>kylin10.0</osinfo> <mountpoints> <mountpoint dev="/dev/sda3">/</mountpoint> <mountpoint dev="/dev/sda1">/boot</mountpoint> </mountpoints> <filesystems> <filesystem dev="/dev/sda1"> <type>ext4</type> <uuid>b09bcfbf-480e-4338-9ff5-1304c591dbe3</uuid> </filesystem> <filesystem dev="/dev/sda2"> <type>swap</type> <uuid>3e8bcddc-5b2f-4459-a82e-6cdb41b24d74</uuid> </filesystem> <filesystem dev="/dev/sda3"> <type>ext4</type> <uuid>b664095d-dbf1-4476-b759-3266b67e74bc</uuid> </filesystem> </filesystems> <applications> <application> <name>accountsservice</name> <version>0.6.55</version> <release>0kylin11k3</release> <arch>amd64</arch> ... </application> </applications> </operatingsystem> </operatingsystems> The distro, package_format, package_management, osinfo, and applications are contained in the output. It works fine. Thanks, Laszlo. Thank you for checking! [PATCH] daemon: inspection: Add support for Kylin (RHBZ#1995391). Message-Id: <20211013163023.21786-1-lersek> https://listman.redhat.com/archives/libguestfs/2021-October/msg00058.html [guestfs-tools PATCH 0/2] refresh "virt-inspector.rng", recognize kylin Message-Id: <20211013163043.21837-1-lersek> https://listman.redhat.com/archives/libguestfs/2021-October/msg00059.html (In reply to Laszlo Ersek from comment #17) > [PATCH] daemon: inspection: Add support for Kylin (RHBZ#1995391). > Message-Id: <20211013163023.21786-1-lersek> > https://listman.redhat.com/archives/libguestfs/2021-October/msg00058.html Merged upstream as (libguestfs) commit 305b02e7e74a. > [guestfs-tools PATCH 0/2] refresh "virt-inspector.rng", recognize kylin > Message-Id: <20211013163043.21837-1-lersek> > https://listman.redhat.com/archives/libguestfs/2021-October/msg00059.html Merged upstream as (guestfs-tools) commit range a4930f5fad82..f041a5e24d8c. (Manual backporting looks unjustified; let's wait for the next rebase(s) with these.) Verified with packages:
libguestfs-1.46.0-5.el9.x86_64
guestfs-tools-1.46.1-5.el9.x86_64
Steps:
1. On rhel9 host
# virt-inspector -a Kylin-Desktop-V10.qcow2
<?xml version="1.0"?>
<operatingsystems>
<operatingsystem>
<root>/dev/sda3</root>
<name>linux</name>
<arch>x86_64</arch>
<distro>kylin</distro>
<product_name>Kylin V10 SP1</product_name>
<major_version>10</major_version>
<minor_version>0</minor_version>
<package_format>deb</package_format>
<package_management>apt</package_management>
<hostname>yoguo-Standard-PC</hostname>
<osinfo>kylin10.0</osinfo>
<mountpoints>
<mountpoint dev="/dev/sda3">/</mountpoint>
<mountpoint dev="/dev/sda1">/boot</mountpoint>
</mountpoints>
<filesystems>
<filesystem dev="/dev/sda1">
<type>ext4</type>
<uuid>b09bcfbf-480e-4338-9ff5-1304c591dbe3</uuid>
</filesystem>
<filesystem dev="/dev/sda2">
<type>swap</type>
<uuid>3e8bcddc-5b2f-4459-a82e-6cdb41b24d74</uuid>
</filesystem>
<filesystem dev="/dev/sda3">
<type>ext4</type>
<uuid>b664095d-dbf1-4476-b759-3266b67e74bc</uuid>
</filesystem>
</filesystems>
<applications>
<application>
<name>accountsservice</name>
<version>0.6.55</version>
<release>0kylin11k3</release>
<arch>amd64</arch>
...
</operatingsystems>
virt-inspector can be able to detect the distro, package_format, package_management and applications correctly.
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 |
Created attachment 1815401 [details] the whole log of virt-inspector Description of problem: virt-inspector fails to detect the distro, package_format, package_management and applications on Kylin-Desktop-V10 image. Version-Release number of selected component (if applicable): guestfs-tools-1.46.1-3.el9.1.x86_64 How reproducible: 100% Steps: 1. Create Kylin-Desktop-V10.qcow2 image with Kylin-Desktop-V10-SP1-RC5-Build01-hwe-210521-x86_64.iso 2. $ virt-inspector -a Kylin-Desktop-V10.qcow2 <?xml version="1.0"?> <operatingsystems> <operatingsystem> <root>/dev/sda3</root> <name>linux</name> <arch>x86_64</arch> <product_name>Kylin V10 SP1</product_name> <major_version>10</major_version> <minor_version>0</minor_version> <hostname>yoguo-Standard-PC</hostname> <mountpoints> <mountpoint dev="/dev/sda3">/</mountpoint> <mountpoint dev="/dev/sda1">/boot</mountpoint> </mountpoints> <filesystems> <filesystem dev="/dev/sda1"> <type>ext4</type> <uuid>b09bcfbf-480e-4338-9ff5-1304c591dbe3</uuid> </filesystem> <filesystem dev="/dev/sda2"> <type>swap</type> <uuid>3e8bcddc-5b2f-4459-a82e-6cdb41b24d74</uuid> </filesystem> <filesystem dev="/dev/sda3"> <type>ext4</type> <uuid>b664095d-dbf1-4476-b759-3266b67e74bc</uuid> </filesystem> </filesystems> <applications/> </operatingsystem> </operatingsystems> Actual results: As above Expected results: virt-inspector can be able to detect the distro, package_format, package_management and applications correctly. Additional info: