SKN "Ceramit" · AGH University of Krakow

AGHOS Configuration Scripts

Arch Greybeards Hall Operating System · aghos@agh.edu.pl · aghos.agh.edu.pl

01

System Scripts

mk_iso.sh /srv/AGHOS/v2/mk_iso.sh

The main build script that produces the AGHOS bootable ISO image. Runs the following stages in order:

  • Cleans pacman and paru caches before building
  • Validates the environment: required directories, tools (mksquashfs, xorriso, mformat, mmd, mcopy), isohdpfx.bin, and GRUB/EFI files
  • Prepares boot files: builds a 64 MB FAT32 EFI partition image (efiboot.img), copies bootx64.efi, writes a GRUB redirect config, and copies isolinux.bin for BIOS boot
  • Creates a compressed SquashFS filesystem from the rootfs (zstd level 18), respecting CPU and memory limits
  • Generates SHA-512 and MD5 checksums for the SquashFS image
  • Builds a hybrid ISO with xorriso supporting both BIOS (isolinux) and UEFI (EFI partition) boot
  • Atomically moves the finished ISO and updates the aghos_liveusb.iso symlink so the HTTP server never sees a broken link

Resource limits: at most ⅔ of CPU cores, 2 GB RAM, aborts if CPU temperature exceeds 80 °C.

set-plasma-lang.sh /usr/local/bin/set-plasma-lang.sh

Reads the vlang= kernel command-line parameter and configures the KDE Plasma session language. Supports: pl_PL, en_US, es_ES, de_DE, fr_FR, zh_CN.

  • Writes ~/.config/plasma-localerc with the selected language and locale
  • Writes ~/.config/kxkbrc with the appropriate keyboard layout
  • Exports LANG, LANGUAGE, and LC_ALL for the session

If vlang= is absent or unrecognised, the script exits silently.

aghos_welcome.py /usr/local/bin/aghos_welcome.py

A PySide6 welcome screen shown on first login. Displays the AGHOS logo and subtitle. Two buttons:

  • TWF Documentation — opens the project documentation
  • Start Working — removes the autostart entry (~/.config/autostart/aghos-welcome.desktop) to prevent reappearing on subsequent logins, then closes

Fixed 650×450 px, non-resizable, no system title bar buttons.

aghos-fix-skel.sh /usr/local/bin/aghos-fix-skel.sh

Populates /etc/skel with the AGHOS default KDE Plasma configuration for all new users. Creates a timestamped backup first, then writes:

FilePurpose
plasma-org.kde.plasma.desktop-appletsrcPanel layout with WPS Office launchers, no weather widget
kdeglobalsBreeze Dark colour scheme, single-click disabled
kscreenlockerrcLock screen wallpaper
autostart-scripts/aghos-first-run.shFirst-run initialisation script
autostart/aghos-first-run.desktopAutostart entry that triggers the first-run script
wps_installer_gui.py (system version) /usr/local/bin/wps_installer_gui.py

A PySide6 GUI installer for WPS Office. Downloads and installs the full WPS Office suite from the AUR via paru.

  • Checks internet connectivity before starting
  • Asks for the sudo password once, validates it with sudo -S -v, reuses the token for the whole installation
  • Runs all packages in a single paru call, streaming output to the console widget
  • Wraps all three WPS .desktop files with firejail --net=none after installation

Packages: ttf-ms-fonts, ttf-wps-fonts, wps-office, MUI language packs for DE, EN-GB, ES, FR-CA, FR-FR, PL, PT.

02

Installer Scripts

aghos_installer.py /home/aghos/AGHOS_installer/aghos_installer.py

The main installer launcher. Discovers and runs numbered scripts from scripts/ in sequence using QProcess with sudo -E. Handles language selection (PL/EN/DE/ES/FR), streams stdout/stderr from sub-scripts into the console window, and aborts on any non-zero exit code.

1_connect_network.py /home/aghos/AGHOS_installer/scripts/

Step 1 — Network configuration.

  • Detects all network interfaces from /sys/class/net
  • Wireless: scans SSIDs via nmcli, connects with password
  • Wired: DHCP or static IP (address, gateway, DNS)
  • Two continue paths: with internet (exit 0) or without internet (exit 0 with warning). Cancellation → exit 1.
2_manage_disks.py /home/aghos/AGHOS_installer/scripts/

Step 2 — Disk partitioning and mounting. Two modes:

  • Full mode: wipes selected disk, lets user customise GPT/MBR layout, runs parted + mkfs.* + mount in a background worker. Sets ESP and swap flags automatically for GPT. Uses lsblk -J for safe NVMe/mmcblk path resolution.
  • Partial mode: launches GParted, then presents a mount-point assignment form for existing partitions with optional formatting.

Continue button activates only after /mnt is confirmed mounted.

3_copy_rootfs.py /home/aghos/AGHOS_installer/scripts/

