Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
elearning:workbooks:lpic:21:450:l103 [2022/10/10 04:37] adminelearning:workbooks:lpic:21:450:l103 [2022/11/01 07:24] (Version actuelle) admin
Ligne 5: Ligne 5:
 Dernière mise-à-jour : ~~LASTMOD~~ Dernière mise-à-jour : ~~LASTMOD~~
  
-======Topic 3: System Startup======+======Topic 202: System Startup======
  
-=====Contenu du Module===== +  * **Topic 202: System Startup**
- +
-  * **Topic 3: System Startup** +
-    * Contenu du Module+
     * Présentation     * Présentation
     * BIOS, EFI et OpenFirmware     * BIOS, EFI et OpenFirmware
Ligne 27: Ligne 24:
         * Configurer l'Authentification         * Configurer l'Authentification
         * Modifier la Configuration de GRUB Legacy en Ligne de Commande         * Modifier la Configuration de GRUB Legacy en Ligne de Commande
-      * GRUB 2 sous RHEL/CentOS 7 +      * GRUB 2 sous Debian 11 
-        * Le fichier /boot/grub/device.map+        * Le fichier /boot/grub2/device.map
         * Le fichier /etc/default/grub         * Le fichier /etc/default/grub
         * Les fichiers du répertoire /etc/grub.d         * Les fichiers du répertoire /etc/grub.d
-        * Configurer l'Authentification 
-          * RHEL/CentOS < 7.2 
-          * RHEL/CentOS >= 7.2 
         * Modifier la Configuration de GRUB 2 en Ligne de Commande         * Modifier la Configuration de GRUB 2 en Ligne de Commande
       * Chargeurs de Démarrages Alternatifs       * Chargeurs de Démarrages Alternatifs
Ligne 48: Ligne 42:
       * Le script init       * Le script init
       * La Commande dracut       * La Commande dracut
-    * Initramfs sous RHEL/CentOS 7 +    * Initramfs sous Debian 11 
-      * Examiner l'image existante +      * LAB #1 - Travailler avec Initramfs 
-      * Le script init +        * 1.1 - Examiner l'image existante 
-      * Consulter le contenu d'un fichier dans initramfs +        1.2 - La Commande mkinitramfs
-      * La Commande dracut+
     * Processus de Démarrage du Noyau Linux     * Processus de Démarrage du Noyau Linux
     * Processus Init     * Processus Init
Ligne 93: Ligne 86:
         * La Commande stop         * La Commande stop
         * La Commande restart         * La Commande restart
-    * Démarrer RHEL/CentOS 7 +    * Démarrer Debian 11 avec systemd 
-      * La Commande systemctl +      * LAB #2 - La Commande systemctl 
-      * Fichiers de Configuration +      * LAB #3 - Fichiers de Configuration 
-      * La Commande systemd-analyze +        * 3.1 - Fichiers de Configuration par Défaut 
-      * Gestion des Services +        * 3.2 - Surchargement des Fichiers par Défaut 
-    Arrêt Système du Système +        * 3.3 - Les Fichiers d'Unités 
-      * La Commande shutdown +      * LAB #4 - La Commande systemd-analyze 
-      * La Commande reboot +      * LAB #5 - Les Cibles 
-      La Commande halt +        5.1 - Contrôler les dépendances d'une Cible 
-      La Commande poweroff+        5.2 - La Cible par Défaut 
 +      * LAB #6 - Gestion des Services 
 +        6.1 - Gestion des Instances Uniques 
 +        6.2 - Gestion d'Instances Multiples 
 +        * 6.3 - Interdire la Modification du Statut d'un Service
  
 =====Présentation===== =====Présentation=====
Ligne 149: Ligne 146:
 </WRAP> </WRAP>
  
-<WRAP center round important>+<WRAP center round important 60% >
 **Important** : L'UEFI gère parfaitement les **SSD** (//Solid State Drives//) qui utilisent le standard **NVMe** (//Non-Volatile Memory Express//). Linux supporte les SSD depuis le noyau 3.3. **Important** : L'UEFI gère parfaitement les **SSD** (//Solid State Drives//) qui utilisent le standard **NVMe** (//Non-Volatile Memory Express//). Linux supporte les SSD depuis le noyau 3.3.
 </WRAP> </WRAP>
Ligne 204: Ligne 201:
 Si le BIOS signale une erreur lorsque LILO essaye de charger une image d'amorce, le code d'erreur correspondant est affiché. Ces codes vont de 0x00 à 0xbb. Reportez-vous au Guide Utilisateur de LILO pour leur explication. Si le BIOS signale une erreur lorsque LILO essaye de charger une image d'amorce, le code d'erreur correspondant est affiché. Ces codes vont de 0x00 à 0xbb. Reportez-vous au Guide Utilisateur de LILO pour leur explication.
  
-<WRAP center round important>+<WRAP center round important 60% >
 **Important** : LILO ne gère pas les systèmes UEFI. **Important** : LILO ne gère pas les systèmes UEFI.
 </WRAP>  </WRAP> 
Ligne 271: Ligne 268:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60% >
 **Important** : Sous les distributions dérivées de Red Hat, par exemple Fedora, le fichier menu.lst s'appelle **grub.conf**. **Important** : Sous les distributions dérivées de Red Hat, par exemple Fedora, le fichier menu.lst s'appelle **grub.conf**.
 </WRAP>  </WRAP> 
Ligne 355: Ligne 352:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60% >
 **Important** : Notez l'addition de la ligne **password --md5 $1$VLOzG$ibdk0my4IHny/XtNIGRhv1** ainsi que le mot clef **lock** sur une ligne située après chaque ligne commençant par **title**.  **Important** : Notez l'addition de la ligne **password --md5 $1$VLOzG$ibdk0my4IHny/XtNIGRhv1** ainsi que le mot clef **lock** sur une ligne située après chaque ligne commençant par **title**. 
 </WRAP> </WRAP>
Ligne 375: Ligne 372:
   * **echap** : abandonner les modifications et retourner à l'interface de GRUB.   * **echap** : abandonner les modifications et retourner à l'interface de GRUB.
  
-====GRUB 2 sous CentOS 8====+====GRUB 2 sous Debian 11====
  
 GRUB 2 est une ré-écriture complète de GRUB Legacy. Il apporte des améliorations, notamment GRUB 2 sait utiliser des partitions RAID et LVM. GRUB 2 est une ré-écriture complète de GRUB Legacy. Il apporte des améliorations, notamment GRUB 2 sait utiliser des partitions RAID et LVM.
Ligne 383: Ligne 380:
   * Etape 1 : Le **boot.img**, stocké dans les 512 premiers octets du secteur 0 avec la table des partitions, est lancé. Son seul but est de lancer l'étape 1.5,   * Etape 1 : Le **boot.img**, stocké dans les 512 premiers octets du secteur 0 avec la table des partitions, est lancé. Son seul but est de lancer l'étape 1.5,
   * Etape 1.5 : Le **core.img**, d'une taille approximative de 25 Ko et stocké dans les secteurs 1 à 62, est lance. Son travail est de charger des pilotes qui supportent de multiples systèmes de fichiers puis de lancer l'étape 2 dans un des systèmes de fichiers,   * Etape 1.5 : Le **core.img**, d'une taille approximative de 25 Ko et stocké dans les secteurs 1 à 62, est lance. Son travail est de charger des pilotes qui supportent de multiples systèmes de fichiers puis de lancer l'étape 2 dans un des systèmes de fichiers,
-  * Etape 2 : Contenu dans le répertoire **/boot/grub2/**, il lance le menu pour que l'utilisateur puisse choisir les système d'exploitation à lancer.+  * Etape 2 : Contenu dans le répertoire **/boot/grub/**, il lance le menu pour que l'utilisateur puisse choisir les système d'exploitation à lancer.
  
 Dans le cas où le Charger de Démarrage **GRUB 2** n'est pas installé, il convient de saisir la commande suivante : Dans le cas où le Charger de Démarrage **GRUB 2** n'est pas installé, il convient de saisir la commande suivante :
  
-  # grub2-install /dev/périphérique [Entrée]+  # grub-install /dev/périphérique [Entrée]
  
 où **périphérique** est le nom du périphérique ou l'étape 1 de GRUB2 doit s'installer dans le MBR.  où **périphérique** est le nom du périphérique ou l'étape 1 de GRUB2 doit s'installer dans le MBR. 
  
-**GRUB 2** lit ses entrées de menus à partir du fichier **/boot/grub2/grub.cfg**. Pour visualiser ce fichier, il convient de saisir la commande suivante :+**GRUB 2** lit ses entrées de menus à partir du fichier **/boot/grub/grub.cfg**. Pour visualiser ce fichier, il convient de saisir la commande suivante :
  
 <code> <code>
-[root@centos8 ~]# cat /boot/grub2/grub.cfg +root@debian11:~# cat /boot/grub/grub.cfg
 # #
 # DO NOT EDIT THIS FILE # DO NOT EDIT THIS FILE
 # #
-# It is automatically generated by grub2-mkconfig using templates+# It is automatically generated by grub-mkconfig using templates
 # from /etc/grub.d and settings from /etc/default/grub # from /etc/grub.d and settings from /etc/default/grub
 # #
  
 ### BEGIN /etc/grub.d/00_header ### ### BEGIN /etc/grub.d/00_header ###
-set pager=1 +if [ -$prefix/grubenv ]; then 
- +  set have_grubenv=true
-if [ -${config_directory}/grubenv ]; then +
-  load_env -f ${config_directory}/grubenv +
-elif [ -s $prefix/grubenv ]; then+
   load_env   load_env
 fi fi
Ligne 416: Ligne 410:
    set boot_once=true    set boot_once=true
 else else
-   set default="${saved_entry}"+   set default="0"
 fi fi
  
Ligne 441: Ligne 435:
   fi   fi
 } }
