2013年8月30日 星期五

Build Rootfs by Busybox for ARM on QEMU

Download busybox first:
$> wget http://busybox.net/downloads/busybox-1.21.1.tar.bz2
$> tar xvf busybox-1.21.1.tar.bz2

Configure:
$> make menuconfig
------------------------------------------------------------------------------------------------------------
Busybox settings --> Build option
                                     "Build busybox as a static binary"
                           --> cross compiler prefix
                                      "arm-none-linux-gnueabi-"                       <----Depends on your cross_compiler
------------------------------------------------------------------------------------------------------------
$> make
$> make install
Now we can build rootfs.img:
$> cd _install
$> mkdir proc sys dev etc etc/init.d
$> cat << EOF > etc/init.d/rcS
#!/bin/sh
mount -t proc none /proc
mount -t sysfs none /sys
/sbin/mdev -s
EOF
$> chmod +x etc/init.d/rcS
$> find . | cpio -o --format=newc > ../rootfs.img
Create rootfs.img.gz:
$> cd ..
$> gzip -c rootfs.img > rootfs.img.gz

沒有留言:

張貼留言