From 7a5f57494ff1dcd6c3305444be21943d6b5df705 Mon Sep 17 00:00:00 2001 From: sun_hai_10 Date: Thu, 27 Jul 2023 21:47:43 +0800 Subject: [PATCH] sync from master to 2203next --- anaconda.spec | 32 +++- ...up-mode-of-do_transaction-sub-proces.patch | 160 ++++++++++++++++++ 2 files changed, 188 insertions(+), 4 deletions(-) create mode 100644 bugfix-change-the-startup-mode-of-do_transaction-sub-proces.patch diff --git a/anaconda.spec b/anaconda.spec index 9f187fd..c2b7d41 100644 --- a/anaconda.spec +++ b/anaconda.spec @@ -1,7 +1,7 @@ %define _empty_manifest_terminate_build 0 Name: anaconda Version: 36.16.5 -Release: 16 +Release: 19 Summary: Graphical system installer License: GPLv2+ and MIT URL: http://fedoraproject.org/wiki/Anaconda @@ -37,7 +37,6 @@ Patch9015: bugfix-change-gnome-kiosk-to-use-metacity.patch Patch9016: bugfix-add-log-and-background.patch Patch9017: bugfix-add-SM3-with-tui.patch Patch9018: bugfix-change-product-name-do-not-with-upper.patch - Patch6003: backport-dracut-handle-compressed-kernel-modules.patch Patch6004: backport-Ignore-SIGINT-in-D-Bus-launcher-and-x11-too.patch Patch6005: backport-network-use-separate-main-conext-for-NM-client-in-threads.patch @@ -47,6 +46,9 @@ Patch9019: bugfix-adapt-active-connection-without-interface-name.patch Patch9020: bugfix-password-tooltip-text-adapt-language.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 + %define dasbusver 1.3 %define dbusver 1.2.3 %define dnfver 3.6.0 @@ -170,7 +172,11 @@ runtime on NFS/HTTP/FTP servers or local disks. %build # use actual build-time release number, not tarball creation time release number +%if "%toolchain" == "clang" +%configure ANACONDA_RELEASE=%{release} CC=clang +%else %configure ANACONDA_RELEASE=%{release} +%endif %make_build %install @@ -284,7 +290,19 @@ update-desktop-database &> /dev/null || : %{_prefix}/libexec/anaconda/dd_* %changelog -* Fri Jun 09 2023 sunhai - 36.16.5-16 +* Mon Jul 10 2023 sunhai - 36.16.5-19 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: change the startup mode of do_transaction sub proces + +* Fri Jun 09 2023 sunhai - 36.16.5-18 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: set grub configuration file is as original + +* Fri Jun 09 2023 sunhai - 36.16.5-17 - Type:bugfix - ID:NA - SUG:NA @@ -293,12 +311,18 @@ update-desktop-database &> /dev/null || : dracut handle compressed kernel modules Sort RPM versions via rpm.labelCompare -* Sat Jun 03 2023 sunhai - 36.16.5-15 +* Sat Jun 03 2023 sunhai - 36.16.5-16 - Type:bugfix - ID:NA - SUG:NA - DESC: fix gui hostname warn info +* Tue May 16 2023 Chenxi Mao - 36.16.5-15 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: Support build with clang. + * Fri Feb 24 2023 sunhai - 36.16.5-14 - Type:bugfix - ID:NA diff --git a/bugfix-change-the-startup-mode-of-do_transaction-sub-proces.patch b/bugfix-change-the-startup-mode-of-do_transaction-sub-proces.patch new file mode 100644 index 0000000..9179cd2 --- /dev/null +++ b/bugfix-change-the-startup-mode-of-do_transaction-sub-proces.patch @@ -0,0 +1,160 @@ +From 7dc41d9a1f3d0e3dfa48838cf0e75c2f0f04e207 Mon Sep 17 00:00:00 2001 +From: sun_hai_10 +Date: Sun, 25 Jun 2023 15:01:25 +0800 +Subject: [PATCH] change the startup mode of do_transaction sub proces + +--- + .../payloads/payload/dnf/dnf_manager.py | 109 ++++++++++++++++-- + 1 file changed, 102 insertions(+), 7 deletions(-) + +diff --git a/pyanaconda/modules/payloads/payload/dnf/dnf_manager.py b/pyanaconda/modules/payloads/payload/dnf/dnf_manager.py +index b1f452c..c73f3d9 100644 +--- a/pyanaconda/modules/payloads/payload/dnf/dnf_manager.py ++++ b/pyanaconda/modules/payloads/payload/dnf/dnf_manager.py +@@ -67,6 +67,50 @@ DNF_PLUGINCONF_DIR = '/tmp/dnf.pluginconf' + # + DNF_EXTRA_SIZE_PER_FILE = Size("6 KiB") + ++g_include_list = [] ++g_exclude_list = [] ++ ++def update_conf(conf, substitutions, releasever, installroot, multilib_policy, timeout, retries): ++ conf.cachedir = DNF_CACHE_DIR ++ conf.pluginconfpath = DNF_PLUGINCONF_DIR ++ conf.logdir = '/tmp/' ++ ++ 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 = DNF_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, exclude_list, ignore_broken_packages, ignore_missing_packages): ++ base.fill_sack() ++ base.read_comps() ++ ++ try: ++ base.install_specs( ++ install=include_list, ++ exclude=exclude_list, ++ strict=not ignore_broken_packages ++ ) ++ except dnf.exceptions.MarkingErrors as e: ++ log.error("Failed to apply specs!\n%s", str(e)) ++ if ignore_missing_packages: ++ log.info("Ignoring missing packages, groups or modules.") ++ else: ++ message = _("Some packages, groups or modules are missing.") ++ raise MissingSpecsError(message + "\n\n" + str(e).strip()) from None ++ ++ base.resolve() + + class DNFManagerError(Exception): + """General error for the DNF manager.""" +@@ -555,6 +599,10 @@ class DNFManager(object): + log.info("Including specs: %s", include_list) + log.info("Excluding specs: %s", exclude_list) + ++ global g_include_list, g_exclude_list ++ g_include_list.extend(include_list) ++ g_exclude_list.extend(exclude_list) ++ + try: + self._base.install_specs( + install=include_list, +@@ -664,12 +712,35 @@ class DNFManager(object): + :param timeout: a time out of a failed process in seconds + :raise PayloadInstallationError: if the installation fails + """ +- queue = multiprocessing.Queue() +- display = TransactionProgress(queue) +- process = multiprocessing.Process( +- target=self._run_transaction, +- args=(self._base, display) +- ) ++ 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 ++ ++ global g_include_list, g_exclude_list ++ ctx = multiprocessing.get_context('spawn') ++ queue = ctx.Queue() ++ process = ctx.Process(target=self._run_transaction, ++ args=(queue, 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, ++ g_include_list, ++ g_exclude_list, ++ self._ignore_broken_packages, ++ self._ignore_missing_packages)) + + # Start the transaction. + log.debug("Starting the transaction process...") +@@ -688,7 +759,10 @@ class DNFManager(object): + log.debug("The transaction process exited with %s.", process.exitcode) + + @staticmethod +- def _run_transaction(base, display): ++ def _run_transaction(queue_instance, repos, releasever, installroot, substitutions, ++ multilib_policy, timeout, retries, pkgdir, proxy, ++ proxy_username, proxy_password, include_list, exclude_list, ++ ignore_broken_packages, ignore_missing_packages): + """Run the DNF transaction. + + Execute the DNF transaction and catch any errors. An error +@@ -702,6 +776,27 @@ class DNFManager(object): + exit_reason = None + + try: ++ display = TransactionProgress(queue_instance) ++ ++ 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, exclude_list, ignore_broken_packages, ignore_missing_packages) ++ queue_instance.put(('log', 'start to transaction.')) ++ + base.do_transaction(display) + exit_reason = "DNF done" + except BaseException as e: # pylint: disable=broad-except +-- +2.19.1 +