- 
 function load_video { function load_video {
   if [ x$feature_all_video_module = xy ]; then   if [ x$feature_all_video_module = xy ]; then
Ligne 456: Ligne 449:
 } }
  
-terminal_output console +if [ x$feature_default_font_path = xy ] ; then 
-if [ x$feature_timeout_style = xy ] ; then +   font=unicode
-  set timeout_style=menu +
-  set timeout=5 +
-# Fallback normal timeout code in case the timeout_style feature is +
-# unavailable.+
 else else
-  set timeout=5 +insmod part_msdos 
-fi +insmod ext2 
-### END /etc/grub.d/00_header ### +set root='hd0,msdos1' 
- +if [ x$feature_platform_search_hint xy ]; then 
-### BEGIN /etc/grub.d/00_tuned ### +  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  9887a74f-a680-4bde-8f04-db5ae9ea186e
-set tuned_params="" +
-set tuned_initrd="" +
-### END /etc/grub.d/00_tuned ### +
- +
-### BEGIN /etc/grub.d/01_menu_auto_hide ### +
-if [ "${boot_success}" "1" -o "${boot_indeterminate}" = "1" ]; then +
-  set last_boot_ok=1+
 else else
-  set last_boot_ok=0+  search --no-floppy --fs-uuid --set=root 9887a74f-a680-4bde-8f04-db5ae9ea186e 
 +fi 
 +    font="/usr/share/grub/unicode.pf2"
 fi fi
  
