Skip to content

Commit

Permalink
reduce dependencies for bootstrap script
Browse files Browse the repository at this point in the history
  • Loading branch information
brabster committed Mar 4, 2024
1 parent 9e1d133 commit 8b41224
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions setup_bootstrap_ansible_usb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,22 @@ USB_DEVICE=$1
SCRIPT_DIR=$(dirname "$0")

echo "Wiping ${USB_DEVICE} MBR"
dd if=/dev/zero of=${USB_DEVICE} bs=512 count=1 conv=notrunc
dd if=/dev/zero of=${USB_DEVICE} bs=512 count=10

echo "Partitioning ${USB_DEVICE}"
parted --script "${USB_DEVICE}" \
mklabel gpt \
mkpart primary 0% 100$

fdisk -l ${USB_DEVICE}
parted -l

parted --script "${USB_DEVICE}" mklabel gpt mkpart primary 0% 100%

parted -l

USB_PARTITION=${USB_DEVICE}1

echo "Formatting partition ${USB_PARTITION}"
mkfs.ext4 -L xubuntu_setup "${USB_PARTITION}"
mkfs.ext4 -vL xubuntu_setup "${USB_PARTITION}"

echo "Mounting new partition"
MOUNT_DIR=$(mktemp -d)
mount -t auto -v "${USB_PARTITION}" "${MOUNT_DIR}"

Expand Down

0 comments on commit 8b41224

Please sign in to comment.