Skip to content

Commit

Permalink
iso: Support RHEL-derived distros
Browse files Browse the repository at this point in the history
Several distros (Fedora is the most common one) have grub commands
prefixed grub2- instead of grub-. So support that in iso.sh by
autodetecting the command.

Signed-off-by: Pedro Falcato <[email protected]>
  • Loading branch information
heatd committed Sep 10, 2023
1 parent 7de7cd9 commit 797f1b4
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions scripts/iso.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mkdir -p isodir/boot/grub
INITRD_GEN_SCRIPT=$1

if [ "$INITRD_GEN_SCRIPT" = "" ]; then
INITRD_GEN_SCRIPT="scripts/default-initrd.sh"
INITRD_GEN_SCRIPT="scripts/default-initrd.sh"
fi

SYSTEM_ROOT=$DESTDIR scripts/geninitrd "$INITRD_GEN_SCRIPT"
Expand All @@ -21,7 +21,7 @@ echo "Compressing kernel"
xz -9 -e -f isodir/boot/vmonyx
#zstd -15 isodir/boot/vmonyx

cat > isodir/boot/grub/grub.cfg << EOF
cat >isodir/boot/grub/grub.cfg <<EOF
set default="0"
set timeout=5
menuentry "Onyx" {
Expand All @@ -40,4 +40,16 @@ menuentry "Onyx" {
boot
}
EOF
grub-mkrescue -o Onyx.iso isodir # Change this acording to your distro/OS.

GRUB_MKRESCUE=""

if command -v grub-mkrescue; then
GRUB_MKRESCUE="grub-mkrescue"
elif command -v grub2-mkrescue; then
GRUB_MKRESCUE="grub2-mkrescue"
else
echo "grub-mkrescue not found! Please install it."
exit 1
fi

$GRUB_MKRESCUE -o Onyx.iso isodir

0 comments on commit 797f1b4

Please sign in to comment.