카테고리

asm (27) bootloader_x86_grub (1) C (92) compile (11) config (76) CPP (13) CSS (1) debugging (7) gimp (1) Go (1) html (1) Java (1) JavaScript (1) kernel (19) LibreOffice (3) Linux system progamming (21) MFC (1) opencv (4) OpenGL (1) PHP (1) Python (4) qemu (29) shell (3) socket (7) troubleshooting (2) ubuntu18.04 (2) windows (1)

2019/01/05

busybox qemu 설치

rootfs 단일 실행 파일 

최소 단일 루트 파일 시스템 init은 여기 참고 https://nautiluslee.blogspot.com/2019/01/init-hello-world.html

리눅스 가장 작은 라이브 이미지 파일 다운로드 후 qemu 설치 
프로젝트 사이트 : https://github.com/ivandavidov/minimal

- 커널 및 비지박스 다운로드
- 다운로드 받은 파일 컴파일
- 8MB 부팅 가능한 ISO 파일 생성

ISO 이미지 파일은 BysyBox 지원하는 쉘과 연동하게 한다.
QEMU를 사용해 부팅 테스트.
커널 소스 디렉토리에서 실행 되도록 커널 수정 

git clone https://github.com/ivandavidov/minimal
cd minimal/src
./build_minimal_linux_live.sh
# QEMU 설치.
# minimal_linux_live.iso 생성.
./qemu64.sh

루트파일 시스템 빌드
Makefile 스크립트로 프로젝트 관리: 
- gcc 크로스 컴파일 툴체인
- 커널 컴파일
- 부트로더 컴파일
- rootfs 생성
- GTK와 같은 복잡한 내용을 포함하여 소스 트리에서 수많은 의존성 패키지 다운로드.

git clone git://git.buildroot.net/buildroot
cd buildroot
git checkout 2016.05
make qemu_x86_defconfig
# -jN 대신, `BR2_JLEVEL=2`를 사용.
BR2_JLEVEL=2 make
# cat board/qemu/x86_64/readme.txt
qemu-system-x86_64 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append root=/dev/vda -net nic,model=virtio -net user
# BusyBox 쉘 동작.

X11 추가 하고 참고: 
https://nautiluslee.blogspot.com/2019/01/x11-blackbox-qemu.html

5MB인 임베디드용 패키지 https://github.com/gliderlabs/docker-alpine
busybox 보다 더욱 가벼운. 

댓글 없음:

댓글 쓰기