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

refind: fix runtime errors #39944

Merged
merged 1 commit into from May 6, 2018
Merged

refind: fix runtime errors #39944

merged 1 commit into from May 6, 2018

Conversation

erikarvstedt
Copy link
Member

@erikarvstedt erikarvstedt commented May 3, 2018

In newer versions, instead of using $PWD to locate its ressource files,
Refind now refers to the dir containing $0.
This causes runtime errors due to missing ressources.

In lieu of a wrapper binary, we now simply patch the variable RefindDir
which stores the path to the ressource dir.

Here's a short script (run as root) to help testing this PR.
To see the runtime error that was fixed, replace the call to refind-install with the current Nixpkgs version of refind.

## Summary: Create temp device, install refind, delete device

# Create temporary loop device
truncate -s 10M /tmp/buf
tmpdev=$(losetup --find --show /tmp/buf)
mkfs.fat $tmpdev

# Run refind 
$(nix-build --no-out-link '<nixpkgs-dev>' -A refind)/bin/refind-install --usedefault $tmpdev --alldrivers
# Show contents of installation
$(nix-build --no-out-link '<nixpkgs>' -A tree)/bin/tree /tmp/refind_install

# Remove device
umount $tmpdev
losetup --detach $tmpdev
rm /tmp/buf
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-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/)
  • Fits CONTRIBUTING.md.

In newer versions, instead of using $PWD to locate its ressource files,
Refind now refers to the dir containing $0.
This causes runtime errors due to missing ressources.

In lieu a wrapper binary, we now simply patch the variable 'RefindDir'
which stores the path to the ressource dir.
@erikarvstedt erikarvstedt changed the title refind: fix runtime error refind: fix runtime errors May 3, 2018
@xeji
Copy link
Contributor

xeji commented May 3, 2018

cc @AndersonTorres

@AndersonTorres
Copy link
Member

It was "readmitted" into Nixpkgs?

@xeji
Copy link
Contributor

xeji commented May 5, 2018

It was last updated and marked no longer broken in 2d66f39.

@joachifm joachifm merged commit 1ff22c7 into NixOS:master May 6, 2018
@AndersonTorres
Copy link
Member

So, it has my bless! Thanks, @xeji and @joachifm !

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

5 participants