Add TODO file.
[grml-rescueboot.git] / 42_grml
1 #! /bin/sh -e
2 # Filename:      42_grml
3 # Purpose:       grub-mkconfig helper script for Grml rescue systems
4 # Authors:       grml-team (grml.org), (c) Andreas Gredler <jimmy@grml.org>, Michael Prokop <mika@grml.org>
5 # Bug-Reports:   see http://grml.org/bugs/
6 # License:       This file is licensed under the GPL v2+.
7 ################################################################################
8
9 prefix=/usr
10 exec_prefix=${prefix}
11 bindir=${exec_prefix}/bin
12 libdir=${exec_prefix}/lib
13 . ${libdir}/grub/grub-mkconfig_lib
14
15 list=$(for i in /boot/grml/*.iso ; do
16         if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
17       done)
18
19 if [ -r /etc/default/grml-rescueboot ] ; then
20   . /etc/default/grml-rescueboot
21 fi
22
23 for grmliso in $list ; do
24   rel_dirname="$(make_system_path_relative_to_its_root $(dirname $grmliso))"
25   grml="$(basename $grmliso)"
26
27   echo "Found Grml ISO image: $grmliso" >&2
28   title="Grml Rescue System ($grml)"
29
30   cat << EOF
31 menuentry "${title}" {
32         iso_path="${rel_dirname}/$grml $CUSTOM_BOOTOPTIONS"
33         export iso_path
34         loopback loop "${rel_dirname}/$grml"
35         set root=(loop)
36         configfile /boot/grub/loopback.cfg
37 }
38 EOF
39 done
40
41 ## END OF FILE #################################################################