Skip to content

Instantly share code, notes, and snippets.

@btashton
Last active August 4, 2020 04:51
Show Gist options
  • Save btashton/cdd3c9caabc3b899f2639120dc64adfd to your computer and use it in GitHub Desktop.
Save btashton/cdd3c9caabc3b899f2639120dc64adfd to your computer and use it in GitHub Desktop.
NuttX Grub Config

Booting NuttX via Grub

Note: These instructions are somewhat Fedora specific and also rely on my partion setup.

You will need to make sure on Fedora you have the grub2-efi-x64-modules package installed to provide the multiboot2 grub module.

  1. Create a new file /etc/grub.d/20_nuttx:
#!/usr/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.
menuentry "nuttx" {
  insmod (lvm/fedora-root)/usr/lib/grub/x86_64-efi/relocator.mod
  insmod (lvm/fedora-root)/usr/lib/grub/x86_64-efi/multiboot2.mod
  multiboot2 (lvm/fedora-home)/bashton/nuttx/nuttx/nuttx.elf
}

I use lvm and have two volumes fedora-root and fedora-home, so adjust for that if needed.

  1. Create a new EFI Grub2 configuration: grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment