[DRBD-user] Re: New drbd .spec file for 0.6.10+

Lars Ellenberg Lars.Ellenberg at linbit.com
Wed Feb 4 14:27:40 CET 2004

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


/ 2004-02-04 11:29:41 +0100
\ Philipp Reisner:
> Hi List,
> 
> Most of the time I am working on debain based systems. ... 
> Maybe the people caring about the .spec file could stand up and
> form a kind of "drbd.spec file group" that will feed patches
> to me for inclusion into CVS and futher releases.
> 
> Maybe you can even find some ftp/http space (I could provide it
> on www.drbd.org as well) to upload prebuild packages for
> e.g. RedHat's and SuSE's distribution kernels... 
> 
> For debian it is already in place...
> http://www.drbd.org/download.html

> Sean Reifschneider wrote :
> >
> > I'm attaching a modified drbd.spec file here.  It's based on the one for
> > 0.6.10, but builds a second package, kernel-module-drbd.  This package
> > is named based on the kernel that it was built for:
> >
> >    kernel-module-drbd-0.6.10-1_2.4.24host.i386.rpm

Thanks.
Attached is the merge with my own changes, which already have been
in CVS.  I propose to remove drbd.spec, add drbd.spec.in,
and add this change to the CVS Makefile:

--- Makefile	22 Jan 2004 14:32:51 -0000	1.25
+++ Makefile	4 Feb 2004 13:08:56 -0000
@@ -89,9 +89,9 @@ rpm: tgz
 	[ -h dist/SOURCES/drbd-$(REL_VERSION).tar.gz ] || \
 	  $(LN_S) $(PWD)/drbd-$(REL_VERSION).tar.gz \
 	          $(PWD)/dist/SOURCES/drbd-$(REL_VERSION).tar.gz
-	if test drbd.spec -nt dist/SPECS/drbd.spec ; then \
+	if test drbd.spec.in -nt dist/SPECS/drbd.spec ; then \
 	   sed -e "s/^\(Version:\).*/\1 $(REL_VERSION)/;" \
-	       -e "s/^\(Packager:\).*/\1 $(USER)@$(HOSTNAME)/;" drbd.spec \
+	       -e "s/^\(Packager:\).*/\1 $(USER)@$(HOSTNAME)/;" < drbd.spec.in \
 	   > dist/SPECS/drbd.spec ; \
 	fi
 	$(RPMBUILD) -ba \

> > For example, the above module was built for kernel version "2.4.24host".
> > The base package keep their orignal naming, this only impacts the kernel
> > module.  This allows you to build multiple DRBD kernel driver RPMs, and
> > install them simultaneously.  The big benefit is that if up switch
> > kernel versions you don't have to "rpm -e drbd" then "rpm -i
> > drbd-*.rpm", then fix up the drbd.conf file that was munged while doing
> > this.

This has been addressed, too.

To test it with CVS:
cvs up
# patch -p0 < above-patchlet # if it is not already in cvs
# cp attachment drbd.spec.in # if it is not already in cvs
make rpm FORCE=1

	Lars Ellenberg
-------------- next part --------------
# "uname -r" output of the kernel to build for, the running one
# if none was specified with "--define 'kernelversion <uname -r>'"
%{!?kernelversion: %{expand: %%define kernelversion %(uname -r)}}

%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

Name: drbd
Summary: Distributed Redundant Block Device driver for Linux
Version: 
Release: 3
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 at linbit.com> - Primary Author
    Lars Ellenberg  <l.g.e at web.de>

%package -n kernel%{?ksmp}-module-drbd
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
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

%build
echo kernelversion=%{kernelversion}
echo kversion=%{kversion}
echo krelver=%{krelver}
mkdir -p %{buildroot}

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

