Imported Upstream version 24.1
[rrq/maintain_lilo.git] / hooks / initramfs / post-update.d / runlilo
1 #!/bin/sh
2 #
3 #  runlilo - postupdate script for modern initrd management
4 #
5 #  Copyright 2010-2014 Joachim Wiedorn
6 #  All rights reserved.
7 #
8 #  Licensed under the terms contained in the file 'COPYING'
9 #  in the source directory.
10 #
11
12 set -e
13 PAR=ever
14
15 # check for maintainer param
16 if [ ! -z "${DPKG_MAINTSCRIPT_PACKAGE}" ]
17 then PAR="${DPKG_MAINTSCRIPT_PACKAGE}"; fi
18
19 case "$PAR" in
20
21   linux-image-*)
22     # lilo will be updated later by the kernel postinst hook.
23     # no need to update it now.
24     true
25     ;;
26
27   *)
28     # Run the boot loader installer
29     # and ignore error on degraded mdadm RAID1
30     if [ -f /sbin/lilo ];then
31       if [ -f /etc/lilo.conf ];then
32         lilo -H  </dev/null  >&2
33       else
34         echo "Warning: Not updating LILO; /etc/lilo.conf not found!" >&2
35       fi
36     fi
37     ;;
38
39 esac
40
41 # end of file