Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-03-14 11:53:59 +0100
committerAnton Hvornum <anton@hvornum.se>2021-03-14 11:53:59 +0100
commit5483b218fd62fcea8648525eb8aa6b7af4cc200b (patch)
treed217d810fb2261a7177c03b0c2bfd35bd41b714f /archinstall
parente2aeb3a32faa397db899f4105a16f31a095387be (diff)
Removing hardcoded boot-loader config name. #51.
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/installer.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index 06bdd05a..b45ad1dc 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -311,18 +311,24 @@ class Installer():
self.log(f'Adding bootloader {bootloader} to {self.boot_partition}', level=LOG_LEVELS.Info)
if bootloader == 'systemd-bootctl':
+ # TODO: Ideally we would want to check if another config
+ # points towards the same disk and/or partition.
+ # And in which case we should do some clean up.
+ unique_loader_conf_name = hashlib.md5(os.urandom(12)+bytes(str(time.time()), 'UTF-8')).hexdigest()
+
o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.mountpoint} bootctl --no-variables --path=/boot install'))
with open(f'{self.mountpoint}/boot/loader/loader.conf', 'w') as loader:
- loader.write('default arch\n')
- loader.write('timeout 5\n')
+ loader.write(f'default {unique_loader_conf_name}\n')
+ loader.write(f'timeout 5\n')
## For some reason, blkid and /dev/disk/by-uuid are not getting along well.
## And blkid is wrong in terms of LUKS.
#UUID = sys_command('blkid -s PARTUUID -o value {drive}{partition_2}'.format(**args)).decode('UTF-8').strip()
- with open(f'{self.mountpoint}/boot/loader/entries/arch.conf', 'w') as entry:
- entry.write('title Arch Linux\n')
- entry.write('linux /vmlinuz-linux\n')
- entry.write('initrd /initramfs-linux.img\n')
+
+ with open(f'{self.mountpoint}/boot/loader/entries/{unique_loader_conf_name}.conf', 'w') as entry:
+ entry.write(f'title Arch Linux\n')
+ entry.write(f'linux /vmlinuz-linux\n')
+ entry.write(f'initrd /initramfs-linux.img\n')
## blkid doesn't trigger on loopback devices really well,
## so we'll use the old manual method until we get that sorted out.