diff options
Diffstat (limited to 'tools/gen_grub_cdrom.sh')
| -rwxr-xr-x | tools/gen_grub_cdrom.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/gen_grub_cdrom.sh b/tools/gen_grub_cdrom.sh new file mode 100755 index 0000000..a1f1a1c --- /dev/null +++ b/tools/gen_grub_cdrom.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +# Ensure to abort on error +set -e + +wai=$(dirname $(readlink -f "$0")) # Current script directory +outdir="${wai}/../" +cdrom="${outdir}/cdrom.img" +isodir="$(mktemp -d)" # Mount point (where the floppy will be mounted temporally +kernel="$outdir/src/boucane" + +[ ! -e "$kernel" ] && { echo "Boucane not found!"; exit 1; } + +check_for () { + command -v "$1" &>/dev/null || { echo "Command $1 not found!"; exit 1; } +} + +check_for grub-mkconfig + +mkdir -p $isodir/boot/grub +cat <<EOT >> $isodir/boot/grub/grub.cfg +set timeout=0 +menuentry "kernel" { + multiboot2 /boot/boucane + boot +} +EOT +cp $kernel "$isodir/boot/" +grub-mkrescue -o "$cdrom" $isodir + +rm -rf "$isodir" |
