LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   change the module and create custom kernel (https://www.linuxquestions.org/questions/debian-26/change-the-module-and-create-custom-kernel-879376/)

cccc 05-07-2011 02:45 PM

change the module and create custom kernel
 
hi

I'd like to change the existing kernel module (driver) file and compile a custom kernel.

Is this the correct way, or pls correct me?

# cd linux-source-2.6.32
# cp /boot/config-$(uname -r) ./.config
# make-kpkg clean
change the driver file /custom_kernel/linux-source-2.6.32/drivers/gpu/drm/i915/i915_drv.h manually
# make-kpkg --rootcmd fakeroot --initrd --revision=custom.001 kernel_image kernel_headers
# dpkg -i *.deb

cccc 05-08-2011 02:17 PM

Still don't know if these steps are correct?

cccc 05-11-2011 08:01 PM

Perhaps other way here to change the kernel module directly instead of kernel compile:

http://www.cyberciti.biz/tips/build-...urce-tree.html

Don't know if it helps in my case and can replace the existing already instelled kernel module.
Or has someone an idea how it should work?

mf93 05-13-2011 02:03 PM

make sure you install kernel-package, a set of tools for compiling kernels/headers, as well as ncurses, for convenience
Code:

#  apt-get install kernel-package
#  apt-get install libncurses5-dev

This will prepare and then compile the kernel after you have made the changes.
make sure these are running while working within the directory of the kernel source tree.
Code:

#  make oldconfig
#  CONCURRENCY_LEVEL=8 make-kpkg kernel-image --initrd --append-to-version=*-your-kernel-name*

replacing *your-kernel-name* with whatever you want to call the new kernel
then
Code:

#  cd /usr/src
#  dpkg -i *name of your custom kernel .deb*

reboot into your new kernel!

cccc 05-16-2011 10:08 AM

Thx a lot it works great, but is it correct if I add kernel_headers on the end?
Code:

# CONCURRENCY_LEVEL=8 make-kpkg kernel-image --initrd --append-to-version=custom.001 kernel_headers

j1alu 05-16-2011 11:33 AM

i always add "--initrd kernel_image kernel_headers " at the end (without quotes), so i'd say: yes.
btw: you probably will want to add the hyphen (-) in front of the custom.001, like posted by mf93,
similar to -append-to-version="-custom.001"
else the resulting name looks a bit strange.
You don't need to compile kernels as root:
http://forums.debian.net/viewtopic.php?p=212790#p212790

cccc 05-20-2011 10:28 AM

Thx I've done the following:
Code:

# CONCURRENCY_LEVEL=8 make-kpkg --initrd --append-to-version=-custom.001 kernel-image kernel_headers
and these packages with these long names were created:
Code:

# ls
linux-headers-2.6.32-custom.001_2.6.32-custom.001-10.00.Custom_i386.deb
linux-image-2.6.32-custom.001_2.6.32-custom.001-10.00.Custom_i386.deb

Can I rename them afterwords?

BTW Sould I do this next time?
Code:

# CONCURRENCY_LEVEL=8 make-kpkg --initrd --append-to-version="-custom.001" kernel-image kernel_headers

mf93 05-22-2011 08:00 PM

you can name them whatever you want, just make sure to install them with dpkg and then boot into them in grub. it will come up in the boot menu with the custom name you appended

cccc 05-27-2011 04:13 AM

Thx

cccc 05-30-2011 10:46 AM

BTW I've forgotten:
Code:

# cp /boot/config-$(uname -r) ./.config
or
Code:

# make oldconfig
Should I build custom kernel again?


All times are GMT -5. The time now is 09:12 PM.