CustomUbuntuKernel » History » Version 1
Anonymous, 07/17/2021 09:16 PM
adding Build Custom Ubuntu Kernel page
| 1 | 1 | h1. Build Custom Ubuntu Kernel |
|
|---|---|---|---|
| 2 | |||
| 3 | # Create container directory: |
||
| 4 | <pre> |
||
| 5 | $ mkdir custom_kernel && cd custom_kernel |
||
| 6 | </pre> |
||
| 7 | # Grab kernel source for the currently installed kernel version (NOTE: this can be modified as needed): |
||
| 8 | <pre> |
||
| 9 | $ apt-get source linux-image-$(uname -r) |
||
| 10 | </pre> |
||
| 11 | # Install build dependencies: |
||
| 12 | <pre> |
||
| 13 | $ sudo apt-get build-dep linux-image-$(uname -r) |
||
| 14 | </pre> |
||
| 15 | # Modify configuration (NOTE: you need to go through each (Y, Exit, Y, Exit..) or get a complaint about config later...): |
||
| 16 | <pre> |
||
| 17 | $ chmod a+x debian/rules |
||
| 18 | $ chmod a+x debian/scripts/* |
||
| 19 | $ chmod a+x debian/scripts/misc/* |
||
| 20 | $ fakeroot debian/rules clean |
||
| 21 | $ fakeroot debian/rules editconfigs |
||
| 22 | </pre> |
||
| 23 | # Build kernel: |
||
| 24 | <pre> |
||
| 25 | $ fakeroot debian/rules clean |
||
| 26 | $ fakeroot debian/rules binary-headers binary-generic binary-perarch |
||
| 27 | </pre> |
||
| 28 | # Install kernel `.debs`: |
||
| 29 | <pre> |
||
| 30 | $ sudo dpkg -i linux-headers-3.19.0-80_3.19.0-80.88~14.04.1_all.deb linux-headers-3.19.0-80-generic_3.19.0-80.88~14.04.1_amd64.deb linux-image-3.19.0-80-generic_3.19.0-80.88~14.04.1_amd64.deb linux-image-extra-3.19.0-80-generic_3.19.0-80.88~14.04.1_amd64.deb |
||
| 31 | </pre> |
||
| 32 | |||
| 33 | h2. Useful Commands |
||
| 34 | |||
| 35 | * If using printk debug, increase the kernel logging verbosity: |
||
| 36 | <pre> |
||
| 37 | # echo 8 > /proc/sys/kernel/printk |
||
| 38 | </pre> |