summaryrefslogtreecommitdiff
path: root/mksyslinux.sh
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2018-06-26 10:11:43 +0800
committerIru Cai <mytbk920423@gmail.com>2018-06-26 10:11:43 +0800
commit83df9af6f3fdf72d6dc7605b0a74a4c25cd96bfd (patch)
tree4f2a47e4a5ffa8a0017793c93b47e8da2e665994 /mksyslinux.sh
parent6945e44775e740dfe0a59ed959782f7a3f121f4f (diff)
downloadliveusb-builder-83df9af6f3fdf72d6dc7605b0a74a4c25cd96bfd.tar.xz
Use syslinux as legacy BIOS bootloader
- Install syslinux by default, fallback to GRUB - Generate syslinux.cfg
Diffstat (limited to 'mksyslinux.sh')
-rwxr-xr-xmksyslinux.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/mksyslinux.sh b/mksyslinux.sh
new file mode 100755
index 0000000..f433fe8
--- /dev/null
+++ b/mksyslinux.sh
@@ -0,0 +1,31 @@
+# Copyright (C) 2018 Iru Cai <mytbk920423@gmail.com>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# generate syslinux menuentry
+# usage: UUID="$UUID" ISOFILE="$ISOFILE" LABEL="$LABEL" \
+# ./mkgrubcfg.sh <entryfile>
+#
+# variables in entryfile:
+# - UUID: the UUID of the partition
+# - ISOFILE: the file name of iso (needed to pass to the entry file)
+# - LABEL: syslinux label
+#
+# parameters in entry file:
+# - TITLE: GRUB menu entry title
+# - KERNEL: path to kernel image
+# - INITRD: path to initramfs/initrd image
+# - OPTION: kernel command line
+# - X64: y/n, indicates whether it's 64-bit
+
+source "$1"
+_INITRD=$(echo ${INITRD[*]}|sed 's/ /,/g')
+
+cat << EOF
+LABEL $LABEL
+MENU LABEL $TITLE
+LINUX $KERNEL
+INITRD $_INITRD
+APPEND $OPTION
+EOF
+
+echo