10-syslinux_customize 1.63 KB
Newer Older
amnesia's avatar
amnesia committed
1
2
#!/bin/bash

3
4
set -e

amnesia's avatar
amnesia committed
5
# Including common functions
6
. "${LB_BASE:-/usr/share/live/build}"/scripts/build.sh
amnesia's avatar
amnesia committed
7
8
9
10
11
12
13
14
15
16

# 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

17
if [ "${LB_BOOTLOADER}" != "syslinux" ]
amnesia's avatar
amnesia committed
18
19
20
21
22
then
	exit 0
fi

# Setting boot method specific variables
23
case "${LB_BINARY_IMAGES}" in
24
	iso|iso-hybrid)
amnesia's avatar
amnesia committed
25
26
27
28
29
30
31
		SYSLINUX_PATH="binary/isolinux"
		;;
	usb-hdd)
		SYSLINUX_PATH="binary/syslinux"
		;;
esac

Tails developers's avatar
Tails developers committed
32
33
Echo_message "customize buggy syslinux help"

34
# Remove help menu entry from menu.cfg (and every line after)
amnesia's avatar
amnesia committed
35
CFG_FILE="${SYSLINUX_PATH}/menu.cfg"
36
perl -pni -E 'exit if m{^label[[:blank:]]+help$}' "${CFG_FILE}"
Tails developers's avatar
Tails developers committed
37
38
39

Echo_message "customize syslinux menu"

40
sed -i -e "s/Boot menu//" "${CFG_FILE}"
41
sed -i -e "s/menu label Live/menu label Tails/" "${SYSLINUX_PATH}"/live*.cfg
42
sed -i -r -e 's/(menu label .* )\(failsafe\)/\1(Troubleshooting Mode)/' \
43
    "${SYSLINUX_PATH}"/live*.cfg
44
sed -i -r -e 's/(append .*)/\1\n\tsysappend 0x40000/g' "${SYSLINUX_PATH}"/live*.cfg
Tails developers's avatar
Tails developers committed
45
46
47
48

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

50
menu width 53
51
52
53
54
55
56
menu vshift 12
menu rows 7
menu helpmsgrow 15
menu cmdlinerow 13
menu timeoutrow 16
menu tabmsgrow 18
Tails developers's avatar
Tails developers committed
57
58
59
60
EOF

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

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

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