# Install a bog-standard Debian bootable for ODROID XU3/XU4.
# Note that this will only work for SD cards; MMC devices
# Install a bog-standard Debian bootable for ODROID XU3/XU4.
# Note that this will only work for SD cards; MMC devices
-if [ ! -b "$DEVICE" ] || [ ! "$BOOTPART_MB" -gt 0 ]; then
- echo "Usage: $0 DEVICE BOOTPARTITION_SIZE [SUITE [OTHER_DEBOOTSTRAP_ARGS...]]"
+DEVICE=$1
+if [ ! -b "$DEVICE" ]; then
+ echo "Usage: $0 [-b BOOTPARTITION_SIZE] [-s SUITE] DEVICE [OTHER_DEBOOTSTRAP_ARGS...]"
# from ext4, but using FAT is somehow traditional and less likely to be broken
# at any given time. (It doesn't support symlinks, though, which breaks flash-kernel,
# but we don't use that anyway.)
# from ext4, but using FAT is somehow traditional and less likely to be broken
# at any given time. (It doesn't support symlinks, though, which breaks flash-kernel,
# but we don't use that anyway.)
# Put an LVM on the other partition; it's easier to deal with when expanding
# partitions or otherwise moving them around.
# Put an LVM on the other partition; it's easier to deal with when expanding
# partitions or otherwise moving them around.
debootstrap --include=linux-image-armmp-lpae,grub-efi-arm,lvm2,isc-dhcp-client --foreign --arch armhf ${SUITE} /mnt/xu4 "$@"
# Run the second stage debootstrap under qemu (via binfmt_misc).
debootstrap --include=linux-image-armmp-lpae,grub-efi-arm,lvm2,isc-dhcp-client --foreign --arch armhf ${SUITE} /mnt/xu4 "$@"
# Run the second stage debootstrap under qemu (via binfmt_misc).