Skip to content

Instantly share code, notes, and snippets.

@mekb-turtle
Last active October 16, 2022 09:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mekb-turtle/8ff002b06a6f7fdfc05651a6d91e1b20 to your computer and use it in GitHub Desktop.
Save mekb-turtle/8ff002b06a6f7fdfc05651a6d91e1b20 to your computer and use it in GitHub Desktop.
Test Limine configurations
#!/usr/bin/bash
DIR=/tmp/liminetest
ISO_DIR=$DIR/isoroot
ISO=$DIR/out.iso
LIMINE_CONFIG=limine.cfg
LIMINE_DIR=limine.d # for adding extra fonts and stuff
LIMINE_BIN_DIR=/usr/share/limine
mkdir -pv "$DIR/" "$ISO_DIR/" "$ISO_DIR/$LIMINE_DIR/" && \
cp -v "${1-/boot/$LIMINE_CONFIG}" "$ISO_DIR/$LIMINE_CONFIG" || exit "$?"
cp -vr "${2-/boot/$LIMINE_DIR}"/* "$ISO_DIR/$LIMINE_DIR/"
cp -v "$LIMINE_BIN_DIR/"limine-cd-efi.bin \
"$LIMINE_BIN_DIR/"limine-cd.bin \
"$LIMINE_BIN_DIR/"limine.sys "$ISO_DIR/" &&
xorriso -as mkisofs -b limine-cd.bin \
-no-emul-boot -boot-load-size 4 -boot-info-table \
--efi-boot limine-cd-efi.bin \
-efi-boot-part --efi-boot-image --protective-msdos-label \
"$ISO_DIR/" -o "$ISO" && \
limine-deploy "$ISO" && \
"qemu-system-$(uname -m)" -bios /usr/share/edk2-ovmf/x64/OVMF.fd -cdrom "$ISO"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment