tech:notes_install_silencieuse_redhat_kickstart
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:notes_install_silencieuse_redhat_kickstart [2025/11/09 19:14] – Jean-Baptiste | tech:notes_install_silencieuse_redhat_kickstart [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Notes install silencieuse RedHat KickStart | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | Voir aussi | ||
| + | * [[notes_cobbler|Cobbler]] | ||
| + | * Preseed [[debian_preseed_install_automatique_par_fichier_de_reponse]] | ||
| + | * [[Live-usb]] | ||
| + | |||
| + | |||
| + | Voir `/ | ||
| + | |||
| + | `ks.cfg` | ||
| + | ~~~ | ||
| + | #bootloader --location=mbr --boot-drive=sda --append=" | ||
| + | bootloader --location=mbr --boot-drive=sda --append=" | ||
| + | |||
| + | clearpart --all --initlabel | ||
| + | ignoredisk --only-use=sda | ||
| + | zerombr | ||
| + | |||
| + | ## Allow anaconda to partition the system as needed | ||
| + | ##autopart --type=lvm | ||
| + | #part /boot --fstype=" | ||
| + | ##part swap --asprimary --size=4096 | ||
| + | #part pv.01 --fstype=" | ||
| + | #volgroup vg_sys | ||
| + | #logvol /home | ||
| + | #logvol / | ||
| + | #logvol swap --fstype swap --name=lv_swap | ||
| + | ## | ||
| + | |||
| + | # La partition ESP pour les machines EFI aura une taille minimale de 500 Mio au lieu de 200 Mio | ||
| + | part /boot/efi --fstype=" | ||
| + | |||
| + | part /boot --fstype=" | ||
| + | part pv.10 --fstype=" | ||
| + | volgroup rhel --pesize=4096 pv.10 | ||
| + | logvol /home --fstype=" | ||
| + | logvol swap --fstype=" | ||
| + | logvol / --fstype=" | ||
| + | |||
| + | firewall --disabled | ||
| + | selinux --disabled | ||
| + | firstboot --disable | ||
| + | |||
| + | keyboard --vckeymap=fr-oss --xlayouts=' | ||
| + | lang fr_FR.UTF-8 | ||
| + | timezone Europe/ | ||
| + | |||
| + | text | ||
| + | reboot | ||
| + | install | ||
| + | skipx | ||
| + | |||
| + | auth --enableshadow --passalgo=sha512 | ||
| + | |||
| + | rootpw --iscrypted $6$16qezferzg55SAL$vnD4POyadqj7x27GUWARljI6.rgezBlTK/ | ||
| + | user --name=dev --password=$6$W8NI3UWFLLZOZOZJO8pZoyn5oH0LNtveNEWtP.WL5.LTwGDS1bmFwBHSbci.3yB491 --iscrypted --gecos=" | ||
| + | |||
| + | %pre | ||
| + | #%pre --erroronfail | ||
| + | |||
| + | set -x -v | ||
| + | exec 1>/ | ||
| + | |||
| + | # Once root's homedir is there, copy over the log. | ||
| + | while : ; do | ||
| + | sleep 10 | ||
| + | if [ -d / | ||
| + | cp / | ||
| + | logger " | ||
| + | break | ||
| + | fi | ||
| + | done & | ||
| + | %end | ||
| + | |||
| + | services --enabled=sshd, | ||
| + | |||
| + | %packages | ||
| + | @core | ||
| + | chrony | ||
| + | %end | ||
| + | |||
| + | %post --nochroot | ||
| + | set -x -v | ||
| + | exec 1>/ | ||
| + | %end | ||
| + | |||
| + | %post | ||
| + | set -x -v | ||
| + | exec 1>/ | ||
| + | |||
| + | # Start yum configuration | ||
| + | #curl " | ||
| + | |||
| + | cd /root | ||
| + | mkdir --mode=700 .ssh | ||
| + | cat >> .ssh/ | ||
| + | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOpSuQISNltnRl5e2lBZ+poH68lY+pMewPOsLM6wvRo9uvEdLgLZBBoYDLgoNhZwT1wvPQSAn7AbHZhmarX3kGlp/ | ||
| + | EOF | ||
| + | chmod 600 .ssh/ | ||
| + | |||
| + | echo " | ||
| + | #network --hostname=myhostname | ||
| + | rpm -e biosdevname | ||
| + | |||
| + | cat <<EOF > / | ||
| + | TYPE=Ethernet | ||
| + | BOOTPROTO=dhcp | ||
| + | # | ||
| + | IPV6INIT=no | ||
| + | IPV4_FAILURE_FATAL=no | ||
| + | NAME=eth0 | ||
| + | DEVICE=eth0 | ||
| + | ONBOOT=yes | ||
| + | NM_CONTROLLED=no | ||
| + | EOF | ||
| + | |||
| + | # End final steps | ||
| + | %end | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Vérif | ||
| + | |||
| + | ~~~bash | ||
| + | yum install pykickstart | ||
| + | |||
| + | # ou | ||
| + | pip install pykickstart | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | ksvalidator ks.cfg | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Lancer le kickstart placé sur un serveur Web | ||
| + | |||
| + | ~~~ | ||
| + | linux ks=http:// | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Inclure le fichier kickstart dans l'iso | ||
| + | |||
| + | Pour boot si BIOS non UEFI | ||
| + | ~~~bash | ||
| + | mount -o ro /dev/cdrom /mnt/iso/ | ||
| + | rsync -a -H --delete --chmod=u+w /mnt/iso/ / | ||
| + | umount /mnt/iso/ | ||
| + | |||
| + | vim / | ||
| + | cp -p / | ||
| + | ~~~ | ||
| + | |||
| + | `isolinux/ | ||
| + | ~~~ | ||
| + | label linux | ||
| + | menu label ^Install Red Hat Enterprise Linux 7.0 - ks (label) | ||
| + | menu default | ||
| + | kernel vmlinuz | ||
| + | #append initrd=initrd.img inst.stage2=hd: | ||
| + | append initrd=initrd.img inst.stage2=hd: | ||
| + | |||
| + | label linux | ||
| + | menu label ^Install Red Hat Enterprise Linux 7.0 - ks (cdrom) | ||
| + | kernel vmlinuz | ||
| + | append initrd=initrd.img inst.stage2=cdrom ks=cdrom:/ | ||
| + | |||
| + | label linux | ||
| + | menu label ^Install Red Hat Enterprise Linux 7.0 | ||
| + | kernel vmlinuz | ||
| + | append initrd=initrd.img inst.stage2=hd: | ||
| + | |||
| + | ~~~ | ||
| + | |||
| + | Pour UEFI | ||
| + | |||
| + | `grub.cfg` | ||
| + | ~~~bash | ||
| + | ### BEGIN / | ||
| + | menuentry ' | ||
| + | linuxefi / | ||
| + | initrdefi / | ||
| + | } | ||
| + | menuentry ' | ||
| + | linuxefi / | ||
| + | initrdefi / | ||
| + | } | ||
| + | ~~~ | ||
| + | |||
| + | Modif de **efiboot.img** | ||
| + | ~~~bash | ||
| + | mkdir /mnt/tmp | ||
| + | mount images/ | ||
| + | vim / | ||
| + | umount /mnt/tmp | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | cd / | ||
| + | genisoimage | ||
| + | isohybrid -u / | ||
| + | implantisomd5 / | ||
| + | ~~~ | ||
| + | |||
| + | Note : le parametre suivant va ensemble `-eltorito-alt-boot -e images/ | ||
| + | |||
| + | |||
| + | ## Autres | ||
| + | |||
| + | |||
| + | |||
| + | La petite partition /boot dédiée sur le disque local est formatée usuellement en ext2 (ou FAT32 dans le cadre d’un système UEFI). | ||
| + | |||
| + | |||
| + | ### Se passer de Grub | ||
| + | |||
| + | Voir : | ||
| + | * `bootloader --sdboot` et `inst.sdboot` | ||
| + | * https:// | ||
| + | |||
| + | |||
