This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

Kernel/Configuration/ko

From Gentoo Wiki (test)
< Kernel
Jump to:navigation Jump to:search
This page is a translated version of the page Kernel/Configuration and the translation is 87% complete.
Outdated translations are marked like this.

이 글에서는 리눅스 커널을 직접 설정하고 설치하는 방법을 설명합니다. 검증된 방법을 찾으신다면, genkernel 글을 살펴보십시오.

심볼릭 링크 설정

/usr/src/linux 심볼릭 링크는 언제든 현재 사용하는 커널 소스를 가리킵니다. 다음 세가지 방법 중 하나로 끝낼 수 있습니다:

1. symlink USE 플래그를 활성화한 후 커널 소스를 설치하십시오. /usr/src/linux가 가리키는 대상을 새로 설치한 커널 소스로 설정합니다. 필요하다면 다음의 수정된 두가지 방식으로 나중에 수정할 수 있습니다:

2. eselect로 심볼릭 링크를 선택하십시오:

root #eselect kernel list
Available kernel symlink targets:
[1] linux-3.3.8-gentoo
[2] linux-3.4.9-gentoo

이 출력 내용에는 사용할 수 있는 커널 소스가 있습니다. 별표 기호는 선택한 소스를 나타냅니다. 커널 소스를 바꾸려면 (예: 두번째 항목) 다음 명령을 실행하십시오:

root #eselect kernel set 2

3. 직접 심볼릭 링크를 설정합니다:

root #ln -sf /usr/src/linux-3.4.9-gentoo /usr/src/linux
root #ls -l /usr/src/linux
lrwxrwxrwx 1 root root 11 Aug 29 22:10 /usr/src/linux -> /usr/src/linux-3.4.9-gentoo


설정 도구

커널에서는 자체를 설정할 수 있는 몇가지 도구를 제공합니다.

Command Description
make config Text based configuration. The options are prompted one after another. All options need to be answered, and out-of-order access to former options is not possible.
make menuconfig An ncurses-based pseudo-graphical menu (only text input). Navigate through the menu to modify the desired options.
make defconfig Generates a new config with default from the ARCH supplied defconfig file. Use this option to get back the default configuration file that came with the sources.
make nconfig Pseudo-graphical menu based on ncurses. Requires sys-libs/ncurses to be installed.
make xconfig Graphical menu using Qt4. Requires dev-qt/qtgui to be installed.
make gconfig Graphical menu using GTK+. Requires x11-libs/gtk+, dev-libs/glib, and gnome-base/libglade to be installed.
make oldconfig Review changes between kernel versions and update to create a new .config for the kernel.
make allyesconfig Enables all configuration options in the kernel. It will set all kernel options to *. Make sure a backup of the current kernel configuration is acquired before experimentally using it!

기타 기본 설정을 만들 몇가지 스크립트도 있습니다. 더 깊은 단계에 있는 설정을 처리하여 시간을 효율적으로 단축할 수 있습니다. 메이크 대상 전체 목록을 보려면 다음 명령을 실행하십시오:

root #make help

설정

이 글에서는 make menuconfig를 사용하여 설정하는 방법을 설명합니다만, 절차는 다른 메뉴랑 비슷합니다.

root #cd /usr/src/linux
root #make menuconfig

사용법

화면에 나타난 메뉴에서 푸른색 막대는 커서 현재 위치를 나타냅니다. , 화살표 키로 커서 위치를 바꿀 수 있습니다. , 화살표 키로 메뉴 표시줄 하단을 순회하며 Enter 키를 누르면 어떤 설정을 할 지 정할 수 있습니다. ---> 로 끝나는 메뉴 항목에서 Select를 누르면 하위 메뉴로 들어갈 수 있고, Exit를 누르면 하위 메뉴에서 나갑니다. Exit를 선택하는 대신 Esc 키를 두번 쳐서 나갈 수 있습니다.

관련 문자 키를 A 키부터 Z 키까지 눌러보면 강조 문자를 가진 줄로 커서줄이 이동합니다. 여기서 Y, M, N 키는 다른 목적으로 사용하는 신성한 키므로(ㅋㅋ) 탐색 문자에서 제외했습니다. Y, M, N 중 한 문자로 시작하는 줄이 있다면 다음 글자를 강조하며 해당 문자를 가진 줄로 건너뛸 수 있습니다. 예를 들자면, 커서 현재 위치에 따라 다음줄이 "Network Device Support --->" 라면 E 키를 눌렀을 때 해당 줄로 커서를 이동합니다.

다음 기호 문자는 메뉴 줄 앞에 나타날 수 있습니다:

Symbol(s) Description
[ ], [*] Options in square brackets can be activated or deactivated. The asterisk marks the menu entry as activated. The value can be changed with the space key. It is also possible to press Y key (Yes) to activate or N key (No) to deactivate the selected entry.


If the option is activated, the selected feature/driver will be built into the kernel and will always be available at boot time.

