Compiling Bcache
Preparing the Compilation Environment
- Check that the ISO image CentOS-7-aarch64-Everything-1810.iso is used for the installation.
- Check the OS version.
uname -a
An example output of the OS version:Linux localhost.localdomain 4.14.0-115.10.1.el7a.aarch64 #1 SMP Thu Nov 26 14:15:20 CST 2020 aarch64 aarch64 aarch64 GNU/Linux
- Check the GCC version.
gcc -v
The recommended GCC version is GCC 4.8.5 (the default version for CentOS 7.6).
An example output of the GCC version:Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/aarch64-redhat-linux/4.8.5/lto-wrapper Target: aarch64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-aarch64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-aarch64-redhat-linux/cloog-install --enable-gnu-indirect-function --build=aarch64-redhat-linux Thread model: posix gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC)
- Check that the kernel header file has been installed.
ls /usr/src/kernels/$(uname -r)
An example output of the header file information:arch block certs crypto drivers firmware fs include init ipc Kconfig kernel lib Makefile mm Module.symvers net samples scripts security sound System.map tools usr virt
Compiling the Source Code
- Download the source code of the smart prefetch bcache from the following link:
- Install the kernel development software package.
yum install kernel-devel-4.14.0-115.el7a.0.1
- Perform the compilation in the source code directory drivers/md/bcache.
make -C /lib/modules/4.14.0-115.el7a.0.1.aarch64/build M=$(pwd)
- Obtain the generated file bcache.ko.
Parent topic: Compiling and Installing Software