From 0cd0ce612b704e1ee6fea5b72cdf1d17e7515350 Mon Sep 17 00:00:00 2001 From: wanglu210 Date: Fri, 5 Aug 2022 17:02:37 +0800 Subject: [PATCH] revert "Set default entry to the BLS id instead of the entry index" --- anaconda.spec | 9 +++- ...lt-entry-to-the-BLS-id-instead-of-th.patch | 46 +++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 revert-Set-default-entry-to-the-BLS-id-instead-of-th.patch diff --git a/anaconda.spec b/anaconda.spec index 3d8298c..e580767 100644 --- a/anaconda.spec +++ b/anaconda.spec @@ -4,7 +4,7 @@ %endif Name: anaconda Version: 33.19 -Release: 32 +Release: 33 Summary: Graphical system installer License: GPLv2+ and MIT URL: http://fedoraproject.org/wiki/Anaconda @@ -121,6 +121,7 @@ Patch6076: change-inst-repo-default-value.patch Patch9026: support-use-sm3-crypt-user-password.patch Patch6077: bugfix-Cancel-planned-manual-update-of-system-time-on-turni.patch +Patch6078: revert-Set-default-entry-to-the-BLS-id-instead-of-th.patch %define dbusver 1.2.3 %define dnfver 3.6.0 @@ -334,6 +335,12 @@ update-desktop-database &> /dev/null || : %{_datadir}/gtk-doc %changelog +* Fri Aug 5 2022 wanglu - 33.19-33 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:revert "Set default entry to the BLS id instead of the entry index" + * Fri Jul 29 2022 sunhai - 33.19-32 - Type:bugfix - ID:NA diff --git a/revert-Set-default-entry-to-the-BLS-id-instead-of-th.patch b/revert-Set-default-entry-to-the-BLS-id-instead-of-th.patch new file mode 100644 index 0000000..0d43f29 --- /dev/null +++ b/revert-Set-default-entry-to-the-BLS-id-instead-of-th.patch @@ -0,0 +1,46 @@ +From e45322c3ea34f5e0941ca64a2c01ed7362b7a04a Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Fri, 5 Aug 2022 16:51:38 +0800 +Subject: [PATCH] revert "Set default entry to the BLS id instead of the entry index" + +revert the patch of "Set default entry to the BLS id instead of the entry index" +Reference:https://github.com/rhinstaller/anaconda/commit/a252e4424bd51d6236d3b7b8e3840d8ca0af90a2 +Conflict:https://github.com/rhinstaller/anaconda/commit/a252e4424bd51d6236d3b7b8e3840d8ca0af90a2 +--- + .../modules/storage/bootloader/grub2.py | 20 +++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/pyanaconda/modules/storage/bootloader/grub2.py b/pyanaconda/modules/storage/bootloader/grub2.py +index a70ba7a..b0f3b0a 100644 +--- a/pyanaconda/modules/storage/bootloader/grub2.py ++++ b/pyanaconda/modules/storage/bootloader/grub2.py +@@ -351,16 +351,16 @@ class GRUB2(BootLoader): + + # make sure the default entry is the OS we are installing + if self.default is not None: +- machine_id_path = conf.target.system_root + "/etc/machine-id" +- if not os.access(machine_id_path, os.R_OK): +- log.error("failed to read machine-id, default entry not set") +- return +- +- with open(machine_id_path, "r") as fd: +- machine_id = fd.readline().strip() +- +- default_entry = "%s-%s" % (machine_id, self.default.version) +- rc = util.execInSysroot("grub2-set-default", [default_entry]) ++ # find the index of the default image ++ try: ++ default_index = self.images.index(self.default) ++ except ValueError: ++ # pylint: disable=no-member ++ log.warning("Failed to find default image (%s), defaulting to 0", ++ self.default.label) ++ default_index = 0 ++ ++ rc = util.execInSysroot("grub2-set-default", [str(default_index)]) + if rc: + log.error("failed to set default menu entry to %s", productName) + +-- +2.27.0 +