Re-add mtools to Depends as they are just suggests of syslinux package
[grml2usb.git] / grml2usb-compat
index c03c0af..a490fb6 100755 (executable)
@@ -18,7 +18,7 @@ from inspect import isroutine, isclass
 import datetime, logging, os, re, subprocess, sys, tempfile, time, os.path
 
 # global variables
-PROG_VERSION = "0.9.14-compat"
+PROG_VERSION = "0.9.20"
 MOUNTED = set()  # register mountpoints
 TMPFILES = set() # register tmpfiles
 DATESTAMP = time.mktime(datetime.datetime.now().timetuple()) # unique identifier for syslinux.cfg
@@ -291,17 +291,48 @@ menuentry "Boot FreeDOS" {
     initrd  /boot/addons/balder10.imz
 }
 
-menuentry "Boot MirOS bsd4grml" {
-    multiboot /boot/addons/bsd4grml/ldbsd.com
-    module    /boot/addons/bsd4grml/bsd.rd
-    module    /boot/addons/bsd4grml/boot.1
-    module    /boot/addons/bsd4grml/boot.2
-    module    /boot/addons/bsd4grml/boot.3
-    module    /boot/addons/bsd4grml/boot.4
-    module    /boot/addons/bsd4grml/boot.5
-    module    /boot/addons/bsd4grml/boot.6
-    module    /boot/addons/bsd4grml/boot.cfg
-}
+if [ ${iso_path} ] ; then
+    # assume loopback.cfg boot
+    if [ -e /boot/addons/bsd4grml/loopback.0 ] ; then
+        # bsd4grml 20100815 and later
+        menuentry "Boot MirOS bsd4grml" {
+            multiboot /boot/addons/bsd4grml/ldbsd.com
+            module /boot/addons/bsd4grml/bsd.rd bsd
+            module /boot/addons/bsd4grml/loopback.0 boot.cfg
+            module /boot/addons/bsd4grml/loopback.1 boot.1
+            module /boot/addons/bsd4grml/loopback.2 boot.2
+            module /boot/addons/bsd4grml/loopback.3 boot.3
+            module /boot/addons/bsd4grml/loopback.4 boot.4
+            module /boot/addons/bsd4grml/loopback.5 boot.5
+            module /boot/addons/bsd4grml/loopback.6 boot.6
+        }
+    else
+        # old bsd4grml
+        menuentry "Boot MirOS bsd4grml" {
+            multiboot /boot/addons/bsd4grml/ldbsd.com
+            module /boot/addons/bsd4grml/bsd.rd bsd.rd
+            module /boot/addons/bsd4grml/boot.cfg boot.cfg
+            module /boot/addons/bsd4grml/boot.1 boot.1
+            module /boot/addons/bsd4grml/boot.2 boot.2
+            module /boot/addons/bsd4grml/boot.3 boot.3
+            module /boot/addons/bsd4grml/boot.4 boot.4
+            module /boot/addons/bsd4grml/boot.5 boot.5
+        }
+    fi
+else
+    # assume grub.cfg boot
+    menuentry "Boot MirOS bsd4grml" {
+        multiboot /boot/addons/bsd4grml/ldbsd.com
+        module /boot/addons/bsd4grml/bsd.rd bsd.rd
+        module /boot/addons/bsd4grml/boot.cfg boot.cfg
+        module /boot/addons/bsd4grml/boot.1 boot.1
+        module /boot/addons/bsd4grml/boot.2 boot.2
+        module /boot/addons/bsd4grml/boot.3 boot.3
+        module /boot/addons/bsd4grml/boot.4 boot.4
+        module /boot/addons/bsd4grml/boot.5 boot.5
+        module /boot/addons/bsd4grml/boot.6 boot.6
+    }
+fi
 
 menuentry "Boot OS of first partition on first disk" {
     set root=(hd0,1)
@@ -345,7 +376,7 @@ menuentry "%(grml_flavour)s2ram        - copy compressed grml file to RAM" {
 ## flavour specific configuration for %(grml_flavour)s [grml2usb for %(grml_flavour)s: %(local_datestamp)s]
 menuentry "%(grml_flavour)s-debug      - enable debugging options" {
     set gfxpayload=1024x768x16,1024x768
-    linux /boot/release/%(grml_flavour)s/linux26 apm=power-off boot=live nomce quiet live-media-path=/live/%(grml_flavour)s/ debug boot=live initcall_debug%(bootoptions)s
+    linux /boot/release/%(grml_flavour)s/linux26 apm=power-off boot=live nomce quiet live-media-path=/live/%(grml_flavour)s/ debug initcall_debug%(bootoptions)s
     initrd /boot/release/%(grml_flavour)s/initrd.gz
 }
 
@@ -364,7 +395,7 @@ menuentry "%(grml_flavour)s-nofb       - disable framebuffer" {
 
 ## flavour specific configuration for %(grml_flavour)s [grml2usb for %(grml_flavour)s: %(local_datestamp)s]
 menuentry "%(grml_flavour)s-failsafe   - disable hardware detection" {
-    linux /boot/release/%(grml_flavour)s/linux26 apm=power-off boot=live nomce quiet live-media-path=/live/%(grml_flavour)s/ vga=normal boot=live noautoconfig atapicd noapic noacpi acpi=off nomodules nofirewire noudev nousb nohotplug noapm nopcmcia nosmp maxcpus=0 noscsi noagp nodma ide=nodma noswap nofstab nosound nogpm nosyslog nodhcp nocpu nodisc nomodem xmodule=vesa noraid nolvm noresume selinux=0 edd=off pci=nomsi %(bootoptions)s
+    linux /boot/release/%(grml_flavour)s/linux26 apm=power-off boot=live nomce quiet live-media-path=/live/%(grml_flavour)s/ vga=normal noautoconfig atapicd noapic noacpi acpi=off nomodules nofirewire noudev nousb nohotplug noapm nopcmcia nosmp maxcpus=0 noscsi noagp nodma ide=nodma noswap nofstab nosound nogpm nosyslog nodhcp nocpu nodisc nomodem xmodule=vesa noraid nolvm noresume selinux=0 edd=off pci=nomsi %(bootoptions)s
     initrd /boot/release/%(grml_flavour)s/initrd.gz
 }
 
@@ -406,7 +437,7 @@ initrd (hd0,%(install_partition)s)/boot/release/%(grml_flavour)s/initrd.gz
 
 ## flavour specific configuration for %(grml_flavour)s [grml2usb for %(grml_flavour)s: %(local_datestamp)s]
 title %(grml_flavour)s-debug
-kernel (hd0,%(install_partition)s)/boot/release/%(grml_flavour)s/linux26 apm=power-off boot=live nomce vga=791 quiet live-media-path=/live/%(grml_flavour)s/ debug boot=live initcall_debug%(bootoptions)s
+kernel (hd0,%(install_partition)s)/boot/release/%(grml_flavour)s/linux26 apm=power-off boot=live nomce vga=791 quiet live-media-path=/live/%(grml_flavour)s/ debug initcall_debug%(bootoptions)s
 initrd (hd0,%(install_partition)s)/boot/release/%(grml_flavour)s/initrd.gz
 
 ## flavour specific configuration for %(grml_flavour)s [grml2usb for %(grml_flavour)s: %(local_datestamp)s]
@@ -421,7 +452,7 @@ initrd (hd0,%(install_partition)s)/boot/release/%(grml_flavour)s/initrd.gz
 
 ## flavour specific configuration for %(grml_flavour)s [grml2usb for %(grml_flavour)s: %(local_datestamp)s]
 title %(grml_flavour)s-failsafe
-kernel (hd0,%(install_partition)s)/boot/release/%(grml_flavour)s/linux26 apm=power-off boot=live nomce quiet live-media-path=/live/%(grml_flavour)s/ vga=normal boot=live noautoconfig atapicd noapic noacpi acpi=off nomodules nofirewire noudev nousb nohotplug noapm nopcmcia nosmp maxcpus=0 noscsi noagp nodma ide=nodma noswap nofstab nosound nogpm nosyslog nodhcp nocpu nodisc nomodem xmodule=vesa noraid nolvm noresume selinux=0 edd=off pci=nomsi %(bootoptions)s
+kernel (hd0,%(install_partition)s)/boot/release/%(grml_flavour)s/linux26 apm=power-off boot=live nomce quiet live-media-path=/live/%(grml_flavour)s/ vga=normal noautoconfig atapicd noapic noacpi acpi=off nomodules nofirewire noudev nousb nohotplug noapm nopcmcia nosmp maxcpus=0 noscsi noagp nodma ide=nodma noswap nofstab nosound nogpm nosyslog nodhcp nocpu nodisc nomodem xmodule=vesa noraid nolvm noresume selinux=0 edd=off pci=nomsi %(bootoptions)s
 initrd (hd0,%(install_partition)s)/boot/release/%(grml_flavour)s/initrd.gz
 
 ## flavour specific configuration for %(grml_flavour)s [grml2usb for %(grml_flavour)s: %(local_datestamp)s]
@@ -586,7 +617,7 @@ APPEND initrd=/boot/release/%(grml_flavour)s/initrd.gz apm=power-off boot=live n
 # flavour specific configuration for %(grml_flavour)s [grml2usb for %(grml_flavour)s: %(local_datestamp)s]
 LABEL  %(grml_flavour)s-debug
 KERNEL /boot/release/%(grml_flavour)s/linux26
-APPEND initrd=/boot/release/%(grml_flavour)s/initrd.gz apm=power-off boot=live nomce vga=791 quiet live-media-path=/live/%(grml_flavour)s/ debug boot=live initcall_debug%(bootoptions)s
+APPEND initrd=/boot/release/%(grml_flavour)s/initrd.gz apm=power-off boot=live nomce vga=791 quiet live-media-path=/live/%(grml_flavour)s/ debug initcall_debug%(bootoptions)s
 
 # flavour specific configuration for %(grml_flavour)s [grml2usb for %(grml_flavour)s: %(local_datestamp)s]
 LABEL  %(grml_flavour)s-x
@@ -601,7 +632,7 @@ APPEND initrd=/boot/release/%(grml_flavour)s/initrd.gz apm=power-off boot=live n
 # flavour specific configuration for %(grml_flavour)s [grml2usb for %(grml_flavour)s: %(local_datestamp)s]
 LABEL  %(grml_flavour)s-failsafe
 KERNEL /boot/release/%(grml_flavour)s/linux26
-APPEND initrd=/boot/release/%(grml_flavour)s/initrd.gz apm=power-off boot=live nomce quiet live-media-path=/live/%(grml_flavour)s/ vga=normal boot=live noautoconfig atapicd noapic noacpi acpi=off nomodules nofirewire noudev nousb nohotplug noapm nopcmcia nosmp maxcpus=0 noscsi noagp nodma ide=nodma noswap nofstab nosound nogpm nosyslog nodhcp nocpu nodisc nomodem xmodule=vesa noraid nolvm noresume selinux=0 edd=off pci=nomsi %(bootoptions)s
+APPEND initrd=/boot/release/%(grml_flavour)s/initrd.gz apm=power-off boot=live nomce quiet live-media-path=/live/%(grml_flavour)s/ vga=normal noautoconfig atapicd noapic noacpi acpi=off nomodules nofirewire noudev nousb nohotplug noapm nopcmcia nosmp maxcpus=0 noscsi noagp nodma ide=nodma noswap nofstab nosound nogpm nosyslog nodhcp nocpu nodisc nomodem xmodule=vesa noraid nolvm noresume selinux=0 edd=off pci=nomsi %(bootoptions)s
 
 # flavour specific configuration for %(grml_flavour)s [grml2usb for %(grml_flavour)s: %(local_datestamp)s]
 LABEL  %(grml_flavour)s-forensic
@@ -1322,7 +1353,7 @@ def handle_grub2_config(grml_flavour, grub_target, bootopt):
 
     # grub2 config
     grub2_cfg = grub_target + 'grub.cfg'
-    logging.debug("Creating grub2 configuration file (grub.lst)")
+    logging.debug("Creating grub2 configuration file (grub.cfg)")
 
     global GRML_DEFAULT