-# Reset boot_indeterminate after a successful boot +if loadfont $font ; then 
-if [ "${boot_success}" = "1"; then +  set gfxmode=auto 
-  set boot_indeterminate=0 +  load_video 
-# Avoid boot_indeterminate causing the menu to be hidden more then once +  insmod gfxterm 
-elif [ "${boot_indeterminate}" "1" ]; then +  set locale_dir=$prefix/locale 
-  set boot_indeterminate=2+  set lang=en_US 
 +  insmod gettext
 fi fi
-set boot_success=0 +terminal_output gfxterm 
-save_env boot_success boot_indeterminate +if [ "${recordfail}" ] ; then 
- +  set timeout=30 
-if [ x$feature_timeout_style xy ] ; then +else 
-  if [ "${menu_show_once}" ]; then +  if [ x$feature_timeout_style = xy ] ; then
-    unset menu_show_once +
-    save_env menu_show_once+
     set timeout_style=menu     set timeout_style=menu
-    set timeout=60 +    set timeout=5 
-  elif [ "${menu_auto_hide}" -a "${last_boot_ok}" = "1" ]; then +  # Fallback normal timeout code in case the timeout_style feature is 
-    set orig_timeout_style=${timeout_style} +  # unavailable. 
-    set orig_timeout=${timeout} +  else 
-    if [ "${fastboot}" = "1" ]; then +    set timeout=5
-      timeout_style=menu + timeout=0 avoids the countdown code keypress check +
-      set timeout_style=menu +
-      set timeout=0 +
-    else +
-      set timeout_style=hidden +
-      set timeout=+
-    fi+
   fi   fi
 fi fi
-### END /etc/grub.d/01_menu_auto_hide ###+### END /etc/grub.d/00_header ###
  
-### BEGIN /etc/grub.d/01_users ### +### BEGIN /etc/grub.d/05_debian_theme ###
-if [ -f ${prefix}/user.cfg ]; then +
-  source ${prefix}/user.cfg +
-  if [ -n "${GRUB2_PASSWORD}" ]; then +
-    set superusers="root" +
-    export superusers +
-    password_pbkdf2 root ${GRUB2_PASSWORD} +
-  fi +
-fi +
-### END /etc/grub.d/01_users ### +
- +
-### BEGIN /etc/grub.d/10_linux ###+
 insmod part_msdos insmod part_msdos
 insmod ext2 insmod ext2
 set root='hd0,msdos1' set root='hd0,msdos1'
 if [ x$feature_platform_search_hint = xy ]; then if [ x$feature_platform_search_hint = xy ]; then
-  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  2ae4c035-9244-458c-82c5-a49ae169cdb6+  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  9887a74f-a680-4bde-8f04-db5ae9ea186e
 else else
-  search --no-floppy --fs-uuid --set=root 2ae4c035-9244-458c-82c5-a49ae169cdb6+  search --no-floppy --fs-uuid --set=root 9887a74f-a680-4bde-8f04-db5ae9ea186e
 fi fi
-insmod part_msdos +insmod png 
-insmod ext2 +if background_image /usr/share/desktop-base/homeworld-theme/grub/grub-4x3.png; then 
-set boot='hd0,msdos1' +  set color_normal=white/black 
-if [ x$feature_platform_search_hint = xy ]; then +  set color_highlight=black/white
-  search --no-floppy --fs-uuid --set=boot --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  2ae4c035-9244-458c-82c5-a49ae169cdb6+
 else else
-  search --no-floppy --fs-uuid --set=boot 2ae4c035-9244-458c-82c5-a49ae169cdb6+  set menu_color_normal=cyan/blue 
 +  set menu_color_highlight=white/blue
 fi fi
 +### END /etc/grub.d/05_debian_theme ###
  
-This section was generated by a scriptDo not modify the generated file all changes +### BEGIN /etc/grub.d/10_linux ### 
-# will be lost the next time file is regeneratedInstead edit the BootLoaderSpec files+function gfxmode { 
-+        set gfxpayload="${1}" 
-# The blscfg command parses the BootLoaderSpec files stored in /boot/loader/entries and +
-# populates the boot menuPlease refer to the Boot Loader Specification documentation +set linux_gfx_mode= 
-for the files format: https://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/. +export linux_gfx_mode 
- +menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-9887a74f-a680-4bde-8f04-db5ae9ea186e' { 
-set default_kernelopts="root=UUID=4c0cc28c-0d59-45be-bd73-d292b80be33c ro crashkernel=auto resume=UUID=c8bb3f47-d67f-4b21-b781-766899dc83d4 rhgb quiet "+        load_video 
 +        insmod gzio 
 +        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi 
 +        insmod part_msdos 
 +        insmod ext2 
 +        set root='hd0,msdos1' 
 +        if [ x$feature_platform_search_hint = xy ]; then 
 +          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  9887a74f-a680-4bde-8f04-db5ae9ea186e 
 +        else 
 +          search --no-floppy --fs-uuid --set=root 9887a74f-a680-4bde-8f04-db5ae9ea186e 
 +        fi 
 +        echo    'Loading Linux 5.10.0-13-amd64 ...' 
 +        linux   /boot/vmlinuz-5.10.0-13-amd64 root=UUID=9887a74f-a680-4bde-8f04-db5ae9ea186e ro  quiet 
 +        echo    'Loading initial ramdisk ...' 
 +        initrd  /boot/initrd.img-5.10.0-13-amd64 
 +
 +submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-9887a74f-a680-4bde-8f04-db5ae9ea186e'
 +        menuentry 'Debian GNU/Linux, with Linux 5.10.0-13-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.10.0-13-amd64-advanced-9887a74f-a680-4bde-8f04-db5ae9ea186e'
 +                load_video 
 +                insmod gzio 
 +                if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi 
 +                insmod part_msdos 
 +                insmod ext2 
 +                set root='hd0,msdos1' 
 +                if [ x$feature_platform_search_hint = xy ]; then 
 +                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  9887a74f-a680-4bde-8f04-db5ae9ea186e 
 +                else 
 +                  search --no-floppy --fs-uuid --set=root 9887a74f-a680-4bde-8f04-db5ae9ea186e 
 +                fi 
 +                echo    'Loading Linux 5.10.0-13-amd64 ...' 
 +                linux   /boot/vmlinuz-5.10.0-13-amd64 root=UUID=9887a74f-a680-4bde-8f04-db5ae9ea186e ro  quiet 
 +                echo    'Loading initial ramdisk ...' 
 +                initrd  /boot/initrd.img-5.10.0-13-amd64 
 +        } 
 +        menuentry 'Debian GNU/Linux, with Linux 5.10.0-13-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.10.0-13-amd64-recovery-9887a74f-a680-4bde-8f04-db5ae9ea186e'
 +                load_video 
 +                insmod gzio 
 +                if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi 
 +                insmod part_msdos 
 +                insmod ext2 
 +                set root='hd0,msdos1' 
 +                if [ x$feature_platform_search_hint = xy ]; then 
 +                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  9887a74f-a680-4bde-8f04-db5ae9ea186e 
 +                else 
 +                  search --no-floppy --fs-uuid --set=root 9887a74f-a680-4bde-8f04-db5ae9ea186e 
 +                fi 
 +                echo    'Loading Linux 5.10.0-13-amd64 ...' 
 +                linux   /boot/vmlinuz-5.10.0-13-amd64 root=UUID=9887a74f-a680-4bde-8f04-db5ae9ea186e ro single  
 +                echo    'Loading initial ramdisk ...' 
 +                initrd  /boot/initrd.img-5.10.0-13-amd64 
 +        } 
 +}
  
-insmod blscfg 
-blscfg 
 ### END /etc/grub.d/10_linux ### ### END /etc/grub.d/10_linux ###
  
 ### BEGIN /etc/grub.d/20_linux_xen ### ### BEGIN /etc/grub.d/20_linux_xen ###
-### END /etc/grub.d/20_linux_xen ### 
  
-### BEGIN /etc/grub.d/20_ppc_terminfo ### +### END /etc/grub.d/20_linux_xen ###
-### END /etc/grub.d/20_ppc_terminfo ###+
  
 ### BEGIN /etc/grub.d/30_os-prober ### ### BEGIN /etc/grub.d/30_os-prober ###
Ligne 589: Ligne 602:
 | rootnoverify (hd0,1) | Ce paramètre n'existe plus sous GRUB 2. Les paramètres des systèmes d'exploitation non Linux sont définit avec le paramètre **root** | | rootnoverify (hd0,1) | Ce paramètre n'existe plus sous GRUB 2. Les paramètres des systèmes d'exploitation non Linux sont définit avec le paramètre **root** |
  
-Notez que ce fichier ne doit pas être modifié manuellement. En effet, il est généré par la commande **grub2-mkconfig**. La commande grub2-mkconfig prend en argument l'emplacement du fichier grub.cfg, par exemple :+Notez que ce fichier ne doit pas être modifié manuellement. En effet, il est généré par la commande **update-grub** ou la commande **grub-mkconfig** sous Debian. La commande grub-mkconfig prend en argument l'emplacement du fichier destination, par exemple :
  
-  * grub2-mkconfig -o /boot/grub2/grub.cfg, ou +  * grub-mkconfig -o /boot/grub/grub.cfg 
-  * grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg+  * grub-mkconfig -o /boot/edi/EFI/debian/grub.cfg
  
-Lors de l'exécution de la commande **grub2-mkconfig** plusieurs fichiers sont lus :+Lors de l'exécution de la commande **grub-mkconfig**plusieurs fichiers sont lus :
  
 ===Le fichier /boot/grub2/device.map=== ===Le fichier /boot/grub2/device.map===
  
 <code> <code>
