mirror of
https://github.com/Snigdha-OS/snigdhaos-grub-theme.git
synced 2025-09-20 19:14:56 +02:00
⚡️ perf: support for 32 bit
This commit is contained in:
@@ -1,30 +1,41 @@
|
||||
# Initialize variables
|
||||
have_kernel="false"
|
||||
have64="false"
|
||||
have32="false"
|
||||
|
||||
# Check for 64-bit kernel in /boot
|
||||
for kk in /boot/vmlinu*-*64; do
|
||||
if [ "$kk" != "/boot/vmlinu*-*64" ]; then
|
||||
if [ -f "$kk" ]; then
|
||||
have64="true"
|
||||
# Check if the system supports 64-bit
|
||||
if cpuid -l; then
|
||||
have_kernel="true"
|
||||
else
|
||||
have_kernel="false"
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Check for 32-bit kernel in /boot
|
||||
for kk in /boot/vmlinu*-*86; do
|
||||
if [ "$kk" != "/boot/vmlinu*-*86" ]; then
|
||||
if [ -f "$kk" ]; then
|
||||
have32="true"
|
||||
have_kernel="true"
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ "${have_kernel}" != "true" ]; then
|
||||
menuentry --class=find.none "NO SUITABLE KERNELS AVAILABLE" {echo $@ echo "There are no kernels suitable for this machine available."
|
||||
|
||||
# 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 64bit capable."
|
||||
echo ""
|
||||
echo "This machine is NOT 64-bit capable."
|
||||
fi
|
||||
echo "There are no suitable kernels available"
|
||||
if [ "${have64}" == "true" ]; then
|
||||
echo ""
|
||||
echo "It appears you are trying to boot a 64bit release on a 32bit machine"
|
||||
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 ""
|
||||
@@ -33,19 +44,16 @@ if [ "${have_kernel}" != "true" ]; then
|
||||
menu_reload
|
||||
}
|
||||
else
|
||||
title=""
|
||||
for kopt in @ARCH@ $kopts @DEFAULT_ARGS@ @BOOT_ARGS@; do
|
||||
if [ -n "$title" ] ; then
|
||||
title="$title $kopt";
|
||||
else
|
||||
title="$kopt";
|
||||
fi;
|
||||
done
|
||||
menuentry "Boot with open source drivers" --class=@DIST_NAME@.@ARCH@ "$title" {# set arguments above with the editor
|
||||
# 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" {# set arguments above with the editor
|
||||
|
||||
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
|
||||
}
|
||||
|
Reference in New Issue
Block a user