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.
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 »

Did you use the config of the kernel-huge package?
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 »

Yes, but also enabled for lxc:

CONFIG_GROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_CGROUP_SCHED=y
CONFIG_CGROUPS=y
CONFIG_CGROUP_NS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CPUSETS=y
CONFIG_PROC_PID_CPUSET=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_RESOURCE_COUNTERS=y
CONFIG_CGROUP_MEM_RES_CTLR=y
CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y
CONFIG_MM_OWNER=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_NET_CLS_CGROUP=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y

BTW, I managed to run the latest kernel (2.6.38-rc2) in my laptop after running mkinitrd and specifying initrd image in grub.cfg , but nvidia driver refuses to compile even after I have specified --kernel-source-path :-( Also created a package using the kernel-huge.Slackbuild. But I installed manually because I could not figure out how to install new kernel-huge-lxc package without removing the salix default kernel. I can post the Slackbuild info and the package I created if someone needs.

One thing that I am noticing is the new setup seems to be a bit slower than the Salix default kernel. I am just wondering whether Salix applies specific patch to kernel.

I enabled cgroup in my server in 2.6.33.4 kernel, but it simply refuses to boot. I shall check once again tomorrow.
linus72
Posts: 79
Joined: 1. Dec 2009, 00:12

Re: Compiling Kernel with cgroups support and other patches

Post by linus72 »

Hope this info helps some :shock:

I have compiled a live 2.6.37 kernel for my Salix based PocketWriter build and would gladly share the .config,etc with you?
http://multidistro.com/downloads.html

Alos, you may have to add libcgroup from Slackware -current???
not sure but I added it to mine....
http://linorg.usp.br/slackware-current/ ... libcgroup/

I originally got the patch,etc from here, including the .config
http://aur.archlinux.org/packages.php?ID=43689
garby
Posts: 48
Joined: 18. Jan 2011, 10:36

Re: Compiling Kernel with cgroups support and other patches

Post by garby »

linus72 wrote:Hope this info helps some :shock:

I have compiled a live 2.6.37 kernel for my Salix based PocketWriter build and would gladly share the .config,etc with you?
http://multidistro.com/downloads.html

Alos, you may have to add libcgroup from Slackware -current???
not sure but I added it to mine....
http://linorg.usp.br/slackware-current/ ... libcgroup/

I originally got the patch,etc from here, including the .config
http://aur.archlinux.org/packages.php?ID=43689
I would love to get you config files. But how?

BTW, the pocketwriter os seems to be an interesting concept, but does it support 64-bit processors?

I would love to test. ;-) Or you can send me a PM with your email. ;-) Thank you for your offer.
linus72
Posts: 79
Joined: 1. Dec 2009, 00:12

Re: Compiling Kernel with cgroups support and other patches

Post by linus72 »

hey garby

here's the kernel config
http://multidistro.com/Kernels/2.6.37/config-2.6.37-smp

here's the kernel, firmware, and modules as pkgs,
kernel
http://multidistro.com/Kernels/2.6.37/k ... 686-2l.txz

modules
http://multidistro.com/Kernels/2.6.37/k ... 686-2l.txz

firmware
kernel-firmware-2.6.37-noarch-2l.txz

right now PocketWriter is i686, it does run on my amd athlon64 as it runs both 32bit and 64bit
pevsner
Posts: 81
Joined: 12. Apr 2010, 16:08

Re: Compiling Kernel with cgroups support and other patches

Post by pevsner »

Hi Garby,

A good general guide for compiling can be found at alienbobs blog http://alien.slackbook.org/dokuwiki/dok ... elbuilding
For 2.6.38-rc2 I:-
Copied the huge .config from the slackware-current repo,
did:- "make old config" ( accepting all the new entries),
(plugged in usb device for detection) then "make localmodconfig" (trims to your system,and builds real fast).
"make gconfig" and edit what you want (tick general>automatic process group scheduling(for cgroup patch), and I always tick processor family>athlon64(or whatever you have).
It's worth ticking "general>Automatically append version information to the version string" and then editing .config to pop in your specific version (eg "-mykernel").
"make bzImage modules"
"install modules"
"cp arch/x86_64/boot/bzImage /boot/vmlinuz-2.6.38-rc2-mykernel" # copy the new kernel file
"cp System.map /boot/System.map-2.6.38-rc2-mykernel " # copy the System.map (optional)
"cp .config /boot/config-2.6.38-rc2-mykernel" # backup copy of your kernel config
"cd /boot"
"rm System.map" # delete the old link
"ln -s System.map--2.6.38-rc2-mykernel" # create a new link
Edit lilo or grub > reboot.

Idk about enabling any other cool, but it's all running nicely for me atm.
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 »

garby wrote: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.
I've compiled a 2.6.38-rc2 kernel for my new notebook now and run into the same problem. Fix was easy: instead of using the .config from the kernel-source package you have to use the config of the running huge kernel: zcat /proc/config.gz > .config
Then of course the usual kernel build commands:
make oldconfig
make -j3
make modules_install
...
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
User avatar
JRD
Salix Warrior
Posts: 950
Joined: 7. Jun 2009, 22:52
Location: Lyon, France

Re: Compiling Kernel with cgroups support and other patches

Post by JRD »

This is a good tip indeed Thenktor.
Or you can also use the config file in /boot which is the same. But yes, the .config in /usr/src/linux is the vanilla config file, not the one tweaked by Pat.
Image
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 »

JRD wrote:the .config in /usr/src/linux is the vanilla config file, not the one tweaked by Pat.
I think it's the Slackware config file, but not the one for the huge kernel. It's the one for the standard kernel, that uses an initrd.
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 »

I did compile the kernel with the combined config from huge and customized ( config file here http://pastebin.com/Czigcvsv). Now when I do lxc-checkconfig, I find the 'File capabilities: missing"! I enabled Posix file capabilities in the kernel config. Which kernel CONFIG makes 'File Capabilities' enabled?
$ lxc-checkconfig
--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enabled
Multiple /dev/pts instances: enabled

--- Control groups ---
Cgroup: enabled
Cgroup namespace: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
Cgroup cpuset: enabled

--- Misc ---
Veth pair device: enabled
Macvlan: enabled
Vlan: enabled
File capabilities: missing

Note : Before booting a new kernel, you can check its configuration
usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig
Post Reply