tech:debian_preseed_install_automatique_par_fichier_de_reponse
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédente | |||
| tech:debian_preseed_install_automatique_par_fichier_de_reponse [2025/05/14 03:46] – Jean-Baptiste | tech:debian_preseed_install_automatique_par_fichier_de_reponse [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Debian Preseed - Install automatique par fichier de réponse | ||
| + | |||
| + | Voir [[live-usb]] | ||
| + | |||
| + | Liens : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * http:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * https:// | ||
| + | * http:// | ||
| + | |||
| + | Plop | ||
| + | * https:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | VPN | ||
| + | * https:// | ||
| + | |||
| + | CD personnalisé: | ||
| + | * https:// | ||
| + | |||
| + | ~~~bash | ||
| + | apt-get install debconf-utils | ||
| + | debconf-get-selections --installer | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | mount -o loop / | ||
| + | rsync -a -H /mnt/iso/ / | ||
| + | umount /mnt/iso | ||
| + | chown jean: -R / | ||
| + | chmod -R u+rwX / | ||
| + | |||
| + | #fakeroot | ||
| + | rm irmod/ -rf | ||
| + | mkdir irmod | ||
| + | cd irmod | ||
| + | gzip -d < ../ | ||
| + | /bin/cp -f ../ | ||
| + | find . | cpio -H newc --create --verbose | gzip -9 > ../ | ||
| + | #exit | ||
| + | cd .. | ||
| + | |||
| + | cd iso | ||
| + | md5sum $(find . -not -name " | ||
| + | |||
| + | cd .. | ||
| + | genisoimage -o test.iso -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -b isolinux/ | ||
| + | |||
| + | # Pour rendre " | ||
| + | # Paquet syslinux-utils ou alors paquet syslinux | ||
| + | isohybrid test.iso | ||
| + | ~~~ | ||
| + | |||
| + | Pour le debug voir / | ||
| + | |||
| + | Note FRONTEND | ||
| + | ~~~ini | ||
| + | DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true | ||
| + | DEBIAN_FRONTEND=text | ||
| + | DEBIAN_FRONTEND=newt | ||
| + | DEBIAN_FRONTEND=gtk | ||
| + | |||
| + | FRONTEND_BACKGROUND=dark | ||
| + | ~~~ | ||
| + | |||
| + | ### Validation | ||
| + | |||
| + | Pour vérifier la syntaxe | ||
| + | |||
| + | ~~~bash | ||
| + | sudo debconf-set-selections -c / | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Preseed | ||
| + | |||
| + | ~~~ | ||
| + | # Preseed file for Debian | ||
| + | # Source http:// | ||
| + | |||
| + | ### Contents of the preconfiguration file (for wheezy) | ||
| + | d-i debian-installer/ | ||
| + | d-i debian-installer/ | ||
| + | d-i debian-installer/ | ||
| + | d-i localechooser/ | ||
| + | |||
| + | ### Keyboard | ||
| + | d-i keyboard-configuration/ | ||
| + | d-i keyboard-configuration/ | ||
| + | d-i console-keymaps-at/ | ||
| + | |||
| + | # keymap is an alias for keyboard-configuration/ | ||
| + | #d-i keymap select fr(latin9) | ||
| + | |||
| + | ### Network configuration | ||
| + | d-i netcfg/ | ||
| + | d-i netcfg/ | ||
| + | d-i netcfg/ | ||
| + | d-i netcfg/ | ||
| + | |||
| + | ### Other | ||
| + | d-i hw-detect/ | ||
| + | |||
| + | ### Apt mirror | ||
| + | #d-i mirror/ | ||
| + | #d-i mirror/ | ||
| + | #d-i mirror/ | ||
| + | #d-i mirror/ | ||
| + | #d-i mirror/ | ||
| + | #d-i mirror/ | ||
| + | d-i mirror/ | ||
| + | d-i mirror/ | ||
| + | d-i mirror/ | ||
| + | d-i mirror/ | ||
| + | |||
| + | ### Account setup | ||
| + | d-i passwd/ | ||
| + | d-i passwd/ | ||
| + | d-i passwd/ | ||
| + | d-i passwd/ | ||
| + | d-i passwd/ | ||
| + | d-i passwd/ | ||
| + | d-i passwd/ | ||
| + | d-i passwd/ | ||
| + | d-i passwd/ | ||
| + | |||
| + | ### Clock and time zone setup | ||
| + | d-i clock-setup/ | ||
| + | d-i time/zone string Europe/ | ||
| + | d-i clock-setup/ | ||
| + | |||
| + | ### Partitioning | ||
| + | d-i partman-auto/ | ||
| + | d-i partman-auto/ | ||
| + | #d-i partman-lvm/ | ||
| + | #d-i partman-md/ | ||
| + | # MARK | ||
| + | d-i partman-auto/ | ||
| + | |||
| + | |||
| + | # MARK | ||
| + | d-i partman-partitioning/ | ||
| + | d-i partman/ | ||
| + | d-i partman/ | ||
| + | d-i partman/ | ||
| + | d-i partman-md/ | ||
| + | d-i partman/ | ||
| + | |||
| + | ### Base system installation | ||
| + | d-i base-installer/ | ||
| + | |||
| + | ### Apt setup | ||
| + | apt-cdrom-setup apt-setup/ | ||
| + | # apt-cdrom-setup apt-setup/ | ||
| + | apt-cdrom-setup apt-setup/ | ||
| + | d-i apt-setup/ | ||
| + | d-i apt-setup/ | ||
| + | d-i apt-setup/ | ||
| + | d-i apt-setup/ | ||
| + | d-i apt-setup/ | ||
| + | |||
| + | ### Package selection | ||
| + | tasksel tasksel/ | ||
| + | d-i pkgsel/ | ||
| + | popularity-contest popularity-contest/ | ||
| + | d-i pkgsel/ | ||
| + | |||
| + | ### Grub | ||
| + | d-i grub-installer/ | ||
| + | d-i grub-installer/ | ||
| + | # Due notably to potential USB sticks, the location of the MBR can not be | ||
| + | # determined safely in general, so this needs to be specified: | ||
| + | #d-i grub-installer/ | ||
| + | # To install to the first device (assuming it is not a USB stick): | ||
| + | d-i grub-installer/ | ||
| + | |||
| + | # Finish install | ||
| + | d-i finish-install/ | ||
| + | d-i cdrom-detect/ | ||
| + | |||
| + | # Postinstall | ||
| + | d-i preseed/ | ||
| + | in-target mkdir /root/.ssh ; \ | ||
| + | in-target mkdir / | ||
| + | in-target /bin/sh -c "echo ' | ||
| + | cp / | ||
| + | in-target chown -R root:root /root/ ; \ | ||
| + | in-target chmod -R go-rwx / | ||
| + | in-target sed -i ' | ||
| + | in-target /bin/sh -c "echo ' | ||
| + | in-target apt-get clean ; \ | ||
| + | cp / | ||
| + | in-target chmod +x / | ||
| + | in-target sed -i.bak " | ||
| + | |||
| + | |||
| + | |||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Pb | ||
| + | |||
| + | Pb | ||
| + | ~~~ | ||
| + | / | ||
| + | ~~~ | ||
| + | |||
| + | Erreur. | ||
| + | |||
| + | Cette erreur survient à cause du retour ligne ' | ||
| + | |||
| + | Solution | ||
| + | Dans le cas présent, j'ai remplacé `\n` par `\x0a` | ||
| + | |||
| + | Exemple : | ||
| + | |||
| + | `preseed.cfg` | ||
| + | ~~~ | ||
| + | d-i preseed/ | ||
| + | in-target sed -i.bak " | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | `preseed.cfg` | ||
| + | ~~~ | ||
| + | d-i preseed/ | ||
| + | in-target sed -i.bak " | ||
| + | ~~~ | ||
| + | |||
| + | |||
