Difference between revisions of "Compile Kernel: Konfigurasi Kernel"

From OnnoWiki
Jump to navigation Jump to search
Line 1: Line 1:
 
Sumber: http://www.linuxchix.org/content/courses/kernel_hacking/lesson2
 
Sumber: http://www.linuxchix.org/content/courses/kernel_hacking/lesson2
  
Kernel Hacking Lesson #2: Configure Your Kernel
 
  
The Linux kernel comes with several configuration tools. Each one is run by typing make <something>config in the top-level kernel source directory. (All make commands need to be run from the top-level kernel directory.)
+
Linux kernel mempunyai beberapa tool konfigurasi. Setiap tool dapat di jalankan dengan menulis
  
    make config
+
make <something>config
  
    This is the barebones configuration tool. It will ask each and every configuration question in order. The Linux kernel has a LOT of configuration questions. Don't use it unless you are a masochist.
+
di directory top-level dari source kernel. Semua perintah make harus di jalankan dari directory top-level dari source kernel.
    make oldconfig
 
  
    This will take the config file named .config and only ask the configuration questions which are not already answered in that file. This is most often used when upgrading to a more recent version of the kernel.
 
    make menuconfig
 
  
    This is the kernel hacker mainstay. This command pops up a text-based menu-style configurator using the ncurses library. You can descend into the menus that interest you and change only the configuration options you care about.
+
* '''make config''' - ini merupakan kerangka dasar dari tool konfigurasi. Ini akan menanya satu per satu dari pertanyaan konfigurasi secara berurut. Kernel Linux mempunyai amat sangat banyak pertanyaan konfigurasi. Jangan gunakan ini kecuali kita kurang kerjaan.
     make xconfig, make gconfig
+
      
 +
* '''make oldconfig''' - ini akan membaca file konfigurasi .config dan akan bertanya konfigurasi yang belum di jawab di file tersebut. Cara ini biasanya digunakan untuk upgrade ke versi kernel yang lebih baru.
  
    If you're running Xwindows, these are prettier, clickable versions of menuconfig. They tends to work less often than menuconfig since they are more sensitive to buggy configuration input files than menuconfig (and because more people use menuconfig). xconfig uses the qt libraries, and gconfig uses the gtk libraries.
+
* '''make menuconfig''' - ini merupakan konfigurasi yang banyak digunakan oleh kernel hacker. Perintah ini menggunakan pop up berbasis text dan konfigurator menu-style menggunakan library ncurses. Kita bisa masuk ke satu menu yang kita tertarik dan mengubah hanya konfigurasi yang kita inginkan saja.
 +
 
 +
* '''make xconfig, make gconfig''' - jika kita menjalankan Xwindows, maka ini lebih cantik, lebih di klik dari menuconfig. Konfigurator ini tampaknya tidak sebaik menuconfig karena lebih sensitif pada input file konfigurasi yang ada bug-nya (di samping, karena memang lebih banyak orang menggunakan menuconfig). xconfig menggunakan library qt, sedang gconfig menggunakan library gtk.
  
 
Each of the configuration programs produces these end products:
 
Each of the configuration programs produces these end products:
  
    A file named .config in the top-level directory containing all your configuration choices.
+
* A file named .config in the top-level directory containing all your configuration choices.
    A file named autoconf.h in the include/linux/ directory defining (or not defining) the CONFIG_* symbols so that the C preprocessor knows whether or not they are turned on.
+
* A file named autoconf.h in the include/linux/ directory defining (or not defining) the CONFIG_* symbols so that the C preprocessor knows whether or not they are turned on.
  
 
If you have a working .config file for your machine, just copy it into your kernel source directory and run make oldconfig. You should double check the configuration with make menuconfig. If you don't already have a .config file, you can create one by visiting each submenu and turning on or off the options you need. menuconfig and xconfig have a "Help" option that shows you the Configure.help entry for that option, which may help you decide whether or not it should be turned on. RedHat and other distributions often include sample .config files with their distribution specific kernel source in a subdirectory named configs in the top-level source directory. If you are compiling for PowerPC, you have a variety of default configs to choose from in arch/ppc/configs. make defconfig will copy the default ppc config file to .config. If you know another source of default configuration files, let us know.
 
