Pino Toscano
2015-Sep-09 14:01 UTC
Re: [Libguestfs] [PATCH] inspect: try to use /etc/os-release on Linux guests
On Wednesday 09 September 2015 15:54:10 Olaf Hering wrote:> Just poked around in my =libguestfs folder... > > On Wed, Sep 09, Pino Toscano wrote: > > > + if (STRPREFIX (line, "ID=")) { > > This is not handled: > > NAME="SLES" > VERSION="12" > VERSION_ID="12" > PRETTY_NAME="SUSE Linux Enterprise Server 12" > ID="sles" > ANSI_COLOR="0;32" > CPE_NAME="cpe:/o:suse:sles:12"That's because I don't have SLES disk images around :) Can you please attach: - the content of /etc/SuSE-release - the XML outout of `virt-inspector -a $img` so I can check whether adding just a two-line check on the ID will not give less detailed information than what we get now. Thanks, -- Pino Toscano
Olaf Hering
2015-Sep-09 14:06 UTC
Re: [Libguestfs] [PATCH] inspect: try to use /etc/os-release on Linux guests
On Wed, Sep 09, Pino Toscano wrote:> - the content of /etc/SuSE-releaseSUSE Linux Enterprise Server 12 (x86_64) VERSION = 12 PATCHLEVEL = 0 # This file is deprecated and will be removed in a future service pack or release. # Please check /etc/os-release for details about this release.> - the XML outout of `virt-inspector -a $img`<operatingsystems> <operatingsystem> <root>/dev/sda3</root> <name>linux</name> <arch>x86_64</arch> <distro>sles</distro> <product_name>SUSE Linux Enterprise Server 12 (x86_64)</product_name> <major_version>12</major_version> <minor_version>0</minor_version> <package_format>rpm</package_format> <package_management>zypper</package_management> <hostname>linux-luwo.site</hostname> <format>installed</format> <mountpoints> <mountpoint dev="/dev/sda3">/</mountpoint> <mountpoint dev="btrfsvol:/dev/sda3/@/opt">/opt</mountpoint> <mountpoint dev="btrfsvol:/dev/sda3/@/srv">/srv</mountpoint> <mountpoint dev="btrfsvol:/dev/sda3/@/tmp">/tmp</mountpoint> <mountpoint dev="btrfsvol:/dev/sda3/@/home">/home</mountpoint> <mountpoint dev="btrfsvol:/dev/sda3/@/var/log">/var/log</mountpoint> <mountpoint dev="btrfsvol:/dev/sda3/@/var/opt">/var/opt</mountpoint> <mountpoint dev="btrfsvol:/dev/sda3/@/var/tmp">/var/tmp</mountpoint> <mountpoint dev="/dev/sda1">/boot/efi</mountpoint> <mountpoint dev="btrfsvol:/dev/sda3/@/usr/local">/usr/local</mountpoint> <mountpoint dev="btrfsvol:/dev/sda3/@/var/crash">/var/crash</mountpoint> <mountpoint dev="btrfsvol:/dev/sda3/@/var/spool">/var/spool</mountpoint> <mountpoint dev="btrfsvol:/dev/sda3/@/var/lib/named">/var/lib/named</mountpoint> <mountpoint dev="btrfsvol:/dev/sda3/@/var/lib/pgsql">/var/lib/pgsql</mountpoint> <mountpoint dev="btrfsvol:/dev/sda3/@/var/lib/mailman">/var/lib/mailman</mountpoint> <mountpoint dev="btrfsvol:/dev/sda3/@/boot/grub2/i386-pc">/boot/grub2/i386-pc</mountpoint> <mountpoint dev="btrfsvol:/dev/sda3/@/boot/grub2/x86_64-efi">/boot/grub2/x86_64-efi</mountpoint> </mountpoints> ... Olaf
Pino Toscano
2015-Sep-09 14:12 UTC
Re: [Libguestfs] [PATCH] inspect: try to use /etc/os-release on Linux guests
On Wednesday 09 September 2015 16:06:43 Olaf Hering wrote:> On Wed, Sep 09, Pino Toscano wrote: > > > - the content of /etc/SuSE-release > > SUSE Linux Enterprise Server 12 (x86_64) > VERSION = 12 > PATCHLEVEL = 0 > # This file is deprecated and will be removed in a future service pack or release. > # Please check /etc/os-release for details about this release. > > > - the XML outout of `virt-inspector -a $img` > > <operatingsystems> > <operatingsystem> > <root>/dev/sda3</root> > <name>linux</name> > <arch>x86_64</arch> > <distro>sles</distro> > <product_name>SUSE Linux Enterprise Server 12 (x86_64)</product_name> > <major_version>12</major_version> > <minor_version>0</minor_version> > [...]Sounds like I can add + else if (VALUE_IS ("sles")) + distro = OS_DISTRO_SLES; to my patch then, thanks! Just note that, in case it was not noticeable from the patch, that if we cannot get all the information from os-release (like on SLES without the check for ID=sles), the current detection methods are tried. This is not "os-release or nothing". -- Pino Toscano
Reasonably Related Threads
- [PATCH] inspection: Deprecate APIs and remove support for inspecting installer CDs.
- [PATCH 1/3] inspection: Add func for merging fs inspections
- [PATCH 1/3] inspection: Add func for merging fs inspections
- [PATCH 2/2] inspect: switch to version struct for os major/minor version
- Re: [PATCH] inspect: try to use /etc/os-release on Linux guests