sync from 24.03 LTS

(cherry picked from commit b7b6d2ba590ef32dab9f8aa20e1e5f16b8d5f272)
This commit is contained in:
sun_hai_10 2024-06-29 17:25:18 +08:00 committed by openeuler-sync-bot
parent f0aca81564
commit 9bc0b6baf6
5 changed files with 119 additions and 34 deletions

View File

@ -1,18 +1,19 @@
From b4cffadd1304fc2da30a727b030415168fcf7708 Mon Sep 17 00:00:00 2001
From: Wenlong Zhang <zhangwenlong@loongson.cn>
Date: Mon, 12 Dec 2022 01:37:57 +0000
From ad79c2e137e801c490fc35d4cecefbca6619fbea Mon Sep 17 00:00:00 2001
From: Huang Yang <huangyang@loongson.cn>
Date: Thu, 25 Apr 2024 12:14:01 +0000
Subject: [PATCH] add loongarch support for anaconda
Signed-off-by: yueyuankun <yueyuankun@kylinos.cn>
---
pyanaconda/modules/storage/bootloader/base.py | 9 +++--
pyanaconda/modules/storage/bootloader/efi.py | 33 ++++++++++++++++++-
pyanaconda/modules/storage/bootloader/efi.py | 35 ++++++++++++++++++-
.../modules/storage/bootloader/factory.py | 4 +++
.../modules/storage/devicetree/fsset.py | 6 +++-
pyanaconda/modules/storage/platform.py | 10 ++++++
5 files changed, 57 insertions(+), 5 deletions(-)
5 files changed, 59 insertions(+), 5 deletions(-)
diff --git a/pyanaconda/modules/storage/bootloader/base.py b/pyanaconda/modules/storage/bootloader/base.py
index 533d528..02ca7ca 100644
index d40086d..191b8af 100644
--- a/pyanaconda/modules/storage/bootloader/base.py
+++ b/pyanaconda/modules/storage/bootloader/base.py
@@ -796,11 +796,14 @@ class BootLoader(object):
@ -34,7 +35,7 @@ index 533d528..02ca7ca 100644
# Does /usr have its own device? If so, we need to tell dracut
usr_device = storage.mountpoints.get("/usr")
diff --git a/pyanaconda/modules/storage/bootloader/efi.py b/pyanaconda/modules/storage/bootloader/efi.py
index 1b47e24..99efde6 100644
index 5a28676..d2fffd2 100644
--- a/pyanaconda/modules/storage/bootloader/efi.py
+++ b/pyanaconda/modules/storage/bootloader/efi.py
@@ -28,7 +28,7 @@ from pyanaconda.product import productName
@ -46,10 +47,10 @@ index 1b47e24..99efde6 100644
class EFIBase(object):
@@ -203,6 +203,37 @@ class Aarch64EFIGRUB(EFIGRUB):
super().__init__()
@@ -170,6 +170,39 @@ class Aarch64EFIGRUB(EFIGRUB):
self._packages64 = ["grub2-efi-aa64", "shim-aa64"]
+class LOONGARCHEFIGRUB(EFIGRUB):
+ _efi_binary = "grubloongarch64.efi"
+ stage2_is_valid_stage1 = False
@ -81,11 +82,13 @@ index 1b47e24..99efde6 100644
+ elif self.stage1_device.type == "mdarray": # pylint: disable=no-member
+ for parent in self.stage1_device.parents: # pylint: disable=no-member
+ self._add_single_efi_boot_target(parent)
+
+
class ArmEFIGRUB(EFIGRUB):
_serial_consoles = ["ttyAMA", "ttyS"]
_efi_binary = "\\grubarm.efi"
diff --git a/pyanaconda/modules/storage/bootloader/factory.py b/pyanaconda/modules/storage/bootloader/factory.py
index 8aa3afb..2fb9993 100644
index 4815685..643f633 100644
--- a/pyanaconda/modules/storage/bootloader/factory.py
+++ b/pyanaconda/modules/storage/bootloader/factory.py
@@ -114,6 +114,10 @@ class BootLoaderFactory(object):
@ -100,11 +103,11 @@ index 8aa3afb..2fb9993 100644
from pyanaconda.modules.storage.bootloader.efi import MacEFIGRUB
return MacEFIGRUB
diff --git a/pyanaconda/modules/storage/devicetree/fsset.py b/pyanaconda/modules/storage/devicetree/fsset.py
index 0d151d3..26667dd 100644
index 4db3759..6f85a37 100644
--- a/pyanaconda/modules/storage/devicetree/fsset.py
+++ b/pyanaconda/modules/storage/devicetree/fsset.py
@@ -23,6 +23,7 @@ import gi
gi.require_version("BlockDev", "2.0")
gi.require_version("BlockDev", "3.0")
from gi.repository import BlockDev as blockdev
+from blivet import arch
@ -124,7 +127,7 @@ index 0d151d3..26667dd 100644
if device.format.check and mountpoint == "/":
passno = 1
diff --git a/pyanaconda/modules/storage/platform.py b/pyanaconda/modules/storage/platform.py
index d0aa7ca..3a238f9 100644
index 20f2c4d..2bb8e41 100644
--- a/pyanaconda/modules/storage/platform.py
+++ b/pyanaconda/modules/storage/platform.py
@@ -287,6 +287,14 @@ class Aarch64EFI(EFI):
@ -142,15 +145,15 @@ index d0aa7ca..3a238f9 100644
class ArmEFI(EFI):
@property
@@ -486,6 +494,8 @@ def get_platform():
return Aarch64EFI()
elif arch.is_arm():
@@ -522,6 +530,8 @@ def get_platform():
return ArmEFI()
elif arch.is_riscv64():
return RISCV64EFI()
+ elif arch.is_loongarch():
+ return LOONGARCHEFI()
else:
return EFI()
elif arch.is_x86():
--
2.33.0
2.43.0

