星期二, 1月 19, 2010

Android root file system

1. Download and Compile unyaffs
gcc -o unyaffs unyaffs.c

2. ramdisk.img

mkdir android_rootfs
cd android_rootfs
cp ~/android-sdk-linux_86/platforms/android-2.1/images/ramdisk.img ramdisk.img.gz
gzip -d ramdisk.img.gz
cpio -i -F ramdisk.img

3. system.img and userdata.img
cd system
~/unyaffs/unyaffs ~/android-sdk-linux_86/platforms/android-2.1/images/system.img
cd ../data
~/unyaffs/unyaffs ~/android-sdk-linux_86/platforms/android-2.1/images/userdata.img
cd ..

4. device
sudo mknod dev/console c 5 1
sudo mknod
dev/null c 1 3
sudo mknod dev/tty2 c 4 2
sudo mknod
dev/tty3 c 4 3
sudo mknod
dev/tty4 c 4 4
sudo mknod dev/fb0 c 29 0

5. Board Dependent
sed 's/goldfish/AT91SAM9261-EK/g' init.goldfish.rc > init.AT91SAM9261-EK.rc
mv system/etc/init.goldfish.sh system/etc/init.AT91SAM9261-EK.sh

6. Modify init.rc for NFS Boot by commenting out mount commands
mount rootfs rootfs / ro remount

mount yaffs2 mtd@system /system
mount yaffs2 mtd@system /system ro remount
mount yaffs2 mtd@userdata /data nosuid nodev
mount yaffs2 mtd@cache /cache nosuid nodev

cp init.rc init.rc.bak
sed -e 's/mount rootfs/#mount rootfs/g' init.rc.bak > init.rc.tmp
sed -e 's/mount yaffs2/#mount yaffs2/g' init.rc.tmp > init.rc



References
[1] Android on OMAP, http://elinux.org/Android_on_OMAP
[2] Unyaff, http://code.google.com/p/unyaffs/

沒有留言: