commit: fca47084c44969bbc8f7c851950646fcd659c591 Author: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org> AuthorDate: Wed Mar 20 10:12:56 2024 +0000 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org> CommitDate: Wed Mar 20 10:12:56 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fca47084
app-emulation/virt-firmware: add 24.2_p20240320 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org> app-emulation/virt-firmware/Manifest | 1 + ...virt-firmware-24.2-allow-cmdline-override.patch | 68 ---------------------- .../virt-firmware-24.2_p20240320.ebuild | 51 ++++++++++++++++ 3 files changed, 52 insertions(+), 68 deletions(-) diff --git a/app-emulation/virt-firmware/Manifest b/app-emulation/virt-firmware/Manifest index b076a294d071..c1abb573fd9d 100644 --- a/app-emulation/virt-firmware/Manifest +++ b/app-emulation/virt-firmware/Manifest @@ -1,2 +1,3 @@ DIST virt-firmware-24.2.tar.gz 110844 BLAKE2B db7ad7663678a313bdd0e23de7e374547e5dbc1a04b37a65e366ae042410a3a6c21ccfef3747a2534cb76906868caaf1364ac1ecd1443c1c1053a5b7687da50b SHA512 8583420acb31fb32e4c195c0c1816b36248ec2e486ded0795e51180e2690b2bcdc10eb8707f4fc9fa36da5b24082737c5c3b2e3988f6c5455e08a5d2a0ff92e7 DIST virt-firmware-24.2_p20240315.tar.gz 105633 BLAKE2B 6d43a00626403739cf40e9d1d9310c02b0a3794a66c61124f21f45714207b3700fe1e91f0bdb57968d03bd1b08b262327edf3e2271db5b7d7dfc33cf52dce7fd SHA512 cb7e10c8ecb65e90373199be30c1e44c6d89a7c1244780999f5a38de10366ad98b0b747ca471360dd3b38a018df883f21a6758cfeabf85f44d96f38622a19655 +DIST virt-firmware-24.2_p20240320.tar.gz 107008 BLAKE2B b647ae0a918a85614499741edcd2c9b9aff6b8223905849977600a1b845de4c58ff4c45365e2a40090d5112592a295d4b5c489a8b52203043960c81973dd299f SHA512 825c27d04dcc80e2f8b163906894e9279a11fdf442b45ecf1f1493d3eb1ce9c6047f1c363a39bc1cc4d8870bfa52afa6835abc8e102fd1f17416ebe9c3a65331 diff --git a/app-emulation/virt-firmware/files/virt-firmware-24.2-allow-cmdline-override.patch b/app-emulation/virt-firmware/files/virt-firmware-24.2-allow-cmdline-override.patch deleted file mode 100644 index 6dd774424784..000000000000 --- a/app-emulation/virt-firmware/files/virt-firmware-24.2-allow-cmdline-override.patch +++ /dev/null @@ -1,68 +0,0 @@ -https://gitlab.com/kraxel/virt-firmware/-/merge_requests/11 -diff --git a/man/kernel-bootcfg.1 b/man/kernel-bootcfg.1 -index 089d4dc..121304e 100644 ---- a/man/kernel-bootcfg.1 -+++ b/man/kernel-bootcfg.1 -@@ -38,6 +38,9 @@ update boot entry for UKI image FILE - \fB\-\-remove\-uki\fR FILE - remove boot entry for UKI image FILE - .TP -+\fB\-\-cmdline\fR CMDLINE -+override UKIs cmdline when adding boot entry (ignored when Secure Boot is enabled) CMDLINE -+.TP - \fB\-\-boot\-ok\fR, \fB\-\-boot\-successful\fR - boot is successful, update BootOrder to have current - entry listed first. -diff --git a/virt/firmware/bootcfg/main.py b/virt/firmware/bootcfg/main.py -index 65f2ad3..b809380 100644 ---- a/virt/firmware/bootcfg/main.py -+++ b/virt/firmware/bootcfg/main.py -@@ -71,6 +71,8 @@ def add_uki(cfg, options): - if not options.title: - logging.error('entry title not specified') - sys.exit(1) -+ if options.cmdline and cfg.secureboot: -+ logging.warning("Overriding built-in UKI cmdline is not possible when Secure Boot is enabled") - - efiuki = linuxcfg.LinuxEfiFile(options.adduki) - nr = cfg.find_uki_entry(efiuki.efi_filename()) -@@ -84,15 +86,25 @@ def add_uki(cfg, options): - if efishim.device != efiuki.device: - logging.error('shim and uki are on different filesystems') - sys.exit(1) -- optdata = ucs16.from_string(efiuki.efi_filename()) -+ if options.cmdline: -+ optdata = ucs16.from_string(efiuki.efi_filename() + ' ' + options.cmdline) -+ else: -+ optdata = ucs16.from_string(efiuki.efi_filename()) - entry = bootentry.BootEntry(title = ucs16.from_string(options.title), - attr = bootentry.LOAD_OPTION_ACTIVE, - devicepath = efishim.dev_path_file(), - optdata = bytes(optdata)) - else: -- entry = bootentry.BootEntry(title = ucs16.from_string(options.title), -- attr = bootentry.LOAD_OPTION_ACTIVE, -- devicepath = efiuki.dev_path_file()) -+ if options.cmdline: -+ optdata = ucs16.from_string(options.cmdline) -+ entry = bootentry.BootEntry(title = ucs16.from_string(options.title), -+ attr = bootentry.LOAD_OPTION_ACTIVE, -+ devicepath = efiuki.dev_path_file(), -+ optdata = bytes(optdata)) -+ else: -+ entry = bootentry.BootEntry(title = ucs16.from_string(options.title), -+ attr = bootentry.LOAD_OPTION_ACTIVE, -+ devicepath = efiuki.dev_path_file()) - - logging.info('Create new entry: %s', str(entry)) - nr = cfg.add_entry(entry) -@@ -229,6 +241,9 @@ def main(): - help = 'update boot entry for UKI image FILE', metavar = 'FILE') - group.add_argument('--remove-uki', dest = 'removeuki', type = str, - help = 'remove boot entry for UKI image FILE', metavar = 'FILE') -+ group.add_argument('--cmdline', dest = 'cmdline', type = str, -+ help = 'override UKIs cmdline when adding boot entry ' -+ '(ignored when Secure Boot is enabled)', metavar = 'CMDLINE') - group.add_argument('--boot-ok', '--boot-successful', dest = 'bootok', - action = 'store_true', default = False, - help = 'boot is successful, update BootOrder to have ' diff --git a/app-emulation/virt-firmware/virt-firmware-24.2_p20240320.ebuild b/app-emulation/virt-firmware/virt-firmware-24.2_p20240320.ebuild new file mode 100644 index 000000000000..bb4de7712a4e --- /dev/null +++ b/app-emulation/virt-firmware/virt-firmware-24.2_p20240320.ebuild @@ -0,0 +1,51 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) +DISTUTILS_USE_PEP517=setuptools + +inherit distutils-r1 systemd + +COMMIT="94db6a7d9eb867076d9b79536d9b9b6c065f341b" + +DESCRIPTION="Tools for ovmf/armvirt firmware volumes" +HOMEPAGE=" + https://gitlab.com/kraxel/virt-firmware + https://pypi.org/project/virt-firmware/ +" +SRC_URI="https://gitlab.com/kraxel/virt-firmware/-/archive/${COMMIT}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/${PN}-${COMMIT}" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64" + +RDEPEND=" + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/pefile[${PYTHON_USEDEP}] +" + +PATCHES=( + "${FILESDIR}/${PN}-24.2-dont-force-shim.patch" +) + +distutils_enable_tests unittest + +python_test() { + eunittest tests +} + +python_install_all() { + distutils-r1_python_install_all + + doman man/*.1 + + doinitd "${FILESDIR}/kernel-bootcfg-boot-successful" + systemd_dounit systemd/kernel-bootcfg-boot-successful.service + + # Use our own provided by sys-kernel/installkernel[efistub] instead + #exeinto /usr/lib/kernel/install.d + #doexe systemd/99-uki-uefi-setup.install +}
