[DRBD-user] DRBD9 with CentOS 7 - install fails

Hiroshi Fujishima h-fujishima at sakura.ad.jp
Fri Nov 6 01:57:34 CET 2015

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


Hi,

Installing DRBD9 kmod package into CentOS 7 system fails with the
following error.

[root at drbd0 ~]# cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
[root at drbd0 ~]# git clone git://git.drbd.org/drbd-9.0.git
[root at drbd0 ~]# cd drbd-9.0
[root at drbd0 drbd-9.0]# gmake tarball kmp-rpm
[root at drbd0 drbd-9.0]# rpm -ivh /root/rpmbuild/RPMS/x86_64/kmod-drbd-9.0.0_3.10.0_229.20.1-3.el7.centos.x86_64.rpm
Preparing...                          ################################# [100%]
        file /lib/modules/3.10.0-229.20.1.el7.x86_64/modules.devname from install of kmod-drbd-9.0.0_3.10.0_229.20.1-3.el7.centos.x86_64 conflicts with file from package kernel-3.10.0-229.20.1.el7.x86_64
        file /lib/modules/3.10.0-229.20.1.el7.x86_64/modules.softdep from install of kmod-drbd-9.0.0_3.10.0_229.20.1-3.el7.centos.x86_64 conflicts with file from package kernel-3.10.0-229.20.1.el7.x86_64

I found the following description.

https://bugzilla.redhat.com/show_bug.cgi?id=1003267
| You need to add the following command to the install section in your spec file
| (after "make -C %{kernel_source $flavor} modules_install M=$PWD/obj/$flavor"):
| 
| # Cleanup unnecessary kernel-generated module dependency files.
| find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \;

the patch as below fixing the problem.

[root at drbd0 drbd-9.0]# git diff
diff --git a/drbd-kernel.spec b/drbd-kernel.spec
index 34b4efc..7e2fbd9 100644
--- a/drbd-kernel.spec
+++ b/drbd-kernel.spec
@@ -82,6 +82,8 @@ export INSTALL_MOD_DIR=extra/drbd
 for flavor in %flavors_to_build ; do
     make -C %{kernel_source $flavor} modules_install \
 	M=$PWD/obj/$flavor
+    # Cleanup unnecessary kernel-generated module dependency files.
+    find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \;
     kernelrelease=$(cat %{kernel_source $flavor}/include/config/kernel.release || make -s -C %{kernel_source $flavor} kernelrelease)
     mv obj/$flavor/.kernel.config.gz obj/k-config-$kernelrelease.gz
     mv obj/$flavor/Module.symvers ../../RPMS/Module.symvers.$kernelrelease.$flavor.%{_arch}

Regards.

--
Hiroshi Fujishima



More information about the drbd-user mailing list