Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debian bootstrap and csm fixes #2667

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion kiwi/bootloader/config/grub2.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def post_init(self, custom_args):

{'grub_directory_name': 'grub|grub2'}
"""
self.efi_csm = True if self.xml_state.build_type.get_eficsm() is None \
else self.xml_state.build_type.get_eficsm()
self.custom_args = custom_args
self.config_options = []
arch = Defaults.get_platform_name()
Expand Down Expand Up @@ -612,7 +614,9 @@ def _copy_grub_config_to_efi_path(
)

def _supports_bios_modules(self):
if self.arch == 'ix86' or self.arch == 'x86_64' or Defaults.is_ppc64_arch(self.arch):
if self.efi_csm and (
self.arch == 'ix86' or self.arch == 'x86_64' or Defaults.is_ppc64_arch(self.arch)
):
return True
return False

Expand Down
6 changes: 4 additions & 2 deletions kiwi/package_manager/apt.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,17 +557,19 @@ def _run_bootstrap_scripts(
script_post = f'{package_metadata_dir}/postinst'
# 1. preinst
if os.path.exists(script_pre):
Command.run(['chmod', '755', script_pre])
Command.run(
[
'chroot', self.root_dir, 'bash',
'chroot', self.root_dir,
f'{script_pre.replace(self.root_dir, "")}', 'install'
], self.command_env
)
# 2. postinst
if os.path.exists(script_post):
Command.run(['chmod', '755', script_post])
Command.run(
[
'chroot', self.root_dir, 'bash',
'chroot', self.root_dir,
f'{script_post.replace(self.root_dir, "")}', 'configure'
], self.command_env
)
42 changes: 36 additions & 6 deletions test/unit/package_manager/apt_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,23 @@ def test_process_install_requests_bootstrap(
),
call(
[
'chroot', 'root-dir', 'bash',
'chmod', '755', 'tempdir/base-passwd/preinst'
]
),
call(
[
'chroot', 'root-dir',
'tempdir/base-passwd/preinst', 'install'
], new_env
),
call(
[
'chroot', 'root-dir', 'bash',
'chmod', '755', 'tempdir/base-passwd/postinst'
]
),
call(
[
'chroot', 'root-dir',
'tempdir/base-passwd/postinst', 'configure'
], new_env
),
Expand All @@ -197,13 +207,23 @@ def test_process_install_requests_bootstrap(
),
call(
[
'chroot', 'root-dir', 'bash',
'chmod', '755', 'tempdir/base-passwd/preinst'
]
),
call(
[
'chroot', 'root-dir',
'tempdir/base-passwd/preinst', 'install'
], new_env
),
call(
[
'chroot', 'root-dir', 'bash',
'chmod', '755', 'tempdir/base-passwd/postinst'
]
),
call(
[
'chroot', 'root-dir',
'tempdir/base-passwd/postinst', 'configure'
], new_env
),
Expand All @@ -212,13 +232,23 @@ def test_process_install_requests_bootstrap(
),
call(
[
'chroot', 'root-dir', 'bash',
'chmod', '755', 'tempdir/vim/preinst'
]
),
call(
[
'chroot', 'root-dir',
'tempdir/vim/preinst', 'install'
], new_env
),
call(
[
'chroot', 'root-dir', 'bash',
'chmod', '755', 'tempdir/vim/postinst'
]
),
call(
[
'chroot', 'root-dir',
'tempdir/vim/postinst', 'configure'
], new_env
)
Expand Down
Loading