summaryrefslogtreecommitdiffstats
path: root/config/binary_local-hooks/10-syslinux_customize
blob: 660121fb2aa9cf3776ad59bdcc3c7223e3ee652d (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash

set -e

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

# Setting static variables
DESCRIPTION="$(Echo 'removing buggy syslinux help')"
HELP=""
USAGE="${PROGRAM}"

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

if [ "${LB_BOOTLOADER}" != "syslinux" ]
then
	exit 0
fi

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

Echo_message "customize buggy syslinux help"

# Remove help menu entry from menu.cfg (and every line after)
CFG_FILE="${SYSLINUX_PATH}/menu.cfg"
perl -pni -E 'exit if m{^label[[:blank:]]+help$}' "${CFG_FILE}"

Echo_message "customize syslinux menu"

sed -i -e "s/Boot menu//" "${CFG_FILE}"
sed -i -e "s/menu label Live/menu label Tails/" "${SYSLINUX_PATH}"/live*.cfg
sed -i -r -e 's/(menu label .* )\(failsafe\)/\1(Troubleshooting Mode)/' \
    "${SYSLINUX_PATH}"/live*.cfg

cat > "${SYSLINUX_PATH}/tails.cfg" << EOF
menu color sel      *           #ffffffff   #55555555   *
menu color hotsel   1;7;37;40   #ffffffff   #22222222   *

menu width 53
menu vshift 12
menu rows 7
menu helpmsgrow 15
menu cmdlinerow 13
menu timeoutrow 16
menu tabmsgrow 18
EOF

sed -i -e '/^include stdmenu\.cfg/a include tails.cfg' "${CFG_FILE}"

# no need to use absolute paths to find splash images
sed -e 's,/isolinux/,,' -i "${SYSLINUX_PATH}/stdmenu.cfg"

# remove useless files that break incremental upgrades
rm "${SYSLINUX_PATH}"/{exithelp,prompt}.cfg