help="format specified partition with FAT16")
parser.add_option("--force", dest="force", action="store_true",
help="force any actions requiring manual interaction")
-parser.add_option("--grub", dest="grub", action="store_true",
- help="install grub bootloader instead of syslinux")
parser.add_option("--initrd", dest="initrd", action="store", type="string",
help="install specified initrd instead of the default [TODO]")
parser.add_option("--kernel", dest="kernel", action="store", type="string",
help="install specified kernel instead of the default [TODO]")
-parser.add_option("--lilo", dest="lilo", action="store", type="string",
+parser.add_option("--lilo-binary", dest="lilobin", action="store", type="string",
help="lilo executable to be used for installing MBR")
parser.add_option("--mbr-manager", dest="mbrmgr", action="store_true",
- help="enable boot manager menu in MBR")
+ help="enable interactive boot manager menu in MBR")
parser.add_option("--quiet", dest="quiet", action="store_true",
help="do not output anything but just errors on console")
parser.add_option("--skip-addons", dest="skipaddons", action="store_true",
help="do not install /boot/addons/ files")
parser.add_option("--skip-mbr", dest="skipmbr", action="store_true",
help="do not install a master boot record (MBR) on the device")
+parser.add_option("--syslinux", dest="syslinux", action="store_true",
+ help="install syslinux bootloader instead of grub")
parser.add_option("--syslinux-mbr", dest="syslinuxmbr", action="store_true",
help="install syslinux master boot record (MBR) instead of default")
parser.add_option("--squashfs", dest="squashfs", action="store", type="string",
initrd /boot/addons/balder10.imz
}
+menuentry "MirBSD" {
+ set root=(hd0,%(install_partition)s)
+ linux /boot/addons/bsd4grml/ldbsd.com
+}
+
menuentry "Boot OS of first partition on first disk" {
set root=(hd0,1)
chainloader +1
kernel (hd0,%(install_partition)s)/boot/release/%(grml_flavour)s/linux26 apm=power-off lang=us vga=791 quiet boot=live nomce module=%(grml_flavour)s
initrd (hd0,%(install_partition)s)/boot/release/%(grml_flavour)s/initrd.gz
+title Memory test (memtest86+)
+kernel (hd0,%(install_partition)s)/boot/addons/memtest
+
+title Grub - all in one image
+kernel (hd0,%(install_partition)s)/boot/addons/memdisk
+initrd (hd0,%(install_partition)s)/boot/addons/allinone.img
+
+title FreeDOS
+kernel (hd0,%(install_partition)s)/boot/addons/memdisk
+initrd (hd0,%(install_partition)s)/boot/addons/balder10.imz
+
+title MirBSD
+kernel (hd0,%(install_partition)s)/boot/addons/bsd4grml/ldbsd.com
+
""" % {'grml_flavour': grml_flavour, 'local_datestamp': local_datestamp, 'bootoptions': bootoptions, 'install_partition': install_partition } )
KERNEL /boot/addons/memdisk
APPEND initrd=/boot/addons/balder10.imz
+# bsd
+LABEL bsd
+MENU LABEL bsd
+KERNEL /boot/addons/bsd4grml/ldbsd.com
+
## end of global configuration
""" % {'grml_flavour': grml_flavour, 'local_datestamp': local_datestamp, 'bootoptions': bootoptions} )
@device: partition where bootloader should be installed to"""
- # Install bootloader on the device (/dev/sda),
- # not on the partition itself (/dev/sda1)?
- #if partition[-1:].isdigit():
- # device = re.match(r'(.*?)\d*$', partition).group(1)
- #else:
- # device = partition
-
- if options.grub:
- install_grub(device)
- else:
+ # by default we use grub, so install syslinux only on request
+ if options.syslinux:
try:
install_syslinux(device)
except CriticalException, error:
logging.critical("Fatal: %s" % error)
cleanup()
sys.exit(1)
+ else:
+ try:
+ install_grub(device)
+ except CriticalException, error:
+ logging.critical("Fatal: %s" % error)
+ cleanup()
+ sys.exit(1)
def install_lilo_mbr(lilo, device):
else:
lilo = '/usr/share/grml2usb/lilo/lilo.static.i386'
# finally prefer a specified lilo executable
- if options.lilo:
- lilo = options.lilo
+ if options.lilobin:
+ lilo = options.lilobin
if not is_exe(lilo):
raise Exception("lilo executable can not be execute")
proc = subprocess.Popen(["install", "--mode=664", allinoneimg, addons + 'allinone.img'])
proc.wait()
+ # bsd imag
+ bsdimg = search_file('bsd4grml', iso_mount)
+ if bsdimg is None:
+ logging.warn("Warning: bsd4grml not found - can not install it")
+ else:
+ logging.debug("cp -a %s %s" % (bsdimg, addons + '/'))
+ proc = subprocess.Popen(["cp", "-a", bsdimg, addons + '/'])
+ proc.wait()
+
# freedos image
balderimg = search_file('balder10.imz', iso_mount)
if balderimg is None:
grub_target + 'ascii.pff'])
proc.wait()
- if not os.path.isfile("/usr/share/grml2usb/grub/stage2_eltorito"):
- logging.critical("Error: /usr/share/grml2usb/grub/stage2_eltorito can not be read.")
- raise
- else:
- logging.debug("cp /usr/share/grml2usb/grub/stage2_eltorito to %s" % grub_target + 'stage2_eltorito')
- proc = subprocess.Popen(["install", "--mode=664", '/usr/share/grml2usb/grub/stage2_eltorito',
- grub_target + 'stage2_eltorito'])
- proc.wait()
-
def install_iso_files(grml_flavour, iso_mount, device, target):
"""Copy files from ISO on given target"""
main_identifier = re.compile(".*main config generated at: %s.*" % re.escape(str(DATESTAMP)))
if not re.match(main_identifier, string):
grub1_config_file = open(grub1_cfg, 'w')
- logging.info("Note: grml flavour %s is being installed as the default booting system." % grml_flavour)
+ # logging.info("Note: grml flavour %s is being installed as the default booting system." % grml_flavour)
grub1_config_file.write(generate_main_grub1_config(grml_flavour, install_partition, bootopt))
grub1_config_file.close()
else:
grub_flavour_config = True
if os.path.isfile(grub1_cfg):
string = open(grub1_cfg).readlines()
- logging.info("Note: you can boot flavour %s using '%s' on the commandline." % (grml_flavour, grml_flavour))
+ # logging.info("Note: you can boot flavour %s using '%s' on the commandline." % (grml_flavour, grml_flavour))
flavour = re.compile("grml2usb for %s: %s" % (re.escape(grml_flavour), re.escape(str(DATESTAMP))))
for line in string:
if flavour.match(line):
def handle_bootloader_config(grml_flavour, device, target):
"""TODO"""
- if options.grub:
- handle_grub_config(grml_flavour, device, target)
- else:
+ if options.syslinux:
handle_syslinux_config(grml_flavour, target)
+ else:
+ handle_grub_config(grml_flavour, device, target)
def handle_iso(iso, device):