Skip to content

Commit

Permalink
Set grub-bls default to false for SUSE on SLES15
Browse files Browse the repository at this point in the history
For the time being, SLES15 distributions cannot handle
KIWI's default to use BLS with GRUB2. Until they catch up,
revert this for them only.
  • Loading branch information
schaefi committed Nov 13, 2024
1 parent 6799a2c commit f8cff49
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ build: clean tox
-e s"@%%MD5SUM@$${md5sums}@" > dist/PKGBUILD
# provide rpm rpmlintrc
cp package/python-kiwi-rpmlintrc dist
# provide patches
cp package/*.patch dist

pypi: clean tox
$(python) setup.py sdist upload
Expand Down
56 changes: 56 additions & 0 deletions package/kiwi-revert-bls-default-for-suse.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
diff --git a/kiwi/bootloader/config/grub2.py b/kiwi/bootloader/config/grub2.py
index 461b168c0..120088d6b 100644
--- a/kiwi/bootloader/config/grub2.py
+++ b/kiwi/bootloader/config/grub2.py
@@ -764,15 +764,6 @@ class BootLoaderConfigGrub2(BootLoaderConfigBase):
if self.custom_args.get('crypto_disk'):
grub_default_entries['GRUB_ENABLE_CRYPTODISK'] = 'y'

- enable_blscfg_implemented = Command.run(
- [
- 'grep', '-q', 'GRUB_ENABLE_BLSCFG',
- self._get_grub2_mkconfig_tool()
- ], raise_on_error=False
- )
- if enable_blscfg_implemented.returncode == 0:
- grub_default_entries['GRUB_ENABLE_BLSCFG'] = 'true'
-
if grub_default_entries:
log.info('Writing grub2 defaults file')
grub_default_location = ''.join([self.root_dir, '/etc/default/'])
diff --git a/test/unit/bootloader/config/grub2_test.py b/test/unit/bootloader/config/grub2_test.py
index 19e0f4d98..daf8e5868 100644
--- a/test/unit/bootloader/config/grub2_test.py
+++ b/test/unit/bootloader/config/grub2_test.py
@@ -579,7 +579,6 @@ class TestBootLoaderConfigGrub2:
),
call('GRUB_CMDLINE_LINUX_DEFAULT', '"some-cmdline"'),
call('GRUB_DISTRIBUTOR', '"Bob"'),
- call('GRUB_ENABLE_BLSCFG', 'true'),
call('GRUB_ENABLE_CRYPTODISK', 'y'),
call('GRUB_GFXMODE', '800x600'),
call(
@@ -625,7 +624,6 @@ class TestBootLoaderConfigGrub2:
call('GRUB_CMDLINE_LINUX', '"root=LABEL=some-label"'),
call('GRUB_DISABLE_LINUX_UUID', 'true'),
call('GRUB_DISTRIBUTOR', '"Bob"'),
- call('GRUB_ENABLE_BLSCFG', 'true'),
call('GRUB_ENABLE_CRYPTODISK', 'y'),
call('GRUB_ENABLE_LINUX_LABEL', 'true'),
call('GRUB_GFXMODE', '800x600'),
@@ -670,7 +668,6 @@ class TestBootLoaderConfigGrub2:
call('GRUB_DISABLE_LINUX_PARTUUID', 'false'),
call('GRUB_DISABLE_LINUX_UUID', 'true'),
call('GRUB_DISTRIBUTOR', '"Bob"'),
- call('GRUB_ENABLE_BLSCFG', 'true'),
call('GRUB_ENABLE_CRYPTODISK', 'y'),
call('GRUB_GFXMODE', '800x600'),
call(
@@ -714,7 +711,6 @@ class TestBootLoaderConfigGrub2:
call('GRUB_CMDLINE_LINUX_DEFAULT', '"abcd console=tty0"'),
call('GRUB_DISABLE_LINUX_UUID', 'true'),
call('GRUB_DISTRIBUTOR', '"Bob"'),
- call('GRUB_ENABLE_BLSCFG', 'true'),
call('GRUB_ENABLE_CRYPTODISK', 'y'),
call('GRUB_ENABLE_LINUX_LABEL', 'true'),
call('GRUB_GFXMODE', '800x600'),
8 changes: 8 additions & 0 deletions package/python-kiwi-spec-template
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ Packager: Marcus Schaefer <[email protected]>
Group: %{pygroup}
Source: %{name}.tar.gz
Source1: %{name}-rpmlintrc
# SUSE-specific patches (1001+)
## PATCH-FIX-OPENSUSE kiwi-revert-bls-default-for-suse.patch -- temporary until opensuse has bls
Patch1001: kiwi-revert-bls-default-for-suse.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: gcc
BuildRequires: python%{python3_pkgversion}-%{develsuffix} >= 3.6
Expand Down Expand Up @@ -574,6 +577,11 @@ Provides manual pages to describe the kiwi commands
%prep
%setup -q -n kiwi-%{version}

%if 0%{?suse_version}
# Temporarily revert grub-bls default to false for SUSE distributions
%patch -P 1001 -p1
%endif

# Drop shebang for kiwi/xml_parse.py, as we don't intend to use it
# as an independent script
sed -e "s|#!/usr/bin/env python||" -i kiwi/xml_parse.py
Expand Down

0 comments on commit f8cff49

Please sign in to comment.