You are not logged in.

#1 2023-07-19 14:19:10

ActuallyJammy
Member
Registered: 2023-07-19
Posts: 2

Grub-mkconfig error(s)

So, lately, I've been trying to boot a Kali Linux ISO from GRUB. I used the Kali2GRUB tool and made a few modifications. Instead of using "update-grub," I used "grub-mkconfig -o /boot/grub/grub.cfg." After following the guide and running the command, I encountered the following errors:

Generating a GRUB configuration file...
Found Linux image: /boot/vmlinuz-linux-lts
Initial memory image found: /boot/intel-ucode.img /boot/initramfs-linux-lts.img
Found fallback initrd image(s) in /boot: intel-ucode.img initramfs-linux-lts-fallback.img
Found Linux image: /boot/vmlinuz-linux
Initial memory image found: /boot/intel-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: intel-ucode.img initramfs-linux-fallback.img
Warning: os-prober will be executed to detect other bootable partitions. Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager at /dev/nvme0n1p1@/efi/Microsoft/Boot/bootmgfw.efi
Adding a boot menu entry for UEFI Firmware Settings ...
error: out of memory.
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 279.
Syntax errors have been detected in the generated GRUB configuration file. Please ensure that there are no errors in /etc/default/grub or the files in /etc/grub.d/*. If there are any errors, please report them with the attached /boot/grub/grub.cfg.new file.

First, I deleted the menu entries in the 40_custom file, which resolved the error. Therefore, I assume the issue was related to that. However, when I tried to examine the grub.cfg.new file and locate the reported error line, the file ended earlier. The same situation occurred with 40_custom. At this point, I feel lost and don't understand the meaning of "out of memory." I would greatly appreciate some assistance. Thanks!

Offline

#2 2023-07-19 18:23:08

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,237

Re: Grub-mkconfig error(s)

You need to post these files to be able to tell what's wrong, both the 40_custom and the grub.cfg.new file. https://wiki.archlinux.org/title/List_o … n_services

Offline

#3 2023-07-20 12:33:36

ActuallyJammy
Member
Registered: 2023-07-19
Posts: 2

Re: Grub-mkconfig error(s)

V1del wrote:

You need to post these files to be able to tell what's wrong, both the 40_custom and the grub.cfg.new file. https://wiki.archlinux.org/title/List_o … n_services

grub.cfg.new:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root c061a9a1-c07a-4c02-99dc-32f04a819274
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=es_ES
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-c061a9a1-c07a-4c02-99dc-32f04a819274' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        search --no-floppy --fs-uuid --set=root c061a9a1-c07a-4c02-99dc-32f04a819274
        echo    'Cargando Linux linux-lts...'
        linux   /boot/vmlinuz-linux-lts root=UUID=c061a9a1-c07a-4c02-99dc-32f04a819274 rw  loglevel=3 quiet video=HDMI-A-1 rd.mem.min=5000
        echo    'Cargando imagen de memoria inicial...'
        initrd  /boot/intel-ucode.img /boot/initramfs-linux-lts.img
}
submenu 'Opciones avanzadas para Arch Linux' $menuentry_id_option 'gnulinux-advanced-c061a9a1-c07a-4c02-99dc-32f04a819274' {
        menuentry 'Arch Linux, con Linux linux-lts' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-lts-advanced-c061a9a1-c07a-4c02-99dc-32f04a819274' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root c061a9a1-c07a-4c02-99dc-32f04a819274
                echo    'Cargando Linux linux-lts...'
                linux   /boot/vmlinuz-linux-lts root=UUID=c061a9a1-c07a-4c02-99dc-32f04a819274 rw  loglevel=3 quiet video=HDMI-A-1 rd.mem.min=5000
                echo    'Cargando imagen de memoria inicial...'
                initrd  /boot/intel-ucode.img /boot/initramfs-linux-lts.img
        }
        menuentry 'Arch Linux, with Linux linux-lts (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-lts-fallback-c061a9a1-c07a-4c02-99dc-32f04a819274' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root c061a9a1-c07a-4c02-99dc-32f04a819274
                echo    'Cargando Linux linux-lts...'
                linux   /boot/vmlinuz-linux-lts root=UUID=c061a9a1-c07a-4c02-99dc-32f04a819274 rw  loglevel=3 quiet video=HDMI-A-1 rd.mem.min=5000
                echo    'Cargando imagen de memoria inicial...'
                initrd  /boot/intel-ucode.img /boot/initramfs-linux-lts-fallback.img
        }
        menuentry 'Arch Linux, con Linux linux-lts (modo de recuperación)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-lts-recovery-c061a9a1-c07a-4c02-99dc-32f04a819274' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root c061a9a1-c07a-4c02-99dc-32f04a819274
                echo    'Cargando Linux linux-lts...'
                linux   /boot/vmlinuz-linux-lts root=UUID=c061a9a1-c07a-4c02-99dc-32f04a819274 rw single
                echo    'Cargando imagen de memoria inicial...'
                initrd  /boot/intel-ucode.img /boot/initramfs-linux-lts-fallback.img
        }
        menuentry 'Arch Linux, con Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-c061a9a1-c07a-4c02-99dc-32f04a819274' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root c061a9a1-c07a-4c02-99dc-32f04a819274
                echo    'Cargando Linux linux...'
                linux   /boot/vmlinuz-linux root=UUID=c061a9a1-c07a-4c02-99dc-32f04a819274 rw  loglevel=3 quiet video=HDMI-A-1 rd.mem.min=5000
                echo    'Cargando imagen de memoria inicial...'
                initrd  /boot/intel-ucode.img /boot/initramfs-linux.img
        }
        menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-c061a9a1-c07a-4c02-99dc-32f04a819274' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root c061a9a1-c07a-4c02-99dc-32f04a819274
                echo    'Cargando Linux linux...'
                linux   /boot/vmlinuz-linux root=UUID=c061a9a1-c07a-4c02-99dc-32f04a819274 rw  loglevel=3 quiet video=HDMI-A-1 rd.mem.min=5000
                echo    'Cargando imagen de memoria inicial...'
                initrd  /boot/intel-ucode.img /boot/initramfs-linux-fallback.img
        }
        menuentry 'Arch Linux, con Linux linux (modo de recuperación)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-recovery-c061a9a1-c07a-4c02-99dc-32f04a819274' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root c061a9a1-c07a-4c02-99dc-32f04a819274
                echo    'Cargando Linux linux...'
                linux   /boot/vmlinuz-linux root=UUID=c061a9a1-c07a-4c02-99dc-32f04a819274 rw single
                echo    'Cargando imagen de memoria inicial...'
                initrd  /boot/intel-ucode.img /boot/initramfs-linux-fallback.img
        }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/25_bli ###
if [ "$grub_platform" = "efi" ]; then
  insmod bli
fi
### END /etc/grub.d/25_bli ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (en /dev/nvme0n1p1)' --class windows --class os $menuentry_id_option 'osprober-efi-B2F2-BEFA' {
        insmod part_gpt
        insmod fat
        search --no-floppy --fs-uuid --set=root B2F2-BEFA
        chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
if [ "$grub_platform" = "efi" ]; then
        fwsetup --is-supported
        if [ "$?" = 0 ]; then
                menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
                        fwsetup
                }
        fi
fi
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
menuentry "Kali Linux Live ISO" {
        set isofile="/boot/iso/kali-linux-2023.2a-installer-netinst-amd64.iso
        loopback loop (hd0,gpt5)$isofile
        linux (loop)/install.amd/gtk/vmlinuz boot=install.amd iso-scan/filename=${isofile} quiet splash
        initrd (loop)/install.amd/gtk/initrd.gz
        }
#BEGIN Kali Linux
submenu "Kali Linux" {menuentry --hotkey=g 'Graphical install' {
    set background_color=black
    loopback loop /boot/iso/kali-linux-2023.2a-installer-netinst-amd64.iso
    linux    (loop)/install.amd/vmlinuz net.ifnames=0 preseed/file=/cdrom/simple-cdd/default.preseed simple-cdd/profiles=kali desktop=xfce vga=788 --- quiet  findiso=/boot/iso/kali-linux-2023.2a-installer-netinst-amd64.iso
    initrd   (loop)/install.amd/gtk/initrd.gz
}
menuentry --hotkey=i 'Install' {
    set background_color=black
    loopback loop /boot/iso/kali-linux-2023.2a-installer-netinst-amd64.iso
    linux    (loop)/install.amd/vmlinuz net.ifnames=0 preseed/file=/cdrom/simple-cdd/default.preseed simple-cdd/profiles=kali desktop=xfce vga=788 --- quiet  findiso=/boot/iso/kali-linux-2023.2a-installer-netinst-amd64.iso
    initrd   (loop)/install.amd/initrd.gz
}
menuentry --hotkey=s 'Install with speech synthesis' {
    set background_color=black
    loopback loop /boot/iso/kali-linux-2023.2a-installer-netinst-amd64.iso
    linux    (loop)/install.amd/vmlinuz net.ifnames=0 preseed/file=/cdrom/simple-cdd/default.preseed simple-cdd/profiles=kali desktop=xfce vga=788 speakup.synth=soft --- quiet  findiso=/boot/iso/kali-linux-2023.2a-installer-netinst-amd64.iso
    initrd   (loop)/install.amd/gtk/initrd.gz
}

#END Kali Linux
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###

### BEGIN /etc/grub.d/99_brunch ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "Brunch" --class "brunch" {
        img_path=/chromeos.img
        img_uuid=2bcaeb05-7276-49b1-b2f0-3b560dee5272
        search --no-floppy --set=root --file $img_path
        loopback loop $img_path
        source (loop,12)/efi/boot/settings.cfg
        if [ -z $verbose ] -o [ $verbose -eq 0 ]; then
                linux (loop,7)$kernel boot=local noresume noswap loglevel=7 options=$options chromeos_bootsplash=$chromeos_bootsplash $cmdline_params \
                        cros_secure cros_debug img_uuid=$img_uuid img_path=$img_path \
                        console= vt.global_cursor_default=0 brunch_bootsplash=$brunch_bootsplash quiet
        else
                linux (loop,7)$kernel boot=local noresume noswap loglevel=7 options=$options chromeos_bootsplash=$chromeos_bootsplash $cmdline_params \
                        cros_secure cros_debug img_uuid=$img_uuid img_path=$img_path
        fi
        initrd (loop,7)/lib/firmware/amd-ucode.img (loop,7)/lib/firmware/intel-ucode.img (loop,7)/initramfs.img
}

menuentry "Brunch settings" --class "brunch-settings" {
        img_path=/chromeos.img
        img_uuid=2bcaeb05-7276-49b1-b2f0-3b560dee5272
        search --no-floppy --set=root --file $img_path
        loopback loop $img_path
        source (loop,12)/efi/boot/settings.cfg
        linux (loop,7)/kernel boot=local noresume noswap loglevel=7 options= chromeos_bootsplash= edit_brunch_config=1 \
                cros_secure cros_debug img_uuid=$img_uuid img_path=$img_path
        initrd (loop,7)/lib/firmware/amd-ucode.img (loop,7)/lib/firmware/intel-ucode.img (loop,7)/initramfs.img
}
### END /etc/grub.d/99_brunch ###


40_custom:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
menuentry "Kali Linux Live ISO" {
        set isofile="/boot/iso/kali-linux-2023.2a-installer-netinst-amd64.iso
        loopback loop (hd0,gpt5)$isofile
        linux (loop)/install.amd/gtk/vmlinuz boot=install.amd iso-scan/filename=${isofile} quiet splash
        initrd (loop)/install.amd/gtk/initrd.gz
        }
#BEGIN Kali Linux
submenu "Kali Linux" {menuentry --hotkey=g 'Graphical install' {
    set background_color=black
    loopback loop /boot/iso/kali-linux-2023.2a-installer-netinst-amd64.iso
    linux    (loop)/install.amd/vmlinuz net.ifnames=0 preseed/file=/cdrom/simple-cdd/default.preseed simple-cdd/profiles=kali desktop=xfce vga=788 --- quiet  findiso=/boot/iso/kali-linux-2023.2a-installer-netinst-amd64.iso
    initrd   (loop)/install.amd/gtk/initrd.gz
}
menuentry --hotkey=i 'Install' {
    set background_color=black
    loopback loop /boot/iso/kali-linux-2023.2a-installer-netinst-amd64.iso
    linux    (loop)/install.amd/vmlinuz net.ifnames=0 preseed/file=/cdrom/simple-cdd/default.preseed simple-cdd/profiles=kali desktop=xfce vga=788 --- quiet  findiso=/boot/iso/kali-linux-2023.2a-installer-netinst-amd64.iso
    initrd   (loop)/install.amd/initrd.gz
}
menuentry --hotkey=s 'Install with speech synthesis' {
    set background_color=black
    loopback loop /boot/iso/kali-linux-2023.2a-installer-netinst-amd64.iso
    linux    (loop)/install.amd/vmlinuz net.ifnames=0 preseed/file=/cdrom/simple-cdd/default.preseed simple-cdd/profiles=kali desktop=xfce vga=788 speakup.synth=soft --- quiet  findiso=/boot/iso/kali-linux-2023.2a-installer-netinst-amd64.iso
    initrd   (loop)/install.amd/gtk/initrd.gz
}

#END Kali Linux

Offline

#4 2023-07-20 12:59:45

Ferdinand
Member
From: Norway
Registered: 2020-01-02
Posts: 338

Re: Grub-mkconfig error(s)

@ActuallyJammy, if you put [code] [/code] tags around your files, it will read a lot easier smile

Offline

Board footer

Powered by FluxBB