오늘 수고 많으셨습니다.
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.
댓글 4
-
구본규
2012.07.29 09:30
-
이홍우
2012.08.03 10:27
github 에 있는 코드로 해봤는데요.. 잘 됩니다.
저번 시간에 왜 그랬는지 잘 이해가 안되요..
init이 rdinit으로 바뀌긴 했지만., 두 개 모두 테스트했었는데,... 미궁...
작업하면서 사용했던 config 파일들은 github에 올려놨습니다.
-
구본규
2013.06.18 13:09
당시 어떤 이유 때문에 빌드가 안 되었었는지 기억이 나지 않지만,
Config.in이 .gitignore로 등록되어 있어 로컬 파일에는 존재하고 repository에는 없으면 그럴 수도 있겠다는 생각이 듭니다.
-
구본규
2013.08.08 16:50
$ sudo apt-get install libncurses5-dev
$ make install
에러 발생
loginutils/passwd.c: In function ‘passwd_main’: loginutils/passwd.c:104:16: error: storage size of ‘rlimit_fsize’ isn’t known loginutils/passwd.c:188:2: warning: implicit declaration of function ‘setrlimit’ [-Wimplicit-function-declaration] loginutils/passwd.c:188:12: error: ‘RLIMIT_FSIZE’ undeclared (first use in this function) loginutils/passwd.c:188:12: note: each undeclared identifier is reported only once for each function it appears in loginutils/passwd.c:104:16: warning: unused variable ‘rlimit_fsize’ [-Wunused-variable] ... miscutils/time.c:23:16: error: field ‘ru’ has incomplete type
수정내용
diff --git a/include/libbb.h b/include/libbb.h index f12800f..e7806c2 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -40,6 +40,7 @@ #include <sys/poll.h> #include <sys/ioctl.h> #include <sys/mman.h> +#include <sys/resource.h> #include <sys/socket.h> #include <sys/stat.h> #include <sys/time.h>
.
여담으로 github인기가 높네요.
그동안 한 두번 프로젝트 소스만 올려보고 말았는데,
이번 스터디 하면서 열심히 활용해 봐야겠네요.