how to build your own ubuntu rt-kernel?

What other apps and distros do you use to round out your studio?

Moderators: khz, MattKingUSA

thorgal
Established Member
Posts: 739
Joined: Mon Apr 07, 2008 6:04 pm

Re: how to build your own ubuntu rt-kernel?

Post by thorgal »

studio32,

just so that I understand how you proceeded:

the 1st time you tried to compile an RT patched kernel, what did you do exactly ? does it sound like what I did :
1- download the vanilla kernel source from kernel.org
2- download the RT patch corresponding to the downloaded kernel version
3- patch the kernel as described in numerous places
4- fetch your current kernel config from /boot (preferably the same major version as the downloaded kernel) and copy it to the top source directory into .config
5- make oldconfig and say yes to full preemption mode
6- use make-kpkg to build the kernel a la debian and install created package(s) - linux-image-blabla and linux-headers-blabla

The absence of ALSA in your config file is very suspicious to me as most distro kernel are configured with all that stuff. It is a hint that your make oldconfig picked some weird config seed file.

studio32
Established Member
Posts: 2415
Joined: Mon Apr 07, 2008 5:09 pm

Re: how to build your own ubuntu rt-kernel?

Post by studio32 »

thorgal wrote:studio32,

just so that I understand how you proceeded:

the 1st time you tried to compile an RT patched kernel, what did you do exactly ? does it sound like what I did :
1- download the vanilla kernel source from kernel.org
2- download the RT patch corresponding to the downloaded kernel version
3- patch the kernel as described in numerous places
4- fetch your current kernel config from /boot (preferably the same major version as the downloaded kernel) and copy it to the top source directory into .config
5- make oldconfig and say yes to full preemption mode
6- use make-kpkg to build the kernel a la debian and install created package(s) - linux-image-blabla and linux-headers-blabla

The absence of ALSA in your config file is very suspicious to me as most distro kernel are configured with all that stuff. It is a hint that your make oldconfig picked some weird config seed file.
I followed this howto. http://forums.debian.net/viewtopic.php?t=17035

But I didn't take step 4 of your list I think. In that howto there is nothing about it, just make oldconfig...
Is it really needed and do you have a command for it?

thorgal
Established Member
Posts: 739
Joined: Mon Apr 07, 2008 6:04 pm

Re: how to build your own ubuntu rt-kernel?

Post by thorgal »

maybe this howto implicitly assumed that the user knows what 'make oldconfig' entiles.

Look into your current /boot directory. Isn't there a file called config-blabla ?

If the kernel version of this config is equal or lower than the version of the kernel you try to compile, that's OK, copy it to .config in the kernel source dir and type make oldconfig.

make oldconfig only makes sense if there's already a .config file lying around, which means an already configured kernel! this is convenient when you want to REbuild a kernel.

Step 4 in my list emulates a .config so that you do not have to do a real kernel configuration, which takes some time, especially when you don't understand 3/4 of the options and don't know much about your hardware. I did it from scratch and you do have to know what you are doing. It's a good school as it forces you to understand what you have in hands :) But for newbies, that's way too tricky. Thus this trick, and it spares you a lot of time.

So do as I say above and report back.

studio32
Established Member
Posts: 2415
Joined: Mon Apr 07, 2008 5:09 pm

Re: how to build your own ubuntu rt-kernel?

Post by studio32 »

thorgal wrote:
If the kernel version of this config is equal or lower than the version of the kernel you try to compile, that's OK, copy it to .config in the kernel source dir and type make oldconfig.
And what if that kernel version is a newer version compared to the one I want to build?

edit: and is this the command?

Code: Select all

  $ sudo cp /boot/config-2.6.24-16-generic /home/jack/kernel2/linux-2.6.24.3-rt3/.config 
Or do I get root/no-root problems when using this and working as non root in the /home folder?
Last edited by studio32 on Wed Dec 03, 2008 1:54 pm, edited 1 time in total.

thorgal
Established Member
Posts: 739
Joined: Mon Apr 07, 2008 6:04 pm

Re: how to build your own ubuntu rt-kernel?

Post by thorgal »

only one way to find out ... try it and report back :)

being non root is fine, I mean, you don't need sudo to copy. Otherwise, .config will not be replaced by your new config as non root ;)

brummer

Re: how to build your own ubuntu rt-kernel?

Post by brummer »

the way I use is to boot the Kernel from that I would take the .config, cd the (non root) console in the kernel source and tip make oldconfig. The oldconfig will not simply copy to the new kernel this way, you will prompt to all new config options and old no more used options will delete. So the config will fit to the new kernel anyway.

studio32
Established Member
Posts: 2415
Joined: Mon Apr 07, 2008 5:09 pm

Re: how to build your own ubuntu rt-kernel?

Post by studio32 »

I can t get a oldconfig with ALSA enabled already :(

I tried it as root:

Code: Select all

cp /boot/config-2.6.24-16-generic /usr/src/linux-2.6.24.3-rt3/.config

Code: Select all

 make oldconfig

Code: Select all

 make xconfig
(do you also take this step??)
>> ALSA not enabled...

(there is a .config and a .config.old in /usr/scr/linux-2.6.24.3-rt3)

thorgal
Established Member
Posts: 739
Joined: Mon Apr 07, 2008 6:04 pm

Re: how to build your own ubuntu rt-kernel?

Post by thorgal »

.config.old is a backup from your previosu attempt because each time you complete a 'make ***config', it will be saved into .config.

The absence of ALSA in your resulting config, even when you seeded it from a generic debian or ubuntu config can only point to a bogus config file that came with the generic kernel package. That's quite serious if one cannot recompile the exact same kernel with the provided config file.

No choice there my friend, you will need to make xconfig after make oldconfig and go straight into the ALSA section. Could be that ALSA is not the only thing affected, maybe your processor type or PCI bus type, or maybe the initrd is disabled as well ? ... hmmmm, a good 3 hours configuring the kernel ... good luck :)

