Creating GRUB2 images without grub2-mkrescue

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
riparoony
Posts: 15
Joined: Wed Jul 04, 2012 9:50 pm
Location: Salt Lake City
Contact:

Creating GRUB2 images without grub2-mkrescue

Post by riparoony »

Is it required to use `grub2-mkrescue` to create images with GRUB2? I remember their being images for GRUB classic that I used to use, but I can't seem to find anything similar for GRUB2. Is there any way to package GRUB2 images on an ISO using something like mkisofs?
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: Creating GRUB2 images without grub2-mkrescue

Post by xenos »

Yes, you can use grub-mkimage and genisoimage for this. I use the ones I have on my Ubuntu anyway, with the following command line:

Code: Select all

grub-mkimage -o /tmp/core.img -O i386-pc biosdisk iso9660 multiboot configfile
cat /usr/lib/grub/i386-pc/cdboot.img /tmp/core.img > iso/grub2/eltorito.img
rm /tmp/core.img
genisoimage -R -f -b boot/grub/eltorito.img -no-emul-boot -boot-load-size 4 -boot-info-table -o run/boot.iso -graft-points nos/=iso/nos/ boot/grub/=iso/grub2/
Of course you may wish to use different modules or need to change some paths.
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
User avatar
riparoony
Posts: 15
Joined: Wed Jul 04, 2012 9:50 pm
Location: Salt Lake City
Contact:

Re: Creating GRUB2 images without grub2-mkrescue

Post by riparoony »

That works, thanks.
Post Reply