Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Suppose i have kernel source at /usr/src/linux
I found the drivers in the /usr/src/linux/drivers tree. And try to modify some codes in the drivers folder.
My question is how can i compile the code that i have modified?
I have tried this sequence:
1. make menuconfig
2. make dep
3. make zImage
4. make module
5. make module_install
you shouldnt have to modify anything in drivers folder unless u got some obscure or really brand new hardware.
but yeah those commands should work u also need to make an initramfs image as well.
If you use one of the Debian branch of distros, it would be more like:
make-kpkg clean && fakeroot make-kpkg --initrd --append-to-version=-(whatever_you_like) kernel_image kernel_headers
I do not quite agree with the previous poster. What is the point of compiling your own kernel if you are not going to reconfigure it?
1. make menuconfig
2. make dep - not necessary after 1.
3. make zImage ... I never do that...
4. make module ... the command should be make modules
5. make module_install ... dito here: make modules_install
my sequence is:
make menuconfig
make
make modules_install
make install (or copying arch/i386/boot/bzImage directly to where you need it to be)
Basically: the exact same process as you always do.
sorry i didn't mention that work's result. because i didn't try it yet
I just want to make sure that the compilation that codes occur in make modules and make modules_install step ?
I tried to modify with error and there is no error when i using these steps:
1. make menu_config
2. make dep
3. make zImage
I didn't install the modules yet, so that's why i suggest that error should be occur in make modules or make modules_install.
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152
Rep:
Quote:
Originally Posted by darthaxul
you shouldnt have to modify anything in drivers folder unless u got some obscure or really brand new hardware.
but yeah those commands should work u also need to make an initramfs image as well.
I have had to edit the kernel source on two occasions: To get my tv tuner card to work I had to hard code the tuner number into the source otherwise it would always be 5 even if I tried to change it, and to get the driver for a USB wifi stick to compile on a ppc mac I had to tweak it a bit. I don't use an initrd, if you do you will have to make a new one otherwise it will load the old stuff from the old initrd. If that still doesn't work maybe start with a 'make clean' to get rid of any old object files before you compile the kernel.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.