X-Git-Url: https://git.grml.org/?a=blobdiff_plain;ds=sidebyside;f=grml2usb;h=c139f72854af2b81e8947cf32e846646fa1c691b;hb=29d54d4a9505cf92bae9fc4ba24b6253bdadedc9;hp=ac700f19887dc6d625a13b281347f54c139b4396;hpb=ef2f28e996c9d5b6313be87ee957c0d9a578e822;p=grml2usb.git diff --git a/grml2usb b/grml2usb index ac700f1..c139f72 100755 --- a/grml2usb +++ b/grml2usb @@ -315,7 +315,7 @@ def get_defaults_file(iso_mount, flavour, name): return ('', '') -def search_file(filename, search_path='/bin' + os.pathsep + '/usr/bin', lst_return=False): +def search_file(filename, search_path='/bin' + os.pathsep + '/usr/bin', lst_return=False, required=False): """Given a search path, find file @filename: name of file to search for @@ -344,6 +344,10 @@ def search_file(filename, search_path='/bin' + os.pathsep + '/usr/bin', lst_retu retval.append(os.path.abspath(os.path.join(current_dir, filename))) if not lst_return: break + + if required and not retval: + raise CriticalException("Required file %s not found in %s" % (filename, search_path)) + if lst_return: return retval elif retval: @@ -1108,7 +1112,7 @@ def copy_bootloader_files(iso_mount, target, grml_flavour): grub_target = target + '/boot/grub/' execute(mkdir, grub_target) - logo = search_file('logo.16', iso_mount) + logo = search_file('logo.16', iso_mount, required=True) exec_rsync(logo, syslinux_target + 'logo.16') bootx64_efi = search_file('bootx64.efi', iso_mount) @@ -1851,14 +1855,14 @@ def check_programs(): def load_loop(): - """Runs modprobe loop and throws away it's output""" + """Runs modprobe loop and throws away its output""" if not which("modprobe"): logging.critical("Fatal: modprobe not available, can not continue - sorry.") logging.critical("Hint: is /sbin missing in PATH?") sys.exit(1) proc = subprocess.Popen(["modprobe", "loop"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - proc.wait() + proc.communicate() def main(): @@ -1928,6 +1932,8 @@ def main(): except Exception as error: logging.critical("Fatal: %s", str(error)) + if options.verbose: + logging.exception("Exception:") sys.exit(1)