diff --git a/autoinstall_iut_salles_TP/S203-Debian12.viso b/autoinstall_iut_salles_TP/S203-Debian12.viso new file mode 100644 index 0000000000000000000000000000000000000000..227a2ddd0d3be696f1d88a8ca1a6382fb3f863dc --- /dev/null +++ b/autoinstall_iut_salles_TP/S203-Debian12.viso @@ -0,0 +1,8 @@ +--iprt-iso-maker-file-marker-bourne-sh=@@UUID@@ +--volume-id=S203-viso --file-mode=0444 --dir-mode=0555 --no-file-mode --no-dir-mode +--import-iso=/home/public/r205/debian-12.9.0-amd64-netinst.iso --file-mode=0444 --dir-mode=0555 +isolinux/isolinux.cfg=:must-remove: 'isolinux/isolinux.cfg=isolinux-isolinux.cfg' +/isolinux/txt.cfg=:must-remove: '/isolinux/txt.cfg=isolinux-txt-fr.cfg' +'/preseed.cfg=preseed-fr.cfg' +'/vboxpostinstall.sh=vboxpostinstall.sh' --push-iso=/usr/share/virtualbox/VBoxGuestAdditions.iso /vboxadditions=/ +--pop diff --git a/autoinstall_iut_salles_TP/isolinux-isolinux.cfg b/autoinstall_iut_salles_TP/isolinux-isolinux.cfg new file mode 100644 index 0000000000000000000000000000000000000000..cf98f5d80f5dc3b39bf7ba00b95c6b610e156cb3 --- /dev/null +++ b/autoinstall_iut_salles_TP/isolinux-isolinux.cfg @@ -0,0 +1,7 @@ +# D-I config version 2.0 +# search path for the c32 support libraries (libcom32, libutil etc.) +path +include txt.cfg +default vesamenu.c32 +prompt 0 +timeout 3 diff --git a/autoinstall_iut_salles_TP/isolinux-txt-fr.cfg b/autoinstall_iut_salles_TP/isolinux-txt-fr.cfg new file mode 100644 index 0000000000000000000000000000000000000000..7a5228d5ab5e5a310ff9d0230e34f0c72865e9b7 --- /dev/null +++ b/autoinstall_iut_salles_TP/isolinux-txt-fr.cfg @@ -0,0 +1,11 @@ +label SAE203VBoxAutoInstallGFX + menu label ^Installation graphique + kernel /install.amd/vmlinuz + append auto=true priority=critical vga=788 initrd=/install.amd/gtk/initrd.gz locale=fr_FR.UTF-8 --- quiet file=/cdrom/preseed.cfg splash noprompt noshell automatic-ubiquity -- + +label SAE203VBoxAutoInstallTXT + menu label Installation texte + kernel /install.amd/vmlinuz + append auto=true priority=critical vga=788 initrd=/install.amd/initrd.gz locale=fr_FR.UTF-8 --- quiet file=/cdrom/preseed.cfg splash noprompt noshell automatic-ubiquity -- + +default SAE203VBoxAutoInstallGFX diff --git a/autoinstall_iut_salles_TP/preseed-fr.cfg b/autoinstall_iut_salles_TP/preseed-fr.cfg new file mode 100644 index 0000000000000000000000000000000000000000..3605e4e1149b0cedfa9f483cf37cc1fe6cb29f50 --- /dev/null +++ b/autoinstall_iut_salles_TP/preseed-fr.cfg @@ -0,0 +1,105 @@ +### Partition +## Configuration +d-i partman-auto/disk string /dev/sda +d-i partman-auto/method string regular +d-i partman-auto/choose_recipe select atomic +d-i partman-lvm/device_remove_lvm boolean true +d-i partman-md/device_remove_md boolean true + +## Validation automatique +d-i partman-partitioning/confirm_write_new_label boolean true +d-i partman/choose_partition select finish +d-i partman/confirm boolean true +d-i partman/confirm_nooverwrite boolean true + + +### Localisation +# Préconfigurer la locale seule définit la langue, le pays et la locale. +d-i debian-installer/locale string fr_FR.UTF-8 +# On peut aussi demander la création d'autres locales. +#d-i localechooser/supported-locales multiselect en_US.UTF-8, … + +## Clavier +d-i console-setup/ask_detect boolean false +d-i console-keymaps-at/keymap select fr-latin9 +d-i keyboard-configuration/xkb-keymap select fr(latin9) + + +### Réseau +d-i netcfg/get_hostname string S203 +d-i netcfg/get_domain string unassigned-domain + +# Netcfg choisira une interface connectée si possible. Cela empêchera +# d'afficher une liste s'il y a plusieurs interfaces. +d-i netcfg/choose_interface select auto +# WIFI : Désactiver dialogue clé WEP +#d-i netcfg/wireless_wep string + + +### Horloge +d-i clock-setup/utc-auto boolean true +d-i clock-setup/ntp boolean false +d-i time/zone string Europe/Paris + + +### Ajout des comptes root et user +d-i user-setup/allow-password-weak boolean true +## root +d-i passwd/root-login boolean true +d-i passwd/root-password password root +d-i passwd/root-password-again password root +## Utilisateur standard +d-i passwd/user-fullname string User +d-i passwd/username string user +d-i passwd/user-password password user +d-i passwd/user-password-again password user +d-i passwd/user-default-groups string audio cdrom video + + +### Packages, Mirrors, Image +## Proxy : Obligatoire à l'université +d-i mirror/http/proxy string http://cache.univ-lille.fr:3128 + +#d-i base-installer/kernel/override-image string linux-server +#d-i base-installer/kernel/override-image string linux-image-amd64 +d-i pkgsel/install-language-support boolean false + +### Apt setup +# Pas de media supplémentaire sur cdrom +d-i apt-setup/disable-cdrom-entries boolean true +# Téléchargement de firmware non-libres, si nécessaire, sans demander +#d-i hw-detect/load_firmware boolean true + +d-i apt-setup/contrib boolean true +d-i apt-setup/non-free boolean true +d-i apt-setup/services-select multiselect security, updates +#d-i apt-setup/restricted boolean true +#d-i apt-setup/universe boolean true + +## Installation meta-paquetages +# Tâches à installer (via des méta-paquetages) +# Lister les possibilités : tasksel --list-task (en ligne de commande) +# Utiliser au minimum "standard" est une bonne idée +tasksel tasksel/first multiselect standard ssh-server + + +### Suivi statistiques paquets installés +popularity-contest popularity-contest/participate boolean false + + +### Grub +d-i grub-installer/grub2_instead_of_grub_legacy boolean true +d-i grub-installer/only_debian boolean true +d-i grub-installer/timeout string 2 +# To install to the first device (assuming it is not a USB stick): +d-i grub-installer/bootdev string default + +d-i finish-install/reboot_in_progress note + +### Custom Commands. +# Note! Debian netboot images use busybox, so no bash. +# Tell script to use target bash. +# Adding Virtualbox GuestAdditions (implies VBoxGuestAdditions.iso defined) +d-i preseed/late_command string cp /cdrom/vboxpostinstall.sh /target/root/vboxpostinstall.sh \ + && chmod +x /target/root/vboxpostinstall.sh \ + && /bin/sh /target/root/vboxpostinstall.sh --need-target-bash --preseed-late-command diff --git a/autoinstall_iut_salles_TP/vboxpostinstall.sh b/autoinstall_iut_salles_TP/vboxpostinstall.sh new file mode 100644 index 0000000000000000000000000000000000000000..1431a08f1faa0f6c7eaea7820cc3e7d54f2ff7f8 --- /dev/null +++ b/autoinstall_iut_salles_TP/vboxpostinstall.sh @@ -0,0 +1,266 @@ +#!/bin/bash +## @file +# Post installation script template for debian-like distros. +# +# Note! This script expects to be running w/o chroot. +# Note! When using ubiquity, this is run after installation logs have +# been copied to /var/log/installation. +# + +# +# Copyright (C) 2017-2022 Oracle and/or its affiliates. +# +# This file is part of VirtualBox base platform packages, as +# available from https://www.virtualbox.org. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, in version 3 of the +# License. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <https://www.gnu.org/licenses>. +# +# SPDX-License-Identifier: GPL-3.0-only +# + + +# +# Globals. +# +MY_TARGET="/target" +MY_LOGFILE="${MY_TARGET}/var/log/vboxpostinstall.log" +MY_CHROOT_CDROM="/cdrom" +MY_CDROM_NOCHROOT="/cdrom" +MY_EXITCODE=0 +MY_DEBUG="" # "yes" + + + +# +# Do we need to exec using target bash? If so, we must do that early +# or ash will bark 'bad substitution' and fail. +# +if [ "$1" = "--need-target-bash" ]; then + # Try figure out which directories we might need in the library path. + if [ -z "${LD_LIBRARY_PATH}" ]; then + LD_LIBRARY_PATH="${MY_TARGET}/lib" + fi + for x in \ + ${MY_TARGET}/lib \ + ${MY_TARGET}/usr/lib \ + ${MY_TARGET}/lib/*linux-gnu/ \ + ${MY_TARGET}/lib32/ \ + ${MY_TARGET}/lib64/ \ + ${MY_TARGET}/usr/lib/*linux-gnu/ \ + ${MY_TARGET}/usr/lib32/ \ + ${MY_TARGET}/usr/lib64/ \ + ; + do + if [ -e "$x" ]; then LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${x}"; fi; + done + export LD_LIBRARY_PATH + + # Append target bin directories to the PATH as busybox may not have tee. + PATH="${PATH}:${MY_TARGET}/bin:${MY_TARGET}/usr/bin:${MY_TARGET}/sbin:${MY_TARGET}/usr/sbin" + export PATH + + # Drop the --need-target-bash argument and re-exec. + shift + echo "******************************************************************************" >> "${MY_LOGFILE}" + echo "** Relaunching using ${MY_TARGET}/bin/bash $0 $*" >> "${MY_LOGFILE}" + echo "** LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> "${MY_LOGFILE}" + echo "** PATH=${PATH}" >> "${MY_LOGFILE}" + exec "${MY_TARGET}/bin/bash" "$0" "$@" +fi + + +# +# Commands. +# + +# Logs execution of a command. +log_command() +{ + echo "--------------------------------------------------" >> "${MY_LOGFILE}" + echo "** Date: `date -R`" >> "${MY_LOGFILE}" + echo "** Executing: $*" >> "${MY_LOGFILE}" + "$@" 2>&1 | tee -a "${MY_LOGFILE}" + MY_TMP_EXITCODE="${PIPESTATUS[0]}" + if [ "${MY_TMP_EXITCODE}" != "0" ]; then + if [ "${MY_TMP_EXITCODE}" != "${MY_IGNORE_EXITCODE}" ]; then + echo "** exit code: ${MY_TMP_EXITCODE}" | tee -a "${MY_LOGFILE}" + MY_EXITCODE=1; + else + echo "** exit code: ${MY_TMP_EXITCODE} (ignored)" | tee -a "${MY_LOGFILE}" + fi + fi +} + +# Logs execution of a command inside the target. +log_command_in_target() +{ + # + # We should be using in-target here, however we don't get any stderr output + # from it because of log-output. We can get stdout by --pass-stdout, but + # that's not helpful for failures. + # + # So, we try do the chroot prepping that in-target does at the start of the + # script (see below) and just use chroot here. + # + log_command chroot "${MY_TARGET}" "$@" + # log_command in-target --pass-stdout "$@" # No stderr output... :-( +} + +# Checks if $1 is a command on the PATH inside the target jail. +chroot_which() +{ + for dir in /bin /usr/bin /sbin /usr/sbin; + do + if [ -x "${MY_TARGET}${dir}/$1" ]; then + return 0; + fi + done + return 1; +} + +# +# Log header. +# +echo "******************************************************************************" >> "${MY_LOGFILE}" +echo "** VirtualBox Unattended Guest Installation - Late installation actions" >> "${MY_LOGFILE}" +echo "** Date: `date -R`" >> "${MY_LOGFILE}" +echo "** Started: $0 $*" >> "${MY_LOGFILE}" + + +# +# Setup the target jail ourselves since in-target steals all the output. +# +if [ -f /lib/chroot-setup.sh ]; then + MY_HAVE_CHROOT_SETUP="yes" + . /lib/chroot-setup.sh + if chroot_setup; then + echo "** chroot_setup: done" | tee -a "${MY_LOGFILE}" + else + echo "** chroot_setup: failed $?" | tee -a "${MY_LOGFILE}" + fi +else + MY_HAVE_CHROOT_SETUP="" +fi + + +# +# We want the ISO available inside the target jail. +# +if [ -d "${MY_TARGET}${MY_CHROOT_CDROM}" ]; then + MY_RMDIR_TARGET_CDROM= +else + MY_RMDIR_TARGET_CDROM="yes" + log_command mkdir -p ${MY_TARGET}${MY_CHROOT_CDROM} +fi + +if [ -f "${MY_TARGET}${MY_CHROOT_CDROM}/vboxpostinstall.sh" ]; then + MY_UNMOUNT_TARGET_CDROM= + echo "** binding cdrom into jail: already done" | tee -a "${MY_LOGFILE}" +else + MY_UNMOUNT_TARGET_CDROM="yes" + log_command mount -o bind "${MY_CDROM_NOCHROOT}" "${MY_TARGET}${MY_CHROOT_CDROM}" + if [ -f "${MY_TARGET}${MY_CHROOT_CDROM}/vboxpostinstall.sh" ]; then + echo "** binding cdrom into jail: success" | tee -a "${MY_LOGFILE}" + else + echo "** binding cdrom into jail: failed" | tee -a "${MY_LOGFILE}" + fi + if [ "${MY_DEBUG}" = "yes" ]; then + log_command find "${MY_TARGET}${MY_CHROOT_CDROM}" + fi +fi + + +# +# Debug +# +if [ "${MY_DEBUG}" = "yes" ]; then + log_command id + log_command ps + log_command ps auxwwwf + log_command env + log_command df + log_command mount + log_command_in_target df + log_command_in_target mount + #log_command find / + MY_EXITCODE=0 +fi + + +# +# Packages needed for GAs. +# +echo "--------------------------------------------------" >> "${MY_LOGFILE}" +echo '** Installing packages for building kernel modules...' | tee -a "${MY_LOGFILE}" +log_command_in_target apt-get -y install build-essential +log_command_in_target apt-get -y install linux-headers-$(uname -r) + + +# +# GAs +# + +echo "--------------------------------------------------" >> "${MY_LOGFILE}" +echo '** Installing VirtualBox Guest Additions...' | tee -a "${MY_LOGFILE}" +MY_IGNORE_EXITCODE=2 # returned if modules already loaded and reboot required. +log_command_in_target /bin/bash "${MY_CHROOT_CDROM}/vboxadditions/VBoxLinuxAdditions.run" --nox11 +log_command_in_target /bin/bash -c "udevadm control --reload-rules" # GAs doesn't yet do this. +log_command_in_target /bin/bash -c "udevadm trigger" # (ditto) +MY_IGNORE_EXITCODE= +log_command_in_target usermod -a -G vboxsf "user" + + + +# +# Test Execution Service. +# + + +# +# Run user command. +# + + + +# +# Unmount the cdrom if we bound it and clean up the chroot if we set it up. +# +if [ -n "${MY_UNMOUNT_TARGET_CDROM}" ]; then + echo "** unbinding cdrom from jail..." | tee -a "${MY_LOGFILE}" + log_command umount "${MY_TARGET}${MY_CHROOT_CDROM}" +fi + +if [ -n "${MY_RMDIR_TARGET_CDROM}" ]; then + log_command rmdir "${MY_TARGET}${MY_CHROOT_CDROM}" +fi + +if [ -n "${MY_HAVE_CHROOT_SETUP}" ]; then + if chroot_cleanup; then + echo "** chroot_cleanup: done" | tee -a "${MY_LOGFILE}" + else + echo "** chroot_cleanup: failed $?" | tee -a "${MY_LOGFILE}" + fi +fi + + +# +# Log footer. +# +echo "******************************************************************************" >> "${MY_LOGFILE}" +echo "** Date: `date -R`" >> "${MY_LOGFILE}" +echo "** Final exit code: ${MY_EXITCODE}" >> "${MY_LOGFILE}" +echo "******************************************************************************" >> "${MY_LOGFILE}" + +exit ${MY_EXITCODE} + diff --git a/images/confifuration-vm-5.png b/images/confifuration-vm-5.png new file mode 100644 index 0000000000000000000000000000000000000000..f2d92d81daadd32cce721f060098be02313f33d8 Binary files /dev/null and b/images/confifuration-vm-5.png differ diff --git a/images/config-vm-memoire.png b/images/config-vm-memoire.png new file mode 100644 index 0000000000000000000000000000000000000000..0f5896f2dc8e8c60ea556fd21435e6961e4c64a7 Binary files /dev/null and b/images/config-vm-memoire.png differ diff --git a/images/config-vm-stockage1.png b/images/config-vm-stockage1.png new file mode 100644 index 0000000000000000000000000000000000000000..5ccaa9acfa6a74c945b047831f96b5255412d473 Binary files /dev/null and b/images/config-vm-stockage1.png differ diff --git a/images/recapitulatif-5.png b/images/recapitulatif-5.png new file mode 100644 index 0000000000000000000000000000000000000000..5b139a466fd7a2d94a2bb137c676b68ac20331ca Binary files /dev/null and b/images/recapitulatif-5.png differ diff --git a/semaine2.md b/semaine2.md index e728e45cd79c345eb2ffb16b5128f1db7d44e0e8..85a7a9465e5d1c3e5b0427b6375589e345b462ba 100644 --- a/semaine2.md +++ b/semaine2.md @@ -147,3 +147,16 @@ Visualiser tous les group du pc : `getent group` >◦ Quel est le dernier nom de code annoncé à ce jour ? bookworm ◦ Quand a-t-il été annoncé ? 10 juin 2023 ◦ Quelle est la version de cette distribution ? 12 + +### Installation préconfigurée + +#### Récupérer et préparer les fichiers nécessaires + +Faire une nouvelle machine avec les caractéristiques suivantes : + +- Nom de la machine dans VirtualBox : *sae203* +- Dossier de la machine : /usr/local/virtual_machine/infoetu/*login* | Bien entendu, login est à remplacer par votre login. +- Type : Linux +- Version : *Debian 64-bit * +- Mémoire vive (RAM) : *2048 Mo* +- Disque dur : *20 Go* (nous feront une seule partition), ne pas cocher la case "Pre-allocate Full Size" \ No newline at end of file