Rate This Document
Findability
Accuracy
Completeness
Readability

Preparing the Environment

The operations vary according to the OS. Unless otherwise specified, the operations are the same in the two OSs.

CentOS 7.6

  1. Install the EPEL source.
    1
    yum install epel-release -y
    
  2. Install the software collection (SCL).
    1
    yum -y install centos-release-scl
    
  3. Modify the SCL Repo source.
    1
    vi /etc/yum.repos.d/CentOS-SCLo-scl.repo
    

    Add the following content:

    1
    baseurl=http://mirror.centos.org/altarch/7/sclo/$basearch/rh/
    
    Change http in the scl-rh Repo source to https.
    1
    vi /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
    

  4. Configure the Yum certificate verification.
    1
    vi /etc/yum.conf
    
    1
    2
    sslverify=false
    deltarpm=0
    
  5. Refresh the Yum cache.
    1
    yum clean all && yum makecache
    
  6. (Optional) Simulate and verify the GCC 7 compilation environment.
    The compilation requires GCC 7 or later. If the GCC version meets the requirement, skip this step. If not, run the following commands to simulate the GCC 7 environment.
    1
    2
    3
    yum -y install devtoolset-7
    scl enable devtoolset-7 bash
    gcc --version
    

    If the GCC version is 7.0 in the command output, the environment is successfully simulated.

openEuler 20.03

  1. Configure the local liboath source.
    1. Download the liboath source code and patch.
      1
      2
      3
      yum install git -y
      git config --global http.sslVerify false
      git clone https://gitee.com/src-openeuler/oath-toolkit.git
      
    2. Use Yum to install the dependencies required for the RPM package.
      1
      yum install wget rpmdevtools gtk-doc pam-devel xmlsec1-devel libtool libtool-ltdl-devel createrepo cmake -y
      
    3. Create an rpmbuild directory. Move the patch file and source package to the /root/rpmbuild/SOURCES directory.
      1
      2
      3
      4
      5
      rpmdev-setuptree
      cd oath-toolkit
      mv 0001-oath-toolkit-2.6.5-lockfile.patch /root/rpmbuild/SOURCES
      mv oath-toolkit-2.6.5.tar.gz /root/rpmbuild/SOURCES
      cp oath-toolkit.spec /root/rpmbuild/SPECS/
      
    4. Compile the RPM package.
      1
      rpmbuild -bb /root/rpmbuild/SPECS/oath-toolkit.spec
      
    5. Use the compiled RPM package as the local Yum source.
      1
      2
      3
      mkdir -p /home/oath
      cp -r /root/rpmbuild/RPMS/*  /home/oath/
      cd  /home/oath && createrepo .
      
    6. Configure the Repo file.
      1
      vi /etc/yum.repos.d/local.repo
      

      Add the following content to the file:

      1
      2
      3
      4
      5
      6
      [local-oath]
      name=local-oath
      baseurl=file:///home/oath
      enabled=1
      gpgcheck=0
      priority=1
      
  2. Edit the yum.conf file and set the Yum certificate verification status to false (no verification).
    1
    vi /etc/yum.conf
    

    Add the following content to the end of the file:

    1
    2
    sslverify=false
    deltarpm=0
    
  3. Configure the Huawei proxy to increase the download speed.
    1
    2
    mkdir -p ~/.pip
    vi ~/.pip/pip.conf
    

    Add the following content:

    1
    2
    3
    4
    [global]
    timeout = 120
    index-url =https://repo.huaweicloud.com/repository/pypi/simple
    trusted-host = repo.huaweicloud.com
    
  4. Download the Huawei image source Repo.
    1
    wget -O /etc/yum.repos.d/openEulerOS.repo https://repo.huaweicloud.com/repository/conf/openeuler_aarch64.repo
    
  5. Install the dependencies required for compiling the Ceph source code on the server.
    1
    yum install java-devel sharutils checkpolicy selinux-policy-devel gperf cryptsetup fuse-devel gperftools-devel libaio-devel libblkid-devel libcurl-devel libudev-devel libxml2-devel libuuid-devel ncurses-devel python-devel valgrind-devel xfsprogs-devel xmlstarlet yasm nss-devel libibverbs-devel openldap-devel CUnit-devel python2-Cython python3-setuptools python-prettytable lttng-ust-devel expat-devel junit boost-random keyutils-libs-devel openssl-devel libcap-ng-devel python-sphinx python2-sphinx python3-sphinx leveldb leveldb-devel snappy snappy-devel lz4 lz4-devel liboath liboath-devel libbabeltrace-devel librabbitmq librabbitmq-devel librdkafka librdkafka-devel libnl3 libnl3-devel rdma-core-devel numactl numactl-devel numactl-libs createrepo openldap-devel rdma-core-devel lz4-devel expat-devel lttng-ust-devel libbabeltrace-devel python3-Cython python2-Cython gperftools-devel bc dnf-plugins-core librabbitmq-devel rpm-build java-1.8.0-openjdk-devel -y
    
  6. Regenerate the rpmbuild directory in /home.
    1. Run the rpmbuild installation command.
      1
      rpmdev-setuptree
      
    2. Modify the .rpmmacros file.
      1
      vi /root/.rpmmacros
      

      Change %_topdir to /home/rpmbuild.

    3. Run the rpmbuild installation command again.
      1
      rpmdev-setuptree