diff options
author | Tom Barrett <tom@tombarrett.xyz> | 2021-04-29 11:24:13 +0200 |
---|---|---|
committer | Tom Barrett <tom@tombarrett.xyz> | 2021-04-29 11:24:13 +0200 |
commit | 3d48fbb25c5a320b6893d308ec456c536adf1ae2 (patch) | |
tree | 9c134331315556735db366457d7a373dc2e2ce23 /airootfs/root/bootstrap | |
parent | 44e0707d428de04919a33f325d4e612335bdb777 (diff) |
need a second script for after the chroot, also added grub setup
Diffstat (limited to 'airootfs/root/bootstrap')
-rwxr-xr-x | airootfs/root/bootstrap | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/airootfs/root/bootstrap b/airootfs/root/bootstrap index 456345c..7e65be7 100755 --- a/airootfs/root/bootstrap +++ b/airootfs/root/bootstrap @@ -11,18 +11,37 @@ if ! test -b "$1"; then exit fi +if [ -z "$2" ]; then + echo "Please pass a hostname also as the second argument." + exit +fi + parted -s "$1" mklabel gpt if ! test -f "/sys/firmware/efi/efivars"; then parted "$1" mkpart bios ext4 0% 513MiB + mkfs.ext4 "$1"1 parted "$1" set 1 bios_grub on parted "$1" mkpart home ext4 513MiB 100% else parted "$1" mkpart efi fat32 0% 513MiB + mkfs.fat -F 32 "$1"1 parted "$1" set 1 esp on parted "$1" mkpart home ext4 513MiB 100% fi +mkfs.ext4 "$1"2 + mount "$1"2 /mnt +mkdir -p /mnt/boot/efi +mount "$1"1 /mnt/boot/efi timedatectl set-ntp true + +pacman-key --init +pacman-key --populate +pacstrap /mnt base linux linux-firmware git vim grub + +genfstab -U /mnt > /mnt/etc/fstab +cp /root/.loader /mnt/root/loader +arch-chroot /mnt /root/loader $1 $2 |