You are not logged in.

#1 2024-07-14 21:56:54

darkh
Member
Registered: 2024-02-19
Posts: 7

Grub Kernel Parameters are not loaded

Since I updated my System, firefox crashes everytime I open pdfs in browser or open google maps (probably also on other sides that loads similar type of data) and it also crashes randomly on youtube sometimes.
So I am trying to change my gpu driver because I read that if I change to AMDGPU it might fix the problem. I have a Radeon R390 and using the radeon driver.
Here is the output of the lspci command

23:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Hawaii PRO [Radeon R9 290/390] (rev 80)
        Subsystem: PC Partner Limited / Sapphire Technology Sapphire Nitro R9 390
        Kernel driver in use: radeon
        Kernel modules: radeon, amdgpu

I updated the grub.cfg to include some parameters to activate the amdgpu driver but they are not loaded.

$ less /boot/grub/grub.cfg
#
# 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
set root='hd1,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3  8e35a805-85a3-4eb5-a741-9ce331e31d67
else
  search --no-floppy --fs-uuid --set=root 8e35a805-85a3-4eb5-a741-9ce331e31d67
fi
    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=en_US
  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-8e35a805-85a3-4eb5-a741-9ce331e31d67' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod fat
        set root='hd1,gpt1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  003D-1496
        else
          search --no-floppy --fs-uuid --set=root 003D-1496
        fi
        echo    'Loading Linux linux ...'
        linux   /vmlinuz-linux root=UUID=8e35a805-85a3-4eb5-a741-9ce331e31d67 rw  loglevel=2 quiet radeon.cik_support=0 amdgpu.cik_support=1
        echo    'Loading initial ramdisk ...'
        initrd  /initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-8e35a805-85a3-4eb5-a741-9ce331e31d67' {
        menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-8e35a805-85a3-4eb5-a741-9ce331e31d67' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod fat
                set root='hd1,gpt1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  003D-1496
                else
                  search --no-floppy --fs-uuid --set=root 003D-1496
                fi
                echo    'Loading Linux linux ...'
                linux   /vmlinuz-linux root=UUID=8e35a805-85a3-4eb5-a741-9ce331e31d67 rw  loglevel=2 quiet radeon.cik_support=0 amdgpu.cik_support=1
                echo    'Loading initial ramdisk ...'
                initrd  /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-8e35a805-85a3-4eb5-a741-9ce331e31d67' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod fat
                set root='hd1,gpt1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  003D-1496
                else
                  search --no-floppy --fs-uuid --set=root 003D-1496
                fi
                echo    'Loading Linux linux ...'
                linux   /vmlinuz-linux root=UUID=8e35a805-85a3-4eb5-a741-9ce331e31d67 rw  loglevel=2 quiet radeon.cik_support=0 amdgpu.cik_support=1
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-linux-fallback.img
        }
}

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

### BEGIN /etc/grub.d/15_ostree ###
### END /etc/grub.d/15_ostree ###

### 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 ###
### 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/35_fwupd ###
### END /etc/grub.d/35_fwupd ###

### 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
# the 'exec tail' line above.
### 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 ###
$ cat /proc/cmdline 
BOOT_IMAGE=/vmlinuz-linux root=UUID=8e35a805-85a3-4eb5-a741-9ce331e31d67 rw loglevel=3 quiet

I dont know if it helps since I dont know that much about system administration but efibootmgr shows the following

$ efibootmgr -v
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0002,0005
Boot0002* UEFI OS       HD(5,GPT,8978b498-bfc9-8b45-a640-34d1e1130834,0x12331800,0x100000)/\EFI\BOOT\BOOTX64.EFI0000424f
      dp: 04 01 2a 00 05 00 00 00 00 18 33 12 00 00 00 00 00 00 10 00 00 00 00 00 98 b4 78 89 c9 bf 45 8b a6 40 34 d1 e1 13 08 34 02 02 / 04 04 30 00 5c 00 45 00 46 00 49 00 5c 00 42 00 4f 00 4f 00 54 00 5c 00 42 00 4f 00 4f 00 54 00 58 00 36 00 34 00 2e 00 45 00 46 00 49 00 00 00 / 7f ff 04 00
    data: 00 00 42 4f
