Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

rpm 패키지를 빌드하고 설치하는 방법에 대해 설명합니다.Describes how to build and install the rpm package (CentOS 6.x 이상or higher).

...

Preferences

  • Install the rpm-build 패키지를 설치 합니다package.

Code Block
[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

  • rpm 빌드 경로를 생성합니다Create the rpm build path.

Code Block
[root@bsr-01 bsr]# mkdir /root/rpmbuild 
[root@bsr-01 bsr]# mkdir /root/rpmbuild/SOURCES

...

Kernel modules

  • rpm 을 생성 합니다.make the rpm package

Code Block
[root@bsr-01 bsr]#  make kmp-rpm
  • rpm 빌드가 완료되면 다음과 같은 위치에 When rpm build is completed, kmod-bsr rpm 패키지가 생성 됩니다package is created in the following location.

Code Block
...
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.

Code Block
[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.

Code Block
[root@bsr-01 bsr]# modprobe bsr
Code Block
[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

rpm 설치 시 bsr의 모듈 기본 경로는 When installing rpm, the default path of the module for bsr is /lib/modules/(kernel_version)/extra/bsr/bsr.ko 입니다. 만약 이미 다른 경로로 부터 bsr 모듈이 적재된 경우 로드된 bsr 모듈을 제거하고 의존성을 재 생성해야 합니다.(의존성을 재 생성하지 않으면 모듈 적재 시 이전 경로를 참조하게 됩니다. 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.

Code Block
[root@bsr-01 bsr]# cd bsr-utils
  • Make the bsr-utils rpm을 생성합니다rpm.

    • CentOS 6

      • Code Block
        [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

      • Code Block
        [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"

  • rpm 빌드가 완료되면 다음 경로에 When the rpm build is completed, the bsr-utils rpm 패키지가 생성 됩니다package is created in the following path.

Code Block
... 
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.

Code Block
[root@bsr-01 x86_64]# rpm -ivh /root/rpmbuild/RPMS/x86_64/bsr-utils-1.6.0-PREALPHA3.el6.x86_64.rpm

...