View File

@ -1,7 +1,7 @@
%define _empty_manifest_terminate_build 0
Name: anaconda
Version: 36.16.5
Release: 32
Release: 37
Summary: Graphical system installer
License: GPLv2+ and MIT
URL: http://fedoraproject.org/wiki/Anaconda
@ -15,9 +15,6 @@ Source5: nestos.conf
%ifarch sw_64
Patch6001: anaconda-33.19.sw.patch
%endif
%ifarch loongarch64
Patch6002: 0001-add-loongarch-support-for-anaconda.patch
%endif
Patch9000: add-passwd-policy.patch
Patch9001: bugfix-GUI-nfs-unknown-error.patch
@ -55,12 +52,17 @@ Patch6008: backport-module-setup.sh-Don-t-ignore-errors-unbound-variable-and-
Patch6009: backport-Fix-the-systemd-generator-for-systemd-253-2165433.patch
# https://github.com/rhinstaller/anaconda/pull/5198
Patch6010: backport-a-riscv64-enablement-patch-from-upstream.patch
# https://github.com/rhinstaller/anaconda/pull/3984
Patch6011: backport-Don-t-unnecessarily-use-cat-and-use-grep-E.patch
Patch9023: bugfix-change-root-and-storage-interface-shows.patch
Patch9024: bugfix-revert-Set-default-entry-to-the-BLS-id-instead-of-the-entry-index.patch
Patch9025: bugfix-import-new-BlockDev.patch
Patch9026: bugfix-fix-custom-storage-chinese-tip.patch
Patch10000: 0001-add-loongarch-support-for-anaconda.patch
%define dasbusver 1.3
%define dbusver 1.2.3
%define dnfver 3.6.0
@ -94,7 +96,7 @@ BuildRequires: gsettings-desktop-schemas metacity
Requires: anaconda-core = %{version}-%{release}
Requires: anaconda-tui = %{version}-%{release}
Requires: libblockdev-plugins-all >= %{libblockdevver} realmd isomd5sum >= %{isomd5sumver}
Requires: kexec-tools createrepo_c tmux gdb rsync python3-meh-gui >= %{mehver}
Requires: kexec-tools createrepo_c tmux rsync python3-meh-gui >= %{mehver}
Requires: adwaita-icon-theme python3-kickstart
Requires: tigervnc-server-minimal libxklavier >= %{libxklavierver} libgnomekbd
Requires: nm-connection-editor keybinder3 system-logos
@ -124,11 +126,10 @@ Requires: python3-pyparted >= %{pypartedver} python3-requests python3-requests-f
Requires: python3-requests-ftp python3-kickstart >= %{pykickstartver}
Requires: python3-langtable >= %{langtablever} util-linux >= %{utillinuxver} python3-gobject-base
Requires: python3-dbus python3-pwquality python3-systemd python3-dasbus >= %{dasbusver}
Requires: python3-packaging
Requires: cracklib-dicts python3-pytz teamd NetworkManager >= %{nmver} NetworkManager-libnm >= %{nmver}
Requires: NetworkManager-team kbd chrony systemd python3-pid
Requires: kbd chrony systemd python3-pid
Requires: python3-ordered-set >= 2.0.0 glibc-langpack-en dbus-daemon
Requires: systemd-resolved
Recommends: python3-packaging NetworkManager-team systemd-resolved
# Required by the systemd service anaconda-fips.
Requires: crypto-policies
Requires: /usr/bin/update-crypto-policies
@ -204,8 +205,8 @@ cp %{SOURCE5} %{SOURCE5}_tmp
# install openEuler conf for anaconda
%ifarch x86_64
sed -i "/^additional_arguments =*/ s/$/ crashkernel=512M/" %{SOURCE1}
sed -i "/^additional_arguments =*/ s/$/ panic=3 nmi_watchdog=1/" %{SOURCE2}
sed -i "/^additional_arguments =*/ s/$/ panic=3 nmi_watchdog=1/" %{SOURCE3}
sed -i "/^additional_arguments =*/ s/$/ panic=3 nmi_watchdog=1 quiet/" %{SOURCE2}
sed -i "/^additional_arguments =*/ s/$/ panic=3 nmi_watchdog=1 quiet/" %{SOURCE3}
sed -i "/^additional_arguments =*/ s/$/ crashkernel=512M/" %{SOURCE5}
%endif
@ -315,12 +316,42 @@ update-desktop-database &> /dev/null || :
%{_prefix}/libexec/anaconda/dd_*
%changelog
* Thu May 09 2024 jchzhou <zhoujiacheng@iscas.ac.cn> - 36.16.5-32
* Wed Jun 26 2024 sunhai <sunhai10@huawei.com> - 36.16.5-37
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: fix encypt shield
* Sat Jun 22 2024 sunhai <sunhai10@huawei.com> - 36.16.5-36
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: adjust some requires and config for derived os
* Wed Jun 19 2024 yueyuankun <yueyuankun@kylinos.cn> - 36.16.5-35
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: fix(anaconda-pre-log-gen): don't unnecessarily use cat and use grep -E
* Thu May 23 2024 yueyuankun <yueyuankun@kylinos.cn> - 36.16.5-34
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: fix patch10000 cannot be applied on loongarch64
* Thu May 09 2024 jchzhou <zhoujiacheng@iscas.ac.cn> - 36.16.5-33
- Type:feature
- ID:NA
- SUG:NA
- DESC: backport a riscv64 enablement patch from upstream
* Mon Apr 22 2024 Huang Yang <huangyang@loongson.cn> - 36.16.5-32
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: fix patch9025 error on loongarch64
* Sat Apr 20 2024 sunhai <sunhai10@huawei.com> - 36.16.5-31
- Type:bugfix
- ID:NA

