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製做文件系統linux

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

steps as below:spa

1. Copy a new rootfs folder.net

#cp  -a  __install  rootfscode

#cd rootfsorm

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

2.Create rcS as belowip

#!/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 777get

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

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

---

相關文章
相關標籤/搜索