encoded = json.dumps(j).encode()
if len(encoded) > section.SizeOfRawData:
raise PEError(
- f'Not enough space in existing section .pcrsig of size {section.SizeOfRawData} to append new data of size {len(encoded)}' # noqa: E501
+ f'Not enough space in existing section .pcrsig of size {section.SizeOfRawData} to append new data of size {len(encoded)}'
)
section.Misc_VirtualSize = len(encoded)
# bytes(n) results in an array of n zeroes
if names[0] != '.profile':
raise ValueError(
- f'Expected .profile section as first valid section in PE profile binary {profile} but got {names[0]}' # noqa: E501
+ f'Expected .profile section as first valid section in PE profile binary {profile} but got {names[0]}'
)
if names.count('.profile') > 1:
if not work:
raise ValueError(
- 'genkey: --secureboot-private-key=/--secureboot-certificate= or --pcr-private-key/--pcr-public-key must be specified' # noqa: E501
+ 'genkey: --secureboot-private-key=/--secureboot-certificate= or --pcr-private-key/--pcr-public-key must be specified'
)
elif self.type:
conv = self.type
else:
- conv = lambda s: s # noqa: E731
+ conv = lambda s: s
# This is a bit ugly, but --initrd and --devicetree-auto are the only options
# with multiple args on the command line and a space-separated list in the
ConfigItem(
'--secureboot-private-key',
dest='sb_key',
- help='required by --signtool=sbsign|systemd-sbsign. Path to key file or engine/provider designation for SB signing', # noqa: E501
+ help='required by --signtool=sbsign|systemd-sbsign. Path to key file or engine/provider designation for SB signing',
config_key='UKI/SecureBootPrivateKey',
),
ConfigItem(
'--secureboot-certificate',
dest='sb_cert',
help=(
- 'required by --signtool=sbsign. sbsign needs a path to certificate file or engine-specific designation for SB signing' # noqa: E501
+ 'required by --signtool=sbsign. sbsign needs a path to certificate file or engine-specific designation for SB signing'
),
config_key='UKI/SecureBootCertificate',
),
dest='sb_certdir',
default='/etc/pki/pesign',
help=(
- 'required by --signtool=pesign. Path to nss certificate database directory for PE signing. Default is /etc/pki/pesign' # noqa: E501
+ 'required by --signtool=pesign. Path to nss certificate database directory for PE signing. Default is /etc/pki/pesign'
),
config_key='UKI/SecureBootCertificateDir',
config_push=ConfigItem.config_set,
'--secureboot-certificate-name',
dest='sb_cert_name',
help=(
- 'required by --signtool=pesign. pesign needs a certificate nickname of nss certificate database entry to use for PE signing' # noqa: E501
+ 'required by --signtool=pesign. pesign needs a certificate nickname of nss certificate database entry to use for PE signing'
),
config_key='UKI/SecureBootCertificateName',
),
# both param given, infer sbsign and in case it was given, ensure signtool=sbsign
if opts.signtool and opts.signtool not in ('sbsign', 'systemd-sbsign'):
raise ValueError(
- f'Cannot provide --signtool={opts.signtool} with --secureboot-private-key= and --secureboot-certificate=' # noqa: E501
+ f'Cannot provide --signtool={opts.signtool} with --secureboot-private-key= and --secureboot-certificate='
)
if not opts.signtool:
opts.signtool = 'sbsign'
if opts.sign_kernel and not opts.sb_key and not opts.sb_cert_name:
raise ValueError(
- '--sign-kernel requires either --secureboot-private-key= and --secureboot-certificate= (for sbsign) or --secureboot-certificate-name= (for pesign) to be specified' # noqa: E501
+ '--sign-kernel requires either --secureboot-private-key= and --secureboot-certificate= (for sbsign) or --secureboot-certificate-name= (for pesign) to be specified'
)
opts.profile = resolve_at_path(opts.profile)
*(['--forward-journal', journal_file] if journal_file else []),
*(
[
- '--credential', f'systemd.extra-unit.emergency-exit.service={shlex.quote(EMERGENCY_EXIT_SERVICE)}', # noqa: E501
+ '--credential', f'systemd.extra-unit.emergency-exit.service={shlex.quote(EMERGENCY_EXIT_SERVICE)}',
'--credential', f'systemd.unit-dropin.emergency.target={shlex.quote(EMERGENCY_EXIT_DROPIN)}',
]
if not sys.stdin.isatty()
iter = os.environ['GITHUB_RUN_ATTEMPT']
runner = os.environ['TEST_RUNNER']
artifact = (
- f'ci-{wf}-{id}-{iter}-{summary.distribution}-{summary.release}-{runner}-failed-test-journals' # noqa: E501
+ f'ci-{wf}-{id}-{iter}-{summary.distribution}-{summary.release}-{runner}-failed-test-journals'
)
ops += [f'gh run download {id} --name {artifact} -D ci/{artifact}']
journal_file = Path(f'ci/{artifact}/test/journal/{name}.journal')