Packaging
Describes how to build and install the rpm packages (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.
Install with rpm command.
Load the bsr module.
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.
Make the bsr-utils rpm.
CentOS 6
CentOS 7/8
When the rpm build is completed, the bsr-utils rpm package is created in the following path.
Install with rpm command.