class CriticalException(Exception):
"""Throw critical exception if the exact error is not known but fatal.
class CriticalException(Exception):
"""Throw critical exception if the exact error is not known but fatal.
"""
bootloader_dirs = ['/boot/isolinux/', '/boot/syslinux/']
for directory in bootloader_dirs:
"""
bootloader_dirs = ['/boot/isolinux/', '/boot/syslinux/']
for directory in bootloader_dirs:
- logging.critical("Fatal: error executing grub-install "
- + "(please check the grml2usb FAQ or drop the --grub option)")
- logging.critical("Note: if using grub2 consider using "
- + "the --grub-mbr option as grub considers PBR problematic.")
+ logging.critical("Fatal: error executing grub-install " +
+ "(please check the grml2usb FAQ or drop the --grub option)")
+ logging.critical("Note: if using grub2 consider using " +
+ "the --grub-mbr option as grub considers PBR problematic.")
- raise CriticalException("Error executing mount: %s already mounted - " % source
- + "please unmount before invoking grml2usb")
+ raise CriticalException("Error executing mount: %s already mounted - " % source +
+ "please unmount before invoking grml2usb")
if os.path.isdir(source):
logging.debug("Source %s is not a device, therefore not mounting.", source)
if os.path.isdir(source):
logging.debug("Source %s is not a device, therefore not mounting.", source)
logging.warning("Warning: Grml releases older than 2011.12 support only one flavour in grub.")
for expr in name, 'distri.cfg', \
logging.warning("Warning: Grml releases older than 2011.12 support only one flavour in grub.")
for expr in name, 'distri.cfg', \
- defaults_file, 'grml.png', 'hd.cfg', 'isolinux.cfg', 'isolinux.bin', \
- 'isoprompt.cfg', 'options.cfg', \
- 'prompt.cfg', 'vesamenu.cfg', 'grml.png', '*.c32':
+ defaults_file, 'grml.png', 'hd.cfg', 'isolinux.cfg', 'isolinux.bin', \
+ 'isoprompt.cfg', 'options.cfg', \
+ 'prompt.cfg', 'vesamenu.cfg', 'grml.png', '*.c32':
glob_and_copy(iso_mount + source_dir + expr, syslinux_target)
for filename in glob.glob1(syslinux_target, "*.c32"):
glob_and_copy(iso_mount + source_dir + expr, syslinux_target)
for filename in glob.glob1(syslinux_target, "*.c32"):
def add_entry_if_not_present(filename, entry):
"""Write entry into filename if entry is not already in the file
def add_entry_if_not_present(filename, entry):
"""Write entry into filename if entry is not already in the file
@entry: data to write to the file
"""
data = open(filename, "a+")
@entry: data to write to the file
"""
data = open(filename, "a+")
- logging.critical("Fatal: grub-install not available (please install the "
- + "grub package or drop the --grub option)")
+ logging.critical("Fatal: grub-install not available (please install the " +
+ "grub package or drop the --grub option)")
- logging.critical("Fatal: syslinux not available (please install the "
- + "syslinux package or use the --grub option)")
+ logging.critical("Fatal: syslinux not available (please install the " +
+ "syslinux package or use the --grub option)")