summaryrefslogtreecommitdiffstats
path: root/pkgs/tools/bootloaders
diff options
context:
space:
mode:
authorErik Arvstedt <erik.arvstedt@gmail.com>2018-05-03 21:54:09 +0200
committerErik Arvstedt <erik.arvstedt@gmail.com>2018-05-03 22:13:39 +0200
commitadce6bf638bc6032f17e002334e444a3c8656ad2 (patch)
tree034d01402e82936b5d4fbd900bcee6e680d11706 /pkgs/tools/bootloaders
parentb45ef79b74d267891a11c1775a473c610ecebe78 (diff)
refind: fix runtime errors
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.
Diffstat (limited to 'pkgs/tools/bootloaders')
-rw-r--r--pkgs/tools/bootloaders/refind/default.nix16
1 files changed, 4 insertions, 12 deletions
diff --git a/pkgs/tools/bootloaders/refind/default.nix b/pkgs/tools/bootloaders/refind/default.nix
index f305cff0ea25..80add316094c 100644
--- a/pkgs/tools/bootloaders/refind/default.nix
+++ b/pkgs/tools/bootloaders/refind/default.nix
@@ -57,7 +57,7 @@ stdenv.mkDerivation rec {
install -D -m0644 gptsync/gptsync_${efiPlatform}.efi $out/share/refind/tools_${efiPlatform}/gptsync_${efiPlatform}.efi
# helper scripts
- install -D -m0755 refind-install $out/share/refind/refind-install
+ install -D -m0755 refind-install $out/bin/refind-install
install -D -m0755 mkrlconf $out/bin/refind-mkrlconf
install -D -m0755 mvrefind $out/bin/refind-mvrefind
install -D -m0755 fonts/mkfont.sh $out/bin/refind-mkfont
@@ -86,21 +86,13 @@ stdenv.mkDerivation rec {
# keys
install -D -m0644 keys/* $out/share/refind/keys/
- # The refind-install script assumes that all resource files are
- # installed under the same directory as the script itself. To avoid
- # having to patch around this assumption, generate a wrapper that
- # cds into $out/share/refind and executes the real script from
- # there.
- cat >$out/bin/refind-install <<EOF
-#! ${stdenv.shell}
-cd $out/share/refind && exec -a $out/bin/refind-install ./refind-install \$*
-EOF
- chmod +x $out/bin/refind-install
+ # Fix variable definition of 'RefindDir' which is used to locate ressource files.
+ sed -i "s,\bRefindDir=.*,RefindDir=$out/share/refind,g" $out/bin/refind-install
# Patch uses of `which`. We could patch in calls to efibootmgr,
# openssl, convert, and openssl, but that would greatly enlarge
# refind's closure (from ca 28MB to over 400MB).
- sed -i 's,`which \(.*\)`,`type -p \1`,g' $out/share/refind/refind-install
+ sed -i 's,`which \(.*\)`,`type -p \1`,g' $out/bin/refind-install
sed -i 's,`which \(.*\)`,`type -p \1`,g' $out/bin/refind-mvrefind
sed -i 's,`which \(.*\)`,`type -p \1`,g' $out/bin/refind-mkfont
'';