Qemu For ARM (2) : Get Rootfs.img.gz

The first step to get rootfs is cross compile busybox, please refer to [2]-使用busybox-1.17.2制作文件系统

But I tried some new ways  to get rootfs, after make and  make install(got  __install folder), I do 

steps as below:

1. Copy a new rootfs folder

#cp  -a  __install  rootfs

#cd rootfs

#mkdir -p proc sys dev etc etc/init.d lib

2.Create rcS as below

#!/bin/sh

mount -t proc none /proc

mount -t sysfs none /sys

/sbin/mdev -s

ifconfig  lo  up

ifconfig eth0 192.168.6.10 netmask 255.255.255.0

route add default gw 192.168.6.128

Then copy rcS to rootfs/etc/init.d, and chomd to 777

3.You can copy some libraries such as ld-linux.so,

libgcc_s.so,libm.so*,libc.so* and libdl.so* to rootfs/lib.

All the libraries above can be found in your cross compile toolchain.

4.Use cpio to create rootfs.img.gz

Turn to rootfs folder, typein below words:

#find . | cpio -o --format=newc | gzip > ./rootfs.img.gz

---


你可能感兴趣的:(Qemu For ARM (2) : Get Rootfs.img.gz)