changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > infra > box / grub/loopback.cfg

changeset 1: 862c7d765472
author: Richard Westhaver <ellis@rwest.io>
date: Fri, 31 May 2024 16:44:48 -0400
permissions: -rw-r--r--
description: baseline init
1 # https://www.supergrubdisk.org/wiki/Loopback.cfg
2 
3 # Search for the ISO volume
4 search --no-floppy --set=archiso_img_dev --file "${iso_path}"
5 probe --set archiso_img_dev_uuid --fs-uuid "${archiso_img_dev}"
6 
7 # Get a human readable platform identifier
8 if [ "${grub_platform}" == 'efi' ]; then
9  archiso_platform='UEFI'
10  if [ "${grub_cpu}" == 'x86_64' ]; then
11  archiso_platform="x64 ${archiso_platform}"
12  elif [ "${grub_cpu}" == 'i386' ]; then
13  archiso_platform="IA32 ${archiso_platform}"
14  else
15  archiso_platform="${grub_cpu} ${archiso_platform}"
16  fi
17 elif [ "${grub_platform}" == 'pc' ]; then
18  archiso_platform='BIOS'
19 else
20  archiso_platform="${grub_cpu} ${grub_platform}"
21 fi
22 
23 # Set default menu entry
24 default=archlinux
25 timeout=15
26 timeout_style=menu
27 
28 
29 # Menu entries
30 
31 menuentry "Arch Linux (%ARCH%, ${archiso_platform})" --class arch --class gnu-linux --class gnu --class os --id 'archlinux' {
32  set gfxpayload=keep
33  linux /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux archisobasedir=%INSTALL_DIR% img_dev=UUID=${archiso_img_dev_uuid} img_loop="${iso_path}"
34  initrd /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux.img
35 }
36 
37 if [ "${grub_platform}" == 'efi' -a "${grub_cpu}" == 'x86_64' -a -f '/boot/memtest86+/memtest.efi' ]; then
38  menuentry 'Run Memtest86+ (RAM test)' --class memtest86 --class gnu --class tool {
39  set gfxpayload=800x600,1024x768
40  linux /boot/memtest86+/memtest.efi
41  }
42 fi
43 if [ "${grub_platform}" == 'pc' -a -f '/boot/memtest86+/memtest' ]; then
44  menuentry 'Run Memtest86+ (RAM test)' --class memtest86 --class gnu --class tool {
45  set gfxpayload=800x600,1024x768
46  linux /boot/memtest86+/memtest
47  }
48 fi
49 if [ "${grub_platform}" == 'efi' ]; then
50  if [ "${grub_cpu}" == 'x86_64' -a -f '/shellx64.efi' ]; then
51  menuentry 'UEFI Shell' {
52  chainloader /shellx64.efi
53  }
54  elif [ "${grub_cpu}" == "i386" -a -f '/shellia32.efi' ]; then
55  menuentry 'UEFI Shell' {
56  chainloader /shellia32.efi
57  }
58  fi
59 
60  menuentry 'UEFI Firmware Settings' --id 'uefi-firmware' {
61  fwsetup
62  }
63 fi
64 
65 menuentry 'System shutdown' --class shutdown --class poweroff {
66  echo 'System shutting down...'
67  halt
68 }
69 
70 menuentry 'System restart' --class reboot --class restart {
71  echo 'System rebooting...'
72  reboot
73 }