mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
lib/inspect-osinfo.c: Generate new osinfo shortname for SLES >= 15
libosinfo changes the naming scheme it uses for SUSE starting with
major version 15. Previously it used names like "sles12" (or
"sles12sp1"), "sled12" for Server and Desktop variants. In 15+ it
uses "sle15" as there are no variants any longer (instead the
installer asks you what variant you want to install). We're only
interested in the Server variant. Change the name that we return to
"sle15" or "sle15sp1".
See: b0fa386699
Fixes: https://issues.redhat.com/browse/RHEL-95791
Thanks: Ming Xie, Victor Toso
Related: https://issues.redhat.com/browse/RHEL-95540
This commit is contained in:
@@ -23,6 +23,9 @@ Inspecting guests that have duplicated root mountpoints now works.
|
||||
Inspection of SUSE Linux guests using btrfs snapshots now ignore
|
||||
snapshots that mirror content in the root filesystem.
|
||||
|
||||
Inspection of SUSE Linux >= 15 now returns the correct osinfo short
|
||||
name (eg. C<"sle15">) (thanks Ming Xie).
|
||||
|
||||
=head2 API
|
||||
|
||||
New C<command_out> and C<sh_out> APIs which allow you to capture
|
||||
@@ -155,6 +158,10 @@ Lost error when opening wrong format of image readonly [rhel-10.1]
|
||||
RFE: Investigate & do something useful with btrfsvol:...snapshots in
|
||||
SUSE Linux guests
|
||||
|
||||
=item L<https://issues.redhat.com/browse/RHEL-95791>
|
||||
|
||||
libguestfs generates the wrong osinfo for SLES 15 guests [rhel-9.6]
|
||||
|
||||
=item L<https://github.com/libguestfs/libguestfs/issues/155>
|
||||
|
||||
1.54.0: gdisk/test-expand-gpt.pl fails
|
||||
|
||||
@@ -62,10 +62,11 @@ guestfs_impl_inspect_get_osinfo (guestfs_h *g, const char *root)
|
||||
else if (STREQ (distro, "fedora") || STREQ (distro, "mageia"))
|
||||
return safe_asprintf (g, "%s%d", distro, major);
|
||||
else if (STREQ (distro, "sles")) {
|
||||
const char *base = major >= 15 ? "sle" : "sles";
|
||||
if (minor == 0)
|
||||
return safe_asprintf (g, "%s%d", distro, major);
|
||||
return safe_asprintf (g, "%s%d", base, major);
|
||||
else
|
||||
return safe_asprintf (g, "%s%dsp%d", distro, major, minor);
|
||||
return safe_asprintf (g, "%s%dsp%d", base, major, minor);
|
||||
}
|
||||
else if (STREQ (distro, "ubuntu"))
|
||||
return safe_asprintf (g, "%s%d.%02d", distro, major, minor);
|
||||
|
||||
Reference in New Issue
Block a user