Fix locale and bios bugs

This commit is contained in:
Rudra Saraswat 2023-04-25 17:03:01 +05:30
parent 81b9dc103b
commit 7feb94aac6
2 changed files with 9 additions and 8 deletions

View file

@ -6,7 +6,7 @@
<p>An installer framework and drop-in replacement for and rewrite of Jade in Python that uses the live session's file system instead of bootstrapping a new one, built for blendOS.</p> <p>An installer framework and drop-in replacement for and rewrite of Jade in Python that uses the live session's file system instead of bootstrapping a new one, built for blendOS.</p>
</div> </div>
**Help us with making blend-inst distribution-independent by creating a pull request!** **Help us with making blend-inst distribution-independent by opening a pull request!**
## Testing ## Testing

View file

@ -127,13 +127,13 @@ def inst_partition(config):
# Create GPT label # Create GPT label
exec(['parted', '-s', device, 'mklabel', 'gpt']) exec(['parted', '-s', device, 'mklabel', 'gpt'])
# Create EFI partition # Create EFI partition
exec(['parted', '-s', device, 'mkpart', 'fat32', '0', '300']) exec(['parted', '-s', device, 'mkpart', 'fat32', '0', '500'])
else: else:
# Create msdos label # Create msdos label
exec(['parted', '-s', device, 'mklabel', 'msdos']) exec(['parted', '-s', device, 'mklabel', 'msdos'])
# Create boot partition # Create boot partition
exec(['parted', '-s', device, 'mkpart', exec(['parted', '-s', device, 'mkpart',
'primary', 'ext4', '1MIB', '512MIB']) 'primary', 'ext4', '1MIB', '600MIB'])
# Create root partition # Create root partition
exec(['parted', '-s', device, 'mkpart', exec(['parted', '-s', device, 'mkpart',
@ -274,12 +274,13 @@ def inst_bootloader(config):
def inst_locale(config): def inst_locale(config):
# Set locale # Set locale
exec_chroot(['bash', '-c', 'echo \'en_US.UTF-8 UTF-8\' > /etc/locale.gen']) exec_chroot(['bash', '-c', 'echo \'en_US.UTF-8 UTF-8\' > /etc/locale.gen'])
exec_chroot(['bash', '-c', 'echo \'LANG=en_US.UTF-8\' > /etc/locale.conf']) first_locale = True
for locale in config['locale']['locale']: for locale in config['locale']['locale']:
exec_chroot(['bash', '-c', f'echo \'{locale}\' >> /etc/locale.gen']) if locale != 'en_US.UTF-8 UTF-8':
if locale.split()[0] != 'en_US.UTF-8': exec_chroot(['bash', '-c', f'echo \'{locale}\' >> /etc/locale.gen'])
exec_chroot( if first_locale:
['sed', '-i', f's/en_US.UTF-8/{locale.split()[0]}/g', '/etc/locale.conf']) exec_chroot(['bash', '-c', f'echo \'LANG={locale.split()[0]}\' > /etc/locale.conf'])
first_locale = False
exec_chroot(['locale-gen']) exec_chroot(['locale-gen'])
# Set keyboard layout # Set keyboard layout