2007-01-15 10:53:19 +01:00
|
|
|
#
|
2011-03-10 12:48:15 +01:00
|
|
|
# spec file for package drbd
|
2007-01-15 10:53:19 +01:00
|
|
|
#
|
2021-03-12 08:49:59 +01:00
|
|
|
# Copyright (c) 2021 SUSE LLC
|
2007-01-15 10:53:19 +01:00
|
|
|
#
|
2008-08-18 18:28:48 +02:00
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2019-09-10 09:54:08 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2007-01-15 10:53:19 +01:00
|
|
|
#
|
2015-07-25 07:44:30 +02:00
|
|
|
# needssslcertforbuild
|
|
|
|
|
2017-07-19 09:00:23 +02:00
|
|
|
|
2020-06-10 05:27:13 +02:00
|
|
|
# RT enabled in Leap15.2(but not in Tumbleweed)
|
|
|
|
%if ! 0%{?is_opensuse} || 0%{?sle_version} >= 150200
|
2015-07-25 07:44:30 +02:00
|
|
|
%ifarch x86_64
|
2018-02-11 11:03:24 +01:00
|
|
|
%define buildrt 1
|
2015-07-25 07:44:30 +02:00
|
|
|
%endif
|
2016-12-06 11:22:12 +01:00
|
|
|
%endif
|
2007-01-15 10:53:19 +01:00
|
|
|
Name: drbd
|
2021-11-22 07:59:49 +01:00
|
|
|
Version: 9.0.30~1+git.8e9c0812
|
2015-07-25 07:44:30 +02:00
|
|
|
Release: 0
|
2019-09-10 09:54:08 +02:00
|
|
|
Summary: Linux driver for the "Distributed Replicated Block Device"
|
|
|
|
License: GPL-2.0-or-later
|
|
|
|
URL: https://drbd.linbit.com/
|
2016-04-13 14:42:42 +02:00
|
|
|
Source: %{name}-%{version}.tar.bz2
|
2015-07-25 07:44:30 +02:00
|
|
|
Source1: preamble
|
2015-08-19 11:34:13 +02:00
|
|
|
#In kernel is: kernel/drivers/block/drbd/drbd.ko
|
2015-07-25 07:44:30 +02:00
|
|
|
Source2: Module.supported
|
2016-04-13 14:42:42 +02:00
|
|
|
Source3: drbd_git_revision
|
2017-03-29 10:55:06 +02:00
|
|
|
Patch1: fix-resync-finished-with-syncs-have-bits-set.patch
|
2022-07-09 02:28:28 +02:00
|
|
|
Patch2: bsc-1192929_01-make_block_holder_optional.patch
|
|
|
|
Patch3: bsc-1192929_02-move_kvmalloc_related_to_slab.patch
|
|
|
|
Patch4: bsc-1192929_03-polling_to_bio_base.patch
|
|
|
|
Patch5: bsc-1192929_04-pass_gend_to_blk_queue_update_readahead.patch
|
2023-01-06 09:38:53 +01:00
|
|
|
Patch6: bsc-1192929_07-add_disk_error_handle.patch
|
|
|
|
Patch7: bsc-1192929_08-have_void_drbd_submit_bio.patch
|
|
|
|
Patch8: bsc-1192929_09-remove_bdgrab.patch
|
|
|
|
Patch9: bsc-1201335_01-compat-test-and-cocci-patch-for-bdi-in-gendisk.patch
|
|
|
|
Patch10: bsc-1201335_02-compat-only-apply-bdi-pointer-patch-if-bdi-is-in-req.patch
|
|
|
|
Patch11: bsc-1201335_03-genhd.patch
|
|
|
|
Patch12: bsc-1201335_04-bio_alloc_bioset.patch
|
|
|
|
Patch13: bsc-1201335_05-bio_alloc.patch
|
|
|
|
Patch14: bsc-1201335_06-bdi.patch
|
|
|
|
Patch15: bsc-1201335_07-write-same.patch
|
|
|
|
Patch16: bsc-1201335_08-bio_clone_fast.patch
|
|
|
|
Patch17: bsc-1202600_01-remove-QUEUE_FLAG_DISCARD.patch
|
|
|
|
Patch18: bsc-1202600_02-dax-introduce-DAX_RECOVERY_WRITE-dax-access-mode.patch
|
|
|
|
Patch19: bsc-1202600_03-block-decouple-REQ_OP_SECURE_ERASE-from-REQ_OP_DISCA.patch
|
|
|
|
Patch20: bsc-1202600_04-remove-assign_p_sizes_qlim.patch
|
|
|
|
Patch21: bsc-1204596_01-block-remove-blk_cleanup_disk.patch
|
|
|
|
Patch22: bsc-1204596_02-drbd-remove-usage-of-bdevname.patch
|
|
|
|
Patch23: bsc-1206791-01-drbd-add-comments-explaining-removal-of-bdi-congesti.patch
|
|
|
|
Patch24: bsc-1206791-02-drbd-fix-static-analysis-warnings.patch
|
|
|
|
Patch25: bsc-1206791-03-drbd-fix-warning-about-initializing-multiple-struct-.patch
|
|
|
|
Patch26: bsc-1206791-04-blk_queue_split__no_present.patch
|
|
|
|
Patch27: bsc-1206791-05-prandom_u32_max.patch
|
|
|
|
Patch28: bsc-1206791-06-write_zeroes__no_capable.patch
|
|
|
|
Patch29: bsc-1206791-07-drbd-fix-use-after-free-bugs-in-get_initial_state.patch
|
|
|
|
Patch30: bsc-1206791-08-lib-lru_cache-Fixed-array-overflow-caused-by-incorre.patch
|
|
|
|
Patch31: bsc-1206791-09-pmem-use-fs_dax_get_by_bdev-instead-of-dax_get_by_ho.patch
|
2020-02-25 10:53:38 +01:00
|
|
|
Patch99: suse-coccinelle.patch
|
2019-09-23 08:02:25 +02:00
|
|
|
#https://github.com/openSUSE/rpmlint-checks/blob/master/KMPPolicyCheck.py
|
2020-02-25 10:53:38 +01:00
|
|
|
BuildRequires: coccinelle >= 1.0.8
|
2015-07-25 07:44:30 +02:00
|
|
|
BuildRequires: kernel-source
|
|
|
|
BuildRequires: kernel-syms
|
2017-11-17 04:55:51 +01:00
|
|
|
BuildRequires: libelf-devel
|
2019-09-10 09:54:08 +02:00
|
|
|
BuildRequires: modutils
|
2022-12-06 00:39:53 +01:00
|
|
|
BuildRequires: %kernel_module_package_buildreqs
|
2017-12-28 10:53:16 +01:00
|
|
|
Requires: drbd-utils >= 9.2.0
|
|
|
|
Supplements: drbd-utils >= 9.2.0
|
2015-07-29 03:10:03 +02:00
|
|
|
Obsoletes: drbd-kmp < %{version}
|
2015-07-25 07:44:30 +02:00
|
|
|
ExcludeArch: i586 s390
|
2016-10-26 05:56:30 +02:00
|
|
|
%kernel_module_package -n drbd -p %{_sourcedir}/preamble
|
|
|
|
%if 0%{?buildrt} == 1
|
|
|
|
BuildRequires: kernel-source-rt
|
|
|
|
BuildRequires: kernel-syms-rt
|
|
|
|
%endif
|
2007-01-15 10:53:19 +01:00
|
|
|
|
|
|
|
%description
|
2019-09-10 09:54:08 +02:00
|
|
|
DRBD is a distributed replicated block device. It mirrors a block
|
2015-07-29 03:10:03 +02:00
|
|
|
device over the network to another machine. Think of it as networked
|
|
|
|
raid 1. It is a building block for setting up clusters.
|
|
|
|
|
|
|
|
%package KMP
|
2019-09-09 10:04:57 +02:00
|
|
|
Summary: Kernel driver
|
2019-09-23 08:02:25 +02:00
|
|
|
URL: http://drbd.linbit.com/
|
2015-07-29 03:10:03 +02:00
|
|
|
|
|
|
|
%description KMP
|
2016-10-26 05:56:30 +02:00
|
|
|
This module is the kernel-dependent driver for DRBD. This is split out so
|
2015-07-25 07:44:30 +02:00
|
|
|
that multiple kernel driver versions can be installed, one for each
|
|
|
|
installed kernel.
|
2007-01-15 10:53:19 +01:00
|
|
|
|
|
|
|
%prep
|
2015-07-25 07:44:30 +02:00
|
|
|
%setup -q -n drbd-%{version}
|
2017-03-29 10:55:06 +02:00
|
|
|
%patch1 -p1
|
2021-07-26 08:16:08 +02:00
|
|
|
%patch2 -p1
|
2021-11-22 07:59:49 +01:00
|
|
|
%patch3 -p1
|
|
|
|
%patch4 -p1
|
|
|
|
%patch5 -p1
|
2023-01-06 09:38:53 +01:00
|
|
|
%patch6 -p1
|
2021-11-22 07:59:49 +01:00
|
|
|
%patch7 -p1
|
|
|
|
%patch8 -p1
|
|
|
|
%patch9 -p1
|
|
|
|
%patch10 -p1
|
2022-07-09 02:28:28 +02:00
|
|
|
%patch11 -p1
|
|
|
|
%patch12 -p1
|
|
|
|
%patch13 -p1
|
|
|
|
%patch14 -p1
|
|
|
|
%patch15 -p1
|
|
|
|
%patch16 -p1
|
|
|
|
%patch17 -p1
|
|
|
|
%patch18 -p1
|
2022-08-23 03:12:22 +02:00
|
|
|
%patch19 -p1
|
|
|
|
%patch20 -p1
|
|
|
|
%patch21 -p1
|
|
|
|
%patch22 -p1
|
2022-10-22 15:07:59 +02:00
|
|
|
%patch23 -p1
|
|
|
|
%patch24 -p1
|
2023-01-05 14:24:33 +01:00
|
|
|
%patch25 -p1
|
|
|
|
%patch26 -p1
|
|
|
|
%patch27 -p1
|
|
|
|
%patch28 -p1
|
|
|
|
%patch29 -p1
|
|
|
|
%patch30 -p1
|
|
|
|
%patch31 -p1
|
2020-02-25 10:53:38 +01:00
|
|
|
%patch99 -p1
|
2016-04-13 14:42:42 +02:00
|
|
|
|
|
|
|
mkdir source
|
|
|
|
cp -a drbd/. source/. || :
|
|
|
|
cp $RPM_SOURCE_DIR/drbd_git_revision source/.drbd_git_revision
|
2007-01-15 10:53:19 +01:00
|
|
|
|
|
|
|
%build
|
2015-07-25 07:44:30 +02:00
|
|
|
rm -rf obj
|
|
|
|
mkdir obj
|
|
|
|
ln -s ../scripts obj/
|
|
|
|
|
2017-07-19 09:00:23 +02:00
|
|
|
export WANT_DRBD_REPRODUCIBLE_BUILD=1
|
2016-04-13 14:42:42 +02:00
|
|
|
export CONFIG_BLK_DEV_DRBD=m
|
|
|
|
export EXTRA_CFLAGS='-DVERSION=\"%{version}\"'
|
2019-10-11 05:26:45 +02:00
|
|
|
# Unset SPAAS or set as 'true' will use `spatch-as-a-service` from drbd.io
|
|
|
|
# when "coccinelle" not installed. Set SPAAS to 'false' to force an ERROR.
|
|
|
|
export SPAAS='false'
|
2016-04-13 14:42:42 +02:00
|
|
|
|
2016-10-26 05:56:30 +02:00
|
|
|
for flavor in %{flavors_to_build}; do
|
2016-04-13 14:42:42 +02:00
|
|
|
rm -rf $flavor
|
2020-03-11 04:00:26 +01:00
|
|
|
cp -a -r source $flavor
|
|
|
|
cp -a %{_sourcedir}/Module.supported $flavor
|
2016-04-13 14:42:42 +02:00
|
|
|
export DRBDSRC="$PWD/obj/$flavor"
|
2020-01-09 07:05:38 +01:00
|
|
|
# bsc#1160194, check the coccicheck work.
|
|
|
|
#make coccicheck
|
2019-10-11 05:26:45 +02:00
|
|
|
make %{?_smp_mflags} -C %{kernel_source $flavor} modules M=$PWD/$flavor SPAAS=${SPAAS}
|
2019-09-09 10:04:57 +02:00
|
|
|
|
2020-01-09 07:05:38 +01:00
|
|
|
# Check the compat result
|
2018-11-21 09:55:22 +01:00
|
|
|
cat $PWD/$flavor/compat.h
|
2015-07-25 07:44:30 +02:00
|
|
|
done
|
2007-01-15 10:53:19 +01:00
|
|
|
|
|
|
|
%install
|
2015-07-25 07:44:30 +02:00
|
|
|
export INSTALL_MOD_PATH=%{buildroot}
|
|
|
|
export INSTALL_MOD_DIR=updates
|
2016-04-13 14:42:42 +02:00
|
|
|
for flavor in %{flavors_to_build}; do
|
|
|
|
make -C %{kernel_source $flavor} modules_install M=$PWD/$flavor
|
2015-07-25 07:44:30 +02:00
|
|
|
done
|
|
|
|
|
2015-09-28 04:50:59 +02:00
|
|
|
mkdir -p %{buildroot}/%{_sbindir}
|
2022-08-23 03:12:22 +02:00
|
|
|
ln -s service %{buildroot}/%{_sbindir}/rc%{name}
|
2015-07-25 07:44:30 +02:00
|
|
|
rm -f drbd.conf
|
|
|
|
|
|
|
|
%files
|
2019-09-23 08:02:25 +02:00
|
|
|
%license COPYING
|
2010-04-16 00:07:17 +02:00
|
|
|
%doc ChangeLog
|
2015-09-28 04:50:59 +02:00
|
|
|
%{_sbindir}/rc%{name}
|
2007-01-15 10:53:19 +01:00
|
|
|
|
2007-03-30 02:32:51 +02:00
|
|
|
%changelog
|