Solved invoking grub-mkrescue fails when following along a tutorial

Solved issue

fairy

New Member
Joined
Mar 17, 2024
Messages
2
Reaction score
0
Credits
21
I am following this OS tutorial. It uses grub legacy which is outdated (I use ubuntu 22.04 and have grub 2 installed by default).
The whole directory structure and project looks like this: https://github.com/AlgorithMan-de/wyoos/tree/b440da72b6403d6cde728b6657e61aed8fd3c682

the important part of the makefile where a bootable ISO file is created looks like this:
Code:
mykernel.iso: mykernel.bin
    mkdir iso
    mkdir iso/boot
    mkdir iso/boot/grub
    cp mykernel.bin iso/boot/mykernel.bin
    echo 'set timeout=0'                      > iso/boot/grub/grub.cfg
    echo 'set default=0'                     >> iso/boot/grub/grub.cfg
    echo ''                                  >> iso/boot/grub/grub.cfg
    echo 'menuentry "My Operating System" {' >> iso/boot/grub/grub.cfg
    echo '  multiboot /boot/mykernel.bin'    >> iso/boot/grub/grub.cfg
    echo '  boot'                            >> iso/boot/grub/grub.cfg
    echo '}'                                 >> iso/boot/grub/grub.cfg
    grub-mkrescue --output=mykernel.iso iso
    rm -rf iso
and the terminal error message is this:

Code:
(commands above grub-mkrescue --output=mykernel.iso iso)...

grub-mkrescue --output=mykernel.iso iso
grub-mkrescue: error: `mformat` invocation failed
.
make: *** [makefile:34: mykernel.iso] Error 1

I do not understand why grub-mkrescue fails. I got one result on google https://bbs.archlinux.org/viewtopic.php?id=219955 which I followed but the error message remained the same.
I also asked on askubuntu but no one there knew something. Can someone please help me? Many thanks!!
 



Members online


Latest posts

Top