Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-04-10 11:21:24 +0200
committerAnton Hvornum <anton@hvornum.se>2021-04-10 11:21:24 +0200
commit48e801e6fdbc1f74885a3541011d4cce5876ab21 (patch)
treee95cbd1539b4aa2f067c23142503f4a6e9d74812
parentd9fc8abf02c70ad8177048f85a06294d63e41faf (diff)
Added a mission statement, and updated the minimal example in the readme.
-rw-r--r--README.md59
1 files changed, 46 insertions, 13 deletions
diff --git a/README.md b/README.md
index 2f3881e1..a48f0a91 100644
--- a/README.md
+++ b/README.md
@@ -21,6 +21,18 @@ Assuming you are on a Arch Linux live-ISO and booted into EFI mode.
# python -m archinstall guided
+# Mission Statement
+
+Archinstall promises to ship a [guided installer](https://github.com/archlinux/archinstall/blob/master/examples/guided.py) that follows the [Arch Principles](https://wiki.archlinux.org/index.php/Arch_Linux#Principles) as well as a library to manage services, packages and other Arch Linux aspects.
+
+The guided installer will provide user friendly options along the way, but the keyword here is options, they are optional and will never be forced upon anyone. The guided installer itself is also optional to use if so desired and not forced upon anyone.
+
+---
+
+Archinstall has one fundamental function which is to be a flexible library to manage services, packages and other aspects inside the installed system. This library is in turn used by the provided guided installer but is also for anyone who wants to script their own installations.
+
+Therefore, Archinstall will try its best to not introduce any breaking changes except for major releases which may break backwards compability after notifying about such changes.
+
# Scripting your own installation
You could just copy [guided.py](examples/guided.py) as a starting point.
@@ -35,23 +47,44 @@ import archinstall, getpass
harddrive = archinstall.select_disk(archinstall.all_disks())
disk_password = getpass.getpass(prompt='Disk password (won\'t echo): ')
-with archinstall.Filesystem(harddrive, archinstall.GPT) as fs:
- # use_entire_disk() is a helper to not have to format manually
- fs.use_entire_disk('luks2')
+# We disable safety precautions in the library that protects the partitions
+harddrive.keep_partitions = False
+
+# First, we configure the basic filesystem layout
+with archinstall.Filesystem(archinstall.arguments['harddrive'], archinstall.GPT) as fs:
+ # We create a filesystem layout that will use the entire drive
+ # (this is a helper function, you can partition manually as well)
+ fs.use_entire_disk(root_filesystem_type='btrfs')
+
+ boot = fs.find_partition('/boot')
+ root = fs.find_partition('/')
+
+ boot.format('vfat')
+
+ # Set the flat for encrypted to allow for encryption and then encrypt
+ root.encrypted = True
+ root.encrypt(password=archinstall.arguments.get('!encryption-password', None))
+
+with archinstall.luks2(root, 'luksloop', disk_password) as unlocked_root:
+ unlocked_root.format(root.filesystem)
+ unlocked_root.mount('/mnt')
+
+ boot.mount('/mnt/boot')
- harddrive.partition[0].format('fat32')
- with archinstall.luks2(harddrive.partition[1], 'luksloop', disk_password) as unlocked_device:
- unlocked_device.format('btrfs')
+with archinstall.Installer('/mnt') as installation:
+ if installation.minimal_installation():
+ installation.set_hostname('minimal-arch')
+ installation.add_bootloader()
- with archinstall.Installer(unlocked_device, hostname='testmachine') as installation:
- if installation.minimal_installation():
- installation.add_bootloader(harddrive.partition[0])
+ installation.add_additional_packages(['nano', 'wget', 'git'])
- installation.add_additional_packages(['nano', 'wget', 'git'])
- installation.install_profile('awesome')
+ # Optionally, install a profile of choice.
+ # In this case, we install a minimal profile that is empty
+ installation.install_profile('minimal')
- installation.user_create('anton', 'test')
- installation.user_set_pw('root', 'toor')
+ installation.user_create('devel', 'devel')
+ installation.user_set_pw('root', 'airoot')
+
```
This installer will perform the following: