Add memtest support.
[syslinux-debian/hramrach.git] / debian / local / extlinux-update.sh
blob706f2a0610f867ddf5afce26f20dab24e4810406
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 _EXTLINUX_DIRECTORY="/boot/extlinux"
14 Update ()
16 # Upate target file using source content
17 _TARGET="${1}"
18 _SOURCE="${2}"
20 _TMPFILE="${_TARGET}.tmp"
21 rm -f "${_TMPFILE}"
23 echo "${_SOURCE}" > "${_TMPFILE}"
25 if [ -e "${_TARGET}" ] && cmp -s "${_TARGET}" "${_TMPFILE}"
26 then
27 rm -f "${_TMPFILE}"
28 else
29 # FIXME: should use fsync here
30 echo "P: Updating ${_TARGET}..."
31 mv -f "${_TMPFILE}" "${_TARGET}"
35 for _FILE in /etc/default/extlinux /etc/default/extlinux.d/*
37 if [ -e "${_FILE}" ]
38 then
39 . "${_FILE}"
41 done