-[root@centos8 ~]# cat /boot/grub2/device.map +root@debian11:~# cat /boot/grub/device.map 
-this device map was generated by anaconda +cat: /boot/grub/device.map: No such file or directory 
-(hd0)      /dev/sda +root@debian11:~grub-mkdevicemap 
-(hd1)      /dev/sda+root@debian11:~# cat /boot/grub/device.map 
 +(hd0)   /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi2 
 +(hd1)   /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0 
 +(hd2)   /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi1 
 +(hd3)   /dev/disk/by-id/lvm-pv-uuid-1JO10Q-CM90-tKxI-OsM6-0vbe-3eDG-S10H6d 
 +(hd4)   /dev/disk/by-id/lvm-pv-uuid-GEkOIP-S7ce-8S1G-K0TX-ocxE-Ud6y-IY3fOZ 
 +(hd5)   /dev/disk/by-id/lvm-pv-uuid-J7UiEX-m983-j1fp-rU7x-TuCh-MFKh-s1O5M0
 </code> </code>
  
Ligne 610: Ligne 629:
  
 <code> <code>
-[root@centos8 ~]# cat /etc/default/grub+root@debian11:~# cat /etc/default/grub 
 +# If you change this file, run 'update-grub' afterwards to update 
 +# /boot/grub/grub.cfg. 
 +# For full documentation of the options in this file, see: 
 +#   info -f grub -n 'Simple configuration' 
 + 
 +GRUB_DEFAULT=0
 GRUB_TIMEOUT=5 GRUB_TIMEOUT=5
-GRUB_DISTRIBUTOR="$(sed 'srelease .*$,,g' /etc/system-release)+GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` 
-GRUB_DEFAULT=saved +GRUB_CMDLINE_LINUX_DEFAULT="quiet" 
-GRUB_DISABLE_SUBMENU=true +GRUB_CMDLINE_LINUX="" 
-GRUB_TERMINAL_OUTPUT="console" + 
-GRUB_CMDLINE_LINUX="crashkernel=auto resume=UUID=c8bb3f47-d67f-4b21-b781-766899dc83d4 rhgb quiet+# Uncomment to enable BadRAM filtering, modify to suit your needs 
-GRUB_DISABLE_RECOVERY="true" +# This works with Linux (no patch required) and with any kernel that obtains 
-GRUB_ENABLE_BLSCFG=true+# the memory map information from GRUB (GNU Machkernel of FreeBSD ...) 
 +#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef
 + 
 +# Uncomment to disable graphical terminal (grub-pc only) 
 +#GRUB_TERMINAL=console 
 + 
 +# The resolution used on graphical terminal 
 +# note that you can use only modes which your graphic card supports via VBE 
 +# you can see them in real GRUB with the command `vbeinfo' 
 +#GRUB_GFXMODE=640x480 
 + 
 +# Uncomment if you don't want GRUB to pass "root=UUID=xxxparameter to Linux 
 +#GRUB_DISABLE_LINUX_UUID=true 
 + 
 +# Uncomment to disable generation of recovery mode menu entries 
 +#GRUB_DISABLE_RECOVERY="true" 
 + 
 +# Uncomment to get a beep at grub start 
 +#GRUB_INIT_TUNE="480 440 1"
 </code> </code>
  
-<WRAP center round important 60%> +<WRAP center round important 60% > 
-**Important** : Notez que toute modification de ce fichier nécessite l'exécution de la commande **grub2-mkconfig** pour que les modifications soient prises en compte.+**Important** : Notez que toute modification de ce fichier nécessite l'exécution de la commande **grub-mkconfig** pour que les modifications soient prises en compte.
 </WRAP> </WRAP>
  
-Dans ce fichier les directives sont :+Dans ce fichier les directives les plus importantes sont :
  
 ^  Directive  ^ Description ^ ^  Directive  ^ Description ^
 +| GRUB_DEFAULT | Entrée du menu sélectionner par défaut |
 | GRUB_TIMEOUT | Durée de l'affichage du menu avant le démarrage en utilisant la valeur de GRUB_DEFAULT | | GRUB_TIMEOUT | Durée de l'affichage du menu avant le démarrage en utilisant la valeur de GRUB_DEFAULT |
 | GRUB_DISTRIBUTOR | Ligne de commande qui génère le texte de l'entrée | | GRUB_DISTRIBUTOR | Ligne de commande qui génère le texte de l'entrée |
-GRUB_DEFAULT Entrée du menu sélectionner par défaut | +GRUB_CMDLINE_LINUX_DEFAULT Paramètres passés au noyau lors d'un démarrage normal (Hors donc le mode secours) |
-| GRUB_DISABLE_SUBMENU | Active ou désactive les sous-menus de GRUB2 | +
-| GRUB_TERMINAL_OUTPUT | Spécifie le terminal par défaut |+
 | GRUB_CMDLINE_LINUX | Paramètres passés au noyau peu importe le type de démarrage | | GRUB_CMDLINE_LINUX | Paramètres passés au noyau peu importe le type de démarrage |
-GRUB_DISABLE_RECOVERY Active ou désactive la génération des entrées en mode **recovery** | +GRUB_BADRAM Permet de spécifier de la mémoire défaillante | 
-GRUB_BLSCFG Active ou désactive l'utilisation de la nouvelle spécification du gestionnaire de démarrage pour configurer celui-ci |+| GRUB_TERMINAL | Si non commentée, cette directive désactive le démarrage graphique | 
 +| GRUB_GFXMODE | Indique la résolution utilisée lors d'un démarrage graphique | 
 +| GRUB_DISABLE_LINUX_UUID | Si **true**, cette directive empêche l'utilisation de l'UUID de la partition | 
 +| GRUB_DISABLE_LINUX_RECOVERY | Si **true**, cette directive empêche la génération des entrées en mode **recovery** | 
 +GRUB_INIT_TUNE Permet d'obtenir un beep au démarrage de GRUB 2 |
  
 ===Les fichiers du répertoire /etc/grub.d=== ===Les fichiers du répertoire /etc/grub.d===
Ligne 642: Ligne 688:
  
 <code> <code>
-[root@centos8 ~] ls -l /etc/grub.d +root@debian11:~# ls -l /etc/grub.d 
-total 92 +total 80 
--rwxr-xr-x1 root root  8958 Mar  2 15:51 00_header +-rwxr-xr-x 1 root root 10046 Jul 11  2021 00_header 
--rwxr-xr-x1 root root  1043 Jun 15  2020 00_tuned +-rwxr-xr-x 1 root root  6260 Jul 11  2021 05_debian_theme 
--rwxr-xr-x1 root root   232 Mar  2 15:51 01_users +-rwxr-xr-x 1 root root 13664 Jul 11  2021 10_linux 
--rwxr-xr-x. 1 root root   832 Mar  2 15:51 08_fallback_counting +-rwxr-xr-x 1 root root 13726 Jul 11  2021 20_linux_xen 
--rwxr-xr-x. 1 root root 14088 Mar  2 15:51 10_linux +-rwxr-xr-x 1 root root 12059 Jul 11  2021 30_os-prober 
--rwxr-xr-x1 root root   830 Mar  2 15:51 10_reset_boot_success +-rwxr-xr-x 1 root root  1416 Jul 11  2021 30_uefi-firmware 
--rwxr-xr-x. 1 root root   889 Mar  2 15:51 12_menu_auto_hide +-rwxr-xr-x 1 root root   214 Jul 11  2021 40_custom 
--rwxr-xr-x. 1 root root 11696 Mar  2 15:51 20_linux_xen +-rwxr-xr-x 1 root root   216 Jul 11  2021 41_custom 
--rwxr-xr-x1 root root  2559 Mar  2 15:51 20_ppc_terminfo +-rw-r--r-- 1 root root   483 Jul 11  2021 README
--rwxr-xr-x. 1 root root 10670 Mar  2 15:51 30_os-prober +
--rwxr-xr-x1 root root  1412 Mar  2 15:51 30_uefi-firmware +
--rwxr-xr-x1 root root   214 Mar  2 15:51 40_custom +
--rwxr-xr-x1 root root   216 Mar  2 15:51 41_custom +
--rw-r--r--1 root root   483 Mar  2 15:51 README+
 </code> </code>
  
