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

     1  set default=0
     2  set timeout=3
     3  
     4  insmod part_gpt
     5  insmod ext2
     6  
     7  if [ -s $prefix/grubenv ]; then
     8    load_env
     9  fi
    10  
    11  if [ "$snap_mode" = "try" ]; then
    12      # a new core or kernel got installed
    13      set snap_mode="trying"
    14      save_env snap_mode
    15  
    16      if [ x"$snap_try_core" != x"" ]; then
    17          set snap_core="$snap_try_core"
    18      fi
    19      if [ x"$snap_try_kernel" != x"" ]; then
    20          set snap_kernel="$snap_try_kernel"
    21      fi
    22  elif [ "$snap_mode" = "trying" ]; then
    23      # nothing cleared the "trying snap" so the boot failed
    24      # we clear the mode and boot normally
    25      set snap_mode=""
    26      save_env snap_mode
    27  fi
    28  
    29  set label="writable"
    30  set cmdline="root=LABEL=$label snap_core=$snap_core snap_kernel=$snap_kernel ro net.ifnames=0 init=/lib/systemd/systemd console=ttyS0 console=tty1 panic=-1"
    31  
    32  menuentry "Ubuntu Core 16" {
    33      search --label $label --set=writable
    34      loopback loop ($writable)/system-data/var/lib/snapd/snaps/$snap_kernel
    35      linux (loop)/kernel.img $cmdline
    36      initrd (loop)/initrd.img
    37  }