|
26 | 26 | # json['virt']['common']['test.addon'] = ['test2'], any other uki except virt |
27 | 27 | # will have a test.addon.efi with text "test1", and virt will have a |
28 | 28 | # test.addon.efi with "test2" |
29 | | -# |
30 | | -# sbat.conf |
31 | | -#---------- |
32 | | -# This dict is containing the sbat string for *all* addons being created. |
33 | | -# This dict is optional, but when used has to be put in a sub-dict with |
34 | | -# { 'sbat' : { 'sbat.conf' : ['your text here'] }} |
35 | | -# It follows the same syntax as the addon files, meaning '#' is comment and |
36 | | -# the rest is taken as sbat string and feed to ukify. |
37 | 29 |
|
38 | 30 | import os |
39 | 31 | import sys |
@@ -62,37 +54,26 @@ def check_clean_arguments(input_json, out_dir): |
62 | 54 | UKICmdlineAddon = collections.namedtuple('UKICmdlineAddon', ['name', 'cmdline']) |
63 | 55 | uki_addons_list = [] |
64 | 56 | uki_addons = {} |
65 | | -addon_sbat_string = None |
66 | 57 |
|
67 | | -def parse_lines(lines, rstrip=True): |
| 58 | +def parse_lines(lines): |
68 | 59 | cmdline = '' |
69 | 60 | for l in lines: |
70 | 61 | l = l.lstrip() |
71 | 62 | if not l: |
72 | 63 | continue |
73 | 64 | if l[0] == '#': |
74 | 65 | continue |
75 | | - # rstrip is used only for addons cmdline, not sbat.conf, as it replaces |
76 | | - # return lines with spaces. |
77 | | - if rstrip: |
78 | | - l = l.rstrip() + ' ' |
79 | | - cmdline += l |
| 66 | + cmdline += l.rstrip() + ' ' |
80 | 67 | if cmdline == '': |
81 | 68 | return '' |
82 | 69 | return cmdline |
83 | 70 |
|
84 | 71 | def parse_all_addons(in_obj): |
85 | | - global addon_sbat_string |
86 | | - |
87 | 72 | for el in in_obj.keys(): |
88 | 73 | # addon found: copy it in our global dict uki_addons |
89 | 74 | if el.endswith('.addon'): |
90 | 75 | uki_addons[el] = in_obj[el] |
91 | 76 |
|
92 | | - if 'sbat' in in_obj and 'sbat.conf' in in_obj['sbat']: |
93 | | - # sbat.conf found: override sbat with the most specific one found |
94 | | - addon_sbat_string = parse_lines(in_obj['sbat']['sbat.conf'], rstrip=False) |
95 | | - |
96 | 77 | def recursively_find_addons(in_obj, folder_list): |
97 | 78 | # end of recursion, leaf directory. Search all addons here |
98 | 79 | if len(folder_list) == 0: |
@@ -128,8 +109,6 @@ def create_addons(out_dir): |
128 | 109 | f'{UKIFY_PATH}', 'build', |
129 | 110 | '--cmdline', uki_addon.cmdline, |
130 | 111 | '--output', out_path] |
131 | | - if addon_sbat_string: |
132 | | - cmd.extend(['--sbat', addon_sbat_string.rstrip()]) |
133 | 112 |
|
134 | 113 | subprocess.check_call(cmd, text=True) |
135 | 114 |
|
|
0 commit comments