Ligne 666: Ligne 707:
   * **Les fichiers /etc/grub.d/40_custom et /etc/grub.d/41_custom**,   * **Les fichiers /etc/grub.d/40_custom et /etc/grub.d/41_custom**,
     * Ces deux fichiers sont fournis en tant que modèles à personnaliser.     * Ces deux fichiers sont fournis en tant que modèles à personnaliser.
- 
-===Le Fichier /boot/grub2/grubenv=== 
- 
-Le fichier **/boot/grub2/grubenv** contient l'entrée du menu sauvegardée, référencée par la directive **GRUB_DEFAULT** du fichier **/etc/default/grub** : 
- 
-<code> 
-[root@centos8 ~]# cat /boot/grub2/grubenv 
-# GRUB Environment Block 
-saved_entry=de79af4f226d480fa7d3fec4cabbf97a-4.18.0-240.22.1.el8_3.x86_64 
-kernelopts=root=UUID=4c0cc28c-0d59-45be-bd73-d292b80be33c ro crashkernel=auto resume=UUID=c8bb3f47-d67f-4b21-b781-766899dc83d4 rhgb quiet  
-boot_success=1 
-boot_indeterminate=0 
-########################################################################################################################################## 
-########################################################################################################################################## 
-########################################################################################################################################## 
-########################################################################################################################################## 
-########################################################################################################################################## 
-############################################################[root@centos8 ~]# 
-</code> 
  
 ===Modifier la Configuration de GRUB 2 en Ligne de Commande=== ===Modifier la Configuration de GRUB 2 en Ligne de Commande===
Ligne 699: Ligne 721:
   * **Crtl-X** : démarrer avec la configuration modifiée,   * **Crtl-X** : démarrer avec la configuration modifiée,
   * **echap** : abandonner les modifications et retourner à l'interface menu de GRUB 2.   * **echap** : abandonner les modifications et retourner à l'interface menu de GRUB 2.
 +
 +<WRAP center round important 60% >
 +**Important** : Certaines distributions, telle qu'Ubuntu, cache le menu de GRUB 2 derrière une interface graphique. Afin de voir ce menu, il convient d'appuyer sur la touche **Shift** pendant que la machine démarre.
 +</WRAP>
  
 ====Chargeurs de Démarrages Alternatifs==== ====Chargeurs de Démarrages Alternatifs====
Ligne 738: Ligne 764:
 Un Chargeur de Démarrage hybride, appelé **isodhpfx.bin**, qui peut être chargé sur un disque **ou** une clef USB. Le fichier isodhpfx.bin est créé avec le programme **xorriso**. Un Chargeur de Démarrage hybride, appelé **isodhpfx.bin**, qui peut être chargé sur un disque **ou** une clef USB. Le fichier isodhpfx.bin est créé avec le programme **xorriso**.
  
-====Initramfs sous RHEL/CentOS 6====+=====Initramfs sous RHEL/CentOS 6=====
  
 Un fichier Initramfs //%%INITial Ram File System%%// est une image d'un système minimal initialisée au démarrage du système. Un fichier Initramfs //%%INITial Ram File System%%// est une image d'un système minimal initialisée au démarrage du système.
Ligne 814: Ligne 840:
 </code> </code>
  
-<WRAP center round todo>+<WRAP center round todo 60%>
 **A faire** : Utilisez le manuel de la commande **cpio** pour comprendre les options utilisées. **A faire** : Utilisez le manuel de la commande **cpio** pour comprendre les options utilisées.
 </WRAP> </WRAP>
Ligne 855: Ligne 881:
 </code> </code>
  
-<WRAP center round todo>+<WRAP center round todo 60%>
 **A faire** : Passez en revue le contenu du script. **A faire** : Passez en revue le contenu du script.
 </WRAP> </WRAP>
Ligne 970: Ligne 996:
  
  
-<WRAP center round todo>+<WRAP center round todo 60%>
 **A faire** : **Re-démarrez votre machine pour tester votre configuration.** **A faire** : **Re-démarrez votre machine pour tester votre configuration.**
 </WRAP> </WRAP>
  
-====Initramfs sous CentOS 8====+=====Initramfs sous Debian 11=====
  
-Le fichier Initramfs //%%INITial Ram File System%%// est une archive au format cpio :+Le fichier Initramfs //%%INITial Ram File System%%// est une image d'un système minimal initialisée au démarrage du système. 
 + 
 +====LAB #1 - Travailler avec Initramfs 
 + 
 +===1.1 - Examiner l'image existante=== 
 + 
 +Pour examiner une image initramfs, il convient d'abord de la copier vers /tmp et de la décompresser :
  
 <code> <code>
-[root@centos8 ~]# cp /boot/initramfs-4.18.0-240.22.1.el8_3.x86_64.img /tmp/custom +root@debian11:~# cp /boot/initrd.img-5.10.0-13-amd64 /tmp/custom.gz 
-[root@centos8 ~]cd /tmp +root@debian11:~# gunzip /tmp/custom.gz  
-[root@centos8 tmp]# ls +</code>
-cpio.list +
-custom +
-dateref +
-incremental.tar +
-mbr.save +
-systemd-private-9af7a2f7444849578f55b306bfd9f820-chronyd.service-iQiNzF +
-tblpart.save +
-test.cpio +
-test.print +
-test.tar +
-tmp.iso +
-vg0_backup+
  
-[root@centos8 tmp]# mv custom custom.gz+Ensuite il convient d'extraire l'image grâce à la commande **cpio** : 
  
-[root@centos8 tmp]gunzip custom.gz+<code> 
 +root@debian11:~# cd /tmp 
 +root@debian11:/tmp# mkdir initrd 
 +root@debian11:/tmp# cd initrd 
 +root@debian11:/tmp/initrd# cpio -idvB < ../custom 
 +... 
 +var 
 +var/cache 
 +var/cache/fontconfig 
 +var/cache/fontconfig/2cf0bf67-ac23-47f4-9d76-913901374fea-le64.cache-7 
 +var/cache/fontconfig/42771ecd-ce02-464a-8263-bedea4e63b34-le64.cache-7 
 +var/cache/fontconfig/CACHEDIR.TAG 
 +var/cache/fontconfig/ce5f225d-fe60-43b7-ad9d-497d8ccce03f-le64.cache-7 
 +var/cache/fontconfig/f8222393-3a24-44e9-bff6-c3f977041ad4-le64.cache-7 
 +31991 blocks 
 +</code>
  
