Compare commits

...

2 Commits
main ... el8

Author SHA1 Message Date
Marcus Schäfer
0b1e806cf2 Fixed missing selinux context setup for live ISOs
When building live ISO images the selinux context was not created
for eventually new created files during the live ISO creation
process. This Fixes OSInside/kiwi-boxed-plugin#99
2026-03-12 22:33:57 +01:00
Marcus Schäfer
28d9f45ca6 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
2026-03-12 22:33:50 +01:00
4 changed files with 15 additions and 2 deletions

View File

@ -281,12 +281,15 @@ class BootLoaderConfigGrub2(BootLoaderConfigBase):
self.boot_directory_name, 'grub.cfg'
]
)
# Disable os-prober, it takes information from the host it
# runs on which is not necessarily matching with the image
os.environ.update({'GRUB_DISABLE_OS_PROBER': 'true'})
Command.run(
[
'chroot', self.root_mount.mountpoint,
os.path.basename(self._get_grub2_mkconfig_tool()), '-o',
config_file.replace(self.root_mount.mountpoint, '')
]
], os.environ
)
if boot_options.get('root_device') != boot_options.get('boot_device'):
# Create a boot -> . link on the boot partition.

View File

@ -189,6 +189,8 @@ class LiveImageBuilder:
working_directory=self.root_dir
)
self.system_setup.setup_selinux_file_contexts()
# prepare dracut initrd call
self.boot_image.prepare()
@ -251,6 +253,9 @@ class LiveImageBuilder:
'mount_options': self.xml_state.get_fs_mount_option_list(),
'create_options': self.xml_state.get_fs_create_option_list()
}
self.system_setup.setup_selinux_file_contexts()
filesystem_setup = FileSystemSetup(
self.xml_state, self.root_dir
)

View File

@ -981,12 +981,13 @@ class TestBootLoaderConfigGrub2:
mock_mount_system.assert_called_once_with(
'rootdev', 'bootdev', None, None, None
)
os.environ.update({'GRUB_DISABLE_OS_PROBER': 'true'})
assert mock_Command_run.call_args_list == [
call(
[
'chroot', self.bootloader.root_mount.mountpoint,
'grub2-mkconfig', '-o', '/boot/grub2/grub.cfg'
]
], os.environ
),
call(
[

View File

@ -227,6 +227,10 @@ class TestLiveImageBuilder:
self.setup.import_cdroot_files.assert_called_once_with('temp_media_dir')
assert self.setup.setup_selinux_file_contexts.call_args_list == [
call(), call()
]
assert kiwi.builder.live.FileSystem.new.call_args_list == [
call(
device_provider=self.loop, name='ext4',