diff options
author | Tom Barrett <tom@tombarrett.xyz> | 2021-04-28 13:04:48 +0200 |
---|---|---|
committer | Tom Barrett <tom@tombarrett.xyz> | 2021-04-28 13:04:48 +0200 |
commit | 44e0707d428de04919a33f325d4e612335bdb777 (patch) | |
tree | a6854f622321f85845889d3dc38d58a37a708544 /airootfs/root/bootstrap | |
parent | a4d0ccb56bf9b426f69d70c185d680b08b9bd25c (diff) |
good testing environment
Diffstat (limited to 'airootfs/root/bootstrap')
-rwxr-xr-x | airootfs/root/bootstrap | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/airootfs/root/bootstrap b/airootfs/root/bootstrap new file mode 100755 index 0000000..456345c --- /dev/null +++ b/airootfs/root/bootstrap @@ -0,0 +1,28 @@ +#!/bin/bash +set -e + +if ! timeout 1 curl -Is tombarrett.xyz | grep "200 OK" > /dev/null; then + echo "Please first connect to the internet." + exit +fi + +if ! test -b "$1"; then + echo "Please pass an existing drive as an argument. ie /dev/sda" + exit +fi + +parted -s "$1" mklabel gpt + +if ! test -f "/sys/firmware/efi/efivars"; then + parted "$1" mkpart bios ext4 0% 513MiB + parted "$1" set 1 bios_grub on + parted "$1" mkpart home ext4 513MiB 100% +else + parted "$1" mkpart efi fat32 0% 513MiB + parted "$1" set 1 esp on + parted "$1" mkpart home ext4 513MiB 100% +fi + +mount "$1"2 /mnt + +timedatectl set-ntp true |