Debian Codegraph @

debian/patches/misc/tools-pygrub-remove-static-solaris-support

raw
1 From: Bastian Blank <[email protected]>
2 Date: Sat, 5 Jul 2014 11:47:29 +0200
3 Subject: Remove static solaris support from pygrub
4
5 Patch-Name: tools-pygrub-remove-static-solaris-support
6 ---
7 tools/pygrub/src/pygrub | 41 +----------------------------------------
8 1 file changed, 1 insertion(+), 40 deletions(-)
9
10 diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
11 index e1657c4..1756a68 100755
12 --- a/tools/pygrub/src/pygrub
13 +++ b/tools/pygrub/src/pygrub
14 @@ -809,42 +809,6 @@ def run_grub(file, entry, fs, cfg_args):
15
16 return grubcfg
17
18 -# If nothing has been specified, look for a Solaris domU. If found, perform the
19 -# necessary tweaks.
20 -def sniff_solaris(fs, cfg):
21 - if not fs.file_exists("/platform/i86xpv/kernel/unix") and \
22 - not fs.file_exists("/platform/i86xpv/kernel/amd64/unix"):
23 - return cfg
24 -
25 - if not cfg["kernel"]:
26 - if fs.file_exists("/platform/i86xpv/kernel/amd64/unix"):
27 - cfg["kernel"] = "/platform/i86xpv/kernel/amd64/unix"
28 - cfg["ramdisk"] = "/platform/i86pc/amd64/boot_archive"
29 - elif fs.file_exists("/platform/i86xpv/kernel/unix"):
30 - cfg["kernel"] = "/platform/i86xpv/kernel/unix"
31 - cfg["ramdisk"] = "/platform/i86pc/boot_archive"
32 - else:
33 - return cfg
34 -
35 - # Unpleasant. Typically we'll have 'root=foo -k' or 'root=foo /kernel -k',
36 - # and we need to maintain Xen properties (root= and ip=) and the kernel
37 - # before any user args.
38 -
39 - xenargs = ""
40 - userargs = ""
41 -
42 - if not cfg["args"]:
43 - cfg["args"] = cfg["kernel"]
44 - else:
45 - for arg in cfg["args"].split():
46 - if re.match("^root=", arg) or re.match("^ip=", arg):
47 - xenargs += arg + " "
48 - elif arg != cfg["kernel"]:
49 - userargs += arg + " "
50 - cfg["args"] = xenargs + " " + cfg["kernel"] + " " + userargs
51 -
52 - return cfg
53 -
54 def sniff_netware(fs, cfg):
55 if not fs.file_exists("/nwserver/xnloader.sys"):
56 return cfg
57 @@ -1053,10 +1017,7 @@ if __name__ == "__main__":
58 try:
59 fs = xenfsimage.open(file, offset, bootfsoptions)
60
61 - chosencfg = sniff_solaris(fs, incfg)
62 -
63 - if not chosencfg["kernel"]:
64 - chosencfg = sniff_netware(fs, incfg)
65 + chosencfg = sniff_netware(fs, incfg)
66
67 if not chosencfg["kernel"]:
68 chosencfg = run_grub(file, entry, fs, incfg["args"])