Skip to content

Commit 9c27882

Browse files
authored
Merge branch 'archlinux:master' into master
2 parents f04e66c + 43963a1 commit 9c27882

145 files changed

Lines changed: 4209 additions & 4706 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.flake8

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
[flake8]
22
count = True
3-
ignore = W191,W503
3+
ignore = W191,W503,E704,E203
44
max-complexity = 40
55
max-line-length = 160
66
show-source = True
77
statistics = True
8-
builtins = _
98
exclude = .git,__pycache__,build,docs,actions-runner

.github/workflows/mypy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
- run: python --version
2121
- run: mypy --version
2222
- name: run mypy
23-
run: mypy --show-traceback --config-file pyproject.toml
23+
run: mypy --config-file pyproject.toml

.github/workflows/python-publish.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,20 @@ jobs:
1111
deploy:
1212

1313
runs-on: ubuntu-latest
14-
14+
permissions:
15+
# IMPORTANT: this permission is mandatory for Trusted Publishing
16+
id-token: write
17+
container:
18+
image: archlinux/archlinux:latest
19+
options: --privileged
1520
steps:
1621
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
17-
- name: Set up Python
18-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
19-
with:
20-
python-version: '3.x'
2122
- name: Prepare arch
2223
run: |
2324
pacman-key --init
2425
pacman --noconfirm -Sy archlinux-keyring
2526
pacman --noconfirm -Syyu
26-
pacman --noconfirm -Sy python-uv python-setuptools python-pip
27+
pacman --noconfirm -Sy python python-uv python-setuptools python-pip python-pyparted python-pydantic
2728
- name: Build archinstall
2829
run: |
2930
uv build --no-build-isolation --wheel

.github/workflows/ruff-format.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
on: [ push, pull_request ]
2+
name: ruff check formatting
3+
jobs:
4+
ruff_format_check:
5+
runs-on: ubuntu-latest
6+
container:
7+
image: archlinux/archlinux:latest
8+
steps:
9+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
10+
- uses: astral-sh/ruff-action@eaf0ecdd668ceea36159ff9d91882c9795d89b49 # v3.4.0
11+
- run: ruff check --select=COM812 --fix
12+
- run: ruff format --diff
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
on: [ push, pull_request ]
2-
name: ruff linting
2+
name: ruff check linting
33
jobs:
44
ruff:
55
runs-on: ubuntu-latest
66
steps:
77
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
8-
- uses: astral-sh/ruff-action@c6bea5606c33b5d04902374392d9233464b90660 # v3.3.0
8+
- uses: astral-sh/ruff-action@eaf0ecdd668ceea36159ff9d91882c9795d89b49 # v3.4.0

.pre-commit-config.yaml

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
default_stages: ['pre-commit']
22
repos:
3-
- repo: https://github.com/pycqa/autoflake
4-
rev: v2.3.1
3+
- repo: https://github.com/astral-sh/ruff-pre-commit
4+
rev: v0.12.0
55
hooks:
6-
- id: autoflake
7-
args: [
8-
'--in-place',
9-
'--remove-all-unused-imports',
10-
'--ignore-init-module-imports'
11-
]
12-
files: \.py$
13-
require_serial: true
14-
fail_fast: true
6+
# fix unused imports and sort them
7+
- id: ruff
8+
args: ["--extend-select", "I", "--fix"]
9+
# format the code
10+
- id: ruff-format
11+
# run the linter
12+
- id: ruff
1513
- repo: https://github.com/pre-commit/pre-commit-hooks
1614
rev: v5.0.0
1715
hooks:
@@ -23,37 +21,27 @@ repos:
2321
- id: check-yaml # Attempts to load all yaml files to verify syntax
2422
- id: destroyed-symlinks # Detects symlinks which are changed to regular files
2523
- id: detect-private-key # Checks for the existence of private keys
26-
- id: end-of-file-fixer # Makes sure files end in a newline and only a newline
27-
- id: trailing-whitespace # Trims trailing whitespace
2824
# Python specific hooks:
2925
- id: check-ast # Simply check whether files parse as valid python
3026
- id: check-docstring-first # Checks for a common error of placing code before the docstring
3127
- repo: https://github.com/pycqa/flake8
32-
rev: 7.2.0
28+
rev: 7.3.0
3329
hooks:
3430
- id: flake8
3531
args: [--config=.flake8]
3632
fail_fast: true
3733
- repo: https://github.com/pre-commit/mirrors-mypy
38-
rev: v1.15.0
34+
rev: v1.16.1
3935
hooks:
4036
- id: mypy
4137
args: [
42-
'--show-traceback',
4338
'--config-file=pyproject.toml'
4439
]
4540
fail_fast: true
4641
additional_dependencies:
4742
- pydantic
4843
- pytest
4944
- cryptography
50-
- repo: https://github.com/astral-sh/ruff-pre-commit
51-
rev: v0.11.8
52-
hooks:
53-
- id: ruff
54-
args: ["check", "--select", "I", "--fix"]
55-
fail_fast: true
56-
- id: ruff
5745
- repo: local
5846
hooks:
5947
- id: pylint

PKGBUILD

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# Maintainer: David Runge <dvzrv@archlinux.org>
22
# Maintainer: Giancarlo Razzolini <grazzolini@archlinux.org>
3+
# Maintainer: Anton Hvornum <torxed@archlinux.org>
34
# Contributor: Anton Hvornum <anton@hvornum.se>
45
# Contributor: demostanis worlds <demostanis@protonmail.com>
56

