Page 1 of 1

Grsec kernel compile in Ubuntu (localversion problems?)

PostPosted: Mon Jan 03, 2011 4:23 pm
by maxp
Hello grsec forums,

When I compile a grsec-patched kernel in Ubuntu with their kernel-package scripts, I get errors about the localversion being set incorrectly. Does anyone know how to avoid this error? This is the procedure that I follow on Ubuntu 10.10, although this has been bothering me for much longer than just this latest version:

Code: Select all
cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.36.2.tar.bz2
tar xjf linux-2.6.36.2.tar.bz2
wget http://grsecurity.net/test/grsecurity-2.2.1-2.6.36.2-201101021130.patch
wget http://grsecurity.net/test/grsecurity-2.2.1-2.6.36.2-201101021130.patch.sig
gpg --verify http://grsecurity.net/test/grsecurity-2.2.1-2.6.36.2-201101021130.patch.sig
patch -p0 --dry-run < http://grsecurity.net/test/grsecurity-2.2.1-2.6.36.2-201101021130.patch
patch -p0 < http://grsecurity.net/test/grsecurity-2.2.1-2.6.36.2-201101021130.patch
cd linux-2.6.32.2
make-kpkg clean
cp /boot/config-2.6.35-24-generic .config
make menuconfig

<-- turn on grsec, turn off a bunch of other crap -->

make-kpkg --initrd kernel-image kernel-headers
...
dpkg-gencontrol: error: package linux-image-2.6.36.2-grsec not in control info


I see that this behavior is related to some open bugs in Ubuntu's Launchpad bug tracker:

Does anyone know the easiest way to avoid this issue? Thanks!

EDIT: It may be worth adding the answer to this question to the Wikibook: http://en.wikibooks.org/wiki/Grsecurity/Configuring_and_Installing_grsecurity#Compiling_and_Installing_the_Kernel

Re: Grsec kernel compile in Ubuntu (localversion problems?)

PostPosted: Wed Jan 12, 2011 2:40 am
by ljnvsf8348f4i3
rm the localversion-grsec file in the source root directory.

Re: Grsec kernel compile in Ubuntu (localversion problems?)

PostPosted: Wed Jan 12, 2011 2:42 am
by ljnvsf8348f4i3
i don't think the second one is related, but unless you automatically deal with it, it can be annoying.
just throw this into one of your kernel scripts prior to build:
Code: Select all
sed -rie 's/echo "\+"/#echo "\+"/' scripts/setlocalversion