Kali Linux: Recompile Kernel: Difference between revisions

From OnnoCenterWiki
Jump to navigationJump to search
Onnowpurbo (talk | contribs)
New page: Recompiling the Kali Linux Kernel Home/ 07. Kali Linux Development On occasion, you might want to add certain drivers, patches, or kernel features that are not included in the st...
 
Onnowpurbo (talk | contribs)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
Recompiling the Kali Linux Kernel
Kadangkala, anda ingin menambahkan fitur driver, patch, atau kernel tertentu yang tidak termasuk dalam Kali Linux kernel biasa. Panduan berikut akan menjelaskan bagaimana kernel Linux Kali dapat dengan cepat diubah dan dikompilasi ulang untuk kebutuhan anda. Harap dicatat bahwa patch injeksi nirkabel global sudah ada secara default di kernel Linux Kali.


    Home/
==Install Build Dependency==
    07. Kali Linux Development


On occasion, you might want to add certain drivers, patches, or kernel features that are not included in the stock Kali Linux kernel. The following guide will describe how the Kali Linux kernel can be quickly modified and recompiled for your needs. Please note that global wireless injection patches are already present by default in the Kali Linux kernel.
Install build dependency untuk compile kernel
Install Build Dependencies


Start by installing all the build dependencies required for recompiling your kernel.
apt-get install kernel-package ncurses-dev fakeroot bzip2
apt-get install kernel-package ncurses-dev fakeroot bzip2
Download Kali Linux Kernel Source Code


Download and extract the Kali Linux kernel source.
==Download Kali Linux Kernel Source Code==
apt-get install linux-source
cd /usr/src/
tar jxpf linux-source-3.7.tar.bz2
cd linux-source-3.7/
Configure Your Kernel


Copy over the default Kali kernel .config file and then modify it to your needs. This is the stage where you would apply various patches, etc. In this example, we are re-compiling a 64 bit kernel.
Download & extract Kali linux kernel source
cp /boot/config-3.7-trunk-amd64 .config
make menuconfig
Build the Kernel


Compile your modified kernel image. Depending on your hardware, this could take a while.
apt-get install linux-source
CONCURRENCY_LEVEL=$(cat /proc/cpuinfo|grep processor|wc -l)
cd /usr/src/
make-kpkg clean
tar jxpf linux-source-3.7.tar.bz2
fakeroot make-kpkg kernel_image
cd linux-source-3.7/
Install the Kernel


Once the kernel has successfully compiled, go ahead and install the new kernel and reboot. Please note that kernel version numbers may change – in our example, it was 3.7.2. Depending on the current kernel version, you might need to adjust it accordingly.
==Konfigurasi Kernel==
dpkg -i ../linux-image-3.7.2_3.7.2-10.00.Custom_amd64.deb
update-initramfs -c -k 3.7.2
update-grub2
reboot


Once rebooted, your new kernel should be running. If things go wrong and your kernel does not boot, you can still boot the original stock Kali kernel and fix your issues.
Copy dan timpa file default Kali kernel .config kemudian modifikasi sesuai dengan kebutuhan kita. Pada tahapan ini kita dapat memasukan berbagai patch dll. Dalam contoh ini, kita akan me-recompile 64 bit kernel.
 
cp /boot/config-3.7-trunk-amd64 .config
make menuconfig
 
==Build Kernel==
 
Compile kernel image yang kita modifikasi. Tergantung hardware yang kita gunakan, ini akan membutuhkan beberapa waktu
 
CONCURRENCY_LEVEL=$(cat /proc/cpuinfo|grep processor|wc -l)
make-kpkg clean
fakeroot make-kpkg kernel_image
 
==Install Kernel==
 
Setelah kernel telah berhasil di compile, lanjutkan dan instal kernel baru dan reboot. Harap dicatat bahwa nomor versi kernel dapat berubah - dalam contoh kita, versi tersebut adalah 3.7.2. Tergantung pada versi kernel saat ini, anda mungkin perlu untuk menyesuaikan.
 
dpkg -i ../linux-image-3.7.2_3.7.2-10.00.Custom_amd64.deb
update-initramfs -c -k 3.7.2
update-grub2
reboot
 
Setelah reboot, kernel baru anda harusnya berjalan. Jika ada sesuatu yang salah dan kernel anda tidak bisa boot, anda masih bisa boot Kali kernel yang asli dan memperbaiki masalah anda.




Line 44: Line 49:


* http://docs.kali.org/development/recompiling-the-kali-linux-kernel
* http://docs.kali.org/development/recompiling-the-kali-linux-kernel
==Pranala Menarik==
* [[Kali Linux]]
* [[Kali Linux: Membuat LiveUSB]]
* [[Kali Linux: Mengaktifkan Metasploit]]
* [[Kali Linux: Recompile Kernel]]

Latest revision as of 22:38, 26 July 2015

Kadangkala, anda ingin menambahkan fitur driver, patch, atau kernel tertentu yang tidak termasuk dalam Kali Linux kernel biasa. Panduan berikut akan menjelaskan bagaimana kernel Linux Kali dapat dengan cepat diubah dan dikompilasi ulang untuk kebutuhan anda. Harap dicatat bahwa patch injeksi nirkabel global sudah ada secara default di kernel Linux Kali.

Install Build Dependency

Install build dependency untuk compile kernel

apt-get install kernel-package ncurses-dev fakeroot bzip2

Download Kali Linux Kernel Source Code

Download & extract Kali linux kernel source

apt-get install linux-source
cd /usr/src/
tar jxpf linux-source-3.7.tar.bz2
cd linux-source-3.7/

Konfigurasi Kernel

Copy dan timpa file default Kali kernel .config kemudian modifikasi sesuai dengan kebutuhan kita. Pada tahapan ini kita dapat memasukan berbagai patch dll. Dalam contoh ini, kita akan me-recompile 64 bit kernel.

cp /boot/config-3.7-trunk-amd64 .config
make menuconfig

Build Kernel

Compile kernel image yang kita modifikasi. Tergantung hardware yang kita gunakan, ini akan membutuhkan beberapa waktu

CONCURRENCY_LEVEL=$(cat /proc/cpuinfo|grep processor|wc -l)
make-kpkg clean
fakeroot make-kpkg kernel_image

Install Kernel

Setelah kernel telah berhasil di compile, lanjutkan dan instal kernel baru dan reboot. Harap dicatat bahwa nomor versi kernel dapat berubah - dalam contoh kita, versi tersebut adalah 3.7.2. Tergantung pada versi kernel saat ini, anda mungkin perlu untuk menyesuaikan.

dpkg -i ../linux-image-3.7.2_3.7.2-10.00.Custom_amd64.deb
update-initramfs -c -k 3.7.2
update-grub2
reboot

Setelah reboot, kernel baru anda harusnya berjalan. Jika ada sesuatu yang salah dan kernel anda tidak bisa boot, anda masih bisa boot Kali kernel yang asli dan memperbaiki masalah anda.



Referensi

Pranala Menarik