View File

@ -0,0 +1,30 @@
From ab9b2f98134d99325ac468a7c01ed0e659464f3d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?O=C4=9Fuz=20Ersen?= <oguz@ersen.moe>
Date: Sat, 26 Mar 2022 18:32:17 +0000
Subject: [PATCH] Don't unnecessarily use cat and use grep -E
---
scripts/anaconda-pre-log-gen | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/scripts/anaconda-pre-log-gen b/scripts/anaconda-pre-log-gen
index 30eacc8a3c..0012e076db 100755
--- a/scripts/anaconda-pre-log-gen
+++ b/scripts/anaconda-pre-log-gen
@@ -5,12 +5,8 @@
# where the resulting logs will be stored
TARGET_DIRECTORY=/tmp/pre-anaconda-logs
-BOOT_OPTIONS_FILE=/proc/cmdline
-
-DEBUG_ENABLED=`cat $BOOT_OPTIONS_FILE | egrep -c "\<debug\>|\<inst\.debug\>"`
-
# do not produce any logs unless debug is enabled
-[ $DEBUG_ENABLED == '0' ] && exit 0
+grep -E -q "\<debug\>|\<inst\.debug\>" /proc/cmdline || exit 0
mkdir ${TARGET_DIRECTORY}
--
2.33.0

