Repository: archlinux/archinstall

Issue:
Does not boot after installation
Hi, after completing installation with this installer rebooting brings me back to the installation menu.  Removing the iso file leaves me with no bootable device.  If I install manually this does not occur.

For reference I am installing on a UEFI system (XPS 17).


Discussion:
> Hi, after completing installation with this installer rebooting brings me back to the installation menu. Removing the iso file leaves me with no bootable device. If I install manually this does not occur.
> 
> For reference I am installing on a UEFI system (XPS 17).

Could you give us the output of:
```
lsblk -o+PARTUUID,UUID,TYPE,SIZE
```
As well as (after the installation is "complete" or fails):
```
cat /mnt/boot/loader/entries/*
```

I suspect this is an old issue that's been fixed in the new release that comes tomorrow, but would be nice to double check and make sure we don't let any bugs slip by :)

Edit: Also `/var/log/archinstall/install.log` would be nice to attach here *(I shouldn't contain any sensitive information, but double check just to be sure)*
same trouble. try reinstall archinstall but trouble not fixed :(
> same trouble. try reinstall archinstall but trouble not fixed :(

Please see above message and give the relevant output.
I'm experiencing the same issue on VMs so I recreated the issue there and have included the requested output.  I was going to include /var/log/archinstall/install.log, but the file was gone after reboot.  I see the sda partitions are not being mounted.  I don't know if this is relevant but I select the option to install awesome when installing and experiencing this error (Have not tried other window managers / desktops). Please let me know if you need any more information.

**Virtual Box:**
```
NAME     MAJ:MIN    RM    SIZE    RO    TYPE    MOUNTPOINT    PARTUUID    UUID    TYPE    SIZE
loop0	7:0	0	618.3M	1	loop	/run/archiso/airootfs	loop	618.3M
sda	8:0	0	8G	0	disk				disk	8GB
sr0	11:0	1	750.3M	0	rom	/run/archiso/bootmnt	2021-04-17-14-14-00	rom	750.3M
```
----------------------------------------
**cat /mnt/boot/loader/entries/* :**
```
#created by: archinstall
#created on: 2021-04-24_13-27-05
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=PARTUUID=d1dc7ed0-819f-4977-ab51-0fb29e0ad51e rw intel_pstate=no_hwp
```
--------------------------------------------------------------------
**Upon Reboot of Virtual Box (After installation):**
```
NAME     MAJ:MIN    RM    SIZE    RO    TYPE    MOUNTPOINT    PARTUUID    UUID    TYPE    SIZE
loop0	7:0	0	618.3M	1	loop	/run/archi	loop	681.3M
sda-
sda1	8:1	0	512	0	part		c8323b58-ee7c-4ec0899f-facd5f028dd7 CA8E-1FCE	part	512M
sda2	8:2	0	7.5G	0	part		d1dc7ed0-819f-4977-ab51-0fb29e0ad51e 3fd14ac7-df52-4ee9-9c82-c2fb08874704	
part	7.5G
sr0	11:0	1	750.3M	0	rom	/run/archi	2021-04-01-17-14-04-00	rom	750.3M
```

-------------------------------------------------------
****/mnt/boot/loader/entries/* after reboot:****
```
zsh: no matches found:/mnt/boot/loader/entries/*
```
Have the same problem as @rf19l on VMWare.
Weird, the boot entry is clearly there.
And it matches the `PARTUUID` of `/dev/sda2`. So I'm assuming this is an issue with the boot loader not being loaded by the BIOS (EFI).

I think it can be related to the workaround mentioned in https://github.com/systemd/systemd/issues/13603#issuecomment-552246188 which is a topic on the Arch Forums as well: https://bbs.archlinux.org/viewtopic.php?pid=1969918#p1969918

I think it's time to properly evaluate if we can introduce writing the vars again, and see if it breaks dual-booting, if not, we'll revert that fix in:
* https://github.com/archlinux/archinstall/blob/3bf7a9e7afe9a1a75f4026e3ff509b68d8f93287/archinstall/lib/installer.py#L380

Resolving patch:
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -381,7 +381,7 @@ def add_bootloader(self, bootloader='systemd-bootctl'):
 			# And in which case we should do some clean up.
 
 			# Install the boot loader
-			sys_command(f'/usr/bin/arch-chroot {self.target} bootctl --no-variables --path=/boot install')
+			sys_command(f'/usr/bin/arch-chroot {self.target} bootctl --path=/boot install')
 
 			# Modify or create a loader.conf
 			if os.path.isfile(f'{self.target}/boot/loader/loader.conf'):
@@ -397,8 +397,11 @@ def add_bootloader(self, bootloader='systemd-bootctl'):
 				for line in loader_data:
 					if line[:8] == 'default ':
 						loader.write(f'default {self.init_time}\n')
+					elif line[:8] == '#timeout' and 'timeout 5' not in loader_data:
+						# We add in the default timeout to support dual-boot
+						loader.write(f"{line[1:]}\n")
 					else:
-						loader.write(f"{line}")
+						loader.write(f"{line}\n")
 
 			## For some reason, blkid and /dev/disk/by-uuid are not getting along well.
 			## And blkid is wrong in terms of LUKS.


Test patch: