From 11e6b7b683394900c0b4f743d6bc7c38dd449d68 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Tue, 21 Jun 2022 10:04:51 -0700 Subject: [PATCH] Backport PR #4207 to fix initramfs generation for Python 3.11 --- 4207.patch | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ anaconda.spec | 10 +++++++++- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 4207.patch diff --git a/4207.patch b/4207.patch new file mode 100644 index 0000000..edcec97 --- /dev/null +++ b/4207.patch @@ -0,0 +1,54 @@ +From 67d146999a2356dd445cc4c6532e052596cae4db Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Tue, 21 Jun 2022 18:50:35 +0200 +Subject: [PATCH 1/2] Don't attempt to add frozen python modules to initramfs + +--- + dracut/python-deps | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/dracut/python-deps b/dracut/python-deps +index cc6138a5e44..587b44a46f9 100755 +--- a/dracut/python-deps ++++ b/dracut/python-deps +@@ -70,6 +70,10 @@ except AttributeError: + while scripts: + script = scripts.pop() + ++ if script == 'frozen': ++ # https://docs.python.org/3.11/whatsnew/3.11.html#frozen-imports-static-code-objects ++ continue ++ + finder = ModuleFinder() + finder.run_script(script) # parse the script + for mod in finder.modules.values(): + +From da2f2499a6bfd2a0c1996c91457065d02040737f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Tue, 21 Jun 2022 19:01:21 +0200 +Subject: [PATCH 2/2] Don't ignore errors from python-deps + +--- + dracut/module-setup.sh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/dracut/module-setup.sh b/dracut/module-setup.sh +index f54d7539621..019f0a1ef24 100755 +--- a/dracut/module-setup.sh ++++ b/dracut/module-setup.sh +@@ -72,13 +72,14 @@ install() { + # timeout script for errors reporting + inst_hook initqueue/timeout 50 "$moddir/anaconda-error-reporting.sh" + # python deps for parse-kickstart. DOUBLE WOOOO ++ set -o pipefail + PYTHONHASHSEED=42 "$moddir/python-deps" "$moddir/parse-kickstart" "$moddir/driver_updates.py" | while read -r dep; do + case "$dep" in + *.so) inst_library "$dep" ;; + *.py) inst_simple "$dep" ;; + *) inst "$dep" ;; + esac +- done ++ done || exit 1 + + # support for specific architectures + case "$(uname -m)" in diff --git a/anaconda.spec b/anaconda.spec index 6f600c9..8658e3f 100644 --- a/anaconda.spec +++ b/anaconda.spec @@ -1,7 +1,7 @@ Summary: Graphical system installer Name: anaconda Version: 37.10 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ and MIT URL: http://fedoraproject.org/wiki/Anaconda @@ -15,6 +15,11 @@ URL: http://fedoraproject.org/wiki/Anaconda # make dist Source0: https://github.com/rhinstaller/%{name}/releases/download/%{name}-%{version}-1/%{name}-%{version}.tar.bz2 +# Fix dracut/python-deps for Python 3.11, required for Rawhide compose +# to work with Python 3.11 +# https://github.com/rhinstaller/anaconda/pull/4207 +Patch0: 4207.patch + # Versions of required components (done so we make sure the buildrequires # match the requires versions of things). @@ -456,6 +461,9 @@ desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{buildroot}%{_d %{_prefix}/libexec/anaconda/dd_* %changelog +* Tue Jun 21 2022 Adam Williamson - 37.10-3 +- Backport PR #4207 to fix initramfs generation for Python 3.11 + * Mon Jun 13 2022 Python Maint - 37.10-2 - Rebuilt for Python 3.11