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

[Errno 2] No such file or directory: 'grub-install': 'grub-install' #15

Closed
Xphobia opened this issue Jan 19, 2021 · 5 comments
Closed

Comments

@Xphobia
Copy link

Xphobia commented Jan 19, 2021

Issue Reproduce Instructions

  1. Launch WoeUSB by running command
woeusb --verbose  --tgt-fs NTFS --device en_windows_server_2012_vl_x64_dvd_917758.iso /dev/sdb
  1. Output with errors
    woeusb-debug2

Expected Behavior

No error

Current Behavior

WoeUSB errors with message "[Errno 2] No such file or directory: 'grub-install': 'grub-install'"

Info of My Environment

WoeUSB Version

v0.2.6

WoeUSB Source

Built from source code, v0.2.6

Information about the Operating System

Tested in Vmware guest, CentOS Linux release 7.6.1810 (Core)

Information about the Source Media

en_windows_server_2012_vl_x64_dvd_917758.iso

Information about the Target Device

A Vmware scsi disk

Debugging

In the test environment(Centos7.6), there is no command named 'grub-install', 'grub2-install' exists.
I go through the source code and find where it happens. It happened in function 'check_runtime_dependencies' in file WoeUSB/utils.py, where called shutil.which() to judge which command to use.
woeusb-bug

It's the if clause matter. when a command, say, 'grub-install' does not exists, shutil.which() returns None instead of ''.
I tested shutil.which() in python3 interpreter.
woeusb-debug

It's a convention to write such kind of if clause as follows

·```
grub = ["grub-install", "grub2-install"]
for command in grub:
    if shutil.which(command):
        grub = command
        break
```

or

·```
grub = ["grub-install", "grub2-install"]
for command in grub:
    if shutil.which(command) is not None:
        grub = command
        break
```
@WaxyMocha
Copy link
Member

Hi, sorry for that delay in response, also thank you for providing solution! I will test it and push the fix.

WaxyMocha added a commit that referenced this issue Feb 6, 2021
Changes:
 - Add Brazilian Portuguese translation (1d8f08e),
 - Fix #15, WoeUSB-ng wasn't correctly checking available commands,
 - Fix #14, except clause wasn't catching network error
@RUvlad1
Copy link

RUvlad1 commented Feb 27, 2021

I'm having the same problem, I'm on Pop!_OS using the GUI option
image

@Xphobia
Copy link
Author

Xphobia commented Feb 27, 2021

I'm having the same problem, I'm on Pop!_OS using the GUI option
It's fixed in the latest version. what's your version ?

@WaxyMocha
Copy link
Member

I don't think that this is an issue here, from quick googling it turns out that pop doesn't use grub so it makes sense that it will be missing. @RUvlad1 Can you try to install grub package and try again? If it would work, can you post what package it was?

@therealaleph
Copy link

I'm having the same problem, I'm on Pop!_OS using the GUI option
image

sudo apt-get install grub2-common

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

4 participants