mirror of
https://github.com/Snigdha-OS/snigdhaos-grub-theme.git
synced 2025-09-22 19:54:55 +02:00
61 lines
1.8 KiB
INI
61 lines
1.8 KiB
INI
# Initialize variables
|
|
have_kernel="false"
|
|
have64="false"
|
|
have32="false"
|
|
|
|
# Check for 64-bit kernel in /boot
|
|
for kk in /boot/vmlinu*-*64; do
|
|
if [ -f "$kk" ]; then
|
|
have64="true"
|
|
# Check if the system supports 64-bit
|
|
if cpuid -l; then
|
|
have_kernel="true"
|
|
fi
|
|
break
|
|
fi
|
|
done
|
|
|
|
# Check for 32-bit kernel in /boot
|
|
for kk in /boot/vmlinu*-*86; do
|
|
if [ -f "$kk" ]; then
|
|
have32="true"
|
|
have_kernel="true"
|
|
break
|
|
fi
|
|
done
|
|
|
|
# If no suitable kernel found
|
|
if [ "$have_kernel" != "true" ]; then
|
|
menuentry --class=find.none "NO SUITABLE KERNELS AVAILABLE" {
|
|
echo "There are no kernels suitable for this machine available."
|
|
echo ""
|
|
# Check if the machine is 64-bit capable
|
|
if ! cpuid -l; then
|
|
echo "This machine is NOT 64-bit capable."
|
|
fi
|
|
echo ""
|
|
if [ "$have64" == "true" ]; then
|
|
echo "It appears you are trying to boot a 64-bit release on a 32-bit machine."
|
|
echo "This cannot work!"
|
|
fi
|
|
echo ""
|
|
echo "Press Escape to return to the main menu"
|
|
sleep --interruptible 9999
|
|
menu_reload
|
|
}
|
|
else
|
|
# Construct boot parameters
|
|
title="@ARCH@ @DEFAULT_ARGS@ @BOOT_ARGS@"
|
|
|
|
# Boot menu entries
|
|
menuentry "Boot with open source drivers" --class=@DIST_NAME@.@ARCH@ "$title" {
|
|
linux /boot/vmlinuz-$2 driver=free nouveau.modeset=1 i915.modeset=1 radeon.modeset=1
|
|
initrd /boot/amd_ucode.img /boot/intel_ucode.img /boot/initramfs-@ARCH@.img
|
|
}
|
|
|
|
menuentry "Boot allowing proprietary drivers (NVIDIA)" --class=@DIST_NAME@.@ARCH@ "$title" {
|
|
linux /boot/vmlinuz-$2 driver=nonfree nouveau.modeset=0 i915.modeset=1 radeon.modeset=1
|
|
initrd /boot/amd_ucode.img /boot/intel_ucode.img /boot/initramfs-@ARCH@.img
|
|
}
|
|
fi
|