+def copy_addons(iso_mount, target):
+ """TODO"""
+ addons = target + '/boot/addons/'
+ execute(mkdir, addons)
+
+ # grub all-in-one image
+ allinoneimg = search_file('allinone.img', iso_mount)
+ if allinoneimg is None:
+ logging.warn("Warning: allinone.img not found - can not install it")
+ else:
+ logging.debug("cp %s %s" % (allinoneimg, addons + '/allinone.img'))
+ proc = subprocess.Popen(["install", "--mode=664", allinoneimg, addons + 'allinone.img'])
+ proc.wait()
+
+ # freedos image
+ balderimg = search_file('balder10.imz', iso_mount)
+ if balderimg is None:
+ logging.warn("Warning: balder10.imz not found - can not install it")
+ else:
+ logging.debug("cp %s %s" % (balderimg, addons + '/balder10.imz'))
+ proc = subprocess.Popen(["install", "--mode=664", balderimg, addons + 'balder10.imz'])
+ proc.wait()
+
+ # memtest86+ image
+ memdiskimg = search_file('memdisk', iso_mount)
+ if memdiskimg is None:
+ logging.warn("Warning: memdisk not found - can not install it")
+ else:
+ logging.debug("cp %s %s" % (memdiskimg, addons + '/memdisk'))
+ proc = subprocess.Popen(["install", "--mode=664", memdiskimg, addons + 'memdisk'])
+ proc.wait()
+
+
+def copy_bootloader_files(iso_mount, target):
+ """"TODO"""
+
+ syslinux_target = target + '/boot/syslinux/'
+ execute(mkdir, syslinux_target)
+
+ logo = search_file('logo.16', iso_mount)
+ logging.debug("cp %s %s" % (logo, syslinux_target + 'logo.16'))
+ proc = subprocess.Popen(["install", "--mode=664", logo, syslinux_target + 'logo.16'])
+ proc.wait()
+
+ for ffile in 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10':
+ bootsplash = search_file(ffile, iso_mount)
+ logging.debug("cp %s %s" % (bootsplash, syslinux_target + ffile))
+ proc = subprocess.Popen(["install", "--mode=664", bootsplash, syslinux_target + ffile])
+ proc.wait()
+
+ grub_target = target + '/boot/grub/'
+ execute(mkdir, grub_target)
+
+ if not os.path.isfile("/usr/share/grml2usb/grub/splash.xpm.gz"):
+ logging.critical("Error: /usr/share/grml2usb/grub/splash.xpm.gz can not be read.")
+ raise
+ else:
+ logging.debug("cp /usr/share/grml2usb/grub/splash.xpm.gz %s" % grub_target + 'splash.xpm.gz')
+ proc = subprocess.Popen(["install", "--mode=664", '/usr/share/grml2usb/grub/splash.xpm.gz',
+ grub_target + 'splash.xpm.gz'])