if cpuid -l; then
    havekernel="Y"
    title=""
    for kopt in x86_64 $kopts archisobasedir=arch archisolabel=@iso_label@ @parameters@; do
        if [ -n "$title" ] ; then
            title="$title $kopt";
        else
            title="$kopt";
        fi;
    done
    menuentry "From CD/DVD/ISO/Stick/HDD: arch.x86_64" --class=arch.x86_64 "$title cow_spacesize=2048M" {# set arguments above with the editor
        linux /boot/vmlinuz-$2
        initrd /boot/initramfs-x86_64.img
    }
else
    havekernel="Y"
    title=""
    for kopt in i686 $kopts archisobasedir=arch archisolabel=@iso_label@ @parameters@; do
        if [ -n "$title" ] ; then
            title="$title $kopt";
        else
            title="$kopt";
        fi;
    done
    menuentry "From CD/DVD/ISO/Stick/HDD: arch.i686" --class=arch.i686 "$title cow_spacesize=2048M" {# set arguments above with the editor
        linux /boot/vmlinuz-$2
        initrd /boot/initramfs-i686.img
    }
fi
if [ "${havekernel}" != "Y" ]; 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."
            for kk in /boot/vmlinu*x86_64; do
                if [ "$kk" != "/boot/vmlinu*x86_64" ]; then
                    have32="true"
                fi
            done
            if [ "${have32}" != "true" ]; then
                echo "There are no 32bit kernels available"
                echo "It appears you are trying to boot a 64bit release on a 32bit machine"
                echo "This cannot work!"
            fi
        fi
        echo "Press Escape to return to the main menu"
        sleep --interruptible 9999
        menu_reload
    }
fi
