Redcore Linux Project Forum

Unfortunately, no one can be told what Redcore Linux is. You have to see it for yourself!

You are not logged in.

#1 2025-10-19 02:22:51

Myst
Member
Registered: 2023-06-05
Posts: 12

Updating Grub on RedcoreLinux

Hi,

When I started my RedcoreLinux journey some years ago, I had very litle technical knowledge, I came from Debian/Ubuntu based distros.

It took me a while to get around not having the "update-grub" command that is used in other distros. In a nutshell, the "update-grub" is just a wrapper for

"grub-mkconfig"
here on redcore the command uses "grub2"

The correect way to update the grub on RedcoreLinux, is with
"grub2-mkconfig -o /boot/grub/grub.cfg"

for those new to linux and are bit daunted by using the above command are more comfortable using "update-grub", below is the guide on simple wrapper for "grub2-mkconfig -o /boot/grub/grub.cfg"; this way all you need to type is :-

"update-grub"

Here’s how to add a simple wrapper so the command works just like in Ubuntu,

? 1. Create the script
sudo tee /usr/local/sbin/update-grub >/dev/null <<'EOF'
#!/bin/sh
set -e

# Detect GRUB2 command
if command -v grub2-mkconfig >/dev/null 2>&1; then
  CMD=grub2-mkconfig
elif command -v grub-mkconfig >/dev/null 2>&1; then
  CMD=grub-mkconfig
else
  echo "Error: grub2-mkconfig or grub-mkconfig not found!" >&2
  exit 1
fi

# Detect output path
if [ -d /boot/grub2 ]; then
  OUT=/boot/grub2/grub.cfg
else
  OUT=/boot/grub/grub.cfg
fi

exec "$CMD" -o "$OUT" "$@"
EOF

? 2. Make it executable
sudo chmod 755 /usr/local/sbin/update-grub

? 3. Test it


sudo update-grub


✅ Expected output:

Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.11.9-redcore
Found initrd image: /boot/initrd-6.11.9-redcore
done

Optional alias

If you also want update-grub2 available:

sudo ln -sf /usr/local/sbin/update-grub /usr/local/sbin/update-grub2


? Summary:
This small wrapper script safely calls grub2-mkconfig or grub-mkconfig and writes the config to the right location. It’s the easiest way to have a Debian-style update-grub command on Redcore or Gentoo — no overlays, no ebuilds, just copy-paste and done.

I hope this helps.

Again thanks to V3n3RiX; for the best LinuxOs, Redcore !

Myst.

Offline

Board footer

Powered by FluxBB