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
|
for kk in /boot/vmlinu*-*64; do
|
||||||
if [ "$kk" != "/boot/vmlinu*-*64" ]; then
|
if [ -f "$kk" ]; then
|
||||||
have64="true"
|
have64="true"
|
||||||
|
# Check if the system supports 64-bit
|
||||||
if cpuid -l; then
|
if cpuid -l; then
|
||||||
have_kernel="true"
|
have_kernel="true"
|
||||||
else
|
|
||||||
have_kernel="false"
|
|
||||||
fi
|
fi
|
||||||
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Check for 32-bit kernel in /boot
|
||||||
for kk in /boot/vmlinu*-*86; do
|
for kk in /boot/vmlinu*-*86; do
|
||||||
if [ "$kk" != "/boot/vmlinu*-*86" ]; then
|
if [ -f "$kk" ]; then
|
||||||
have32="true"
|
have32="true"
|
||||||
have_kernel="true"
|
have_kernel="true"
|
||||||
|
break
|
||||||
fi
|
fi
|
||||||
done
|
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 ""
|
echo ""
|
||||||
|
# Check if the machine is 64-bit capable
|
||||||
if ! cpuid -l; then
|
if ! cpuid -l; then
|
||||||
echo "This machine is NOT 64bit capable."
|
echo "This machine is NOT 64-bit capable."
|
||||||
echo ""
|
|
||||||
fi
|
fi
|
||||||
echo "There are no suitable kernels available"
|
|
||||||
if [ "${have64}" == "true" ]; then
|
|
||||||
echo ""
|
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!"
|
echo "This cannot work!"
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
@@ -33,19 +44,16 @@ if [ "${have_kernel}" != "true" ]; then
|
|||||||
menu_reload
|
menu_reload
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
title=""
|
# Construct boot parameters
|
||||||
for kopt in @ARCH@ $kopts @DEFAULT_ARGS@ @BOOT_ARGS@; do
|
title="@ARCH@ @DEFAULT_ARGS@ @BOOT_ARGS@"
|
||||||
if [ -n "$title" ] ; then
|
|
||||||
title="$title $kopt";
|
# Boot menu entries
|
||||||
else
|
menuentry "Boot with open source drivers" --class=@DIST_NAME@.@ARCH@ "$title" {
|
||||||
title="$kopt";
|
|
||||||
fi;
|
|
||||||
done
|
|
||||||
menuentry "Boot with open source drivers" --class=@DIST_NAME@.@ARCH@ "$title" {# set arguments above with the editor
|
|
||||||
linux /boot/vmlinuz-$2 driver=free nouveau.modeset=1 i915.modeset=1 radeon.modeset=1
|
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
|
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
|
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
|
initrd /boot/amd_ucode.img /boot/intel_ucode.img /boot/initramfs-@ARCH@.img
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user