From 6057203e5bc1dc22f95dfef513fdb23950db8326 Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Sat, 15 May 2021 12:59:38 -0400 Subject: More formatting fixes --- docs/pull_request_template.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/pull_request_template.md') diff --git a/docs/pull_request_template.md b/docs/pull_request_template.md index 729c1aae..18d01ab2 100644 --- a/docs/pull_request_template.md +++ b/docs/pull_request_template.md @@ -12,5 +12,5 @@ If the PR is larger than ~20 lines, please describe it here unless described in # Testing -Any new feature or stability improvement should be tested if possible. -Please follow the test instructions at the bottom of the README or use the ISO built on each PR. \ No newline at end of file +Any new feature or stability improvement should be tested if possible. Please follow the test instructions at the bottom +of the README or use the ISO built on each PR. -- cgit v1.2.3-70-g09d2 From 3b20adb7d216cbe72bf1770e219207216bee96ee Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Sat, 15 May 2021 13:59:37 -0400 Subject: Whitespace changes --- archinstall/lib/disk.py | 16 ++++++++++------ archinstall/lib/general.py | 2 ++ archinstall/lib/hardware.py | 2 +- archinstall/lib/installer.py | 5 ++--- archinstall/lib/mirrors.py | 2 +- archinstall/lib/profiles.py | 6 +++--- archinstall/lib/services.py | 2 +- docs/pull_request_template.md | 3 +-- examples/guided.py | 12 ++++++------ profiles/gnome.py | 4 ++-- profiles/xorg.py | 4 ++-- 11 files changed, 31 insertions(+), 27 deletions(-) (limited to 'docs/pull_request_template.md') diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py index 2241ac8e..62f1785f 100644 --- a/archinstall/lib/disk.py +++ b/archinstall/lib/disk.py @@ -152,8 +152,9 @@ class BlockDevice(): def flush_cache(self): self.part_cache = OrderedDict() + class Partition(): - def __init__(self, path :str, block_device :BlockDevice, part_id=None, size=-1, filesystem=None, mountpoint=None, encrypted=False, autodetect_filesystem=True): + def __init__(self, path: str, block_device: BlockDevice, part_id=None, size=-1, filesystem=None, mountpoint=None, encrypted=False, autodetect_filesystem=True): if not part_id: part_id = os.path.basename(path) @@ -506,9 +507,9 @@ class Filesystem(): self.blockdevice.partition[0].allow_formatting = True self.blockdevice.partition[1].allow_formatting = True else: - #we don't need a seprate boot partition it would be a waste of space + # we don't need a seprate boot partition it would be a waste of space self.add_partition('primary', start='1MB', end='100%') - self.blockdevice.partition[0].filesystem=root_filesystem_type + self.blockdevice.partition[0].filesystem = root_filesystem_type log(f"Set the root partition {self.blockdevice.partition[0]} to use filesystem {root_filesystem_type}.", level=logging.DEBUG) self.blockdevice.partition[0].target_mountpoint = '/' self.blockdevice.partition[0].allow_formatting = True @@ -558,28 +559,31 @@ def device_state(name, *args, **kwargs): return return True + # lsblk --json -l -n -o path def all_disks(*args, **kwargs): kwargs.setdefault("partitions", False) drives = OrderedDict() - #for drive in json.loads(sys_command(f'losetup --json', *args, **lkwargs, hide_from_log=True)).decode('UTF_8')['loopdevices']: + # for drive in json.loads(sys_command(f'losetup --json', *args, **lkwargs, hide_from_log=True)).decode('UTF_8')['loopdevices']: for drive in json.loads(b''.join(sys_command(f'lsblk --json -l -n -o path,size,type,mountpoint,label,pkname,model', *args, **kwargs, hide_from_log=True)).decode('UTF_8'))['blockdevices']: if not kwargs['partitions'] and drive['type'] == 'part': continue drives[drive['path']] = BlockDevice(drive['path'], drive) return drives + def convert_to_gigabytes(string): unit = string.strip()[-1] size = float(string.strip()[:-1]) if unit == 'M': - size = size/1024 + size = size / 1024 elif unit == 'T': - size = size*1024 + size = size * 1024 return size + def harddrive(size=None, model=None, fuzzy=False): collection = all_disks() for drive in collection: diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py index 9f6de666..f9b9078a 100644 --- a/archinstall/lib/general.py +++ b/archinstall/lib/general.py @@ -83,10 +83,12 @@ class JSON(json.JSONEncoder, json.JSONDecoder): def encode(self, obj): return super(JSON, self).encode(self._encode(obj)) + class sys_command: """ Stolen from archinstall_gui """ + def __init__(self, cmd, callback=None, start_callback=None, peak_output=False, environment_vars={}, *args, **kwargs): kwargs.setdefault("worker_id", gen_uid()) kwargs.setdefault("emulate", False) diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py index 9eaff22e..3203daee 100644 --- a/archinstall/lib/hardware.py +++ b/archinstall/lib/hardware.py @@ -108,7 +108,7 @@ def cpuVendor() -> Optional[str]: def isVM() -> bool: try: - subprocess.check_call(["systemd-detect-virt"]) # systemd-detect-virt issues a non-zero exit code if it is not on a virtual machine + subprocess.check_call(["systemd-detect-virt"]) # systemd-detect-virt issues a non-zero exit code if it is not on a virtual machine return True except: return False diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index eccd2c49..cacdff69 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -153,7 +153,7 @@ class Installer(): return True - def set_hostname(self, hostname :str, *args, **kwargs): + def set_hostname(self, hostname: str, *args, **kwargs): with open(f'{self.target}/etc/hostname', 'w') as fh: fh.write(hostname + '\n') @@ -423,7 +423,6 @@ class Installer(): ## blkid doesn't trigger on loopback devices really well, ## so we'll use the old manual method until we get that sorted out. - if (real_device := self.detect_encryption(root_partition)): # TODO: We need to detect if the encrypted device is a whole disk encryption, # or simply a partition encryption. Right now we assume it's a partition (and we always have) @@ -446,7 +445,7 @@ class Installer(): sys_command('/usr/bin/arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg') return True else: - root_device = subprocess.check_output(f'basename "$(readlink -f /sys/class/block/{root_partition.path.replace("/dev/","")}/..)"', shell=True).decode().strip() + root_device = subprocess.check_output(f'basename "$(readlink -f /sys/class/block/{root_partition.path.replace("/dev/", "")}/..)"', shell=True).decode().strip() if root_device == "block": root_device = f"{root_partition.path}" o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.target} grub-install --target=i386-pc /dev/{root_device}')) diff --git a/archinstall/lib/mirrors.py b/archinstall/lib/mirrors.py index e53b356a..4b05b96a 100644 --- a/archinstall/lib/mirrors.py +++ b/archinstall/lib/mirrors.py @@ -22,7 +22,7 @@ def filter_mirrors_by_region(regions, destination='/etc/pacman.d/mirrorlist', tm return True -def add_custom_mirrors(mirrors:list, *args, **kwargs): +def add_custom_mirrors(mirrors: list, *args, **kwargs): """ This will append custom mirror definitions in pacman.conf diff --git a/archinstall/lib/profiles.py b/archinstall/lib/profiles.py index 8b5525b4..2f97231c 100644 --- a/archinstall/lib/profiles.py +++ b/archinstall/lib/profiles.py @@ -14,7 +14,7 @@ from .storage import storage 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:], ('/', '?', '=', '&'))]) + safe_path = path[:path.find(':') + 1] + ''.join([item if item in ('/', '?', '=', '&') else urllib.parse.quote(item) for item in multisplit(path[path.find(':') + 1:], ('/', '?', '=', '&'))]) ssl_context = ssl.create_default_context() ssl_context.check_hostname = False ssl_context.verify_mode = ssl.CERT_NONE @@ -47,7 +47,7 @@ def list_profiles(filter_irrelevant_macs=True, subpath='', filter_top_level_prof if len(first_line) and first_line[0] == '#': description = first_line[1:].strip() - cache[file[:-3]] = {'path' : os.path.join(root, file), 'description' : description, 'tailored' : tailored} + cache[file[:-3]] = {'path': os.path.join(root, file), 'description': description, 'tailored': tailored} break # Grab profiles from upstream URL @@ -70,7 +70,7 @@ def list_profiles(filter_irrelevant_macs=True, subpath='', filter_top_level_prof continue tailored = True - cache[profile[:-3]] = {'path' : os.path.join(storage["UPSTREAM_URL"]+subpath, profile), 'description' : profile_list[profile], 'tailored' : tailored} + cache[profile[:-3]] = {'path': os.path.join(storage["UPSTREAM_URL"] + subpath, profile), 'description': profile_list[profile], 'tailored': tailored} if filter_top_level_profiles: for profile in list(cache.keys()): diff --git a/archinstall/lib/services.py b/archinstall/lib/services.py index 46aa7846..537a2f84 100644 --- a/archinstall/lib/services.py +++ b/archinstall/lib/services.py @@ -5,6 +5,6 @@ def service_state(service_name: str): if os.path.splitext(service_name)[1] != '.service': service_name += '.service' # Just to be safe - state = b''.join(sys_command(f'systemctl show --no-pager -p SubState --value {service_name}', environment_vars={'SYSTEMD_COLORS' : '0'})) + state = b''.join(sys_command(f'systemctl show --no-pager -p SubState --value {service_name}', environment_vars={'SYSTEMD_COLORS': '0'})) return state.strip().decode('UTF-8') diff --git a/docs/pull_request_template.md b/docs/pull_request_template.md index 18d01ab2..1cbcf76a 100644 --- a/docs/pull_request_template.md +++ b/docs/pull_request_template.md @@ -12,5 +12,4 @@ If the PR is larger than ~20 lines, please describe it here unless described in # Testing -Any new feature or stability improvement should be tested if possible. Please follow the test instructions at the bottom -of the README or use the ISO built on each PR. +Any new feature or stability improvement should be tested if possible. Please follow the test instructions at the bottom of the README or use the ISO built on each PR. diff --git a/examples/guided.py b/examples/guided.py index ae5c5f54..ca50f838 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -85,7 +85,7 @@ def ask_user_questions(): # If we provide keys as options, it's better to convert them to list and sort before passing mountpoints_list = sorted(list(partition_mountpoints.keys())) partition = archinstall.generic_select(mountpoints_list, - "Select a partition by number that you want to set a mount-point for (leave blank when done): ") + "Select a partition by number that you want to set a mount-point for (leave blank when done): ") if not partition: if set(mountpoints_set) & {'/', '/boot'} == {'/', '/boot'}: break @@ -316,12 +316,12 @@ def perform_installation(mountpoint): time.sleep(1) # Set mirrors used by pacstrap (outside of installation) if archinstall.arguments.get('mirror-region', None): - archinstall.use_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors for the live medium + archinstall.use_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors for the live medium if installation.minimal_installation(): installation.set_hostname(archinstall.arguments['hostname']) if archinstall.arguments['mirror-region'].get("mirrors", None) is not None: - installation.set_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors in the installation medium - if archinstall.arguments["bootloader"]=="grub-install" and hasUEFI()==True: + installation.set_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors in the installation medium + if archinstall.arguments["bootloader"] == "grub-install" and hasUEFI() == True: installation.add_additional_packages("grub") installation.set_keyboard_language(archinstall.arguments['keyboard-language']) installation.add_bootloader(archinstall.arguments["bootloader"]) @@ -329,8 +329,8 @@ def perform_installation(mountpoint): # If user selected to copy the current ISO network configuration # Perform a copy of the config if archinstall.arguments.get('nic', {}) == 'Copy ISO network configuration to installation': - installation.copy_ISO_network_config(enable_services=True) # Sources the ISO network configuration to the install medium. - elif archinstall.arguments.get('nic', {}).get('NetworkManager',False): + installation.copy_ISO_network_config(enable_services=True) # Sources the ISO network configuration to the install medium. + elif archinstall.arguments.get('nic', {}).get('NetworkManager', False): installation.add_additional_packages("networkmanager") installation.enable_service('NetworkManager.service') # Otherwise, if a interface was selected, configure that interface diff --git a/profiles/gnome.py b/profiles/gnome.py index 09fac1bb..7bf5b7fd 100644 --- a/profiles/gnome.py +++ b/profiles/gnome.py @@ -37,5 +37,5 @@ if __name__ == 'gnome': archinstall.storage['installation_session'].add_additional_packages(__packages__) archinstall.storage['installation_session'].enable_service('gdm') # Gnome Display Manager - # We could also start it via xinitrc since we do have Xorg, - # but for gnome that's deprecated and wayland is preferred. +# We could also start it via xinitrc since we do have Xorg, +# but for gnome that's deprecated and wayland is preferred. diff --git a/profiles/xorg.py b/profiles/xorg.py index 3351e4e5..e18a4f03 100644 --- a/profiles/xorg.py +++ b/profiles/xorg.py @@ -30,11 +30,11 @@ if __name__ == 'xorg': try: if "nvidia" in _gfx_driver_packages: 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("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)}") else: archinstall.storage['installation_session'].add_additional_packages(f"xorg-server xorg-xinit {' '.join(_gfx_driver_packages)}") except: - archinstall.storage['installation_session'].add_additional_packages("xorg-server xorg-xinit") # Prep didn't run, so there's no driver to install \ No newline at end of file + archinstall.storage['installation_session'].add_additional_packages("xorg-server xorg-xinit") # Prep didn't run, so there's no driver to install -- cgit v1.2.3-70-g09d2 From da0da729c5f3ef0aaf832229901dda221de654ab Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Tue, 18 May 2021 09:10:24 -0400 Subject: Proofreading: Fix misc. spelling and grammar issues --- CONTRIBUTING.md | 29 +++++++--------- README.md | 66 ++++++++++++++++++++----------------- archinstall/lib/mirrors.py | 4 +-- archinstall/lib/networking.py | 2 +- archinstall/lib/output.py | 4 +-- archinstall/lib/user_interaction.py | 4 +-- docs/examples/python.rst | 4 +-- docs/installing/guided.rst | 2 +- docs/pull_request_template.md | 4 +-- profiles/52-54-00-12-34-56.py | 2 +- profiles/i3.py | 2 +- 11 files changed, 62 insertions(+), 61 deletions(-) (limited to 'docs/pull_request_template.md') diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1d490a44..a92cff91 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,32 +1,28 @@ # Contributing to archinstall -Any contributions through pull requests are welcome as this project aims to be a community based project to ease some -Arch Linux installation steps. Bear in mind that in the future this repo might be transferred to the -official [GitLab repo under Arch Linux](http://gitlab.archlinux.org/archlinux/) *(if GitLab becomes open to the general -public)*. +Any contributions through pull requests are welcome as this project aims to be a community based project to ease some Arch Linux installation steps. +Bear in mind that in the future this repo might be transferred to the official [GitLab repo under Arch Linux](http://gitlab.archlinux.org/archlinux/) + *(if GitLab becomes open to the general public)*. -Therefore guidelines and style changes to the code might come into affect as well as guidelines surrounding bug -reporting and discussions. +Therefore, guidelines and style changes to the code might come into effect as well as guidelines surrounding bug reporting and discussions. ## Branches -`master` is currently the default branch, and that's where all future feature work is being done, this means -that `master` is a living entity and will most likely never be in a fully stable state. For stable releases, please see -the tagged commits. +`master` is currently the default branch, and that's where all future feature work is being done, this means that `master` is a living entity and will most likely never be in a fully stable state. +For stable releases, please see the tagged commits. -Patch releases will be done against their own branches, branched from stable tagged releases and will be named according -to the version it will become on release *(Patches to `v2.1.4` will be done on branch `v2.1.5` for instance)*. +Patch releases will be done against their own branches, branched from stable tagged releases and will be named according to the version it will become on release. + *(Patches to `v2.1.4` will be done on branch `v2.1.5` for instance)*. ## Discussions -Currently, questions, bugs and suggestions should be reported -through [GitHub issue tracker](https://github.com/archlinux/archinstall/issues).
+Currently, questions, bugs and suggestions should be reported through [GitHub issue tracker](https://github.com/archlinux/archinstall/issues).
For less formal discussions there are also a [archinstall Discord server](https://discord.gg/cqXU88y). ## Coding convention -Archinstall's goal is to follow [PEP8](https://www.python.org/dev/peps/pep-0008/) as best as it can with some minor -exceptions.
+ArchInstall's goal is to follow [PEP8](https://www.python.org/dev/peps/pep-0008/) as best as it can with some minor exceptions.
+ The exceptions to PEP8 are: * Archinstall uses [tabs instead of spaces](https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces) simply to make it @@ -46,8 +42,7 @@ There might therefore be older code which does not follow the coding convention ## Submitting Changes -Archinstall uses Github's pull-request workflow and all contributions in terms of code should be done through pull -requests.
+Archinstall uses GitHub's pull-request workflow and all contributions in terms of code should be done through pull requests.
Anyone interested in archinstall may review your code. One of the core developers will merge your pull request when they think it is ready. For every pull request, we aim to promptly either merge it or say why it is not yet ready; if you go diff --git a/README.md b/README.md index 63c8cefe..139dbd48 100644 --- a/README.md +++ b/README.md @@ -2,16 +2,16 @@ drawing # Arch 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 install Arch Linux and manage services, packages and other things inside the installed system *(Usually from a live medium)*. - * 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 [documentation](https://python-archinstall.readthedocs.io/en/latest/index.html) - +* 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 [documentation](https://python-archinstall.readthedocs.io/en/latest/index.html) # Installation & Usage @@ -22,24 +22,27 @@ Or use `pip install --upgrade archinstall` to use as a library. ## Running the [guided](examples/guided.py) installer -Assuming you are on a Arch Linux live-ISO and booted into EFI mode. +Assuming you are on an Arch Linux live-ISO and booted into EFI mode. # python -m archinstall guided # Help? -Submit an issue here on Github, or submit a post in the discord help channel.
+Submit an issue here on GitHub, or submit a post in the discord help channel.
When doing so, attach the `/var/log/archinstall/install.log` to the issue ticket. This helps us help you! # 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. +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. +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. +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. @@ -47,7 +50,7 @@ Therefore, Archinstall will try its best to not introduce any breaking changes e You could just copy [guided.py](examples/guided.py) as a starting point. -But assuming you're building your own ISO and want to create an automated install process, or you want to install virtual machines on to local disk images.
+However, assuming you're building your own ISO and want to create an automated installation process, or you want to install virtual machines on to local disk images.
This is probably what you'll need, a [minimal example](examples/minimal.py) of how to install using archinstall as a Python library. ```python @@ -99,33 +102,36 @@ with archinstall.Installer('/mnt') as installation: This installer will perform the following: - * Prompt the user to select a disk and disk-password - * Proceed to wipe the selected disk with a `GPT` partition table on a UEFI system and MBR on a bios system. - * 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 to partition 0 on uefi. on bios it sets the root to partition 0. - * Install additional packages *(nano, wget, git)* +* Prompt the user to select a disk and disk-password +* Proceed to wipe the selected disk with a `GPT` partition table on a UEFI system and MBR on a BIOS system. +* 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 to partition 0 on uefi. On BIOS, it sets the root to partition 0. +* Install additional packages *(nano, wget, git)* > **Creating your own ISO with this script on it:** 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. ## Unattended installation based on MAC address -Archinstall comes with a [unattended](examples/unattended.py) example which will look for a matching profile for the machine it is being run on, based on any local MAC address. For instance, if the machine that [unattended](examples/unattended.py) is run on has the MAC address `52:54:00:12:34:56` it will look for a profile called [profiles/52-54-00-12-34-56.py](profiles/52-54-00-12-34-56.py). If it's found, the unattended installation will commence and source that profile as it's installation proceedure. +Archinstall comes with a [unattended](examples/unattended.py) example which will look for a matching profile for the machine it is being run on, based on any local MAC address. +For instance, if the machine that [unattended](examples/unattended.py) is run on has the MAC address `52:54:00:12:34:56` it will look for a profile called [profiles/52-54-00-12-34-56.py](profiles/52-54-00-12-34-56.py). +If it's found, the unattended installation will commence and source that profile as it's installation procedure. # Testing ## Using a Live ISO Image -If you want to test a commit, branch or bleeding edge release from the repository using the vanilla Arch Live ISO image, you can replace the version of archinstall with a new version and run that with the steps described below. +If you want to test a commit, branch or bleeding edge release from the repository using the vanilla Arch Live ISO image, +you can replace the version of archinstall with a new version and run that with the steps described below: - 1. You need a working network connection - 2. Install the build requirements with `pacman -Sy; pacman -S git python-pip` - *(note that this may or may not work depending on your RAM and current state of the squashfs maximum filesystem free space)* - 3. Uninstall the previous version of archinstall with `pip uninstall archinstall` - 4. Now clone the latest repository with `git clone https://github.com/archlinux/archinstall` - 5. Enter the repository with `cd archinstall` - *At this stage, you can choose to check out a feature branch for instance with `git checkout torxed-v2.2.0`* - 6. Build the project and install it using `python setup.py install` +1. You need a working network connection +2. Install the build requirements with `pacman -Sy; pacman -S git python-pip` + *(note that this may or may not work depending on your RAM and current state of the squashfs maximum filesystem free space)* +3. Uninstall the previous version of archinstall with `pip uninstall archinstall` +4. Now clone the latest repository with `git clone https://github.com/archlinux/archinstall` +5. Enter the repository with `cd archinstall` + *At this stage, you can choose to check out a feature branch for instance with `git checkout torxed-v2.2.0`* +6. Build the project and install it using `python setup.py install` After this, running archinstall with `python -m archinstall` will run against whatever branch you chose in step 5. @@ -141,9 +147,9 @@ This can be done by installing `pacman -S arch-install-scripts util-linux` local # python -m archinstall guided # qemu-system-x86_64 -enable-kvm -machine q35,accel=kvm -device intel-iommu -cpu host -m 4096 -boot order=d -drive file=./testimage.img,format=raw -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_CODE.fd -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_VARS.fd -This will create a *5GB* `testimage.img` and create a loop device which we can use to format and install to.
-`archinstall` is installed and executed in [guided mode](#docs-todo). Once the installation is complete,
-~~you can use qemu/kvm to boot the test media.~~ *(You'd actually need to do some EFI magic in order to point the EFI vars to the partition 0 in the test medium so this won't work entirely out of the box, but gives you a general idea of what we're going for here)* +This will create a *5 GB* `testimage.img` and create a loop device which we can use to format and install to.
+`archinstall` is installed and executed in [guided mode](#docs-todo). Once the installation is complete, ~~you can use qemu/kvm to boot the test media.~~
+*(You'd actually need to do some EFI magic in order to point the EFI vars to the partition 0 in the test medium, so this won't work entirely out of the box, but that gives you a general idea of what we're going for here)* There's also a [Building and Testing](https://github.com/archlinux/archinstall/wiki/Building-and-Testing) guide.
It will go through everything from packaging, building and running *(with qemu)* the installer against a dev branch. diff --git a/archinstall/lib/mirrors.py b/archinstall/lib/mirrors.py index 5050df7d..4ef4fa49 100644 --- a/archinstall/lib/mirrors.py +++ b/archinstall/lib/mirrors.py @@ -10,8 +10,8 @@ def filter_mirrors_by_region(regions, destination='/etc/pacman.d/mirrorlist', tm This function will change the active mirrors on the live medium by filtering which regions are active based on `regions`. - :param region: A series of country codes separated by `,`. For instance `SE,US` for sweden and United States. - :type region: str + :param regions: A series of country codes separated by `,`. For instance `SE,US` for sweden and United States. + :type regions: str """ region_list = [] for region in regions.split(','): diff --git a/archinstall/lib/networking.py b/archinstall/lib/networking.py index 8a2f0edd..dbd510dd 100644 --- a/archinstall/lib/networking.py +++ b/archinstall/lib/networking.py @@ -31,7 +31,7 @@ def check_mirror_reachable(): check = SysCommand("pacman -Sy") return check.exit_code == 0 except: - return False + return False def enrich_iface_types(interfaces: dict): diff --git a/archinstall/lib/output.py b/archinstall/lib/output.py index 8bc6cacb..20b0df8d 100644 --- a/archinstall/lib/output.py +++ b/archinstall/lib/output.py @@ -26,7 +26,7 @@ class Journald(dict): except ModuleNotFoundError: return False - # For backwards compability, convert old style log-levels + # For backwards compatibility, convert old style log-levels # to logging levels (and warn about deprecated usage) # There's some code re-usage here but that should be fine. # TODO: Remove these in a few versions: @@ -135,7 +135,7 @@ def log(*args, **kwargs): # Unless the level is higher than we've decided to output interactively. # (Remember, log files still get *ALL* the output despite level restrictions) if 'level' in kwargs: - # For backwards compability, convert old style log-levels + # For backwards compatibility, convert old style log-levels # to logging levels (and warn about deprecated usage) # There's some code re-usage here but that should be fine. # TODO: Remove these in a few versions: diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py index c640cb83..5f849607 100644 --- a/archinstall/lib/user_interaction.py +++ b/archinstall/lib/user_interaction.py @@ -242,7 +242,7 @@ class MiniCurses: if (mapped_char := mapper.get(char, None)) == 'BACKSPACE': if self._cursor_x <= self.input_pos: - # Don't backspace futher back than the cursor start position during input + # Don't backspace further back than the cursor start position during input return True # Move back to the current known position (BACKSPACE doesn't updated x-pos) sys.stdout.flush() @@ -694,7 +694,7 @@ def select_mirror_regions(mirrors, show_top_mirrors=True): def select_driver(options=AVAILABLE_GFX_DRIVERS): """ - Some what convoluted function, which's job is simple. + Some what convoluted function, whose job is simple. Select a graphics driver from a pre-defined set of popular options. (The template xorg is for beginner users, not advanced, and should diff --git a/docs/examples/python.rst b/docs/examples/python.rst index f6388738..342ec5c7 100644 --- a/docs/examples/python.rst +++ b/docs/examples/python.rst @@ -27,7 +27,7 @@ Lets create a `test_installer` - installer as an example. This is assuming that We begin by creating `./archinstall/examples/test_installer.py`. The placement here is important later. This script can now already be called using `python -m archinstall test_installer` after a successful installation of the library itself. -But the script won't do much. So we'll do something simple like list all the harddrives as an example. +But the script won't do much. So we'll do something simple like list all the hard drives as an example. To do this, we'll begin by importing `archinstall` in our `./archinstall/examples/test_installer.py` and call some functions. @@ -56,4 +56,4 @@ This should now print all available drives on your system. .. note:: - This should work on any system, not just Arch Linux based ones. But note that other functions in the library relies heavily on Arch Linux based commands to execute the installation steps. Such as `arch-chroot`. \ No newline at end of file + This should work on any system, not just Arch Linux based ones. But note that other functions in the library relies heavily on Arch Linux based commands to execute the installation steps. Such as `arch-chroot`. diff --git a/docs/installing/guided.rst b/docs/installing/guided.rst index 8699ae62..88b4e480 100644 --- a/docs/installing/guided.rst +++ b/docs/installing/guided.rst @@ -3,7 +3,7 @@ Guided installation This is the default scripted installation you'll encounter on the official Arch Linux Archinstall package as well as the unofficial ISO found on `https://archlinux.life `_. It will guide your through a very basic installation of Arch Linux. -The installer has two pre-requisits: +The installer has two pre-requisites: * A Physical or Virtual machine to install on * An active internet connection prior to running archinstall diff --git a/docs/pull_request_template.md b/docs/pull_request_template.md index 1cbcf76a..5e6daf51 100644 --- a/docs/pull_request_template.md +++ b/docs/pull_request_template.md @@ -3,11 +3,11 @@ # New features *(v2.2.0)* All future work towards *`v2.2.0`* is done against `master` now.
-Any patch work to existing verions will have to create a new branch against the tagged versions. +Any patch work to existing versions will have to create a new branch against the tagged versions. # Describe your PR -If the changes has been discussed in an Issue, please tag it so we can backtrace from the Issue later on.
+If the changes has been discussed in an Issue, please tag it so that we can backtrace from the issue later on.
If the PR is larger than ~20 lines, please describe it here unless described in an issue. # Testing diff --git a/profiles/52-54-00-12-34-56.py b/profiles/52-54-00-12-34-56.py index e1361073..68e15720 100644 --- a/profiles/52-54-00-12-34-56.py +++ b/profiles/52-54-00-12-34-56.py @@ -23,7 +23,7 @@ with archinstall.Filesystem(harddrive) as fs: fs.use_entire_disk('luks2') if harddrive.partition[1].size == '512M': - raise OSError('Trying to encrypt the boot partition for petes sake..') + raise OSError('Trying to encrypt the boot partition for Pete's sake..') harddrive.partition[0].format('fat32') with archinstall.luks2(harddrive.partition[1], 'luksloop', disk_password) as unlocked_device: diff --git a/profiles/i3.py b/profiles/i3.py index b26745a1..39977b28 100644 --- a/profiles/i3.py +++ b/profiles/i3.py @@ -62,7 +62,7 @@ if __name__ == 'i3': # Install dependency profiles archinstall.storage['installation_session'].install_profile('xorg') - # gaps is installed by deafult so we are overriding it here with lightdm + # gaps is installed by default so we are overriding it here with lightdm archinstall.storage['installation_session'].add_additional_packages(__packages__[4:]) # Auto start lightdm for all users -- cgit v1.2.3-70-g09d2