index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton.feeds+github@gmail.com> | 2020-06-30 21:22:28 +0000 |
---|---|---|
committer | Anton Hvornum <anton.feeds+github@gmail.com> | 2020-06-30 21:22:28 +0000 |
commit | 0399df8c25caccd26ef61b703d6b1c43a7ddcec9 (patch) | |
tree | ee2cdd6ea741ec1779ea51d36dcdb94602d416fb /installer.py | |
parent | 5ae18b80fd118cc07108694feb81e5e02a9b18f3 (diff) |
-rw-r--r-- | installer.py | 34 |
diff --git a/installer.py b/installer.py index 5c7d4467..91a8139a 100644 --- a/installer.py +++ b/installer.py @@ -1,22 +1,28 @@ import archinstall, getpass -selected_hdd = archinstall.select_disk(archinstall.all_disks()) -disk_password = getpass.getpass(prompt='Disk password (won\'t echo): ') +archinstall.sys_command(f'cryptsetup close /dev/mapper/luksloop') -with archinstall.Formatter(selected_hdd, archinstall.GPT) as formatter: - exit(1) - disk.encrypt('luks2', password=disk_password, key_size=512, hash_type='sha512', iter_time=10000, key_file='./pwfile') +#selected_hdd = archinstall.select_disk(archinstall.all_disks()) +selected_hdd = archinstall.all_disks()['/dev/loop0'] +disk_password = '1234' # getpass.getpass(prompt='Disk password (won\'t echo): ') - root_partition = disk.partition['/'] +with archinstall.Filesystem(selected_hdd, archinstall.GPT) as fs: + fs.use_entire_disk('luks2') + with archinstall.luks2(fs) as crypt: + if selected_hdd.partition[1]['size'] == '512M': + raise OSError('Trying to encrypt the boot partition for petes sake..') -with archinstall.installer(root_partition, hostname='testmachine') as installation: - if installation.minimal_installation(): - installation.add_bootloader() + key_file = crypt.encrypt(selected_hdd.partition[1], password=disk_password, key_size=512, hash_type='sha512', iter_time=10000, key_file='./pwfile') + crypt.mount(selected_hdd.partition[1], 'luksloop', key_file) + exit(1) + with archinstall.installer(root_partition, hostname='testmachine') as installation: + if installation.minimal_installation(): + installation.add_bootloader() - installation.add_additional_packages(['nano', 'wget', 'git']) - installation.install_profile('desktop') + installation.add_additional_packages(['nano', 'wget', 'git']) + installation.install_profile('desktop') - installation.user_create('anton', 'test') - installation.user_set_pw('root', 'toor') + installation.user_create('anton', 'test') + installation.user_set_pw('root', 'toor') - installation.add_AUR_support()
\ No newline at end of file + installation.add_AUR_support()
\ No newline at end of file |