google-code-export / rk3066-linux

Automatically exported from code.google.com/p/rk3066-linux
0 stars 0 forks source link

Create installation script for Android #10

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Create instalaltion script for android.

Original issue reported on code.google.com by almrob...@gmail.com on 7 Dec 2012 at 8:24

GoogleCodeExporter commented 9 years ago
Something like this?

TODO:
Fix fdisk script.
Error handling.

-------------

#!/bin/bash

#prepare
rm /mnt/sdcard/recovery_image.img
rm /mnt/sdcard/rootfs.tar.gz
cp /mnt/ext_sdcard/picuntu/recovery_image.img /mnt/sdcard/
cp /mnt/ext_sdcard/picuntu/rootfs.tar.gz /mnt/sdcard/

#Flash/copy the recovery partition
busybox dd if=/mnt/sdcard/recovery_image.img of=/dev/block/mtd/by-name/recovery 
bs=8192

#unmount sdcard
umount /mnt/ext_sdcard

#TODO!
#partition the sdcard. p1: FAT32 63Mb, start sector 2048.... p2: The rest of 
the card EXT4
#busybox fdisk /dev/block/mmcblk0 << EOF
#
#w
#q
#EOF

#Create fs
mke2fs -t ext4 /dev/block/mmcblk0p2

#mount new sdcard
mkdir /data/picuntu
mount -t ext4 /dev/block/mmcblk0p2 /data/picuntu

#install rootfs
busybox tar -xvzf /mnt/sdcard/rootfs.tar.gz /data/picuntu

#reboot into the new system
reboot recovery

Original comment by almrob...@gmail.com on 8 Dec 2012 at 11:34