Don't attempt to add frozen python modules to initramfs

(cherry picked from commit e025b7a384ba4f1771a7ac42831d157791ae2b5b)
This commit is contained in:
sun_hai_10 2023-08-21 18:04:36 +08:00 committed by openeuler-sync-bot
parent 4f564eb952
commit 7ffc8e0541
3 changed files with 68 additions and 1 deletions

View File

@ -1,7 +1,7 @@
%define _empty_manifest_terminate_build 0 %define _empty_manifest_terminate_build 0
Name: anaconda Name: anaconda
Version: 36.16.5 Version: 36.16.5
Release: 20 Release: 21
Summary: Graphical system installer Summary: Graphical system installer
License: GPLv2+ and MIT License: GPLv2+ and MIT
URL: http://fedoraproject.org/wiki/Anaconda URL: http://fedoraproject.org/wiki/Anaconda
@ -49,6 +49,9 @@ Patch9020: bugfix-password-tooltip-text-adapt-language.patch
Patch9021: bugfix-revert-Unify-GRUB-configuration-file-location-across-all-platforms.patch Patch9021: bugfix-revert-Unify-GRUB-configuration-file-location-across-all-platforms.patch
Patch9022: bugfix-change-the-startup-mode-of-do_transaction-sub-proces.patch Patch9022: bugfix-change-the-startup-mode-of-do_transaction-sub-proces.patch
Patch6007: backport-Don-t-attempt-to-add-frozen-python-modules-to-initramfs.patch
Patch6008: backport-module-setup.sh-Don-t-ignore-errors-unbound-variable-and-pipe-fails.patch
%define dasbusver 1.3 %define dasbusver 1.3
%define dbusver 1.2.3 %define dbusver 1.2.3
%define dnfver 3.6.0 %define dnfver 3.6.0
@ -297,6 +300,12 @@ update-desktop-database &> /dev/null || :
%{_prefix}/libexec/anaconda/dd_* %{_prefix}/libexec/anaconda/dd_*
%changelog %changelog
* Mon Aug 21 2023 sunhai <sunhai10@huawei.com> - 36.16.5-21
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: Don't attempt to add frozen python modules to initramfs
* Mon Jul 10 2023 sunhai <sunhai10@huawei.com> - 36.16.5-20 * Mon Jul 10 2023 sunhai <sunhai10@huawei.com> - 36.16.5-20
- Type:bugfix - Type:bugfix
- ID:NA - ID:NA

View File

@ -0,0 +1,26 @@
From 67d146999a2356dd445cc4c6532e052596cae4db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Tue, 21 Jun 2022 18:50:35 +0200
Subject: [PATCH] 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 cc6138a5e4..587b44a46f 100644
--- 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():
--
2.23.0

View File

@ -0,0 +1,32 @@
From 76d232cbf406416103d2cb38ab0141649f5440ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Tue, 21 Jun 2022 19:01:21 +0200
Subject: [PATCH] module-setup.sh: Don't ignore errors, unbound variable and
pipe fails
Note that -eu could be in the shebang,
but this way it's set even when executed via `bash module-setup.sh`
or when sourced.
---
dracut/module-setup.sh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dracut/module-setup.sh b/dracut/module-setup.sh
index f54d753962..9c07375c8c 100644
--- a/dracut/module-setup.sh
+++ b/dracut/module-setup.sh
@@ -1,5 +1,6 @@
#!/bin/bash
# module-setup.sh for anaconda
+set -eu -o pipefail
check() {
[[ $hostonly ]] && return 1
@@ -90,3 +91,5 @@ install() {
esac
}
+# revert back to the default in case this is sourced
+set +eu +o pipefail
--
2.23.0