Projet

Général

Profil

Tâche #35063

Scénario #34897: EOLE 2.9 : le menu grub devrait s'afficher dès le premier reboot

Étude

Ajouté par Benjamin Bohard il y a plus d'un an. Mis à jour il y a environ un an.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Début:
01/10/2022
Echéance:
% réalisé:

100%

Restant à faire (heures):
0.0

Historique

#1 Mis à jour par Benjamin Bohard il y a plus d'un an

  • Statut changé de Nouveau à En cours

#2 Mis à jour par Benjamin Bohard il y a plus d'un an

Contenu du grub.cfg après installation d’un eolebase

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${initrdfail}" = 2 ]; then
   set initrdfail=
elif [ "${initrdfail}" = 1 ]; then
   set next_entry="${prev_entry}" 
   set prev_entry=
   save_env prev_entry
   if [ "${next_entry}" ]; then
      set initrdfail=2
   fi
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}" 
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="${saved_entry}" 
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id" 
else
  menuentry_id_option="" 
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}" 
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}" 
    save_env saved_entry
  fi
}
function initrdfail {
    if [ -n "${have_grubenv}" ]; then if [ -n "${partuuid}" ]; then
      if [ -z "${initrdfail}" ]; then
        set initrdfail=1
        if [ -n "${boot_once}" ]; then
          set prev_entry="${default}" 
          save_env prev_entry
        fi
      fi
      save_env initrdfail
    fi; fi
}
function recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod lvm
insmod ext2
set root='lvmid/QpkyAH-CR1E-NMzu-nXqN-w2Od-evM7-RK57Z8/KqAdRk-igSn-fRlF-GwjQ-nkp2-qc8f-ohnUKR'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint='lvmid/QpkyAH-CR1E-NMzu-nXqN-w2Od-evM7-RK57Z8/KqAdRk-igSn-fRlF-GwjQ-nkp2-qc8f-ohnUKR'  6a319ab8-8b91-4ab6-90f1-17eb6b3d3c83
else
  search --no-floppy --fs-uuid --set=root 6a319ab8-8b91-4ab6-90f1-17eb6b3d3c83
fi
    font="/usr/share/grub/unicode.pf2" 
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=fr_FR
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=30
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
    set timeout=0
  # Fallback normal timeout code in case the timeout_style feature is
  # unavailable.
  else
    set timeout=0
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
        set gfxpayload="${1}" 
        if [ "${1}" = "keep" ]; then
                set vt_handoff=vt.handoff=7
        else
                set vt_handoff=
        fi
}
if [ "${recordfail}" != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if [ ${grub_platform} != pc ]; then
      set linux_gfx_mode=keep
    elif hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'EOLE GNU/Linux' --class eole --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-6a319ab8-8b91-4ab6-90f1-17eb6b3d3c83' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        search --no-floppy --fs-uuid --set=root b66aef75-2a92-414a-b0c7-5f3839448c4b
        linux   /vmlinuz-5.15.0-53-generic root=/dev/mapper/eolebase--vg-root ro rootdelay=90 
        initrd  /initrd.img-5.15.0-53-generic
}
submenu 'Advanced options for EOLE GNU/Linux' $menuentry_id_option 'gnulinux-advanced-6a319ab8-8b91-4ab6-90f1-17eb6b3d3c83' {
        menuentry 'EOLE GNU/Linux, with Linux 5.15.0-53-generic' --class eole --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.0-53-generic-advanced-6a319ab8-8b91-4ab6-90f1-17eb6b3d3c83' {
                recordfail
                load_video
                gfxmode $linux_gfx_mode
                insmod gzio
                if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root b66aef75-2a92-414a-b0c7-5f3839448c4b
                echo    'Loading Linux 5.15.0-53-generic ...'
                linux   /vmlinuz-5.15.0-53-generic root=/dev/mapper/eolebase--vg-root ro rootdelay=90 
                echo    'Loading initial ramdisk ...'
                initrd  /initrd.img-5.15.0-53-generic
        }
        menuentry 'EOLE GNU/Linux, with Linux 5.15.0-53-generic (recovery mode)' --class eole --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.0-53-generic-recovery-6a319ab8-8b91-4ab6-90f1-17eb6b3d3c83' {
                recordfail
                load_video
                insmod gzio
                if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root b66aef75-2a92-414a-b0c7-5f3839448c4b
                echo    'Loading Linux 5.15.0-53-generic ...'
                linux   /vmlinuz-5.15.0-53-generic root=/dev/mapper/eolebase--vg-root ro recovery nomodeset dis_ucode_ldr rootdelay=90
                echo    'Loading initial ramdisk ...'
                initrd  /initrd.img-5.15.0-53-generic
        }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/10_linux_zfs ###
### END /etc/grub.d/10_linux_zfs ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
        fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/35_fwupd ###
### END /etc/grub.d/35_fwupd ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###

### BEGIN /etc/grub.d/90_eole_default_kernel ###
### END /etc/grub.d/90_eole_default_kernel ###

#3 Mis à jour par Benjamin Bohard il y a plus d'un an

Le fichier autoinstall.yaml utilise les paramètres suivants pour le module debconf-selections :
  • grub-pc grub-pc/timeout string 6
  • grub-pc grub-pc/hidden_timeout boolean false
  • grub-pc grub2/linux_cmdline string rootdelay=90

Cependant, grub-pc est la version de grub pour BIOS et n’est pas installé. Ces options ne semblent utilisées par aucun autre paquet grub que grub-pc.

#4 Mis à jour par Benjamin Bohard il y a plus d'un an

Un exemple intéressant dans la documentation de subiquity (https://github.com/canonical/subiquity/blob/main/documentation/autoinstall.md) :

late-commands:
    - sed -ie 's/GRUB_TIMEOUT=.\*/GRUB_TIMEOUT=30/' /target/etc/default/grub

Après différentes tentatives infructueuses utilisant debconf-selections et l’installation de grub-pc, la modification avec sed semble bien être la manière de faire.

#5 Mis à jour par Benjamin Bohard il y a plus d'un an

La commande sed en late-commands ne semble pas fonctionnelle, soit que le fichier édité n’est pas le bon, soit qu’il est écrasé avec la version par défaut dans une étape ultérieure, soit que la syntaxe n’est pas bonne…

sed -ie 's/GRUB_TIMEOUT=.*/GRUB_TIMEOUT=30/' /target/etc/default/grub

#7 Mis à jour par Benjamin Bohard il y a plus d'un an

L’option qui est déterminante est GRUB_TIMOUT et n’est pas géré dans le postinst.
On plus de sed, il faut penser à regénérer la configuration avec update-grub.

#8 Mis à jour par Benjamin Bohard il y a plus d'un an

  • Statut changé de En cours à À valider

#9 Mis à jour par Benjamin Bohard il y a plus d'un an

  • % réalisé changé de 0 à 100

#10 Mis à jour par Joël Cuissinat il y a plus d'un an

  • Statut changé de À valider à Fermé
  • Restant à faire (heures) mis à 0.0

Formats disponibles : Atom PDF