[추가] linux, busybox .config / build 방법

구본규 2012.07.29 00:48 조회 수 : 13177

오늘 수고 많으셨습니다.


buildroot에서 빌드한 linux config와 busybox config입니다.


kernel 버전은 mainline git repository이고(3.5.0-rc7), busybox는 1.20.1입니다.


kernel 이미지는 cpio 파일까지 포함해 빌드했고,

busybox는 buildroot가 library까지 복사해 주기에 static library 옵션을 사용하진 않았습니다.


회사에서는 buildroot 안 쓰고 저번에 올린 게시글대로 해서 성공했으니 역시 오늘 사용한 커널 소스가 의심스럽습니다.



참고로 오늘 나왔던 shell에서 vi 명령 사용하는 설정은

set -o vi

 

export EDITOR=vi

 

export VISUAL=vi


중 아무거나 사용하면 된다고 하네요. 전 set -o vi를 환경변수에 넣어놓고 씁니다.



bash가 emacs 또는 vi 방식을 지원하는데 emacs가 default고, 전 vi 명령이 익숙해서 vi로 바꾸는 것이지요.



그럼 다음주에 뵈어요.


************************************************************

    [추가] 위 내용이 buildroot로 빌드한 .config에 해당하구요, (이우성님께서 메일로 전달하신 내용)

    오늘 iamroot git와 새로 다운 받은 busybox로 빌드해 보았습니다.

************************************************************


환경: fedora 16 x86_64 버전

1. qemu 설치
linaro qemu 다운로드. 압축해제
$ ./configure --target-list=arm-softmmu,arm-linux-user
$ make -j 4
$ sudo make install
$ qemu-system-arm --version

2. cross compiler 설치
* linaro 2012.06 toolchain binary download
* 압축 풀어 /opt/linaro-201206에 복사
* 환경변수 설정
PATH=$PATH:/opt/linaro-201206/bin
export PATH
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-

3. busybox build
$ cd busybox-1.20.2
$ make clean && make distclean
$ make menuconfig
  │ Symbol: DESKTOP [=n]                                                                                                                                        │  
  │ Prompt: Enable options for full-blown desktop systems                                                                                                       │  
  │   Defined at Config.in:16                                                                                                                                   │  
  │   Location:                                                                                                                                                 │  
  │     -> Busybox Settings                                                                                                                                     │  
  │       -> General Configuration

  │ Symbol: FEATURE_INETD_RPC [=n]                                                                                                                              │  
  │ Prompt: Support RPC services                                                                                                                                │  
  │   Defined at networking/Config.in:592                                                                                                                       │  
  │   Depends on: INETD                                                                                                                                         │  
  │   Location:                                                                                                                                                 │
  │     -> Networking Utilities                                                                                                                                 │
  │       -> inetd (INETD [=y])                                                                                                                                 │
  │   Selects: FEATURE_HAVE_RPC

  │ Symbol: STATIC [=y]                                                                                                                                         │
  │ Prompt: Build BusyBox as a static binary (no shared libs)                                                                                                   │
  │   Defined at Config.in:463                                                                                                                                  │
  │   Location:                                                                                                                                                 │
  │     -> Busybox Settings                                                                                                                                     │
  │       -> Build Options


$ make -j 4 && make install
$ cd _install
$ find . | cpio -o --format newC > ../rootfs.img

4. kernel build
$ make clean && make distclean
$ make vexpress_defconfig
$ make menuconfig
  │ Symbol: BLK_DEV_INITRD [=y]                                                                                                                                 │
  │ Type  : boolean                                                                                                                                             │
  │ Prompt: Initial RAM filesystem and RAM disk (initramfs/initrd) support                                                                                      │
  │   Defined at init/Kconfig:1093                                                                                                                              │
  │   Depends on: BROKEN [=n] || !FRV                                                                                                                           │
  │   Location:                                                                                                                                                 │
  │     -> General setup

$ make -j 4


5. qemu 실행
$ qemu-system-arm -M vexpress-a9 -m 1024M -snapshot -s -S -kernel arch/arm/boot/zImage -initrd ../rootfs.img -serial stdio -append "root=/dev/ram rdinit=/sbin/init console=ttyAMA0 debug"

6. gdb 실행
$ arm-linux-gnueabihf-gdb vmlinux                                                                                                                                  
GNU gdb (crosstool-NG linaro-1.13.1-2012.06-20120625 - Linaro GCC 2012.06) 7.4-2012.06
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-build_pc-linux-gnu --target=arm-linux-gnueabihf".
For bug reporting instructions, please see:
<https://bugs.launchpad.net/gcc-linaro>...
Reading symbols from /home/freestyle/kernel/linux-git/vmlinux...done.
(gdb) set print pretty
(gdb) target remote :1234
Remote debugging using :1234
0x60000000 in ?? ()
(gdb) b start_kernel
Breakpoint 1 at 0x8043650c: file init/main.c, line 471.
(gdb) c
Continuing.

Breakpoint 1, start_kernel () at init/main.c:471
471 {
(gdb) c
Continuing.


[출처] se


d

번호 제목 글쓴이 날짜 조회 수
공지 [공지] 커널 스터디 관련 Q&A 게시판 입니다. [5] woos 2016.04.09 2194
1725 [잡담] O(1) 스케쥴러에서 [5] 박은병 2008.04.02 13742
1724 u-boot 분석 참고자료 file 구본규 2012.07.27 13313
» [추가] linux, busybox .config / build 방법 [4] file 구본규 2012.07.29 13177
1722 CFS 스케줄러 기초 정리 홍문화 2011.05.27 12874
1721 이클립스에서 ARM Linux 개발 툴 사용하기(DS-5) [1] file 와사 2013.08.15 12867
1720 x86 linux booting 과정 file 백창우 2007.02.23 12734
1719 [문의] linux device driver 개정 3판 가지고 계신분? [6] 맥주 2008.03.27 12442
1718 링크 레지스터 오프셋 [6] 정현철 2011.06.12 12360
1717 안녕하세요~ 소성은 입니다~ [5] file 소성은 2010.04.05 12159
1716 [문서] 커널 분석 문서입니다. file 맥주 2008.11.10 12087
1715 커널 소스 분석에 도움을 주는 도구들 구본규 2012.08.06 12006
1714 RealMode? ProtectedMode? [2] 김태훈91 2012.05.11 11951
1713 linux부팅과정 설명 문서 [3] file 이상철 2009.03.18 11768
1712 ELF 파일 포맷 정리 [6] 도영주 2013.05.04 11536
1711 [x86] fixed_addresses pororo 2012.03.04 11498
1710 kernel stack과 이를 이용하는 context_switch()사이의 연관성에 대한 질문 [11] 이종인 2011.05.27 11433
1709 memory map in powerpc kernel [1] file 김강년 2007.07.08 11267
1708 커널 스터디 6기 멤버 소개(arm-11 mp-core) 소개 페이지로 이동 예정 [4] 강진성 2010.03.24 11224
1707 리눅스 커널 초기화(ARM) 참고 자료 [2] file 유강희 2010.04.07 11221
1706 다들 주무시죠?? 자~ 질문입니다 ㅋ [4] 변유준 2007.06.16 11220
XE Login