Skip to content

Commit 0594cf8

Browse files
authored
Merge branch 'archlinux:master' into master
2 parents 3ed9b72 + dd75371 commit 0594cf8

52 files changed

Lines changed: 552 additions & 614 deletions

Some content is hidden

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

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
default_stages: ['pre-commit']
22
repos:
33
- repo: https://github.com/astral-sh/ruff-pre-commit
4-
rev: v0.11.11
4+
rev: v0.11.13
55
hooks:
66
# fix unused imports and sort them
77
- id: ruff
@@ -31,7 +31,7 @@ repos:
3131
args: [--config=.flake8]
3232
fail_fast: true
3333
- repo: https://github.com/pre-commit/mirrors-mypy
34-
rev: v1.15.0
34+
rev: v1.16.0
3535
hooks:
3636
- id: mypy
3737
args: [

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.7
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: 2 additions & 60 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

archinstall/__init__.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from archinstall.lib.args import arch_config_handler
1010
from archinstall.lib.disk.utils import disk_layouts
11+
from archinstall.lib.packages.packages import check_package_upgrade
1112

1213
from .lib.hardware import SysInfo
1314
from .lib.output import FormattedOutput, debug, error, info, log, warn
@@ -53,15 +54,15 @@ def _check_new_version() -> None:
5354
info('Checking version...')
5455
upgrade = None
5556

56-
try:
57-
upgrade = Pacman.run('-Qu archinstall').decode()
58-
except Exception as e:
59-
debug(f'Failed determine pacman version: {e}')
57+
upgrade = check_package_upgrade('archinstall')
58+
59+
if upgrade is None:
60+
debug('No archinstall upgrades found')
61+
return None
6062

61-
if upgrade:
62-
text = f'New version available: {upgrade}'
63-
info(text)
64-
time.sleep(3)
63+
text = tr('New version available') + f': {upgrade}'
64+
info(text)
65+
time.sleep(3)
6566

6667

6768
def main() -> int:

archinstall/default_profiles/desktops/hyprland.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ def _ask_seat_access(self) -> None:
6666
).run()
6767

6868
if result.type_ == ResultType.Selection:
69-
if result.item() is not None:
70-
self.custom_settings['seat_access'] = result.get_value().value
69+
self.custom_settings['seat_access'] = result.get_value().value
7170

7271
@override
7372
def do_on_select(self) -> None:

archinstall/default_profiles/desktops/labwc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ def _ask_seat_access(self) -> None:
6363
).run()
6464

6565
if result.type_ == ResultType.Selection:
66-
if result.item() is not None:
67-
self.custom_settings['seat_access'] = result.get_value().value
66+
self.custom_settings['seat_access'] = result.get_value().value
6867

6968
@override
7069
def do_on_select(self) -> None:

archinstall/default_profiles/desktops/niri.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ def _ask_seat_access(self) -> None:
7171
).run()
7272

7373
if result.type_ == ResultType.Selection:
74-
if result.item() is not None:
75-
self.custom_settings['seat_access'] = result.get_value().value
74+
self.custom_settings['seat_access'] = result.get_value().value
7675

7776
@override
7877
def do_on_select(self) -> None:

archinstall/default_profiles/desktops/sway.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ def _ask_seat_access(self) -> None:
7373
).run()
7474

7575
if result.type_ == ResultType.Selection:
76-
if result.item() is not None:
77-
self.custom_settings['seat_access'] = result.get_value().value
76+
self.custom_settings['seat_access'] = result.get_value().value
7877

7978
@override
8079
def do_on_select(self) -> None:

archinstall/default_profiles/desktops/xmonad.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def packages(self) -> list[str]:
1414
return [
1515
'xmonad',
1616
'xmonad-contrib',
17-
'xmonad-extra',
17+
'xmonad-extras',
1818
'xterm',
1919
'dmenu',
2020
]

archinstall/lib/args.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
from archinstall.lib.models.packages import Repository
2323
from archinstall.lib.models.profile_model import ProfileConfiguration
2424
from archinstall.lib.models.users import Password, User
25-
from archinstall.lib.output import debug, error, warn
25+
from archinstall.lib.output import debug, error, logger, warn
2626
from archinstall.lib.plugins import load_plugin
27-
from archinstall.lib.storage import storage
2827
from archinstall.lib.translationhandler import Language, tr, translation_handler
2928
from archinstall.lib.utils.util import get_password
3029
from archinstall.tui.curses_menu import Tui
@@ -389,7 +388,7 @@ def _parse_args(self) -> Arguments:
389388
args.silent = False
390389

391390
if args.debug:
392-
warn(f'Warning: --debug mode will write certain credentials to {storage["LOG_PATH"]}/{storage["LOG_FILE"]}!')
391+
warn(f'Warning: --debug mode will write certain credentials to {logger.path}!')
393392

394393
if args.plugin:
395394
plugin_path = Path(args.plugin)

0 commit comments

Comments
 (0)