diff --git a/.boom-boot.metadata b/.boom-boot.metadata index 3c39db8..a7b0260 100644 --- a/.boom-boot.metadata +++ b/.boom-boot.metadata @@ -1 +1 @@ -67070610fcc9a8ee2c4fcdb165947b1d30599342 SOURCES/boom-1.2.tar.gz +4c95e888f7aecd9dd809c6f0d44ce650a5ae07da SOURCES/boom-1.3.tar.gz diff --git a/.gitignore b/.gitignore index 40c357f..b3db033 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/boom-1.2.tar.gz +SOURCES/boom-1.3.tar.gz diff --git a/SOURCES/0003-boom-bump-release-to-1.2.patch b/SOURCES/0003-boom-bump-release-to-1.2.patch deleted file mode 100644 index bd25e51..0000000 --- a/SOURCES/0003-boom-bump-release-to-1.2.patch +++ /dev/null @@ -1,46 +0,0 @@ - boom.spec | 2 +- - boom/__init__.py | 2 +- - doc/conf.py | 4 ++-- - 3 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/boom.spec b/boom.spec -index 160aa53..9331112 100644 ---- a/boom.spec -+++ b/boom.spec -@@ -2,7 +2,7 @@ - %global sphinx_docs 1 - - Name: boom --Version: 1.1 -+Version: 1.2 - Release: 1%{?dist} - Summary: %{summary} - -diff --git a/boom/__init__.py b/boom/__init__.py -index fa17610..34f2d14 100644 ---- a/boom/__init__.py -+++ b/boom/__init__.py -@@ -35,6 +35,6 @@ from __future__ import print_function - from ._boom import * - from ._boom import __all__ - --__version__ = "1.1" -+__version__ = "1.2" - - # vim: set et ts=4 sw=4 : -diff --git a/doc/conf.py b/doc/conf.py -index cccdcfa..043655b 100644 ---- a/doc/conf.py -+++ b/doc/conf.py -@@ -64,9 +64,9 @@ author = u'Bryn M. Reeves' - # built documents. - # - # The short X.Y version. --version = u'1.1' -+version = u'1.2' - # The full version, including alpha/beta/rc tags. --release = u'1.1' -+release = u'1.2' - - # The language for content autogenerated by Sphinx. Refer to documentation - # for a list of supported languages. diff --git a/SOURCES/0004-boom-fix-precedence-and-handle-conflicts-when-mergin.patch b/SOURCES/0004-boom-fix-precedence-and-handle-conflicts-when-mergin.patch deleted file mode 100644 index 5f160d9..0000000 --- a/SOURCES/0004-boom-fix-precedence-and-handle-conflicts-when-mergin.patch +++ /dev/null @@ -1,117 +0,0 @@ - boom/command.py | 84 ++++++++++++++++++++++++++++++++++++++++++--------------- - 1 file changed, 63 insertions(+), 21 deletions(-) - -diff --git a/boom/command.py b/boom/command.py -index dc9abae..8900457 100644 ---- a/boom/command.py -+++ b/boom/command.py -@@ -482,24 +482,72 @@ def _do_print_type(report_fields, selected, output_fields=None, - return br.report_output() - - --def _merge_add_del_opts(orig_opts, opts): -+def _merge_add_del_opts(bp, add_opts, del_opts): - """Merge a set of existing bootparams option alterations with - a set of command-line provided values to produce a single - set of options to add or remove from a cloned or edited - ``BootEntry``. -- :param orig_opts: A list of original option modifications -- :param opts: A space-separated string containing a list of -- command line option modifications -- :returns: A single list containing the merged options -- """ -- # Merge new and cloned kernel options -- all_opts = set() -- if opts: -- all_opts.update(opts.split()) -- if orig_opts: -- all_opts.update(orig_opts) - -- return list(all_opts) -+ The sets are merged giving precedence to alterations on the -+ current command line: i.e. if an option is present in both -+ ``bp.del_opts`` and ``add_opts`` (or vice versa) then the -+ option taken from the current command line will be effective. -+ -+ :param bp: A ``BootParams`` object with the original ``add_opts`` -+ and ``del_opts`` values. -+ :param add_opts: A space-separated string containing a list of -+ additional options taken from the current -+ command line. -+ :param del_opts: A space-separated string containing a list of -+ options to delete taken from the current -+ command line. -+ :returns: A tuple ``(effective_add_opts, effective_del_opts)`` -+ giving the final effective values as a list of -+ strings, one per option word. -+ """ -+ def _merge_opts(orig_opts, opts, r_opts): -+ # Merge new and cloned kernel options -+ all_opts = set() -+ if opts: -+ all_opts.update(opts) -+ if orig_opts: -+ all_opts.update(orig_opts) -+ all_opts = list(all_opts) -+ return [o for o in all_opts if o not in r_opts] -+ -+ _log_debug_cmd("Add opts: %s" % add_opts) -+ _log_debug_cmd("Del opts: %s" % del_opts) -+ _log_debug_cmd("Original add_opts: %s" % bp.add_opts) -+ _log_debug_cmd("Original del_opts: %s" % bp.del_opts) -+ -+ r_del_opts = [] -+ r_add_opts = [] -+ -+ add_opts = add_opts.split() if add_opts else [] -+ del_opts = del_opts.split() if del_opts else [] -+ -+ for add_opt in list(add_opts): -+ # Do not allow conflicting command line add/del opts -+ if add_opt in del_opts: -+ raise ValueError("Conflicting --add-opts %s and --del-opts %s" % -+ (add_opt, add_opt)) -+ -+ if add_opt in bp.del_opts: -+ r_del_opts.append(add_opt) -+ add_opts.remove(add_opt) -+ -+ for del_opt in list(del_opts): -+ if del_opt in bp.add_opts: -+ r_add_opts.append(del_opt) -+ del_opts.remove(del_opt) -+ -+ add_opts = _merge_opts(bp.add_opts, add_opts, r_add_opts) -+ del_opts = _merge_opts(bp.del_opts, del_opts, r_del_opts) -+ -+ _log_debug_cmd("Effective add options: %s" % add_opts) -+ _log_debug_cmd("Effective del options: %s" % del_opts) -+ -+ return (add_opts, del_opts) - - - # -@@ -759,10 +807,7 @@ def clone_entry(selection=None, title=None, version=None, machine_id=None, - else be.bp.btrfs_subvol_id) - profile = profile if profile else be._osp - -- add_opts = _merge_add_del_opts(be.bp.add_opts, add_opts) -- del_opts = _merge_add_del_opts(be.bp.del_opts, del_opts) -- _log_debug_cmd("Effective add options: %s" % add_opts) -- _log_debug_cmd("Effective del options: %s" % del_opts) -+ (add_opts, del_opts) = _merge_add_del_opts(be.bp, add_opts, del_opts) - - bp = BootParams(version, root_device, lvm_root_lv=lvm_root_lv, - btrfs_subvol_path=btrfs_subvol_path, -@@ -864,10 +909,7 @@ def edit_entry(selection=None, title=None, version=None, machine_id=None, - machine_id = machine_id or be.machine_id - version = version or be.version - -- add_opts = _merge_add_del_opts(be.bp.add_opts, add_opts) -- del_opts = _merge_add_del_opts(be.bp.del_opts, del_opts) -- _log_debug_cmd("Effective add options: %s" % add_opts) -- _log_debug_cmd("Effective del options: %s" % del_opts) -+ (add_opts, del_opts) = _merge_add_del_opts(be.bp, add_opts, del_opts) - - be._osp = profile or be._osp - be.title = title or be.title diff --git a/SOURCES/0005-boom-pass-add-del-opts-to-edit_entry-in-edit-command.patch b/SOURCES/0005-boom-pass-add-del-opts-to-edit_entry-in-edit-command.patch deleted file mode 100644 index e8b77e7..0000000 --- a/SOURCES/0005-boom-pass-add-del-opts-to-edit_entry-in-edit-command.patch +++ /dev/null @@ -1,25 +0,0 @@ - boom/command.py | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/boom/command.py b/boom/command.py -index 8900457..165a8a8 100644 ---- a/boom/command.py -+++ b/boom/command.py -@@ -2256,6 +2256,9 @@ def _edit_cmd(cmd_args, select, opts, identifier): - - profile = _find_profile(cmd_args, version, machine_id, "edit") - -+ add_opts = cmd_args.add_opts -+ del_opts = cmd_args.del_opts -+ - arch = cmd_args.architecture - - try: -@@ -2264,6 +2267,7 @@ def _edit_cmd(cmd_args, select, opts, identifier): - lvm_root_lv=lvm_root_lv, - btrfs_subvol_path=btrfs_subvol_path, - btrfs_subvol_id=btrfs_subvol_id, profile=profile, -+ add_opts=add_opts, del_opts=del_opts, - architecture=arch, expand=cmd_args.expand_variables) - except ValueError as e: - print(e) diff --git a/SOURCES/0006-boom-check-for-duplicates-in-edit_entry.patch b/SOURCES/0006-boom-check-for-duplicates-in-edit_entry.patch deleted file mode 100644 index 20afe98..0000000 --- a/SOURCES/0006-boom-check-for-duplicates-in-edit_entry.patch +++ /dev/null @@ -1,19 +0,0 @@ - boom/command.py | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/boom/command.py b/boom/command.py -index 165a8a8..c164b33 100644 ---- a/boom/command.py -+++ b/boom/command.py -@@ -927,6 +927,11 @@ def edit_entry(selection=None, title=None, version=None, machine_id=None, - be.initrd = _cache_image(be.initrd, images == I_BACKUP) - be.linux = _cache_image(be.linux, images == I_BACKUP) - -+ # Is the entry now identical to an existing entry? -+ if len(find_entries(Selection(boot_id=be.boot_id))) > 1: -+ raise ValueError("Entry already exists (boot_id=%s)." % -+ be.disp_boot_id) -+ - be.update_entry(expand=expand) - __write_legacy() - diff --git a/SOURCES/0007-tests-add-test_clone_entry_-add-del-_opts_and_re_-ad.patch b/SOURCES/0007-tests-add-test_clone_entry_-add-del-_opts_and_re_-ad.patch deleted file mode 100644 index 1d3a385..0000000 --- a/SOURCES/0007-tests-add-test_clone_entry_-add-del-_opts_and_re_-ad.patch +++ /dev/null @@ -1,50 +0,0 @@ - tests/command_tests.py | 36 ++++++++++++++++++++++++++++++++++++ - 1 file changed, 36 insertions(+) - -diff --git a/tests/command_tests.py b/tests/command_tests.py -index 6d0c79b..fee6a33 100644 ---- a/tests/command_tests.py -+++ b/tests/command_tests.py -@@ -519,6 +519,42 @@ class CommandTests(unittest.TestCase): - be.delete_entry() - self.assertFalse(exists(be._entry_path)) - -+ def test_clone_entry_del_opts_and_re_add(self): -+ # Fedora 24 (Workstation Edition) -+ -+ # Delete rhgb quiet -+ osp = get_os_profile_by_id(test_os_id) -+ be = create_entry("delopts", "2.6.0", "ffffffff", test_lv, -+ lvm_root_lv=test_root_lv, profile=osp, -+ del_opts="rhgb quiet") -+ -+ # Assert it's gone -+ self.assertFalse("rhgb quiet" in be.options) -+ -+ be2 = clone_entry(Selection(boot_id=be.boot_id), title="addoptsclone", -+ add_opts="rhgb quiet") -+ -+ # Assert it's back -+ self.assertTrue("rhgb quiet" in be2.options) -+ -+ def test_clone_entry_add_opts_and_re_del(self): -+ # Fedora 24 (Workstation Edition) -+ -+ # Add debug -+ osp = get_os_profile_by_id(test_os_id) -+ be = create_entry("addopts", "2.6.0", "ffffffff", test_lv, -+ lvm_root_lv=test_root_lv, profile=osp, -+ add_opts="debug") -+ -+ # Assert it's there -+ self.assertTrue("debug" in be.options) -+ -+ be2 = clone_entry(Selection(boot_id=be.boot_id), title="deloptsclone", -+ del_opts="debug") -+ -+ # Assert it's gone -+ self.assertFalse("debug" in be2.options) -+ - @unittest.skipIf(not have_root_lv(), "requires root LV") - def test_clone_delete_entry(self): - # Fedora 24 (Workstation Edition) diff --git a/SOURCES/0008-tests-skip-add-del-and-re-del-add-tests-if-have_root.patch b/SOURCES/0008-tests-skip-add-del-and-re-del-add-tests-if-have_root.patch deleted file mode 100644 index 85ce7aa..0000000 --- a/SOURCES/0008-tests-skip-add-del-and-re-del-add-tests-if-have_root.patch +++ /dev/null @@ -1,23 +0,0 @@ - tests/command_tests.py | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/tests/command_tests.py b/tests/command_tests.py -index fee6a33..b85b7dd 100644 ---- a/tests/command_tests.py -+++ b/tests/command_tests.py -@@ -519,6 +519,7 @@ class CommandTests(unittest.TestCase): - be.delete_entry() - self.assertFalse(exists(be._entry_path)) - -+ @unittest.skipIf(not have_root_lv(), "requires root LV") - def test_clone_entry_del_opts_and_re_add(self): - # Fedora 24 (Workstation Edition) - -@@ -537,6 +538,7 @@ class CommandTests(unittest.TestCase): - # Assert it's back - self.assertTrue("rhgb quiet" in be2.options) - -+ @unittest.skipIf(not have_root_lv(), "requires root LV") - def test_clone_entry_add_opts_and_re_del(self): - # Fedora 24 (Workstation Edition) - diff --git a/SPECS/boom-boot.spec b/SPECS/boom-boot.spec index 3e26b6b..25a2c39 100644 --- a/SPECS/boom-boot.spec +++ b/SPECS/boom-boot.spec @@ -2,8 +2,8 @@ %global sphinx_docs 1 Name: boom-boot -Version: 1.2 -Release: 2%{?dist} +Version: 1.3 +Release: 1%{?dist} Summary: %{summary} License: GPLv2 @@ -12,12 +12,6 @@ Source0: https://github.com/snapshotmanager/boom/archive/%{version}/boom-%{versi Patch0: Disable-GRUB2-plugin-on-RHEL-8.patch Patch1: 0001-etc-Remove-executable-permission-from-etc-default-bo.patch Patch2: 0002-man-Fix-line-starting-with.patch -Patch3: 0003-boom-bump-release-to-1.2.patch -Patch4: 0004-boom-fix-precedence-and-handle-conflicts-when-mergin.patch -Patch5: 0005-boom-pass-add-del-opts-to-edit_entry-in-edit-command.patch -Patch6: 0006-boom-check-for-duplicates-in-edit_entry.patch -Patch7: 0007-tests-add-test_clone_entry_-add-del-_opts_and_re_-ad.patch -Patch8: 0008-tests-skip-add-del-and-re-del-add-tests-if-have_root.patch BuildArch: noarch @@ -27,6 +21,7 @@ BuildRequires: python3-devel %if 0%{?sphinx_docs} BuildRequires: python3-sphinx %endif +BuildRequires: make Requires: python3-boom = %{version}-%{release} Requires: %{name}-conf = %{version}-%{release} @@ -97,12 +92,6 @@ This package provides integration scripts for grub2 bootloader. %patch0 -p1 %patch1 -p1 %patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 %build %if 0%{?sphinx_docs} @@ -177,6 +166,26 @@ rm doc/conf.py %changelog +* Sat Jan 30 2021 Marian Csontos 1.3-1 +- Check for duplicates consistently in the clone and edit commands. +- Apply correct command line precedence to --add-opts and --del-opts. +- Correctly merge multiple --add/del-opts when editing or cloning. +- Correctly propagate --add/del-opts in boom edit commands. +- Enhanced logging of --add/del-opts merge logic. +- The default Python interpreter is now /usr/bin/python. +- Fixed re-ordering of options modifications when read from disk. +- Do not set BootParams attributes for anonymous option words. +- Make lvm_root_lv validation checks more strict. +- Improve BootParams.from_entry() parameter recovery debug logging. +- Include sample OsProfile for Fedora 32. +- Re-set sandbox state in test suite to ensure run-to-run consistency. +- Improve compatibility with Red Hat BLS implementation. +- Allow non-boom managed entries to be listed and displayed. +- Handle quirks in Red Hat's use of the BLS machine_id key. +- Allow grub2 bootloader variables to be expanded when cloning entries. +- Simplify clone_entry logic and make consistent with edit_entry. +- Ensure stable ordering of legacy boot entry configuration. + * Mon Jun 29 2020 Marian Csontos 1.2-2 - Fix RHEL-8 profiles. - Fix --add/del-opt precedence.