Merge branch 'stable' into devel
[tails/pzajda.git] / config / binary_local-hooks / 10-syslinux_customize
blob214c487c9928e75478676956b720866fe571ad86
1 #!/bin/bash
3 set -e
5 # Including common functions
6 . "${LB_BASE:-/usr/share/live/build}"/scripts/build.sh
8 # Setting static variables
9 DESCRIPTION="$(Echo 'removing buggy syslinux help')"
10 HELP=""
11 USAGE="${PROGRAM}"
13 # Reading configuration files
14 Read_conffiles config/all config/common config/binary
15 Set_defaults
17 if [ "${LB_BOOTLOADER}" != "syslinux" ]
18 then
19 exit 0
22 # Setting boot method specific variables
23 case "${LB_BINARY_IMAGES}" in
24 iso|iso-hybrid)
25 SYSLINUX_PATH="binary/isolinux"
27 usb-hdd)
28 SYSLINUX_PATH="binary/syslinux"
30 esac
32 Echo_message "customize buggy syslinux help"
34 # Remove help menu entry from menu.cfg (and every line after)
35 CFG_FILE="${SYSLINUX_PATH}/menu.cfg"
36 perl -pni -E 'exit if m{^label[[:blank:]]+help$}' "${CFG_FILE}"
38 Echo_message "customize syslinux menu"
40 sed -i -e "s/Boot menu/Boot Tails/" "${CFG_FILE}"
42 cat > "${SYSLINUX_PATH}/tails.cfg" << EOF
43 menu color sel * #ffffffff #55555555 *
44 menu color hotsel 1;7;37;40 #ffffffff #22222222 *
46 menu vshift 12
47 menu rows 7
48 menu helpmsgrow 15
49 menu cmdlinerow 13
50 menu timeoutrow 16
51 menu tabmsgrow 18
52 EOF
54 sed -i -e '/^include stdmenu\.cfg/a include tails.cfg' "${CFG_FILE}"
56 # no need to use absolute paths to find splash images
57 sed -e 's,/isolinux/,,' -i "${SYSLINUX_PATH}/stdmenu.cfg"
59 # remove useless files that break incremental upgrades on Wheezy
60 rm "${SYSLINUX_PATH}"/{exithelp,prompt}.cfg