diff --git a/scripts/install-tripleboot.md b/scripts/install-tripleboot.md new file mode 100644 index 0000000..defc66a --- /dev/null +++ b/scripts/install-tripleboot.md @@ -0,0 +1,113 @@ +# Triple Boot Debian 13 - Terra Portable Tactile + +## Materiel +- Terra portable tactile +- NVMe 512 Go +- Ecran tactile integre + +## Schema de partitionnement + +| # | Partition | Taille | Type | Usage | +|---|--------------|--------|-------|----------| +| 1 | EFI | 512 Mo | FAT32 | Partagee | +| 2 | photobooth | 155 Go | ext4 | Projet 1 | +| 3 | photostation | 155 Go | ext4 | Projet 2 | +| 4 | autre | 155 Go | ext4 | Projet 3 | +| 5 | swap | 8 Go | swap | Partage | + +> Disque Terra : NVMe 512 Go (476 Go utiles) + +## Preparation + +1. Telecharger l'ISO Debian 13 (Trixie) netinst : + https://www.debian.org/devel/debian-installer/ + +2. Creer une cle USB bootable : + ```bash + sudo dd if=debian-13-amd64-netinst.iso of=/dev/sdX bs=4M status=progress + ``` + +## Installation 1 : Photobooth + +1. Booter sur la cle USB +2. Choisir "Install" (pas graphique, plus leger) +3. Nom de machine : `photobooth` +4. Utilisateur : `jules` +5. Partitionnement **manuel** : + - Creer partition EFI 512 Mo (FAT32, flag boot) + - Creer partition 150 Go ext4, montee sur `/` + - Creer partition 150 Go ext4 (ne PAS monter, pour photostation) + - Creer partition 145 Go ext4 (ne PAS monter, pour autre) + - Creer partition 8 Go swap +6. Selection logiciels : decocher TOUT sauf "utilitaires usuels du systeme" + - Pas de bureau, pas de serveur web, rien +7. Installer GRUB sur le disque + +## Installation 2 : Photostation + +1. Booter a nouveau sur la cle USB +2. Nom de machine : `photostation` +3. Partitionnement **manuel** : + - Utiliser la partition EFI existante (512 Mo, monter sur `/boot/efi`) + - Monter la 2eme partition 150 Go sur `/` (formater) + - NE PAS toucher aux autres partitions + - Utiliser le swap existant +4. Meme selection logiciels minimale +5. Installer GRUB (il detectera les autres OS) + +## Installation 3 : Autre + +1. Meme procedure, sur la 3eme partition 145 Go +2. Nom de machine : `autre` + +## Apres les 3 installations + +### Renommer les entrees GRUB (depuis n'importe quelle partition) + +```bash +sudo nano /etc/grub.d/40_custom +``` + +Ajouter : +``` +menuentry "Photobooth" { + search --no-floppy --fs-uuid --set=root + linux /boot/vmlinuz root=UUID= ro quiet splash + initrd /boot/initrd.img +} + +menuentry "Photostation" { + search --no-floppy --fs-uuid --set=root + linux /boot/vmlinuz root=UUID= ro quiet splash + initrd /boot/initrd.img +} + +menuentry "Autre" { + search --no-floppy --fs-uuid --set=root + linux /boot/vmlinuz root=UUID= ro quiet splash + initrd /boot/initrd.img +} +``` + +Puis : +```bash +sudo update-grub +``` + +### Installer le photobooth (sur la partition photobooth) + +```bash +sudo apt install -y git +git clone https://git.copydev.fr/jules/photobooth.git ~/photobooth +cd ~/photobooth +chmod +x scripts/*.sh +sudo bash scripts/install-x86.sh +sudo reboot +``` + +## Notes + +- L'ecran tactile Terra devrait fonctionner out-of-the-box avec le driver evdev/libinput +- Si besoin de calibrer le tactile : `xinput_calibrator` +- Pour changer le projet au boot : maintenir Shift au demarrage pour afficher GRUB +- Timeout GRUB par defaut : 5 secondes, puis boot sur le dernier OS utilise diff --git a/scripts/install-x86.sh b/scripts/install-x86.sh new file mode 100644 index 0000000..7372689 --- /dev/null +++ b/scripts/install-x86.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# Installation du photobooth sur Debian 13 x86_64 (Terra portable tactile) +set -e + +echo "=== Installation Photobooth - Debian 13 x86_64 ===" + +# Mise a jour systeme +sudo apt update && sudo apt upgrade -y + +# Dependances systeme +sudo apt install -y \ + python3 python3-pip python3-venv \ + libgphoto2-dev gphoto2 \ + cups libcups2-dev \ + chromium \ + libopencv-dev python3-opencv \ + unclutter-xfixes \ + git \ + xinput \ + xdotool + +# Repertoire du projet +APP_DIR="/home/jules/photobooth" + +# Cloner ou mettre a jour le depot +if [ -d "$APP_DIR" ]; then + echo "Mise a jour du depot..." + cd "$APP_DIR" + git pull +else + echo "Clonage du depot..." + git clone https://git.copydev.fr/jules/photobooth.git "$APP_DIR" + cd "$APP_DIR" +fi + +# Creer le venv +python3 -m venv .venv +source .venv/bin/activate + +# Installer les dependances Python +pip install -r backend/requirements.txt + +# Creer les dossiers de donnees +mkdir -p data/photos data/exports +mkdir -p frontend/assets/overlays frontend/assets/backgrounds frontend/assets/sounds + +# Installer le service systemd +sudo cp scripts/photobooth-x86.service /etc/systemd/system/photobooth.service +sudo systemctl daemon-reload +sudo systemctl enable photobooth + +# Configurer l'auto-login en mode kiosk +echo "" +echo "=== Configuration auto-login kiosk ===" +sudo bash scripts/setup-kiosk.sh + +echo "" +echo "=== Installation terminee ===" +echo "Redemarrer pour lancer le photobooth automatiquement" +echo "Ou manuellement : ./scripts/start.sh" diff --git a/scripts/photobooth-x86.service b/scripts/photobooth-x86.service new file mode 100644 index 0000000..97087e0 --- /dev/null +++ b/scripts/photobooth-x86.service @@ -0,0 +1,17 @@ +[Unit] +Description=Photobooth +After=network.target graphical.target +Wants=graphical.target + +[Service] +Type=simple +User=jules +WorkingDirectory=/home/jules/photobooth +ExecStart=/home/jules/photobooth/scripts/start.sh +Restart=always +RestartSec=5 +Environment=DISPLAY=:0 +Environment=XAUTHORITY=/home/jules/.Xauthority + +[Install] +WantedBy=graphical.target diff --git a/scripts/setup-kiosk.sh b/scripts/setup-kiosk.sh new file mode 100644 index 0000000..b024e00 --- /dev/null +++ b/scripts/setup-kiosk.sh @@ -0,0 +1,69 @@ +#!/bin/bash +# Configure l'auto-login et le mode kiosk pour le photobooth +# A executer en root +set -e + +USER="jules" + +echo "--- Configuration auto-login getty ---" + +# Auto-login sur tty1 via systemd override +mkdir -p /etc/systemd/system/getty@tty1.service.d +cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf < "$BASH_PROFILE" <<'BASHEOF' +# Auto-start X sur tty1 pour le photobooth kiosk +if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then + exec startx -- -nocursor +fi +BASHEOF +chown "$USER:$USER" "$BASH_PROFILE" + +# .xinitrc lance le photobooth en plein ecran +XINITRC="/home/$USER/.xinitrc" +cat > "$XINITRC" <<'XEOF' +#!/bin/bash +# Desactiver l'ecran de veille et le DPMS +xset s off +xset -dpms +xset s noblank + +# Rotation ecran si necessaire (decommenter et ajuster) +# xrandr --output eDP-1 --rotate right + +# Attendre le demarrage du backend +sleep 2 + +# Lancer Chromium en mode kiosk +exec chromium \ + --kiosk \ + --noerrdialogs \ + --disable-infobars \ + --disable-translate \ + --disable-features=TranslateUI \ + --disable-session-crashed-bubble \ + --disable-component-update \ + --check-for-update-interval=31536000 \ + --autoplay-policy=no-user-gesture-required \ + --start-fullscreen \ + --incognito \ + --touch-events=enabled \ + --enable-touch-drag-drop \ + http://localhost:8080 +XEOF +chown "$USER:$USER" "$XINITRC" +chmod +x "$XINITRC" + +# Installer xinit si absent +apt install -y xinit x11-xserver-utils + +echo "--- Kiosk configure ---" +echo "Au prochain reboot, le photobooth demarrera automatiquement." diff --git a/scripts/tripleboot-install.sh b/scripts/tripleboot-install.sh new file mode 100644 index 0000000..7cfaade --- /dev/null +++ b/scripts/tripleboot-install.sh @@ -0,0 +1,303 @@ +#!/bin/bash +# Triple Boot Debian 13 (Trixie) - Installation automatisee +# A executer depuis une cle USB live Debian/Ubuntu +set -e + +# === CONFIGURATION === +DISK="/dev/nvme0n1" +USER="jules" +PASSWORD="jules" # A changer apres installation +MIRROR="http://deb.debian.org/debian" +SUITE="trixie" + +PARTITIONS=("photobooth" "photostation" "autre") +PART_SIZES=("155G" "155G" "155G") +SWAP_SIZE="8G" +EFI_SIZE="512M" + +# === COULEURS === +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' + +info() { echo -e "${GREEN}[INFO]${NC} $1"; } +warn() { echo -e "${YELLOW}[WARN]${NC} $1"; } +error() { echo -e "${RED}[ERREUR]${NC} $1"; exit 1; } + +# === VERIFICATIONS === +if [ "$EUID" -ne 0 ]; then + error "Ce script doit etre execute en root (sudo)" +fi + +if [ ! -b "$DISK" ]; then + error "Disque $DISK non trouve. Verifier avec 'lsblk'" +fi + +# Detecter le suffixe de partition (nvme = p1, sda = 1) +if [[ "$DISK" == *"nvme"* ]]; then + PART_PREFIX="${DISK}p" +else + PART_PREFIX="${DISK}" +fi + +echo "" +echo "==========================================" +echo " TRIPLE BOOT DEBIAN 13 - TERRA" +echo "==========================================" +echo "" +echo "Disque cible : $DISK" +echo "Partitions : ${PARTITIONS[*]}" +echo "" +warn "TOUTES LES DONNEES SUR $DISK SERONT EFFACEES !" +echo "" +read -p "Continuer ? (oui/non) : " CONFIRM +if [ "$CONFIRM" != "oui" ]; then + echo "Annule." + exit 0 +fi + +# === INSTALLATION DES OUTILS === +info "Installation des outils necessaires..." +apt-get update -qq +apt-get install -y -qq debootstrap parted dosfstools arch-install-scripts > /dev/null 2>&1 || { + # arch-install-scripts fournit genfstab, sinon on s'en passe + apt-get install -y -qq debootstrap parted dosfstools > /dev/null 2>&1 +} + +# === PARTITIONNEMENT === +info "Partitionnement de $DISK..." + +# Effacer la table de partition +wipefs -a "$DISK" > /dev/null 2>&1 +sgdisk --zap-all "$DISK" > /dev/null 2>&1 || true + +# Creer la table GPT et les partitions +parted -s "$DISK" mklabel gpt +parted -s "$DISK" mkpart "EFI" fat32 1MiB 513MiB +parted -s "$DISK" set 1 esp on +parted -s "$DISK" mkpart "photobooth" ext4 513MiB 159233MiB # ~155 Go +parted -s "$DISK" mkpart "photostation" ext4 159233MiB 318465MiB # ~155 Go +parted -s "$DISK" mkpart "autre" ext4 318465MiB 477697MiB # ~155 Go +parted -s "$DISK" mkpart "swap" linux-swap 477697MiB 485889MiB # ~8 Go + +# Attendre que les partitions apparaissent +sleep 2 +partprobe "$DISK" +sleep 2 + +# Formater +info "Formatage des partitions..." +mkfs.fat -F32 "${PART_PREFIX}1" +mkfs.ext4 -q -L "photobooth" "${PART_PREFIX}2" +mkfs.ext4 -q -L "photostation" "${PART_PREFIX}3" +mkfs.ext4 -q -L "autre" "${PART_PREFIX}4" +mkswap -L "swap" "${PART_PREFIX}5" + +# Recuperer les UUID +UUID_EFI=$(blkid -s UUID -o value "${PART_PREFIX}1") +UUID_1=$(blkid -s UUID -o value "${PART_PREFIX}2") +UUID_2=$(blkid -s UUID -o value "${PART_PREFIX}3") +UUID_3=$(blkid -s UUID -o value "${PART_PREFIX}4") +UUID_SWAP=$(blkid -s UUID -o value "${PART_PREFIX}5") + +UUIDS=("$UUID_1" "$UUID_2" "$UUID_3") + +info "Partitionnement termine." +lsblk "$DISK" + +# === INSTALLATION DES 3 SYSTEMES === +install_system() { + local INDEX=$1 + local NAME="${PARTITIONS[$INDEX]}" + local PART="${PART_PREFIX}$((INDEX + 2))" + local UUID="${UUIDS[$INDEX]}" + local MNT="/mnt/${NAME}" + + info "=== Installation de ${NAME} ($PART) ===" + + # Monter + mkdir -p "$MNT" + mount "$PART" "$MNT" + mkdir -p "$MNT/boot/efi" + mount "${PART_PREFIX}1" "$MNT/boot/efi" + + # Debootstrap + info " debootstrap ${NAME}..." + debootstrap --arch=amd64 "$SUITE" "$MNT" "$MIRROR" + + # fstab + cat > "$MNT/etc/fstab" < "$MNT/etc/hostname" + cat > "$MNT/etc/hosts" < "$MNT/etc/apt/sources.list" < "$MNT/tmp/setup.sh" < /etc/timezone +ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime +apt-get update -qq +apt-get install -y -qq locales +sed -i 's/# fr_FR.UTF-8/fr_FR.UTF-8/' /etc/locale.gen +locale-gen +update-locale LANG=fr_FR.UTF-8 + +# Installer le noyau, GRUB, firmware et outils de base +apt-get install -y -qq \ + linux-image-amd64 \ + grub-efi-amd64 \ + firmware-linux \ + sudo \ + network-manager \ + openssh-server \ + bash-completion \ + console-setup \ + keyboard-configuration + +# Creer l'utilisateur +useradd -m -s /bin/bash -G sudo,video,input,audio $USER +echo "$USER:$PASSWORD" | chpasswd +echo "root:$PASSWORD" | chpasswd + +# Sudo sans mot de passe (optionnel, pratique pour le kiosk) +echo "$USER ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USER + +# Activer NetworkManager +systemctl enable NetworkManager + +# Configurer le clavier FR +cat > /etc/default/keyboard < "$MNT/etc/grub.d/40_custom" < "$MNT/etc/default/grub" <