Feature: #28 - Fixing the booatloader config when disk ain't encrypted
This commit is contained in:
parent
1aec07f829
commit
70c811e2bc
|
|
@ -1012,14 +1012,16 @@ def setup_bootloader(*positionals, **kwargs):
|
||||||
## For some reason, blkid and /dev/disk/by-uuid are not getting along well.
|
## For some reason, blkid and /dev/disk/by-uuid are not getting along well.
|
||||||
## And blkid is wrong in terms of LUKS.
|
## 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()
|
#UUID = sys_command('blkid -s PARTUUID -o value {drive}{partition_2}'.format(**args)).decode('UTF-8').strip()
|
||||||
UUID = simple_command(f"ls -l /dev/disk/by-uuid/ | grep {os.path.basename(args['drive'])}{args['partitions']['2']} | awk '{{print $9}}'").decode('UTF-8').strip()
|
|
||||||
with open('/mnt/boot/loader/entries/arch.conf', 'w') as entry:
|
with open('/mnt/boot/loader/entries/arch.conf', 'w') as entry:
|
||||||
entry.write('title Arch Linux\n')
|
entry.write('title Arch Linux\n')
|
||||||
entry.write('linux /vmlinuz-linux\n')
|
entry.write('linux /vmlinuz-linux\n')
|
||||||
entry.write('initrd /initramfs-linux.img\n')
|
entry.write('initrd /initramfs-linux.img\n')
|
||||||
if args['skip-encrypt']:
|
if args['skip-encrypt']:
|
||||||
|
## NOTE: We could use /dev/disk/by-partuuid but blkid does the same and a lot cleaner
|
||||||
|
UUID = simple_command(f"blkid -s PARTUUID -o value /dev/{os.path.basename(args['drive'])}{args['partitions']['2']}").decode('UTF-8').strip()
|
||||||
entry.write('options root=PARTUUID={UUID} rw intel_pstate=no_hwp\n'.format(UUID=UUID))
|
entry.write('options root=PARTUUID={UUID} rw intel_pstate=no_hwp\n'.format(UUID=UUID))
|
||||||
else:
|
else:
|
||||||
|
UUID = simple_command(f"ls -l /dev/disk/by-uuid/ | grep {os.path.basename(args['drive'])}{args['partitions']['2']} | awk '{{print $9}}'").decode('UTF-8').strip()
|
||||||
entry.write('options cryptdevice=UUID={UUID}:luksdev root=/dev/mapper/luksdev rw intel_pstate=no_hwp\n'.format(UUID=UUID))
|
entry.write('options cryptdevice=UUID={UUID}:luksdev root=/dev/mapper/luksdev rw intel_pstate=no_hwp\n'.format(UUID=UUID))
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue