From d0410cd60f15cc17e4bbdf43b0e02865bad9cce5 Mon Sep 17 00:00:00 2001 From: Scott Sutherland Date: Sun, 6 Oct 2024 19:35:35 -0500 Subject: [PATCH] Add sample configs. Add sample configs for grub. --- Scripts/SampleConfigs/grub.cfg | 68 +++++++++++++++++++++++++++++++++ Scripts/SampleConfigs/grub.conf | 68 +++++++++++++++++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 Scripts/SampleConfigs/grub.cfg create mode 100644 Scripts/SampleConfigs/grub.conf diff --git a/Scripts/SampleConfigs/grub.cfg b/Scripts/SampleConfigs/grub.cfg new file mode 100644 index 0000000..03cd5c8 --- /dev/null +++ b/Scripts/SampleConfigs/grub.cfg @@ -0,0 +1,68 @@ +# Set the default menu entry to boot +set default=0 + +# Set the timeout for the GRUB menu +set timeout=5 + +# Set the GRUB background image (optional) +if loadfont /boot/grub/fonts/unicode.pf2; then + insmod gfxterm + insmod png + set gfxmode=auto + set background_image="/boot/grub/background.png" + terminal_output gfxterm +fi + +# Define the superuser and plain-text password (for demo purposes only) +set superusers="admin" +password admin myplaintextpassword + +# Load necessary modules for Linux booting +insmod gzio +insmod part_msdos +insmod ext2 + +# Specify the path to the main GRUB boot configuration +set root='hd0,msdos1' +search --no-floppy --fs-uuid --set=root 1234-5678 + +# Boot menu entries +menuentry 'Ubuntu 22.04 LTS' --class ubuntu --class gnu-linux --class os { + recordfail + load_video + gfxmode $linux_gfx_mode + insmod gzio + insmod part_msdos + insmod ext2 + set root='hd0,msdos1' + linux /vmlinuz-5.15.0-30-generic root=UUID=1234-5678 ro quiet splash + initrd /initrd.img-5.15.0-30-generic +} + +# Protected entry for recovery mode (requires superuser password) +menuentry 'Ubuntu 22.04 LTS (Recovery Mode)' --class ubuntu --class gnu-linux --class os --unrestricted { + recordfail + load_video + gfxmode $linux_gfx_mode + insmod gzio + insmod part_msdos + insmod ext2 + set root='hd0,msdos1' + linux /vmlinuz-5.15.0-30-generic root=UUID=1234-5678 ro recovery nomodeset + initrd /initrd.img-5.15.0-30-generic +} + +# Additional entry for Windows booting (if dual-booted) +menuentry 'Windows 10' --class windows --class os { + insmod part_msdos + insmod ntfs + set root='hd0,msdos2' + chainloader +1 +} + +# Boot to GRUB command line (restricted access, requires superuser password) +menuentry 'GRUB Command Line' --class cmdline --unrestricted { + insmod all_video + terminal_input console + terminal_output console +} diff --git a/Scripts/SampleConfigs/grub.conf b/Scripts/SampleConfigs/grub.conf new file mode 100644 index 0000000..03cd5c8 --- /dev/null +++ b/Scripts/SampleConfigs/grub.conf @@ -0,0 +1,68 @@ +# Set the default menu entry to boot +set default=0 + +# Set the timeout for the GRUB menu +set timeout=5 + +# Set the GRUB background image (optional) +if loadfont /boot/grub/fonts/unicode.pf2; then + insmod gfxterm + insmod png + set gfxmode=auto + set background_image="/boot/grub/background.png" + terminal_output gfxterm +fi + +# Define the superuser and plain-text password (for demo purposes only) +set superusers="admin" +password admin myplaintextpassword + +# Load necessary modules for Linux booting +insmod gzio +insmod part_msdos +insmod ext2 + +# Specify the path to the main GRUB boot configuration +set root='hd0,msdos1' +search --no-floppy --fs-uuid --set=root 1234-5678 + +# Boot menu entries +menuentry 'Ubuntu 22.04 LTS' --class ubuntu --class gnu-linux --class os { + recordfail + load_video + gfxmode $linux_gfx_mode + insmod gzio + insmod part_msdos + insmod ext2 + set root='hd0,msdos1' + linux /vmlinuz-5.15.0-30-generic root=UUID=1234-5678 ro quiet splash + initrd /initrd.img-5.15.0-30-generic +} + +# Protected entry for recovery mode (requires superuser password) +menuentry 'Ubuntu 22.04 LTS (Recovery Mode)' --class ubuntu --class gnu-linux --class os --unrestricted { + recordfail + load_video + gfxmode $linux_gfx_mode + insmod gzio + insmod part_msdos + insmod ext2 + set root='hd0,msdos1' + linux /vmlinuz-5.15.0-30-generic root=UUID=1234-5678 ro recovery nomodeset + initrd /initrd.img-5.15.0-30-generic +} + +# Additional entry for Windows booting (if dual-booted) +menuentry 'Windows 10' --class windows --class os { + insmod part_msdos + insmod ntfs + set root='hd0,msdos2' + chainloader +1 +} + +# Boot to GRUB command line (restricted access, requires superuser password) +menuentry 'GRUB Command Line' --class cmdline --unrestricted { + insmod all_video + terminal_input console + terminal_output console +}