File: drbd.spec.in

package info (click to toggle)
drbd 0.7.10-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,324 kB
  • ctags: 1,787
  • sloc: ansic: 14,123; perl: 2,344; sh: 1,686; makefile: 593; yacc: 426
file content (346 lines) | stat: -rw-r--r-- 13,585 bytes parent folder | download
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
# "uname -r" output of the kernel to build for, the running one
# if none was specified with "--define 'kernelversion <uname -r>'"
# PLEASE: provide both (correctly) or none!!
%{!?kernelversion: %{expand: %%define kernelversion %(uname -r)}}
%{!?kdir: %{expand: %%define kdir /lib/modules/%(uname -r)/build}}

#
# this results in strange names for e.g. smp4G, psmp,
# -smp-lge or whatnot.
#-- 
# %define kversion %(echo %{kernelversion} | sed -e s/smp// -)
# %define krelver  %(echo %{kversion} | tr -s '-' '_')
# %if %(echo %{kernelversion} | grep -c smp)
#   %{expand:%%define ksmp -smp}
# %endif
#-- 
# so I choose to have it thus:
%define krelver  %(echo %{kernelversion} | tr -s '-' '_')

Name: drbd
Summary: Distributed Redundant Block Device driver for Linux
Version: 
Release: 1
Source: %{name}-%{version}.tar.gz
Vendor: DRBD 
License: GPL
ExclusiveOS: linux
Group: System Environment/Kernel
Packager: 
Requires: kernel
Provides: %{name}
URL: http://www.drbd.org/ 
BuildRoot: %{_tmppath}/%{name}-%{version}-root

%description
Drbd is a distributed replicated block device. It mirrors a
block device over the network to another machine. Think of it
as networked raid 1. It is a building block for setting up
high availability (HA) clusters.

Authors:
--------
    Philipp Reisner <philipp.reisner@linbit.com>
    Lars Ellenberg  <l.g.e@web.de>

#%package -n kernel%{?ksmp}-module-drbd
# I choose to have the kernelversion as part of the package name!
# drbd is prepended...
%package km-%{krelver}
Summary: Kernel driver for DRBD.
#Release: %{release}_%{krelver}
Group: System Environment/Kernel
Requires: %{name} = %{version}, /sbin/depmod
#%{?ksmp:Provides: kernel-module-drbd = %{version}-%{release}_%{krelver}}

#%description -n kernel%{?ksmp}-module-drbd
%description km-%{krelver}
This module is the kernel-dependant driver for DRBD.  This is split out so
that multiple kernel driver versions can be installed, one for each
installed kernel.

%prep
%setup
test -d %{kdir}/.
test $(echo -e "#include <linux/version.h>\ndrbd_kernel_release UTS_RELEASE" |
       gcc -nostdinc -E -P -I%{kdir}/include - |
       sed -ne 's/^drbd_kernel_release "\(.*\)".*/\1/p') = %{kernelversion}

