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

woeusb: add p7zip to runtime deps enable extra feature #47982

Merged
merged 2 commits into from Nov 25, 2018

Conversation

gleber
Copy link
Contributor

@gleber gleber commented Oct 6, 2018

WoeUSB depends on presence of '7z` binary in the path to execute an extra step.
As Windows 7's installation media doesn't place the required EFI bootloaders
in the right location, WoeUSB extracts them from the system image manually
using '7z' binary which it checks with 'command -v 7z'.

See related code at:
https://github.com/slacka/WoeUSB/blob/aea4f91783d60fe092605cf26b996d1ba593f976/src/woeusb#L1530

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

WoeUSB depends on presence of '7z` binary in the path to execute an extra step. 
As Windows 7's installation media doesn't place the required EFI bootloaders
in the right location, WoeUSB extracts them from the system image manually
using '7z' binary which it checks with 'command -v 7z'.

See related code at:
https://github.com/slacka/WoeUSB/blob/aea4f91783d60fe092605cf26b996d1ba593f976/src/woeusb#L1530
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
# should be patched with a less useless default PATH, but for now
# we add everything we need manually.
wrapProgram "$out/bin/woeusb" \
--set PATH '${stdenv.lib.makeBinPath [ coreutils dosfstools findutils gawk gnugrep grub2_light ncurses ntfs3g parted utillinux wget ]}'
--set PATH '${stdenv.lib.makeBinPath [ coreutils dosfstools findutils gawk gnugrep grub2_light ncurses ntfs3g parted utillinux wget p7zip ]}'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer it if you make it clear in the expression that p7zip is an optional dependency. I don't mind it being enabled by default.

That would mean an withWin7EfiSupport ? true or something like that argument and using ++ lib.optionals withWin7EfiSupport [ p7zip ] together with a comment explaining what you did in the PR message (what 7z is needed for) here.

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

Successfully merging this pull request may close these issues.

None yet

4 participants