Skip to content

Instantly share code, notes, and snippets.

@jlevon
Created March 12, 2018 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlevon/723dc30e77785bdd4ff29c68a21f3d75 to your computer and use it in GitHub Desktop.
Save jlevon/723dc30e77785bdd4ff29c68a21f3d75 to your computer and use it in GitHub Desktop.
Compiling CentOS 7 kernel RPM
yum -y groupinstall "Development Tools" 
yum -y install ncurses-devel  hmaccalc zlib-devel binutils-devel elfutils-libelf-devel  qt-devel
yum -y install rpm-build redhat-rpm-config asciidoc hmaccalc perl-ExtUtils-Embed pesign xmlto 
yum -y install audit-libs-devel binutils-devel elfutils-devel elfutils-libelf-devel
yum -y install ncurses-devel newt-devel numactl-devel pciutils-devel python-devel zlib-devel java-devel bc
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros
rpm -i http://vault.centos.org/7.4.1708/updates/Source/SPackages/kernel-3.10.0-693.21.1.el7.src.rpm 2>&1 | grep -v exist
cd ~/rpmbuild/SPECS
rpmbuild -bp --target=$(uname -m) kernel.spec
rpmbuild -bb --target=`uname -m` kernel.spec 2> build-err.log | tee build-out.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment