Files
fluffy-pancake/build/README.md
T
gunnar a957c96fa1 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
2026-05-30 16:33:41 +02:00

64 lines
2.2 KiB
Markdown

# Build Scripts
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 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-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
## Hilfsscript
- **`copr-helpers.sh`** - Funktionen fuer sichere COPR-Repo-Installation (enable, install, disable)
## Erstellung eigener Scripts
```bash
# Neues Script mit nummeriertem Prefix erstellen
# Die Number bestimmt die Ausfuehrungsreihenfolge
#!/usr/bin/bash
set -eoux pipefail
echo "Installiere Pakete..."
dnf5 install -y --allowerasing some-package
```
### Best Practices
- **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
### Script deaktivieren
Ohne Loeschen deaktivieren:
- Umbenennen: `20-script.sh``20-script.sh.disabled`
- Execute-Recht entfernen: `chmod -x build/20-script.sh`
## Ausfuehrung im Containerfile
```dockerfile
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
```
## Hinweise
- 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