diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2021-04-19 19:06:28 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2021-04-19 19:06:28 +0200 |
| commit | ca1e725b0dc9b10997897dd2ac6d44028601d9bb (patch) | |
| tree | 0eb7bd087a2382d1d1a660ceda1eae01d1b8b3ca /tools/gen_grub_cdrom.sh | |
| parent | f5146ca9c987ed5e6ea69a0c67b7ed03444be30c (diff) | |
Init sources
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" |
