Patching CentOS' Kernel
Posted: Fri Feb 13, 2015 2:12 am
Hello, I am trying to patch the CentOS Linux kernel "kernel-3.10.0-123.20.1.el7" with https://grsecurity.net/stable/grsecurit ... 2101.patch
I ended up with a file not found error and it's asking for which file to patch. I'm assuming this is a conflict. Do I need to modify the grsec patch file to remove conflicts, or do I have to take the default Linux kernel and work on that one?
Any help is appreciated, thanks.
End of output from patch:
Commands used to build and patch the CentOS 7 kernel:
# as root #
# now running as user #
I ended up with a file not found error and it's asking for which file to patch. I'm assuming this is a conflict. Do I need to modify the grsec patch file to remove conflicts, or do I have to take the default Linux kernel and work on that one?
Any help is appreciated, thanks.
End of output from patch:
- Code: Select all
patching file arch/arm/mach-omap2/omap_hwmod.c
can't find file to patch at input line 3708
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/arch/arm/mach-omap2/powerdomains43xx_data.c b/arch/arm/mach-omap2/powerdomains43xx_data.c
|index 95fee54..cfa9cf1 100644
|--- a/arch/arm/mach-omap2/powerdomains43xx_data.c
|+++ b/arch/arm/mach-omap2/powerdomains43xx_data.c
--------------------------
File to patch:
Commands used to build and patch the CentOS 7 kernel:
# as root #
- Code: Select all
yum install rpm-build redhat-rpm-config asciidoc hmaccalc perl-ExtUtils-Embed pesign xmlto \
audit-libs-devel binutils-devel elfutils-devel elfutils-libelf-devel \
newt-devel numactl-devel pciutils-devel python-devel zlib-devel net-tools bc bison
useradd user
su user
# now running as user #
- Code: Select all
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros
rpm -i http://vault.centos.org/7.0.1406/updates/Source/SPackages/kernel-3.10.0-123.20.1.el7.src.rpm 2>&1 | grep -v exist
cd ~/rpmbuild/SPECS
rpmbuild -bp --target=$(uname -m) kernel.spec
cd ~/rpmbuild/BUILD/kernel-3.10.0-123.20.1.el7
wget https://grsecurity.net/stable/grsecurity-3.0-3.14.32-201502062101.patch
cd ~/rpmbuild/BUILD/kernel-3.10.0-123.20.1.el7/linux-3.10.0-123.20.1.el7.x86_64
patch -p1 < ../grsecurity-3.0-3.14.32-201502062101.patch