Hello community, here is the log from the commit of package supermin for openSUSE:Factory checked in at 2019-11-21 12:58:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/supermin (Old) and /work/SRC/openSUSE:Factory/.supermin.new.26869 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "supermin" Thu Nov 21 12:58:53 2019 rev:7 rq:749898 version:5.1.20 Changes: -------- --- /work/SRC/openSUSE:Factory/supermin/supermin.changes 2019-08-05 10:42:04.719294024 +0200 +++ /work/SRC/openSUSE:Factory/.supermin.new.26869/supermin.changes 2019-11-21 12:58:58.746522114 +0100 @@ -1,0 +2,6 @@ +Fri Nov 1 12:34:56 UTC 2019 - [email protected] + +- Update to version 5.1.20, via _service file + No changelog provided by upstream + +------------------------------------------------------------------- Old: ---- supermin-5.1.18.tar.xz New: ---- _service supermin-5.1.20.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ supermin.spec ++++++ --- /var/tmp/diff_new_pack.SnnbNA/_old 2019-11-21 12:58:59.466521892 +0100 +++ /var/tmp/diff_new_pack.SnnbNA/_new 2019-11-21 12:58:59.466521892 +0100 @@ -17,9 +17,9 @@ Name: supermin -Version: 5.1.18 +Version: 5.1.20 Release: 0 -%{ocaml_preserve_bytecode} +%{?ocaml_preserve_bytecode} Url: http://libguestfs.org/ Summary: Bootstrapping tool for creating supermin appliances License: GPL-3.0-or-later @@ -30,7 +30,6 @@ Requires: tar Requires: xmlstarlet Requires: zypper -BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0: supermin-%{version}.tar.xz # Pending upstream review Patch0: suse_release.patch @@ -80,7 +79,6 @@ find $RPM_BUILD_ROOT -ls %files -%defattr (-,root,root) %doc README %doc TODO /usr/bin/* ++++++ _service ++++++ <services> <service name="tar_scm" mode="disabled"> <param name="url">https://github.com/libguestfs/supermin.git</param> <param name="scm">git</param> <param name="versionformat">5.1.20</param> <param name="revision">v5.1.20</param> <param name="filename">supermin</param> </service> <service name="recompress" mode="disabled"> <param name="file">*.tar</param> <param name="compression">xz</param> </service> <service name="set_version" mode="disabled"/> </services> ++++++ supermin-5.1.18.tar.xz -> supermin-5.1.20.tar.xz ++++++ ++++ 3881 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/.gitignore new/supermin-5.1.20/.gitignore --- old/supermin-5.1.18/.gitignore 2017-03-01 13:13:45.000000000 +0100 +++ new/supermin-5.1.20/.gitignore 2017-08-24 14:28:08.000000000 +0200 @@ -40,7 +40,7 @@ /snippet/ /src/.depend /src/config.ml -/src/format-ext2-init-bin.S +/src/format-ext2-init-bin.h /src/supermin /src/supermin.1 /src/supermin-link.sh diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/README new/supermin-5.1.20/README --- old/supermin-5.1.18/README 2017-03-01 12:34:37.000000000 +0100 +++ new/supermin-5.1.20/README 2018-11-19 23:24:55.000000000 +0100 @@ -107,7 +107,6 @@ If you're cloning this from git the first time, do: - ./bootstrap ./autogen.sh For normal builds, and building from the tarball: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/autogen.sh new/supermin-5.1.20/autogen.sh --- old/supermin-5.1.18/autogen.sh 2014-03-26 01:01:12.000000000 +0100 +++ new/supermin-5.1.20/autogen.sh 2018-11-19 23:24:55.000000000 +0100 @@ -2,6 +2,11 @@ set -e +# If the submodule is not initialized run bootstrap +if git submodule status .gnulib | grep -q '^-'; then + ./bootstrap +fi + # If no arguments were specified and configure has run before, use the previous # arguments if test $# -eq 0 && test -x ./config.status; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/compile new/supermin-5.1.20/compile --- old/supermin-5.1.18/compile 2016-02-17 15:57:44.000000000 +0100 +++ new/supermin-5.1.20/compile 2014-03-12 20:05:34.000000000 +0100 @@ -3,7 +3,7 @@ scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # Written by Tom Tromey <[email protected]>. # # This program is free software; you can redistribute it and/or modify diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/configure.ac new/supermin-5.1.20/configure.ac --- old/supermin-5.1.18/configure.ac 2017-07-13 11:32:06.000000000 +0200 +++ new/supermin-5.1.20/configure.ac 2019-01-17 13:26:35.000000000 +0100 @@ -1,5 +1,5 @@ dnl supermin configure.ac -dnl (C) Copyright 2009-2016 Red Hat Inc. +dnl (C) Copyright 2009-2019 Red Hat Inc. dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ dnl dnl Written by Richard W.M. Jones <[email protected]> -AC_INIT([supermin],[5.1.18]) +AC_INIT([supermin],[5.1.20]) AM_INIT_AUTOMAKE(foreign) AC_REQUIRE_AUX_FILE([supermin-test-driver]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/missing new/supermin-5.1.20/missing --- old/supermin-5.1.18/missing 2016-02-17 15:57:44.000000000 +0100 +++ new/supermin-5.1.20/missing 2014-03-12 20:05:34.000000000 +0100 @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2013-10-28.13; # UTC +scriptversion=2012-06-26.16; # UTC -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <[email protected]>, 1996. # This program is free software; you can redistribute it and/or modify @@ -160,7 +160,7 @@ ;; autom4te*) echo "You might have modified some maintainer files that require" - echo "the 'autom4te' program to be rebuilt." + echo "the 'automa4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/src/.depend new/supermin-5.1.20/src/.depend --- old/supermin-5.1.18/src/.depend 2017-07-13 11:33:18.000000000 +0200 +++ new/supermin-5.1.20/src/.depend 2019-01-17 13:28:36.000000000 +0100 @@ -1,7 +1,5 @@ ./config.cmo : -config.cmo : ./config.cmx : -config.cmx : ./ext2fs.cmi : ./ext2fs.cmo : ./ext2fs.cmi ./ext2fs.cmx : ./ext2fs.cmi @@ -60,3 +58,5 @@ ./utils.cmi : ./utils.cmo : ./utils.cmi ./utils.cmx : ./utils.cmi +config.cmo : +config.cmx : diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/src/Makefile.am new/supermin-5.1.20/src/Makefile.am --- old/supermin-5.1.18/src/Makefile.am 2017-03-01 12:34:37.000000000 +0100 +++ new/supermin-5.1.20/src/Makefile.am 2017-08-24 14:28:08.000000000 +0200 @@ -17,7 +17,7 @@ EXTRA_DIST = \ .depend \ - bin2s.pl \ + bin2c.pl \ config.ml.in \ supermin.1 \ supermin.pod \ @@ -111,11 +111,13 @@ bin_PROGRAMS = supermin supermin_SOURCES = $(SOURCES_C) +nodist_supermin_SOURCES = format-ext2-init-bin.h supermin_CFLAGS = \ -I$(shell $(OCAMLC) -where) \ $(EXT2FS_CFLAGS) $(COM_ERR_CFLAGS) $(LIBRPM_CFLAGS) \ -Wall $(WERROR_CFLAGS) \ -I$(top_srcdir)/lib -I../lib +format-ext2-init-c.$(OBJEXT): format-ext2-init-bin.h BOBJECTS = $(SOURCES_ML:.ml=.cmo) XOBJECTS = $(SOURCES_ML:.ml=.cmx) @@ -132,9 +134,9 @@ BEST = opt endif -supermin_DEPENDENCIES = $(OBJECTS) format-ext2-init-bin.o +supermin_DEPENDENCIES = $(OBJECTS) -supermin_LDADD = format-ext2-init-bin.o ../lib/libgnu.a +supermin_LDADD = ../lib/libgnu.a supermin_LINK = \ ./supermin-link.sh \ @@ -148,17 +150,15 @@ .ml.cmx: $(OCAMLFIND) ocamlopt $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@ -CLEANFILES += format-ext2-init-bin.S +CLEANFILES += format-ext2-init-bin.h +BUILT_SOURCES = format-ext2-init-bin.h -format-ext2-init-bin.o: format-ext2-init-bin.S - $(CC) -o $@ -c $< - -format-ext2-init-bin.S: ../init/init $(srcdir)/bin2s.pl +format-ext2-init-bin.h: ../init/init $(srcdir)/bin2c.pl strip --strip-all $< ls -l $< @file $< | grep -isq static || \ (echo "*** error: init is not statically linked"; exit 1) - $(srcdir)/bin2s.pl $< $@ + $(srcdir)/bin2c.pl $< $@ depend: .depend diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/src/bin2c.pl new/supermin-5.1.20/src/bin2c.pl --- old/supermin-5.1.18/src/bin2c.pl 1970-01-01 01:00:00.000000000 +0100 +++ new/supermin-5.1.20/src/bin2c.pl 2017-08-24 14:28:08.000000000 +0200 @@ -0,0 +1,57 @@ +#!/usr/bin/perl +# (C) Copyright 2009-2016 Hilko Bengen. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +# This script creates a C snippet embedding an arbitrary file +# +# The output provides two variables: +# static const char _binary_$name[]; +# static const size_t _binary_$name_len; + +use strict; +use warnings; + +die "usage: $0 <in> <out>\n" if @ARGV != 2; + +my ($infile, $outfile) = @ARGV; +my ($buf, $i, $sz); +open my $ifh, '<', $infile or die "open $infile: $!"; +open my $ofh, '>', $outfile or die "open $outfile: $!"; + +my $infile_basename = $infile; +$infile_basename =~ s{.*/}{}; + +print $ofh <<"EOF"; +/* This file has been automatically generated from $infile by $0 */ + +static const char _binary_${infile_basename}[] = { +EOF + +$sz = 0; +while ( $i = read $ifh, $buf, 12 ) { + print $ofh " " + . join( ", ", map { sprintf '0x%02x', ord $_ } split //, $buf ) . ",\n"; + $sz += $i; +} +die "read $infile (at offset $sz): $!\n" if not defined $i; +close $ifh; + +print $ofh <<"EOF"; +}; +static const size_t _binary_${infile_basename}_len = ${sz}; +EOF + +close $ofh; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/src/bin2s.pl new/supermin-5.1.20/src/bin2s.pl --- old/supermin-5.1.18/src/bin2s.pl 2016-03-18 12:54:46.000000000 +0100 +++ new/supermin-5.1.20/src/bin2s.pl 1970-01-01 01:00:00.000000000 +0100 @@ -1,63 +0,0 @@ -#!/usr/bin/perl -# (C) Copyright 2009-2016 Hilko Bengen. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -# This script creates a source file for the GNU assembler which shuold -# result in an object file equivalent to that of -# -# objcopy -I binary -B $(DEFAULT_ARCH) -O $(ELF_DEFAULT_ARCH) <in> <out> - -use strict; -use warnings; - -die "usage: $0 <in> <out>\n" if @ARGV != 2; - -my ($infile, $outfile) = @ARGV; -my ($buf, $i, $sz); -open my $ifh, '<', $infile or die "open $infile: $!"; -open my $ofh, '>', $outfile or die "open $outfile: $!"; - -my $infile_basename = $infile; -$infile_basename =~ s{.*/}{}; - -print $ofh <<"EOF"; -/* This file has been automatically generated from $infile by $0 */ - -/* Mark stack as non-executable for GNU tools. */ -\t.section .note.GNU-stack,"",%progbits -\t.previous - -\t.globl\t_binary_${infile_basename}_start -\t.globl\t_binary_${infile_basename}_end - -\t.section\t.rodata -_binary_${infile_basename}_start: -EOF - -$sz = 0; -while ( $i = read $ifh, $buf, 12 ) { - print $ofh "\t.byte\t" - . join( ',', map { sprintf '0x%02x', ord $_ } split //, $buf ) . "\n"; - $sz += $i; -} -die "read $infile (at offset $sz): $!\n" if not defined $i; -close $ifh; - -print $ofh <<"EOF"; -_binary_${infile_basename}_end: -EOF - -close $ofh; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/src/config.ml new/supermin-5.1.20/src/config.ml --- old/supermin-5.1.18/src/config.ml 2017-07-13 11:33:07.000000000 +0200 +++ new/supermin-5.1.20/src/config.ml 2019-01-17 13:28:36.000000000 +0100 @@ -18,16 +18,16 @@ *) let package_name = "supermin" -let package_version = "5.1.18" +let package_version = "5.1.20" let host_cpu = "x86_64" let apt_get = "no" let cpio = "/usr/bin/cpio" let dnf = "/usr/bin/dnf" -let dpkg = "no" -let dpkg_deb = "no" -let dpkg_query = "no" -let dpkg_divert = "no" +let dpkg = "/usr/bin/dpkg" +let dpkg_deb = "/usr/bin/dpkg-deb" +let dpkg_query = "/usr/bin/dpkg-query" +let dpkg_divert = "/usr/bin/dpkg-divert" let fakeroot = "/usr/bin/fakeroot" let makepkg = "no" let pacman = "no" @@ -36,7 +36,7 @@ let rpm = "/usr/bin/rpm" let rpm2cpio = "/usr/bin/rpm2cpio" let urpmi = "no" -let yumdownloader = "/usr/bin/yumdownloader" +let yumdownloader = "no" let xzcat = "/usr/bin/xzcat" let zcat = "/usr/bin/zcat" let zypper = "no" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/src/format-ext2-init-c.c new/supermin-5.1.20/src/format-ext2-init-c.c --- old/supermin-5.1.18/src/format-ext2-init-c.c 2017-03-01 12:34:37.000000000 +0100 +++ new/supermin-5.1.20/src/format-ext2-init-c.c 2017-08-24 14:28:08.000000000 +0200 @@ -27,19 +27,18 @@ #include <caml/memory.h> /* The init binary. - * See: bin2s.pl, init.c. + * See: bin2c.pl, init.c. */ -extern uint8_t _binary_init_start, _binary_init_end; +#include <format-ext2-init-bin.h> value supermin_binary_init (value unitv) { CAMLparam1 (unitv); CAMLlocal1 (sv); - size_t n = &_binary_init_end - &_binary_init_start; - sv = caml_alloc_string (n); - memcpy (String_val (sv), &_binary_init_start, n); + sv = caml_alloc_string (_binary_init_len); + memcpy (String_val (sv), _binary_init, _binary_init_len); CAMLreturn (sv); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/src/format_ext2_kernel.ml new/supermin-5.1.20/src/format_ext2_kernel.ml --- old/supermin-5.1.18/src/format_ext2_kernel.ml 2017-03-01 12:34:37.000000000 +0100 +++ new/supermin-5.1.20/src/format_ext2_kernel.ml 2018-08-31 09:53:19.000000000 +0200 @@ -24,76 +24,95 @@ open Fnmatch open Glob -let patt_of_cpu host_cpu = - let models = - match host_cpu with - | "mips" | "mips64" -> [host_cpu; "*-malta"] - | "ppc" | "powerpc" | "powerpc64" -> ["ppc"; "powerpc"; "powerpc64"] - | "sparc" | "sparc64" -> ["sparc"; "sparc64"] - | "amd64" | "x86_64" -> ["amd64"; "x86_64"] - | "parisc" | "parisc64" -> ["hppa"; "hppa64"] - | "ppc64el" -> ["powerpc64le"] - | _ when host_cpu.[0] = 'i' && host_cpu.[2] = '8' && host_cpu.[3] = '6' -> ["?86"] - | _ when String.length host_cpu >= 5 && String.sub host_cpu 0 5 = "armv7" -> ["armmp"] - | _ -> [host_cpu] - in - List.map (fun model -> sprintf "vmlinu?-*-%s" model) models - let rec build_kernel debug host_cpu copy_kernel kernel = - (* Locate the kernel. *) + (* Locate the kernel. + * SUPERMIN_* environment variables override everything. If those + * are not present then we look in /lib/modules and /boot. + *) let kernel_file, kernel_name, kernel_version, modpath = - try - let kernel_env = getenv "SUPERMIN_KERNEL" in - if debug >= 1 then - printf "supermin: kernel: SUPERMIN_KERNEL environment variable %s\n%!" - kernel_env; - let kernel_version = - try - let v = getenv "SUPERMIN_KERNEL_VERSION" in + if debug >= 1 then + printf "supermin: kernel: looking for kernel using environment variables ...\n%!"; + match find_kernel_from_env_vars debug with + | Some k -> k + | None -> + if debug >= 1 then + printf "supermin: kernel: looking for kernels in /lib/modules/*/vmlinuz ...\n%!"; + match find_kernel_from_lib_modules debug with + | Some k -> k + | None -> if debug >= 1 then - printf "supermin: kernel: SUPERMIN_KERNEL_VERSION environment variable %s\n%!" v; - v - with Not_found -> get_kernel_version_from_file kernel_env in - if debug >= 1 then - printf "supermin: kernel: SUPERMIN_KERNEL version %s\n%!" - kernel_version; - let kernel_name = Filename.basename kernel_env in - let modpath = find_modpath debug kernel_version in - kernel_env, kernel_name, kernel_version, modpath - with Not_found -> - let kernels = - let files = glob "/lib/modules/*/vmlinuz" [GLOB_NOSORT; GLOB_NOESCAPE] in - let files = Array.to_list files in - let kernels = - List.map ( - fun f -> - let modpath = Filename.dirname f in - f, Filename.basename f, Filename.basename modpath, modpath - ) files in - List.sort ( - fun (_, _, a, _) (_, _, b, _) -> compare_version b a - ) kernels in - - if kernels <> [] then ( - let kernel = List.hd kernels in - if debug >= 1 then ( - let kernel_file, _, _, _ = kernel in - printf "supermin: kernel: picked vmlinuz %s\n%!" kernel_file; - ); - kernel - ) else - find_kernel debug host_cpu kernel in + printf "supermin: kernel: looking for kernels in /boot ...\n%!"; + match find_kernel_from_boot debug host_cpu with + | Some k -> k + | None -> + error_no_kernels host_cpu in if debug >= 1 then ( + printf "supermin: kernel: picked vmlinuz %s\n%!" kernel_file; printf "supermin: kernel: kernel_version %s\n" kernel_version; - printf "supermin: kernel: modules %s\n%!" modpath; + printf "supermin: kernel: modpath %s\n%!" modpath; ); copy_or_symlink_file copy_kernel kernel_file kernel; (kernel_version, modpath) -and find_kernel debug host_cpu kernel = +and error_no_kernels host_cpu = + error "\ +failed to find a suitable kernel (host_cpu=%s). + +I looked for kernels in /boot and modules in /lib/modules. + +If this is a Xen guest, and you only have Xen domU kernels +installed, try installing a fullvirt kernel (only for +supermin use, you shouldn't boot the Xen guest with it)." + host_cpu + +and find_kernel_from_env_vars debug = + try + let kernel_env = getenv "SUPERMIN_KERNEL" in + if debug >= 1 then + printf "supermin: kernel: SUPERMIN_KERNEL=%s\n%!" kernel_env; + let kernel_version = + try + let v = getenv "SUPERMIN_KERNEL_VERSION" in + if debug >= 1 then + printf "supermin: kernel: SUPERMIN_KERNEL_VERSION=%s\n%!" v; + v + with Not_found -> + match get_kernel_version debug kernel_env with + | Some v -> v + | None -> raise Not_found in + let kernel_name = Filename.basename kernel_env in + let modpath = find_modpath debug kernel_version in + Some (kernel_env, kernel_name, kernel_version, modpath) + with Not_found -> None + +and find_kernel_from_lib_modules debug = + let kernels = + let files = glob "/lib/modules/*/vmlinuz" [GLOB_NOSORT; GLOB_NOESCAPE] in + let files = Array.to_list files in + let kernels = + filter_map ( + fun kernel_file -> + let size = try (stat kernel_file).st_size with Unix_error _ -> 0 in + if size < 10000 then None + else ( + let kernel_name = Filename.basename kernel_file in + let modpath = Filename.dirname kernel_file in + let kernel_version = Filename.basename modpath in + Some (kernel_file, kernel_name, kernel_version, modpath) + ) + ) files in + List.sort ( + fun (_, _, a, _) (_, _, b, _) -> compare_version b a + ) kernels in + + match kernels with + | kernel :: _ -> Some kernel + | [] -> None + +and find_kernel_from_boot debug host_cpu = let is_arm = String.length host_cpu >= 3 && host_cpu.[0] = 'a' && host_cpu.[1] = 'r' && host_cpu.[2] = 'm' in @@ -111,19 +130,22 @@ (* In original: ls -1dvr /boot/vmlinuz-* 2>/dev/null | grep -v xen *) kernel_filter ["vmlinu?-*"] is_arm all_files in - if files = [] then no_kernels host_cpu; - let files = List.sort (fun a b -> compare_version b a) files in - let kernel_name = List.hd files in - let kernel_version = get_kernel_version kernel_name in - - if debug >= 1 then - printf "supermin: kernel: picked kernel %s\n%!" kernel_name; - - (* Get the kernel modules. *) - let modpath = find_modpath debug kernel_version in - - ("/boot" // kernel_name), kernel_name, kernel_version, modpath + let kernels = + filter_map ( + fun kernel_name -> + let kernel_file = "/boot" // kernel_name in + match get_kernel_version debug kernel_file with + | None -> None + | Some kernel_version -> + let modpath = find_modpath debug kernel_version in + if not (has_modpath modpath) then None + else Some (kernel_file, kernel_name, kernel_version, modpath) + ) files in + + match kernels with + | kernel :: _ -> Some kernel + | [] -> None and kernel_filter patterns is_arm all_files = let files = @@ -141,25 +163,28 @@ find filename "tegra" = -1 ) files ) in - List.filter (fun filename -> has_modpath filename) files - -and no_kernels host_cpu = - error "\ -failed to find a suitable kernel (host_cpu=%s). + files -I looked for kernels in /boot and modules in /lib/modules. - -If this is a Xen guest, and you only have Xen domU kernels -installed, try installing a fullvirt kernel (only for -supermin use, you shouldn't boot the Xen guest with it)." - host_cpu +and patt_of_cpu host_cpu = + let models = + match host_cpu with + | "mips" | "mips64" -> [host_cpu; "*-malta"] + | "ppc" | "powerpc" | "powerpc64" -> ["ppc"; "powerpc"; "powerpc64"] + | "sparc" | "sparc64" -> ["sparc"; "sparc64"] + | "amd64" | "x86_64" -> ["amd64"; "x86_64"] + | "parisc" | "parisc64" -> ["hppa"; "hppa64"] + | "ppc64el" -> ["powerpc64le"] + | _ when host_cpu.[0] = 'i' && host_cpu.[2] = '8' && host_cpu.[3] = '6' -> ["?86"] + | _ when String.length host_cpu >= 5 && String.sub host_cpu 0 5 = "armv7" -> ["armmp"] + | _ -> [host_cpu] + in + List.map (fun model -> sprintf "vmlinu?-*-%s" model) models and find_modpath debug kernel_version = try let modpath = getenv "SUPERMIN_MODULES" in if debug >= 1 then - printf "supermin: kernel: SUPERMIN_MODULES environment variable = %s\n%!" - modpath; + printf "supermin: kernel: SUPERMIN_MODULES=%s\n%!" modpath; modpath with Not_found -> let modpath = "/lib/modules/" ^ kernel_version in @@ -167,31 +192,47 @@ printf "supermin: kernel: picked modules path %s\n%!" modpath; modpath -and has_modpath kernel_name = - try - let kv = get_kernel_version kernel_name in - modules_dep_exists kv - with - | Not_found -> false - -and get_kernel_version kernel_name = - if (string_prefix "vmlinuz-" kernel_name) || - (string_prefix "vmlinux-" kernel_name) then ( - let kv = String.sub kernel_name 8 (String.length kernel_name - 8) in - if modules_dep_exists kv then kv - else get_kernel_version_from_name kernel_name - ) else get_kernel_version_from_name kernel_name - -and modules_dep_exists kv = - try (lstat ("/lib/modules/" ^ kv ^ "/modules.dep")).st_kind = S_REG +and has_modpath modpath = + try (stat (modpath // "modules.dep")).st_kind = S_REG with Unix_error _ -> false -and get_kernel_version_from_name kernel_name = - get_kernel_version_from_file ("/boot" // kernel_name) +(* Extract the kernel version from a Linux kernel file. + * + * This first sees if we can get the information from the file + * content (see below) and if that fails tries to parse the + * filename. + *) +and get_kernel_version debug kernel_file = + if debug >= 1 then + printf "supermin: kernel: kernel version of %s%!" kernel_file; + match get_kernel_version_from_file_content kernel_file with + | Some version -> + if debug >= 1 then printf " = %s (from content)\n%!" version; + Some version + | None -> + (* Try to work it out from the filename instead. *) + let basename = Filename.basename kernel_file in + if string_prefix "vmlinuz-" basename || string_prefix "vmlinux-" basename + then ( + let version = String.sub basename 8 (String.length basename - 8) in + (* Does the version look reasonable? *) + let modpath = "/lib/modules" // version in + if has_modpath modpath then ( + if debug >= 1 then printf " = %s (from filename)\n%!" version; + Some version + ) else ( + if debug >= 1 then printf " = error, no modpath\n%!"; + None + ) + ) + else ( + if debug >= 1 then printf " = error, cannot parse filename\n%!"; + None + ) (* Extract the kernel version from a Linux kernel file. * - * Returns a string containing the version or [Not_found] if the + * Returns a string containing the version or [None] if the * file can't be read, is not a Linux kernel, or the version can't * be found. * @@ -204,7 +245,7 @@ * * Bugs: probably limited to x86 kernels. *) -and get_kernel_version_from_file file = +and get_kernel_version_from_file_content file = try let chan = open_in file in let buf = read_string chan 514 4 in @@ -234,10 +275,13 @@ ) else raise Not_found in - loop 0 + let version = loop 0 in + Some version with - | Sys_error _ -> raise Not_found - | Invalid_argument _ -> raise Not_found + | Not_found + | End_of_file + | Sys_error _ + | Invalid_argument _ -> None (* Read an unsigned little endian short at a specified offset in a file. *) and read_leshort chan offset = @@ -246,9 +290,9 @@ and read_string chan offset len = seek_in chan offset; - let buf = String.create len in + let buf = Bytes.create len in really_input chan buf 0 len; - buf + Bytes.to_string buf and copy_or_symlink_file copy_kernel src dest = if not copy_kernel then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/src/mode_build.ml new/supermin-5.1.20/src/mode_build.ml --- old/supermin-5.1.18/src/mode_build.ml 2017-03-01 12:34:37.000000000 +0100 +++ new/supermin-5.1.20/src/mode_build.ml 2019-01-17 13:26:00.000000000 +0100 @@ -46,6 +46,7 @@ | Packages | Hostfiles | Excludefiles +| Empty let rec string_of_file_type = function | GZip c -> sprintf "gzip %s" (string_of_file_content c) @@ -56,6 +57,7 @@ | Packages -> "packages" | Hostfiles -> "hostfiles" | Excludefiles -> "excludefiles" + | Empty -> "empty" let rec build debug (copy_kernel, format, host_cpu, @@ -250,6 +252,8 @@ (* Depending on the file type, read or unpack the file. *) let appliance = match file_type with + | Uncompressed Empty | GZip Empty | XZ Empty -> + appliance | Uncompressed ((Packages|Hostfiles|Excludefiles) as t) -> let chan = open_in file in let lines = input_all_lines chan in @@ -294,14 +298,15 @@ String.sub path 1 (n-1) ) lines in { appliance with excludefiles = appliance.excludefiles @ lines } - | Base_image -> assert false + | Base_image | Empty -> assert false (* Determine the [file_type] of [file], or exit with an error. *) and get_file_type file = let chan = open_in file in - let buf = String.create 512 in - let len = input chan buf 0 (String.length buf) in + let buf = Bytes.create 512 in + let len = input chan buf 0 (Bytes.length buf) in close_in chan; + let buf = Bytes.to_string buf in if len >= 3 && buf.[0] = '\x1f' && buf.[1] = '\x8b' && buf.[2] = '\x08' then (* gzip-compressed file *) @@ -330,13 +335,15 @@ else if len >= 2 && buf.[0] = '/' then Hostfiles else if len >= 2 && buf.[0] = '-' then Excludefiles else if len >= 1 && isalnum buf.[0] then Packages + else if len = 0 then Empty else error "%s: unknown file type in supermin directory" file and get_compressed_file_content zcat file = let cmd = sprintf "%s %s" zcat (quote file) in let chan_out, chan_in, chan_err = open_process_full cmd [||] in - let buf = String.create 512 in - let len = input chan_out buf 0 (String.length buf) in + let buf = Bytes.create 512 in + let len = input chan_out buf 0 (Bytes.length buf) in + let buf = Bytes.to_string buf in (* We're expecting the subprocess to fail because we close the pipe * early, so: *) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/src/mode_prepare.ml new/supermin-5.1.20/src/mode_prepare.ml --- old/supermin-5.1.18/src/mode_prepare.ml 2017-03-01 12:34:37.000000000 +0100 +++ new/supermin-5.1.20/src/mode_prepare.ml 2019-01-17 13:26:00.000000000 +0100 @@ -128,36 +128,50 @@ * be missing either from the package or from the filesystem (the * latter case with --use-installed). *) - let files_from = - let config_files = - List.map ( - fun (_, files) -> - filter_map ( - function - | { ft_config = true; ft_path = path } -> Some path - | { ft_config = false } -> None - ) files - ) packages in - let config_files = List.flatten config_files in + let config_files = + List.map ( + fun (_, files) -> + filter_map ( + function + | { ft_config = true; ft_path = path } -> Some path + | { ft_config = false } -> None + ) files + ) packages in + let config_files = List.flatten config_files in - let config_files = List.filter ( - fun path -> - try close_in (open_in (dir // path)); true - with Sys_error _ -> false - ) config_files in + let config_files = List.filter ( + fun path -> + try close_in (open_in (dir // path)); true + with Sys_error _ -> false + ) config_files in - (* Put the list of config files into a file, for tar to read. *) - let files_from = tmpdir // "files-from.txt" in - let chan = open_out files_from in - List.iter (fprintf chan ".%s\n") config_files; (* "./filename" *) - close_out chan; + if debug >= 1 then + printf "supermin: there are %d config files\n" + (List.length config_files); - files_from in + if config_files <> [] then ( + (* There are config files to copy, so create the list with them, + * and then compress them with tar. + *) + let files_from = + (* Put the list of config files into a file, for tar to read. *) + let files_from = tmpdir // "files-from.txt" in + let chan = open_out files_from in + List.iter (fprintf chan ".%s\n") config_files; (* "./filename" *) + close_out chan; - (* Write base.tar.gz. *) - let base = outputdir // "base.tar.gz" in - if debug >= 1 then printf "supermin: writing %s\n%!" base; - let cmd = - sprintf "tar -C %s -zcf %s -T %s" - (quote dir) (quote base) (quote files_from) in - run_command cmd; + files_from in + + (* Write base.tar.gz. *) + let base = outputdir // "base.tar.gz" in + if debug >= 1 then printf "supermin: writing %s\n%!" base; + let cmd = + sprintf "tar%s -C %s -zcf %s -T %s" + (if debug >=1 then " -v" else "") + (quote dir) (quote base) (quote files_from) in + run_command cmd; + ) + else ( + (* No config files to copy, so do not create base.tar.gz. *) + if debug >= 1 then printf "supermin: not creating base.tar.gz\n%!"; + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/src/ph_rpm.ml new/supermin-5.1.20/src/ph_rpm.ml --- old/supermin-5.1.18/src/ph_rpm.ml 2017-03-01 12:34:37.000000000 +0100 +++ new/supermin-5.1.20/src/ph_rpm.ml 2018-11-19 23:24:50.000000000 +0100 @@ -40,7 +40,8 @@ let opensuse_detect () = Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () && Config.zypper <> "no" && - (List.mem (Os_release.get_id ()) [ "opensuse"; "sled"; "sles" ] || + (List.mem (Os_release.get_id ()) [ "sled"; "sles" ] || + string_prefix "opensuse" (Os_release.get_id ()) || try (stat "/etc/SuSE-release").st_kind = S_REG with Unix_error _ -> false) let mageia_detect () = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/src/supermin-link.sh.in new/supermin-5.1.20/src/supermin-link.sh.in --- old/supermin-5.1.18/src/supermin-link.sh.in 2015-07-27 16:42:03.000000000 +0200 +++ new/supermin-5.1.20/src/supermin-link.sh.in 2018-08-31 09:57:30.000000000 +0200 @@ -21,4 +21,8 @@ # Hack automake to link 'supermin' binary properly. There is no other # way to add the -cclib parameter to the end of the command line. -exec "$@" -linkpkg -cclib '@EXT2FS_LIBS@ @COM_ERR_LIBS@ @LIBRPM_LIBS@' +exec "$@" \ + -linkpkg \ + -runtime-variant _pic \ + -ccopt '@CFLAGS@' \ + -cclib '@LDFLAGS@ @EXT2FS_LIBS@ @COM_ERR_LIBS@ @LIBRPM_LIBS@' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/src/supermin.1 new/supermin-5.1.20/src/supermin.1 --- old/supermin-5.1.18/src/supermin.1 2017-03-01 12:36:34.000000000 +0100 +++ new/supermin-5.1.20/src/supermin.1 2017-10-24 14:43:44.000000000 +0200 @@ -67,7 +67,7 @@ .\" ======================================================================== .\" .IX Title "SUPERMIN 1" -.TH SUPERMIN 1 "2017-03-01" "supermin-5.1.17" "Virtualization Support" +.TH SUPERMIN 1 "2017-10-24" "supermin-5.1.19" "Virtualization Support" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -84,7 +84,7 @@ .SH "EXAMPLE" .IX Header "EXAMPLE" .Vb 1 -\& supermin \-\-prepare bash \-o /tmp/supermin.d +\& supermin \-\-prepare bash util\-linux \-o /tmp/supermin.d \& \& cat > init <<EOF \& #!/bin/sh @@ -103,7 +103,7 @@ \& \-kernel /tmp/appliance.d/kernel \e \& \-initrd /tmp/appliance.d/initrd \e \& \-hda /tmp/appliance.d/root \e -\& \-serial stdio \-append "console=ttyS0" +\& \-serial stdio \-append "console=ttyS0 root=/dev/sda" \& ... \& Welcome to supermin \& bash\-4.3# diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/src/supermin.pod new/supermin-5.1.20/src/supermin.pod --- old/supermin-5.1.18/src/supermin.pod 2017-03-01 12:34:37.000000000 +0100 +++ new/supermin-5.1.20/src/supermin.pod 2017-10-24 14:43:07.000000000 +0200 @@ -12,7 +12,7 @@ =head1 EXAMPLE - supermin --prepare bash -o /tmp/supermin.d + supermin --prepare bash util-linux -o /tmp/supermin.d cat > init <<EOF #!/bin/sh @@ -31,7 +31,7 @@ -kernel /tmp/appliance.d/kernel \ -initrd /tmp/appliance.d/initrd \ -hda /tmp/appliance.d/root \ - -serial stdio -append "console=ttyS0" + -serial stdio -append "console=ttyS0 root=/dev/sda" ... Welcome to supermin bash-4.3# diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/test-driver new/supermin-5.1.20/test-driver --- old/supermin-5.1.18/test-driver 2016-02-17 15:57:44.000000000 +0100 +++ new/supermin-5.1.20/test-driver 2014-03-12 20:05:34.000000000 +0100 @@ -1,9 +1,9 @@ #! /bin/sh # test-driver - basic testsuite driver script. -scriptversion=2013-07-13.22; # UTC +scriptversion=2012-06-27.10; # UTC -# Copyright (C) 2011-2014 Free Software Foundation, Inc. +# Copyright (C) 2011-2013 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -44,12 +44,13 @@ Usage: test-driver --test-name=NAME --log-file=PATH --trs-file=PATH [--expect-failure={yes|no}] [--color-tests={yes|no}] - [--enable-hard-errors={yes|no}] [--] - TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS] + [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT The '--test-name', '--log-file' and '--trs-file' options are mandatory. END } +# TODO: better error handling in option parsing (in particular, ensure +# TODO: $log_file, $trs_file and $test_name are defined). test_name= # Used for reporting. log_file= # Where to save the output of the test script. trs_file= # Where to save the metadata of the test run. @@ -68,23 +69,10 @@ --enable-hard-errors) enable_hard_errors=$2; shift;; --) shift; break;; -*) usage_error "invalid option: '$1'";; - *) break;; esac shift done -missing_opts= -test x"$test_name" = x && missing_opts="$missing_opts --test-name" -test x"$log_file" = x && missing_opts="$missing_opts --log-file" -test x"$trs_file" = x && missing_opts="$missing_opts --trs-file" -if test x"$missing_opts" != x; then - usage_error "the following mandatory options are missing:$missing_opts" -fi - -if test $# -eq 0; then - usage_error "missing argument" -fi - if test $color_tests = yes; then # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'. red='[0;31m' # Red. @@ -106,14 +94,11 @@ # Test script is run here. "$@" >$log_file 2>&1 estatus=$? - if test $enable_hard_errors = no && test $estatus -eq 99; then - tweaked_estatus=1 -else - tweaked_estatus=$estatus + estatus=1 fi -case $tweaked_estatus:$expect_failure in +case $estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; @@ -122,12 +107,6 @@ *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac -# Report the test outcome and exit status in the logs, so that one can -# know whether the test passed or failed simply by looking at the '.log' -# file, without the need of also peaking into the corresponding '.trs' -# file (automake bug#11814). -echo "$res $test_name (exit status: $estatus)" >>$log_file - # Report outcome to console. echo "${col}${res}${std}: $test_name" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/supermin-5.1.18/tests/test-harder.sh new/supermin-5.1.20/tests/test-harder.sh --- old/supermin-5.1.18/tests/test-harder.sh 2017-03-01 12:34:37.000000000 +0100 +++ new/supermin-5.1.20/tests/test-harder.sh 2018-11-19 23:24:50.000000000 +0100 @@ -29,7 +29,7 @@ distro=$(. /etc/os-release && echo $ID) case "$distro" in fedora|rhel|centos) distro=redhat ;; - opensuse|sled|sles) distro=suse ;; + opensuse*|sled|sles) distro=suse ;; ubuntu) distro=debian ;; esac elif [ -f /etc/arch-release ]; then ++++++ suse_release.patch ++++++ --- /var/tmp/diff_new_pack.SnnbNA/_old 2019-11-21 12:58:59.638521839 +0100 +++ /var/tmp/diff_new_pack.SnnbNA/_new 2019-11-21 12:58:59.638521839 +0100 @@ -1,7 +1,5 @@ -Index: supermin-5.1.18/src/os_release.ml -=================================================================== ---- supermin-5.1.18.orig/src/os_release.ml -+++ supermin-5.1.18/src/os_release.ml +--- a/src/os_release.ml ++++ b/src/os_release.ml @@ -29,6 +29,7 @@ let split sep str = type os_release = { @@ -40,10 +38,8 @@ + match get_data () with + | None -> [] + | Some d -> d.id_like -Index: supermin-5.1.18/src/os_release.mli -=================================================================== ---- supermin-5.1.18.orig/src/os_release.mli -+++ supermin-5.1.18/src/os_release.mli +--- a/src/os_release.mli ++++ b/src/os_release.mli @@ -24,3 +24,10 @@ val get_id : unit -> string An empty string is returned if the file does not exist or cannot @@ -55,14 +51,12 @@ + + An empty list is returned if the file does not exist, cannot + be read or the ID_LIKE field is not defined. *) -Index: supermin-5.1.18/src/ph_rpm.ml -=================================================================== ---- supermin-5.1.18.orig/src/ph_rpm.ml -+++ supermin-5.1.18/src/ph_rpm.ml -@@ -41,6 +41,7 @@ let opensuse_detect () = - Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () && +--- a/src/ph_rpm.ml ++++ b/src/ph_rpm.ml +@@ -42,6 +42,7 @@ let opensuse_detect () = Config.zypper <> "no" && - (List.mem (Os_release.get_id ()) [ "opensuse"; "sled"; "sles" ] || + (List.mem (Os_release.get_id ()) [ "sled"; "sles" ] || + string_prefix "opensuse" (Os_release.get_id ()) || + List.mem "suse" (Os_release.get_id_like ()) || try (stat "/etc/SuSE-release").st_kind = S_REG with Unix_error _ -> false)
