Skip to content

Commit 6218bb8

Browse files
committed
Run grub mkconfig with os-prober disabled
Set GRUB_DISABLE_OS_PROBER=true to the caller environment such that it gets consumed via /etc/grub.d/30_os-prober This Fixes #2883
1 parent 05474c1 commit 6218bb8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

kiwi/bootloader/config/grub2.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,15 @@ def setup_disk_image_config(
300300
self.boot_directory_name, 'grub.cfg'
301301
]
302302
)
303+
# Disable os-prober, it takes information from the host it
304+
# runs on which is not necessarily matching with the image
305+
os.environ.update({'GRUB_DISABLE_OS_PROBER': 'true'})
303306
Command.run(
304307
[
305308
'chroot', self.root_mount.mountpoint,
306309
os.path.basename(self._get_grub2_mkconfig_tool()), '-o',
307310
config_file.replace(self.root_mount.mountpoint, '')
308-
]
311+
], os.environ
309312
)
310313
if boot_options.get('root_device') != boot_options.get('boot_device'):
311314
# Create a boot -> . link on the boot partition.

test/unit/bootloader/config/grub2_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,12 +1219,13 @@ def open_file(filename, mode=None):
12191219
mock_mount_system.assert_called_once_with(
12201220
'rootdev', 'bootdev', None, None, None
12211221
)
1222+
os.environ.update({'GRUB_DISABLE_OS_PROBER': 'true'})
12221223
assert mock_Command_run.call_args_list == [
12231224
call(
12241225
[
12251226
'chroot', self.bootloader.root_mount.mountpoint,
12261227
'grub2-mkconfig', '-o', '/boot/grub2/grub.cfg'
1227-
]
1228+
], os.environ
12281229
),
12291230
call(
12301231
[

0 commit comments

Comments
 (0)