본문 바로가기
Programming Language/Linux

리눅스 커널 컴파일 및 Xenomai 설치(다른버젼)

by 민트초코맛꼬깔콘 2014. 11. 14.

기존의 방법에서 CPU가 달라지니 커널-xenomai버전 호환이 안맞는걸 확인.

새로운 버젼으로 설치방법 작성


CPU : Intel® Celeron(R) CPU G1830 @ 2.80GHz × 2

RAM : 4gb

SSD : 128gb


Linux ubuntu 12.04.5 LTS, 32bit

Linux kernel : linux-3.10.32
Xenomai : xenomai-2.6.3
ipipe : 3.10.32


$ sudo apt-get install build-essential kernel-package libncurses5-dev doxygen

linux kernel : www.kernel.org
xenomai : www.xenomai.org
ipipe : http://download.gna.org/adeos/patches/v3.x/x86/


- 다운 받은 파일을 /usr/src로 이동

$ sudo cp linux-3.10.32.tar.gz /usr/src

$ sudo cp xenomai-2.6.3.tar.bz2 /usr/src


$ sudo cp ipipe-core-3.10.32-x86-5.patch /usr/src


$ cd /usr/src






- 압축풀기

$ sudo tar -xzvf linux-3.10.32.tar.gz

$ sudo tar --bzip2 -xvf xenomai-2.6.3.tar.bz2


$ sudo mv ipipe-core-3.10.32-x86-5.patch /usr/src/xenomai-2.6.3/ksrc/arch/x86/patches/



- 심볼릭 링크

$ cd /usr/src

$ sudo ln -s linux-3.10.32 linux


$ sudo ln -s xenomai-2.6.3 xenomai

- Linux kernel patch


$ cd /usr/src/xenomai/scripts

$ sudo ./prepare-kernel.sh --arch=x86 --adeos=/usr/src/xenomai-2.6.3/ksrc/arch/x86/patches/ipipe-core-3.10.32-x86-5.patch --linux=/usr/src/linux-3.10.32

- Linux kernel config & compile

$ cd /usr/src/linux

$ sudo make-kpkg clean


$ cd /boot

$ sudo cp /boot/config-3.x.x-xx-generic /usr/src/linux/.config

$ cd /usr/src/linux

$ sudo make oldconfig

(all enter)


$ sudo make menuconfig




아래의 항목들을 Disable 해준다.


>Power management and ACPI options > CPU Frequency scaling > CPU frequency scaling


> Power management and ACPI options > ACPI (Advanced Configuration and Power Interface) Support


> Power management and ACPI options > CPU idle PM support


> Processor type and features > Enable-fstack-protector buffer overflow detection


> Power management and ACPI options > APM (Advanced Power Management) BIOS support


> Device Drivers > Input device support > Miscellaneous devices > PC Speaker support


> Bus options (PCI etc.) > Message Signaled Interrupts (MSI and MSI-X)


> Processor type and features > Processor family => core 2 / newer Xeon


Save & Exit

$ cd /usr/src/linux

$ sudo vi .config

RTS5139를 검색 후 해당라인을 #주석처리


- 컴파일 시작

("CONCURRENCY_LEVEL=4 make-kpkg"-여러개의 프로세서를 사용하여 동시에 컴파일할 수 있는 옵션)

$ sudo CONCURRENCY_LEVEL=4 make-kpkg --initrd --stem linux --append-to-version=.01rt kernel_image kernel_headers


(도중에 한번 엔터)


- 커널 컴파일이 정상적으로 수행됐다면, /usr/src 폴더를 보면, 다음과 같이 두 파일이 생성된 것을 볼 수 있다.


linux-headers-3.8.13.01rt_3.8.13.01rt-10.00.Custom_i386.deb

linux-image-3.8.13.01rt_3.8.13.01rt-10.00.Custom_i386.deb

- 데비안 패키지 파일(deb)를 설치한다.

$ sudo dpkg -i linux-headers-3.10.32.01rt_3.10.32.01rt-10.00.Custom_i386.deb linux-image-3.10.32.01rt_3.10.32.01rt-10.00.Custom_i386.deb

- 설치가 끝나면 실제로 컴파일한 커널이 부트로더에 등록되었는지 확인해보자.

$ sudo update-grub

- 새로 설치한 커널버젼으로 재부팅 -



Xenomai 설치


$ sudo su

$ cd /usr/src/xenomai

$ ./configure

$ make

$ make install


$ cp /etc/ld.so.conf.d/libc.conf /etc/ld.so.conf.d/xenomai.conf

$ vim /etc/ld.so.conf.d/xenomai.conf


아래와 같이 설정된 내용을

#libc default configuration

/usr/local/lib


다음과 같이 변경한다.

# xenomai libs

/usr/xenomai/lib


저장한 다음 configuration load

$ ldconfig


- 예제 프로그램

$ cd /usr/src/xenomai/examples/native

$ make

$ ./trivial-periodic


$ exit

'Programming Language > Linux' 카테고리의 다른 글

리눅스 복원 클론질라(Clonezilla.org)  (0) 2015.01.07
우분투 유틸  (0) 2014.12.23
리눅스 GRUB 메뉴 숨기기/보이기  (0) 2014.10.21
리눅스 고스트  (0) 2014.10.16
우분투 파티션 조절  (0) 2014.10.16