%install
make PREFIX=%{buildroot}/ MANDIR=%{_mandir} install
cd documentation
mv HOWTO HOWTO.orig
mkdir HOWTO
cp -p HOWTO.orig/*.html HOWTO/
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:
find sbin/rcdrbd -printf "/%p\n" >> "$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
/etc/ha.d/resource.d/datadisk

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

%defattr(700,root,root)
%dir /var/lib/drbd

%defattr(-,root,root)
%{_mandir}/man8/datadisk.8.gz
%{_mandir}/man8/drbd.8.gz
%{_mandir}/man8/drbdsetup.8.gz
%{_mandir}/man5/drbd.conf.5.gz
%{_mandir}/ja/man8/datadisk.8.gz
%{_mandir}/ja/man8/drbd.8.gz
%{_mandir}/ja/man8/drbdsetup.8.gz
%{_mandir}/ja/man5/drbd.conf.5.gz
%{_mandir}/pt_BR/man8/datadisk.8.gz
%{_mandir}/pt_BR/man8/drbd.8.gz
%{_mandir}/pt_BR/man8/drbdsetup.8.gz
%{_mandir}/pt_BR/man5/drbd.conf.5.gz
%doc scripts/drbd.conf
%doc documentation/NFS-Server-README.txt
%doc documentation/drbd-article.html
%doc documentation/HOWTO
%doc COPYING
%doc README

%files -n kernel%{?ksmp}-module-drbd
%defattr(-,root,root)
/lib/modules/%{kernelversion}/

%post
uname -r | grep BOOT || /sbin/depmod -a > /dev/null 2>&1 || true

chkconfig --add drbd

%preun
service drbd stop

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
/sbin/depmod -a -F /boot/System.map-%{kernelversion} %{kernelversion} >/dev/null 2>&1 || true

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

%changelog
* Wed Feb  4 2004 Lars Ellenberg <Lars.Ellenberg at linbit.com> [0.6.10-3]
- merged Sean Reifschneiders changes with my own cahnges which already
  where in cvs

* Tue Feb  3 2004 Sean Reifschneider <jafo-rpms at tummy.com> [0.6.10-2]
- Moved DRBD driver out into "kernel-module-drbd" RPM.
- The kernel-module-drbd module has a release based on the kernel name,
  allowing one instance of kernel-module-drbd to be installed for each
  kernel on the box.
- Removed the "drbd.o.old" pre/post code.

* Wed Dec 12 2003 15:10:44 +0200 Philipp Reisner <phil at linbit.com>
- drbd (0.6.10-1)
- With 0.6.9 there was a bug introduced which prevented the sending 
  of ACK packets during resync. Fixed.
- A fix to drbdsetup's wait_connect command.
  Replaced all invocations of the sleep_on() family functions with the 
  invocations of the wait_event() macros. This removes lost wakup events 
  and race conditions.
- New implementation of drbd_wait_ee(). This makes the 
  "(BUG?) Moving bh=%p to done_ee" go away.
- Handle the case if vmalloc() of the bitmap fails.

* Wed Nov 26 2003 17:39:19 +0100 Philipp Reisner <phil at linbit.com>
- drbd (0.6.9-1)
- New module build system (using kernel source tree build system)
- New net section option 'ko-count'. It allows you to kick out a 
  secondary node which does no longer process data in acceptable time. 
  Its default value is 0 which disables this feature.
- Changing syncgroups while resync runs has shows now the correct behaviour.
- In case thread creations fails DRBD would deadlock on its own
  semaphore. Fixed now.
- BKL is no longer used on Linux-2.4.x.
- Now you can stack mapping block devices like LVM2 (and maybe md) on 
  top of drbd (a one character fix).
- drbdsetup wait_connect on a StandAlone node looked like a timeout and
  forced primary. fixed.
- if drbdsetup wait_* in fact did timeout this looked like a failed ioctl.
  this bug was newly introduced in 0.6.8. fixed.
- A fix to a race in _drbd_alloc_ee(). You could trigger this race if
  your filesystem uses a blocksize < 4K and your machine has multiple CPUs.
  By Eric W. Biederman.
- A maybe bugfix regarding calls to free_page() by Eric W. Biederman.
- A cleanup patch to drbd_process_done_ee() by Eric W. Biederman.

* Mon Oct 20 2003 11:43:00 +0100 Philipp Reisner <phil at linbit.com>
- drbd (0.6.8-1)
- Two fixes to the sync-group functionality.

* Mon Jul 28 2003 14:40:26 +0100 Philipp Reisner <phil at linbit.com>
- drbd (0.6.7-1)
- A fix to a bug that could cause data corruption if you use a 
  other blocksize than 4k to access the DRBD device.
- A fix to a SMP race in the syncer code. The problem was tirggered
  when using DRBD on QLogic fiber channel adapters.
- Replaced various calls to sleep_on() variants with the wait_event()
  macros. -- This removes potential (, non-critical) SMP races.
- This release includes the sync-group option.

* Mon Jul 28 2003 14:40:26 +0100 Philipp Reisner <phil at linbit.com>
- drbd (0.6.6-1)
- In the 0.6.5 release the secondary_remote command was badly broken,
  it succeeded when it should fail silently. This is fixed now.
- Probabely in all previous releases, the resyncer thread did not
  exit properly if the secondary node goes away during resync. 
  This was not fatal sind the resyncher thread did exit at soon
  as it gets a network error. This is fixed now.
- Some new switches to the drbd script.

* Sun Jul 06 2003 13:29:00 +0100 Philipp Reisner <phil at linbit.com>
- drbd (0.6.5-1)
- Improvements to the build system
- Now it is possible to tune the socket send buffer size via drbdsetup/
  drbd.conf. This is especially usefull for WAN mirroring / using
  protocol A.
- Compatibility code to compile DRBD under RedHat 9.0 (RH's version of
  Linux-2.4.20)
- Improved sample drbd.conf file

* Thu May 01 2003 21:00:00 +0100 Philipp Reisner <phil at linbit.com>
- drbd (0.6.4-1)
- Reworked build system (i.e. better Makefiles)
- SyncAll works forward instead of backwards. Improves performance on
  some storage controlers.
- Reworked /etc/init.d/drbd script (i.e. better support of
  different bash releases)

* Thu Mar 20 2003 20:23:40 +0100 Philipp Reisner <phil at linbit.com>
- drbd (0.6.3-1)
-  * Lockup of primary if secondary fails during resync. Fixed. (Stupid!)
-  * Probabely SMP only deadlock in the drop-conection code path.
-  * Improved connect code. (The old code could trap into a distributed
-    deadlock, resulting in an endless connect/disconnect loop.)
-  * The 'BitMap too small bug' was actually caused by a patch in
-    SuSE's distribution kernel. This patch makes DRBD 'more' compatible
-    with SuSE's kernel.
-  * Improved code to allocate buffers for the rsynchronisation process.
-    The old code allocated physical adjacent pages although the syncer
-    does not need them! The old code could fail under high memory pressure.

* Tue Feb 11 2003 15:58:49 +0100 Philipp Reisner <phil at linbit.com>
-  drbd (0.6.2-1)
-
-  * SMP fix in drbd_dio_end_sec()
-  * /etc/init.d/drbd knows about returncodes of fsck
-  * SUSE style rcdrbd
-  * Fixes for uninstall Target of the Makefiles.

* Thu Aug 15 2002 Omar Kilani <ok at mailcall.com.au>
- Do not chkconfig --del on an update.

* Wed Aug 14 2002 Omar Kilani <ok at mailcall.com.au>
- Initial revision (a very hacked up e1000.spec file)


More information about the drbd-user mailing list