36 lines
1 KiB
Bash
36 lines
1 KiB
Bash
|
#!/bin/sh
|
||
|
# credit: https://wiki.osdev.org/Stivale_Bare_Bones
|
||
|
# modified to suit sen
|
||
|
|
||
|
# switch to build directory
|
||
|
cd build &&
|
||
|
|
||
|
# check if limine is already downloaded, and built
|
||
|
if [ ! -d "limine" ]
|
||
|
then
|
||
|
# Download the latest Limine binary release.
|
||
|
git clone https://github.com/limine-bootloader/limine.git --branch=v2.0-branch-binary --depth=1 &&
|
||
|
|
||
|
# Build limine-install.
|
||
|
make -C limine &&
|
||
|
|
||
|
# Create a directory which will be our ISO root.
|
||
|
mkdir -p iso_root
|
||
|
fi
|
||
|
|
||
|
# Copy the relevant files over.
|
||
|
cp -v ../bin/sen.elf ../src/limine.cfg limine/limine.sys \
|
||
|
limine/limine-cd.bin limine/limine-eltorito-efi.bin iso_root/ &&
|
||
|
|
||
|
# Create the bootable ISO.
|
||
|
xorriso -as mkisofs -b limine-cd.bin \
|
||
|
-no-emul-boot -boot-load-size 4 -boot-info-table \
|
||
|
--efi-boot limine-eltorito-efi.bin \
|
||
|
-efi-boot-part --efi-boot-image --protective-msdos-label \
|
||
|
iso_root -o sen.iso &&
|
||
|
|
||
|
# Install Limine stage 1 and 2 for legacy BIOS boot.
|
||
|
./limine/limine-install sen.iso &&
|
||
|
|
||
|
cp sen.iso ../bin/sen.iso
|