SW 개발

[Linux Kernel] 리눅스 커널빌드시 ouput 디렉토리 지정하기

. . . 2012. 1. 31. 09:19
반응형

이전 2.6 커널기준 이며, 최신커널에서는 해당내용들에 해당하지 않습니다.

리눅스 커널빌드시에 오브젝트 및 vmlinux 이미지를 원하는 디렉토리에 떨어지게 할수있다.

O 옵션을 사용

  • 출처 : http://www.linuxtopia.org/online_books/linux_kernel/kernel_configuration/ch05s04.html
## Source in one place, output in another

Sometimes it is easier to have the source code for the kernel tree in a read-only location (such as on a CD-ROM, or in a source code control system), and place the output of the kernel build elsewhere, so that you do not disturb the original source tree. The kernel build system handles this easily, by requiring only the single argument `O=` to tell it where to place the output of the build. For example, if the kernel source is located on a CD-ROM mounted on `/mnt/cdrom/` and you wish to place the built files in your local directory, enter:

$ cd /mnt/cdrom/linux-2.6.17.11/
$ make O=~/linux/linux-2.6.17.11

All of the build files will be created in the `~/linux/linux-2.6.17.11/` directory. Please note that this `O=` option should also be passed to the configuration options of the build so that the configuration is correctly placed in the output directory and not in the directory containing the source code.
  • 대문자 "O" 와 함께 make를 하면 된다.
  • 해당 디렉토리는 상대경로, 절대 경로 모두 가능하다
  • 해당 디렉토리는 미리 생성되어 있어야한다.
  • 해당 디렉토리 안에는 커널 config 파일이 있어야한다.

make menuconfig 에서 생성된 파일 (특정 파일이름이라면..) output 딜렉토리에 .config 라는 이름으로 카피를 해놔야 한다.

반응형