diff options
author | Tom Barrett <tom@tombarrett.xyz> | 2021-07-21 22:20:48 +0200 |
---|---|---|
committer | Tom Barrett <tom@tombarrett.xyz> | 2021-07-21 22:20:48 +0200 |
commit | fff917132ec4ddb5ef8f34ac790d9959963dd74a (patch) | |
tree | 091871643fe86021115bc43f55002fe53f21963b /airootfs/root/bootstrap | |
parent | 11c7f231d2cf06245b52e302868337ea44b6081f (diff) |
now with encryption
Diffstat (limited to 'airootfs/root/bootstrap')
-rwxr-xr-x | airootfs/root/bootstrap | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/airootfs/root/bootstrap b/airootfs/root/bootstrap index f059cc0..8876c5e 100755 --- a/airootfs/root/bootstrap +++ b/airootfs/root/bootstrap @@ -19,29 +19,40 @@ fi parted -s "$1" mklabel gpt if ! test -e "/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% + BOOT_DIR="$1"2 + ROOT_DIR="$1"3 + + parted -s "$1" mkpart grub 0% 1MiB + parted -s "$1" set 1 bios_grub on + + parted -s "$1" mkpart grubcfg 1MiB 513MiB + mkfs.ext4 "$BOOT_DIR" + + parted -s "$1" mkpart root 513MiB 100% else - parted "$1" mkpart efi fat32 0% 513MiB - mkfs.fat -F 32 "$1"1 - parted "$1" set 1 boot on - parted "$1" mkpart home ext4 513MiB 100% + BOOT_DIR="$1"1 + ROOT_DIR="$1"2 + + parted -s "$1" mkpart efi fat32 0% 513MiB + mkfs.fat -F 32 "$BOOT_DIR" + parted -s "$1" set 1 boot on + + parted -s "$1" mkpart home ext4 513MiB 100% fi -mkfs.ext4 "$1"2 +cryptsetup luksFormat "$ROOT_DIR" +cryptsetup open "$ROOT_DIR" root +mkfs.ext4 /dev/mapper/root -mount "$1"2 /mnt -mkdir -p /mnt/boot/efi -mount "$1"1 /mnt/boot/efi +mount /dev/mapper/root /mnt +mkdir -p /mnt/boot/ +mount "$BOOT_DIR" /mnt/boot timedatectl set-ntp true pacman-key --init pacman-key --populate -pacstrap /mnt base linux linux-firmware git vim grub efibootmgr +pacstrap /mnt base linux linux-firmware git vim grub efibootmgr arch-install-scripts -genfstab -U /mnt > /mnt/etc/fstab cp /root/.loader /mnt/root/loader -arch-chroot /mnt /root/loader $1 $2 +arch-chroot /mnt /root/loader "$1" "$2" "$ROOT_DIR" |