forked from comoonics/comoonics-initrd-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
comoonics-bootimage-initscripts-el5.spec
412 lines (389 loc) · 15.5 KB
/
comoonics-bootimage-initscripts-el5.spec
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
#****h* comoonics-bootimage/comoonics-bootimage.spec
# NAME
# comoonics-bootimage-initscripts.spec
# $id$
# DESCRIPTION
# initscripts for the Comoonics bootimage
# AUTHOR
# Mark Hlawatschek
#
#*******
# @(#)$File:$
#
# Copyright (c) 2001 ATIX GmbH, 2007 ATIX AG.
# Einsteinstrasse 10, 85716 Unterschleissheim, Germany
# All rights reserved.
#
# 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 3 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, see <http://www.gnu.org/licenses/>.
#
# $Id: comoonics-bootimage-initscripts-el5.spec,v 1.30 2011-02-28 14:27:42 marc Exp $
#
##
##
%define _user root
%define CONFIGDIR /%{_sysconfdir}/comoonics
%define APPDIR /opt/atix/comoonics-bootimage
%define SBINDIR /sbin
%define ENVDIR /etc/profile.d
%define ENVFILE %{ENVDIR}/%{name}.sh
%define INITDIR /etc/rc.d/init.d
%define SYSCONFIGDIR /%{_sysconfdir}/sysconfig
%define KERNEL_SYSCONFIG_FILE %{SYSCONFIGDIR}/kernel
%define COMOONICS_NEW_KERNEL_PKG_UPDATE %{APPDIR}/patches/new-kernel-pkg-update.sh
%define RELEASENAME Gumpn
%define PRODUCTNAME OpenSharedRoot
%define PRODUCTVERSION 5.0
%define DISTRIBUTIONNAME %{PRODUCTNAME} %{PRODUCTVERSION} (%{RELEASENAME})
%define DISTRIBUTIONBASE %{DISTRIBUTIONNAME} Base
%define DISTRIBUTIONEXTRAS %{DISTRIBUTIONNAME} Extras
%define GROUPPARENT System Environment
%define GROUPCHILDEXTRAS Extras
%define GROUPCHILDBASE Base
%define GROUPCHILDSLES SLES
%define GROUPCHILDSLES10 SLES10
%define GROUPCHILDSLES11 SLES11
%define GROUPCHILDRHEL RHEL
%define GROUPCHILDRHEL4 RHEL4
%define GROUPCHILDRHEL5 RHEL5
%define GROUPCHILDRHEL6 RHEL6
%define GROUPCHILDFEDORA Fedora
Name: comoonics-bootimage-initscripts
Summary: Initscripts used by the OSR cluster environment.
Version: 5.0
BuildArch: noarch
Requires: comoonics-bootimage >= 5.0
Requires: comoonics-bootimage-listfiles-all
Requires: comoonics-bootimage-listfiles-rhel5
#Conflicts:
Release: 8_rhel5
Vendor: ATIX AG
Packager: ATIX AG <http://bugzilla.atix.de>
ExclusiveArch: noarch
URL: http://www.atix.de/
Source: http://www.atix.de/software/downloads/comoonics/comoonics-bootimage-initscripts-%{version}.tar.gz
License: GPL
Group: %{GROUPPARENT}/%{GROUPCHILDBASE}/%{GROUPCHILDRHEL5}
Distribution: %{DISTRIBUTIONBASE}
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
%description
Initscripts used by the OSR cluster environment.
%prep
%setup -n comoonics-bootimage-%{version}
%build
%install
# Files for compat
install -d -m 755 $RPM_BUILD_ROOT/%{INITDIR}
install -m755 initscripts/bootsr $RPM_BUILD_ROOT/%{INITDIR}/bootsr
install -m755 initscripts/mountcdsls $RPM_BUILD_ROOT/%{INITDIR}/mountcdsls
install -d -m 755 $RPM_BUILD_ROOT/%{APPDIR}/patches
install -m600 initscripts/rhel5/halt-xtab.patch $RPM_BUILD_ROOT/%{APPDIR}/patches/halt-xtab.patch
#install -m600 initscripts/rhel5/halt-local.patch $RPM_BUILD_ROOT/%{APPDIR}/patches/halt-local.patch
install -m600 initscripts/rhel5/halt-killall.patch $RPM_BUILD_ROOT/%{APPDIR}/patches/halt-killall.patch
install -m600 initscripts/rhel5/halt-comoonics.patch $RPM_BUILD_ROOT/%{APPDIR}/patches/halt-comoonics.patch
install -m600 initscripts/rhel5/netfs-xtab.patch $RPM_BUILD_ROOT/%{APPDIR}/patches/netfs-xtab.patch
install -m600 initscripts/rhel5/netfs-comoonics.patch $RPM_BUILD_ROOT/%{APPDIR}/patches/netfs-comoonics.patch
install -m600 initscripts/rhel5/network-xrootfs.patch $RPM_BUILD_ROOT/%{APPDIR}/patches/network-xrootfs.patch
install -m600 initscripts/rhel5/network-comoonics.patch $RPM_BUILD_ROOT/%{APPDIR}/patches/network-comoonics.patch
install -m600 initscripts/rhel5/halt.orig $RPM_BUILD_ROOT/%{APPDIR}/patches/halt.orig
install -m600 initscripts/rhel5/network.orig $RPM_BUILD_ROOT/%{APPDIR}/patches/network.orig
install -m600 initscripts/rhel5/netfs.orig $RPM_BUILD_ROOT/%{APPDIR}/patches/netfs.orig
install -m600 initscripts/rhel5/halt $RPM_BUILD_ROOT/%{APPDIR}/patches/halt
install -m600 initscripts/rhel5/network $RPM_BUILD_ROOT/%{APPDIR}/patches/network
install -m600 initscripts/rhel5/netfs $RPM_BUILD_ROOT/%{APPDIR}/patches/netfs
install -d $RPM_BUILD_ROOT/%{SBINDIR}
install -m755 initscripts/halt.local $RPM_BUILD_ROOT/%{SBINDIR}/halt.local
install -m600 initscripts/rhel5/new-kernel-pkg-update.sh $RPM_BUILD_ROOT/%{APPDIR}/patches/new-kernel-pkg-update.sh
%preun
if [ "$1" -eq 0 ]; then
echo "Preuninstalling comoonics-bootimage-initscripts"
/sbin/chkconfig --del bootsr
# we patch all versions here
fi
%pre
#if this is an upgrade we need to unpatch all files
if [ "$1" -eq 2 ]; then
# we patch all versions here
for initscript in halt network netfs; do
if grep "comoonics patch " /etc/init.d/$initscript > /dev/null; then
# the old way
if [ -e /opt/atix/comoonics-bootimage/patches/${initscript}.patch ]; then
patchfile="/opt/atix/comoonics-bootimage/patches/${initscript}.patch"
echo -n "Unpatching initscript($patchfile)"
cd /etc/init.d/ && patch -R -f -r /tmp/$(basename ${patchfile}).patch.rej > /dev/null < $patchfile
if [ $? -ne 0 ]; then
echo >&2
echo >&2
echo "FAILURE!!!!" >&2
echo "Patching $initscript with patch $patchfile" >&2
echo "You might want to consider restoring the original initscript and the patch again by:" >&2
echo "cp /opt/atix/comoonics-bootimage/patches/${initscript}.orig /etc/init.d/${initscript}"
echo "/opt/atix/comoonics-bootimage/manage_chroot.sh -a patch_files ${initscript}"
echo >&2
fi
echo
else
echo -n "Unpatching $initscript ("
for patchfile in $(ls -1 /opt/atix/comoonics-bootimage/patches/${initscript}-*.patch | sort -r); do
echo -n $(basename $patchfile)", "
cd /etc/init.d/ && patch -R -f -r /tmp/$(basename ${patchfile}).patch.rej > /dev/null < $patchfile
if [ $? -ne 0 ]; then
echo >&2
echo >&2
echo "FAILURE!!!!" >&2
echo "Patching $initscript with patch $patchfile" >&2
echo "You might want to consider restoring the original initscript and the patch again by:" >&2
echo "cp /opt/atix/comoonics-bootimage/patches/${initscript}.orig /etc/init.d/${initscript}"
echo "/opt/atix/comoonics-bootimage/manage_chroot.sh -a patch_files ${initscript}"
echo >&2
fi
done
echo ")"
fi
fi
done
fi
%post
echo "Starting postinstall.."
services="bootsr mountcdsls"
echo "Resetting services ($services)"
for service in $services; do
/sbin/chkconfig --del $service &>/dev/null
/sbin/chkconfig --add $service
/sbin/chkconfig $service on
/sbin/chkconfig --list $service
done
services=""
echo "Disabling services ($services)"
for service in $services; do
/sbin/chkconfig --del $service &> /dev/null
done
if ! grep "source %{COMOONICS_NEW_KERNEL_PKG_UPDATE}" "%{KERNEL_SYSCONFIG_FILE}" &>/dev/null; then
echo "Adapting %{KERNEL_SYSCONFIG_FILE} .."
echo "test -e %{COMOONICS_NEW_KERNEL_PKG_UPDATE} && source %{COMOONICS_NEW_KERNEL_PKG_UPDATE}" >> %{KERNEL_SYSCONFIG_FILE}
fi
%{APPDIR}/manage_chroot.sh -a patch_files
/bin/true
%postun
if [ -L %{SBINDIR}/halt.local ]; then
rm %{SBINDIR}/halt.local
fi
%files
%attr(755, root, root) %{INITDIR}/bootsr
%attr(755, root, root) %{INITDIR}/mountcdsls
%attr(755, root, root) %{APPDIR}/patches/halt
%attr(755, root, root) %{APPDIR}/patches/halt.orig
%attr(644, root, root) %{APPDIR}/patches/halt-comoonics.patch
%attr(644, root, root) %{APPDIR}/patches/halt-killall.patch
#%attr(644, root, root) %{APPDIR}/patches/halt-local.patch
%attr(644, root, root) %{APPDIR}/patches/halt-xtab.patch
%attr(755, root, root) %{APPDIR}/patches/netfs
%attr(755, root, root) %{APPDIR}/patches/netfs.orig
%attr(644, root, root) %{APPDIR}/patches/netfs-comoonics.patch
%attr(644, root, root) %{APPDIR}/patches/netfs-xtab.patch
%attr(755, root, root) %{APPDIR}/patches/network
%attr(755, root, root) %{APPDIR}/patches/network.orig
%attr(644, root, root) %{APPDIR}/patches/network-comoonics.patch
%attr(644, root, root) %{APPDIR}/patches/network-xrootfs.patch
%attr(644, root, root) %{APPDIR}/patches/new-kernel-pkg-update.sh
%attr(755, root, root) %{SBINDIR}/halt.local
%clean
rm -rf %{buildroot}
%changelog
* Thu Jul 05 2012 Marc Grimme <grimme( at )atix.de> 5.0-8
- initscripts/rhel5/halt: don't remount ro with cluster file system.
* Thu Jul 05 2012 Marc Grimme <grimme( at )atix.de> 5.0-7
- initscripts/rhel5/halt: fixed bug with missing parameters to halt/reboot
will not switchoff/reboot as desired.
* Mon May 07 2012 Marc Grimme <grimme( at )atix.de> 5.0-6
- initscripts/rhel5/new-kernel-pkg-update.sh
would yield an error if grub.conf exists but is not used (NFS Root).
* Tue Feb 14 2012 Marc Grimme <grimme( at )atix.de> 5.0-5
- initscripts/bootsr:
- changed stop order of bootsr to be stopped later
(after clvmd has been stoped).
- removed clean_start (obsolete)
- check_sharedroot now knows of gfs and gfs2
- start: calling clusterfs_init and cc_init independently from root
filesystem and cluster type (different parameters)
- stop: calling clusterfs_init and cc_init independently from
root filesystem and cluster type (different parameters)
* Tue Nov 29 2011 Marc Grimme <grimme ( at )atix.de> - 5.0-4
* initscripts/bootsr: moved inclusion of /etc/init.d/functions and
/etc/rc.status after inclusion of libs. Now all outputs should be seen at
console.
* Fri Nov 25 2011 Marc Grimme <grimme ( at )atix.de> - 5.0-3
* initscripts/bootsr: - Added call to update the repository from initrd -
Only remount cdsl environment if it is not only in /etc/mtab existant - other
handling fixes with chrootneeded
* Thu Nov 03 2011 Marc Grimme <grimme( at )atix.de> - 5.0-2_rhel5
* If no comoonics killall5 is available fall back to old one and don't issue errors.
* Tue Nov 01 2011 Marc Grimme <grimme( at )atix.de> - 5.0-1_rhel5
* Rebase for Release 5.0
* Tue Oct 25 2011 Marc Grimme <grimme( at )atix.de> 1.4-26.rhel5
- added RHEL5.7 initscripts (patched and unpatched).
* Fri Aug 05 2011 Marc Grimme <grimme@atix.de> 1.4-25.rhel5
- removed dep to SysVInit-comooics (will be found if the filesystem
- comoonics-bootimage-listfiles-<dist>-<filesystem> - rpm).
- Compatible with RHEL5.7 and below
* Thu Jul 28 2011 Marc Grimme <grimme@atix.de> 1.4-24.rhel5
- upstream patches for RHEL5.7
* Tue May 03 2011 Marc Grimme <grimme@atix.de> 1.4-23.rhel5
- added bootsr from generic initscripts
- introducing updated version to /sbin/new-kernel-pkg-update in order to allow autobuild of initrds
(requirement boot is mounted).
* Tue Mar 22 2011 Marc Grimme <grimme@atix.de> 1.4-22.rhel5
- Rebase
* Tue Mar 22 2011 Marc Grimme <grimme@atix.de> 1.4-21.rhel5
- Rebase
* Mon Feb 28 2011 Marc Grimme <grimme@atix.de> 1.4-20.rhel5
- halt.local will now be a file being installed instead of a symbolic link.
* Wed Aug 18 2010 Marc Grimme <grimme@atix.de> 1.4-19.rhel5
- initscripts/rhel4,rhel5,fedora,sles10,sles11/bootsr
- fixed bug #382 where the cdsl.local was not remounted in /etc/mtab on locally installed systems
* Thu Jul 08 2010 Marc Grimme <grimme@atix.de> 1.4-18.rhel5
- bootsr uses bash as shell
* Thu Jun 08 2010 Marc Grimme <grimme@atix.de> 1.4-17.rhel5
- introducted initscript mountcdsls
* Fri Apr 23 2010 Marc Grimme <grimme@atix.de> 1.4-16.rhel5
- netfs-tab.patch: initial revision
- netfs-xtab.patch: removed old data
* Tue Feb 23 2010 Marc Grimme <grimme@atix.de> 1.4-15.rhel5
- Fixes in check_mtab
* Fri Oct 09 2009 Marc Grimme <grimme@atix.de> 1.4-13el5
- removed halt patches as the are not needed with /sbin/halt.local
* Thu Oct 08 2009 Marc Grimme <grimme@atix.de> 1.4-12el5
- halt.local is now a link to /opt/atix/comoonics-bootimage/bootscripts/com-halt.sh
* Mon Apr 20 2009 Marc Grimme <grimme@atix.de> 1.4-10el5
- RC1
* Tue Apr 16 2009 Marc Grimme <grimme@atix.de> 1.4-9el5
- Syncronized bootsr and fixed calling of _init
* Wed Apr 15 2009 Marc Grimme <grimme@atix.de> 1.4-8el5
- Working release with gfs
* Wed Apr 15 2009 Marc Grimme <grimme@atix.de> 1.4-4el5
- XFiles patch and small patches ported to rhel5 first version.
* Fri Mar 27 2009 Marc Grimme <grimme@atix.de> 1.4-3el5
- Fixed a BUG with RHEL5 and gfs as rootfs
* Mon Feb 02 2009 Marc Grimme <grimme@atix.de> 1.3-12el5
- Bugfix in support for other filesystems
* Tue Nov 18 2008 Marc Grimme <grimme@atix.de> 1.3-11el5
- Support for glusterfs
* Tue Nov 18 2008 Marc Grimme <grimme@atix.de> 1.3-10el5
- Clean up of old repository caches (Bug #289)
* Tue Oct 14 2008 Marc Grimme <grimme@atix.de> 1.3-9el5
- Enhancement #273 and dependencies implemented (flexible boot of local fs systems)
* Tue Jun 24 2008 Mark Hlawatschek <hlawatschek@atix.de> 1.3.8
- changed kill level fro bootsr initscript
* Fri Jun 20 2008 Mark Hlawatschek <hlawatschek@atix.de> 1.3.7
- added patch for netfs and network
* Tue Jun 10 2008 Marc Grimme <grimme@atix.de> - 1.3-6
- rewrote reboot concept
* Wed Nov 28 2007 Mark Hlawatschek <hlawatschek@atix.de> 1.3.5
- Fixed BZ 150
* Tue Sep 25 2007 Mark Hlawatschek <hlawatschek@atix.de> 1.3.3
- create symlinks in /var/run
* Wed Sep 19 2007 Mark Hlawatschek <hlawatschek@atix.de> 1.3.2
- added file halt.patch
* Wed Sep 12 2007 Mark Hlawatschek <hlawatschek@atix.de> 1.3.1
- first revision
# ------
# $Log: comoonics-bootimage-initscripts-el5.spec,v $
# Revision 1.30 2011-02-28 14:27:42 marc
# new versions for halt.local as file
#
# Revision 1.29 2010/08/18 11:53:28 marc
# new versions
#
# Revision 1.28 2010/07/08 08:39:37 marc
# new versions
#
# Revision 1.27 2010/06/09 08:23:22 marc
# new versions
#
# Revision 1.26 2010/04/23 10:23:53 marc
# new versions
#
# Revision 1.25 2010/03/08 19:35:14 marc
# comoonics-4.6-rc1
#
# Revision 1.24 2010/02/07 20:35:13 marc
# - latest versions
#
# Revision 1.23 2009/08/11 12:17:10 marc
# new versions
#
# Revision 1.22 2009/04/20 07:21:22 marc
# RC1 version 10
#
# Revision 1.21 2009/04/14 15:03:33 marc
# new version
#
# Revision 1.20 2009/02/27 08:42:26 marc
# fixed bug with halt and localfilesystems
#
# Revision 1.19 2009/02/18 18:06:59 marc
# new version
#
# Revision 1.18 2009/02/04 09:22:18 marc
# changed rpm names.
#
# Revision 1.17 2009/02/04 09:17:43 marc
# added true to pre to make it updateable
#
# Revision 1.16 2009/02/03 16:32:46 marc
# new version
#
# Revision 1.15 2009/01/29 19:48:45 marc
# new version
#
# Revision 1.14 2008/12/05 16:12:58 marc
# First step to go rpmlint compat BUG#230
#
# Revision 1.13 2008/12/01 14:46:24 marc
# changed file attributes (Bug #290)
#
# Revision 1.12 2008/11/18 15:59:37 marc
# - implemented RFE-BUG 289 (level up/down)
#
# Revision 1.11 2008/10/14 10:57:07 marc
# Enhancement #273 and dependencies implemented (flexible boot of local fs systems)
#
# Revision 1.10 2008/08/14 14:41:08 marc
# removed listfiles
#
# Revision 1.9 2008/06/24 12:31:01 mark
# changed kill level fro bootsr initscript
#
# Revision 1.8 2008/06/23 22:13:57 mark
# new release
#
# Revision 1.7 2008/06/10 10:11:03 marc
# - new versions
#
# Revision 1.6 2007/12/07 16:39:59 reiner
# Added GPL license and changed ATIX GmbH to AG.
#
# Revision 1.5 2007/11/28 12:41:42 mark
# new release
#
# Revision 1.4 2007/10/05 14:09:53 mark
# new revision
#
# Revision 1.3 2007/09/26 11:55:51 mark
# new releases
#
# Revision 1.2 2007/09/21 15:34:51 mark
# new release
#
# Revision 1.1 2007/09/14 08:32:58 mark
# initial check in