mirror of
https://github.com/arthur-pbty/arch-custom-iso.git
synced 2026-08-01 20:28:05 +02:00
ajout de la prise en charge des paquets personnalisés et mise à jour des scripts de construction
This commit is contained in:
@@ -13,6 +13,7 @@ This project allows you to generate a fully customized Arch Linux installation I
|
|||||||
- Automated install scripts
|
- Automated install scripts
|
||||||
- Custom configs (dotfiles, system settings)
|
- Custom configs (dotfiles, system settings)
|
||||||
- Reproducible builds
|
- Reproducible builds
|
||||||
|
- Support for your own packages built from source
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -276,9 +276,8 @@ for i = 1, 10 do
|
|||||||
local keycode = 9 + i -- 10=1, 11=2, 12=3 ... 18=9, 19=0
|
local keycode = 9 + i -- 10=1, 11=2, 12=3 ... 18=9, 19=0
|
||||||
local key_str = "code:" .. keycode
|
local key_str = "code:" .. keycode
|
||||||
|
|
||||||
-- Utilisation de exec_cmd pour éviter les erreurs d'API (workspace est une table, pas une fonction)
|
hl.bind(mainMod .. " + " .. key_str, hl.dsp.exec_cmd("hyprctl dispatch workspace " .. i))
|
||||||
hl.bind(mainMod .. " + " .. key_str, hl.dsp.exec_cmd("workspace " .. i))
|
hl.bind(mainMod .. " + SHIFT + " .. key_str, hl.dsp.exec_cmd("hyprctl dispatch movetoworkspace " .. i))
|
||||||
hl.bind(mainMod .. " + SHIFT + " .. key_str, hl.dsp.exec_cmd("movetoworkspace " .. i))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Example special workspace (scratchpad)
|
-- Example special workspace (scratchpad)
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ set -e
|
|||||||
ISO_NAME="arch-custom-iso"
|
ISO_NAME="arch-custom-iso"
|
||||||
# On récupère le nom de l'utilisateur normal (pas root) pour makepkg
|
# On récupère le nom de l'utilisateur normal (pas root) pour makepkg
|
||||||
BUILD_USER="${SUDO_USER:-root}"
|
BUILD_USER="${SUDO_USER:-root}"
|
||||||
|
CUSTOM_PKGS_DIR="$PWD/custom-pkgs"
|
||||||
|
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# LES LISTES DE PAQUETS
|
# LES LISTES DE PAQUETS
|
||||||
@@ -51,7 +52,7 @@ echo "[1/5] Cleaning previous build..."
|
|||||||
rm -rf work out offline_cache
|
rm -rf work out offline_cache
|
||||||
|
|
||||||
# --- TÉLÉCHARGEMENT DES PAQUETS OFFICIELS ---
|
# --- 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
|
# On utilise /tmp pour éviter tout problème de permissions dans le Home
|
||||||
TMP_CACHE="/tmp/archiso_cache_$$"
|
TMP_CACHE="/tmp/archiso_cache_$$"
|
||||||
mkdir -p "$TMP_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
|
cp "$TMP_CACHE"/*.pkg.tar.zst offline_cache/ 2>/dev/null || true
|
||||||
rm -rf "$TMP_CACHE"
|
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 ---
|
# --- 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
|
mkdir -p aur_build
|
||||||
|
|
||||||
for pkg in "${AUR_PACKAGES[@]}"; do
|
for pkg in "${AUR_PACKAGES[@]}"; do
|
||||||
@@ -89,13 +107,18 @@ done
|
|||||||
rm -rf aur_build
|
rm -rf aur_build
|
||||||
|
|
||||||
# --- INJECTION DANS L'ISO ---
|
# --- 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
|
mkdir -p airootfs/root/offline_cache
|
||||||
cp offline_cache/*.pkg.tar.zst airootfs/root/offline_cache/
|
cp offline_cache/*.pkg.tar.zst airootfs/root/offline_cache/
|
||||||
rm -rf 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 ---
|
# --- 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 .
|
sudo mkarchiso -v .
|
||||||
|
|
||||||
if [ -f out/*.iso ]; then
|
if [ -f out/*.iso ]; then
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Paquets personnalisés
|
||||||
|
|
||||||
|
Place ici les sources de tes applications personnelles.
|
||||||
|
|
||||||
|
Structure recommandée :
|
||||||
|
|
||||||
|
- custom-pkgs/my-app/
|
||||||
|
- PKGBUILD
|
||||||
|
- .SRCINFO (généré automatiquement)
|
||||||
|
- src/
|
||||||
|
|
||||||
|
Exemple rapide :
|
||||||
|
|
||||||
|
- une application en C/C++/Rust/Go/Python
|
||||||
|
- un script shell autonome
|
||||||
|
- un binaire déjà compilé
|
||||||
|
|
||||||
|
Pour une application non disponible sur pacman/AUR, la méthode la plus propre est de la packager avec un PKGBUILD puis de la construire dans le build ISO.
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Maintainer: Ton Nom <ton@email>
|
||||||
|
|
||||||
|
pkgname=optifetch
|
||||||
|
pkgver=1.0
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc='Version personnalisée de fastfetch intégrée dans l\'ISO'
|
||||||
|
arch=('x86_64')
|
||||||
|
url='https://example.com/ton-projet'
|
||||||
|
license=('MIT')
|
||||||
|
depends=('gcc' 'make')
|
||||||
|
source=("optifetch::git+https://github.com/arthur-pbty/optifetch.git")
|
||||||
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
|
pkg() {
|
||||||
|
cd "$srcdir/optifetch"
|
||||||
|
make
|
||||||
|
install -Dm0755 optifetch "$pkgdir/usr/bin/optifetch"
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# Maintainer: Ton Nom <ton@email>
|
||||||
|
|
||||||
|
pkgname=hello-custom
|
||||||
|
pkgver=1.0
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc='Petit exemple de programme personnalisé à intégrer dans l\'ISO'
|
||||||
|
arch=('x86_64')
|
||||||
|
license=('MIT')
|
||||||
|
source=("hello-custom.sh")
|
||||||
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
|
package() {
|
||||||
|
install -Dm0755 "$srcdir/hello-custom.sh" "$pkgdir/usr/bin/hello-custom"
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
echo "Hello from my custom app!"
|
||||||
|
echo "This binary was built from source and included in the ISO."
|
||||||
@@ -126,3 +126,4 @@ xdg-utils
|
|||||||
xfsprogs
|
xfsprogs
|
||||||
xl2tpd
|
xl2tpd
|
||||||
zsh
|
zsh
|
||||||
|
hello-custom
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Ce script est exécuté dans l'environnement du live ISO
|
||||||
|
# Il peut installer/mettre en place des éléments personnalisés.
|
||||||
|
|
||||||
|
echo "[custom] Configuration personnalisée de l'ISO"
|
||||||
|
|
||||||
|
# Exemple: créer un dossier pour tes applis perso
|
||||||
|
mkdir -p /usr/local/bin /usr/local/share/my-apps
|
||||||
|
|
||||||
|
# Si tu as déjà un binaire compilé, tu peux l'ajouter ici.
|
||||||
|
# Exemple:
|
||||||
|
# install -Dm0755 /root/custom-app /usr/local/bin/custom-app
|
||||||
|
|
||||||
|
# Si tu veux rendre un script disponible globalement:
|
||||||
|
# install -Dm0755 /root/custom-scripts/hello.sh /usr/local/bin/hello.sh
|
||||||
Reference in New Issue
Block a user