Skip to content

Commit

Permalink
Use 'source' instead of 'configfile' in generated grub.cfg
Browse files Browse the repository at this point in the history
Details are outlined in issue #2320
  • Loading branch information
slowpeek committed Jul 27, 2023
1 parent 7528c35 commit 97ac758
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
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

0 comments on commit 97ac758

Please sign in to comment.