67
pkgname=archinstall
7-
pkgver=3.0.4
8+
pkgver=3.0.8
89
pkgrel=1
910
pkgdesc="Just another guided/automated Arch Linux installer with a twist"
1011
arch=(any)
1112
url="https://github.com/archlinux/archinstall"
12-
license=(GPL3)
13+
license=(GPL-3.0-only)
1314
depends=(
1415
'arch-install-scripts'
1516
'btrfs-progs'
@@ -24,6 +25,7 @@ depends=(
2425
'pciutils'
2526
'procps-ng'
2627
'python'
28+
'python-cryptography'
2729
'python-pydantic'
2830
'python-pyparted'
2931
'systemd'
@@ -34,13 +36,15 @@ depends=(
3436
'ntfs-3g'
3537
)
3638
makedepends=(
37-
'python-cryptography'
38-
'python-setuptools'
39-
'python-sphinx'
4039
'python-build'
4140
'python-installer'
41+
'python-setuptools'
42+
'python-sphinx'
4243
'python-wheel'
4344
'python-sphinx_rtd_theme'
45+
'python-pylint'
46+
'python-pylint-pydantic'
47+
'ruff'
4448
)
4549
optdepends=(
4650
'python-systemd: Adds journald logging'
@@ -54,19 +58,17 @@ source=(
5458
)
5559
sha512sums=()
5660
b2sums=()
57-
validpgpkeys=('256F73CEEFC6705C6BBAB20E5FBBB32941E3740A') # Anton Hvornum (Torxed) <anton@hvornum.se>
61+
validpgpkeys=('8AA2213C8464C82D879C8127D4B58E897A929F2E') # torxed@archlinux.org
5862

59-
pkgver() {
63+
check() {
6064
cd $pkgname-$pkgver
61-
62-
awk '$1 ~ /^__version__/ {gsub("\"", ""); print $3}' archinstall/__init__.py
65+
ruff check
6366
}
6467

65-
prepare() {
68+
pkgver() {
6669
cd $pkgname-$pkgver
6770

68-
# use real directories for examples and profiles, as symlinks do not work
69-
rm -fv $pkgname/{examples,profiles}
71+
awk '$1 ~ /^__version__/ {gsub("\"", ""); print $3}' archinstall/__init__.py
7072
}
7173

7274
build() {

README.md

Lines changed: 3 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -104,67 +104,9 @@ All available console fonts can be found in `/usr/share/kbd/consolefonts` and se
104104

105105
## Scripting interactive installation
106106

107-
There are some examples in the `examples/` directory that should serve as a starting point.
107+
For an example of a fully scripted, interactive installation please refer to the example
108+
[interactive_installation.py](https://github.com/archlinux/archinstall/blob/master/archinstall/scripts/guided.py)
108109

109-
The following is a small example of how to script your own *interactive* installation:
110-
111-
```python
112-
from pathlib import Path
113-
114-
from archinstall import Installer, ProfileConfiguration, profile_handler, User
115-
from archinstall.default_profiles.minimal import MinimalProfile
116-
from archinstall.lib.disk.device_model import FilesystemType
117-
from archinstall.lib.disk.encryption_menu import DiskEncryptionMenu
118-
from archinstall.lib.disk.filesystem import FilesystemHandler
119-
from archinstall.lib.interactions.disk_conf import select_disk_config
120-
121-
fs_type = FilesystemType('ext4')
122-
123-
# Select a device to use for the installation
124-
disk_config = select_disk_config()
125-
126-
# Optional: ask for disk encryption configuration
127-
data_store = {}
128-
disk_encryption = DiskEncryptionMenu(disk_config.device_modifications, data_store).run()
129-
130-
# initiate file handler with the disk config and the optional disk encryption config
131-
fs_handler = FilesystemHandler(disk_config, disk_encryption)
132-
133-
# perform all file operations
134-
# WARNING: this will potentially format the filesystem and delete all data
135-
fs_handler.perform_filesystem_operations()
136-
137-
mountpoint = Path('/tmp')
138-
139-
with Installer(
140-
mountpoint,
141-
disk_config,
142-
disk_encryption=disk_encryption,
143-
kernels=['linux']
144-
) as installation:
145-
installation.mount_ordered_layout()
146-
installation.minimal_installation(hostname='minimal-arch')
147-
installation.add_additional_packages(['nano', 'wget', 'git'])
148-
149-
# Optionally, install a profile of choice.
150-
# In this case, we install a minimal profile that is empty
151-
profile_config = ProfileConfiguration(MinimalProfile())
152-
profile_handler.install_profile_config(installation, profile_config)
153-
154-
user = User('archinstall', 'password', True)
155-
installation.create_users(user)
156-
```
157-
158-
This installer will perform the following actions:
159-
160-
* Prompt the user to configure the disk partitioning
161-
* Prompt the user to setup disk encryption
162-
* Create a file handler instance for the configured disk and the optional disk encryption
163-
* Perform the disk operations (WARNING: this will potentially format the disks and erase all data)
164-
* Install a basic instance of Arch Linux *(base base-devel linux linux-firmware btrfs-progs efibootmgr)*
165-
* Install and configures a bootloader to partition 0 on UEFI. On BIOS, it sets the root to partition 0.
166-
* Install additional packages *(nano, wget, git)*
167-
* Create a new user
168110

169111
> **To create your own ISO with this script in it:** Follow [ArchISO](https://wiki.archlinux.org/index.php/archiso)'s guide on creating your own ISO.
170112
@@ -226,7 +168,7 @@ This can be done by installing `pacman -S arch-install-scripts util-linux` local
226168
# losetup --partscan --show --find ./testimage.img
227169
# pip install --upgrade archinstall
228170
# python -m archinstall --script guided
229-
# 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
171+
# 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.4m.fd -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF.4m.fd
230172
231173
This will create a *20 GB* `testimage.img` and create a loop device which we can use to format and install to.<br>
232174
`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.~~<br>

0 commit comments

Comments
 (0)