#!/usr/bin/env python3 import os from pathlib import Path from shutil import copyfile build_root = Path(os.environ['MESON_BUILD_ROOT']) source_root = Path(os.environ['MESON_SOURCE_ROOT']) install_dir = build_root / 'sys' target_dir = install_dir / 'image/efi/boot' os.makedirs(target_dir, exist_ok=True) ovmf_file = 'OVMF_X64.fd' copyfile(source_root / ovmf_file, install_dir / ovmf_file) efi_file = 'BOOTX64.EFI' copyfile(build_root / efi_file, target_dir / efi_file)