Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

grub-mkconfig silently generates no Linux menu entries due to missing pkgdatadir in /etc/grub.d/10_linux

Open
#4,680 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
linux, shell

Research direction

Start by tracing archinstall's GRUB setup that generates /etc/grub.d/10_linux, then compare its variables with the grub package version. Reproduce with grub-mkconfig -o /boot/grub/grub.cfg and verify that installed kernels produce menuentry blocks without the manual workaround.

Written by the indexing model from the issue text.

Description

Which ISO version are you using?

2026.07.01

The installation log
/var/log/archinstall/install.log does not exist — cleaned up after reboot from the live ISO. Full diagnostic output demonstrating the bug is included in the issue description above (bash -x trace, broken 10_linux excerpt, and workaround).
describe the problem
Description of the issue

I installed Arch Linux via archinstall on a desktop with:

  • CPU: AMD Ryzen 7 7700 (Zen 4)
  • GPU: AMD Radeon RX 9070 XT
  • RAM: 32 GB DDR5
  • Storage: 2x NVMe SSDs
  • Boot mode: UEFI

Selected GRUB as bootloader during archinstall. Installation completed successfully. After booting into the system, I installed additional kernels (linux-cachyos and linux-zen), then ran sudo grub-mkconfig -o /boot/grub/grub.cfg. The resulting GRUB menu shows only "Arch Linux", "Windows Boot Manager" and "UEFI Firmware Settings" — zero Linux entries.

Kernels and initramfs images are present in /boot/:

/boot/vmlinuz-linux-cachyos /boot/vmlinuz-linux-zen /boot/initramfs-linux-cachyos.img /boot/initramfs-linux-zen.img /boot/amd-ucode.img

grub-probe works fine:

$ sudo grub-probe --target=device /boot && echo "OK" || echo "FAILED"
/dev/nvme1n1p1
OK

But running the kernel detection script manually reveals the bug:

$ sudo bash -x /etc/grub.d/10_linux 2>&1 | tail -5

  • set -e
  • prefix=/usr
  • exec_prefix=/usr
  • datarootdir=/usr/share
  • . /grub-mkconfig_lib
    /etc/grub.d/10_linux: line 24: /grub-mkconfig_lib: No such file or directory

The /etc/grub.d/10_linux generated by archinstall is missing the pkgdatadir variable:
```console
# archinstall's broken version:
prefix="/usr"
exec_prefix="/usr"
datarootdir="/usr/share"

. "$pkgdatadir/grub-mkconfig_lib"   # pkgdatadir is never set → expands to /grub-mkconfig_lib

The correct version (from the grub package) should be:

prefix="/usr"
exec_prefix="/usr"
datarootdir="/usr/share"
pkgdatadir="/usr/share/grub"

. "$pkgdatadir/grub-mkconfig_lib"

Because set -e is active and pkgdatadir is empty, the script dies silently without generating any menuentry blocks. grub-mkconfig reports no errors whatsoever.

Reinstalling grub (sudo pacman -S grub) does not fix it because /etc/grub.d/10_linux is treated as a config file — pacman preserves the broken version and writes the correct one only as .pacnew.

Workaround:

$ sudo sed -i '/^datarootdir=/a pkgdatadir="/usr/share/grub"' /etc/grub.d/10_linux
$ sudo grub-mkconfig -o /boot/grub/grub.cfg
$ grep -E "^menuentry " /boot/grub/grub.cfg
menuentry 'Arch Linux (CachyOS)' ...
menuentry 'Arch Linux (Zen)' ...
menuentry 'Windows Boot Manager' ...

Expected behavior: grub-mkconfig should detect all installed kernels and generate proper menuentry blocks after a fresh archinstall.

ok?

Dominant language
Python
Stars
8.5k
Forks
774
Avg merge
5d 15h
Merged PRs (30d)
32

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from archlinux/archinstall

All issues in archlinux/archinstall

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.