summaryrefslogtreecommitdiff
path: root/install_syslinux
blob: 0f110a4fbcd6a22b5724c31aaaf122a0d42916ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
# Copyright (C)  2018 Iru Cai <mytbk920423@gmail.com>
# 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"

if [ ! -d "$SYSLINUX_BIOS" ]; then
	SYSLINUX_BIOS=/usr/share/syslinux
fi

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"