1234567891011121314151617181920212223242526 |
- #! /usr/bin/env sh
-
- if [ $# -ne 1 ]
- then
- echo "Usage: $0 sdx" >&2
- exit 64
- fi
-
- disk="/dev/$1"
- partition=2
-
- if [ ! -b "${disk}" ]
- then
- echo "${disk} does not exists or is not a valid device" >&2
- exit 1
- fi
-
- echo "Copying image..."
- dd if=prololive.img of="${disk}" || {
- echo "Failed to copy image" >&2
- exit 2
- }
-
- echo "Resizing filesystem..."
- echo -e "d\n${partition}\nn\np\n${partition}\n\n\nw\n" | fdisk "${disk}"
- resize2fs "${disk}${partition}"
|