View File

@ -113,8 +113,8 @@ index 3a75565..b9344da 100644
--- a/pyanaconda/ui/gui/spokes/lib/accordion.py
+++ b/pyanaconda/ui/gui/spokes/lib/accordion.py
@@ -544,7 +544,7 @@ class CreateNewPage(BasePage):
use_underline=True
)
self._createBox.attach(label, 0, 6, 2, 1)
- checkbox = Gtk.CheckButton(label="Encrypt my data.")
+ checkbox = Gtk.CheckButton(label=_("Encrypt my data."))

View File

@ -4,15 +4,16 @@ Date: Wed, 16 Sep 2020 15:28:39 +0800
Subject: [PATCH] disable disk encryption
---
pyanaconda/ui/gui/spokes/custom_storage.py | 8 ++++----
pyanaconda/ui/gui/spokes/custom_storage.py | 9 +++++----
pyanaconda/ui/gui/spokes/lib/accordion.py | 2 --
pyanaconda/ui/gui/spokes/storage.py | 7 ++++---
2 files changed, 8 insertions(+), 7 deletions(-)
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom_storage.py b/pyanaconda/ui/gui/spokes/custom_storage.py
index 347a0e0..d72e315 100644
--- a/pyanaconda/ui/gui/spokes/custom_storage.py
+++ b/pyanaconda/ui/gui/spokes/custom_storage.py
@@ -796,8 +796,8 @@ class CustomPartitioningSpoke(NormalSpoke, StorageCheckHandler):
@@ -796,8 +796,9 @@ class CustomPartitioningSpoke(NormalSpoke, StorageCheckHandler):
fancy_set_sensitive(self._reformatCheckbox, self._permissions.reformat)
# Set up the encryption.
@ -20,6 +21,7 @@ index 347a0e0..d72e315 100644
- fancy_set_sensitive(self._encryptCheckbox, self._permissions.device_encrypted)
+ self._encryptCheckbox.set_active(False)
+ fancy_set_sensitive(self._encryptCheckbox, False)
+ self._encryptCheckbox.set_visible(False)
self._encryptCheckbox.set_inconsistent(self._request.container_encrypted)
text = _("The container is encrypted.") if self._request.container_encrypted else ""
@ -41,6 +43,25 @@ index 347a0e0..d72e315 100644
self._update_luks_combo()
fancy_set_sensitive(self._fsCombo, self._permissions.format_type)
self.on_value_changed()
diff --git a/pyanaconda/ui/gui/spokes/lib/accordion.py b/pyanaconda/ui/gui/spokes/lib/accordion.py
index b9344da..235890f 100644
--- a/pyanaconda/ui/gui/spokes/lib/accordion.py
+++ b/pyanaconda/ui/gui/spokes/lib/accordion.py
@@ -542,7 +542,6 @@ class CreateNewPage(BasePage):
wrap=True,
use_underline=True
)
- self._createBox.attach(label, 0, 6, 2, 1)
checkbox = Gtk.CheckButton(label="Encrypt my data.")
checkbox.connect("toggled", encrypted_changed_cb)
@@ -552,6 +551,5 @@ class CreateNewPage(BasePage):
checkbox.set_hexpand(False)
label.set_mnemonic_widget(checkbox)
- self._createBox.attach(checkbox, 0, 7, 2, 1)
self.add(self._createBox)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 9494d6a..b2c0d3e 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
@ -67,5 +88,5 @@ index 9494d6a..b2c0d3e 100644
# Hide the reclaim space checkbox if automatic storage configuration is not used.
self._reclaim_revealer.set_reveal_child(
--
1.8.3.1
2.27.0