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

Use 'source' instead of 'configfile' in generated grub.cfg #2337

Merged
merged 1 commit into from
Jul 28, 2023
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
4 changes: 2 additions & 2 deletions kiwi/bootloader/config/grub2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ def _create_early_boot_script_for_uuid_search(self, filename, uuid):
)
)
early_boot.write(
'configfile ($root){0}/{1}/grub.cfg{2}'.format(
'source ($root){0}/{1}/grub.cfg{2}'.format(
self.get_boot_path(), self.boot_directory_name, os.linesep
)
)
Expand All @@ -1098,7 +1098,7 @@ def _create_early_boot_script_for_mbrid_search(self, filename, mbrid):
)
)
early_boot.write(
'configfile ($root)/boot/{0}/grub.cfg{1}'.format(
'source ($root)/boot/{0}/grub.cfg{1}'.format(
self.boot_directory_name, os.linesep
)
)
Expand Down
16 changes: 8 additions & 8 deletions test/unit/bootloader/config/grub2_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@ def side_effect(arg):
call('set root="cryptouuid/0815"\n'),
call('search --fs-uuid --set=root 0815\n'),
call('set prefix=($root)//grub2\n'),
call('configfile ($root)//grub2/grub.cfg\n')
call('source ($root)//grub2/grub.cfg\n')
]
assert mock_command.call_args_list == [
call(
Expand Down Expand Up @@ -1327,7 +1327,7 @@ def side_effect(arg):
call('set root="cryptouuid/0815"\n'),
call('search --fs-uuid --set=root 0815\n'),
call('set prefix=($root)//grub2\n'),
call('configfile ($root)//grub2/grub.cfg\n')
call('source ($root)//grub2/grub.cfg\n')
]
mock_open.assert_called_once_with(
'root_dir/boot/efi/EFI/BOOT/grub.cfg', 'w'
Expand Down Expand Up @@ -1532,7 +1532,7 @@ def side_effect_glob(arg):
call('set root="cryptouuid/uuid"\n'),
call('search --fs-uuid --set=root uuid\n'),
call('set prefix=($root)/boot/grub2\n'),
call('configfile ($root)/boot/grub2/grub.cfg\n')
call('source ($root)/boot/grub2/grub.cfg\n')
]
mock_open.assert_called_once_with(
'root_dir/boot/efi/EFI/BOOT/grub.cfg', 'w'
Expand Down Expand Up @@ -1628,7 +1628,7 @@ def side_effect_glob(arg):
call('set root="cryptouuid/uuid"\n'),
call('search --fs-uuid --set=root uuid\n'),
call('set prefix=($root)/boot/grub2\n'),
call('configfile ($root)/boot/grub2/grub.cfg\n')
call('source ($root)/boot/grub2/grub.cfg\n')
]
mock_open.assert_called_once_with(
'root_dir/boot/efi/EFI/BOOT/grub.cfg', 'w'
Expand Down Expand Up @@ -1730,11 +1730,11 @@ def side_effect(arg):
call('set btrfs_relative_path="yes"\n'),
call('search --file --set=root /boot/mbrid\n'),
call('set prefix=($root)/boot/grub2\n'),
call('configfile ($root)/boot/grub2/grub.cfg\n'),
call('source ($root)/boot/grub2/grub.cfg\n'),
call('set btrfs_relative_path="yes"\n'),
call('search --file --set=root /boot/mbrid\n'),
call('set prefix=($root)/boot/grub2\n'),
call('configfile ($root)/boot/grub2/grub.cfg\n'),
call('source ($root)/boot/grub2/grub.cfg\n'),
call('source /boot/grub2/grub.cfg\n')
]
assert mock_Path_create.call_args_list == [
Expand Down Expand Up @@ -1843,7 +1843,7 @@ def side_effect(arg):
call('set btrfs_relative_path="yes"\n'),
call('search --file --set=root /boot/mbrid\n'),
call('set prefix=($root)/boot/grub2\n'),
call('configfile ($root)/boot/grub2/grub.cfg\n'),
call('source ($root)/boot/grub2/grub.cfg\n'),
call('source /boot/grub2/grub.cfg\n')
]
assert mock_open.call_args_list == [
Expand Down Expand Up @@ -1911,7 +1911,7 @@ def side_effect_glob(arg):
call('set btrfs_relative_path="yes"\n'),
call('search --file --set=root /boot/mbrid\n'),
call('set prefix=($root)/boot/grub2\n'),
call('configfile ($root)/boot/grub2/grub.cfg\n'),
call('source ($root)/boot/grub2/grub.cfg\n'),
call('source /boot/grub2/grub.cfg\n')
]
assert mock_open.call_args_list == [
Expand Down
Loading