From 83df9af6f3fdf72d6dc7605b0a74a4c25cd96bfd Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Tue, 26 Jun 2018 10:11:43 +0800 Subject: Use syslinux as legacy BIOS bootloader - Install syslinux by default, fallback to GRUB - Generate syslinux.cfg --- install_syslinux | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 install_syslinux (limited to 'install_syslinux') diff --git a/install_syslinux b/install_syslinux new file mode 100755 index 0000000..d4fdbf9 --- /dev/null +++ b/install_syslinux @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright (C) 2018 Iru Cai +# SPDX-License-Identifier: GPL-3.0-or-later + +# Example: ./install_syslinux /dev/sdb /dev/sdb1 /media/boot +set -e + +SYSLINUX_BIOS=/usr/lib/syslinux/bios +DEVNAME="$1" +BOOTPART="$2" +BOOTPATH="$3" + +test -d "$SYSLINUX_BIOS" +syslinux -i "$BOOTPART" +dd bs=440 count=1 conv=notrunc if="$SYSLINUX_BIOS/mbr.bin" of="$DEVNAME" +install -d "$BOOTPATH/syslinux" +cp "$SYSLINUX_BIOS"/*.c32 "$BOOTPATH/syslinux" -- cgit v1.2.3