error('python3 jinja2 missing')
endif
+python_310 = run_command(python, '-c',
+ 'import sys; sys.exit(0 if sys.version_info >= (3,10) else 1)',
+ check : false).returncode() == 0
+if get_option('ukify') == 'auto'
+ want_ukify = python_310
+elif get_option('ukify') == 'true' and not python310
+ error('ukify requires Python >= 3.10')
+else
+ want_ukify = get_option('ukify') == 'true'
+endif
+
############################################################
gperf = find_program('gperf')
args : [exe.full_path(), loaderentry_install])
endif
+if want_ukify
+ exe = custom_target(
+ 'ukify',
+ input : 'src/ukify/ukify.py',
+ output : 'ukify',
+ command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
+ install : true,
+ install_mode : 'rwxr-xr-x',
+ install_dir : rootlibexecdir)
+ public_programs += exe
+endif
+
############################################################
runtest_env = custom_target(
description : 'build against LLVM libFuzzer')
option('kernel-install', type: 'boolean', value: true,
description : 'install kernel-install and associated files')
+option('ukify', type : 'combo', choices : ['auto', 'true', 'false'],
+ description : 'install ukify')
option('analyze', type: 'boolean', value: true,
description : 'install systemd-analyze')
import pefile
+__version__ = '{{GIT_VERSION}}'
+
EFI_ARCH_MAP = {
# host_arch glob : [efi_arch, 32_bit_efi_arch if mixed mode is supported]
'x86_64' : ['x64', 'ia32'],
action=argparse.BooleanOptionalAction,
help='print systemd-measure output for the UKI')
+ p.add_argument('--version',
+ action='version',
+ version=f'ukify {__version__}')
+
opts = p.parse_args(args)
if opts.cmdline and opts.cmdline.startswith('@'):