Skip to content

Commit

Permalink
Ensure use of GRUB platform i386-pc
Browse files Browse the repository at this point in the history
Without i386-pc available, the resulting rescue image
could cause error "Could not read from CDROM (code 0004)"
during boot in QEMU.  Related to issue #14.
  • Loading branch information
hartwork committed Dec 29, 2017
1 parent 5e89537 commit 24368c8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions grub2_theme_preview/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

_PATH_IMAGE_ONLY = 'themes/DEMO.png'
_PATH_FULL_THEME = 'themes/DEMO'
_GRUB2_PLATFORM = 'i386-pc'

_KILL_BY_SIGNAL = 128

Expand Down Expand Up @@ -229,6 +230,10 @@ def _ignore_oserror(func, *args, **kwargs):
pass


def _grub2_directory(platform):
return '/usr/lib/grub/%s' % platform


def _inner_main(options):
for command, package in (
(options.grub2_mkrescue, 'Grub 2.x'),
Expand Down Expand Up @@ -268,6 +273,7 @@ def _inner_main(options):
abs_tmp_img_file = os.path.join(abs_tmp_folder, 'grub2_theme_demo.img')
assemble_cmd = [
options.grub2_mkrescue,
'--directory=%s' % _grub2_directory(_GRUB2_PLATFORM),
'--xorriso', options.xorriso,
'--output', abs_tmp_img_file,
]
Expand Down

0 comments on commit 24368c8

Please sign in to comment.