-[root@centos8 tmp]# mkdir initramfs+Installez maintenant le paquet **tree** : 
  
-[root@centos8 tmp]cd initramfs+<code> 
 +root@debian11:/tmp/initrdapt-get -y install tree 
 +</code>
  
-[root@centos8 initramfs]cpio -cid -I ../custom +Utilisez maintenant la commande **tree** pour examiner le contenu de l'image : 
-216 blocks + 
-[root@centos8 initramfs]# ls +<code> 
-bin  dev  etc  init  lib  lib64  proc  root  run  sbin  shutdown  sys  sysroot  tmp  usr  var+root@debian11:/tmp/initrdtree | more 
 +
 +├── bin -> usr/bin 
 +├── conf 
 +│   ├── arch.conf 
 +│   ├── conf.d 
 +│   │   └── resume 
 +│   └── initramfs.conf 
 +├── cryptroot 
 +│   └── crypttab 
 +├── etc 
 +│   ├── console-setup 
 +│   │   ├── cached_UTF-8_del.kmap 
 +│   │   └── null 
 +│   ├── default 
 +│   │   └── keyboard 
 +│   ├── fonts 
 +│   │   ├── conf.d 
 +│   │   │   └── 60-latin.conf 
 +│   │   └── fonts.conf 
 +│   ├── fstab 
 +│   ├── ld.so.cache 
 +│   ├── ld.so.conf 
 +│   ├── ld.so.conf.d 
 +│   │   ├── libc.conf 
 +│   │   └── x86_64-linux-gnu.conf 
 +│   ├── lvm 
 +│   │   ├── archive 
 +│   │   │   ├── vg0_00000-267942700.vg 
 +│   │   │   ├── vg0_00001-854434220.vg 
 +│   │   │   ├── vg0_00002-520659205.vg 
 +│   │   │   ├── vg0_00003-1606608177.vg 
 +│   │   │   ├── vg0_00004-458787361.vg 
 +│   │   │   ├── vg0_00005-1786773709.vg 
 +│   │   │   ├── vg0_00006-196117920.vg 
 +│   │   │   ├── vg0_00007-2024993792.vg 
 +│   │   │   ├── vg0_00008-297779072.vg 
 +│   │   │   ├── vg0_00009-1557237202.vg 
 +│   │   │   ├── vg0_00010-550024633.vg 
 +│   │   │   ├── vg0_00011-155655591.vg 
 +│   │   │   └── vg0_00012-1101644815.vg 
 +│   │   ├── backup 
 +│   │   │   └── vg0 
 +│   │   ├── lvm.conf 
 +│   │   ├── lvmlocal.conf 
 +│   │   └── profile 
 +│   │       ├── cache-mq.profile 
 +│   │       ├── cache-smq.profile 
 +│   │       ├── command_profile_template.profile 
 +│   │       ├── lvmdbusd.profile 
 +│   │       ├── metadata_profile_template.profile 
 +│   │       ├── thin-generic.profile 
 +│   │       ├── thin-performance.profile 
 +│   │       └── vdo-small.profile 
 +│   ├── modprobe.d 
 +│   ├── motd 
 +│   ├── mtab -> /proc/mounts 
 +│   ├── nsswitch.conf 
 +│   ├── os-release 
 +--More-- 
 +[q]
 </code> </code>
  
-===Examiner l'image existante===+Comme vous pouvez le constater, l'image contient une arborescence Linux minimaliste :
  
-Pour examiner une image initramfs archivée, il convient d'utiliser la commande **lsinitrd** :+<code> 
 +root@debian11:/tmp/initrd# ls -l 
 +total 36 
 +lrwxrwxrwx  1 root root    7 Apr 30 11:02 bin -> usr/bin 
 +drwxr-xr-x  3 root root 4096 Apr 30 11:02 conf 
 +drwxr-xr-x  2 root root 4096 Apr 30 11:02 cryptroot 
 +drwxr-xr-x 10 root root 4096 Apr 30 11:02 etc 
 +-rwxr-xr-x  1 root root 6301 Apr 30 11:02 init 
 +lrwxrwxrwx  1 root root    7 Apr 30 11:02 lib -> usr/lib 
 +lrwxrwxrwx  1 root root    9 Apr 30 11:02 lib32 -> usr/lib32 
 +lrwxrwxrwx  1 root root    9 Apr 30 11:02 lib64 -> usr/lib64 
 +lrwxrwxrwx  1 root root   10 Apr 30 11:02 libx32 -> usr/libx32 
 +drwxr-xr-x  2 root root 4096 Apr 30 11:02 run 
 +lrwxrwxrwx  1 root root    8 Apr 30 11:02 sbin -> usr/sbin 
 +drwxr-xr-x 10 root root 4096 Apr 30 11:02 scripts 
 +drwxr-xr-x 10 root root 4096 Apr 30 11:02 usr 
 +drwxr-xr-x  3 root root 4096 Apr 30 11:02 var 
 +</code> 
 + 
 +Le script **init** est lancé lors du chargement de l'image :
  
 <code> <code>
-[root@centos8 tmp]lsinitrd custom | more +root@debian11:/tmp/initrd# more init 
-Image: custom: 25M +#!/bin/sh
-======================================================================== +
-Early CPIO image +
-======================================================================== +
-drwxr-xr-x   3 root     root            0 Feb 22 10:57 . +
--rw-r--r--   1 root     root            2 Feb 22 10:57 early_cpio +
-drwxr-xr-x   3 root     root            0 Feb 22 10:57 kernel +
-drwxr-xr-x   3 root     root            0 Feb 22 10:57 kernel/x86 +
-drwxr-xr-x   2 root     root            0 Feb 22 10:57 kernel/x86/microcode +
--rw-r--r--   1 root     root       109568 Feb 22 10:57 kernel/x86/microcode/GenuineIntel.bin +
-======================================================================== +
-Version: dracut-049-95.git20200804.el8_3.4+
  
-Arguments: -f --kver '4.18.0-240.22.1.el8_3.x86_64'+# Default PATH differs between shells, and is not automatically exported 
 +# by klibc dash Make it consistent. 
 +export PATH=/sbin:/usr/sbin:/bin:/usr/bin
  
