Quote:
Originally Posted by titaniumdecoy
I am using these instructions to make and install a vanilla kernel with make-kpkg and dpkg.
However, it takes a very long time to compile the kernel.
|
No it doesn't. If you have a quad-core processor, that is.
Here is the script that I use to compile kernels. Note the CONCURRENCY_LEVEL line. Even if you only have a single core, you can probably get away with using 2.
Code:
#!/bin/sh
export CONCURRENCY_LEVEL=4
make-kpkg clean
fakeroot make-kpkg --append_to_version -k8 --revision=0.1 --initrd kernel_image
Code:
Since the purpose of compiling my own kernel is to modify it, how can I only make and install those parts of the kernel and/or modules that have changed?
It depends on what you're trying to do. If you are modifying the code in a loadable module, you can recompile just the directory holding that module, and thus that module, by using something like this. Say you're working on the sata_nv driver. Of course you wouldn't be able to do this if you were booted from sata_nv, but it shows the general idea.
Code:
make M=drivers/ata
rmmod sata_nv
insmod drivers/ata/sata_nv.ko
Added: However, it's not a good idea to leave it like this once you get it working properly. You should remake the kernel and reinstall it.
Quote:
Is there an update option for dpkg?
|
You can see all the options by typing "man dpkg", but I don't think there is an update. Make-kpkg does an awful lot to make the .deb file.
Quote:
Also, do I need to recompile and reinstall kernel-headers after each modification or just kernel-image?
|
You don't have to install any kernel-headers package. Your kernel source is, by definition, the kernel-headers.
To replace a kernel with a new one of the same version, we normally would change the revision in the make command, and move the /lib/modules for the old one. To do so, generally follow this:
Code:
<make the new kernel file>
mv /lib/modules/kernelnumber /lib/modules/kernelnumber.bak (this is the one already installed)
dpkg -i newkernel