Compiling Kernel with cgroups support and other patches

You have a problem with Salix? Post here and we'll do what we can to help.
garby
Posts: 48
Joined: 18. Jan 2011, 10:36

Compiling Kernel with cgroups support and other patches

Post by garby »

This post is more a request for orientation to compile a kernel under Salix than a problem.

Before I compile a new kernel with cgroup support for lxc and the 200 lines of per tty task group patch (http://blogs.computerworld.com/17371/th ... lot_faster) plus grsecurity, I have a few questions.

1) I am aware that compiling kernel involves :

Code: Select all

make mrproper
make (*)config (* can be replaced with menu or x)
make bzImage
make modules
in the linux source directory. In Salix 13.1 case the source directory seems to be /usr/src/linux. Correct me if I am wrong. And if there are some extra steps involved in salix's case (I do see a kernel*.diff.gz files in the directory and would like to know what they are for?)

2) At which stage of make above in 1) do I apply the patch like the

3) Is there any necessity for the grsecurity patch in slack/salix? I am asking because slackware is considered pretty secure by design ;-)

4) Is there a specific way of applying patch in Salix for creating a kernel package?

Or in other words, I need to know exactly how the kernel package in Salix is created? Appreciate your inputs before I compile on my own. Thanks!
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: Compiling Kernel with cgroups support and other patches

Post by thenktor »

You have to patch before running make. Then run
make menuconfig
make
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
garby
Posts: 48
Joined: 18. Jan 2011, 10:36

Re: Compiling Kernel with cgroups support and other patches

Post by garby »

@thenktor: What a prompt reply!!! Thanks

But I am just wondering about the diff files in the /usr/src/linux directory and whether grsecurity patch is advised? Also is there a specific way to create a package so that I can just install in other computers?

Thanks!
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: Compiling Kernel with cgroups support and other patches

Post by thenktor »

No idea what the grsecurity patch is.
If you want to build kernel packages you can have a look at the SlackBuild: http://slackware.osuosl.org/slackware-1 ... rnel-huge/

But I'd advise you to just copy the bzImage to /boot. You'll find it in /usr/src/linux/arch/x86/boot. And run make modules_install, which copies the modules to /lib/modules. Then you can copy the kernel and the modules to every PC you want.

Don't forget to edit your lilo.conf and run lilo.
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
garby
Posts: 48
Joined: 18. Jan 2011, 10:36

Re: Compiling Kernel with cgroups support and other patches

Post by garby »

Thank you again, I am looking at the link you provided.

grsecurity.net is the patch that I am referring to and they have released a patch (http://www.grsecurity.net/~spender/grse ... 1645.patch) discussed at http://forums.grsecurity.net/viewtopic.php?f=1&t=2259

However, I am creating something for the amd64 machines and I did not see /usr/src/linux/arch/amd64, what I am seeing only is the following directories:
Kconfig alpha arm avr32 blackfin cris frv h8300 ia64 m32r m68k m68knommu microblaze mips mn10300 parisc powerpc s390 score sh sparc um x86 xtensa
which one is applicable to amd64? x86 or ia64? Just wondering!
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: Compiling Kernel with cgroups support and other patches

Post by thenktor »

OK, as far as I can see: If you have to ask if you need the grsecurity patch, then you won't need it ;)

What you refer as amd64 is an extension to x86. And ia64 is completely different architecture.
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
garby
Posts: 48
Joined: 18. Jan 2011, 10:36

Re: Compiling Kernel with cgroups support and other patches

Post by garby »

Thank you so much for confirmation. I am trying to compile the latest snapshot as well as v 2.6.37 stable (the latter with both grsecurity and 200 lines of task grouping scheduler patch). Shall report back if I succeed. ;-)
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: Compiling Kernel with cgroups support and other patches

Post by thenktor »

IIRC the group scheduling patch was added to the 2.6.38 kernel, so you could try this one, too.
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
garby
Posts: 48
Joined: 18. Jan 2011, 10:36

Re: Compiling Kernel with cgroups support and other patches

Post by garby »

Thank you, I compiled the 2.6.38-rc2 kernel with the cgroups enabled with the default config from the stock config of salix 2.6.33.4. But I am getting kernel panic (not syncing VFS Unable to mount rootfs on unknown device). I tried to specify rootfstype=ext4 in the grub2 linux line, but it remails same.

What I did so far in the kernel source folder:

Code: Select all

make mrproper
make xconfig
make
cat arch/x86_64/boot/bzImage > /boot/vzlinuz-2.6.38-rc2
cp arch/x86_64/boot/System.map /boot/System-map-2.6.38-rc2
make modules_install
and made the necessary changes in the /boot/grub/grub.cfg file, the first entry boots fine, but not the second one:
menuentry "SalixOS-2.6.33.4 (on /dev/sdb3)" {
insmod ext2
set root='(hd1,3)'
search --no-floppy --fs-uuid --set 6a1611db-4954-44e9-b881-92b9c24bbbcc
linux /boot/vmlinuz root=/dev/sdb3 ro quiet vt.default_utf8=1 vga = normal
}
menuentry "SalixOS-lxc-2.6.38-rc2 (on /dev/sdb3)" {
insmod ext2
set root='(hd1,3)'
search --no-floppy --fs-uuid --set 6a1611db-4954-44e9-b881-92b9c24bbbcc
linux /boot/vmlinuz-2.6.38-rc2-lxc root=/dev/sdb3 ro quiet vt.default_utf8=1 vga = normal
}
Any hints to get rid of the kernel panic (not syncing VFS unable to mount rootfs on unknown device) error?

PS: Actually I am trying to have two parallel kernel (the compiled one with the default salix kernel 2.6.33.4).

Thanks for help!

Tried to post my working config file, but I got "Your message contains 115246 characters. The maximum number of allowed characters is 60000." :-(
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: Compiling Kernel with cgroups support and other patches

Post by Shador »

Upload a diff of your config and the stock slackware config to some pastebin site or similar.
Image
Post Reply