Skip to content

Commit 685163c

Browse files
committed
uki_addons: remove completely sbat/sbat.conf
JIRA: https://issues.redhat.com/browse/RHEL-92594 Upstream Status: RHEL-Only sbat/sbat.conf is not really useful, because usually the SBAT description contains the kernel version. We will pass it directly as input parameter, so that it comes from the kernel.spec and contains all info that it has to provide. Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
1 parent 06792db commit 685163c

File tree

2 files changed

+4
-25
lines changed

2 files changed

+4
-25
lines changed

redhat/scripts/uki_addons/uki_create_addons.py

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@
2626
# json['virt']['common']['test.addon'] = ['test2'], any other uki except virt
2727
# will have a test.addon.efi with text "test1", and virt will have a
2828
# 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.
3729

3830
import os
3931
import sys
@@ -62,37 +54,26 @@ def check_clean_arguments(input_json, out_dir):
6254
UKICmdlineAddon = collections.namedtuple('UKICmdlineAddon', ['name', 'cmdline'])
6355
uki_addons_list = []
6456
uki_addons = {}
65-
addon_sbat_string = None
6657

67-
def parse_lines(lines, rstrip=True):
58+
def parse_lines(lines):
6859
cmdline = ''
6960
for l in lines:
7061
l = l.lstrip()
7162
if not l:
7263
continue
7364
if l[0] == '#':
7465
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() + ' '
8067
if cmdline == '':
8168
return ''
8269
return cmdline
8370

8471
def parse_all_addons(in_obj):
85-
global addon_sbat_string
86-
8772
for el in in_obj.keys():
8873
# addon found: copy it in our global dict uki_addons
8974
if el.endswith('.addon'):
9075
uki_addons[el] = in_obj[el]
9176

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-
9677
def recursively_find_addons(in_obj, folder_list):
9778
# end of recursion, leaf directory. Search all addons here
9879
if len(folder_list) == 0:
@@ -128,8 +109,6 @@ def create_addons(out_dir):
128109
f'{UKIFY_PATH}', 'build',
129110
'--cmdline', uki_addon.cmdline,
130111
'--output', out_path]
131-
if addon_sbat_string:
132-
cmd.extend(['--sbat', addon_sbat_string.rstrip()])
133112

134113
subprocess.check_call(cmd, text=True)
135114

redhat/scripts/uki_addons/uki_create_json.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# The name of the end resulting addon is taken from the folder hierarchy, but this
2222
# is handled by uki_create_addons.py when building the rpm. This script only
2323
# prepares the json file to be added in the srpm. For more information about
24-
# the folder hierarchy, what the 'common' and 'sbat' folder are, look at
24+
# the folder hierarchy and what the 'common' folder is, look at
2525
# uki_create_addons.py.
2626
#
2727
# The common folder, present in any folder under redhat/uki_addons
@@ -51,7 +51,7 @@ def usage(err):
5151
sys.exit(1)
5252

5353
def find_addons():
54-
cmd = ['/usr/bin/find', 'uki_addons', "(", '-name', '*.addon', '-o', '-name', 'sbat.conf', ")"]
54+
cmd = ['/usr/bin/find', 'uki_addons', '-name', '*.addon']
5555
proc_out = subprocess.run(cmd, check=True, capture_output=True, text=True)
5656
if proc_out.returncode == 0:
5757
return proc_out.stdout

0 commit comments

Comments
 (0)