Boot0005* Windows Boot Manager  HD(4,GPT,657793f9-62b1-4259-a2a2-57cb9977b718,0x122cd800,0x64000)/\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI0000424f
      dp: 04 01 2a 00 04 00 00 00 00 d8 2c 12 00 00 00 00 00 40 06 00 00 00 00 00 f9 93 77 65 b1 62 59 42 a2 a2 57 cb 99 77 b7 18 02 02 / 04 04 46 00 5c 00 45 00 46 00 49 00 5c 00 4d 00 49 00 43 00 52 00 4f 00 53 00 4f 00 46 00 54 00 5c 00 42 00 4f 00 4f 00 54 00 5c 00 42 00 4f 00 4f 00 54 00 4d 00 47 00 46 00 57 00 2e 00 45 00 46 00 49 00 00 00 / 7f ff 04 00
    data: 00 00 42 4f

I have a multi boot system with arch linux, manjaro and Windows. I am not sure what the output of efibootmgr says but when I boot I can choose in grub menu what distro to load (arch, manjaro or windows).

Last edited by darkh (2024-07-14 22:05:56)

Offline

#2 2024-07-15 05:36:28

-thc
Member
Registered: 2017-03-15
Posts: 578

Re: Grub Kernel Parameters are not loaded

First - which part of the sentence

# DO NOT EDIT THIS FILE

did you not understand? If you want to permanently add linux kernel parameters you add them to "GRUB_CMDLINE_LINUX_DEFAULT" in /etc/default/grub".

Since your active EFI executable is "\EFI\BOOT\BOOTX64.EFI" - which is the "fallback" EFI executable and your Arch grub.cfg menu only shows Arch entries your boot menu is probably from the grub instance inside Manjaro.

Offline

#3 2024-07-15 07:35:11

cryptearth
Member
Registered: 2024-02-03
Posts: 606

Re: Grub Kernel Parameters are not loaded

darkh wrote:

I can choose in grub menu what distro to load (arch, manjaro or windows).

you seem to have edited the wrong config

Offline

#4 2024-07-15 11:13:14

darkh
Member
Registered: 2024-02-19
Posts: 7

Re: Grub Kernel Parameters are not loaded

-thc wrote:

First - which part of the sentence

# DO NOT EDIT THIS FILE

did you not understand? If you want to permanently add linux kernel parameters you add them to "GRUB_CMDLINE_LINUX_DEFAULT" in /etc/default/grub".

Since your active EFI executable is "\EFI\BOOT\BOOTX64.EFI" - which is the "fallback" EFI executable and your Arch grub.cfg menu only shows Arch entries your boot menu is probably from the grub instance inside Manjaro.

I didnt edit the grub.cfg directly but created it after updating /etc/default/grub like you said.


Is it a problem having two grub instances? This is probably because I used only Manjaro and Windows for some years and later installed arch linux which is now my main distro. I dont use Manjaro any more, it is just there because I didnt have time to clean it up and there is some data on that partition I need to backup first.
So what would be the best solution now? Just edit the entry inside Manjaros grub.cfg? Remove the Manjaro grub instance and make the Arch Grub instance the main one (But keep the manjaro distro itself and still be able to load it)?

Isn't there a way to find out exactly how and from where my system is getting the boot command?

Offline

#5 2024-07-15 12:12:34

darkh
Member
Registered: 2024-02-19
Posts: 7

Re: Grub Kernel Parameters are not loaded

ok I got it working by creating the grub.cfg inside Manjaro instance via grub-mkconfig. It correctly set the default parameters coming from /etc/default/grub of the arch distro.

Thanks for your help!

Offline

#6 2024-07-15 12:50:27

cryptearth
Member
Registered: 2024-02-03
Posts: 606

Re: Grub Kernel Parameters are not loaded

with uefi the idea is to shift the boot management from a bootmanager like grub into the firmware - but even today modern firmwares can have faulty implementations so still using grub and others isn't a bad idea
you also can have multiple at once each with thier own config
issues arise - as here - when you mix things and try to edit a config belong to another OS

