Error making the patched kernel on ubuntu 12.04

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

Error making the patched kernel on ubuntu 12.04

Postby schbrdw » Sat Jul 21, 2012 1:00 pm

I'm trying to build a deb package of the kernel as the wikibook instructs (I'm using the latest stable release of grsecurity with linux 3.2.23), that is with 'fakeroot make deb-pkgd' but I run into some problem.
I'm new to kernel compiling so I don't really know what any of it means but here's the last few lines of output:

OBJCOPY arch/x86/boot/compressed/vmlinux.bin
RELOCS arch/x86/boot/compressed/vmlinux.relocs
Invalid absolute R_386_32 relocation: _etext
make[4]: *** [arch/x86/boot/compressed/vmlinux.relocs] Error 1
make[3]: *** [arch/x86/boot/compressed/vmlinux] Error 2
make[2]: *** [bzImage] Error 2
make[1]: *** [deb-pkg] Error 2
make: *** [deb-pkg] Error 2


Any idea what happened there? I'll appreciate any help
schbrdw
 
Posts: 3
Joined: Sat Jul 21, 2012 12:51 pm

Re: Error making the patched kernel on ubuntu 12.04

Postby PaX Team » Sun Jul 22, 2012 8:14 am

what is the ld version? and can you send me your .config please?
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Re: Error making the patched kernel on ubuntu 12.04

Postby schbrdw » Sun Jul 22, 2012 12:36 pm

I was using 'ld.gold' but after reading your reply I thought maybe that's the problem and reverted to the standard variant of ld.
It still doesn't work, but for a different reason. It seems to complete the actual compiling but then fail attempting to make the deb packages. Here's what it says now:

dpkg-deb: building package `linux-headers-3.2.23-grsec' in `../linux-headers-3.2.23-grsec_3.2.23-grsec-5_i386.deb'.
dpkg-deb: building package `linux-firmware-image' in `../linux-firmware-image_3.2.23-grsec-5_i386.deb'.
dpkg-deb: building package `linux-libc-dev' in `../linux-libc-dev_3.2.23-grsec-5_i386.deb'.
dpkg-deb: building package `linux-image-3.2.23-grsec' in `../linux-image-3.2.23-grsec_3.2.23-grsec-5_i386.deb'.
dpkg-deb (subprocess): data member: internal gzip write error 'No space left on device'
dpkg-deb: error: subprocess <compress> from tar -cf returned error exit status 2
make[1]: *** [deb-pkg] Error 2
make: *** [deb-pkg] Error 2


and if it's still relevant, the ld version is 2.22 and how do I send you the .config file?
schbrdw
 
Posts: 3
Joined: Sat Jul 21, 2012 12:51 pm

Re: Error making the patched kernel on ubuntu 12.04

Postby schbrdw » Sun Jul 22, 2012 12:38 pm

and there IS quite a lot of space on every mounted filesystem, so I don't really see why it complains about that
schbrdw
 
Posts: 3
Joined: Sat Jul 21, 2012 12:51 pm

Re: Error making the patched kernel on ubuntu 12.04

Postby PaX Team » Sun Jul 22, 2012 6:52 pm

schbrdw wrote:and if it's still relevant, the ld version is 2.22 and how do I send you the .config file?
either email it to me or just put it on pastebin or similar. as for running out of space, i don't know debian's kernel build system, so can't help you there, sorry.
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Re: Error making the patched kernel on ubuntu 12.04

Postby sfs6dzs » Sun Jul 29, 2012 5:38 pm

schbrdw: Since Ubuntu and Debian share the same arhitecture when it comes to package managers (both uses apt-get and they are based on deb package manager) I recommend you this blog post, hopefully it will work for you:
Code: Select all
http://hypervion.blogspot.com/2012/07/hardening-263259-kernel-on-32-bit-x86.html


Short story by the way, try these (quoted from the blog post mentioned above):
Code: Select all
#> apt-get install build-essential fakeroot devscripts
#> make clean
#> make KDEB_PKGVERSION=<custom.1.0> deb-pkg

    Like the Kernel Handbook says for KDEB_PKGVERSION:
„The custom.1.0 part in this command is the version identifier, which will get appended to the kernel package name. Feel free to adjust it to your liking. As a result of the build, a custom kernel package linux-image-2.6.59-grsec_custom.1.0_i386.deb (name will reflect the version of the kernel and the revision chosen in the command line above) will be created in the directory one level above the top of the tree.”


These will install some utils needed for compiling the kernel and obviously install it. It will generate a deb package up one level (e.g.: if pwd is "/kernel-enforced/" -- then, the .deb will be in: "/<name of package>.deb").

This is for an x86 32-bit machine. I hope it comes in handy, please come back with feedback.

In addition:
schbrdw wrote:dpkg-deb: building package `linux-image-3.2.23-grsec' in `../linux-image-3.2.23-grsec_3.2.23-grsec-5_i386.deb'.
dpkg-deb (subprocess): data member: internal gzip write error 'No space left on device'
Could you please run a "df -h" and come back with the report about the space that is used and available in your boot partition?
sfs6dzs
 
Posts: 11
Joined: Thu Jul 12, 2012 11:47 am


Return to grsecurity support