Step 3 — Copies the live system to /mnt using rsync.

  • Excludes: /proc/*, /sys/*, /dev/*, /run/*, /tmp/*, /mnt/*, /media/*, /lost+found/*, /home/aghos/*, pacman lock file
  • Accepts exit codes 0, 23 (partial transfer), and 24 (vanished files) as success
  • Creates empty stub directories in the target after copying
  • Optional game launcher (supertux2, supertuxkart, pingus) to keep the user entertained during the copy
4_configure.py /home/aghos/AGHOS_installer/scripts/

Step 4 — System configuration inside the installed system via arch-chroot.

TaskDetails
/etc/fstabGenerated from findmnt + blkid UUIDs; includes swapfile if present
TimezoneValidated, set via symlink in /usr/share/zoneinfo
LocaleWrites locale.gen, runs locale-gen, writes locale.conf
VconsoleKEYMAP and FONT written to /etc/vconsole.conf
BrandingWrites os-release, hostname, hosts
User creationuseradd -m -G wheel,users; passwords via chpasswd -c SHA512 over stdin
Sudoers/etc/sudoers.d/10-wheel with mode 0440
Remove install userDeletes the aghos live user from the new system
SDDM autologinRemoves autologin.conf
Machine IDRemoves machine-id and random-seed for fresh generation on first boot
5_grub.py /home/aghos/AGHOS_installer/scripts/

Step 5 — Bootloader installation in a background thread.

  • Patches mkinitcpio.conf with AGHOS-specific MODULES and HOOKS, runs mkinitcpio -P
  • Resolves root and boot partition UUIDs via findmnt + blkid
  • Writes /etc/default/grub with kernel cmdline, root=UUID=..., os-prober toggle, timeout
  • UEFI: grub-install --target=x86_64-efi --bootloader-id=AGHOS --removable
  • BIOS: resolves parent disk via lsblk -J (NVMe/mmcblk safe), grub-install --target=i386-pc
  • Runs grub-mkconfig and post-processes grub.cfg to fix path bugs and UUID mismatches

UI: kernel parameter checklist (rw, TRIM, loglevel, quiet, etc.) plus free-text field for custom parameters.

6_finish.py /home/aghos/AGHOS_installer/scripts/

Step 6 — Final screen with animated rune terminal and installation summary (hostname, mounted partitions, kernel version, start time).

ButtonAction
Reboot nowConfirms, then calls reboot
Unmount and stay in LiveUnmounts all partitions under /mnt in a background thread, deepest first, with live status updates
Close installerWaits for any running unmount worker, exits with code 0
03

User Environment Scripts

aghos-first-run.sh /etc/skel/.config/autostart-scripts/

Runs once on first login for every new user. Uses kdialog for a progress bar. Performs:

  • Creates directory tree: Desktop, Documents, Downloads, Media/{Video,Photos,Audio}, tmp/{Public,Templates}
  • Writes ~/.config/user-dirs.dirs with XDG paths
  • Sets KDE path overrides via kwriteconfig6
  • Writes ~/.config/mimeapps.list: LibreWolf for web, Thunderbird for mail, VLC for video
  • Sets desktop and lock screen wallpaper via qdbus PlasmaShell and kwriteconfig6
  • Removes its own autostart entry and deletes itself
wps_installer_gui.py (skel & autostart versions) /etc/skel/.config/

Per-user WPS Office installer. Differences from the system version:

  • Installs packages one by one, tracking failures individually
  • Uses --sudoflags -A to route sudo prompts through SUDO_ASKPASS (ksshaskpass or zenity)
  • If the base wps-office package fails, skips shortcut creation entirely
  • Wraps WPS .desktop shortcuts with firejail --net=none in ~/.local/share/applications/
04

Autostart & Desktop Entry Files

FilePathPurpose
aghos-first-run.desktop/etc/skel/.config/autostart/Triggers aghos-first-run.sh on first KDE login (phase 1, after panel)
aghos-welcome.desktop/etc/skel/.config/autostart/Launches the welcome screen (aghos_welcome.py) on first login
Install_WPS_Office.desktop/etc/skel/Desktop/Desktop shortcut to manually launch the WPS Office installer
install_aghos.desktop/home/aghos/Desktop/Live desktop shortcut to launch the AGHOS installer (runs as root via sudo)
05

Branding

os-release /usr/lib/os-release → /etc/os-release

Identifies the distribution to system tools, desktop environments, and package managers.

NAME="Arch Greybeards Hall Linux"
PRETTY_NAME="AGHOS"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;0;105;60"
HOME_URL="https://aghos.agh.edu.pl"

The 4_configure.py installer script rewrites this file in the installed system with AGHOS-specific branding and URLs.

06

Execution Flow

Live boot │ ├── aghos-first-run.sh ← runs once per new user (KDE autostart) ├── aghos_welcome.py ← welcome screen (KDE autostart) │ └── install_aghos.desktop ← user clicks to start installation │ └── aghos_installer.py ← main installer window │ ├── 1_connect_network.py ← network setup ├── 2_manage_disks.py ← partitioning & mounting ├── 3_copy_rootfs.py ← rsync live → /mnt ├── 4_configure.py ← chroot configuration ├── 5_grub.py ← bootloader └── 6_finish.py ← reboot / unmount