github.com/canonical/ubuntu-image@v0.0.0-20240430122802-2202fe98b290/internal/statemachine/testdata/gadget_tree/grub-cpc.cfg (about)

     1  # CLOUD_IMG: This file was created/modified by the Cloud Image build process
     2  #
     3  # DO NOT EDIT THIS FILE
     4  #
     5  # It is automatically generated by grub-mkconfig using templates
     6  # from /etc/grub.d and settings from /etc/default/grub
     7  #
     8  
     9  ### BEGIN /etc/grub.d/00_header ###
    10  if [ -s $prefix/grubenv ]; then
    11    set have_grubenv=true
    12    load_env
    13  fi
    14  if [ "${next_entry}" ] ; then
    15     set default="${next_entry}"
    16     set next_entry=
    17     save_env next_entry
    18     set boot_once=true
    19  else
    20     set default="0"
    21  fi
    22  
    23  if [ x"${feature_menuentry_id}" = xy ]; then
    24    menuentry_id_option="--id"
    25  else
    26    menuentry_id_option=""
    27  fi
    28  
    29  export menuentry_id_option
    30  
    31  insmod part_gpt
    32  
    33  if [ "${prev_saved_entry}" ]; then
    34    set saved_entry="${prev_saved_entry}"
    35    save_env saved_entry
    36    set prev_saved_entry=
    37    save_env prev_saved_entry
    38    set boot_once=true
    39  fi
    40  
    41  function savedefault {
    42    if [ -z "${boot_once}" ]; then
    43      saved_entry="${chosen}"
    44      save_env saved_entry
    45    fi
    46  }
    47  function recordfail {
    48    set recordfail=1
    49    if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
    50  }
    51  function load_video {
    52    if [ x$feature_all_video_module = xy ]; then
    53      insmod all_video
    54    else
    55      insmod efi_gop
    56      insmod efi_uga
    57      insmod ieee1275_fb
    58      insmod vbe
    59      insmod vga
    60      insmod video_bochs
    61      insmod video_cirrus
    62    fi
    63  }
    64  
    65  terminal_input console
    66  terminal_output console
    67  if [ "${recordfail}" = 1 ] ; then
    68    set timeout=0
    69  else
    70    if [ x$feature_timeout_style = xy ] ; then
    71      set timeout_style=hidden
    72      set timeout=0
    73    # Fallback hidden-timeout code in case the timeout_style feature is
    74    # unavailable.
    75    elif sleep --interruptible 0 ; then
    76      set timeout=0
    77    fi
    78  fi
    79  ### END /etc/grub.d/00_header ###
    80  
    81  ### BEGIN /etc/grub.d/05_debian_theme ###
    82  set menu_color_normal=white/black
    83  set menu_color_highlight=black/light-gray
    84  ### END /etc/grub.d/05_debian_theme ###
    85  
    86  ### BEGIN /etc/grub.d/10_linux ###
    87  function gfxmode {
    88  	set gfxpayload="${1}"
    89  	if [ "${1}" = "keep" ]; then
    90  		set vt_handoff=vt.handoff=7
    91  	else
    92  		set vt_handoff=
    93  	fi
    94  }
    95  if [ "${recordfail}" != 1 ]; then
    96    if [ -e ${prefix}/gfxdenylist.txt ]; then
    97      if hwmatch ${prefix}/gfxdenylist.txt 3; then
    98        if [ ${match} = 0 ]; then
    99          set linux_gfx_mode=keep
   100        else
   101          set linux_gfx_mode=text
   102        fi
   103      else
   104        set linux_gfx_mode=text
   105      fi
   106    else
   107      set linux_gfx_mode=keep
   108    fi
   109  else
   110    set linux_gfx_mode=text
   111  fi
   112  export linux_gfx_mode
   113  set label="writable"
   114  menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os {
   115      recordfail
   116      load_video
   117      gfxmode $linux_gfx_mode
   118      insmod gzio
   119      if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
   120      insmod ext2
   121      set root='hd0,gpt3'
   122      search --label $label --set=writable
   123          linux  /vmlinuz root=LABEL=$label ro console=tty1 console=ttyS0
   124      initrd  /initrd.img
   125  }
   126  submenu 'Advanced options for Ubuntu' {
   127  	menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os {
   128              recordfail
   129              load_video
   130              gfxmode $linux_gfx_mode
   131              insmod gzio
   132              if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
   133              insmod ext2
   134              set root='hd0,gpt3'
   135              search --label $label --set=writable
   136              echo    'Loading Linux 4.4.0-93-generic ...'
   137                  linux   /system-data/vmlinuz root=LABEL=$label ro  console=tty1 console=ttyS0
   138              echo    'Loading initial ramdisk ...'
   139              initrd  /system-data/initrd.img
   140      }
   141  	menuentry 'Ubuntu (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
   142              recordfail
   143              load_video
   144              insmod gzio
   145              if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
   146              insmod ext2
   147              set root='hd0,gpt3'
   148              search --label $label --set=writable
   149              echo    'Loading Linux 4.4.0-93-generic ...'
   150                  linux   /system-data/vmlinuz root=LABEL=$label ro recovery nomodeset 
   151              echo    'Loading initial ramdisk ...'
   152              initrd  /system-data/initrd.img
   153  	}
   154  }
   155  
   156  ### END /etc/grub.d/10_linux ###
   157  
   158  ### BEGIN /etc/grub.d/20_linux_xen ###
   159  
   160  ### END /etc/grub.d/20_linux_xen ###
   161  
   162  ### BEGIN /etc/grub.d/30_os-prober ###
   163  ### END /etc/grub.d/30_os-prober ###
   164  
   165  ### BEGIN /etc/grub.d/30_uefi-firmware ###
   166  ### END /etc/grub.d/30_uefi-firmware ###
   167  
   168  ### BEGIN /etc/grub.d/40_custom ###
   169  # This file provides an easy way to add custom menu entries.  Simply type the
   170  # menu entries you want to add after this comment.  Be careful not to change
   171  # the 'exec tail' line above.
   172  ### END /etc/grub.d/40_custom ###
   173  
   174  ### BEGIN /etc/grub.d/41_custom ###
   175  if [ -f  ${config_directory}/custom.cfg ]; then
   176    source ${config_directory}/custom.cfg
   177  elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
   178    source $prefix/custom.cfg;
   179  fi
   180  ### END /etc/grub.d/41_custom ###