Describes how to build and install the rpm package (CentOS 6.x or higher).
Preferences
Install the rpm-build package.
[root@bsr-01 bsr]# yum install rpm-build
It may require the following additional installations on CentOS 8:
[root@bsr-01 bsr]# dnf install kernel-rpm-macros kernel-abi-whitelists
Create the rpm build path.
[root@bsr-01 bsr]# mkdir /root/rpmbuild [root@bsr-01 bsr]# mkdir /root/rpmbuild/SOURCES
Kernel modules
make the rpm package
[root@bsr-01 bsr]# make kmp-rpm
When rpm build is completed, kmod-bsr rpm package is created in the following location.
... You have now: /root/rpmbuild/RPMS/x86_64/bsr-kernel-debuginfo-1.6.0-PREALPHA3.el6.x86_64.rpm /root/rpmbuild/RPMS/x86_64/kmod-bsr-1.6.0_2.6.32_754.24.3-PREALPHA3.el6.x86_64.rpm
Install with rpm command.
[root@bsr-01 bsr]# rpm -ivh /root/rpmbuild/RPMS/x86_64/kmod-bsr-1.6.0_2.6.32_754.24.3-PREALPHA3.el6.x86_64.rpm
Load the bsr module.
[root@bsr-01 bsr]# modprobe bsr
[root@bsr-01 bsr]# modinfo bsr filename: /lib/modules/2.6.32-754.24.3.el6.x86_64/extra/bsr/bsr.ko license: GPL alias: block-major-147-* license: GPL version: 1.6.0-PREALPHA3 description: bsr - Block Sync and Replication v1.6.0-PREALPHA3 author: Man Technology Inc. <dev3@mantech.co.kr> retpoline: Y srcversion: 8A7DAFDEC0E6383AFB76501 depends: libcrc32c vermagic: 2.6.32-754.24.3.el6.x86_64 SMP mod_unload modversions parm: minor_count:Approximate number of bsr devices (1-255) (uint) parm: disable_sendpage:bool parm: allow_oos:DONT USE! (bool) parm: use_fast_sync:bool parm: debug_fast_sync:bool parm: enable_faults:int parm: fault_rate:int parm: fault_count:int parm: fault_devs:int parm: two_phase_commit_fail:int parm: usermode_helper:string
When installing rpm, the default path of the module for bsr is /lib/modules/(kernel_version)/extra/bsr/bsr.ko. If the bsr module is already loaded from a different path, you must remove the loaded bsr module and re-create the dependencies.
(If the dependency is not regenerated, the previous path will be referenced when loading the module)
[root@localhost x86_64]# modinfo bsr filename: /lib/modules/2.6.32-754.24.3.el6.x86_64/updates/bsr.ko license: GPL alias: block-major-147-* license: GPL version: 1.6.0-PREALPHA3 description: bsr - Block Sync and Replication v1.6.0-PREALPHA3 author: Man Technology Inc. <dev3@mantech.co.kr> rhelversion: 8.1 srcversion: BFDF8D2F1E41F6A18478892 depends: libcrc32c name: bsr vermagic: 4.18.0-147.el8.x86_64 SMP mod_unload modversions parm: minor_count:Approximate number of bsr devices (1-255) (uint) parm: disable_sendpage:bool parm: allow_oos:DONT USE! (bool) parm: use_fast_sync:bool parm: debug_fast_sync:bool parm: enable_faults:int parm: fault_rate:int parm: fault_count:int parm: fault_devs:int parm: two_phase_commit_fail:int parm: usermode_helper:string
[root@localhost x86_64]# rmmod bsr
[root@localhost x86_64]# rm -rf /lib/modules/2.6.32-754.24.3.el6.x86_64/updates/bsr.ko
[root@localhost x86_64]# depmod -a
[root@localhost x86_64]# cat /lib/modules/2.6.32-754.24.3.el6.x86_64/modules.dep | grep bsr.ko
extra/bsr/bsr.ko: kernel/lib/libcrc32c.ko
[root@bsr-01 bsr]# modprobe bsr
UtilsĀ
Go to the bsr-utils path.
[root@bsr-01 bsr]# cd bsr-utils
Make the bsr-utils rpm.
CentOS 6
[root@bsr-01 bsr-utils]# ./autogen.sh [root@bsr-01 bsr-utils]# ./configure [root@bsr-01 bsr-utils]# make [root@bsr-01 bsr-utils]# make rpm RPMOPT="--without bsrmon --without manual --without xen"
CentOS 7/8
[root@bsr-01 bsr-utils]# ./autogen.sh [root@bsr-01 bsr-utils]# ./configure [root@bsr-01 bsr-utils]# make [root@bsr-01 bsr-utils]# make rpm RPMOPT="--without bsrmon --without manual --without xen --without sbinsymlinks"
When the rpm build is completed, the bsr-utils rpm package is created in the following path.
... You have now: /root/rpmbuild/RPMS/x86_64/bsr-1.6.0-PREALPHA3.el6.x86_64.rpm /root/rpmbuild/RPMS/x86_64/bsr-debuginfo-1.6.0-PREALPHA3.el6.x86_64.rpm /root/rpmbuild/RPMS/x86_64/bsr-bash-completion-1.6.0-PREALPHA3.el6.x86_64.rpm /root/rpmbuild/RPMS/x86_64/bsr-udev-1.6.0-PREALPHA3.el6.x86_64.rpm /root/rpmbuild/RPMS/x86_64/bsr-utils-1.6.0-PREALPHA3.el6.x86_64.rpm
Install with rpm command.
[root@bsr-01 x86_64]# rpm -ivh /root/rpmbuild/RPMS/x86_64/bsr-utils-1.6.0-PREALPHA3.el6.x86_64.rpm
[root@bsr-01 x86_64]# bsradm -V BSRADM_BUILDTAG=GIT-hash:\ e3fff1406638405bef558c540c2622b24fc4e5f4\ build\ by\ root@centos803\,\ 2020-03-09\ 02:02:01 BSRADM_API_VERSION=2 BSR_KERNEL_VERSION_CODE=0x000000 BSR_KERNEL_VERSION=0.0.0 BSRADM_VERSION_CODE=0x010600 BSRADM_VERSION=1.6.0-PREALPHA3