[elbe-devel] [PATCH 1/3] grub-legacy: Add target XML and command support

bage at linutronix.de bage at linutronix.de
Tue Jan 28 23:25:08 CET 2020


From: Christian Teklenborg <chris at linutronix.de>

Add grub-legacy to the available bootloaders in elbe.
This includes the support for the <grub-install/> element
and the initvm's hdimg command.

Signed-off-by: Christian Teklenborg <chris at linutronix.de>
Signed-off-by: Bastian Germann <bage at linutronix.de>
---
 elbepack/commands/hdimg.py | 4 ++--
 elbepack/elbeproject.py    | 7 +++----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/elbepack/commands/hdimg.py b/elbepack/commands/hdimg.py
index 7a7d65555..1ec2c287c 100644
--- a/elbepack/commands/hdimg.py
+++ b/elbepack/commands/hdimg.py
@@ -40,7 +40,7 @@ def run_command(argv):
         type="int",
         dest="grub_version",
         default=202,
-        help="use specific grub version (possible values are 0 and 202)")
+        help="use specific grub version (possible values are 0, 97, and 202)")
 
     (opt, args) = oparser.parse_args(argv)
 
@@ -62,7 +62,7 @@ def run_command(argv):
     if opt.skip_grub:
         opt.grub_version = 0
 
-    if opt.grub_version not in [0, 202]:
+    if opt.grub_version not in [0, 97, 202]:
         print("invalid grub version")
         oparser.print_help()
         sys.exit(20)
diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
index bc32c25d0..75cb74196 100644
--- a/elbepack/elbeproject.py
+++ b/elbepack/elbeproject.py
@@ -589,8 +589,6 @@ class ElbeProject (object):
             self.buildenv.rfs.write_licenses(f, pkgnames, lic_xml_fname)
 
         # Use some handwaving to determine grub version
-        #
-        # We might also want support for legacy grub
         grub_arch = "ia32" if self.arch == "i386" else self.arch
         grub_fw_type = []
         grub_version = 0
@@ -608,8 +606,9 @@ class ElbeProject (object):
             grub_fw_type.append("shimfix")
         if self.get_rpcaptcache().is_installed('grub-legacy'):
             logging.warning("package grub-legacy is installed, "
-                            "this is obsolete, skipping grub")
-            grub_fw_type = []
+                            "this is obsolete.")
+            grub_version = 97
+            grub_fw_type.append("bios")
         elif not grub_fw_type:
             logging.warning("neither package grub-pc nor grub-efi-%s-bin "
                             "are installed, skipping grub",
-- 
2.20.1




More information about the elbe-devel mailing list