From 4ad4aad4c060eb8f3f4a51f04e0898e6834e8626 Mon Sep 17 00:00:00 2001 From: Torxed Date: Sun, 27 Jul 2025 16:42:10 +0200 Subject: [PATCH] Added first version of ISO build --- .gitignore | 2 ++ .gitmodules | 3 +++ README.md | 32 +++++++++++++++++++++++++++++++- archiso | 1 + build_iso.sh | 36 ++++++++++++++++++++++++++++++++++++ grub-autoboot.patch | 13 +++++++++++++ 6 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 160000 archiso create mode 100755 build_iso.sh create mode 100644 grub-autoboot.patch diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a41c0c5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +out/ +**/**.iso \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..593cd51 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "archiso"] + path = archiso + url = https://gitlab.archlinux.org/archlinux/archiso.git diff --git a/README.md b/README.md index 8c254fb..87654ec 100644 --- a/README.md +++ b/README.md @@ -1 +1,31 @@ -# omarchy-iso \ No newline at end of file +# omarchy-iso + +This will create an ISO that does two things: + +1. Auto-boot into Live Arch Linux (without prompt) +2. Will auto-launch `omarchy-tui` + +# Build instructions + +``` +$ docker run --rm \ + --privileged \ + -v "./out/:/out/" \ + -v "./build_iso.sh:/build_iso.sh:ro" \ + -v "./archiso:/archiso:ro" \ + -v "./grub-autoboot.patch:/grub-autoboot.patch:ro" \ + archlinux/archlinux:latest /build_iso.sh +``` + +Finished result should be in `./out`. +Note that `--privileged` is used. The main reason being `mkarchiso` mounts `/sys/proc` and other locations, which requires privileged permissions. + +# Signing + +``` +$ gpg --local-user 0xD4B58E897A929F2E \ + --output ./out/*.iso.sig \ + --detach-sig ./out/*.iso +``` + +Note that `gpg --list-keys --fingerprint --keyid-format 0xLONG torxed@archlinux.org` can give you your GPG Key ID. In my case `ed25519/0xD4B58E897A929F2E`. \ No newline at end of file diff --git a/archiso b/archiso new file mode 160000 index 0000000..69047bd --- /dev/null +++ b/archiso @@ -0,0 +1 @@ +Subproject commit 69047bdc03ee3bddb00c531a71474897a0d3164b diff --git a/build_iso.sh b/build_iso.sh new file mode 100755 index 0000000..41982de --- /dev/null +++ b/build_iso.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +set -e + +pacman-key --init +pacman --noconfirm -Sy archlinux-keyring +pacman --noconfirm -Sy archiso git + +# Packages to add to the archiso profile packages +# As a base example (the TUI packages needs to be here) +packages=( + git +) + +cache_dir=$(realpath --canonicalize-missing ~/.cache/omarchy/iso_$(date +%Y-%m-%d)) + +mkdir -p $cache_dir/ +cp -r archiso/configs/releng/* $cache_dir/ + +# We add in our auto-start applications +# We'll assume the TUI installer is called omarchy-tui for now +cat <<- _EOF_ | tee $cache_dir/airootfs/root/.zprofile + omarchy-tui +_EOF_ + +# Add packages to the archiso profile packages +for package in "${packages[@]}"; do + echo "$package" >> "$cache_dir/packages.x86_64" +done + +# We patch grub to our liking: +(cd $cache_dir/ && git apply /grub-autoboot.patch) +# We could also use: +# patch -p1 < grub-autoboot.patch + +mkarchiso -v -w "$cache_dir/work/" -o "/out/" "$cache_dir/" \ No newline at end of file diff --git a/grub-autoboot.patch b/grub-autoboot.patch new file mode 100644 index 0000000..f256722 --- /dev/null +++ b/grub-autoboot.patch @@ -0,0 +1,13 @@ +--- a/grub/grub.cfg ++++ b/grub/grub.cfg +@@ -45,8 +45,8 @@ fi + + # Set default menu entry + default=archlinux +-timeout=15 +-timeout_style=menu ++timeout=0 ++timeout_style=hidden + + + # Menu entries