-dracut modules: +[ -d /dev ] || mkdir -m 0755 /dev 
-bash +[ -d /root ] || mkdir -m 0700 /root 
-systemd +-d /sys ] || mkdir /sys 
-systemd-initrd +-d /proc ] || mkdir /proc 
-nss-softokn +-d /tmp ] || mkdir /tmp 
-rngd +mkdir -p /var/lock 
-i18n +mount -t sysfs -o nodev,noexec,nosuid sysfs /sys 
-network-legacy +mount -t proc -o nodev,noexec,nosuid proc /proc 
-network + 
-ifcfg +# shellcheck disable=SC2013 
-drm +for x in $(cat /proc/cmdline); do 
-plymouth +        case $x in 
-prefixdevname +        initramfs.clear) 
-kernel-modules +                clear 
-kernel-modules-extra +                ;; 
-kernel-network-modules +        quiet) 
-resume +                quiet=y 
-rootfs-block +                ;; 
-terminfo +        esac 
-udev-rules +done 
-biosdevname + 
-dracut-systemd +if [ "$quiet" !"y" ]; then 
-usrmount +        quiet=n 
-base +        echo "Loading, please wait..." 
-fs-lib +fi 
-memstrack +export quiet 
-microcode_ctl-fw_dir_override + 
-shutdown +# Note that this only becomes /dev on the real filesystem if udev's scripts 
-======================================================================== +# are used; which they will bebut it's worth pointing out 
-drwxr-xr-x  12 root     root            0 Feb 22 10:57 +mount -t devtmpfs -o nosuid,mode=0755 udev /dev 
-crw-r--r--   1 root     root       5,   1 Feb 22 10:57 dev/console +mkdir /dev/pts 
-crw-r--r--   1 root     root       1 11 Feb 22 10:57 dev/kmsg +mount -t devpts -o noexec,nosuid,gid=5,mode=0620 devpts /dev/pts || true 
-crw-r--r--   1 root     root       1  3 Feb 22 10:57 dev/null + 
-crw-r--r--   1 root     root       1,   8 Feb 22 10:57 dev/random +# Export the dpkg architecture 
-crw-r--r--   1 root     root       1  9 Feb 22 10:57 dev/urandom +export DPKG_ARCH= 
-lrwxrwxrwx   1 root     root            7 Feb 22 10:57 bin -> usr/bin +/conf/arch.conf 
-drwxr-xr-x   2 root     root            0 Feb 22 10:57 dev + 
-drwxr-xr-x  11 root     root            0 Feb 22 10:57 etc +# Set modprobe env 
--rw-r--r--   1 root     root           30 Nov 10  2020 etc/centos-release +export MODPROBE_OPTIONS="-qb" 
-drwxr-xr-x   2 root     root            0 Feb 22 10:57 etc/cmdline.d + 
-drwxr-xr-x   2 root     root            0 Feb 22 10:57 etc/conf.d +# Export relevant variables 
--rw-r--r--   1 root     root          124 Feb 22 10:57 etc/conf.d/systemd.conf +export ROOT= 
---More--+export ROOTDELAY= 
 +export ROOTFLAGS= 
 +export ROOTFSTYPE= 
 +export IP= 
 +export DEVICE= 
 +export BOOT= 
 +export BOOTIF= 
 +export UBIMTD= 
 +export break= 
 +export init=/sbin/init 
 +--More--(19%)
 </code> </code>
  
-===Le script init===+<WRAP center round todo 60%> 
 +**A faire** : Passez en revue le contenu du script. 
 +</WRAP> 
 + 
 +===1.2 - La commande mkinitramfs===
  
-RHEL/CentOS 8 utilise le système de démarrage **systemd**. Pour cette raison le script init est un lien symbolique vers **/usr/lib/systemd/systemd** :+La commande **mkinitramfs** permet de créer facilement une image initramfsLes options de la commande sont :
  
 <code> <code>
-[root@centos8 tmp]lsinitrd custom | grep usr/lib/systemd/systemd | grep init +root@debian11:~mkinitramfs --help 
-lrwxrwxrwx   1 root     root           23 Feb 22 10:57 init -> usr/lib/systemd/systemd+ 
 +Usagemkinitramfs [option]... -o outfile [version] 
 + 
 +Options: 
 +  -c compress   Override COMPRESS setting in initramfs.conf. 
 +  -d confdir    Specify an alternative configuration directory. 
 +  -k            Keep temporary directory used to make the image. 
 +  -o outfile    Write to outfile. 
 +  -r root       Override ROOT setting in initramfs.conf. 
 + 
 +See mkinitramfs(8) for further details.
 </code> </code>
  
-===Consulter le contenu d'un fichier dans initramfs===+Le fichier de configuration de mkinitramfs est **/etc/initramfs-tools/modules**. Editez ce fichier pour spécifier des modules noyau supplémentaires à inclure dans le fichier image générée :
  
-Pour consulter le contenu d'un fichier inclus dans l'initramfs, il convient d'utiliser la commande **lsinitrd** de la manière suivante :+<code> 
 +root@debian11:/tmp/initrd# vi /etc/initramfs-tools/modules 
 +root@debian11:/tmp/initrd# cat /etc/initramfs-tools/modules 
 +# List of modules that you want to include in your initramfs. 
 +# They will be loaded at boot time in the order below. 
 +
 +# Syntax:  module_name [args ...] 
 +
 +# You must run update-initramfs(8) to effect this change. 
 +
 +# Examples: 
 +
 +# raid1 
 +# sd_mod 
 +usbcore 
 +uhci 
 +ehci-hcd 
 +usb-ohci 
 +usb-uhci 
 +usb-storage 
 +scsi_mod 
 +sd_mod 
 +</code> 
 + 
 +Exécutez maintenant la commande suivante afin de générer le fichier **usbinitramfs** :
  
 <code> <code>
