chore: repo cleanup - pin actions, fix typos, improve gitignore

- build.yml: pin push-to-registry to SHA
- build-installer-iso.yml: pin checkout/upload-artifact to SHA,
  replace hardcoded registry with env vars, add env block
- Justfile: fix 'Virtal' typo (10x), fix shfmt error msg,
  quote $file in check/fix recipes
- .gitignore: add *.iso, *.qcow2, *.raw, .env, *.log
- iso/config.toml: remove leading space
- Containerfile: remove non-existent /tmp/build from cleanup
- build/50-prepare-flatpak-for-bazaar.sh: add executable permission
- build/README.md: update to reflect current script names
This commit is contained in:
gunnar
2026-05-30 16:33:41 +02:00
parent d89f20e931
commit a957c96fa1
8 changed files with 72 additions and 70 deletions
+36 -50
View File
@@ -1,77 +1,63 @@
# Build Scripts
This directory contains build scripts that run during image creation. Scripts are executed in numerical order.
This directory contains build scripts that run during image creation via bind mounts in the Containerfile.
## How It Works
Scripts are named with a number prefix (e.g., `10-build.sh`, `20-onepassword.sh`) and run in ascending order during the container build process.
Scripts are named with a number prefix and run in ascending order during the container build process. Each script is bind-mounted into the build container and executed individually.
## Included Scripts
- **`10-build.sh`** - Main build script for base system modifications, package installation, and service configuration
- **`10-repos.sh`** - RPM Fusion repositories einrichten (frei + nonfree)
- **`20-multimedia.sh`** - Mesa Freeworld, Codecs, FFmpeg, GStreamer, Intel-Media-Treiber
- **`30-virt.sh`** - Virtualisierung (libvirt, QEMU), Plasma-Setup, Distrobox, Micro, etc.
- **`40-remove-packages.sh`** - Entfernt unerwuenschte Pakete (Firefox, Plasma Discover)
- **`50-prepare-flatpak-for-bazaar.sh`** - Laedt Flathub-Repo-Definition fuer Bazaar
## Example Scripts
## Hilfsscript
- **`20-onepassword.sh.example`** - Example showing how to install software from third-party RPM repositories (Google Chrome, 1Password)
- **`copr-helpers.sh`** - Funktionen fuer sichere COPR-Repo-Installation (enable, install, disable)
To use an example script:
1. Remove the `.example` extension
2. Make it executable: `chmod +x build/20-yourscript.sh`
3. The build system will automatically run it in numerical order
## Creating Your Own Scripts
Create numbered scripts for different purposes:
## Erstellung eigener Scripts
```bash
# 10-build.sh - Base system (already exists)
# 20-drivers.sh - Hardware drivers
# 30-development.sh - Development tools
# 40-gaming.sh - Gaming software
# 50-cleanup.sh - Final cleanup tasks
```
# Neues Script mit nummeriertem Prefix erstellen
# Die Number bestimmt die Ausfuehrungsreihenfolge
### Script Template
#!/usr/bin/bash
set -eoux pipefail
```bash
#!/usr/bin/env bash
set -oue pipefail
echo "Running custom setup..."
# Your commands here
echo "Installiere Pakete..."
dnf5 install -y --allowerasing some-package
```
### Best Practices
- **Use descriptive names**: `20-nvidia-drivers.sh` is better than `20-stuff.sh`
- **One purpose per script**: Easier to debug and maintain
- **Clean up after yourself**: Remove temporary files and disable temporary repos
- **Test incrementally**: Add one script at a time and test builds
- **Comment your code**: Future you will thank present you
- **Beschreibende Namen**: `25-nvidia.sh` statt `25-stuff.sh`
- **Ein Script pro Zweck**: Einfacher zu debuggen und zu warten
- **Aufraeumen**: Temporaere Dateien entfernen, temporaere Repos deaktivieren
- **Inkrementell testen**: Ein Script nach dem anderen hinzufuegen
- **Kommentare**: Das zukuenftige Ich wird es schaetzen
### Disabling Scripts
### Script deaktivieren
To temporarily disable a script without deleting it:
- Rename it with `.disabled` extension: `20-script.sh.disabled`
- Or remove execute permission: `chmod -x build/20-script.sh`
Ohne Loeschen deaktivieren:
- Umbenennen: `20-script.sh` `20-script.sh.disabled`
- Execute-Recht entfernen: `chmod -x build/20-script.sh`
## Execution Order
The Containerfile runs scripts like this:
## Ausfuehrung im Containerfile
```dockerfile
RUN /ctx/build/10-build.sh
RUN --mount=type=bind,from=ctx,source=/build/10-repos.sh,target=/tmp/10-repos.sh \
--mount=type=cache,dst=/var/cache \
--mount=type=tmpfs,dst=/tmp \
bash /tmp/10-repos.sh && dnf5 clean all
```
If you want to run multiple scripts, you can:
## Hinweise
1. **Modify Containerfile** to run each script explicitly
2. **Create a runner script** that executes all numbered scripts
3. **Use the default** and keep everything in `10-build.sh` (simplest)
## Notes
- Scripts run as root during build
- Build context is available at `/ctx`
- Use dnf5 for package management (not dnf or yum)
- Always use `-y` flag for non-interactive installs
- Scripts laufen als root waehrend des Builds
- Build-Kontext ist ueber Bind-Mounts verfuegbar
- Nutze `dnf5` fuer Paketverwaltung (nicht dnf oder yum)
- Immer `-y` Flag fuer nicht-interaktive Installationen verwenden
- Cache-Mounts (`--mount=type=cache`) verhindern Neudownload bei Aenderungen