2
0
mirror of https://github.com/mbusb/multibootusb synced 2024-11-01 15:40:16 +00:00
multibootusb/scripts/menus.py

38 lines
1.2 KiB
Python
Raw Normal View History

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Name: menus.py
# Purpose: Module contain custom menu entries for fewer distros
# Authors: Sundar
# Licence: This file is a part of multibootusb package. You can redistribute it or modify
# under the terms of GNU General Public License, v.2 or above
from . import iso
from . import config
from . import grub
def pc_tool_config(syslinux=True, grub=False):
"""
Menu entry for PC Tool ISO
:param syslinux:
:param grub:
:return:
"""
if syslinux is True:
return """LABEL livecd
KERNEL /system/stage1
APPEND initrd=/system/stage2 root=/dev/ram0 rw rdinit=/linuxrc video=vesa:ywrap,mtrr vga=0x303 loglevel=0 splash boot=cdrom\n"""
elif grub is True:
return """menuentry """ + iso.iso_basename(config.image_path) + """ {
linux /system/stage1 root=/dev/ram0 rw rdinit=/linuxrc video=vesa:ywrap,mtrr vga=0x303 loglevel=0 splash boot=cdrom
initrd /system/stage2\n}"""
def grub2only():
return """MENU LABEL """ + iso.iso_basename(config.image_path) + """
Linux /multibootusb/grub/lnxboot.img
INITRD /multibootusb/grub/core.img
TEXT HELP
Switch to GRUB2 to select boot options.
ENDTEXT\n"""