️ perf: support for 32 bit

This commit is contained in:
RiO
2024-12-24 03:49:45 +05:30
parent 1d7881d88f
commit 39420d3bd4

View File

@@ -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
fi break
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"
fi break
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."
echo ""
if ! cpuid -l; then
echo "This machine is NOT 64bit capable."
echo ""
fi fi
echo "There are no suitable kernels available" done
if [ "${have64}" == "true" ]; then
# 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 ""
echo "It appears you are trying to boot a 64bit release on a 32bit machine" # 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!" 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
} }