You are not logged in.

#1 2021-09-08 12:58:44

CheesingJade
Member
Registered: 2021-09-08
Posts: 2

grub-mkconfig 40_custom syntax error

hello, I'm trying to update grub but when I do

grub-mkconfig -o /boot/grub/grub.cfg

either my arch kernel crash, or if I am on archiso I get
menuentry: command not found,

syntax error line 4 on 40_custom next to }

I cant get any info about that issue online, I tried to reinstall grub altogether but the problem percist.

my 40_custom file:

    menuentry 'Reboot System' --class restart {
        reboot
    }

    menuentry 'Shutdown System' --class shutdown {
        halt
    }

thx

Last edited by CheesingJade (2021-09-08 12:59:34)

Offline

#2 2021-09-08 13:25:41

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

Re: grub-mkconfig 40_custom syntax error

It looks good to me, except I think the syntax is class=restart

Here's an explanation on that class thing with menuentries:
https://unix.stackexchange.com/question … -menuentry

I only used the basic syntax from the Arch wiki and that works good:
https://wiki.archlinux.org/title/GRUB#Custom_grub.cfg

Offline

#3 2021-09-08 13:30:23

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,677
Website

Re: grub-mkconfig 40_custom syntax error

If this is your *entire* config file, you screwed it up, since it is required to contain a bash script.

/etc/grub.d/40_custom wrote:

#!/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
# the 'exec tail' line above.

Last edited by schard (2021-09-08 13:32:09)


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#4 2021-09-08 14:01:25

CheesingJade
Member
Registered: 2021-09-08
Posts: 2

Re: grub-mkconfig 40_custom syntax error

schard wrote:

If this is your *entire* config file, you screwed it up, since it is required to contain a bash script.

/etc/grub.d/40_custom wrote:

#!/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
# the 'exec tail' line above.

I added the bash script to the beginning of 40_custom and now it works fine.
I don't know how it wasn't there in the first place since I never edited 40_custom but eh. Thanks for the help!

Offline

Board footer

Powered by FluxBB