debian

Preseed Debian

Preseed Debian

Automatisez simplement l'installation

Voici une méthode pour automatiser l'installation de Debian et se faire ses propre iso :

Plus d'info en suivant la source :

https://www.nextinpact.com/news/107141-preseed-debian-automatisez-simplement-installation.htm

### Fichier de préconfiguration pour l'installation de Debian 9.x (Stretch)
### Template complet : https://www.debian.org/releases/stable/example-preseed.txt
### Guide officiel   : https://www.debian.org/releases/stable/i386/apbs04.html.fr

### Configuration du français comme langue d'installation
d-i debian-installer/locale string fr_FR

### Décommenter pour configurer chaque élément de manière distincte
### Peut être utile pour des combinaisons spécifiques
#d-i debian-installer/locale string fr_FR.UTF-8
#d-i debian-installer/language string fr
#d-i debian-installer/country string FR

### Configuration du clavier français
### Utiliser la première ligne pour sauter cette étape
#d-i keyboard-configuration/xkb-keymap select skip-config
d-i keyboard-configuration/xkb-keymap select fr(latin9)

### Evite le scan de l'ISO au début de la procédure
#d-i apt-setup/cdrom/set-failed boolean false
#d-i apt-setup/cdrom/set-first boolean false
#d-i apt-setup/cdrom/set-next boolean false

### Configuration automatique du réseau
### Chargement d'un firmware non-libre si nécessaire
d-i netcfg/choose_interface select auto
d-i hw-detect/load_firmware boolean true 

### Configuration du nom/domaine de la machine
d-i netcfg/get_hostname string DebianMachineXX
d-i netcfg/get_domain string local

### Décommenter pour une installation hors-ligne
#d-i netcfg/enable boolean false

### Configuration automatique de l'heure
### On utilise Paris comme fuseau de référence
d-i clock-setup/utc boolean true
d-i clock-setup/ntp boolean true
d-i time/zone string Europe/Paris

### Déclare le système comme non UEFI
### Permet d'éviter la question sur l'installation UEFI forcée
#d-i partman-efi/non_efi_system boolean true

### Précision du HDD/SSD à formater
### Dans le doute, laisser les lignes commentées
#d-i partman-auto/disk string /dev/sda
#d-i partman-auto/disk string /dev/sdb
#d-i partman-auto/disk string /dev/nvme0n1

### Effacement de tout le stockage principal
### Utilisation d'un partionnement LVM
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-auto/method string lvm

### Schéma de partitionnement
### Différents choix possibles :
### - atomic (tous les fichiers dans une même partition)
### - home (/home séparé du reste)
### - multi (/home, /var, /tmp séparés du reste)
d-i partman-auto/choose_recipe select atomic

### Aucune confirmation ne vous sera demandée
### Commentez certaines lignes pour avoir à valider certaines étapes
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-md/confirm boolean true
d-i partman-partitioning/confirm_write_new_label boolean true

### Configuration des dépôts non-libres et contrib
d-i apt-setup/non-free boolean true
d-i apt-setup/contrib boolean true

### Configuration du mirroir français
### Alternatives possibles :
### - ftp.crihan.fr
### - ftp.iut-bm.univ-fcomte.fr
### - ftp.rezopole.net
### - ftp.u-picardie.fr
### - ftp.u-strasbg.fr
d-i mirror/protocol string ftp
d-i mirror/ftp/hostname string ftp.fr.debian.org
d-i mirror/ftp/directory string /debian
d-i mirror/ftp/proxy string

### Pour utiliser plutôt des mirroirs HTTP
### Alternatives possibles :
### - debian.mirrors.ovh.net
### - debian.polytech-lille.fr
### - debian.proxad.net
### - debian.univ-reims.fr
### - debian.univ-tlse2.fr
#d-i mirror/country string manual
#d-i mirror/http/hostname string debian.univ-lorraine.fr
#d-i mirror/http/directory string /debian
#d-i mirror/http/proxy string

### Version Stable, Testing ou Unstable ?
d-i apt-setup/use_mirror boolean true
d-i mirror/suite string stable

### Groupes de paquets à installer
### Différents choix possibles (combinables) :
### - standard (nécessaire)
### - print-server
### - ssh-server
### - web-server
### - cinnamon-desktop
### - desktop
### - gnome-desktop
### - kde-desktop
### - lxde-desktop
### - mate-desktop
### - xfce-desktop
tasksel tasksel/first multiselect standard, ssh-server

### Paquets à installer via APT pendant l'installation
d-i pkgsel/include string avahi-daemon build-essential cifs-utils open-iscsi virt-manager
popularity-contest popularity-contest/participate boolean false

### Pas de compte root configuré sur la machine
d-i passwd/root-login boolean false

### Configuration d'un compte utilisateur
d-i passwd/user-fullname string davlgd 
d-i passwd/username string davlgd

### Commande pour générer l'empreinte du mot de passe :
### mkpasswd -m sha-512 (motdepasse dans le cas ci-dessous)
d-i passwd/user-password-crypted password $6$rnPpgCH7$uiSg5eyyTjflS3SMGh1bBMs26qFwFargMV.cUHkOeIOTaQJqsU7v9iDA7VQvdNUVNC.hHX7F0.VNi/aX3TzRJ1

### Installation de GRUB
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true

### Placé sur la première partition par défaut
### Utilisez plutôt la seconde ligne pour préciser votre choix
d-i grub-installer/bootdev string default
#d-i grub-installer/bootdev string /dev/sda
#d-i grub-installer/bootdev string /dev/sdb
#d-i grub-installer/bootdev string /dev/nvme0n1

### Fin de l'installation
d-i finish-install/reboot_in_progress note
sudo apt install genisoimage isolinux wget xorriso 

Il suffit de le lancer avec les paramètres suivants :

sudo ./preseed_creator.sh -i image.iso -p preseed.cfg -o image_preseed.iso

Voilà tout :)

0 Commentaires 0 Commentaires
0 Commentaires 0 Commentaires