+UI menu.c32
+
menu color title * #FFFFFFFF *
menu color sel * #ffffffff #999999ff *
menu color hotsel 1;7;37;40 #ffffffff #999999ff *
endtext
kernel menu.c32
append menu.cfg
-
-menu separator
-
-label chain
- menu label Boot a configuration directly...
- text help
- Select this option and enter a configuration ID to boot it directly.
- endtext
- kernel custom.gpxe
-
-label exit
- menu label Quit to gPXE command line
- menu quit
(r"/config/([0-9]+)/boot.gpxe", BootGPXEHandler),
# Static files
- (r"/(boot.png|custom.gpxe|premenu.cfg|vesamenu.c32|menu.c32)",
+ (r"/(boot\.png|premenu\.cfg|pxelinux\.0|menu\.c32|vesamenu\.c32)",
tornado.web.StaticFileHandler, { "path" : BOOT_STATIC_PATH }),
])
menu.gpxe
"""
def get(self):
- # XXX Check if version of the bootloader is allright
+ # Check if version of the bootloader is recent enough.
+ # Otherwise send the latest version of the PXE loader.
+ user_agent = self.request.headers.get("User-Agent", None)
+ if user_agent:
+ try:
+ client, version = user_agent.split("/")
+ except:
+ pass
+ else:
+ # We replaced gPXE by iPXE.
+ if client == "gPXE":
+ return self.serve_update()
+
+ # Everything under version 1.0.0 should be
+ # updated.
+ if version < "1.0.0":
+ return self.serve_update()
# Devliver content
self.set_header("Content-Type", "text/plain")
self.write("#!gpxe\n")
- self.write("chain menu.c32 premenu.cfg\n")
+
+ self.write("set 209:string premenu.cfg\n")
+ self.write("set 210:string http://boot.ipfire.org/\n")
+ self.write("chain pxelinux.0\n")
+
+ def serve_update(self):
+ self.set_header("Content-Type", "text/plain")
+ self.write("#!gpxe\n")
+
+ # Small warning
+ self.write("echo\necho Your copy of gPXE/iPXE is too old. ")
+ self.write("Upgrade to avoid seeing this every boot!\n")
+
+ self.write("chain http://mirror0.ipfire.org/releases/ipfire-boot/latest/ipxe.kpxe\n")
class MenuCfgHandler(BootBaseHandler):