summaryrefslogtreecommitdiff
path: root/airootfs/root/bootstrap
blob: 456345ce4189a890cf464f816c4edeeec3c81a61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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