No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

flash.sh 613B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/sh
  2. if [ "$#" -ne 1 ] ; then
  3. echo "Usage: $0 /dev/disk" >&2
  4. exit 1
  5. fi
  6. # Unmount mounted partitions
  7. for fs in `grep $1 /proc/mounts|cut -d ' ' -f 1` ; do
  8. echo Unmounting $fs
  9. sudo umount $fs
  10. done
  11. echo Overwriting old partition table
  12. sudo dd if=/dev/zero of=$1 bs=1024 count=1024
  13. echo Recreating new partition table
  14. sudo fdisk $1 << EOF
  15. n
  16. p
  17. 1
  18. +16MB
  19. t
  20. 53
  21. n
  22. p
  23. 2
  24. w
  25. EOF
  26. echo Writing bootstream
  27. sudo dd if=output/images/imx23_olinuxino_dev_linux.sb bs=512 of="$1"1 seek=4
  28. echo Writing root filesystem
  29. sudo dd if=output/images/rootfs.ext2 of="$1"2 bs=512
  30. echo Synchronising changes to disk
  31. sudo sync