Run wrap-and-sort -a on debian directory
[grml-rescueboot.git] / 42_grml
diff --git a/42_grml b/42_grml
index 08108a4..8cfdb3f 100755 (executable)
--- a/42_grml
+++ b/42_grml
@@ -1,8 +1,7 @@
 #!/bin/sh
 # Filename:      42_grml
 # Purpose:       grub-mkconfig helper script for Grml rescue systems
-# Authors:       grml-team (grml.org), (c) Andreas Gredler <jimmy@grml.org>, Michael Prokop <mika@grml.org>
-# Bug-Reports:   see http://grml.org/bugs/
+# Authors:       Grml team (grml.org), (c) Andreas Gredler <jimmy@grml.org>, Michael Prokop <mika@grml.org>
 # License:       This file is licensed under the GPL v2+.
 ################################################################################
 
@@ -12,7 +11,14 @@ prefix=/usr
 exec_prefix=${prefix}
 bindir=${exec_prefix}/bin
 libdir=${exec_prefix}/lib
-. ${libdir}/grub/grub-mkconfig_lib
+
+if [ -r ${libdir}/grub/grub-mkconfig_lib ] ; then
+  . ${libdir}/grub/grub-mkconfig_lib
+elif [ -r /usr/share/grub/grub-mkconfig_lib ] ; then # fallback for e.g. Fedora
+  . /usr/share/grub/grub-mkconfig_lib
+else
+  echo "Could not locate file grub-mkconfig_lib, please report a bug." >&2
+fi
 
 # default unless configured otherwise:
 ISO_LOCATION="/boot/grml"
@@ -101,10 +107,11 @@ for grmliso in $iso_list ; do
 
   echo "Found Grml ISO image: $grmliso" >&2
   title="Grml Rescue System ($grml)"
+  grub_prep=$(prepare_grub_to_access_device "$device" | sed -e "s/^/        /")
 
   cat << EOF
 menuentry "${title}" {
-$(prepare_grub_to_access_device "$device" | sed -e "s/^/        /")
+${grub_prep}
         iso_path="${rel_dirname}/${grml}"
         export iso_path
         kernelopts=" $CUSTOM_BOOTOPTIONS $additional_param "