R&D/OS

Kernel Build

sunshout 2014. 6. 23. 13:24

Linux Kernel 소스


git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git



kernel compile.

아래와 같이 kernel compile을 하도록 하자.

  • make-kpkg 가 안될 경우, kernel-package 를 설치해야 한다.
$ cd kvm
$ make mrproper
$ cp /boot/config-'uname -r'  ./.config
$ make menuconfig
 
Virtualization >  모든 항목 포함.
Processor type and features > Linux guest support > Xen을 제외한 모든 항목 포함.
Network support > Networking options > Network packet filtering framework > IP: Netfilter Configuration > IPV4 NAT > 모든 항목 포함.
 
$ sudo make-kpkg clean
$ sudo make-kpkg --jobs 8 --initrd --stem linux kernel_image kernel_headers kernel_source modules_image
  • make-kpkg 옵션 분석
    • --append_to_version foo : Makefile의 EXTRAVERSION 변수에 해당함
    • --initrd : kernel image 패키지를 생성함
    • --stem foo : kernel-* 대신에 foo-* 패키지를 호출 (default : linux)
    • kernel_image : linux kernel source 이미지를 생성함
    • kenel_headers : linux kernel 생성시 kenel header 파일을 포함한 형태로 생성
    • kernel_source  : kernel source 패키지를 생성함
    • module_image : allows you to build all packages under MODULE_LOC

kernel install

$ cd ..
$ sudo dpkg -i linux-*.deb