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.

dd_prololive.sh 455B

1234567891011121314151617181920212223242526
  1. #! /usr/bin/env sh
  2. if [ $# -ne 1 ]
  3. then
  4. echo "Usage: $0 sdx" >&2
  5. exit 64
  6. fi
  7. disk="/dev/$1"
  8. partition=2
  9. if [ ! -b "${disk}" ]
  10. then
  11. echo "${disk} does not exists or is not a valid device" >&2
  12. exit 1
  13. fi
  14. echo "Copying image..."
  15. dd if=prololive.img of="${disk}" || {
  16. echo "Failed to copy image" >&2
  17. exit 2
  18. }
  19. echo "Resizing filesystem..."
  20. echo -e "d\n${partition}\nn\np\n${partition}\n\n\nw\n" | fdisk "${disk}"
  21. resize2fs "${disk}${partition}"