Start Kernel 2.6 + BusyBox as Rootfs in QEMU hardware environment

Source: Internet
Author: User
# # Environment and software version
Ubuntu 14.04 x86_64
Compiler:codesourcery 2009q1 arm-none-linux-gnueabi-i686 [1]
Kernel:linux 2.6.33
rootfs:busybox-1.16.0

# # Compile Kernel 2.6.33
"Shell
# under source code directory
$ make Arch=arm cross_compile=arm-none-linux-gnueabi-o=path/for/compilation versatile_defconfig
$ make Menuconfig arch=arm cross_compile=arm-none-linux-gnueabi-o=path/for/compilation
' Kernel Features ' => (Y) Use the ARM Eabi to compile Kernel
```

"Shell
# under Path/for/compilation directory
$ make-j9 Arch=arm cross_compile=arm-none-linux-gnueabi-uimage-s
```

# # Compile BusyBox 1.16.0
"Shell
# under source code directory
$ make Arch=arm Cross_compile=arm-none-linux-gnueabi-defconfig
$ make Arch=arm Cross_compile=arm-none-linux-gnueabi-menuconfig
' Busybox Settings '-> ' build Options '-> ' builds Busybox as a static binary (no shared libs) '
```

"Shell
# under source code directory
$ make-j9 Arch=arm Cross_compile=arm-none-linux-gnueabi-install
```
Results stay under directory ' _install '.

"Shell
# under _install/
$ mkdir proc Sys Dev etc etc/init.d
```
Create _install/etc/init.d/rcs with the following content
"" txt
#!/bin/sh
MOUNT-T proc None/proc
Mount-t Sysfs None/sys
/sbin/mdev-s
```
ADD EXEC permission to RcS.
"Shell
# under _install/etc/init.d/
$ chmod +x RcS
```

Create Rootfs
"Shell
# under _install/
$ find. | Cpio-o--FORMAT=NEWC >. /rootfs.img
$ cd ... /
$ gzip-c rootfs.img > rootfs.img.gz
$ file Rootfs.img
$ file rootfs.img.gz
```

# # Launch Image on VERSATILEPB board
"Shell
# under QEMU directory
$./qemu-system-arm-m versatilepb-m 128m-initrd path/to/rootfs.img.gz-kernel path/to/zimage-append "Root=/dev/ram Rd Init=/sbin/init console=ttyama0 "-nographic
```

Press ' Enter ' to enter Ramfs.

For more information, see [2].

[1]: https://sourcery.mentor.com/public/gnu_toolchain/arm-none-linux-gnueabi/ arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

[2]: https://balau82.wordpress.com/2010/03/27/busybox-for-arm-on-qemu/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.