import struct
# global variables
-PROG_VERSION = "0.9.25"
+PROG_VERSION = "0.9.26~git"
MOUNTED = set() # register mountpoints
TMPFILES = set() # register tmpfiles
DATESTAMP = time.mktime(datetime.datetime.now().timetuple()) # unique identifier for syslinux.cfg
" (wrong UID/permissions or device/directory not present?)" % partition)
if filesystem != "vfat":
- raise CriticalException("Partition %s does not contain a FAT16 filesystem. "
- + "(Use --fat16 or run mkfs.vfat %s)" % (partition, partition))
+ raise CriticalException(
+ "Partition %s does not contain a FAT16 filesystem." % (partition) \
+ + "(Use --fat16 or run mkfs.vfat %s)" % (partition))
except OSError:
raise CriticalException("Sorry, /sbin/blkid not available (install e2fsprogs?)")
modify_grub_config(grub2_cfg)
+def get_bootoptions(grml_flavour):
+ """Returns bootoptions for specific flavour
+
+ @grml_flavour: name of the grml_flavour
+ """
+ # do NOT write "None" in kernel cmdline
+ if options.bootoptions is None:
+ bootopt = ""
+ else:
+ bootopt = options.bootoptions
+ bootopt = bootopt.replace("%flavour", grml_flavour)
+ return bootopt
+
+
def handle_grub_config(grml_flavour, device, target):
"""Main handler for generating grub (v1 and v2) configuration
else:
raise CriticalException("error validating partition schema (raw device?)")
- # do NOT write "None" in kernel cmdline
- if options.bootoptions is None:
- bootopt = ""
- else:
- bootopt = options.bootoptions
+
+ bootopt = get_bootoptions(grml_flavour)
# write menu.lst
handle_grub1_config(grml_flavour, install_grub1_partition, grub_target, bootopt)
bootid_re = re.compile("bootid=[\w_-]+")
live_media_path_re = re.compile("live-media-path=[\w_/-]+")
- # do NOT write "None" in kernel cmdline
- if options.bootoptions is None:
- bootopt = ""
- else:
- bootopt = options.bootoptions
+ bootopt = get_bootoptions(flavour)
regexe = []
option_re = None