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

Cannot get any preview without error #8

Closed
tokiclover opened this issue Jun 29, 2015 · 8 comments
Closed

Cannot get any preview without error #8

tokiclover opened this issue Jun 29, 2015 · 8 comments

Comments

@tokiclover
Copy link

Hello, I've made this SLiM theme and intend to make a GRUB2 theme of it... So, I've tried to preview GRUB2 default theme before starting, and I am getting this error:

$ grub2-theme-preview --grub-cfg ./grub.cfg ./starfield
INFO: Appending to fonts to load: dejavu_10.pf2
INFO: Appending to fonts to load: dejavu_12.pf2
INFO: Appending to fonts to load: dejavu_14.pf2
INFO: Appending to fonts to load: dejavu_16.pf2
INFO: Appending to fonts to load: dejavu_bold_14.pf2
Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/grub2-theme-preview", line 6, in <module>
    main()
  File "/usr/lib64/python2.7/site-packages/grub2_theme_preview/cli.py", line 245, in main
    _run(run_command, options.verbose)
  File "/usr/lib64/python2.7/site-packages/grub2_theme_preview/cli.py", line 40, in _run
    subprocess.call(cmd, stdout=stdout, stderr=stdout)
  File "/usr/lib64/python2.7/subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib64/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

I have previously copied the files in order to get write permission. I cannot understand what's wrong with that output.

@hartwork
Copy link
Owner

Hello @tokiclover, thanks for the report! I will have time for a closer look tonight.

@hartwork
Copy link
Owner

I had a chance to have a closer look and improve a few things now.
It seems to me that the cause is that your system does not have command qemu-system-x86_64 in $PATH or not at all. And the code lacked proper handling/reporting of that case.

The code I just commited should do better reporting. You could use --qemu COMMAND for different command names with both old and new code. I could add QEMU command name detection to increase comfort.

Do you have a chance to test the new code? I can make a new release quickly.

@hartwork
Copy link
Owner

PS:
Are you on a amd64/x86_86 machine or something else?
If something else, does which qemu-system-$(uname -m) point to the QEMU binary that you would expect to be run?

@tokiclover
Copy link
Author

Thanks for quick help! I can adapt quicly one of the official ebuild to make a live version,--actually done,--to test the new code. However...

Spot on in the missing qemu command! (I did not use qemu for ages and x86_64 target is missing. It is fixed by rebuilding the package with the right target.)

Here is what I have now:

$ grub2-theme-preview --verbose --grub-cfg ./grub.cfg ./starfield
INFO: Appending to fonts to load: dejavu_10.pf2
INFO: Appending to fonts to load: dejavu_12.pf2
INFO: Appending to fonts to load: dejavu_14.pf2
INFO: Appending to fonts to load: dejavu_16.pf2
INFO: Appending to fonts to load: dejavu_bold_14.pf2
# grub2-mkrescue --output /tmp/.private/tokiclover/tmpy3GTxF/grub2_theme_demo.img boot/grub/grub.cfg=/tmp/.private/tokiclover/tmpy3GTxF/grub.cfg boot/grub/themes/DEMO/=/mnt/tank/dev/starfield
xorriso 1.4.0 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:/tmp/.private/tokiclover/tmpy3GTxF/grub2_theme_demo.img'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data,  358m free
Added to ISO image: directory '/'='/tmp/.private/tokiclover/grub.iDApss'
xorriso : UPDATE : 1080 files added in 1 seconds
Added to ISO image: file '/boot/grub/grub.cfg'='/tmp/.private/tokiclover/tmpy3GTxF/grub.cfg'
Added to ISO image: directory '/boot/grub/themes/DEMO'='/mnt/tank/dev/starfield'
xorriso : FAILURE : Cannot find path '/efi.img' in loaded ISO image
xorriso : UPDATE : 1112 files added in 1 seconds
xorriso : aborting : -abort_on 'FAILURE' encountered 'FAILURE'
# qemu-system-x86_64 -drive file=/tmp/.private/tokiclover/tmpy3GTxF/grub2_theme_demo.img,index=0,media=disk,format=raw
qemu-system-x86_64: -drive file=/tmp/.private/tokiclover/tmpy3GTxF/grub2_theme_demo.img,index=0,media=disk,format=raw: Could not open '/tmp/.private/tokiclover/tmpy3GTxF/grub2_theme_demo.img': No such file or directory

Missing /efi.img which looks odd... shouldn't it in the current directory instead? If the script try to write to /, nothing would happen. Note that, there numerous temporary files in TMPDIR. So, no idead where that odd one comes from.

And the theme preview is not built... because of that missing EFI image?

@tokiclover
Copy link
Author

Actually I have an old clone of the tree, so synced to current master and tested it: I've got the same error as above.

@hartwork
Copy link
Owner

Hi!

I found a related bug report in Arch Linux that hints about lack of mtools as a runtime dependency. Indeed, installing mtools seems to fix the problem: strace confirmed this to be the cause:

# strace -F -eprocess grub2-mkrescue -o foo.img |& grep -E -o '[^" ]+bin[^" ]+' | sort -u | fgrep -v /local/
/usr/bin/grub-mkrescue
/usr/bin/mcopy
/usr/bin/mformat
/usr/bin/xorriso

I have committed code to better handle the case of mtools missing.
Please give the latest code from Git a try. Let's see if that makes the preview work for you, too.

In the mean time, I have added mtools for a dependency to the existing ebuilds already:

+  30 Jun 2015; Sebastian Pipping <....>
+  grub2-theme-preview-1.1.ebuild, grub2-theme-preview-1.2.ebuild,
+  grub2-theme-preview-1.2.1.ebuild:
+  Add mtools to runtime dependencies (see
+  https://github.com/hartwork/grub2-theme-preview/issues/8)
+

Best, S

@tokiclover
Copy link
Author

Yes, issue fixed... thanks!
Time to switch to theming instead of debugging.

@hartwork
Copy link
Owner

Yes :) Thanks again for the report and for testing.

+*grub2-theme-preview-1.3.0 (30 Jun 2015)
+
+  30 Jun 2015; Sebastian Pipping <...>
+  +grub2-theme-preview-1.3.0.ebuild:
+  Bump to 1.3.0

Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants