From a3a5281e1d4dc2e8c40a0666f10feaa3e21ec82b Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 12 Jan 2016 19:08:31 +0000 Subject: [PATCH] Add all patches since 5.1.14. --- ...ze-since-it-can-be-computed-from-_st.patch | 75 +++++++++++++++++++ ...l-exclude-setting-when-downloading-p.patch | 39 ++++++++++ supermin.spec | 11 ++- 3 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 0001-bin2s-Remove-_size-since-it-can-be-computed-from-_st.patch create mode 100644 0002-dnf-Ignore-global-exclude-setting-when-downloading-p.patch diff --git a/0001-bin2s-Remove-_size-since-it-can-be-computed-from-_st.patch b/0001-bin2s-Remove-_size-since-it-can-be-computed-from-_st.patch new file mode 100644 index 0000000..757bbbf --- /dev/null +++ b/0001-bin2s-Remove-_size-since-it-can-be-computed-from-_st.patch @@ -0,0 +1,75 @@ +From 7cff794d82076df70dde7a851937fc7bf93fdf44 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 12 Jan 2016 11:07:57 +0000 +Subject: [PATCH 1/2] bin2s: Remove _size, since it can be computed from _start + and _end. + +Also declare the _start and _end as uint8_t instead of char, since +they refer to an array of bytes. + +See discussion here: +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809185 +--- + src/bin2s.pl | 8 -------- + src/ext2init-c.c | 5 +++-- + 2 files changed, 3 insertions(+), 10 deletions(-) + +diff --git a/src/bin2s.pl b/src/bin2s.pl +index db6db26..8558126 100755 +--- a/src/bin2s.pl ++++ b/src/bin2s.pl +@@ -39,7 +39,6 @@ print $ofh <<"EOF"; + + \t.globl\t_binary_${infile}_start + \t.globl\t_binary_${infile}_end +-\t.globl\t_binary_${infile}_size + + \t.section\t.rodata + _binary_${infile}_start: +@@ -55,14 +54,7 @@ die "read $infile (at offset $sz): $!\n" if not defined $i; + close $ifh; + + print $ofh <<"EOF"; +- + _binary_${infile}_end: +- +-#if defined(__hppa__) +-\t_binary_${infile}_size: .equ $sz +-#else +-\t.equ _binary_${infile}_size, $sz +-#endif + EOF + + close $ofh; +diff --git a/src/ext2init-c.c b/src/ext2init-c.c +index c310ed2..66ad254 100644 +--- a/src/ext2init-c.c ++++ b/src/ext2init-c.c +@@ -20,6 +20,7 @@ + + #include + #include ++#include + #include + + #include +@@ -28,14 +29,14 @@ + /* The init binary. + * See: bin2s.pl, init.c. + */ +-extern char _binary_init_start, _binary_init_end, _binary_init_size; ++extern uint8_t _binary_init_start, _binary_init_end; + + value + supermin_binary_init (value unitv) + { + CAMLparam1 (unitv); + CAMLlocal1 (sv); +- size_t n = (size_t) &_binary_init_size; ++ size_t n = &_binary_init_end - &_binary_init_start; + + sv = caml_alloc_string (n); + memcpy (String_val (sv), &_binary_init_start, n); +-- +2.5.0 + diff --git a/0002-dnf-Ignore-global-exclude-setting-when-downloading-p.patch b/0002-dnf-Ignore-global-exclude-setting-when-downloading-p.patch new file mode 100644 index 0000000..a83cccf --- /dev/null +++ b/0002-dnf-Ignore-global-exclude-setting-when-downloading-p.patch @@ -0,0 +1,39 @@ +From 53a113ee3ada2e2aea586a62c258e5bb46ca32d5 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 12 Jan 2016 19:02:44 +0000 +Subject: [PATCH 2/2] dnf: Ignore global exclude setting when downloading + packages. + +When you use `dnf download', it obeys the exclude settings in +`/etc/dnf/dnf.conf'. This is a problem if the user has excluded some +broken packages from being installed on the host, but still wants to +build libguestfs. + +Use the --disableexcludes=all option to override this behaviour. +--- + src/rpm.ml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/rpm.ml b/src/rpm.ml +index 1db47b6..cf6341c 100644 +--- a/src/rpm.ml ++++ b/src/rpm.ml +@@ -1,5 +1,5 @@ + (* supermin 5 +- * Copyright (C) 2009-2014 Red Hat Inc. ++ * Copyright (C) 2009-2016 Red Hat 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 +@@ -334,7 +334,7 @@ and fedora_download_all_packages_with_dnf pkgs dir tdir = + let rpms = pkgs_as_NA_rpms pkgs in + + let cmd = +- sprintf "%s download%s%s --destdir %s %s" ++ sprintf "%s download%s%s --destdir=%s --disableexcludes=all %s" + Config.dnf + (if !settings.debug >= 1 then " -v" else " -q") + (match !settings.packager_config with +-- +2.5.0 + diff --git a/supermin.spec b/supermin.spec index e45f04d..cd800d1 100644 --- a/supermin.spec +++ b/supermin.spec @@ -6,7 +6,7 @@ Summary: Tool for creating supermin appliances Name: supermin Version: 5.1.14 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ %if 0%{?rhel} >= 7 @@ -16,6 +16,10 @@ ExclusiveArch: x86_64 URL: http://people.redhat.com/~rjones/supermin/ Source0: http://libguestfs.org/download/supermin/%{name}-%{version}.tar.gz +# All upstream since 5.1.14. +Patch1: 0001-bin2s-Remove-_size-since-it-can-be-computed-from-_st.patch +Patch2: 0002-dnf-Ignore-global-exclude-setting-when-downloading-p.patch + BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2html BuildRequires: rpm @@ -86,7 +90,7 @@ from supermin appliances. %prep %setup -q -#%autopatch -p1 +%autopatch -p1 %build @@ -130,6 +134,9 @@ make check || { %changelog +* Tue Jan 12 2016 Richard W.M. Jones - 5.1.14-2 +- Add all patches since 5.1.14. + * Mon Jan 11 2016 Richard W.M. Jones - 5.1.14-1 - New upstream version 5.1.14. - Remove all patches - now upstream.