index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | archinstall/__init__.py | 2 | ||||
-rw-r--r-- | archinstall/lib/hardware.py | 2 | ||||
-rw-r--r-- | archinstall/lib/user_interaction.py | 1 | ||||
-rw-r--r-- | docs/index.rst | 3 | ||||
-rw-r--r-- | docs/installing/guided.rst | 101 | ||||
-rw-r--r-- | examples/custom-command-sample.json | 10 | ||||
-rw-r--r-- | examples/guided.py | 24 | ||||
-rw-r--r-- | profiles/desktop.py | 2 | ||||
-rw-r--r-- | profiles/minimal.py | 2 | ||||
-rw-r--r-- | profiles/server.py | 2 | ||||
-rw-r--r-- | profiles/sway.py | 6 | ||||
-rw-r--r-- | profiles/xorg.py | 10 |
@@ -10,7 +10,7 @@ The installer also doubles as a python library to install Arch Linux and manage * archinstall [discord](https://discord.gg/cqXU88y) server * archinstall [matrix.org](https://app.element.io/#/room/#archinstall:matrix.org) channel -* archinstall [#archinstall@freenode (IRC)](irc://#archinstall@FreeNode) +* archinstall [#archinstall@irc.libera.chat](irc://#archinstall@irc.libera.chat:6697) * archinstall [documentation](https://python-archinstall.readthedocs.io/en/latest/index.html) # Installation & Usage @@ -34,7 +34,7 @@ Prequisites: Assuming you are on a Arch Linux live-ISO and booted into EFI mode. - # archinstall --config <path to config file or URL> [optional: --vars '<space_seperated KEY=VALUE pairs>'] + # archinstall --config <path to config file or URL> # Help? diff --git a/archinstall/__init__.py b/archinstall/__init__.py index 6a070392..fcd9a706 100644 --- a/archinstall/__init__.py +++ b/archinstall/__init__.py @@ -23,7 +23,7 @@ from .lib.user_interaction import * parser = ArgumentParser() -__version__ = "2.2.0.RC1" +__version__ = "2.3.0.dev0" storage['__version__'] = __version__ diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py index 7c164096..6a3b166d 100644 --- a/archinstall/lib/hardware.py +++ b/archinstall/lib/hardware.py @@ -110,7 +110,7 @@ def cpu_vendor() -> Optional[str]: def is_vm() -> bool: try: # systemd-detect-virt issues a non-zero exit code if it is not on a virtual machine - if b"".join(SysCommand("systemd-detect-virt")).lower() != b"none": + if b"none" not in b"".join(SysCommand("systemd-detect-virt")).lower(): return True except: pass diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py index 0a4cd0f9..79919658 100644 --- a/archinstall/lib/user_interaction.py +++ b/archinstall/lib/user_interaction.py @@ -579,6 +579,7 @@ def select_profile(): print(' -- The above list is a set of pre-programmed profiles. --') print(' -- They might make it easier to install things like desktop environments. --') + print(' -- The desktop profile will let you select a DE/WM profile, e.g gnome, kde, sway --') print(' -- (Leave blank and hit enter to skip this step and continue) --') selected_profile = generic_select(actual_profiles_raw, 'Enter a pre-programmed profile name if you want to install one: ', options_output=False) diff --git a/docs/index.rst b/docs/index.rst index a5d07901..0d80501b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,9 +6,6 @@ python-archinstall Documentation | | A demo can be viewed here: `https://www.youtube.com/watch?v=9Xt7X_Iqg6E <https://www.youtube.com/watch?v=9Xt7X_Iqg6E>`_ which uses the default guided installer. -.. warning:: - This installer currently requires that your machine has EFI-mode enabled. - Some of the features of Archinstall are: * **No external dependencies or installation requirements.** Runs without any external requirements or installation processes. diff --git a/docs/installing/guided.rst b/docs/installing/guided.rst index e442d927..03225adb 100644 --- a/docs/installing/guided.rst +++ b/docs/installing/guided.rst @@ -39,7 +39,7 @@ And to run it, execute archinstall as a Python module: | The ``--script guided`` argument is optional as it's the default behavior. | But this will start the process of guiding you through a installation of a quite minimal Arch Linux experience. -Installing directly from a config file +Installing directly from a configuration file -------------------------------------- .. note:: @@ -58,6 +58,7 @@ Installing directly from a config file ], "!encryption-password": "supersecret", "filesystem": "btrfs", + "gfx_driver": "VMware / VirtualBox (open-source)", "harddrive": { "path": "/dev/nvme0n1" }, @@ -66,14 +67,11 @@ Installing directly from a config file "linux" ], "keyboard-language": "us", - "mirror-region": { - "Worldwide": { - "https://mirror.rackspace.com/archlinux/$repo/os/$arch": true - } - }, + "mirror-region": "Worldwide", "nic": { "NetworkManager": true }, + "ntp": true, "packages": ["docker", "git", "wget", "zsh"], "profile": "gnome", "services": ["docker"], @@ -82,6 +80,8 @@ Installing directly from a config file "!password": "devel" } }, + "sys-encoding": "utf-8", + "sys-language": "en_US", "timezone": "US/Eastern", "users": {} } @@ -92,46 +92,55 @@ To run it, execute archinstall as a Python module: python -m archinstall --config <local path or remote URL> -+----------------------+--------------------------------------------------------+----------------------------------------------------------------------------+-----------------------------------------------+ -| Key | Values/Description | Description | Required | -| | | | | -+======================+========================================================+============================================================================+===============================================+ -| audio | pipewire/pulseaudio | Audioserver to be installed | No | -+----------------------+--------------------------------------------------------+----------------------------------------------------------------------------+-----------------------------------------------+ -| bootloader | systemd-bootctl/grub-install | Bootloader to be installed | Yes | -+----------------------+--------------------------------------------------------+----------------------------------------------------------------------------+-----------------------------------------------+ -| custom-commands | [ <command1>, <command2>, ...] | Custom commands to be run post install | No | -+----------------------+--------------------------------------------------------+----------------------------------------------------------------------------+-----------------------------------------------+ -| !encryption-password | any | Password to encrypt disk, not encrypted if password not provided | No | -+----------------------+--------------------------------------------------------+----------------------------------------------------------------------------+-----------------------------------------------+ -| filesystem | ext4 / btrfs / fat32 etc. | Filesystem for root and home partitions | Yes | -+----------------------+--------------------------------------------------------+----------------------------------------------------------------------------+-----------------------------------------------+ -| harddrive | { "path": <path of device> } | Path of device to be used | Yes | -+----------------------+--------------------------------------------------------+----------------------------------------------------------------------------+-----------------------------------------------+ -| hostname | any | Hostname of machine after installation | Yes | -+----------------------+--------------------------------------------------------+----------------------------------------------------------------------------+-----------------------------------------------+ -| kernels | [ "kernel1", "kernel2"] | List of kernels to install eg: linux, linux-lts, linux-zen etc | Atleast 1 | -+----------------------+--------------------------------------------------------+----------------------------------------------------------------------------+-----------------------------------------------+ -| keyboard-language | 2 letter code for your keyboard language | eg: us, de etc | Yes | -+----------------------+--------------------------------------------------------+----------------------------------------------------------------------------+-----------------------------------------------+ -| mirror-region | {"<Region Name>": { "Mirror Name": True/False}, ..} | List of regions and mirrors to use | Yes | -+----------------------+--------------------------------------------------------+----------------------------------------------------------------------------+-----------------------------------------------+ -| nic | nic to use, Use value NetworkManager for installing it | | Yes | -+----------------------+--------------------------------------------------------+----------------------------------------------------------------------------+-----------------------------------------------+ -| packages | [ "package1", "package2", ..] | List of packages to install post-installation | No | -+----------------------+--------------------------------------------------------+----------------------------------------------------------------------------+-----------------------------------------------+ -| profile | Name of profile to install | profiles are present in profiles/, use the name of a profile to install it | No | -+----------------------+--------------------------------------------------------+----------------------------------------------------------------------------+-----------------------------------------------+ -| !root-password | any | The root account password | No | -+----------------------+--------------------------------------------------------+----------------------------------------------------------------------------+-----------------------------------------------+ -| services | [ "service1", "service2", ..] | Services to enable post-installation | No | -+----------------------+--------------------------------------------------------+----------------------------------------------------------------------------+-----------------------------------------------+ -| superusers | { "<username>": { "!password": "<password>"}, ..} | List of superuser credentials, see config for reference | Yes, if root account password is not provided | -+----------------------+--------------------------------------------------------+----------------------------------------------------------------------------+-----------------------------------------------+ -| timezone | Timezone to configure in installation | Timezone eg: UTC, Asia/Kolkata etc. | Yes | -+----------------------+--------------------------------------------------------+----------------------------------------------------------------------------+-----------------------------------------------+ -| users | { "<username>": { "!password": "<password>"}, ..} | List of regular user credentials, see config for reference | Yes, can be {} | -+----------------------+--------------------------------------------------------+----------------------------------------------------------------------------+-----------------------------------------------+ ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| Key | Values/Description | Description | Required | +| | | | | ++======================+======================================================================================================================================+======================================================================================+===============================================+ +| audio | pipewire/pulseaudio | Audioserver to be installed | No | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| bootloader | systemd-bootctl/grub-install | Bootloader to be installed | Yes | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| custom-commands | [ <command1>, <command2>, ...] | Custom commands to be run post install | No | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| !encryption-password | any | Password to encrypt disk, not encrypted if password not provided | No | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| filesystem | ext4 / btrfs / fat32 etc. | Filesystem for root and home partitions | Yes | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| gfx_driver | "VMware / VirtualBox (open-source)" or "Nvidia" or "Intel (open-source)" or "AMD / ATI (open-source)" or "All open-source (default)" | Graphics Drivers to install | No | +| | | | | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| harddrive | { "path": <path of device> } | Path of device to be used | Yes | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| hostname | any | Hostname of machine after installation | Yes | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| kernels | [ "kernel1", "kernel2"] | List of kernels to install eg: linux, linux-lts, linux-zen etc | Atleast 1 | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| keyboard-language | 2 letter code for your keyboard language | eg: us, de etc | Yes | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| mirror-region | {"<Region Name>": { "Mirror Name": True/False}, ..} | List of regions and mirrors to use | Yes | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| nic | { NetworkManager: <boolean>, nic: <nic name> } | | Yes | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| ntp | <boolean> | Set to true to set-up ntp post install | No | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| packages | [ "package1", "package2", ..] | List of packages to install post-installation | No | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| profile | Name of the profile to install | Profiles are present in profiles/, use the name of a profile to install it | No | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| !root-password | any | The root account password | No | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| services | [ "service1", "service2", ..] | Services to enable post-installation | No | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| sys-encoding | "utf-8" | Set to change system encoding post-install, ignored if --advanced flag is not passed | No | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| sys-language | "en_US" | Set to change system language post-install, ignored if --advanced flag is not passed | No | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| superusers | { "<username>": { "!password": "<password>"}, ..} | List of superuser credentials, see configuration for reference | Yes, if root account password is not provided | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| timezone | Timezone to configure in installation | Timezone eg: UTC, Asia/Kolkata etc. | Yes | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ +| users | { "<username>": { "!password": "<password>"}, ..} | List of regular user credentials, see configuration for reference | Yes, can be {} | ++----------------------+--------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------------------------------------+ Description individual steps ============================ diff --git a/examples/custom-command-sample.json b/examples/custom-command-sample.json index 5e7a70e3..f38bcca1 100644 --- a/examples/custom-command-sample.json +++ b/examples/custom-command-sample.json @@ -8,6 +8,7 @@ ], "!encryption-password": "supersecret", "filesystem": "btrfs", + "gfx_driver": "VMware / VirtualBox (open-source)", "harddrive": { "path": "/dev/nvme0n1" }, @@ -16,14 +17,11 @@ "linux" ], "keyboard-language": "us", - "mirror-region": { - "Worldwide": { - "https://mirror.rackspace.com/archlinux/$repo/os/$arch": true - } - }, + "mirror-region": "Worldwide", "nic": { "NetworkManager": true }, + "ntp": true, "packages": ["docker", "git", "wget", "zsh"], "profile": "gnome", "services": ["docker"], @@ -32,6 +30,8 @@ "!password": "devel" } }, + "sys-encoding": "utf-8", + "sys-language": "en_US", "timezone": "US/Eastern", "users": {} } diff --git a/examples/guided.py b/examples/guided.py index 73fded4e..42429370 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -5,7 +5,7 @@ import time import archinstall from archinstall.lib.general import run_custom_user_commands -from archinstall.lib.hardware import has_uefi +from archinstall.lib.hardware import has_uefi, AVAILABLE_GFX_DRIVERS from archinstall.lib.networking import check_mirror_reachable from archinstall.lib.profiles import Profile @@ -61,7 +61,6 @@ def ask_user_questions(): if not archinstall.arguments.get('sys-encoding', None): archinstall.arguments['sys-encoding'] = 'utf-8' - # Ask which harddrive/block-device we will install to if archinstall.arguments.get('harddrive', None): archinstall.arguments['harddrive'] = archinstall.BlockDevice(archinstall.arguments['harddrive']) @@ -259,7 +258,10 @@ def perform_installation_steps(): print() print('This is your chosen configuration:') archinstall.log("-- Guided template chosen (with below config) --", level=logging.DEBUG) - archinstall.log(json.dumps(archinstall.arguments, indent=4, sort_keys=True, cls=archinstall.JSON), level=logging.INFO) + user_configuration = json.dumps(archinstall.arguments, indent=4, sort_keys=True, cls=archinstall.JSON) + archinstall.log(user_configuration, level=logging.INFO) + with open("/var/log/archinstall/user_configuration.json", "w") as config_file: + config_file.write(user_configuration) print() if not archinstall.arguments.get('silent'): @@ -442,13 +444,21 @@ else: archinstall.arguments['harddrive'].keep_partitions = False # Temporary workaround to make Desktop Environments work if archinstall.arguments.get('profile', None) is not None: - archinstall.arguments['profile'] = archinstall.Profile(None, archinstall.arguments.get('profile', None)) + if type(archinstall.arguments.get('profile', None)) is dict: + archinstall.arguments['profile'] = archinstall.Profile(None, archinstall.arguments.get('profile', None)['path']) + else: + archinstall.arguments['profile'] = archinstall.Profile(None, archinstall.arguments.get('profile', None)) else: archinstall.arguments['profile'] = None if archinstall.arguments.get('mirror-region', None) is not None: - selected_region = archinstall.arguments.get('mirror-region', None) - archinstall.arguments['mirror-region'] = {selected_region: archinstall.list_mirrors()[selected_region]} + if type(archinstall.arguments.get('mirror-region', None)) is dict: + archinstall.arguments['mirror-region'] = archinstall.arguments.get('mirror-region', None) + else: + selected_region = archinstall.arguments.get('mirror-region', None) + archinstall.arguments['mirror-region'] = {selected_region: archinstall.list_mirrors()[selected_region]} archinstall.arguments['sys-language'] = archinstall.arguments.get('sys-language', 'en_US') archinstall.arguments['sys-encoding'] = archinstall.arguments.get('sys-encoding', 'utf-8') - + if archinstall.arguments.get('gfx_driver', None) is not None: + archinstall.storage['gfx_driver_packages'] = AVAILABLE_GFX_DRIVERS.get(archinstall.arguments.get('gfx_driver', None), None) + perform_installation_steps() diff --git a/profiles/desktop.py b/profiles/desktop.py index 631c7f76..73df9256 100644 --- a/profiles/desktop.py +++ b/profiles/desktop.py @@ -4,6 +4,8 @@ import archinstall is_top_level_profile = True +__description__ = 'Provides a selection of desktop environments and tiling window managers, e.g. gnome, kde, sway' + # New way of defining packages for a profile, which is iterable and can be used out side # of the profile to get a list of "what packages will be installed". __packages__ = [ diff --git a/profiles/minimal.py b/profiles/minimal.py index 13cfd05a..c7df517c 100644 --- a/profiles/minimal.py +++ b/profiles/minimal.py @@ -2,6 +2,8 @@ is_top_level_profile = True +__description__ = 'A very basic installation that allows you to customize Arch Linux as you see fit.' + def _prep_function(*args, **kwargs): """ diff --git a/profiles/server.py b/profiles/server.py index 704c8efe..79aa9481 100644 --- a/profiles/server.py +++ b/profiles/server.py @@ -6,6 +6,8 @@ import archinstall is_top_level_profile = True +__description__ = 'Provides a selection of various server packages to install and enable, e.g. httpd, nginx, mariadb' + available_servers = [ "cockpit", "docker", diff --git a/profiles/sway.py b/profiles/sway.py index 9afc047d..b0ff8c19 100644 --- a/profiles/sway.py +++ b/profiles/sway.py @@ -25,7 +25,7 @@ def _prep_function(*args, **kwargs): other code in this stage. So it's a safe way to ask the user for more input before any other installer steps start. """ - __builtins__["_gfx_driver_packages"] = archinstall.select_driver() + archinstall.storage["gfx_driver_packages"] = archinstall.select_driver() return True @@ -34,7 +34,7 @@ def _prep_function(*args, **kwargs): # through importlib.util.spec_from_file_location("sway", "/somewhere/sway.py") # or through conventional import sway if __name__ == "sway": - if "nvidia" in _gfx_driver_packages: + if "nvidia" in archinstall.storage.get("gfx_driver_packages", None): choice = input("The proprietary Nvidia driver is not supported by Sway. It is likely that you will run into issues. Continue anyways? [y/N] ") if choice.lower() in ("n", ""): raise archinstall.lib.exceptions.HardwareIncompatibilityError("Sway does not support the proprietary nvidia drivers.") @@ -43,4 +43,4 @@ if __name__ == "sway": archinstall.storage['installation_session'].add_additional_packages(__packages__) # Install the graphics driver packages - archinstall.storage['installation_session'].add_additional_packages(_gfx_driver_packages) + archinstall.storage['installation_session'].add_additional_packages(f"xorg-server xorg-xinit {' '.join(archinstall.storage.get('gfx_driver_packages', None))}") diff --git a/profiles/xorg.py b/profiles/xorg.py index b8fb2cbb..ce13664d 100644 --- a/profiles/xorg.py +++ b/profiles/xorg.py @@ -4,6 +4,8 @@ import archinstall is_top_level_profile = True +__description__ = 'Installs a minimal system as well as xorg and graphics drivers.' + __packages__ = [ 'dkms', 'xorg-server', @@ -22,7 +24,7 @@ def _prep_function(*args, **kwargs): for more input before any other installer steps start. """ - __builtins__['_gfx_driver_packages'] = archinstall.select_driver() + archinstall.storage["gfx_driver_packages"] = archinstall.select_driver() # TODO: Add language section and/or merge it with the locale selected # earlier in for instance guided.py installer. @@ -35,13 +37,13 @@ def _prep_function(*args, **kwargs): # or through conventional import xorg if __name__ == 'xorg': try: - if "nvidia" in _gfx_driver_packages: + if "nvidia" in archinstall.storage.get("gfx_driver_packages", None): if "linux-zen" in archinstall.storage['installation_session'].base_packages or "linux-lts" in archinstall.storage['installation_session'].base_packages: archinstall.storage['installation_session'].add_additional_packages("dkms") # I've had kernel regen fail if it wasn't installed before nvidia-dkms archinstall.storage['installation_session'].add_additional_packages("xorg-server xorg-xinit nvidia-dkms") else: - archinstall.storage['installation_session'].add_additional_packages(f"xorg-server xorg-xinit {' '.join(_gfx_driver_packages)}") + archinstall.storage['installation_session'].add_additional_packages(f"xorg-server xorg-xinit {' '.join(archinstall.storage.get('gfx_driver_packages', None))}") else: - archinstall.storage['installation_session'].add_additional_packages(f"xorg-server xorg-xinit {' '.join(_gfx_driver_packages)}") + archinstall.storage['installation_session'].add_additional_packages(f"xorg-server xorg-xinit {' '.join(archinstall.storage.get('gfx_driver_packages', None))}") except: archinstall.storage['installation_session'].add_additional_packages("xorg-server xorg-xinit") # Prep didn't run, so there's no driver to install |