]> git.ipfire.org Git - ipfire.org.git/commitdiff
netboot: Make version detection easier by adding our own version field
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 11 Oct 2017 19:43:37 +0000 (21:43 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 11 Oct 2017 19:43:37 +0000 (21:43 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
static/netboot/ipxe.kpxe
webapp/handlers_boot.py

index 75cd559ae8f8ef917b8f7a21614f0872bdf7923a..8096b724b085985fe0cffb9517ee50188b1cd446 100644 (file)
Binary files a/static/netboot/ipxe.kpxe and b/static/netboot/ipxe.kpxe differ
index bea3acef0cfe824e15cccf9e9f65e6ac7363b33c..0fc23c03529cc22c5ed404583fb6848838174714 100644 (file)
@@ -14,6 +14,8 @@ from handlers_base import BaseHandler
 
 BASEDIR = os.path.dirname(__file__)
 
+LATEST_VERSION = "2.0"
+
 def word_wrap(s, width=45):
        paragraphs = s.split('\n')
        lines = []
@@ -49,32 +51,14 @@ class BootBaseHandler(BaseHandler):
 
 
 class MenuGPXEHandler(BootBaseHandler):
+
        """
                menu.gpxe
        """
        def get(self):
-               # 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" or version == "1.0.0+":
-                                       return self.serve_update()
-
-                               # This is an outdated git build
-                                for v in ("c4bce", "300a371"):
-                                    if v in version:
-                                        return self.serve_update()
+                version = self.get_argument("version", None)
+                if not version or version < LATEST_VERSION:
+                    return self.serve_update()
 
                # Deliver content
                self.set_header("Content-Type", "text/plain")