Merge pull request #28397 from DaanDeMeyer/python-stuff
mkosi: Stop using python3.9 on CentOS 8
This commit is contained in:
@@ -76,7 +76,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
|
||||
- uses: systemd/mkosi@b1a570550ee077ed7a9a9359e4732636034807e6
|
||||
- uses: systemd/mkosi@5866c0ff3b36d350c943016e5a3b115f7a95d37f
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
|
||||
+2
-3
@@ -2143,8 +2143,8 @@ if efi_arch == 'x64' and cc.links('''
|
||||
endif
|
||||
|
||||
have_pyelftools = pymod.find_installation('python3', required : false, modules : ['elftools']).found()
|
||||
if get_option('bootloader') == 'true' and (not python_39 or not have_pyelftools)
|
||||
error('EFI bootloader support requires Python >= 3.9 and pyelftools.')
|
||||
if get_option('bootloader') == 'true' and not have_pyelftools
|
||||
error('EFI bootloader support requires pyelftools.')
|
||||
endif
|
||||
|
||||
conf.set10(
|
||||
@@ -2152,7 +2152,6 @@ conf.set10(
|
||||
get_option('efi') and
|
||||
get_option('bootloader') in ['auto', 'true'] and
|
||||
efi_arch != '' and
|
||||
python_39 and
|
||||
have_pyelftools,
|
||||
)
|
||||
|
||||
|
||||
@@ -6,3 +6,5 @@ Distribution=centos
|
||||
[Distribution]
|
||||
Release=9
|
||||
Repositories=epel
|
||||
epel-next
|
||||
hyperscale-packages-main
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
[Output]
|
||||
OutputDirectory=mkosi.output
|
||||
BuildDirectory=mkosi.builddir
|
||||
CacheDirectory=mkosi.cache
|
||||
|
||||
[Content]
|
||||
# Prevent ASAN warnings when building the image and ship the real ASAN options prefixed with MKOSI_.
|
||||
Environment=ASAN_OPTIONS=verify_asan_link_order=false
|
||||
MKOSI_ASAN_OPTIONS=strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:disable_coredump=0:use_madv_dontdump=1
|
||||
MKOSI_UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1
|
||||
OutputDirectory=mkosi.output
|
||||
|
||||
[Content]
|
||||
BuildDirectory=mkosi.builddir
|
||||
CacheDirectory=mkosi.cache
|
||||
|
||||
[Host]
|
||||
Incremental=yes
|
||||
@@ -22,21 +22,10 @@ KernelCommandLineExtra=systemd.crash_shell
|
||||
systemd.log_ratelimit_kmsg=0
|
||||
systemd.journald.forward_to_console
|
||||
systemd.journald.max_level_console=warning
|
||||
# Tell the kernel to only log warning and up to the console.
|
||||
loglevel=4
|
||||
# Disable the kernel's ratelimiting on userspace logging to kmsg.
|
||||
printk.devkmsg=on
|
||||
# Tell networkd to manage the ethernet interface.
|
||||
ip=enp0s1:any
|
||||
# Make sure sulogin works even with a locked root account.
|
||||
SYSTEMD_SULOGIN_FORCE=1
|
||||
# Make sure /sysroot is mounted rw in the initrd.
|
||||
rw
|
||||
# Make sure we pull in network related units even if nothing else depends on the
|
||||
# network to be online.
|
||||
systemd.wants=network-online.target
|
||||
# Make sure we don't load vmw_vmci which messes with virtio vsock.
|
||||
module_blacklist=vmw_vmci
|
||||
# Lower the default device timeout so we get a shell earlier if the root device does
|
||||
# not appear for some reason.
|
||||
systemd.default_device_timeout_sec=10
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
[Match]
|
||||
Distribution=centos
|
||||
Release=8
|
||||
|
||||
[Distribution]
|
||||
PackageManagerTrees=mkosi.reposdir:/etc/yum.repos.d
|
||||
@@ -1,7 +0,0 @@
|
||||
[centos-hyperscale]
|
||||
name=CentOS Stream $releasever - Hyperscale
|
||||
mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=hyperscale-packages-main
|
||||
#baseurl=http://mirror.centos.org/$contentdir/$stream/hyperscale/$basearch/packages-main/
|
||||
gpgcheck=1
|
||||
enabled=1
|
||||
gpgkey=https://git.centos.org/rpms/centos-release-hyperscale/raw/c8s-sig-hyperscale/f/SOURCES/RPM-GPG-KEY-CentOS-SIG-HyperScale
|
||||
@@ -1,10 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
[powertools-hotfixes]
|
||||
name=powertools-hotfixes
|
||||
mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=PowerTools
|
||||
gpgkey=https://www.centos.org/keys/RPM-GPG-KEY-CentOS-Official
|
||||
gpgcheck=1
|
||||
enabled=1
|
||||
module_hotfixes=1
|
||||
skip_if_unavailable=1
|
||||
@@ -48,6 +48,13 @@ if [ ! -f "$BUILDDIR"/build.ninja ]; then
|
||||
rootprefix=/${rootprefix#/}
|
||||
fi
|
||||
|
||||
. /etc/os-release
|
||||
if [ "$ID" = "centos" ] && [ "$VERSION" = "8" ]; then
|
||||
UKIFY=false
|
||||
else
|
||||
UKIFY=true
|
||||
fi
|
||||
|
||||
CONFIGURE_OPTS=(
|
||||
-D sysvinit-path="$sysvinit_path"
|
||||
-D rootprefix="$rootprefix"
|
||||
@@ -133,7 +140,7 @@ if [ ! -f "$BUILDDIR"/build.ninja ]; then
|
||||
-D kernel-install=true
|
||||
-D analyze=true
|
||||
-D bpf-framework=true
|
||||
-D ukify=true
|
||||
-D ukify="$UKIFY"
|
||||
-D seccomp=true
|
||||
-D selinux=auto
|
||||
-D apparmor=auto
|
||||
|
||||
@@ -28,6 +28,7 @@ BuildPackages=
|
||||
bpftool
|
||||
docbook-xsl
|
||||
findutils
|
||||
libgcrypt-devel # CentOS Stream 8 libgcrypt-devel doesn't ship a pkg-config file.
|
||||
libxslt
|
||||
pam-devel
|
||||
pkgconfig(audit)
|
||||
@@ -65,4 +66,10 @@ BuildPackages=
|
||||
pkgconfig(tss2-tcti-device)
|
||||
pkgconfig(valgrind)
|
||||
pkgconfig(xkbcommon)
|
||||
python3
|
||||
python3dist(jinja2)
|
||||
python3dist(lxml)
|
||||
python3dist(pefile)
|
||||
python3dist(pyelftools)
|
||||
python3dist(pytest)
|
||||
rpm
|
||||
|
||||
@@ -8,11 +8,4 @@ Packages=
|
||||
python3dist(pytest-flakes)
|
||||
|
||||
BuildPackages=
|
||||
pkgconfig(libgcrypt)
|
||||
pkgconfig(xencontrol)
|
||||
python3
|
||||
python3dist(jinja2)
|
||||
python3dist(lxml)
|
||||
python3dist(pefile)
|
||||
python3dist(pyelftools)
|
||||
python3dist(pytest)
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
[Match]
|
||||
Distribution=centos
|
||||
Release=8
|
||||
|
||||
[Content]
|
||||
BuildPackages=
|
||||
libgcrypt-devel # CentOS Stream 8 libgcrypt-devel doesn't ship a pkg-config file.
|
||||
platform-python
|
||||
python3.9dist(jinja2)
|
||||
python3.9dist(lxml)
|
||||
python3.9dist(pefile)
|
||||
python3.9dist(pyelftools)
|
||||
python3.9dist(pytest)
|
||||
python39
|
||||
@@ -1,15 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
[Match]
|
||||
Distribution=centos
|
||||
Release=9
|
||||
|
||||
[Content]
|
||||
BuildPackages=
|
||||
pkgconfig(libgcrypt)
|
||||
platform-python
|
||||
python3dist(jinja2)
|
||||
python3dist(lxml)
|
||||
python3dist(pefile)
|
||||
python3dist(pyelftools)
|
||||
python3dist(pytest)
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
set -e
|
||||
|
||||
if [ "$1" = "build" ]; then
|
||||
. /etc/os-release
|
||||
|
||||
if [ "$ID" = "centos" ] && [ "$VERSION" = "8" ]; then
|
||||
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
|
||||
alternatives --set python3 /usr/bin/python3.9
|
||||
fi
|
||||
fi
|
||||
@@ -23,5 +23,10 @@ Packages=
|
||||
passwd
|
||||
polkit
|
||||
procps-ng
|
||||
python3
|
||||
python3dist(pefile)
|
||||
python3dist(pluggy) # python3-pluggy is a pytest dependency that's not installed for some reason.
|
||||
python3dist(psutil)
|
||||
python3dist(pytest)
|
||||
quota
|
||||
vim-common
|
||||
|
||||
@@ -8,7 +8,3 @@ Packages=
|
||||
btrfs-progs
|
||||
compsize
|
||||
f2fs-tools
|
||||
python3
|
||||
python3dist(pefile)
|
||||
python3dist(psutil)
|
||||
python3dist(pytest)
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
[Match]
|
||||
Distribution=centos
|
||||
Release=8
|
||||
|
||||
[Content]
|
||||
Packages=
|
||||
platform-python
|
||||
python3.9dist(pefile)
|
||||
python3.9dist(pluggy) # python39-pluggy is a pytest dependency that's not installed for some reason.
|
||||
python3.9dist(psutil)
|
||||
python3.9dist(pytest)
|
||||
python39
|
||||
@@ -1,13 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
[Match]
|
||||
Distribution=centos
|
||||
Release=9
|
||||
|
||||
[Content]
|
||||
Packages=
|
||||
platform-python
|
||||
python3dist(pefile)
|
||||
python3dist(pluggy) # python39-pluggy is a pytest dependency that's not installed for some reason.
|
||||
python3dist(psutil)
|
||||
python3dist(pytest)
|
||||
+8
-8
@@ -80,7 +80,7 @@ class PeRelocationBlock(LittleEndianStructure):
|
||||
|
||||
def __init__(self, PageRVA: int):
|
||||
super().__init__(PageRVA)
|
||||
self.entries: list[PeRelocationEntry] = []
|
||||
self.entries: typing.List[PeRelocationEntry] = []
|
||||
|
||||
|
||||
class PeRelocationEntry(LittleEndianStructure):
|
||||
@@ -281,7 +281,7 @@ def convert_elf_section(elf_s: ELFSection) -> PeSection:
|
||||
return pe_s
|
||||
|
||||
|
||||
def copy_sections(elf: ELFFile, opt: PeOptionalHeader) -> list[PeSection]:
|
||||
def copy_sections(elf: ELFFile, opt: PeOptionalHeader) -> typing.List[PeSection]:
|
||||
sections = []
|
||||
|
||||
for elf_s in elf.iter_sections():
|
||||
@@ -304,7 +304,7 @@ def copy_sections(elf: ELFFile, opt: PeOptionalHeader) -> list[PeSection]:
|
||||
|
||||
|
||||
def apply_elf_relative_relocation(
|
||||
reloc: ElfRelocation, image_base: int, sections: list[PeSection], addend_size: int
|
||||
reloc: ElfRelocation, image_base: int, sections: typing.List[PeSection], addend_size: int
|
||||
):
|
||||
# fmt: off
|
||||
[target] = [
|
||||
@@ -330,8 +330,8 @@ def convert_elf_reloc_table(
|
||||
elf: ELFFile,
|
||||
elf_reloc_table: ElfRelocationTable,
|
||||
image_base: int,
|
||||
sections: list[PeSection],
|
||||
pe_reloc_blocks: dict[int, PeRelocationBlock],
|
||||
sections: typing.List[PeSection],
|
||||
pe_reloc_blocks: typing.Dict[int, PeRelocationBlock],
|
||||
):
|
||||
NONE_RELOC = {
|
||||
"EM_386": ENUM_RELOC_TYPE_i386["R_386_NONE"],
|
||||
@@ -377,7 +377,7 @@ def convert_elf_reloc_table(
|
||||
|
||||
|
||||
def convert_elf_relocations(
|
||||
elf: ELFFile, opt: PeOptionalHeader, sections: list[PeSection]
|
||||
elf: ELFFile, opt: PeOptionalHeader, sections: typing.List[PeSection]
|
||||
) -> typing.Optional[PeSection]:
|
||||
dynamic = elf.get_section_by_name(".dynamic")
|
||||
if dynamic is None:
|
||||
@@ -387,7 +387,7 @@ def convert_elf_relocations(
|
||||
if not flags_tag["d_val"] & ENUM_DT_FLAGS_1["DF_1_PIE"]:
|
||||
raise RuntimeError("ELF file is not a PIE.")
|
||||
|
||||
pe_reloc_blocks: dict[int, PeRelocationBlock] = {}
|
||||
pe_reloc_blocks: typing.Dict[int, PeRelocationBlock] = {}
|
||||
for reloc_type, reloc_table in dynamic.get_relocation_tables().items():
|
||||
if reloc_type not in ["REL", "RELA"]:
|
||||
raise RuntimeError("Unsupported relocation type {elf_reloc_type}.")
|
||||
@@ -433,7 +433,7 @@ def convert_elf_relocations(
|
||||
|
||||
|
||||
def write_pe(
|
||||
file, coff: PeCoffHeader, opt: PeOptionalHeader, sections: list[PeSection]
|
||||
file, coff: PeCoffHeader, opt: PeOptionalHeader, sections: typing.List[PeSection]
|
||||
):
|
||||
file.write(b"MZ")
|
||||
file.seek(0x3C, io.SEEK_SET)
|
||||
|
||||
Reference in New Issue
Block a user