File: tools-pygrub-remove-static-solaris-support

package info (click to toggle)
xen 4.20.0%2B68-g35cb38b222-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 39,144 kB
  • sloc: ansic: 539,752; asm: 9,162; python: 7,986; sh: 7,667; makefile: 6,650; ml: 5,544; perl: 4,187; cpp: 1,885; lex: 828; yacc: 645; pascal: 533; awk: 274; xml: 51; exp: 39; sed: 4
file content (68 lines) | stat: -rw-r--r-- 2,438 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
From: Bastian Blank <waldi@debian.org>
Date: Sat, 5 Jul 2014 11:47:29 +0200
Subject: Remove static solaris support from pygrub

Patch-Name: tools-pygrub-remove-static-solaris-support
---
 tools/pygrub/src/pygrub | 41 +----------------------------------------
 1 file changed, 1 insertion(+), 40 deletions(-)

diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index e1657c4..1756a68 100755
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -809,42 +809,6 @@ def run_grub(file, entry, fs, cfg_args):
 
     return grubcfg
 
-# If nothing has been specified, look for a Solaris domU. If found, perform the
-# necessary tweaks.
-def sniff_solaris(fs, cfg):
-    if not fs.file_exists("/platform/i86xpv/kernel/unix") and \
-       not fs.file_exists("/platform/i86xpv/kernel/amd64/unix"):
-        return cfg
-
-    if not cfg["kernel"]:
-        if fs.file_exists("/platform/i86xpv/kernel/amd64/unix"):
-            cfg["kernel"] = "/platform/i86xpv/kernel/amd64/unix"
-            cfg["ramdisk"] = "/platform/i86pc/amd64/boot_archive"
-        elif fs.file_exists("/platform/i86xpv/kernel/unix"):
-            cfg["kernel"] = "/platform/i86xpv/kernel/unix"
-            cfg["ramdisk"] = "/platform/i86pc/boot_archive"
-        else:
-            return cfg
-
-    # Unpleasant. Typically we'll have 'root=foo -k' or 'root=foo /kernel -k',
-    # and we need to maintain Xen properties (root= and ip=) and the kernel
-    # before any user args.
-
-    xenargs = ""
-    userargs = ""
-
-    if not cfg["args"]:
-        cfg["args"] = cfg["kernel"]
-    else:
-        for arg in cfg["args"].split():
-            if re.match("^root=", arg) or re.match("^ip=", arg):
-                xenargs += arg + " "
-            elif arg != cfg["kernel"]:
-                userargs += arg + " "
-        cfg["args"] = xenargs + " " + cfg["kernel"] + " " + userargs
-
-    return cfg
-
 def sniff_netware(fs, cfg):
     if not fs.file_exists("/nwserver/xnloader.sys"):
         return cfg
@@ -1053,10 +1017,7 @@ if __name__ == "__main__":
         try:
             fs = xenfsimage.open(file, offset, bootfsoptions)
 
-            chosencfg = sniff_solaris(fs, incfg)
-
-            if not chosencfg["kernel"]:
-                chosencfg = sniff_netware(fs, incfg)
+            chosencfg = sniff_netware(fs, incfg)
 
             if not chosencfg["kernel"]:
                 chosencfg = run_grub(file, entry, fs, incfg["args"])