summaryrefslogtreecommitdiffstats
path: root/config/binary_local-hooks/15-syslinux_sysappend
blob: bbba340cbf7d5a1dc02f6ae5c9a818fdd951e486 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash

set -e

# Including common functions
. "${LB_BASE:-/usr/share/live/build}"/scripts/build.sh

# Setting static variables
DESCRIPTION="$(Echo 'adding SYSAPPEND parameter to the syslinux menu')"
HELP=""
USAGE="${PROGRAM}"

# Reading configuration files
Read_conffiles config/all config/bootstrap config/common config/binary
Set_defaults

# Safeguards
if [ "${LB_BOOTLOADER}" != "syslinux" ]
then
	exit 0
fi
if [ "${LB_ARCHITECTURE}" != "i386" ]
then
	exit 0
fi

# Seems like we'll have work to do
Echo_message "adding SYSAPPEND parameter to the syslinux menu"

# Setting boot method specific variables
case "${LB_BINARY_IMAGES}" in
	iso|iso-hybrid)
		SYSLINUX_PATH="binary/isolinux"
		SYSLINUX_CFG="${SYSLINUX_PATH}/isolinux.cfg"
		;;
	usb-hdd)
		SYSLINUX_PATH="binary/syslinux"
		SYSLINUX_CFG="${SYSLINUX_PATH}/syslinux.cfg"
		;;
esac

# Setting variables
SYSLINUX_LIVE_CFG="${SYSLINUX_PATH}/live.cfg"

# Patch live.cfg to add the SYSAPPEND parameter
perl -pi -E 'if (/^(\s+)append\s+/) { say "$1sysappend 0x40000"}' "${SYSLINUX_LIVE_CFG}"