-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0011.patch
More file actions
271 lines (254 loc) · 7.71 KB
/
0011.patch
File metadata and controls
271 lines (254 loc) · 7.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
From 0bb9a683d4df27427a0ab1d247b6dbb8343d820e Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Thu, 15 Mar 2018 16:57:47 +0100
Subject: [PATCH] spec: drop support for legacy distributions
rhel <= 7 has its own branch and there is no point in supporting the old
fedora
---
51-dracut-rescue-postinst.sh | 68 ---------------------------------------
dracut.spec | 75 +++++++-------------------------------------
2 files changed, 12 insertions(+), 131 deletions(-)
diff --git a/51-dracut-rescue-postinst.sh b/51-dracut-rescue-postinst.sh
deleted file mode 100755
index 67f5b717..00000000
--- a/51-dracut-rescue-postinst.sh
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/bash
-
-export LANG=C
-
-KERNEL_VERSION="$1"
-KERNEL_IMAGE="$2"
-
-[[ -f /etc/os-release ]] && . /etc/os-release
-
-if [[ ! -f /etc/machine-id ]] || [[ ! -s /etc/machine-id ]]; then
- systemd-machine-id-setup
-fi
-
-[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
-
-[[ $MACHINE_ID ]] || exit 1
-[[ -f $KERNEL_IMAGE ]] || exit 1
-
-INITRDFILE="/boot/initramfs-0-rescue-${MACHINE_ID}.img"
-NEW_KERNEL_IMAGE="${KERNEL_IMAGE%/*}/vmlinuz-0-rescue-${MACHINE_ID}"
-
-[[ -f $INITRDFILE ]] && [[ -f $NEW_KERNEL_IMAGE ]] && exit 0
-
-dropindirs_sort()
-{
- suffix=$1; shift
- args=("$@")
- files=$(
- while (( $# > 0 )); do
- for i in ${1}/*${suffix}; do
- [[ -f $i ]] && echo ${i##*/}
- done
- shift
- done | sort -Vu
- )
-
- for f in $files; do
- for d in "${args[@]}"; do
- if [[ -f "$d/$f" ]]; then
- echo "$d/$f"
- continue 2
- fi
- done
- done
-}
-
-# source our config dir
-for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d"); do
- [[ -e $f ]] && . "$f"
-done
-
-[[ $dracut_rescue_image != "yes" ]] && exit 0
-
-if [[ ! -f $INITRDFILE ]]; then
- dracut --no-hostonly -a "rescue" "$INITRDFILE" "$KERNEL_VERSION"
- ((ret+=$?))
-fi
-
-if [[ ! -f $NEW_KERNEL_IMAGE ]]; then
- cp --reflink=auto "$KERNEL_IMAGE" "$NEW_KERNEL_IMAGE"
- ((ret+=$?))
-fi
-
-new-kernel-pkg --install "$KERNEL_VERSION" --kernel-image "$NEW_KERNEL_IMAGE" --initrdfile "$INITRDFILE" --banner "$NAME $VERSION_ID Rescue $MACHINE_ID"
-
-((ret+=$?))
-
-exit $ret
diff --git a/dracut.spec b/dracut.spec
index 725f89d6..9c2fc9d4 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -5,15 +5,6 @@
# strip the automatically generated dep here and instead co-own the
# directory.
%global __requires_exclude pkg-config
-
-# Variables must be defined
-%define with_nbd 1
-
-# nbd in Fedora only
-%if 0%{?rhel} >= 6
-%define with_nbd 0
-%endif
-
%define dist_free_release xxx
Name: dracut
@@ -46,6 +37,7 @@ BuildRequires: gcc
%if 0%{?fedora} || 0%{?rhel}
BuildRequires: pkgconfig
+BuildRequires: systemd
%endif
%if 0%{?fedora}
BuildRequires: bash-completion
@@ -63,31 +55,11 @@ BuildRequires: docbook-style-xsl docbook-dtds libxslt
BuildRequires: asciidoc
%endif
-%if 0%{?fedora} > 12 || 0%{?rhel}
-# no "provides", because dracut does not offer
-# all functionality of the obsoleted packages
-Obsoletes: mkinitrd < 6.0.94
-Obsoletes: mkinitrd-devel < 6.0.94
-Obsoletes: nash < 6.0.94
-Obsoletes: libbdevid-python < 6.0.94
-%endif
-
-%if 0%{?fedora} > 16 || 0%{?rhel} > 6
-BuildRequires: systemd-units
-%endif
-
%if 0%{?suse_version} > 9999
Obsoletes: mkinitrd < 2.6.1
Provides: mkinitrd = 2.6.1
%endif
-Obsoletes: dracut-kernel < 005
-Provides: dracut-kernel = %{version}-%{release}
-
-Obsoletes: dracut < 030
-Obsoletes: dracut-norescue < 030
-Provides: dracut-norescue = %{version}-%{release}
-
Requires: bash >= 4
Requires: coreutils
Requires: cpio
@@ -99,33 +71,23 @@ Requires: sed
Requires: xz
Requires: gzip
-%if 0%{?fedora} > 22 || 0%{?rhel} > 7
+%if 0%{?fedora} || 0%{?rhel}
Recommends: grubby
Recommends: hardlink
Recommends: pigz
Recommends: kpartx
-%else
-Requires: hardlink
-Requires: gzip
-Requires: kpartx
-%endif
-
-%if 0%{?fedora} || 0%{?rhel} > 6
Requires: util-linux >= 2.21
Requires: systemd >= 219
Requires: systemd-udev >= 219
Requires: procps-ng
-Conflicts: grubby < 8.23
-Conflicts: initscripts < 8.63-1
-Conflicts: plymouth < 0.8.0-0.2009.29.09.19.1
-Conflicts: bcache-tools < 0-0.14.20130909git
%else
+Requires: hardlink
+Requires: gzip
+Requires: kpartx
Requires: udev > 166
Requires: util-linux-ng >= 2.21
%endif
-Conflicts: mdadm < 3.2.6-14
-
%description
dracut contains tools to create bootable initramfses for the Linux
kernel. Unlike previous implementations, dracut hard-codes as little
@@ -155,17 +117,12 @@ Provides: dracut-generic = %{version}-%{release}
This package requires everything which is needed to build a generic
all purpose initramfs with network support with dracut.
-%if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?suse_version}
+%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
%package fips
Summary: dracut modules to build a dracut initramfs with an integrity check
Requires: %{name} = %{version}-%{release}
Requires: hmaccalc
-%if 0%{?rhel} > 5
-# For Alpha 3, we want nss instead of nss-softokn
Requires: nss
-%else
-Requires: nss-softokn
-%endif
Requires: nss-softokn-freebl
%description fips
@@ -250,9 +207,6 @@ cp %{SOURCE1} .
make %{?_smp_mflags}
%install
-%if 0%{?fedora} || 0%{?rhel}
-rm -rf -- $RPM_BUILD_ROOT
-%endif
make %{?_smp_mflags} install \
DESTDIR=$RPM_BUILD_ROOT \
libdir=%{_prefix}/lib
@@ -314,16 +268,12 @@ install -m 0644 dracut.conf.d/suse.conf.example $RPM_BUILD_ROOT%{dracutlibdir}
install -m 0644 dracut.conf.d/fips.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/40-fips.conf
%endif
-%if 0%{?fedora} <= 12 && 0%{?rhel} < 6 && 0%{?suse_version} <= 9999
+%if 0%{?fedora} == 0 && 0%{?rhel} == 0 && 0%{?suse_version} <= 9999
rm -f -- $RPM_BUILD_ROOT%{_bindir}/mkinitrd
rm -f -- $RPM_BUILD_ROOT%{_bindir}/lsinitrd
%endif
-%if 0%{?fedora} || 0%{?rhel} > 6
-# FIXME: remove after F19
-mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/kernel/postinst.d
-install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
-
+%if 0%{?fedora} || 0%{?rhel}
echo 'hostonly="no"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-generic-image.conf
echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-rescue.conf
%endif
@@ -342,7 +292,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%{_bindir}/dracut
%{_datadir}/bash-completion/completions/dracut
%{_datadir}/bash-completion/completions/lsinitrd
-%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999
+%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} > 9999
%{_bindir}/mkinitrd
%{_bindir}/lsinitrd
%endif
@@ -368,7 +318,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%if %{with doc}
%{_mandir}/man8/dracut.8*
%{_mandir}/man8/*service.8*
-%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999
+%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} > 9999
%{_mandir}/man8/mkinitrd.8*
%{_mandir}/man1/lsinitrd.1*
%endif
@@ -462,7 +412,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%{_unitdir}/initrd.target.wants/dracut-pre-udev.service
%endif
-%if 0%{?fedora} || 0%{?rhel} > 6
+%if 0%{?fedora} || 0%{?rhel}
%{_prefix}/lib/kernel/install.d/50-dracut.install
%endif
@@ -527,9 +477,8 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%files config-rescue
%defattr(-,root,root,0755)
%{dracutlibdir}/dracut.conf.d/02-rescue.conf
-%if 0%{?fedora} || 0%{?rhel} > 6
+%if 0%{?fedora} || 0%{?rhel}
%{_prefix}/lib/kernel/install.d/51-dracut-rescue.install
-%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
%endif
%changelog