From 19b9df780c8660285168279506a06ac06bb6f407 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Sat, 20 Sep 2025 12:16:14 -0400 Subject: New bootloadeer and disk layout is working --- installer/run.sh | 85 ++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 58 insertions(+), 27 deletions(-) (limited to 'installer/run.sh') diff --git a/installer/run.sh b/installer/run.sh index e927bf7..93b8ef7 100644 --- a/installer/run.sh +++ b/installer/run.sh @@ -19,6 +19,15 @@ CONFIGURE="${CONFIGURE:-yes}" LOGIND="${LOGIND:-yes}" GRAPHICS="${GRAPHICS:-yes}" +ping -c 3 8.8.4.4 >/dev/null 2>&1 || exec sh -c "echo No internet access. Please try again after connecting to the internet." +if [ "$(id -u)" -ne 0 ] ; then + echo "Run this script as root, i.e. with sudo" + exit 1 +fi + +# temporary Workaround for slow mirrors +reflector | grep rit.edu > /etc/pacman.d/mirrorlist + echo "############################################################" echo "INSTALL PROCESS" echo "############################################################" @@ -92,11 +101,9 @@ fi _part1="${_disk}1" _part2="${_disk}2" -_part3="${_disk}3" if echo "$_disk" | grep "nvme" ; then _part1="${_disk}p1" _part2="${_disk}p2" - _part3="${_disk}p3" fi @@ -105,28 +112,26 @@ wipefs -a "$_disk" sgdisk --zap-all "$_disk" sgdisk --hybrid "$_disk" sgdisk \ - --new=1::+1G --typecode=1:ef00 \ - --new=2::+2G --typecode=2:8300 \ - --largest-new=3 --typecode=3:8e00 \ + --new=1::+2G --typecode=1:ef00 \ + --largest-new=2 --typecode=2:8e00 \ "$_disk" partprobe >/dev/null 2>&1 || echo "" mkfs.vfat -F 32 "$_part1" -mkfs.ext4 "$_part2" set +x echo "You will now enter your passphrase for ${_red}disk encryption${_clear}: " -cryptsetup luksFormat "$_part3" +cryptsetup luksFormat "$_part2" -_part3_uuid="$(blkid -o json "$_part3" | jq -r .uuid | tr -d '\n')" -if [ -z "$_part3_uuid" ] ; then +_part2_uuid="$(blkid -o json "$_part2" | jq -r .uuid | tr -d '\n')" +if [ -z "$_part2_uuid" ] ; then echo "${_red}Unable to find UUID for partition 3, bailing${_clear}" exit 1 fi echo "We're now going to unlock that disk with the same passhrase: " -cryptsetup luksOpen "$_part3" "$_cryptname" +cryptsetup luksOpen "$_part2" "$_cryptname" set -x mkfs.btrfs /dev/mapper/"$_cryptname" @@ -134,18 +139,22 @@ mkfs.btrfs /dev/mapper/"$_cryptname" mount /dev/mapper/"$_cryptname" "$_mnt" cd "$_mnt" -btrfs sub create root -btrfs sub create home +btrfs sub create @ +btrfs sub create @home +btrfs sub create @log +btrfs sub create @pkg cd - umount /dev/mapper/"$_cryptname" -mount -o subvol=root,compress=zstd /dev/mapper/"$_cryptname" "$_mnt" +mount -o subvol=@,compress=zstd /dev/mapper/"$_cryptname" "$_mnt" mkdir -p "$_mnt"/home -mount -o subvol=home,compress=zstd /dev/mapper/"$_cryptname" "$_mnt"/home +mount -o subvol=@home,compress=zstd /dev/mapper/"$_cryptname" "$_mnt"/home +mkdir -p "$_mnt"/var/log +mount -o subvol=@log,compress=zstd /dev/mapper/"$_cryptname" "$_mnt"/var/log +mkdir -p "$_mnt"/var/cache/pacman/pkg +mount -o subvol=@pkg /dev/mapper/"$_cryptname" "$_mnt"/var/cache/pacman/pkg mkdir -p "$_mnt"/boot -mount "$_part2" "$_mnt"/boot -mkdir -p "$_mnt"/boot/efi -mount "$_part1" "$_mnt"/boot/efi +mount "$_part1" "$_mnt"/boot set +x @@ -346,6 +355,8 @@ pacstrap -K "$_install_path" \ xorg-server \ xorg-xkill \ zsh \ + opencl-mesa \ + limine \ zstd set +x @@ -374,23 +385,43 @@ sed -i \ do_chroot mkinitcpio -p linux -sed -i \ - -e 's/^GRUB_CMDLINE_LINUX_DEFAULT=.*$/GRUB_CMDLINE_LINUX_DEFAULT=""/' \ - "${_install_path}"/etc/default/grub - -sed -i \ - -e 's@^GRUB_CMDLINE_LINUX=.*$@GRUB_CMDLINE_LINUX="cryptdevice=UUID='"$_part3_uuid"':'"$_cryptname"'"@g' \ - "${_install_path}"/etc/default/grub +# sed -i \ +# -e 's/^GRUB_CMDLINE_LINUX_DEFAULT=.*$/GRUB_CMDLINE_LINUX_DEFAULT=""/' \ +# "${_install_path}"/etc/default/grub +# +# sed -i \ +# -e 's@^GRUB_CMDLINE_LINUX=.*$@GRUB_CMDLINE_LINUX="cryptdevice=UUID='"$_part2_uuid"':'"$_cryptname"'"@g' \ +# "${_install_path}"/etc/default/grub # do_edit /etc/default/grub # Make this bootable directly as removable media -do_chroot grub-install --target=x86_64-efi --removable --efi-directory=/boot/efi +# do_chroot grub-install --target=x86_64-efi --removable --efi-directory=/boot/efi # But also add an entry to the uEFI, and set it as default -do_chroot grub-install --target=x86_64-efi --efi-directory=/boot/efi +# do_chroot grub-install --target=x86_64-efi --efi-directory=/boot/efi -do_chroot grub-mkconfig -o /boot/grub/grub.cfg +# do_chroot grub-mkconfig -o /boot/grub/grub.cfg + +do_chroot mkdir -p /boot/EFI/BOOT +do_chroot mkdir -p /boot/EFI/limine + +do_chroot cp /usr/share/limine/BOOTX64.EFI /boot/EFI/BOOT/BOOTX64.EFI +do_chroot cp /usr/share/limine/BOOTX64.EFI /boot/EFI/limine/limine.efi + +efibootmgr --create --disk "$_disk" --part 1 --label "Arch Linux Limine Bootloader" \ + --loader "\EFI\limine\limine.efi" \ + --unicode + +cat > "$_install_path"/boot/limine.conf <