Grsec kernel compile in Ubuntu (localversion problems?)

Discuss usability issues, general maintenance, and general support issues for a grsecurity-enabled system.

Grsec kernel compile in Ubuntu (localversion problems?)

Postby maxp » Mon Jan 03, 2011 4:23 pm

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
maxp
 
Posts: 1
Joined: Mon Jan 03, 2011 4:10 pm

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

Postby ljnvsf8348f4i3 » Wed Jan 12, 2011 2:40 am

rm the localversion-grsec file in the source root directory.
ljnvsf8348f4i3
 
Posts: 2
Joined: Wed Jan 12, 2011 2:38 am

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

Postby ljnvsf8348f4i3 » Wed Jan 12, 2011 2:42 am

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
ljnvsf8348f4i3
 
Posts: 2
Joined: Wed Jan 12, 2011 2:38 am


Return to grsecurity support

cron