PDA

View Full Version : Custom Kernels in Dapper


JackDog
February 21st, 2006, 05:55 PM
Couple Questions:

What is the best way to use custom compiled kernels with Dapper and still allow synaptic to keep the rest of the system up to date?

Is there an Ubuntu Way to compile kernels and maintain configs?

Where can I find the config that Ubuntu uses in Dapper for each kernel (686,K7 etc)?


I have compiled and used custom kernels for years however I want to make sure I do not shoot myself in the foot with ubuntu by doing it now.

az
February 21st, 2006, 08:29 PM
Couple Questions:

What is the best way to use custom compiled kernels with Dapper and still allow synaptic to keep the rest of the system up to date?.

Make the kernel with kernel-package (example:

fakeroot make-kpkg --revision=2 --append-to-version=custom --stem=linux kernel_image kernel_headers

If you omit the stem switch, you end up with kernel-images instead of linux-image deb packages.

Install your kernel and then pin it. (Use synaptic to keep that version)




Is there an Ubuntu Way to compile kernels and maintain configs? .

Can you automate the compiling of a new kernel from source with your custom config? I dunno. Good question.


Where can I find the config that Ubuntu uses in Dapper for each kernel (686,K7 etc)?




Look in /boot.

RAOF
February 21st, 2006, 09:33 PM
You'd be interested in checking out https://wiki.ubuntu.com/KernelHowto. When I do my custom kernels, I tend to "cp /boot/config-`uname -r` .config", and then run make oldconfig - this then only asks about any new options in the kernel, and takes the rest from the old config file.

JackDog
February 21st, 2006, 09:57 PM
Thank you for the help, this is exactly what I was looking for.

abhaysahai
February 22nd, 2006, 07:54 AM
You'd be interested in checking out https://wiki.ubuntu.com/KernelHowto. When I do my custom kernels, I tend to "cp /boot/config-`uname -r` .config", and then run make oldconfig - this then only asks about any new options in the kernel, and takes the rest from the old config file.

Thanks RAOF.
we can also use
make xconfig, it gives a good GUI and we can use mouse to select the options.

RAOF
February 22nd, 2006, 08:16 PM
Thanks RAOF.
we can also use
make xconfig, it gives a good GUI and we can use mouse to select the options.
Or make gconfig, if you don't want the qt dependencies :)

I just use oldconfig because it highlights the new options (they're all it asks about). Using one of the gui tools, it's really not obvious what the new options (which won't have been set by your old config) are. I often use gconfig after oldconfig, to check on really obvious, important options.

JackDog
February 27th, 2006, 01:13 PM
What is the best way to recompile the nvidia module and create a deb package for my new custom kernel?

RAOF
February 27th, 2006, 07:44 PM
You can run the nvidia installer with the --kernel-module-only option (or something to that effect, check out the help with --advanced-options). That is, I think, as good as it'll get.

joffe
April 28th, 2006, 05:48 AM
I have had my fair share of kernel compiling in the past using slackware, then using something like:
make menuconfig
make && make modules_install
cp arch/i386/boot/bzimage /boot/kernel-x.y.z
cp System.map /boot/System.map-x.y.z
<edit lilo.conf>
lilo

Since there seems to be no automated way of doing this in ubuntu just yet, I would like to know the exact commands used to build the official ubuntu kernels + modules. In the mean time, will all the modules be installed if I just do the
make-kpkg --initrd --stem=linux kernel_image kernel_headers
or do I have to run make-kpkg like this?
make-kpkg --initrd --stem=linux kernel_image kernel_headers modules_image

az
April 28th, 2006, 08:30 AM
will all the modules be installed if I just do the
make-kpkg --initrd --stem=linux kernel_image kernel_headers


Yes.

zasf
April 28th, 2006, 09:07 AM
make-kpkg --initrd --stem=linux kernel_image kernel_headers modules_image

will make modules .debs also, according to what is in /usr/src/modules

What is the difference between a kernel-image and linux-image (--stem option)?

Do you guys download sources from kernel.org or do you use deb-src packages? I feel like ubuntu kernel source are higly patched.

thasheep
April 28th, 2006, 09:28 AM
Actually, no but almost. This will build the equivalent of the ubuntu linux-image and linux-headers packages but it won't install them.

Also, the kernel_headers package isn't needed if you have the source (but could be good if you want to use your custom kernel on other machines. Furthermore, it's a good idea to add a custom tag to your kernel(s) so you can tell them apart easier. So here's a complete command for building and installing your custom kernel (once configured).
sudo make-kpkg --initrd --stem=linux --append-to-version=-hotpies kernel_image
sudo dpkg -i /usr/src/linux-image-[kernel version]-hotpies.Custom_[arch].deb

zasf
April 28th, 2006, 10:46 AM
What is the difference between a kernel-image and linux-image (--stem option)?

I answer myself after some googling

--stem foo
Call the packages foo-* instead of kernel-*. This is useful in helping transition from calling the packages kernel-* to linux-* packages, in preparation for non-linux kernels in the distribution. The default remains kernel; this may change in the future.

not that big difference