< >, <M>, <*> Options in angle brackets can be activated or deactivated, but also activated as module (indicated by a M). The values can be modified by pressing Y/N keys as before or by pressing the M key to activate the feature/driver as a module.


See the Kernel Modules article for differentiation.

{M}, {*} Options in curly brackets can be activated or activated as module but not be deactivated. This happens because another feature/driver is dependent on this feature.
-M-, -*- Options between hyphens are activated in the shown way by another feature/driver. There is no choice.

게다가 어떤 항목은 뒷부분에 이런 표시를 붙였습니다:

Tag Description
(NEW) This driver is new in the kernel and is maybe not stable enough.
(EXPERIMENTAL) This driver is experimental and most likely not stable enough.
(DEPRECATED) This driver is deprecated and not needed for most systems.
(OBSOLETE) This driver is obsolete and should not be activated.

대부분 옵션에는 H 키를 누르거나 메뉴 표시줄의 Help를 선택하면 설명이 뜹니다.

드라이버 선택

하드웨어 분류의 하드웨어 감지 글을 보십시오.

모듈 검색

menuconfig에서 모듈을 검색하려면 / 키를 사용하십시오.

As shown below, the search result will show numbers in front of the matches. Pressing 1 in the example below would make menuconfig jump straight to the option Bluetooth device drivers in the menu structure.

커널 HCIBTUSB 검색 후 예제 출력
Symbol: BT_HCIBTUSB [=m]                       
Type  : tristate                               
Prompt: HCI USB driver                         
  Location:                                    
    -> Networking support (NET [=y])           
      -> Bluetooth subsystem support (BT [=y]) 
(1)     -> Bluetooth device drivers            
  Defined at drivers/bluetooth/Kconfig:5       
  Depends on: NET [=y] && BT [=y] && USB [=m]

젠투 리눅스 일반 설정 활성화

sys-kernel/gentoo-sources와 젠투에서 관리하는 다른 커널 프로젝트 에서만 나타나는 CONFIG_GENTOO_LINUX 커널 설정 옵션이 있습니다. 자체적으론 하는 일이 없지만, 일반 설치 과정에서 필요한 다양한 설정 옵션을 설정합니다.

이 설정은 젠투 리눅스에서 /dev를 처리하는데 필요한 tmpfsdevtmpfs 지원을 자동으로 선택하지만, 젠투 리눅스 시스템의 다른 필수적 설정을 차후에 활성화하기 위해 확장됩니다. 더 많은 내용을 알아보려면, 이 안내서에 앞서 설명한 커널 설정 시스템을 통해 제공하는 도움말 정보를 읽어보십시오.

빌드

커널 설정을 완벽하게 끝냈다면 커널을 컴파일하십시오:

root #make

프로세서 코어가 여러개 있다면 모든 코어가 동작할 수 있게 할 수 있습니다. 이렇게 하려면 -j(NUMBER_CORES +1) 매개 변수를 추가하십시오. 듀얼 코어 프로세서에는 논리코어 더하기 일입니다(2 + 1):

root #make -j3

쿼드코어 시스템에서는 논리코어 네개 더하기 일입니다(4 + 1):

root #make -j5

설치

드라이버를 모듈로 활성화 했다면, 설치해야 합니다:

root #make modules_install

모듈은 /lib/modules의 하위 디렉터리에 복사합니다.

실제 커널을 설치하려면:

root #make install

이 명령은 sys-apps/debianutils 꾸러미의 일부인 /sbin/installkernel 을 실행합니다. 새 커널은 {{Path|/boot/vmlinuz-{version}}}에 설치합니다. /boot/vmlinuz 심볼릭 링크가 이미 있다면, 새 커널에 대해 만든/boot/vmlinuz 링크를 만들고 바꾸며, 이전에 설치한 커널은 /boot/vmlinuz.old로 둡니다.(installkernel man page). configSystem.map파일과 같습니다. 이 심볼릭 링크는 파일 경로를 바꾸지 않고 항상 새로운 커널을 가리키기 때문에 단순합니다(예: 부트로더 설정에서 쓸 수 있습니다).

부트로더

시스템 부트 로더 설정을 바꾸어 새 커널로 부팅하도록 고르십시오.

마지막으로 새 커널로 시스템을 다시 부팅하십시오.

현재 커널 설정과 기본 설정 비교

Use the following procedure to get an overview of the kernel configuration settings that deviate from the default. Keep in mind that the modification of one configuration setting may alter additional configuration settings.

root #cd /usr/src/linux
root #cp .config ../.config.working
root #make defconfig
root #mv .config ../.config.default
root #cp ../.config.working .config
root #cd ..
root #/usr/src/linux/scripts/diffconfig .config.working .config.default > .config.diff

The search function in make menuconfig can be used to look up the symbols and their interpretations. When you're done, clean up:

root #cd /usr/src/
root #rm .config.working .config.default .config.diff

See also