17 Commits

Author SHA1 Message Date
Bella Zhang
72f99817c7 Add detection support for Circle Linux 2024-02-06 12:22:00 +00:00
Neil Hanlon
631962c0e8 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>
2021-12-10 09:09:47 +00:00
Pino Toscano
3720900438 inspect: get icon of OpenMandriva guests
Followup of commit a4ef6716b4.
2019-04-08 13:34:11 +02:00
Pino Toscano
c648052690 inspect: fix icon of RHEL
Use a better icon for RHEL guests, still provided by redhat-logos (or
equivalent in downstream distributions), and which fits a better
definition of logo for the distribution.

Thanks to Ray Strode for the hints.
2019-03-25 16:10:20 +01:00
Pino Toscano
c8a26adf1d inspect: get icon of Gentoo guests
The icon is installed by x11-themes/gentoo-artwork, which is not
installed by default (and most probably only on "desktop"
installations), although it's the best hit so far...
2019-02-07 19:00:13 +01:00
Pino Toscano
f41a75cea6 inspect: revamp icon extraction for *SUSE guests
Newer versions do not have the 24px distributor.png icon; OTOH they have
the 48px version, so look for that one before the 24px one.

Also, bump the size limit to 10K, as newer versions of the icon are
bigger than 3K.
2019-02-06 15:19:53 +01:00
Pino Toscano
6ff95acc72 inspect: factor out find_png helper function
Isolate the code for looking for a PNG file among a specified list from
the icon_ubuntu implementation, and switch that function to it.

This is just code refactoring, with no behaviour changes.
2019-02-06 15:15:08 +01:00
Pino Toscano
032b8d4c72 inspect: bump size limit for Mageia guests
Newer versions of the logo in Cauldron are almost 3K, so bump the limit
to 10K for now.
2019-02-06 15:05:51 +01:00
Richard W.M. Jones
aad2c9413f lib/inspect-icon.c: Return error if guestfs_int_cmd_run has internal error.
This function returns -1 if things like fork(2) fail, so it is right
to return an error here.  If the PBMTEXT command fails then that's a
NOT_FOUND case.
2017-10-06 13:53:14 +01:00
Richard W.M. Jones
7e974b509c lib: Use guestfs_int_make_temp_path in a few more places.
There were various places in the library where we open coded making
temporary filenames.  This uses the utility function instead.
2017-09-21 18:05:07 +01:00
Richard W.M. Jones
0734afd41f lib: Fix guestfs_int_download_to_tmp.
Since commit 65cfecb0f5,
‘guestfs_int_download_to_tmp’ was buggy because it did not deal with
the case where a guest had multiple roots.  It cached the downloaded
file under a single name which was not distinguished by which root we
were looking at.  As a result, if you inspected (eg.) the icon on such
a guest, then in some circumstances the same icon could be returned
for all roots (incorrectly).

This changes the function in a few ways:

 - Don't cache downloaded files.  It wasn't a useful feature of the
   function in most scenarios.  Instead a new name is generated for
   every call.

 - Use guestfs_int_make_temp_path.

 - Allow an extension to be specified.
2017-09-21 18:05:07 +01:00
Richard W.M. Jones
41df9aaf90 lib: Move guestfs_int_download_to_tmp and remove inspect.c.
Move the last remaining function ‘guestfs_int_download_to_tmp’ to
lib/inspect-icon.c (the main, but not only user of this function).
Then remove lib/inspect.c entirely.

This is not quite code motion because I updated the comment for the
function to reflect what it does in reality.
2017-09-21 18:05:07 +01:00
Richard W.M. Jones
3a00c4d179 Remove inspection from the C library and switch to daemon/OCaml implementation. 2017-09-16 22:27:16 +01:00
Richard W.M. Jones
53ab995cf1 lib: inspect: Remove ‘fs’ parameter from ‘guestfs_int_download_to_tmp’.
After we move inspection code to the daemon, the library will no
longer have access to ‘struct inspect_fs’, and so we won't be able to
prefix downloads with the "root filesystem number".

Just remove this prefix (it's internal only).  However it does mean
that this function can no longer cache downloaded files.
2017-09-16 22:27:16 +01:00
Pino Toscano
439b9189f0 inspect: get a more common size icon for ALT Linux guests (RHBZ#1433937)
A 64px icon does not exists everywhere, so just use a 48px one.

Updates commit bc54e0d605 and
commit 9928296c1c.

Thanks to: Xiang Hua Chen.
2017-03-24 11:04:14 +01:00
Pino Toscano
bc54e0d605 inspect: get a better icon for ALT Linux guests (RHBZ#1433937)
Use a 64px icon which is in the menu-icons-default package, hopefully
part of the default installation of any flavour.

Updates commit 9928296c1c.

Thanks to: Xiang Hua Chen.
2017-03-20 13:50:25 +01:00
Richard W.M. Jones
f161c9ea57 Rename src/ to lib/ 2017-01-26 15:05:46 +00:00