If you have a working .config file for your machine, just copy it into your kernel source directory and run make oldconfig. You should double check the configuration with make menuconfig. If you don't already have a .config file, you can create one by visiting each submenu and turning on or off the options you need. menuconfig and xconfig have a "Help" option that shows you the Configure.help entry for that option, which may help you decide whether or not it should be turned on. RedHat and other distributions often include sample .config files with their distribution specific kernel source in a subdirectory named configs in the top-level source directory. If you are compiling for PowerPC, you have a variety of default configs to choose from in arch/ppc/configs. make defconfig will copy the default ppc config file to .config. If you know another source of default configuration files, let us know.
Line 37: Line 36:
 
* Find out what your current kernel has compiled in with dmesg | less. Most device drivers print out messages when they detect a device.
 
* Find out what your current kernel has compiled in with dmesg | less. Most device drivers print out messages when they detect a device.
  
If all else fails, copy a .config file from someone else. The grrls-only list is a good place to ask.
+
Jika semua gagal, copy file .config dari teman.
  
  

Revision as of 11:18, 3 April 2013

Sumber: http://www.linuxchix.org/content/courses/kernel_hacking/lesson2


Linux kernel mempunyai beberapa tool konfigurasi. Setiap tool dapat di jalankan dengan menulis

make <something>config

di directory top-level dari source kernel. Semua perintah make harus di jalankan dari directory top-level dari source kernel.


  • make config - ini merupakan kerangka dasar dari tool konfigurasi. Ini akan menanya satu per satu dari pertanyaan konfigurasi secara berurut. Kernel Linux mempunyai amat sangat banyak pertanyaan konfigurasi. Jangan gunakan ini kecuali kita kurang kerjaan.
  • make oldconfig - ini akan membaca file konfigurasi .config dan akan bertanya konfigurasi yang belum di jawab di file tersebut. Cara ini biasanya digunakan untuk upgrade ke versi kernel yang lebih baru.
  • make menuconfig - ini merupakan konfigurasi yang banyak digunakan oleh kernel hacker. Perintah ini menggunakan pop up berbasis text dan konfigurator menu-style menggunakan library ncurses. Kita bisa masuk ke satu menu yang kita tertarik dan mengubah hanya konfigurasi yang kita inginkan saja.
  • make xconfig, make gconfig - jika kita menjalankan Xwindows, maka ini lebih cantik, lebih di klik dari menuconfig. Konfigurator ini tampaknya tidak sebaik menuconfig karena lebih sensitif pada input file konfigurasi yang ada bug-nya (di samping, karena memang lebih banyak orang menggunakan menuconfig). xconfig menggunakan library qt, sedang gconfig menggunakan library gtk.

Each of the configuration programs produces these end products:

  • A file named .config in the top-level directory containing all your configuration choices.
  • A file named autoconf.h in the include/linux/ directory defining (or not defining) the CONFIG_* symbols so that the C preprocessor knows whether or not they are turned on.

If you have a working .config file for your machine, just copy it into your kernel source directory and run make oldconfig. You should double check the configuration with make menuconfig. If you don't already have a .config file, you can create one by visiting each submenu and turning on or off the options you need. menuconfig and xconfig have a "Help" option that shows you the Configure.help entry for that option, which may help you decide whether or not it should be turned on. RedHat and other distributions often include sample .config files with their distribution specific kernel source in a subdirectory named configs in the top-level source directory. If you are compiling for PowerPC, you have a variety of default configs to choose from in arch/ppc/configs. make defconfig will copy the default ppc config file to .config. If you know another source of default configuration files, let us know.

Tips for configuring a kernel:

  • Always turn on "Prompt for development... drivers".
  • From kernel 2.6.8, you can add your own string (such as your initials) at "Local version - append to kernel release" to personalize your kernel version string (for older kernel versions, you have to edit the EXTRAVERSION line in the Makefile).
  • Always turn off module versioning, but always turn on kernel module loader, kernel modules and module unloading.
  • In the kernel hacking section, turn on all options except for "Use 4Kb for kernel stacks instead of 8Kb". If you have a slow machine, don't turn on "Debug memory allocations" either.
  • Turn off features you don't need.
  • Only use modules if you have a good reason to use a module. For example, if you are working on a driver, you'll want to load a new version of it without rebooting.
  • Be extra sure you selected the right processor type. Find out what processor you have now with cat /proc/cpuinfo.
  • Find out what PCI devices you have installed with lspci -v.
  • Find out what your current kernel has compiled in with dmesg | less. Most device drivers print out messages when they detect a device.

Jika semua gagal, copy file .config dari teman.




Referensi

Pranala Menarik