summaryrefslogtreecommitdiff
path: root/airootfs
diff options
context:
space:
mode:
authorTom Barrett <tom@tombarrett.xyz>2023-01-22 21:22:02 +0100
committerTom Barrett <tom@tombarrett.xyz>2023-01-22 21:22:02 +0100
commit7f43546f853e4ff6e14678a4c6d69cd9fc06c56c (patch)
tree010e7860e6300ed7ce9f0686a40fe45d2de5c6c1 /airootfs
parent9c990fca729353b9076cf109e732fd2a55573d81 (diff)
uuid didn't come up in chroot, fix vars from -e, new mkinitcpio hooks
Diffstat (limited to 'airootfs')
-rwxr-xr-xairootfs/root/.loader7
-rwxr-xr-xairootfs/root/bootstrap7
2 files changed, 7 insertions, 7 deletions
diff --git a/airootfs/root/.loader b/airootfs/root/.loader
index 763bae2..c396aa0 100755
--- a/airootfs/root/.loader
+++ b/airootfs/root/.loader
@@ -20,14 +20,13 @@ echo "127.0.0.1 localhost" > /etc/hosts
echo "::1 localhost" >> /etc/hosts
echo "127.0.1.1 $2.lan $2" >> /etc/hosts
-OLD="HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)"
-NEW="HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt filesystems fsck)"
+OLD="HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block filesystems fsck)"
+NEW="HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block encrypt filesystems fsck)"
sed -i "s|$OLD|$NEW|g" /etc/mkinitcpio.conf
mkinitcpio -P
-UUID=$(lsblk --output UUID,PATH | grep "$3" | cut -f 1 -d ' ')
OLD="GRUB_CMDLINE_LINUX_DEFAULT=\"loglevel=3 quiet\""
-NEW="GRUB_CMDLINE_LINUX_DEFAULT=\"loglevel=3 quiet cryptdevice=UUID=$UUID:cryptroot root=/dev/mapper/cryptroot\""
+NEW="GRUB_CMDLINE_LINUX_DEFAULT=\"loglevel=3 quiet cryptdevice=UUID=$3:cryptroot root=/dev/mapper/cryptroot\""
sed -i "s|$OLD|$NEW|g" /etc/default/grub
if ! test -e "/sys/firmware/efi/efivars"; then
diff --git a/airootfs/root/bootstrap b/airootfs/root/bootstrap
index 5bfcf11..4da3804 100755
--- a/airootfs/root/bootstrap
+++ b/airootfs/root/bootstrap
@@ -6,12 +6,12 @@ if ! timeout 1 curl -Is tombarrett.xyz | grep "200 OK" > /dev/null; then
exit
fi
-if ! test -b "$1"; then
+if ! test -b "${1:-}"; then
echo "Please pass an existing drive as an argument. ie /dev/sda"
exit
fi
-if [ -z "$2" ]; then
+if [ -z "${2:-}" ]; then
echo "Please pass a hostname also as the second argument."
exit
fi
@@ -56,4 +56,5 @@ pacman-key --populate
pacstrap /mnt base linux linux-firmware git vim grub efibootmgr arch-install-scripts networkmanager
cp /root/.loader /mnt/root/loader
-arch-chroot /mnt /root/loader "$1" "$2" "$ROOT_DIR"
+UUID=$(lsblk --output UUID,PATH | grep "$ROOT_DIR" | cut -f 1 -d ' ')
+arch-chroot /mnt /root/loader "$1" "$2" "$UUID"