-[root@centos8 tmp]lsinitrd /boot/initramfs-$(uname -r).img  /etc/ld.so.conf +root@debian11:/tmp/initrdmkinitramfs -o usbinitramfs-`uname -r`.img
-include ld.so.conf.d/*.conf+
 </code> </code>
  
-====Processus de Démarrage du Noyau Linux====+Notez la présence de votre nouvelle image **/tmp/initrd/usbinitramfs** : 
 + 
 +<code> 
 +root@debian11:/tmp/initrd# ls -l /tmp/initrd/usbinitramfs-5.10.0-13-amd64.img  
 +-rw-r--r-- 1 root root 47695493 Apr 30 11:12 /tmp/initrd/usbinitramfs-5.10.0-13-amd64.img 
 +</code> 
 + 
 +Déplacez votre fichier usbinitramfs au répertoire /boot : 
 + 
 +<code> 
 +root@debian11:/tmp/initrd# mv usbinitramfs-5.10.0-13-amd64.img /boot 
 +</code> 
 + 
 +Créez maintenant le fichier **/etc/grub.d/09_usbdebian** : 
 + 
 +<code> 
 +root@debian11:/tmp/initrd# vi /etc/grub.d/09_usbdebian 
 +root@debian11:/tmp/initrd# cat /etc/grub.d/09_usbdebian 
 +#!/bin/sh -e 
 +cat << EOF 
 +menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-9887a74f-a680-4bde-8f04-db5ae9ea186e'
 +        load_video 
 +        insmod gzio 
 +        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi 
 +        insmod part_msdos 
 +        insmod ext2 
 +        set root='hd0,msdos1' 
 +        if [ x$feature_platform_search_hint = xy ]; then 
 +          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  9887a74f-a680-4bde-8f04-db5ae9ea186e 
 +        else 
 +          search --no-floppy --fs-uuid --set=root 9887a74f-a680-4bde-8f04-db5ae9ea186e 
 +        fi 
 +        echo    'Loading Linux 5.10.0-13-amd64 ...' 
 +        linux   /boot/vmlinuz-5.10.0-13-amd64 root=UUID=9887a74f-a680-4bde-8f04-db5ae9ea186e ro  quiet 
 +        echo    'Loading initial ramdisk ...' 
 +        initrd  /boot/usbinitramfs-5.10.0-13-amd64.img 
 +
 +EOF 
 +</code> 
 + 
 +Rendez ce fichier exécutable : 
 + 
 +<code> 
 +root@debian11:/tmp/initrd# chmod +x /etc/grub.d/09_usbdebian 
 +</code> 
 + 
 +Mettez à jour grub afin que celui-ci prend en compte le nouveau fichier : 
 + 
 +<code> 
 +root@debian11:/tmp/initrd# grub-mkconfig -o /boot/grub/grub.cfg 
 +Generating grub configuration file ... 
 +Found background image: /usr/share/images/desktop-base/desktop-grub.png 
 +Found linux image: /boot/vmlinuz-5.10.0-13-amd64 
 +Found initrd image: /boot/initrd.img-5.10.0-13-amd64 
 +done 
 +</code> 
 + 
 +Controlez le fichier /boot/grub/grub.cfg : 
 + 
 +<file> 
 +... 
 +### END /etc/grub.d/05_debian_theme ### 
 + 
 +### BEGIN /etc/grub.d/09_usbdebian ### 
 +menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os  'gnulinux-simple-9887a74f-a680-4bde-8f04-db5ae9ea186e'
 +        load_video 
 +        insmod gzio 
 +        if [ x = xxen ]; then insmod xzio; insmod lzopio; fi 
 +        insmod part_msdos 
 +        insmod ext2 
 +        set root='hd0,msdos1' 
 +        if [ x = xy ]; then 
 +          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  9887a74f-a680-4bde-8f04-db5ae9ea186e 
 +        else 
 +          search --no-floppy --fs-uuid --set=root 9887a74f-a680-4bde-8f04-db5ae9ea186e 
 +        fi 
 +        echo    'Loading Linux 5.10.0-13-amd64 ...' 
 +        linux   /boot/vmlinuz-5.10.0-13-amd64 root=UUID=9887a74f-a680-4bde-8f04-db5ae9ea186e ro  quiet 
 +        echo    'Loading initial ramdisk ...' 
 +        initrd  /boot/usbinitramfs-5.10.0-13-amd64.img 
 +
 +### END /etc/grub.d/09_usbdebian ### 
 + 
 +### BEGIN /etc/grub.d/10_linux ### 
 +... 
 +</file> 
 + 
 +=====Processus de Démarrage du Noyau Linux=====
  
 Le processus de démarrage du Noyau Linux peut être divisé en 6 étapes : Le processus de démarrage du Noyau Linux peut être divisé en 6 étapes :
Ligne 1114: Ligne 1355:
 Dans le cas d'un échec à ce stade le message **Kernel Panic** sera affiché. Dans le cas d'un échec à ce stade le message **Kernel Panic** sera affiché.
  
-====Processus Init====+=====Processus Init=====
  
 Le premier processus lancé par le noyau est **Init**. L'exécutable lancé est **/sbin/init**. Son rôle est de d'initialiser le système et de lancer certains autres services. Les tâches accomplies par init sont : Le premier processus lancé par le noyau est **Init**. L'exécutable lancé est **/sbin/init**. Son rôle est de d'initialiser le système et de lancer certains autres services. Les tâches accomplies par init sont :
Ligne 1345: Ligne 1586:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60% >
 **Important** : Notez que chaque répertoire correspondant à un niveau d'exécution contient des liens pointant vers un script dans le répertoire **/etc/init.d**. La lettre **S** indique au script **rc** que le script dans **/etc/rc.d/init.d** doit être exécutée avec l'option **start**. De cette façon les processus sont lancés dans le niveau d'exécution spécifié. Le numéro qui suit la lettre **S** indique l'ordre de lancement par le script **rc**. Si deux scripts dans un répertoire **/etc/rc.d/rcX.d** ont le même numéro, l'ordre alphabétique prime. Notez aussi la présence du lien **S99local** qui lance le script **rc.local** en dernier. Le script rc.local est lancé dans les niveaux d'exécution **2, 3, 4 et 5**. C'est dans ce script que **root** peut ajouter des commandes. **Important** : Notez que chaque répertoire correspondant à un niveau d'exécution contient des liens pointant vers un script dans le répertoire **/etc/init.d**. La lettre **S** indique au script **rc** que le script dans **/etc/rc.d/init.d** doit être exécutée avec l'option **start**. De cette façon les processus sont lancés dans le niveau d'exécution spécifié. Le numéro qui suit la lettre **S** indique l'ordre de lancement par le script **rc**. Si deux scripts dans un répertoire **/etc/rc.d/rcX.d** ont le même numéro, l'ordre alphabétique prime. Notez aussi la présence du lien **S99local** qui lance le script **rc.local** en dernier. Le script rc.local est lancé dans les niveaux d'exécution **2, 3, 4 et 5**. C'est dans ce script que **root** peut ajouter des commandes.
 </WRAP> </WRAP>
Ligne 1370: Ligne 1611:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60% >
 **Important** : Ici le principe est le même sauf que la lettre **K** indique au script **rc** que le script dans **/etc/rc.d/init.d** doit être lancé avec l'option **stop**. **Important** : Ici le principe est le même sauf que la lettre **K** indique au script **rc** que le script dans **/etc/rc.d/init.d** doit être lancé avec l'option **stop**.
 </WRAP> </WRAP>
Ligne 1827: Ligne 2068:
   # update-rc.d ssh start 20 2 3 4 5 . stop 20 0 1 6 . [Entrée]   # update-rc.d ssh start 20 2 3 4 5 . stop 20 0 1 6 . [Entrée]
  
-<WRAP center round important>+<WRAP center round important 60% >
 **Important** :  **Important** : 
 Il existe aussi un mot clef : **default**. Ce mot clef indique à **update-rc.d** d'utiliser les valeurs spécifiées dans la command précédente. Il existe aussi un mot clef : **default**. Ce mot clef indique à **update-rc.d** d'utiliser les valeurs spécifiées dans la command précédente.
Ligne 1836: Ligne 2077:
   # update-rc.d -f ssh remove [Entrée]   # update-rc.d -f ssh remove [Entrée]
  
-<WRAP center round important>+<WRAP center round important 60% >
 **Important** :  **Important** : 
 Cette commande laisse le script ssh dans le répertoire /etc/init.d. Cette commande laisse le script ssh dans le répertoire /etc/init.d.
Ligne 2080: Ligne 2321:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60% >
 **Important** : Notez qu'à part la deuxième ligne de la description, chaque ligne **doit** commencer par le caractère **#** suivi par un espace. **Important** : Notez qu'à part la deuxième ligne de la description, chaque ligne **doit** commencer par le caractère **#** suivi par un espace.
 </WRAP> </WRAP>
Ligne 2597: Ligne 2838:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60% >
 Il est aussi possible d'utiliser les commandes **initctl start**, **initctl stop** et **initctl restart** pour gérer les jobs. Il est aussi possible d'utiliser les commandes **initctl start**, **initctl stop** et **initctl restart** pour gérer les jobs.
 </WRAP> </WRAP>
Menu