Compile Kernel
Source code kernel (inti) sistem operasi Linux dapat di ambil secara bebas dari situs http://www.kernel.org. Proses / langkah membuat sistem operasi Linux dengan cara meng-compile kernel dapat di lakukan di sistem operasi linux yang kita operasikan dan menjalankan perintah-perintah berikut.
Jika baru install, ubah password root
$ sudo passwd root Password: Password:
Masuk sebagai root
$ su - #
update source
# apt-get update $ sudo apt-get update
Set supaya /bin/sh menjadi /bin/bash jika di perlukan
# rm -f /bin/sh # ln -s /bin/bash /bin/sh
Siapkan kernel package
apt-get update apt-get install kernel-package libncurses5-dev fakeroot wget bzip2 \ fakeroot kernel-wedge build-essential makedumpfile libncurses5 apt-get build-dep linux
Untuk source code .gz
Copy source code kernel
cd /usr/src rm -Rf /usr/src/linux wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.8.4.tar.gz tar xjf linux-3.8.4.tar.gz -C /usr/src ln -s /usr/src/linux-3.8.4 /usr/src/linu
Untuk Source Code .xz
Copy source code kernel
cd /usr/src rm -Rf /usr/src/linux wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.8.4.tar.xz tar xJf linux-3.8.4.tar.xz -C /usr/src ln -s /usr/src/linux-3.8.4 /usr/src/linux
Compile kernel 3.8 di Linux
cd /usr/src/linux cp -vi /boot/config-`uname -r` ./.config
Langkah cp /boot/config* dibutuhkan jika kita ingin konfigurasi kernel yang digunakan sama dengan konfigurasi kernel dari system operasi yang sedang kita gunakan. Kita dapat meloncati hal ini dan langsung ke make menuconfig.
cd /usr/src/linux make menuconfig make-kpkg clean
Mungkin akan lebih mudah untuk memaksa compile semua source code melalui perintah
cd /usr/src/linux make all
baru di lanjutkan dengan perintah
cd /usr/src/linux fakeroot make-kpkg --initrd --append-to-version=-custom kernel-image kernel-headers cd /usr/src dpkg -i linux-image-2.6.32.3-custom_2.6.32.3-custom-10.00.Custom_i386.deb dpkg -i linux-headers-2.6.32.3-custom_2.6.32.3-custom-10.00.Custom_i386.deb
GRUB di Ubuntu 9.04 ke bawah
Ubah GRUB untuk menambahkan menu untuk booting
vi /boot/grub/menu.lst
Pastikan ada menu untuk booting dari kernel yang baru seperti
title Ubuntu 9.04, kernel 2.6.29.2-custom uuid d0a32d6c-3176-4b92-8cac-6e75acc4348a kernel /boot/vmlinuz-2.6.29.2-custom root=UUID=d0a32d6c-3176-4b92-8cac-6e75acc4348a ro quiet splash initrd /boot/initrd.img-2.6.29.2-custom quiet
title Ubuntu 9.04, kernel 2.6.29.2-custom (recovery mode) uuid d0a32d6c-3176-4b92-8cac-6e75acc4348a kernel /boot/vmlinuz-2.6.29.2-custom root=UUID=d0a32d6c-3176-4b92-8cac-6e75acc4348a ro single initrd /boot/initrd.img-2.6.29.2-custom
GRUB di Ubuntu 9.10 ke atas
Gunakan cara nekad
update-grub
Cara yang lebih elegan - Ubah file
vi /boot/grub/grub.cfg
Isi informasi kernel yang baru
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "Ubuntu, Linux 2.6.32.3-custom" {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
        set quiet=1
        insmod ext2
        set root=(hd0,6)
        search --no-floppy --fs-uuid --set e2482ccc-1480-4c25-adf8-bc77a255b3b3
        linux   /boot/vmlinuz-2.6.32.3-custom root=UUID=e2482ccc-1480-4c25-adf8-bc77a255b3b3 ro    crashkernel=384M-2G:64M,2G-:128M quiet splash
        initrd  /boot/initrd.img-2.6.32.3-custom
}
menuentry "Ubuntu, Linux 2.6.32.3-custom (recovery mode)" {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
        insmod ext2
        set root=(hd0,6)
        search --no-floppy --fs-uuid --set e2482ccc-1480-4c25-adf8-bc77a255b3b3
        linux   /boot/vmlinuz-2.6.32.3-custom root=UUID=e2482ccc-1480-4c25-adf8-bc77a255b3b3 ro single
        initrd  /boot/initrd.img-2.6.32.3-custom
}
### END /etc/grub.d/40_custom ###
Shutdown dan Reboot komputer
shutdown -r now
Setelah reboot & masuk lagi ke shell lakukan ..
uname -r
Referensi
Pranala Menarik
- Linux
 - Ubuntu
 - Sistem Operasi
 - Kernel
 - Compile Kernel
 - OS: Linux Kernel
 - OS: Parameter Kernel Default
 - OS: Kernel Scheduler
 - OS: Complete Teori Tuning Kernel Scheduler
 - OS: Complete Teori Tuning I/O Performance
 - OS: Tuning Kernel Scheduler
 - OS: Tuning Completely Fair Queueing CFQ I/O scheduler
 - OS: Tuning Completely Fair scheduler CFS
 - OS: Build in Monitoring Tool
 - Linux Benchmarking
 - OS: Benchmarking menggunakan UnixBench
 - OS: Benchmarking menggunakan LLCBench
 - OS: Membuat Kernel Modul