0000-defaults: Add rewrite note.
[syslinux-debian/hramrach.git] / debian / local / extlinux.d / 0000-defaults
blob42e60d3540714cb51900bd396e9729b4b0af6d9a
1 #!/bin/sh
3 ## Copyright (C) 2006-2013 Daniel Baumann <mail@daniel-baumann.ch>
4 ##
5 ## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
6 ## This is free software, and you are welcome to redistribute it
7 ## under certain conditions; see COPYING for details.
10 set -e
12 . /usr/share/extlinux/extlinux-update.sh
14 # Checking extlinux directory
15 echo -n "P: Checking for EXTLINUX directory..."
17 # Creating extlinux directory
18 if [ ! -e "${_EXTLINUX_DIRECTORY}" ]
19 then
20 echo " not found."
22 echo -n "P: Creating EXTLINUX directory..."
23 mkdir -p "${_EXTLINUX_DIRECTORY}"
24 echo " done: ${_EXTLINUX_DIRECTORY}"
25 else
26 echo " found."
29 # Setting defaults
30 EXTLINUX_ALTERNATIVES="${EXTLINUX_ALTERNATIVES:-default recovery}"
31 EXTLINUX_DEFAULT="${EXTLINUX_DEFAULT:-l0}"
32 EXTLINUX_ENTRIES="${EXTLINUX_ENTRIES:-all}"
33 EXTLINUX_MEMDISK="${EXTLINUX_MEMDISK:-true}"
34 EXTLINUX_MEMDISK_DIRECTORY="${EXTLINXU_MEMDISK_DIRECTORY:-/boot}"
36 if [ -z "${EXTLINUX_MENU_LABEL}" ]
37 then
38 if [ -x "$(which lsb_release 2>/dev/null)" ]
39 then
40 EXTLINUX_MENU_LABEL="$(lsb_release -i -s) GNU/Linux, kernel"
41 else
42 EXTLINUX_MENU_LABEL="Debian GNU/Linux, kernel"
46 EXTLINUX_OS_PROBER="${EXTLINUX_OS_PROBER:-true}"
47 EXTLINUX_PARAMETERS="${EXTLINUX_PARAMETERS:-ro quiet}"
49 if [ -z "${EXTLINUX_ROOT}" ]
50 then
51 # Find root partition
52 while read _LINE
55 read _FS_SPEC _FS_FILE _FS_VFSTYPE _FS_MNTOPS _FS_FREQ _FS_PASSNO << EOF
56 ${_LINE}
57 EOF
59 if [ "${_FS_SPEC}" != "#" ] && [ "${_FS_FILE}" = "/" ]
60 then
61 EXTLINUX_ROOT="root=${_FS_SPEC}"
62 break
64 done < /etc/fstab
67 if [ -z "${EXTLINUX_THEME}" ]
68 then
69 # Using default menu if available
70 if [ -e /usr/share/EXTLINUX/themes/default ]
71 then
72 EXTLINUX_THEME="default"
73 else
74 EXTLINUX_THEME="none"
78 EXTLINUX_TIMEOUT="${EXTLINUX_TIMEOUT:-50}"
80 # Writing new default file
81 cat > "/etc/default/extlinux" << EOF
82 ## /etc/default/extlinux - configuration file for extlinux-update(8)
83 # This file is rewritten by a script. Any comments and unsuported options will be lost.
85 EXTLINUX_UPDATE="${EXTLINUX_UPDATE}"
87 EXTLINUX_ALTERNATIVES="${EXTLINUX_ALTERNATIVES}"
88 EXTLINUX_DEFAULT="${EXTLINUX_DEFAULT}"
89 EXTLINUX_ENTRIES="${EXTLINUX_ENTRIES}"
90 EXTLINUX_MEMDISK="${EXTLINUX_MEMDISK}"
91 EXTLINUX_MEMDISK_DIRECTORY="${EXTLINUX_MEMDISK_DIRECTORY}"
92 EXTLINUX_MENU_LABEL="${EXTLINUX_MENU_LABEL}"
93 EXTLINUX_OS_PROBER="${EXTLINUX_OS_PROBER}"
94 EXTLINUX_PARAMETERS="$(echo -n ${EXTLINUX_PARAMETERS} | sed -e 's|\"|\\\"|g')"
95 EXTLINUX_ROOT="${EXTLINUX_ROOT}"
96 EXTLINUX_THEME="${EXTLINUX_THEME}"
97 EXTLINUX_TIMEOUT="${EXTLINUX_TIMEOUT}"
98 EOF