Skip to content

Commit

Permalink
deploy: 62d66e1
Browse files Browse the repository at this point in the history
  • Loading branch information
svartkanin committed Aug 28, 2024
0 parents commit 5fba260
Show file tree
Hide file tree
Showing 84 changed files with 8,965 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 5bd259cba67a7c19f4dc2dde4a25b460
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added .doctrees/archinstall/Installer.doctree
Binary file not shown.
Binary file added .doctrees/archinstall/plugins.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/environment.pickle
Binary file not shown.
Binary file added .doctrees/examples/python.doctree
Binary file not shown.
Binary file added .doctrees/help/discord.doctree
Binary file not shown.
Binary file added .doctrees/help/known_issues.doctree
Binary file not shown.
Binary file added .doctrees/help/report_bug.doctree
Binary file not shown.
Binary file added .doctrees/index.doctree
Binary file not shown.
Binary file added .doctrees/installing/guided.doctree
Binary file not shown.
Binary file added .doctrees/installing/python.doctree
Binary file not shown.
Empty file added .nojekyll
Empty file.
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
archinstall.archlinux.page
11 changes: 11 additions & 0 deletions _sources/archinstall/Installer.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. _archinstall.Installer:

archinstall.Installer
=====================

The installer is the main class for accessing an installation-instance.
You can look at this class as the installation you have or will perform.

Anything related to **inside** the installation, will be found in this class.

.. autofunction:: archinstall.Installer
57 changes: 57 additions & 0 deletions _sources/archinstall/plugins.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
.. _archinstall.Plugins:

Python Plugins
==============

``archinstall`` supports plugins via two methods.

First method is directly via the ``--plugin`` parameter when running as a CLI tool. This will load a specific plugin locally or remotely via a path.

The second method is via Python's built in `plugin discovery`_ using `entry points`_ categorized as ``archinstall.plugin``.

``--plugin`` parameter
----------------------

The parameter has the benefit of being stored in the ``--conf`` state, meaning when re-running an installation — the plugin will automatically be loaded.
It's limitation is that it requires an initial path to be known and written and be cumbersome.

Plugin Discovery
----------------

This method allows for multiple plugins to be loaded with the drawback that they have to be installed beforehand on the system running ``archinstall``.
This mainly targets those who build their own ISO's and package specific setups for their needs.


What's supported?
-----------------

Currently the documentation for this is scarse. Until that is resolved, the best way to find supported features is to search the source code for `plugin.on_ <https://github.com/search?q=repo%3Aarchlinux%2Farchinstall+%22plugin.on_%22&type=code>`_ as this will give a clear indication of which calls are made to plugins.

How does it work?
-----------------

``archinstall`` plugins use a discovery-driven approach where plugins are queried for certain functions.
As an example, if a plugin has the following function:

.. code-block:: python
def on_pacstrap(*packages):
...
The function :code:`archinstall.Pacman().strap(["some packages"])` is hardcoded to iterate plugins and look for :code:`on_pacstrap` in the plugin.
If the function exists, :code:`.strap()` will call the plugin's function and replace the initial package list with the result from the plugin.

The best way to document these calls is currently undecided, as it's hard to document this behavior dynamically.

Writing your own?
-----------------

The simplest way currently is to look at a reference implementation or the community. Two of these are:

* `torxed/archinstall-aur <https://github.com/torxed/archinstall-aur>`_
* `phisch/archinstall-aur <https://github.com/phisch/archinstall-aur>`_

And search for `plugin.on_ <https://github.com/search?q=repo%3Aarchlinux%2Farchinstall+%22plugin.on_%22&type=code>`_ in the code base to find what ``archinstall`` will look for. PR's are welcome to widen the support for this.

.. _plugin discovery: https://packaging.python.org/en/latest/specifications/entry-points/
.. _entry points: https://docs.python.org/3/library/importlib.metadata.html#entry-points
22 changes: 22 additions & 0 deletions _sources/cli_parameters/config/custom_commands.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.. _custom commands:

Custom Commands
===============

| Custom commands is a configuration entry that allows for executing custom commands post-installation.
| The commands are executed with `arch-chroot <https://man.archlinux.org/man/extra/arch-install-scripts/arch-chroot.8.en>`_.
The option takes a list of arguments, an example is:

.. code-block:: json
{
"custom-commands": [
"hostname new-hostname"
]
}
| The following example will set a new hostname in the installed system.
| The example is just to illustrate that the command is not run in the ISO but inside the installed system after the base system is installed.
More examples can be found in the code repository under `examples/ <https://github.com/archlinux/archinstall/tree/e6344f93f7e476d05bbcd642f2ed91fdde545870/examples>`_
235 changes: 235 additions & 0 deletions _sources/cli_parameters/config/disk_config.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
.. _disk config:

Disk Configuration
==================

There are only three modes in the ``disk_config`` option. They are described in more detail below.

"Leave as is"
--------------

.. code-block:: json
{
"config_type": "pre_mounted_config",
"mountpoint": "/mnt/archinstall"
}
This mode will not perform any partitioning what so ever.
Instead it relies on what's mounted manually by the user under ``/mnt/archinstall``.

Given the following disk example:

