Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ requirements.txt
/cmd_output.txt
node_modules/
uv.lock
test_tooling/mkosi/mkosi.output/*image*
test_tooling/mkosi/mkosi.cache/**
test_tooling/mkosi/mkosi.tools/**
test_tooling/mkosi/mkosi.tools.manifest
File renamed without changes.
12 changes: 12 additions & 0 deletions test_tooling/mkosi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To build

mkosi build -B

# To run

mkosi qemu \
--drive=archinstall_small:25G \
-- \
-device nvme,serial=archinstall_small,drive=archinstall_small

*note: in order to boot the installation, we need to disable UKI being added to -kernel. I don't know of a way to do this yet, unless we tinker with mkosi/qemu.py - https://github.com/Torxed/mkosi/commit/6f3c20802bd73f88b672cc96ef0db1e542084316 - in which case we could do: `mkosi qemu --drive=archinstall_small:25G -- -device nvme,serial=archinstall_small,drive=archinstall_small,bootindex=0 -kernel none` but it still won't boot properly.*
Empty file.
50 changes: 50 additions & 0 deletions test_tooling/mkosi/mkosi.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[Distribution]
Distribution=arch
# LocalMirror=file:///var/lib/localmirror

[Output]
Format=uki
# Format=disk

[Include]
Include=mkosi-vm

[Validation]
SecureBoot=false
SecureBootAutoEnroll=false
Sign=false
# Signing artifacts (hashsums etc) using a GPG key:
# Key=D4B58E897A929F2E
# Signing secure boot using PIV on yubikey:
# SecureBoot=true
# SecureBootKey=pkcs11:
# SecureBootCertificate=secureboot.crt

[Content]
Packages=
pacman
archlinux-keyring
amd-ucode
intel-ucode
# tpm2-tss
# libfido2
# libp11-kit
WithDocs=false
RootPassword=toor
Timezone=Europe/Stockholm
Keymap=sv-latin1
InitrdProfiles=network

[Config]
Profiles=archinstall

[Build]
Incremental=true
ToolsTree=default
ToolsTreeProfiles=devel,misc,package-manager,runtime,gui
WithNetwork=yes

[Runtime]
Console=gui
CPUs=4
RAM=8G
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --noreset --noclear --autologin root - ${TERM}
5 changes: 5 additions & 0 deletions test_tooling/mkosi/mkosi.extra/root/.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cd archinstall-git
rm -rf dist

uv build --no-build-isolation --wheel
uv pip install dist/*.whl --break-system-packages --system --no-build --no-deps
Empty file.
10 changes: 10 additions & 0 deletions test_tooling/mkosi/mkosi.postinst.chroot
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

git clone https://github.com/archlinux/archinstall.git /root/archinstall-git
(cd /root/archinstall-git && git checkout master)

# TODO: Set geo-mirrors statically instead
curl -s "https://archlinux.org/mirrorlist/?country=SE&protocol=https&use_mirror_status=on" | sed -e 's/^#Server/Server/' -e '/^#/d' | rankmirrors -n 5 - > /etc/pacman.d/mirrorlist

pacman-key --init
pacman-key --populate archlinux
56 changes: 56 additions & 0 deletions test_tooling/mkosi/mkosi.profiles/archinstall
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[Content]
Packages=
acpid
intel-media-driver
linux-firmware
linux-firmware-intel
ca-certificates-mozilla
ca-certificates-utils
nano
gvfs
noto-fonts
cantarell-fonts
ttf-dejavu
polkit
bash
bzip2
coreutils
file
filesystem
findutils
gawk
gcc-libs
gettext
glibc
grep
gzip
iproute2
iputils
licenses
pciutils
procps-ng
psmisc
sed
tar
linux
diffutils
less
strace
util-linux
xz
pacman-contrib
gcc
git
pkgconfig
python
python-pip
python-uv
python-setuptools
python-pyparted
python-pydantic
python-textual
dosfstools
btrfs-progs
arch-install-scripts
WithDocs=false
KernelCommandLine=quiet splash
1 change: 1 addition & 0 deletions test_tooling/mkosi/mkosi.version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12
Loading