add support for configuration of additional boot arguments and change the startup mode of do_transaction sub process to spawn
This commit is contained in:
parent
e54bebdd3e
commit
c1a9a1b1a8
67
Support-configuration-of-additional-boot-arguments.patch
Normal file
67
Support-configuration-of-additional-boot-arguments.patch
Normal file
@ -0,0 +1,67 @@
|
||||
From 8f6a97734a9ecb63320d73ec42efd6f4c03eac5b Mon Sep 17 00:00:00 2001
|
||||
From: Qiumiao Zhang <zhangqiumiao1@huawei.com>
|
||||
Date: Thu, 7 Apr 2022 03:41:52 -0400
|
||||
Subject: [PATCH] Support configuration of additional boot arguments
|
||||
|
||||
---
|
||||
data/anaconda.conf | 3 +++
|
||||
pyanaconda/core/configuration/bootloader.py | 8 ++++++++
|
||||
pyanaconda/modules/storage/bootloader/base.py | 5 +++++
|
||||
3 files changed, 16 insertions(+)
|
||||
|
||||
diff --git a/data/anaconda.conf b/data/anaconda.conf
|
||||
index c622700..3e63c50 100644
|
||||
--- a/data/anaconda.conf
|
||||
+++ b/data/anaconda.conf
|
||||
@@ -134,6 +134,9 @@ preserved_arguments =
|
||||
biosdevname ipv6.disable net.ifnames net.ifnames.prefix
|
||||
nosmt
|
||||
|
||||
+# Arguments added by default.
|
||||
+additional_arguments =
|
||||
+
|
||||
|
||||
[Storage]
|
||||
# Enable dmraid usage during the installation.
|
||||
diff --git a/pyanaconda/core/configuration/bootloader.py b/pyanaconda/core/configuration/bootloader.py
|
||||
index 6746e45..7b782d3 100644
|
||||
--- a/pyanaconda/core/configuration/bootloader.py
|
||||
+++ b/pyanaconda/core/configuration/bootloader.py
|
||||
@@ -69,3 +69,11 @@ class BootloaderSection(Section):
|
||||
:return: a list of kernel arguments
|
||||
"""
|
||||
return self._get_option("preserved_arguments", str).split()
|
||||
+
|
||||
+ @property
|
||||
+ def additional_arguments(self):
|
||||
+ """Arguments added by default.
|
||||
+
|
||||
+ :return: a list of kernel arguments
|
||||
+ """
|
||||
+ return self._get_option("additional_arguments", str).split()
|
||||
diff --git a/pyanaconda/modules/storage/bootloader/base.py b/pyanaconda/modules/storage/bootloader/base.py
|
||||
index a45a530..db98693 100644
|
||||
--- a/pyanaconda/modules/storage/bootloader/base.py
|
||||
+++ b/pyanaconda/modules/storage/bootloader/base.py
|
||||
@@ -707,6 +707,7 @@ class BootLoader(object):
|
||||
self._set_extra_boot_args()
|
||||
self._set_storage_boot_args(storage)
|
||||
self._preserve_some_boot_args()
|
||||
+ self._add_additional_boot_args()
|
||||
self._set_graphical_boot_args()
|
||||
self._set_security_boot_args()
|
||||
|
||||
@@ -843,6 +844,10 @@ class BootLoader(object):
|
||||
|
||||
self.boot_args.add(new_arg)
|
||||
|
||||
+ def _add_additional_boot_args(self):
|
||||
+ for opt in conf.bootloader.additional_arguments:
|
||||
+ self.boot_args.add(opt)
|
||||
+
|
||||
def _set_graphical_boot_args(self):
|
||||
"""Set up the graphical boot."""
|
||||
args = []
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@ -1,31 +0,0 @@
|
||||
From 99970253a5600555118a64046259b7ef638655df Mon Sep 17 00:00:00 2001
|
||||
From: t_feng <fengtao40@huawei.com>
|
||||
Date: Fri, 11 Sep 2020 11:26:41 +0800
|
||||
Subject: [PATCH] add boot args for smmu and video
|
||||
|
||||
---
|
||||
pyanaconda/modules/storage/bootloader/grub2.py | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/pyanaconda/modules/storage/bootloader/grub2.py b/pyanaconda/modules/storage/bootloader/grub2.py
|
||||
index 17e46e5..a70ba7a 100644
|
||||
--- a/pyanaconda/modules/storage/bootloader/grub2.py
|
||||
+++ b/pyanaconda/modules/storage/bootloader/grub2.py
|
||||
@@ -271,6 +271,14 @@ class GRUB2(BootLoader):
|
||||
if blivet.arch.is_aarch64():
|
||||
log.info("check boot args:%s", arg_str)
|
||||
arg_str += " crashkernel=1024M,high"
|
||||
+ if "smmu.bypassdev=0x1000:0x17" not in arg_str:
|
||||
+ arg_str += " smmu.bypassdev=0x1000:0x17"
|
||||
+ if "smmu.bypassdev=0x1000:0x15" not in arg_str:
|
||||
+ arg_str += " smmu.bypassdev=0x1000:0x15"
|
||||
+ if "video=efifb:off" not in arg_str:
|
||||
+ arg_str += " video=efifb:off"
|
||||
+ if "video=VGA-1:640x480-32@60me" not in arg_str:
|
||||
+ arg_str += " video=VGA-1:640x480-32@60me"
|
||||
else:
|
||||
arg_str += " crashkernel=512M"
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -1,15 +1,14 @@
|
||||
%define _empty_manifest_terminate_build 0
|
||||
%if "0%{?_vendor}" == "0"
|
||||
%define _vendor openEuler
|
||||
%endif
|
||||
Name: anaconda
|
||||
Version: 33.19
|
||||
Release: 41
|
||||
Release: 42
|
||||
Summary: Graphical system installer
|
||||
License: GPLv2+ and MIT
|
||||
URL: http://fedoraproject.org/wiki/Anaconda
|
||||
Source0: https://github.com/rhinstaller/anaconda/archive/%{name}-%{version}.tar.bz2
|
||||
Source1: openeuler.conf
|
||||
Source2: euleros.conf
|
||||
Source3: hce.conf
|
||||
|
||||
Patch6000: Fix-hiding-of-network-device-activation-switch.patch
|
||||
|
||||
@ -27,9 +26,7 @@ Patch9011: disable-product-name-in-welcome-is-uppercase.patch
|
||||
Patch9012: modify-default-timezone.patch
|
||||
Patch9013: modify-network-hostname-dot-illegal.patch
|
||||
Patch9014: disable-ssh-login-checkbox.patch
|
||||
Patch9015: bugfix-add-kdump-parameter-into-kernel-cmdline.patch
|
||||
Patch9016: bugfix-fix-password-policy.patch
|
||||
Patch9017: add-boot-args-for-smmu-and-video.patch
|
||||
Patch9018: disable-disk-encryption.patch
|
||||
Patch9019: bugfix-set-up-LD_PRELOAD-for-the-Storage-and-Services-module.patch
|
||||
Patch9020: bugfix-Propagate-a-lazy-proxy-of-the-storage-model.patch
|
||||
@ -124,6 +121,8 @@ Patch9028: Change-sidebar-background-size.patch
|
||||
Patch6078: bugfix-Cancel-planned-manual-update-of-system-time-on-turni.patch
|
||||
Patch9029: support-use-sm3-crypt-user-password.patch
|
||||
Patch6079: backport-remove-authconfig-support.patch
|
||||
Patch6080: bugfix-change-the-startup-mode-of-do_transaction-sub-proces.patch
|
||||
Patch6081: Support-configuration-of-additional-boot-arguments.patch
|
||||
|
||||
%define dbusver 1.2.3
|
||||
%define dnfver 3.6.0
|
||||
@ -255,10 +254,21 @@ runtime on NFS/HTTP/FTP servers or local disks.
|
||||
%delete_la
|
||||
|
||||
# install openEuler conf for anaconda
|
||||
if [ %{_vendor} != "openEuler" ]; then
|
||||
sed -i "s#openEuler#%{_vendor}#g" %{SOURCE1}
|
||||
fi
|
||||
install -m 0755 %{SOURCE1} %{buildroot}/%{_sysconfdir}/%{name}/product.d/
|
||||
%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}
|
||||
%endif
|
||||
|
||||
%ifarch aarch64
|
||||
sed -i "/^additional_arguments =*/ s/$/ crashkernel=1024M,high smmu.bypassdev=0x1000:0x17 smmu.bypassdev=0x1000:0x15/" %{SOURCE1}
|
||||
sed -i "/^additional_arguments =*/ s/$/ panic=1 vga=0x317 nohz=off smmu.bypassdev=0x1000:0x17 smmu.bypassdev=0x1000:0x15/" %{SOURCE2}
|
||||
sed -i "/^additional_arguments =*/ s/$/ panic=1 vga=0x317 nohz=off smmu.bypassdev=0x1000:0x17 smmu.bypassdev=0x1000:0x15/" %{SOURCE3}
|
||||
%endif
|
||||
install -m 0644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/%{name}/product.d/
|
||||
install -m 0644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/%{name}/product.d/
|
||||
install -m 0644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/%{name}/product.d/
|
||||
|
||||
|
||||
# Create an empty directory for addons
|
||||
install -d -m 0755 %{buildroot}%{_datadir}/anaconda/addons
|
||||
@ -352,6 +362,13 @@ update-desktop-database &> /dev/null || :
|
||||
%{_prefix}/libexec/anaconda/dd_*
|
||||
|
||||
%changelog
|
||||
* Thu Apr 7 2022 zhangqiumiao <zhangqiumiao1@huawei.com> - 33.19-42
|
||||
- Type:bugfix
|
||||
- CVE:NA
|
||||
- SUG:NA
|
||||
- DESC:add support for configuration of additional boot arguments
|
||||
change the startup mode of do_transaction sub process to spawn
|
||||
|
||||
* Sat Mar 05 2022 gaihuiying <eaglegai@163.com> - 33.19-41
|
||||
- Type:bugfix
|
||||
- CVE:NA
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
From e8e0d299420138e95dae58fcd4b5669e72217947 Mon Sep 17 00:00:00 2001
|
||||
From: Jialong Chen <chenjialong@huawei.com>
|
||||
Date: Tue, 14 Jul 2020 21:45:01 +0800
|
||||
Subject: [PATCH] add kdump parameter into kernel cmdline
|
||||
|
||||
---
|
||||
pyanaconda/modules/storage/bootloader/grub2.py | 12 ++++++++++--
|
||||
1 file changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/pyanaconda/modules/storage/bootloader/grub2.py b/pyanaconda/modules/storage/bootloader/grub2.py
|
||||
index c6b7db4..57fb2e5 100644
|
||||
--- a/pyanaconda/modules/storage/bootloader/grub2.py
|
||||
+++ b/pyanaconda/modules/storage/bootloader/grub2.py
|
||||
@@ -17,6 +17,7 @@
|
||||
#
|
||||
import os
|
||||
import re
|
||||
+import blivet
|
||||
from _ped import PARTITION_BIOS_GRUB
|
||||
|
||||
from blivet.devicelibs import raid
|
||||
@@ -266,8 +267,15 @@ class GRUB2(BootLoader):
|
||||
# this is going to cause problems for systems containing multiple
|
||||
# linux installations or even multiple boot entries with different
|
||||
# boot arguments
|
||||
- log.info("bootloader.py: used boot args: %s ", self.boot_args)
|
||||
- defaults.write("GRUB_CMDLINE_LINUX=\"%s\"\n" % self.boot_args)
|
||||
+ arg_str = "%s" % self.boot_args
|
||||
+ if blivet.arch.is_aarch64():
|
||||
+ log.info("check boot args:%s", arg_str)
|
||||
+ arg_str += " crashkernel=1024M,high"
|
||||
+ else:
|
||||
+ arg_str += " crashkernel=512M"
|
||||
+
|
||||
+ log.info("bootloader.py: used boot args: %s ", arg_str)
|
||||
+ defaults.write("GRUB_CMDLINE_LINUX=\"%s\"\n" % arg_str)
|
||||
defaults.write("GRUB_DISABLE_RECOVERY=\"true\"\n")
|
||||
#defaults.write("GRUB_THEME=\"/boot/grub2/themes/system/theme.txt\"\n")
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -0,0 +1,145 @@
|
||||
From a8379c76d391c8fdf47cdc141a8f24e129cf9e45 Mon Sep 17 00:00:00 2001
|
||||
From: Qiumiao Zhang <zhangqiumiao1@huawei.com>
|
||||
Date: Fri, 10 Dec 2021 22:35:45 -0500
|
||||
Subject: [PATCH] change the startup mode of do_transaction sub proces
|
||||
|
||||
---
|
||||
pyanaconda/payload/dnf/payload.py | 33 ++++++++++++++++--
|
||||
pyanaconda/payload/dnf/utils.py | 58 ++++++++++++++++++++++++++++++-
|
||||
2 files changed, 87 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/pyanaconda/payload/dnf/payload.py b/pyanaconda/payload/dnf/payload.py
|
||||
index 2a4b295..32ec971 100644
|
||||
--- a/pyanaconda/payload/dnf/payload.py
|
||||
+++ b/pyanaconda/payload/dnf/payload.py
|
||||
@@ -1326,9 +1326,36 @@ class DNFPayload(Payload):
|
||||
pre_msg = (N_("Preparing transaction from installation source"))
|
||||
progress_message(pre_msg)
|
||||
|
||||
- queue_instance = multiprocessing.Queue()
|
||||
- process = multiprocessing.Process(target=do_transaction,
|
||||
- args=(self._base, queue_instance))
|
||||
+ repos = dict()
|
||||
+ for repo in self._base.repos.iter_enabled():
|
||||
+ t_repo = dict()
|
||||
+ repo_agrs = dict()
|
||||
+ t_repo['baseurl'] = list(repo.baseurl)
|
||||
+ repo_agrs['sslverify'] = repo.sslverify
|
||||
+ repo_agrs['proxy'] = repo.proxy
|
||||
+ t_repo['repo_agrs'] = repo_agrs
|
||||
+ repos[repo.id] = t_repo
|
||||
+
|
||||
+ pkgs_list = list()
|
||||
+ for pkg in pkgs_to_download:
|
||||
+ pkgs_list.append(pkg.name)
|
||||
+
|
||||
+ ctx = multiprocessing.get_context('spawn')
|
||||
+ queue_instance = ctx.Queue()
|
||||
+ process = ctx.Process(target=do_transaction,
|
||||
+ args=(queue_instance, repos,
|
||||
+ self._base.conf.releasever,
|
||||
+ self._base.conf.installroot,
|
||||
+ self._base.conf.substitutions,
|
||||
+ self._base.conf.multilib_policy,
|
||||
+ self._base.conf.timeout,
|
||||
+ self._base.conf.retries,
|
||||
+ self._download_location,
|
||||
+ self._base.conf.proxy,
|
||||
+ self._base.conf.proxy_username,
|
||||
+ self._base.conf.proxy_password,
|
||||
+ pkgs_list))
|
||||
+
|
||||
process.start()
|
||||
(token, msg) = queue_instance.get()
|
||||
# When the installation works correctly it will get 'install' updates
|
||||
diff --git a/pyanaconda/payload/dnf/utils.py b/pyanaconda/payload/dnf/utils.py
|
||||
index dfac5c9..d716c08 100644
|
||||
--- a/pyanaconda/payload/dnf/utils.py
|
||||
+++ b/pyanaconda/payload/dnf/utils.py
|
||||
@@ -18,6 +18,7 @@
|
||||
import os
|
||||
import operator
|
||||
import time
|
||||
+import dnf
|
||||
|
||||
from blivet.size import Size
|
||||
|
||||
@@ -27,6 +28,7 @@ from pyanaconda.progress import progressQ
|
||||
from pyanaconda.core import util
|
||||
from pyanaconda.core.configuration.anaconda import conf
|
||||
from pyanaconda.product import productName, productVersion
|
||||
+from pyanaconda.flags import flags
|
||||
|
||||
log = get_packaging_logger()
|
||||
|
||||
@@ -121,12 +123,66 @@ def pick_mount_point(df, download_size, install_size, download_only):
|
||||
return sorted_mpoints[0][0]
|
||||
|
||||
|
||||
-def do_transaction(base, queue_instance):
|
||||
+def update_conf(conf, substitutions, releasever, installroot, multilib_policy, timeout, retries):
|
||||
+ conf.cachedir = DNF_CACHE_DIR
|
||||
+ conf.pluginconfpath = DNF_PLUGINCONF_DIR
|
||||
+ conf.logdir = '/tmp/'
|
||||
+ # enable depsolver debugging if in debug mode
|
||||
+ conf.debug_solver = flags.debug
|
||||
+
|
||||
+ conf.substitutions = substitutions
|
||||
+ conf.releasever = releasever
|
||||
+ conf.installroot = installroot
|
||||
+ conf.prepend_installroot('persistdir')
|
||||
+ conf.multilib_policy = multilib_policy
|
||||
+ conf.timeout = timeout
|
||||
+ conf.retries = retries
|
||||
+
|
||||
+ conf.substitutions.update_from_etc(conf.installroot)
|
||||
+
|
||||
+ conf.reposdir = REPO_DIRS
|
||||
+
|
||||
+
|
||||
+def update_proxy(conf, proxy, proxy_username, proxy_password):
|
||||
+ conf.proxy = proxy
|
||||
+ conf.proxy_username = proxy_username
|
||||
+ conf.proxy_password = proxy_password
|
||||
+
|
||||
+
|
||||
+def update_depdency(base, include_list):
|
||||
+ base.fill_sack()
|
||||
+ base.read_comps()
|
||||
+ base.install_specs(install=include_list, exclude=None)
|
||||
+ base.resolve()
|
||||
+
|
||||
+
|
||||
+def do_transaction(queue_instance, repos, releasever, installroot, substitutions,
|
||||
+ multilib_policy, timeout, retries, pkgdir, proxy,
|
||||
+ proxy_username, proxy_password, include_list):
|
||||
# Execute the DNF transaction and catch any errors. An error doesn't
|
||||
# always raise a BaseException, so presence of 'quit' without a preceeding
|
||||
# 'post' message also indicates a problem.
|
||||
try:
|
||||
display = TransactionProgress(queue_instance)
|
||||
+ # We create new dnf base obj, and update it from parent process
|
||||
+ base = dnf.Base()
|
||||
+ conf = base.conf
|
||||
+
|
||||
+ update_conf(conf, substitutions, releasever, installroot, multilib_policy, timeout, retries)
|
||||
+ update_proxy(conf, proxy, proxy_username, proxy_password)
|
||||
+
|
||||
+ queue_instance.put(('log', 'start to setup repo.'))
|
||||
+ for (key, repo) in repos.items():
|
||||
+ base.repos.add_new_repo(key, conf, repo['baseurl'], **repo['repo_agrs'])
|
||||
+ base.repos[key].enable()
|
||||
+
|
||||
+ for repo in base.repos.iter_enabled():
|
||||
+ repo.pkgdir = pkgdir
|
||||
+
|
||||
+ queue_instance.put(('log', 'start to update depdency.'))
|
||||
+ update_depdency(base, include_list)
|
||||
+
|
||||
+ queue_instance.put(('log', 'start to transaction.'))
|
||||
base.do_transaction(display=display)
|
||||
exit_reason = "DNF quit"
|
||||
except BaseException as e: # pylint: disable=broad-except
|
||||
--
|
||||
2.19.1
|
||||
|
||||
21
euleros.conf
Normal file
21
euleros.conf
Normal file
@ -0,0 +1,21 @@
|
||||
# Anaconda configuration file for EulerOS
|
||||
|
||||
[Product]
|
||||
product_name = EulerOS
|
||||
variant_name = Server
|
||||
|
||||
[Network]
|
||||
default_on_boot = FIRST_WIRED_WITH_LINK
|
||||
|
||||
[Bootloader]
|
||||
efi_dir = euleros
|
||||
additional_arguments = crash_kexec_post_notifiers softlockup_panic=1 reserve_kbox_mem=16M fsck.mode=auto fsck.repair=yes
|
||||
|
||||
[Payload]
|
||||
enable_closest_mirror = True
|
||||
|
||||
[User Interface]
|
||||
blivet_gui_supported = False
|
||||
|
||||
[License]
|
||||
eula = "/usr/share/euleros-release/EULA"
|
||||
21
hce.conf
Normal file
21
hce.conf
Normal file
@ -0,0 +1,21 @@
|
||||
# Anaconda configuration file for HCE
|
||||
|
||||
[Product]
|
||||
product_name = HCE
|
||||
variant_name = Server
|
||||
|
||||
[Network]
|
||||
default_on_boot = FIRST_WIRED_WITH_LINK
|
||||
|
||||
[Bootloader]
|
||||
efi_dir = hce
|
||||
additional_arguments = crash_kexec_post_notifiers softlockup_panic=1 reserve_kbox_mem=16M fsck.mode=auto fsck.repair=yes
|
||||
|
||||
[Payload]
|
||||
enable_closest_mirror = True
|
||||
|
||||
[User Interface]
|
||||
blivet_gui_supported = False
|
||||
|
||||
[License]
|
||||
eula = "/usr/share/hce-release/EULA"
|
||||
@ -8,6 +8,7 @@ default_on_boot = FIRST_WIRED_WITH_LINK
|
||||
|
||||
[Bootloader]
|
||||
efi_dir = openEuler
|
||||
additional_arguments =
|
||||
|
||||
[Payload]
|
||||
enable_closest_mirror = True
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user