~craig.magina/junk/pandakit

« back to all changes in this revision

Viewing changes to omap4-netboot-mkcard.sh

  • Committer: Robie Basak
  • Date: 2012-01-29 15:38:42 UTC
  • Revision ID: robie.basak@canonical.com-20120129153842-um6rsrhcz8vbvwho
Initial revision

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
set -e
 
4
set -x
 
5
 
 
6
export http_proxy=http://192.168.12.1:3128/
 
7
 
 
8
if [ ! "$1" = "/dev/sda" ] ; then
 
9
    unset LANG
 
10
    DRIVE=$1
 
11
    if [ -b "$DRIVE" ] ; then
 
12
        dd if=/dev/zero of=$DRIVE bs=1024 count=1024
 
13
        SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'`
 
14
        echo DISK SIZE - $SIZE bytes
 
15
        CYLINDERS=$[$SIZE/255/63/512]
 
16
        echo CYLINDERS - $CYLINDERS
 
17
        {
 
18
        echo ,9,0x0C,*
 
19
        } | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE
 
20
        mkfs.vfat -F 32 -n "boot" ${DRIVE}p1
 
21
    fi 
 
22
    
 
23
    if [ -b "${DRIVE}p1" ] ; then
 
24
        mount ${DRIVE}p1 /mnt
 
25
        wget -O /mnt/MLO http://ports.ubuntu.com/ubuntu-ports/dists/oneiric/main/installer-armel/current/images/omap4/netboot/MLO
 
26
        wget -O /mnt/u-boot.bin http://ports.ubuntu.com/ubuntu-ports/dists/oneiric/main/installer-armel/current/images/omap4/netboot/u-boot.bin
 
27
        echo "setenv pxecfg_ram 0x88000000;setenv kernel_ram 0x80000000;setenv initrd_ram 0x81600000;pxecfg get;pxecfg boot" > /mnt/ENV.txt
 
28
        umount /mnt
 
29
    fi
 
30
fi