%build
echo kernelversion=%{kernelversion}
echo kversion=%{kversion}
echo krelver=%{krelver}
[ -n $RPM_BUILD_ROOT -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
mkdir -p %{buildroot}

make clean
# note: MANDIR is not used anywhere in the makefiles
#       maybe this should be changed
make all doc PREFIX=%{buildroot}/ MANDIR=%{_mandir} KDIR=%{kdir}

%install
make install PREFIX=%{buildroot}/ MANDIR=%{_mandir}
cd drbd
mv .kernel.config.gz k-config-%{kernelversion}.gz

FILELIST="%{_builddir}/%{name}-%{version}/file.list"
cd %{buildroot}
#
# this is because /etc/init.d != /etc/rc.d != /etc/rc.d/init.d ...
# you may want to edit this, or the file list below ;)
#
find etc/ -name drbd -printf "/%p\n" > "$FILELIST"
# on suse/united we have additionally:
test -e sbin/rcdrbd && echo "/sbin/rcdrbd" >> "$FILELIST"

## If I only wanted to include the module, not all the directories
## I'd then say  %files -n kernel%{?ksmp}-module-drbd -f $FILELIST.mod below
#find lib/ -name "drbd.*" -printf "/%p\n" > "$FILELIST.mod"

#
# and I only want to install a hint to the example conf
#
cat <<___ > etc/drbd.conf
#
# please have a a look at the example configuration file in
# %{_docdir}/drbd.conf
#
___

%clean
[ -n $RPM_BUILD_ROOT -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

%files -f %{_builddir}/%{name}-%{version}/file.list
%defattr(755,root,root)
/sbin/drbdsetup
/sbin/drbdadm
/etc/ha.d/resource.d/drbddisk

%defattr(644,root,root)
%config(noreplace) /etc/drbd.conf

%defattr(-,root,root)
%{_mandir}/man8/drbd.8.gz
%{_mandir}/man8/drbdsetup.8.gz
%{_mandir}/man8/drbdadm.8.gz
%{_mandir}/man5/drbd.conf.5.gz
%doc scripts/drbd.conf
%doc documentation/NFS-Server-README.txt
%doc COPYING
%doc README
%doc file.list

#%files -n kernel%{?ksmp}-module-drbd
%files km-%{krelver}
%defattr(-,root,root)
/lib/modules/%{kernelversion}/
%doc drbd/k-config-%{kernelversion}.gz

%post
chkconfig --add drbd

for i in `seq 0 15` ; do 
    test -b /dev/drbd$i || mknod -m 0660 /dev/drbd$i b 147 $i; 
done


%preun
if type -p service ; then
	service drbd stop
fi
if type -p rcdrbd ; then
	rcdrbd stop
fi

lsmod | grep drbd > /dev/null 2>&1
if [ $? -eq 0 ]; then
	rmmod drbd
fi

if [ $1 -eq 0 ]; then
	chkconfig --del drbd
fi

#%post -n kernel%{?ksmp}-module-drbd
%post km-%{krelver}
uname -r | grep BOOT ||
/sbin/depmod -a -F /boot/System.map-%{kernelversion} %{kernelversion} >/dev/null 2>&1 || true

#%postun -n kernel%{?ksmp}-module-drbd
%postun km-%{krelver}
/sbin/depmod -a -F /boot/System.map-%{kernelversion} %{kernelversion} >/dev/null 2>&1 || true

%changelog
* Mon Jan 31 2005 10:17:00 +0200 Philipp Reisner <phil@linbit.com>
- drbd (0.7.10-1)
 * 0.7.9 had a memory corruption bug and memory leakage (BIOs).
   This time I did the clone_bio() fix myself, and this release is
   supposed to work with SLES9 SP1, Linux-2.6.11 and Linux-2.6.12.

* Tue Jan 25 2005 11:31:00 +0200 Philipp Reisner <phil@linbit.com>
- drbd (0.7.9-1)
 * A fix that makes DRBD work on SLES9 SP1 kernel, and 
   probabely will be also necessary for Linux-2.6.11

* Mon Jan 17 2005 12:55:01 +0200 Philipp Reisner <phil@linbit.com>
- drbd (0.7.8-1)
  * Fixed a bug that caused the syncer to starve on devices 
    bigger than 2 TB on 32bit systems (=CONFIG_LBA).
  * Made online resizing actually work. Now it makes a lot
    more sense to put DRBD on top of LVM.
  * Made the user dialog to work on RedHat based distributions.
  * A small optimization that improves the performance of the 
    syncer when woking with IBM's ServRaid Controllers (ips).
    May have a positive effect with other Controllers as well.
  * Made epoch_size atomic. This removes a SMP race condition that
    could lead on some Xeon CPUs to an ASSERT printk, but did no other
    harm than printing messages to the syslog
  * Fixed write_gc.pl to work with the perl version delivered
    with RHAS3.
  * Made the initscript to abort if one of the setup commands fails.

* Tue Dec 15 2004 15:50:00 +0200 Philipp Reisner <phil@linbit.com>
- drbd (0.7.7-1)
  * "drbdadm adjust [res...]" now does the calls to drbdsetup 
    in an improved order, first the disk config of all devices,
    then the syncer and net config last. With the old scheme
    drbdadm run in a timeout when setting up more than about 
    6 devices at once (startup script...).
  * New progress indication in the startup script.
  * Bugfix to a race that could cause a OOPS on a BUG() macro
    in mod_timer while starting resync. The more devices you have 
    the higher the probability to hit this race condition.
  * Fixed a bug in the sync-groups conde, that only showed up
    when you have more than 4 resources in your config. 
    The resync process was continued too early on the node in
    SyncTarget state.
  * Fixed a stupid typo in the range-check code, that was intoduced
    in 0.7.6. Drbdsetup allowed "max-buffers" to be in the range 
    from 32 to 32.
  * Makefiles are gcc-2.95 compatible again.

* Tue Nov 16 2004 14:59:00 +0200 Philipp Reisner <phil@linbit.com>
- drbd (0.7.6-1)
  * Fixed bug that could cause a lockup of the receiver and
    asender threads, the visible outcome was that the syncer
    starves.
  * Fixed a bug that under specific circumstandes caused that the
    SyncSource node did not recognised that a resync process was
    finished.
  * "drbdadm invalidate [res]" was not working correct, while
    "drbdadm invalidate_remote [res]" works. Fixed the former.
  * Make DRBD work on Linux-2.6.10-rc2 and newer: Replaced
    sock_alloc() by sock_create(), replaced TASK_ZOMBIE by 
    EXIT_ZOMBIE.
  * Range checks in drbdadm for all numeric configure parameters.
  * A fix to make ioctl()s work on machines with 64bit kernel space 
    and 32bit user space. 
  * Ioctl()s are only allowed if the caller has CAP_SYS_ADMIN set.
  * Removal of warnings on 64bit architectures.
  * Backport of find_first_bit() for x86_64 aka AMD64 for use on 
    that architecture under Linux-2.4.x
  * Changed drbdadm to do the syncer config before the net config.
  * Changed the way drbdadm determines the minor_count parameter for
    module loading.
  * Improvements to the drbddisk script, to do the right thing
    in case Heartbeat is configured with a small timeout than DRBD.
  * On request of the debian package maintainers, the debian directory
    from SVN is not longer included in the tar.gz releases.

* Fri Oct 1 2004 11:33:00 +0200 Philipp Reisner <phil@linbit.com>
- drbd (0.7.5-1)
  * Fix a bug that could case read requests to return wrong data
    on a node in Primary/SyncTaget state. (A very unlikely race,
    it is not known that this ever triggered; It was found by an 
    ASSERTION in the code)
  * Removed the 30MB/sec speeding limit for the syncer. (this was 
    intended as a debugging aid, but it was not removed in time)
  * A fix to drbdsetup, to make drbdadm adjust work if a resource
    is diskless.
  * Got rid of the compiler warning when build on a kernel with
    CONFIG_LBD not set.
  * Now the device nodes are created with sane permissions.
  * The debian package is now named "drbd0.7"
  * set_fs() is now also done for sendpage()
  * Better compatibility with early 2.4.x kernels (BH_Launder, min()/max())
  * Touch /var/lock/subsys/drbd, needed for RedHat based distros.
  * Improvements to the INSALL document
  * Removed HOWTO, ja, pt_BR ... all hopelessly outdated.
    disabled benchmark/run.sh

* Thu Sep 9 2004 19:50:00 +0200 Philipp Reisner <phil@linbit.com>
- drbd (0.7.4-1)
  * Fixed a critical bug with Linux-2.4.x and HIGHMEM!
  * Fixed a bug that only showed up with the HIGHMEM problem on 
    Linux-2.4.x -> It caused the resync process to starve.
  * The drbd.spec file now creates /dev/drbd in the post-install stage.
  * Fixed support for more than 2TB storage. Now DRBD supports up to
    3.99TB storage. It will also tell you, that it is not supported if 
    you try to set up a bigger device.
  * Debian's build rules file now knows about the adjust_drbd_config_h.sh
    file.
  * DRBD_DISABLE_SENDPAGE available in drbd_config.h

* Fri Aug 27 2004 15:02:00 +0200 Philipp Reisner <phil@linbit.com>
- drbd (0.7.3-1)
  * Fixed minor bugs in the handling of the generation counters.
  * prevent possible in-kernel buffer overflow in drbd_proc.c
  * Fixed debian's postinst script to create /dev/drbd? instead of /dev/nb?
  * drbd status:
    be nice to heartbeat, include "OK" in output.
  * added FullSync meta data flag to read/write gc.pl
  * make the RHEL3 happy (page_count no longer in mm.h, but in mm_inline.h)
  * [Patch by Pavel Semerad]. Also use the drbd_devfs_name on Linux-2.4.x
  * fix missing dependencies on drbd_config.h

* Fri Aug 06 2004 14:44:31 +0200 Philipp Reisner <phil@linbit.com>
- drbd (0.7.2-1)
  * Proper handling of backing storage devices that occasionally fail 
    READA (=read ahead) requests. (E.g. LVM and MD)
  * DRBD now fails READA requests itself, if a resynchronisation is running
    and it would need to fetch the block from its peer.
  * "drbdadm adjust" had a race, which caused random errors. ( Missing
    waitpid() ). Fixed now.
  * Proper subtract SyncPause times from the syncer performance numbers.
  * Fix to the syncer progress bar in /proc/drbd.
  * Fix to debian build rules.

* Fri Jul 30 2004 13:50:38 +0200 Philipp Reisner <phil@linbit.com>
- drbd (0.7.1-1)
  * Upgrade instructions for 0.6.x -> 0.7.0 and 0.7.0 -> 0.7.1
  * Workaround for XFS' IO requests with page count of zero.
  * Handle the human and the timeout count correctly in the new init script.
  * The implementation of the incon-degr-cmd was missing, added.
  * Fix for integer overflow in /proc/drbd syncer progress display
  * Longer timeouts in drbdadm for drbdsetup commands witch operate on 
    meta data.
  * New major number 147 (officially registered at lanana.org).
  * Added a missing w_resume_next_wg() in case we stop syncing because
    of connection loss.
  * Fixed a Linux-2.2-ismus in recieve_data_tail(). Should considerably
    speed up protocols A and B.
  * Some work on vendor kernel compatibility

* Mon Jul 26 2004 18:39:38 +0200 Lars Ellenberg <l.g.e@web.de>
- update to SVN revision http://svn.drbd.org/drbd/trunk@1456
- drbd (0.7.0-1)
  Drbd-0.7 was actually forked off from drbd-0.6.1 (actually -pre18). 
  * Complete new way of doing resynchronisation. Does no longer need
    to do tricks with the nice value, and delivers very good performace.
  * Decoupling of role assignment (primary/secondary) from the direction
    of resynchronisation. (Necessary for primary/primary)
  * All "ack" and "ping" packets now go through the msock. 
    (Prerequisite for primary/primary)
  * Reworked a lot of internals to work with sector_t instead of
    blocknumbers. DRBD works now with XFS, and will be complete
    immune to changes in the block size.
  * Reworked the tl_ code, the user no longer has to specify the size
    for a preallocated transfer-log.
  * Improved metadata; Ao the device size is now stored in metadata,
    users no longer need to configure it.
  * Online resizing via "drbdsetup resize"
  * Resynchronisation groups "drbdsetup syncer -g"
  * New (very short!) sys-v init scripts, new userland tool "drbdadm"
  * Changes to the way we allocate memory. We want to survive hard OOM
    situations. (partially done, partially ongoing work) 
  * Implemented the Activity-Log and the persistent bitmap.