Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/kexec-tools/, sys-apps/kexec-tools/files/
Date: Sun, 03 May 2020 19:01:59
Message-Id: 1588532469.a79ebc56e947c3561a98e56f1de792f491846cde.whissi@gentoo
1 commit: a79ebc56e947c3561a98e56f1de792f491846cde
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 3 18:46:41 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Sun May 3 19:01:09 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a79ebc56
7
8 sys-apps/kexec-tools: fix building against GCC 10
9
10 Closes: https://bugs.gentoo.org/707132
11 Package-Manager: Portage-2.3.99, Repoman-2.3.22
12 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
13
14 ...0-remove-duplicated-variable-declarations.patch | 99 ++++++++++++++++++++++
15 sys-apps/kexec-tools/kexec-tools-2.0.20-r1.ebuild | 89 +++++++++++++++++++
16 2 files changed, 188 insertions(+)
17
18 diff --git a/sys-apps/kexec-tools/files/kexec-tools-2.0.20-remove-duplicated-variable-declarations.patch b/sys-apps/kexec-tools/files/kexec-tools-2.0.20-remove-duplicated-variable-declarations.patch
19 new file mode 100644
20 index 00000000000..d71e76b3d63
21 --- /dev/null
22 +++ b/sys-apps/kexec-tools/files/kexec-tools-2.0.20-remove-duplicated-variable-declarations.patch
23 @@ -0,0 +1,99 @@
24 +From cc087b11462af9f971a2c090d07e8d780a867b50 Mon Sep 17 00:00:00 2001
25 +From: Kairui Song <kasong@××××××.com>
26 +Date: Wed, 29 Jan 2020 13:38:19 +0800
27 +Subject: kexec-tools: Remove duplicated variable declarations
28 +
29 +When building kexec-tools for Fedora 32, following error is observed:
30 +
31 +/usr/bin/ld: kexec/arch/x86_64/kexec-bzImage64.o:(.bss+0x0): multiple definition of `bzImage_support_efi_boot';
32 +kexec/arch/i386/kexec-bzImage.o:(.bss+0x0): first defined here
33 +
34 +/builddir/build/BUILD/kexec-tools-2.0.20/kexec/arch/arm/../../fs2dt.h:33: multiple definition of `my_debug';
35 +kexec/fs2dt.o:/builddir/build/BUILD/kexec-tools-2.0.20/kexec/fs2dt.h:33: first defined here
36 +
37 +/builddir/build/BUILD/kexec-tools-2.0.20/kexec/arch/arm64/kexec-arm64.h:68: multiple definition of `arm64_mem';
38 +kexec/fs2dt.o:/builddir/build/BUILD/kexec-tools-2.0.20/././kexec/arch/arm64/kexec-arm64.h:68: first defined here
39 +
40 +/builddir/build/BUILD/kexec-tools-2.0.20/kexec/arch/arm64/kexec-arm64.h:54: multiple definition of `initrd_size';
41 +kexec/fs2dt.o:/builddir/build/BUILD/kexec-tools-2.0.20/././kexec/arch/arm64/kexec-arm64.h:54: first defined here
42 +
43 +/builddir/build/BUILD/kexec-tools-2.0.20/kexec/arch/arm64/kexec-arm64.h:53: multiple definition of `initrd_base';
44 +kexec/fs2dt.o:/builddir/build/BUILD/kexec-tools-2.0.20/././kexec/arch/arm64/kexec-arm64.h:53: first defined here
45 +
46 +And apparently, these variables are wrongly declared multiple times. So
47 +remove duplicated declaration.
48 +
49 +Signed-off-by: Kairui Song <kasong@××××××.com>
50 +Signed-off-by: Simon Horman <horms@×××××××××.au>
51 +---
52 + kexec/arch/arm64/kexec-arm64.h | 6 +++---
53 + kexec/arch/ppc64/kexec-elf-ppc64.c | 2 --
54 + kexec/arch/x86_64/kexec-bzImage64.c | 1 -
55 + kexec/fs2dt.h | 2 +-
56 + 4 files changed, 4 insertions(+), 7 deletions(-)
57 +
58 +diff --git a/kexec/arch/arm64/kexec-arm64.h b/kexec/arch/arm64/kexec-arm64.h
59 +index 628de79..ed447ac 100644
60 +--- a/kexec/arch/arm64/kexec-arm64.h
61 ++++ b/kexec/arch/arm64/kexec-arm64.h
62 +@@ -50,8 +50,8 @@ int zImage_arm64_load(int argc, char **argv, const char *kernel_buf,
63 + void zImage_arm64_usage(void);
64 +
65 +
66 +-off_t initrd_base;
67 +-off_t initrd_size;
68 ++extern off_t initrd_base;
69 ++extern off_t initrd_size;
70 +
71 + /**
72 + * struct arm64_mem - Memory layout info.
73 +@@ -65,7 +65,7 @@ struct arm64_mem {
74 + };
75 +
76 + #define arm64_mem_ngv UINT64_MAX
77 +-struct arm64_mem arm64_mem;
78 ++extern struct arm64_mem arm64_mem;
79 +
80 + uint64_t get_phys_offset(void);
81 + uint64_t get_vp_offset(void);
82 +diff --git a/kexec/arch/ppc64/kexec-elf-ppc64.c b/kexec/arch/ppc64/kexec-elf-ppc64.c
83 +index 3510b70..695b8b0 100644
84 +--- a/kexec/arch/ppc64/kexec-elf-ppc64.c
85 ++++ b/kexec/arch/ppc64/kexec-elf-ppc64.c
86 +@@ -44,8 +44,6 @@
87 + uint64_t initrd_base, initrd_size;
88 + unsigned char reuse_initrd = 0;
89 + const char *ramdisk;
90 +-/* Used for enabling printing message from purgatory code */
91 +-int my_debug = 0;
92 +
93 + int elf_ppc64_probe(const char *buf, off_t len)
94 + {
95 +diff --git a/kexec/arch/x86_64/kexec-bzImage64.c b/kexec/arch/x86_64/kexec-bzImage64.c
96 +index 8edb3e4..ba8dc48 100644
97 +--- a/kexec/arch/x86_64/kexec-bzImage64.c
98 ++++ b/kexec/arch/x86_64/kexec-bzImage64.c
99 +@@ -42,7 +42,6 @@
100 + #include <arch/options.h>
101 +
102 + static const int probe_debug = 0;
103 +-int bzImage_support_efi_boot;
104 +
105 + int bzImage64_probe(const char *buf, off_t len)
106 + {
107 +diff --git a/kexec/fs2dt.h b/kexec/fs2dt.h
108 +index 7633273..fe24931 100644
109 +--- a/kexec/fs2dt.h
110 ++++ b/kexec/fs2dt.h
111 +@@ -30,7 +30,7 @@ extern struct bootblock bb[1];
112 +
113 + /* Used for enabling printing message from purgatory code
114 + * Only has implemented for PPC64 */
115 +-int my_debug;
116 ++extern int my_debug;
117 + extern int dt_no_old_root;
118 +
119 + void reserve(unsigned long long where, unsigned long long length);
120 +--
121 +cgit 1.2-0.3.lf.el7
122 +
123
124 diff --git a/sys-apps/kexec-tools/kexec-tools-2.0.20-r1.ebuild b/sys-apps/kexec-tools/kexec-tools-2.0.20-r1.ebuild
125 new file mode 100644
126 index 00000000000..7fd2e6f2679
127 --- /dev/null
128 +++ b/sys-apps/kexec-tools/kexec-tools-2.0.20-r1.ebuild
129 @@ -0,0 +1,89 @@
130 +# Copyright 1999-2020 Gentoo Authors
131 +# Distributed under the terms of the GNU General Public License v2
132 +
133 +EAPI=7
134 +
135 +inherit flag-o-matic libtool linux-info systemd
136 +
137 +if [[ ${PV} == "9999" ]] ; then
138 + inherit git-r3 autotools
139 + EGIT_REPO_URI="https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git"
140 +else
141 + SRC_URI="https://www.kernel.org/pub/linux/utils/kernel/kexec/${P/_/-}.tar.xz"
142 + [[ "${PV}" == *_rc* ]] || \
143 + KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
144 +fi
145 +
146 +DESCRIPTION="Load another kernel from the currently executing Linux kernel"
147 +HOMEPAGE="https://kernel.org/pub/linux/utils/kernel/kexec/"
148 +
149 +LICENSE="GPL-2"
150 +SLOT="0"
151 +IUSE="booke lzma xen zlib"
152 +
153 +REQUIRED_USE="lzma? ( zlib )"
154 +
155 +DEPEND="
156 + lzma? ( app-arch/xz-utils )
157 + zlib? ( sys-libs/zlib )"
158 +RDEPEND="${DEPEND}"
159 +
160 +S="${WORKDIR}/${P/_/-}"
161 +
162 +CONFIG_CHECK="~KEXEC"
163 +
164 +PATCHES=(
165 + "${FILESDIR}"/${PN}-2.0.4-disable-kexec-test.patch
166 + "${FILESDIR}"/${PN}-2.0.4-out-of-source.patch
167 + "${FILESDIR}"/${P}-remove-duplicated-variable-declarations.patch
168 +)
169 +
170 +pkg_setup() {
171 + # GNU Make's $(COMPILE.S) passes ASFLAGS to $(CCAS), CCAS=$(CC)
172 + export ASFLAGS="${CCASFLAGS}"
173 +}
174 +
175 +src_prepare() {
176 + default
177 + if [[ "${PV}" == 9999 ]] ; then
178 + eautoreconf
179 + else
180 + elibtoolize
181 + fi
182 + filter-flags '-mindirect-branch=thunk*'
183 +}
184 +
185 +src_configure() {
186 + local myeconfargs=(
187 + $(use_with booke)
188 + $(use_with lzma)
189 + $(use_with xen)
190 + $(use_with zlib)
191 + )
192 + econf "${myeconfargs[@]}"
193 +}
194 +
195 +src_install() {
196 + default
197 +
198 + dodoc "${FILESDIR}"/README.Gentoo
199 +
200 + newinitd "${FILESDIR}"/kexec.init-2.0.13-r1 kexec
201 + newconfd "${FILESDIR}"/kexec.conf-2.0.4 kexec
202 +
203 + insinto /etc
204 + doins "${FILESDIR}"/kexec.conf
205 +
206 + insinto /etc/kernel/postinst.d
207 + doins "${FILESDIR}"/90_kexec
208 +
209 + systemd_dounit "${FILESDIR}"/kexec.service
210 +}
211 +
212 +pkg_postinst() {
213 + if systemd_is_booted || has_version sys-apps/systemd; then
214 + elog "For systemd support the new config file is"
215 + elog " /etc/kexec.conf"
216 + elog "Please adopt it to your needs as there is no autoconfig anymore"
217 + fi
218 +}