index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton.feeds+github@gmail.com> | 2020-07-01 08:54:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-01 08:54:14 +0200 |
commit | f0bc987e1bea4d1243340be0e6dd1522ea2750ff (patch) | |
tree | ad8e3f7c6d08f7d042ac14490e5f1fad88333483 | |
parent | c986ffd4099c27c55b1bf51428998552e9fc778d (diff) |
-rw-r--r-- | README.md | 39 |
@@ -1,7 +1,8 @@ # <img src="logo.png" alt="drawing" width="200"/> -Just another guided/automated [Arch Linux](https://wiki.archlinux.org/index.php/Arch_Linux) installer. +Just another guided/automated [Arch Linux](https://wiki.archlinux.org/index.php/Arch_Linux) installer with a twist. +The installer also doubles as a python library to access each individual installation step for customized installs. -Pre-built ISO's can be found here which autostarts this script *(in guided mode)*: https://hvornum.se/archiso/ +Pre-built ISO's can be found here which autostarts archinstall *(in a safe guided mode)*: https://hvornum.se/archiso/ * archinstall [discord](https://discord.gg/cqXU88y) server * archinstall guided install ISO's: https://hvornum.se/archiso/ @@ -32,38 +33,38 @@ This will start a guided install with the same safety checks as previous.<br> Again, a guided install starts with safety checks.<br> This assumes tho that Python and Pip is present (not always the case on the default Arch Linux ISO), see above for pre-built ISO's containing Python+pip -## Scripting a installation +## Scripting an installation -So, assuming you're building your own ISO and want to create an automated install.<br> -This is probably what you'll need, a minimal example of how to install using the library. +Assuming you're building your own ISO and want to create an automated install process.<br> +This is probably what you'll need, a minimal example of how to install using archinstall as a Python library. ```python import archinstall, getpass -selected_hdd = archinstall.select_disk(archinstall.all_disks()) +hdd = archinstall.select_disk(archinstall.all_disks()) disk_password = getpass.getpass(prompt='Disk password (won\'t echo): ') -with archinstall.Filesystem(selected_hdd, archinstall.GPT) as fs: +with archinstall.Filesystem(hdd, archinstall.GPT) as fs: fs.use_entire_disk('luks2') - with archinstall.luks2(fs) as crypt: - if selected_hdd.partition[1]['size'] == '512M': + with archinstall.Luks2(fs) as crypt: + if hdd.partition[1]['size'] == '512M': raise OSError('Trying to encrypt the boot partition for petes sake..') - 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) + key_file = crypt.encrypt(hdd.partition[1], password=disk_password, key_size=512, hash_type='sha512', iter_time=10000, key_file='./pwfile') + unlocked_crypt_vol = crypt.mount(hdd.partition[1], 'luksloop', key_file) - with archinstall.installer(root_partition, hostname='testmachine') as installation: - if installation.minimal_installation(): - installation.add_bootloader() + with archinstall.Installer(unlocked_crypt_vol, 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() + installation.add_AUR_support() ``` This installer will perform the following: |