.. code-block::
/mnt/archinstall (/dev/sda2)
├── boot (/dev/sda1)
└── home (/dev/sda3)
Running ``archinstall --conf your.json --silent`` where the above JSON is configured. The disk will be left alone — and a working system will be installed to the above folders and mountpoints will be translated into the installed system.

.. note::

Some disk layouts can be too complicated to detect, such as RAID setups. Please do report those setups on the `Issue Tracker <https://github.com/archlinux/archinstall>`__ so we can support them.

Best Effort
-----------

.. warning::

This mode will wipe data!

.. note::

Note that this options is similar to the manual partitioning but is generated through the menu system! And the best effort layout might deviate slightly from some wiki guidelines in order to facilitate some optional configurations at a later stage.

.. code-block:: json
{
"disk_config": {
"config_type": "default_layout",
"device_modifications": [
{
"device": "/dev/sda",
"wipe": true,
"partitions": "..."
}
]
}
}
This mode will attempt to configure a sane default layout on the selected disks.
Based on the chosen filesystem, and potential optional settings for said filesystem — different default layouts will be provided.

Manual Partitioning
-------------------

.. code-block:: json
{
"disk_config": {
"config_type": "manual_partitioning",
"device_modifications": [
"filesystem struct"
]
}
}
Manual partitioning is the most complex one of the three. It offers you near endless flexibility of how to partition your disk. It integrates against `pyparted <https://github.com/dcantrell/pyparted>`__ and some control logic in ``archinstall`` that deals with creating things like subvolumes and compression.

Sizes are by default ``sector`` units, but other units are supported.

The options supplied to ``manual_partitioning`` are dictionary definitions, where the following parameters must exist:

.. csv-table:: JSON options
:file: ./manual_options.csv
:widths: 15, 15, 65, 5
:escape: !
:header-rows: 1

Each partition definition heavily relies on what filesystem is used.
Below follow two of the more common filesystems, anything else will best be described by running ``archinstall`` to generate a desired configuration for the desired filesystem type — and copy the relevant parts for permanent configurations.

.. warning::

Important to note that the units and positions in the examples below — are highly user specific!

FAT32
^^^^^

.. code-block:: json
{
"btrfs": [],
"flags": [
"Boot"
],
"fs_type": "fat32",
"length": {
"sector_size": null,
"total_size": null,
"unit": "B",
"value": 99982592
},
"mount_options": [],
"mountpoint": "/boot",
"obj_id": "369f31a8-2781-4d6b-96e7-75680552b7c9",
"start": {
"sector_size": {
"sector_size": null,
"total_size": null,
"unit": "B",
"value": 512
},
"total_size": null,
"unit": "sectors",
"value": 34
},
"status": "create",
"type": "primary"
}
.. note::

The ``Boot`` flag will make ``archinstall`` automatically set the correct ESP partition GUID if the system is booted with ``EFI`` support. The GUID will then be set to ``C12A7328-F81F-11D2-BA4B-00A0C93EC93B``.

EXT4
^^^^

.. code-block:: json
{
"btrfs": [],
"flags": [],
"fs_type": "ext4",
"length": {
"sector_size": null,
"total_size": null,
"unit": "B",
"value": 15805127360
},
"mount_options": [],
"mountpoint": "/",
"obj_id": "3e75d045-21a4-429d-897e-8ec19a006e8b",
"start": {
"sector_size": {
"sector_size": null,
"total_size": null,
"unit": "B",
"value": 512
},
"total_size": {
"sector_size": null,
"total_size": null,
"unit": "B",
"value": 16106127360
},
"unit": "MB",
"value": 301
},
"status": "create",
"type": "primary"
}
BTRFS
^^^^^

The BTRFS filesystem is inherently more complicated, thus the options are a bit more involved.
This example contains both subvolumes and compression.

.. note::

Note that the ``"mountpoint": null`` is used for the overall partition, and instead individual subvolumes have mountpoints set.

.. code-block:: json
{
"btrfs": [
{
"mountpoint": "/",
"name": "@",
},
{
"mountpoint": "/home",
"name": "@home",
},
{
"mountpoint": "/var/log",
"name": "@log",
},
{
"mountpoint": "/var/cache/pacman/pkg",
"name": "@pkg",
},
{
"mountpoint": "/.snapshots",
"name": "@.snapshots",
}
],
"dev_path": null,
"flags": [],
"fs_type": "btrfs",
"mount_options": [
"compress=zstd"
],
"mountpoint": null,
"obj_id": "d712357f-97cc-40f8-a095-24ff244d4539",
"size": {
"sector_size": {
"unit": "B",
"value": 512
},
"unit": "B",
"value": 15568207872
},
"start": {
"sector_size": {
"unit": "B",
"value": 512
},
"unit": "MiB",
"value": 513
},
"status": "create",
"type": "primary"
}
19 changes: 19 additions & 0 deletions _sources/cli_parameters/config/disk_encryption.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.. _disk encryption:

Disk Encryption
===============

Disk encryption consists of a top level entry in the user configuration.

.. code-block:: json
{
"disk_encryption": {
"encryption_type": "luks",
"partitions": [
"d712357f-97cc-40f8-a095-24ff244d4539"
]
}
}
The ``UID`` in the ``partitions`` list is an internal reference to the ``obj_id`` in the :ref:`disk config` entries.
Loading

0 comments on commit 5fba260

Please sign in to comment.