RTFM

[Read This Fine Material] from Joshua Hoblitt

How to build GPFS 3.5.0 Linux/RHEL kernel packages

| 0 comments

First, check that the RHEL/EL kernel package and GPFS release is a supported combination.

# uname -r
2.6.32-504.1.3.el6.x86_64

GPFS Frequently Asked Questions and Answers: What are the latest kernel levels that GPFS has been tested with?

Install the toolchain required to build kernel packages.

yum groupinstall -y "Development tools"
yum install -y imake kernel-devel kernel-headers

Sanity check that the kernel and kernel development packages have matching revision numbers.

# rpm -q kernel kernel-devel kernel-headers
kernel-2.6.32-431.el6.x86_64
kernel-2.6.32-504.1.3.el6.x86_64
kernel-devel-2.6.32-431.el6.x86_64
kernel-headers-2.6.32-431.el6.x86_64
#  yum upgrade -y --disableexcludes=all kernel-devel-`uname -r` kernel-headers-`uname -r`
Loaded plugins: priorities, security, upgrade-helper
6772 packages excluded due to repository priority protections
Setting up Upgrade Process
Resolving Dependencies
--> Running transaction check
---> Package kernel-devel.x86_64 0:2.6.32-504.1.3.el6 will be installed
---> Package kernel-headers.x86_64 0:2.6.32-431.el6 will be updated
---> Package kernel-headers.x86_64 0:2.6.32-504.1.3.el6 will be an update
--> Finished Dependency Resolution
...
# rpm -q kernel kernel-devel kernel-headers
kernel-2.6.32-431.el6.x86_64
kernel-2.6.32-504.1.3.el6.x86_64
kernel-devel-2.6.32-431.el6.x86_64
kernel-devel-2.6.32-504.1.3.el6.x86_64
kernel-headers-2.6.32-504.1.3.el6.x86_64

Install the gpfs.gpl package.

# yum install -y gpfs.gpl
Loaded plugins: priorities, security, upgrade-helper
6756 packages excluded due to repository priority protections
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package gpfs.gpl.noarch 0:3.5.0-21 will be installed
...
# rpm -q gpfs.gpl
gpfs.gpl-3.5.0-21.noarch

Build the kernel glue + RPMs with:

cd /usr/lpp/mmfs/src
make clean
make LINUX_DISTRIBUTION=REDHAT_AS_LINUX Autoconfig 
make World
make rpm
# cd /usr/lpp/mmfs/src
# make clean
rm -rf /usr/lpp/mmfs/src/include /usr/lpp/mmfs/src/bin /usr/lpp/mmfs/src/lib
mkdir /usr/lpp/mmfs/src/include /usr/lpp/mmfs/src/bin /usr/lpp/mmfs/src/lib
rm -f //usr/lpp/mmfs/src/gpl-linux/gpl_kernel.tmp.ver
# make LINUX_DISTRIBUTION=REDHAT_AS_LINUX Autoconfig 
cd /usr/lpp/mmfs/src/config; ./configure --genenvonly; if [ $? -eq 0 ]; then /usr/bin/cpp -P def.mk.proto > ./def.mk; exit $? || exit 1; else exit $?; fi
# make World
Verifying that tools to build the portability layer exist....
cpp present
gcc present
g++ present
ld present
...
# make rpm
rm -rf /tmp/rpm
rpmbuild --define "MODKERNEL `cat //usr/lpp/mmfs/src/gpl-linux/gpl_kernel.tmp.ver`" --define "GPLDIR /usr/lpp/mmfs/src/gpl-linux" -bb /usr/lpp/mmfs/src/config/gpfs.gplbin.spec --buildroot=/tmp/rpm
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.skq5uG
...

Verify RPM package was created.

# ls -la /root/rpmbuild/RPMS/x86_64/gpfs.gplbin-`uname -r`-*
-rw-r--r-- 1 root root 1531152 Nov 21 15:33 /root/rpmbuild/RPMS/x86_64/gpfs.gplbin-2.6.32-504.1.3.el6.x86_64-3.5.0-21.x86_64.rpm

This package can be installed locally to allow GPFS to be started or added to a yum repo.

Leave a Reply