unfortunately grub doesn't know about when one instance is used for multiple OS to which in "belongs": The OS from which you call mkconfig will be the "primary home os" and all other OS are secondary OS with a maybe non-fixed order. If you call mkconfig from manjaro then manjaro is grubs base OS and arch is only some additional one. But if you call mkconfig from Arch then Arch is the base,OS and manjaro will become the secondary.
Important: no matter how many instances of different boitmanagers you have installed - it depends on which config they use:
when installing grub without the --boot-directory parameter it will refer to its config in the current /boot directory. If you have th ESP mounted to /boot then there will always be one config at /boot/grub/grub.cfg.
But if you have something else mounted at /boot (or nothing at all but /boot is part of the root partition and the esp is mounted to /efi or /boot/efi then /boot/grub/grub.cfg becomes specific telative from which root you call install and mkconfig.
An option us to use --boot-directory:

grub-install ... --boot-directory=/efi

this way the config that instance gets bound to is the ine on whatever is mounted /efi like the ESP - this way you can keep grub and a common config on the esp while have the kernel and initrd either on the root or at an additional xbootldr partition.

What went wrong? Wild guess in the blue you have more that one grub.efi and more than one grub.cfg - and mixed up which efi binary reads which config.
A cleanup might be useful.

Offline

#7 2024-07-15 15:26:33

darkh
Member
Registered: 2024-02-19
Posts: 7

Re: Grub Kernel Parameters are not loaded

cryptearth wrote:

The OS from which you call mkconfig will be the "primary home os" and all other OS are secondary OS with a maybe non-fixed order. If you call mkconfig from manjaro then manjaro is grubs base OS and arch is only some additional one. But if you call mkconfig from Arch then Arch is the base,OS and manjaro will become the secondary.

running mkconfig from arch doesnt change anything in the boot process. The boot menu is still from manjaro. Also running mkconfig from arch only finds the arch boot entry, whereas running mkconfig from manjaro detects manjaro, arch and windows and creates the according grub.cfg. So I am not sure what you mean by primary OS and secondary OS but it is always using the manjaro grub.

Offline

#8 2024-07-15 18:26:59

cryptearth
Member
Registered: 2024-02-03
Posts: 606

Re: Grub Kernel Parameters are not loaded

as said: you have multiple grub.cfg and then one you modify from arch is not the one the binary installed by manjaro reads
please post from both arch and manjaro:

lsblk -f
mount
sudo find / -name grub.cfg

the sudo here is explicit to suppress all those access denied lines when run as regular user

Offline

#9 2024-07-15 19:02:26

cryptearth
Member
Registered: 2024-02-03
Posts: 606

Re: Grub Kernel Parameters are not loaded

Here's a setup that demonstrate this problem:

root@archiso ~ # lsblk -f
NAME   FSTYPE   FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0  squashfs 4.0                                                    0   100% /run/archiso/airootfs
vda                                                                             
├─vda1 vfat     FAT32       FABD-8EB6                                           
├─vda2 ext4     1.0         ae77ce70-6647-4f30-87bf-76102f0ee3f0                
└─vda3 ext4     1.0         fec6094e-7ede-4914-afb7-49727ee27690

with vda1 contain two grub binaries:

esp/EFI/arch/bootx64.efi
esp/EFI/manjaro/bootx64.efi

as the ESP was mounted to (/boot)/efi it only contains grub - no configs or other files
so /boot is part of the respective root partition of each OS

When grub got installed from manjaro the installer figured out that /boot/grub/grub.cfg will be on partition vda2 and hardcoded its uuid ae77ce70-6647-4f30-87bf-76102f0ee3f0 into the binary. So when the manjaro grub.efi gets loaded and started it will read its config from ae77ce70-6647-4f30-87bf-76102f0ee3f0/boot/grub/grub.cfg

Now you have arch installed - and it hardcoded its uuid fec6094e-7ede-4914-afb7-49727ee27690 into its grub binary - so the binary installed by arch will only read fec6094e-7ede-4914-afb7-49727ee27690/boot/grub/grub.cfg

Your issue: From within Arch you now only modify fec6094e-7ede-4914-afb7-49727ee27690/boot/grub/grub.cfg - but as the manjaro binary starts it will stll load ae77ce70-6647-4f30-87bf-76102f0ee3f0/boot/grub/grub.cfg - which is NOT the file you modified from arch - but is the config that's created when you run mkconfig from within manjaro.

Why your arch mkconfig only detects arch: because os-prober is likely neither installed or enabled and hence mkconfig will only find the current running arch.

What I mean by "primary" and "secondary" OS: Have a look at your grub.cfg: From Manjaro you have Manjaro always as the first entry - with Arch the second and Windows the third. From Arch (if os-prober is enabled) you will always have Arch as first and Manjaro as second - because the current running OS will always be the priority one - which makes it hard to manage one config on the ESP for several OSs without an external tool which can keep track of that - or by only creating the config from the same OS.

Offline

Board footer

Powered by FluxBB