]> git.ipfire.org Git - people/shoehn/ipfire.org.git/commitdiff
BIO: Update method how this is working and update to iPXE.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 24 May 2013 15:35:46 +0000 (17:35 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 24 May 2013 15:35:46 +0000 (17:35 +0200)
static/netboot/custom.gpxe [deleted file]
static/netboot/menu.c32
static/netboot/premenu.cfg
static/netboot/pxelinux.0 [new file with mode: 0644]
static/netboot/vesamenu.c32
webapp/__init__.py
webapp/handlers_boot.py

diff --git a/static/netboot/custom.gpxe b/static/netboot/custom.gpxe
deleted file mode 100644 (file)
index e06369a..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!gpxe
-input id "Enter configuration ID to boot (eg, 1000)"
-imgfree
-chain http://boot.ipfire.org/config/${id}/boot.gpxe
index ffea9cca221822dd0c55bac50174c12821701619..348c6b87a9b437884cce03cfe955dd89575d5cc9 100644 (file)
Binary files a/static/netboot/menu.c32 and b/static/netboot/menu.c32 differ
index 210492664f50560682866267d8463d80f014bbfe..5068e617164b9adff17299fe517a2e16fecb25d4 100644 (file)
@@ -1,3 +1,5 @@
+UI menu.c32
+
 menu color title        * #FFFFFFFF *
 menu color sel          * #ffffffff #999999ff *
 menu color hotsel       1;7;37;40 #ffffffff #999999ff *
@@ -31,16 +33,3 @@ label text
   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
diff --git a/static/netboot/pxelinux.0 b/static/netboot/pxelinux.0
new file mode 100644 (file)
index 0000000..528ad2c
Binary files /dev/null and b/static/netboot/pxelinux.0 differ
index f348094726e904825e12ba7e78d9428f00d734eb..c466582b7a7e6b292a98c6a4a05ae91a2206ba4c 100755 (executable)
Binary files a/static/netboot/vesamenu.c32 and b/static/netboot/vesamenu.c32 differ
index 10b1cf1d60d30f4f3598c8453f74cca8b2b11875..c613ac86902d1afbde7cbb216a61f10260181f65 100644 (file)
@@ -184,7 +184,7 @@ class Application(tornado.web.Application):
                        (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 }),
                ])
 
index 298389361fe718caeb502cb6480835c981d949fd..93e8d18ec87357dd897aafe593f9a8184a86802d 100644 (file)
@@ -36,12 +36,41 @@ class MenuGPXEHandler(BootBaseHandler):
                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):