From 9ea95890429f50cb7057a47d9d1625cb312ad1b3 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 30 Jun 2020 21:51:41 +0200 Subject: Update README.md --- README.md | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 6 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 0be80bad..236529f5 100644 --- a/README.md +++ b/README.md @@ -3,20 +3,73 @@ Just another guided/automated [Arch Linux](https://wiki.archlinux.org/index.php/ Pre-built ISO's can be found here which autostarts this script *(in guided mode)*: https://hvornum.se/archiso/ -# How-to / Usecases +# Usage ## Run on Live-CD (Binary) # wget https://gzip.app/archinstall # chmod +x archinstall; ./archinstall -## Run on Live-CD (Python): +This downloads and runs a "compiled" *(using nuitka)* version of the project.
+It defaults to starting a guided install with some safety checks in place. - # wget https://raw.githubusercontent.com/Torxed/archinstall/master/archinstall.py - # pacman -S --noconfirm python; python archinstall.py +## Run on Live-CD with Python: -This will start a guided install.
-Add `--default` for a unattended minimalistic installation of Arch Linux. + # wget https://raw.githubusercontent.com/Torxed/archinstall/master/installer.py + # pacman -S --noconfirm python; python install.py + +This will start a guided install with the same safety checks as previous.
+ +## Run using PIP and Python module: + + # pip install archinstall + # python -m archinstall + +Again, a guided install starts with safety checks.
+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 + +So, assuming you're building your own ISO and want to create an automated install.
+This is probably what you'll need, a minimal example of how to install using the library. + + import archinstall, getpass + + + selected_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: + 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..') + + 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) + + 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.user_create('anton', 'test') + installation.user_set_pw('root', 'toor') + + installation.add_AUR_support() + +This installer will perform the following: + + * Prompt the user to select a disk and disk-password + * Proceed to wipe said disk + * Sets up a default 100% used disk with encryption + * Installs a basic instance of Arch Linux *(base base-devel linux linux-firmware btrfs-progs efibootmgr)* + * Installs and configures a bootloader + * Install additional packages *(nano, wget, git)* + * Installs a network-profile called `desktop` *(more on network profiles in the docs)* + * Adds AUR support by compiling and installing [yay](https://github.com/Jguer/yay) > **Creating your own ISO:** Follow [ArchISO](https://wiki.archlinux.org/index.php/archiso)'s guide on how to create your own ISO or use a pre-built [guided ISO](https://hvornum.se/archiso/) to skip the python installation step, or to create auto-installing ISO templates. Further down are examples and cheat sheets on how to create different live ISO's. -- cgit v1.2.3-70-g09d2 From 568acc4a876803435a22ba3020fa5acdf66ec0fc Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 30 Jun 2020 22:02:46 +0200 Subject: Update README.md --- README.md | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 236529f5..08e4bdfa 100644 --- a/README.md +++ b/README.md @@ -33,32 +33,34 @@ This assumes tho that Python and Pip is present (not always the case on the defa So, assuming you're building your own ISO and want to create an automated install.
This is probably what you'll need, a minimal example of how to install using the library. - import archinstall, getpass +```python +import archinstall, getpass - selected_hdd = archinstall.select_disk(archinstall.all_disks()) - disk_password = getpass.getpass(prompt='Disk password (won\'t echo): ') +selected_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: - 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.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..') - 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) - - 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) - installation.add_additional_packages(['nano', 'wget', 'git']) - installation.install_profile('desktop') + with archinstall.installer(root_partition, hostname='testmachine') as installation: + if installation.minimal_installation(): + installation.add_bootloader() - installation.user_create('anton', 'test') - installation.user_set_pw('root', 'toor') + installation.add_additional_packages(['nano', 'wget', 'git']) + installation.install_profile('desktop') - installation.add_AUR_support() + installation.user_create('anton', 'test') + installation.user_set_pw('root', 'toor') + + installation.add_AUR_support() +``` This installer will perform the following: -- cgit v1.2.3-70-g09d2 From c986ffd4099c27c55b1bf51428998552e9fc778d Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 30 Jun 2020 22:10:32 +0200 Subject: Update README.md --- README.md | 102 +++----------------------------------------------------------- 1 file changed, 4 insertions(+), 98 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 08e4bdfa..fa784506 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,10 @@ Just another guided/automated [Arch Linux](https://wiki.archlinux.org/index.php/ Pre-built ISO's can be found here which autostarts this script *(in guided mode)*: https://hvornum.se/archiso/ + * archinstall [discord](https://discord.gg/cqXU88y) server + * archinstall guided install ISO's: https://hvornum.se/archiso/ + * archinstall on [#archinstall@freenode (IRC)](irc://#archinstall@FreeNode) + # Usage ## Run on Live-CD (Binary) @@ -75,104 +79,6 @@ This installer will perform the following: > **Creating your own ISO:** Follow [ArchISO](https://wiki.archlinux.org/index.php/archiso)'s guide on how to create your own ISO or use a pre-built [guided ISO](https://hvornum.se/archiso/) to skip the python installation step, or to create auto-installing ISO templates. Further down are examples and cheat sheets on how to create different live ISO's. -# Features - - * User guided install of Arch Linux *(Like most other distros have)* - * `AUR` package support. - * Unattended install of Arch Linux - * Profile / Template based installs - * Full disk encryption, locale/region settings and customizable application selection - * YubiKey support for disk and root password *(TBD / next release)* - * Supports offline-installation of Arch Linux - * Never creates or leave post-install/service scripts *(usually used to finalize databases etc)* - -**Default Installation Contains:** Encrypts drive, btrfs filesystem, `linux` kernel, nano, wpa_supplicant *(and dialog)* - -# Examples: - - * `./archinstall --profile=workstation --drive=/dev/sda` - Installs the [workstation](https://github.com/Torxed/archinstall/blob/master/deployments/workstation.json) template on the drive `/dev/sda` - -# [Build a Arch Linux ISO to autorun archinstall](https://github.com/Torxed/archinstall/wiki/Autorun-on-Arch-Live-CD) - -More options for the built ISO: - -### [Unattended install of a profile](https://github.com/Torxed/archinstall/wiki/Unattended-install-of-a-profile) - -### [User guided install (DEFAULT)](https://github.com/Torxed/archinstall/wiki/User-guided-installation-(DEFAULT)) - -### [Custom web-server for deployment profiles](https://github.com/Torxed/archinstall/wiki/Custom-web-server-for-deployment-profiles) - -### [Rerunning the installation](https://github.com/Torxed/archinstall/wiki/Rerunning-the-installation) - -# Some parameters you can give it - - --drive= - Which drive to install arch on, if absent, the first disk under /dev/ is used - - --minimal - Starts a minimal installation, and skips looking for profiles. - - --size=100% (Default) - Sets the size of the root filesystem (btrfs) - - --start=513MiB (Default) - Sets the starting location of the root partition - (TODO: /boot will take up space from 1MiB - , make sure boot is no larger than 513MiB) - - --password=0000 (Default) - Which disk password to use, - --password="" for prompt of password - --password="" for setting a unique password on the YubiKey and use that as a password - (NOTE: This will wipe/replace slot 1 on the YubiKey) - - --aur-support (default) - - --pwfile=/tmp/diskpw (Default) - Which file to store the disk encryption password while sending it to cryptsetup - - --hostname=Arcinstall (Default) - Sets the hostname of the box - - --country=all (Default) - Default mirror allocation for fetching packages. - If network is found, archinstall will try to attempt and guess which country the - install originates from, basing it off GeoIP off your public IP (uses https://hvornu.se/ip/ for lookups) - - --packages='' (Default) - Which additional packages to install, defaults to none. - (Space separated as it's passed unchanged to `pacstrap` - - --user= - Adds an additional username to the system (default group Wheel) - - --post=reboot (Default) - After a successful install, reboots into the system. Use --post=stay to not reboot. - - --unattended - This parameter causes the installation script to install arch unattended on the first disk - - --profile= - For instance, --profile=workstation will install the workstation profile. - - --profiles-path=https://example.com/profiles - Changes the default path the script looks for deployment profiles. - The default path is 'https://raw.githubusercontent.com/Torxed/archinstall/master/deployments' - - --rerun="Name of step in profile" - Enables you to skip the format, encryption and base install steps. - And head straight for a step in the profile specified. - (Useful for debugging a step in your profile) - - --localtime="Europe/Stockholm" (Default if --country=SE, otherwise GMT+0) - Specify a localtime you're used to. - -Deployment profile structs support all the above parameters and more, for instance, custom arguments with string formatting. -See [deployments/workstation.json](https://github.com/Torxed/archinstall/blob/net-deploy/deployments/workstation.json) for examples. - -# Contact - -IRC: `#archinstall@FreeNode` - ## End note ![description](description.jpg) -- cgit v1.2.3-70-g09d2 From f0bc987e1bea4d1243340be0e6dd1522ea2750ff Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Wed, 1 Jul 2020 08:54:14 +0200 Subject: Update README.md --- README.md | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index fa784506..96de9585 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # drawing -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.
Again, a guided install starts with safety checks.
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.
-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.
+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: -- cgit v1.2.3-70-g09d2 From db528d86761ac8d8e1fc13be04d5c1d2e137fd8d Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Mon, 6 Jul 2020 18:46:12 +0200 Subject: Pointed the images to the new docs location --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 96de9585..9b158564 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# drawing +# drawing 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. @@ -82,4 +82,4 @@ This installer will perform the following: ## End note - ![description](description.jpg) + ![description](docs/description.jpg) -- cgit v1.2.3-70-g09d2 From 37b50ca119ade74f860824022db279773d894b36 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Mon, 6 Jul 2020 22:51:18 +0200 Subject: Absolute paths for pictures --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 9b158564..f461ccba 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# drawing +# drawing 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. @@ -82,4 +82,4 @@ This installer will perform the following: ## End note - ![description](docs/description.jpg) + ![description](https://github.com/Torxed/archinstall/raw/master/description.jpg) -- cgit v1.2.3-70-g09d2 From 7545b128d894f0654c252152d41cc64b8fcedd4c Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Mon, 6 Jul 2020 22:52:54 +0200 Subject: Prepped readme for pypi. Also updated setup.py to reflect a better project name when uploading to pypi. --- README.md | 4 ++-- archinstall/lib/profiles.py | 2 +- setup.py | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 9b158564..5f49f021 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# drawing +# drawing 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. @@ -82,4 +82,4 @@ This installer will perform the following: ## End note - ![description](docs/description.jpg) + ![description](https://github.com/Torxed/archinstall/raw/annotations/docs/description.jpg) diff --git a/archinstall/lib/profiles.py b/archinstall/lib/profiles.py index 653bc72b..bea17d44 100644 --- a/archinstall/lib/profiles.py +++ b/archinstall/lib/profiles.py @@ -3,7 +3,7 @@ from collections import OrderedDict from .general import multisplit, sys_command, log from .exceptions import * -UPSTREAM_URL = 'https://raw.githubusercontent.com/Torxed/archinstall/annotations/profiles' +UPSTREAM_URL = 'https://raw.githubusercontent.com/Torxed/archinstall/master/profiles' def grab_url_data(path): safe_path = path[:path.find(':')+1]+''.join([item if item in ('/', '?', '=', '&') else urllib.parse.quote(item) for item in multisplit(path[path.find(':')+1:], ('/', '?', '=', '&'))]) diff --git a/setup.py b/setup.py index 9571d41d..c2b14559 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( - name="archinstall-Torxed", # Replace with your own username + name="archinstall", version="2.0.0", author="Anton Hvornum", author_email="anton@hvornum.se", @@ -14,9 +14,9 @@ setuptools.setup( url="https://github.com/Torxed/archinstall", packages=setuptools.find_packages(), classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: GPL 3.0 License", - "Operating System :: Arch Linux", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Operating System :: POSIX :: Linux", ], python_requires='>=3.8', ) \ No newline at end of file -- cgit v1.2.3-70-g09d2