diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2010-02-21 23:34:33 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2010-02-21 23:34:33 +0100 |
commit | cd945e49e76927a4c2924523458ceebfc2f859d6 (patch) | |
tree | 522e6d2becd283d0adf9fb63366bd8725a466275 /package/adkinstall/src | |
parent | 3f5ed16b700efcfbc6d3eb0cc54bc63b3aa75ea5 (diff) |
rename ext2-cf target rootfs to ext2-block
- add a foxg20 adkinstaller (not working yet)
- rename ext2-cf target rootfs to ext2-block
Diffstat (limited to 'package/adkinstall/src')
-rw-r--r-- | package/adkinstall/src/adkinstall.foxg20 | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/package/adkinstall/src/adkinstall.foxg20 b/package/adkinstall/src/adkinstall.foxg20 new file mode 100644 index 000000000..fec746ef0 --- /dev/null +++ b/package/adkinstall/src/adkinstall.foxg20 @@ -0,0 +1,51 @@ +#!/bin/sh +# installs a rootfs tar archive from OpenADK onto a micro SD card +# special script for foxboard netus aka foxg20 + +if [ -z $1 ];then + printf "Please give your root tar archive as first parameter\n" + exit 1 +fi +if [ -z $2 ];then + printf "Please give your kernel as second parameter\n" + exit 1 +fi + +printf "Creating partition scheme\n" +parted -s /dev/mmcblk0 mklabel msdos +sleep 2 +maxsize=$(env LC_ALL=C parted /dev/mmcblk0 -s unit cyl print |awk '/^Disk/ { print $3 }'|sed -e 's/cyl//') +rootsize=$(($maxsize-2)) +parted -s /dev/mmcblk0 unit cyl mkpartfs primary fat32 0 5 +parted -s /dev/mmcblk0 unit cyl mkpart primary ext2 5 $rootsize +parted -s /dev/mmcblk0 unit cyl mkpart primary fat32 $rootsize $maxsize +parted -s /dev/mmcblk0 set 1 boot on +sfdisk --change-id /dev/mmcblk0 3 88 >/dev/null 2>&1 +sleep 2 +sync +printf "Installing kernel\n" +mount -t vfat /dev/mmcblk0p1 /mnt +cp $2 /mnt/uImage +sync +umount /mnt +mke2fs /dev/mmcblk0p2 +mount -t ext2 /dev/mmcblk0p2 /mnt + +printf "Extracting install archive\n" +tar -C /mnt -xzpf $1 +if [ $? -ne 0 ];then + printf "Extracting of install archive failed" + exit 1 +fi + +chmod 1777 /mnt/tmp +chmod 4755 /mnt/bin/busybox +sync +umount /mnt +if [ $? -ne 0 ];then + printf "Unmounting filesystem failed" + exit 1 +else + printf "Successfully installed.\n" + exit 0 +fi |