ajout de la prise en charge des paquets personnalisés et mise à jour des scripts de construction

This commit is contained in:
Puechberty Arthur
2026-07-29 16:33:56 +02:00
parent 293d7b0ee4
commit dd0a59f294
10 changed files with 103 additions and 7 deletions
+27 -4
View File
@@ -11,6 +11,7 @@ set -e
ISO_NAME="arch-custom-iso"
# On récupère le nom de l'utilisateur normal (pas root) pour makepkg
BUILD_USER="${SUDO_USER:-root}"
CUSTOM_PKGS_DIR="$PWD/custom-pkgs"
# ==============================================================================
# LES LISTES DE PAQUETS
@@ -51,7 +52,7 @@ echo "[1/5] Cleaning previous build..."
rm -rf work out offline_cache
# --- TÉLÉCHARGEMENT DES PAQUETS OFFICIELS ---
echo "[2/5] Downloading Official Packages for offline cache..."
echo "[2/6] Downloading Official Packages for offline cache..."
# On utilise /tmp pour éviter tout problème de permissions dans le Home
TMP_CACHE="/tmp/archiso_cache_$$"
mkdir -p "$TMP_CACHE"
@@ -65,8 +66,25 @@ mkdir -p offline_cache
cp "$TMP_CACHE"/*.pkg.tar.zst offline_cache/ 2>/dev/null || true
rm -rf "$TMP_CACHE"
# --- COMPILATION DES PAQUETS PERSONNALISÉS ---
echo "[3/6] Building custom packages from custom-pkgs/..."
mkdir -p custom_pkg_build
for pkg_dir in "$CUSTOM_PKGS_DIR"/*; do
[ -d "$pkg_dir" ] || continue
[ -f "$pkg_dir/PKGBUILD" ] || continue
pkg_name=$(basename "$pkg_dir")
echo " -> Building custom package: $pkg_name"
rm -rf "custom_pkg_build/$pkg_name"
cp -a "$pkg_dir" "custom_pkg_build/$pkg_name"
chown -R "$BUILD_USER":"$BUILD_USER" "custom_pkg_build/$pkg_name"
sudo -u "$BUILD_USER" bash -lc "cd '$PWD/custom_pkg_build/$pkg_name' && makepkg -f --noconfirm --needed"
mv "custom_pkg_build/$pkg_name"/*.pkg.tar.zst offline_cache/ 2>/dev/null || true
done
rm -rf custom_pkg_build
# --- COMPILATION DES PAQUETS AUR ---
echo "[3/5] Building AUR Packages for offline cache..."
echo "[4/6] Building AUR Packages for offline cache..."
mkdir -p aur_build
for pkg in "${AUR_PACKAGES[@]}"; do
@@ -89,13 +107,18 @@ done
rm -rf aur_build
# --- INJECTION DANS L'ISO ---
echo "[4/5] Injecting offline cache into ISO skeleton..."
echo "[5/6] Injecting offline cache into ISO skeleton..."
mkdir -p airootfs/root/offline_cache
cp offline_cache/*.pkg.tar.zst airootfs/root/offline_cache/
rm -rf offline_cache
# Copier les scripts personnalisés dans la racine du live system si nécessaire
mkdir -p airootfs/usr/local/bin
cp custom-pkgs/hello-custom/hello-custom.sh airootfs/usr/local/bin/hello-custom 2>/dev/null || true
chmod +x airootfs/usr/local/bin/hello-custom 2>/dev/null || true
# --- CRÉATION DE L'ISO ---
echo "[5/5] Building ISO (this will take a while)..."
echo "[6/6] Building ISO (this will take a while)..."
sudo mkarchiso -v .
if [ -f out/*.iso ]; then