mirror of
https://github.com/Snigdha-OS/snigdhaos-archiso.git
synced 2025-09-05 12:16:40 +02:00
🧹 chore: simplified && remove redundancy
This commit is contained in:
@@ -8,15 +8,15 @@ insmod ntfscomp
|
||||
insmod exfat
|
||||
insmod udf
|
||||
|
||||
# Use graphics-mode output
|
||||
if loadfont "${prefix}/fonts/unicode.pf2" ; then
|
||||
# Use graphics-mode output if the font can be loaded
|
||||
if loadfont "${prefix}/fonts/unicode.pf2"; then
|
||||
insmod all_video
|
||||
set gfxmode="auto"
|
||||
terminal_input console
|
||||
terminal_output console
|
||||
fi
|
||||
|
||||
# Enable serial console
|
||||
# Enable serial console if available
|
||||
insmod serial
|
||||
insmod usbserial_common
|
||||
insmod usbserial_ftdi
|
||||
@@ -27,16 +27,18 @@ if serial --unit=0 --speed=115200; then
|
||||
terminal_output --append serial
|
||||
fi
|
||||
|
||||
# Search for the ISO volume
|
||||
# Search for the ISO volume if UUID is not already set
|
||||
if [ -z "${ARCHISO_UUID}" ]; then
|
||||
# Try to extract ARCHISO_HINT if not already set
|
||||
if [ -z "${ARCHISO_HINT}" ]; then
|
||||
regexp --set=1:ARCHISO_HINT '^\(([^)]+)\)' "${cmdpath}"
|
||||
fi
|
||||
# Search for the ISO file and get the UUID
|
||||
search --no-floppy --set=root --file '%ARCHISO_SEARCH_FILENAME%' --hint "${ARCHISO_HINT}"
|
||||
probe --set ARCHISO_UUID --fs-uuid "${root}"
|
||||
fi
|
||||
|
||||
# Get a human readable platform identifier
|
||||
# Determine platform identifier (UEFI or BIOS)
|
||||
if [ "${grub_platform}" == 'efi' ]; then
|
||||
archiso_platform='UEFI'
|
||||
if [ "${grub_cpu}" == 'x86_64' ]; then
|
||||
@@ -52,32 +54,35 @@ else
|
||||
archiso_platform="${grub_cpu} ${grub_platform}"
|
||||
fi
|
||||
|
||||
# Set default menu entry
|
||||
# Set default menu entry and timeout
|
||||
default=snigdhaos
|
||||
timeout=15
|
||||
timeout_style=menu
|
||||
|
||||
# Menu entries for different installation modes
|
||||
|
||||
# Menu entries
|
||||
|
||||
# SNIGDHA OS LTS install (open source driver)
|
||||
menuentry "SNIGDHA OS LTS install medium (%ARCH%, ${archiso_platform}, open source)" --class arch --class gnu-linux --class gnu --class os --id 'snigdhaos' {
|
||||
set gfxpayload=keep
|
||||
linux /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux-lts archisobasedir=%INSTALL_DIR% archisodevice=UUID=${ARCHISO_UUID} cow_spacesize=4G copytoram=n driver=free module_blacklist=nvidia,nvidea_modeset,nvidia_uvm,nvidia_drm,pcspkr nouveau.modeset=1 radeon.modeset=1 i915.modeset=1 nvme_load=yes
|
||||
initrd /%INSTALL_DIR%/boot/intel-ucode.img /%INSTALL_DIR%/boot/amd-ucode.img /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux-lts.img
|
||||
}
|
||||
|
||||
# SNIGDHA OS LTS install (NVIDIA driver)
|
||||
menuentry "SNIGDHA OS LTS install medium (%ARCH%, ${archiso_platform}, NVIDIA)" --hotkey s --class arch --class gnu-linux --class gnu --class os --id 'snigdhaosnv' {
|
||||
set gfxpayload=keep
|
||||
linux /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux-lts archisobasedir=%INSTALL_DIR% archisodevice=UUID=${ARCHISO_UUID} cow_spacesize=4G copytoram=n driver=nonfree nvidia nvidia-drm.modeset=1 nouveau.modeset=0 radeon.modeset=1 i915.modeset=1 module_blacklist=pcspkr nvme_load=yes
|
||||
initrd /%INSTALL_DIR%/boot/intel-ucode.img /%INSTALL_DIR%/boot/amd-ucode.img /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux-lts.img
|
||||
}
|
||||
|
||||
# SNIGDHA OS LTS install (safe graphics, nomodeset)
|
||||
menuentry "SNIGDHA OS LTS install medium (%ARCH%, ${archiso_platform}, safe graphics, nomodeset)" --class arch --class gnu-linux --class gnu --class os --id 'snigdhaosnm' {
|
||||
set gfxpayload=keep
|
||||
linux /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux-lts archisobasedir=%INSTALL_DIR% archisodevice=UUID=${ARCHISO_UUID} cow_spacesize=4G copytoram=n driver=free nomodeset module_blacklist=nvidia,nvidea_modeset,nvidia_uvm,nvidia_drm,pcspkr nouveau.modeset=0 radeon.modeset=0 i915.modeset=0 nvme_load=yes
|
||||
initrd /%INSTALL_DIR%/boot/intel-ucode.img /%INSTALL_DIR%/boot/amd-ucode.img /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux-lts.img
|
||||
}
|
||||
|
||||
# Run Memtest86+ if available
|
||||
if [ "${grub_platform}" == 'efi' -a "${grub_cpu}" == 'x86_64' -a -f '/boot/memtest86+/memtest.efi' ]; then
|
||||
menuentry 'Run Memtest86+ (RAM test)' --class memtest86 --class memtest --class gnu --class tool {
|
||||
set gfxpayload=800x600,1024x768
|
||||
@@ -90,6 +95,8 @@ if [ "${grub_platform}" == 'pc' -a -f '/boot/memtest86+/memtest' ]; then
|
||||
linux /boot/memtest86+/memtest
|
||||
}
|
||||
fi
|
||||
|
||||
# UEFI Shell entry if supported
|
||||
if [ "${grub_platform}" == 'efi' ]; then
|
||||
if [ "${grub_cpu}" == 'x86_64' -a -f '/shellx64.efi' ]; then
|
||||
menuentry 'UEFI Shell' --class efi {
|
||||
@@ -101,11 +108,13 @@ if [ "${grub_platform}" == 'efi' ]; then
|
||||
}
|
||||
fi
|
||||
|
||||
# UEFI Firmware Settings
|
||||
menuentry 'UEFI Firmware Settings' --id 'uefi-firmware' {
|
||||
fwsetup
|
||||
}
|
||||
fi
|
||||
|
||||
# System reboot and shutdown options
|
||||
menuentry "System restart" --class reboot --class restart {
|
||||
echo "System rebooting..."
|
||||
reboot
|
||||
@@ -114,4 +123,4 @@ menuentry "System restart" --class reboot --class restart {
|
||||
menuentry "System shutdown" --class shutdown --class poweroff {
|
||||
echo "System shutting down..."
|
||||
halt
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user