X-Git-Url: https://git.grml.org/?p=grml2usb.git;a=blobdiff_plain;f=grml2usb.py;h=ff8f96c6e27117234d1cc8e24b23607a82584874;hp=acc59bdbfe50a8a6386a7c0e5ca1ea62178b064b;hb=32a796adb98b54fbde22333031e0810355ac4989;hpb=fab3d15949833fa969fe376e8b0a4050ade42013 diff --git a/grml2usb.py b/grml2usb.py index acc59bd..ff8f96c 100755 --- a/grml2usb.py +++ b/grml2usb.py @@ -34,16 +34,16 @@ from inspect import isroutine, isclass import datetime, logging, os, re, subprocess, sys, tempfile, time # global variables -PROG_VERSION = "0.9.2" +PROG_VERSION = "0.9.2(pre1)" mounted = set() # register mountpoints tmpfiles = set() # register tmpfiles datestamp = time.mktime(datetime.datetime.now().timetuple()) # unique identifier for syslinux.cfg # cmdline parsing -usage = "Usage: %prog [options] <[ISO[s] | /live/image]> \n\ +usage = "Usage: %prog [options] <[ISO[s] | /live/image]> \n\ \n\ %prog installs a grml ISO to an USB device to be able to boot from it.\n\ -Make sure you have at least a grml ISO or a running grml system (/live/image),\n\ +Make sure you have at least one grml ISO or a running grml system (/live/image),\n\ syslinux (just run 'aptitude install syslinux' on Debian-based systems)\n\ and root access. Further information can be found in: man grml2usb" @@ -406,14 +406,21 @@ def install_mbr(device): if not is_writeable(device): raise IOError, "device not writeable for user" + # use specified lilo if options.lilo: lilo = options.lilo else: - from platform import architecture - if architecture()[0] == '64bit': - lilo = '/usr/share/grml2usb/lilo/lilo.static.amd64' + # otherwise try to use system's lilo + if which("lilo"): + lilo = which("lilo") + print "debug: lilo = %s" % lilo else: - lilo = '/usr/share/grml2usb/lilo/lilo.static.i386' + # finally fall back to our static version + from platform import architecture + if architecture()[0] == '64bit': + lilo = '/usr/share/grml2usb/lilo/lilo.static.amd64' + else: + lilo = '/usr/share/grml2usb/lilo/lilo.static.i386' if not is_exe(lilo): raise Exception, "lilo executable can not be execute"