studio32
Established Member
Posts: 2415
Joined: Mon Apr 07, 2008 5:09 pm

Re: how to build your own ubuntu rt-kernel?

Post by studio32 »

mmh strange and frustrating...
But I really appreciate your help...
I'll try it out at another ubuntu version on another part of my hd ;) :/

and this is some kind of backup ;)
http://www.howtoforge.com/kernel_compilation_ubuntu
edit

Code: Select all

If you re-used the existing configuration, note that Ubuntu kernels build with debugging information on, which makes the resulting kernel modules (*.ko files) much larger than they would otherwise be. To turn this off, go into "Kernel hacking"; then, under "Kernel debugging", turn OFF "Compile the kernel with debug info".
https://help.ubuntu.com/community/Kerne ... uildMethod
Last edited by studio32 on Thu Dec 04, 2008 6:15 pm, edited 1 time in total.

thorgal
Established Member
Posts: 739
Joined: Mon Apr 07, 2008 6:04 pm

Re: how to build your own ubuntu rt-kernel?

Post by thorgal »

one of these days, I think it would be good for you to go through the whole config from scratch. You will really learn a lot! Once you get a very tight and tailored config for your h/w that makes the kernel boot and work properly, keep it safe, and use it for kernel upgrades, it will save you a lot of time!

studio32
Established Member
Posts: 2415
Joined: Mon Apr 07, 2008 5:09 pm

Re: how to build your own ubuntu rt-kernel?

Post by studio32 »

thorgal wrote:one of these days, I think it would be good for you to go through the whole config from scratch. You will really learn a lot! Once you get a very tight and tailored config for your h/w that makes the kernel boot and work properly, keep it safe, and use it for kernel upgrades, it will save you a lot of time!
I did that once, man that take a time! But there was something strange with that kernel, I couldn't make a proper one... The problem is, I dont have very much knowledge about hardware...

thorgal
Established Member
Posts: 739
Joined: Mon Apr 07, 2008 6:04 pm

Re: how to build your own ubuntu rt-kernel?

Post by thorgal »

then try this debian generic config (for 2.6.24) :
ALSA is included in there. I got it from my mythTV server, for which I did not compile a customized kernel because it does not need it.

http://rafb.net/p/LXKeX131.html

(these links are temporary so you don't have that much time to copy it).

studio32
Established Member
Posts: 2415
Joined: Mon Apr 07, 2008 5:09 pm

Re: how to build your own ubuntu rt-kernel?

Post by studio32 »

I managed to get a .config with ALSA on another partition...

But it fails on another point :(

Code: Select all

UPD     include/linux/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1
kernel/built-in.o: In function `timespec_add_ns':
/usr/src/linux-2.6.24.4-rt4/include/linux/time.h:177: undefined reference to `__umoddi3'
/usr/src/linux-2.6.24.4-rt4/include/linux/time.h:177: undefined reference to `__udivdi3'
kernel/built-in.o: In function `timespec_add_ns':
/usr/src/linux-2.6.24.4-rt4/kernel/time/timekeeping.c:129: undefined reference to `__udivdi3'
/usr/src/linux-2.6.24.4-rt4/kernel/time/timekeeping.c:129: undefined reference to `__umoddi3'
kernel/built-in.o: In function `timespec_add_ns':
/usr/src/linux-2.6.24.4-rt4/include/linux/time.h:177: undefined reference to `__umoddi3'
/usr/src/linux-2.6.24.4-rt4/include/linux/time.h:177: undefined reference to `__udivdi3'
/usr/src/linux-2.6.24.4-rt4/include/linux/time.h:177: undefined reference to `__umoddi3'
/usr/src/linux-2.6.24.4-rt4/include/linux/time.h:177: undefined reference to `__udivdi3'
/usr/src/linux-2.6.24.4-rt4/include/linux/time.h:177: undefined reference to `__umoddi3'
/usr/src/linux-2.6.24.4-rt4/include/linux/time.h:177: undefined reference to `__udivdi3'
make[1]: *** [.tmp_vmlinux1] Error 1
make[1]: Leaving directory `/usr/src/linux-2.6.24.4-rt4'
make: *** [debian/stamp-build-kernel] Error 2
edit: where can i download older ubuntu generic kernels?
ah http://packages.ubuntu.com/search?suite ... rnel-image

thorgal
Established Member
Posts: 739
Joined: Mon Apr 07, 2008 6:04 pm

Re: how to build your own ubuntu rt-kernel?

Post by thorgal »

most like it's because you compile a lot of kernel stuff, even stuff that you don't need that requires external dependencies that kernel packagers make sure have. That's the problem when you try to reproduce the packaged kernel by using its packaged configuration as a seed for your own.

Let's face it, you need to spend this half a day doing it from scratch ...

studio32
Established Member
Posts: 2415
Joined: Mon Apr 07, 2008 5:09 pm

Re: how to build your own ubuntu rt-kernel?

Post by studio32 »

Mhh ok got that...

The question is now, how to become a kernel packager....

Post Reply