grub2 custom_40 not read at bootup

Help with issues regarding installation of Debian

grub2 custom_40 not read at bootup

Postby francois.e » 2020-12-30 20:56

It seems that grub2 custom_40 not read at bootup.
Here are my essential files:
/etc/default/grub
Code: Select all
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
GRUB_TIMEOUT=3
GRUB_DISTRIBUTOR=`Debian`
GRUB_DEFAULT=2  #2 pour 40_custom première entrée.

#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

GRUB_CMDLINE_LINUX=""

# If you want to enable the save default function, uncomment the following
# line, and set GRUB_DEFAULT to saved.
GRUB_SAVEDEFAULT=true

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable Hidden Menu, and optionally hide the timeout count
#GRUB_HIDDEN_TIMEOUT=5
#GRUB_HIDDEN_TIMEOUT_QUIET=true

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
GRUB_COLOR_NORMAL="light-gray/black"
GRUB_COLOR_HIGHLIGHT="green/black"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
GRUB_BACKGROUND="/usr/share/grub/background.png"
GRUB_THEME="/boot/grub/themes/Manjaro-Default/theme.txt"


# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

and
/etc/grub.d/custom_40
Code: Select all
#!/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.

# ajout fl en dessous

# path to the partition holding ISO images (using UUID)
probe -u $root --set=rootuuid
set imgdevpath="/dev/disk/by-uuid/$rootuuid"

menuentry "debian-live-10.6.0-amd64-xfce.iso" {
    set isofile="/isos/debian-live-10.6.0-amd64-xfce.iso"
    loopback aloop (hd1,3)$isofile
    linux  (aloop)/live/vmlinuz-4.19.0-11-amd64 boot=live findiso=$isofile live-media-path=/live components
    initrd (aloop)/live/initrd.img-4.19.0-11-amd64
}
menuentry "Porteus41 XFCE x86-64 iso" {
insmod part_msdos
insmod ext2
set root=(hd1,3)
set isofile="/isos/Porteus-XFCE-v4.0-x86_64.iso"
search --no-floppy --file --set=root $isofile
loopback loop $isofile
linux (loop)/boot/syslinux/vmlinuz from=$isofile changes=/41_porteus login=root extramod=UUID:5ef211e4-004a-4a22-9cc2-f39edcd73f7b/41_porteus/xfce extramod=UUID:5ef211e4-004a-4a22-9cc2-f39edcd73f7b/64_V40/porteus
initrd (loop)/boot/syslinux/initrd.xz
}
francois.e
 
Posts: 33
Joined: 2009-03-06 22:03

Re: grub2 custom_40 not read at bootup

Postby Head_on_a_Stick » 2020-12-30 21:02

You need to use the 'update-grub' command to add /etc/grub.d/40_custom (not "custom_40") to the boot menu. Anything in /boot/grub/custom.cfg will be added to the menu even if the 'update-grub' command isn't used.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13041
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: grub2 custom_40 not read at bootup

Postby francois.e » 2020-12-30 21:17

I changed
Code: Select all
GRUB_DISTRIBUTOR=`Debian`

for
Code: Select all
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`


Then I could:
Code: Select all
update-grub


And the the custom_40 menu appearead at bootup. :)

However, trying now to update-grub I get:
Code: Select all
fl@francois-asus:~$ sudo grub-update
[sudo] password for fl:
sudo: grub-update: command not found
fl@francois-asus:~$


Any comments or suggestions appreciated.
Thanks.
francois.e
 
Posts: 33
Joined: 2009-03-06 22:03

Re: grub2 custom_40 not read at bootup

Postby Head_on_a_Stick » 2020-12-30 21:20

Yes, I also have trouble remembering the order of the words in the 'update-grub' command so I just run the command inside the wrapper script directly:
Code: Select all
# grub-mkconfig -o /boot/grub/grub.cfg

^ I find that *much* easier to remember.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13041
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: grub2 custom_40 not read at bootup

Postby francois.e » 2020-12-31 01:59

You will be surprised, I was about to try it. :)
Very nice to you to answer this one. It could be too much boose, but it isn't.
Best thing for me is to go to bed right now. :oops:

You have been giving your time for years on this forum.
I am grateful.
Happy holiday!
francois.e
 
Posts: 33
Joined: 2009-03-06 22:03

Re: grub2 custom_40 not read at bootup

Postby p.H » 2020-12-31 11:52

Head_on_a_Stick wrote:Anything in /boot/grub/custom.cfg will be added to the menu

WARNING : /etc/grub.d/41_custom adds the following instructions to include the contents of custom.cfg at boot time :
Code: Select all
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

So if $config_directory is defined at boot time, GRUB will load custom.cfg from this location instead of $prefix (/boot/grub).
It is unclear which circumstances define $config_directory, but it appears that when GRUB signed for EFI secure boot is used, $config_directory points to EFI/debian in the EFI partition, so this is where GRUB will look for custom.cfg.
p.H
 
Posts: 1609
Joined: 2017-09-17 07:12


Return to Installation

Who is online

Users browsing this forum: No registered users and 12 guests

fashionable