From 295c645d807e4754b7d1f89ffdb65263cae9f042 Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Mon, 27 May 2024 12:24:30 -0700 Subject: [PATCH] freebsd.boot-install: wrap coreutils install instead of netbsd netbsd can no longer compile under FreeBSD native early bootstrap stdenv, so switch to coreutils. This only involves discarding the -l flag. The -l flag causes a symlink instead of a copy to be installed, so it is safe to discard during bootstrap. --- .../bsd/freebsd/pkgs/boot-install.nix | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/boot-install.nix b/pkgs/os-specific/bsd/freebsd/pkgs/boot-install.nix index 966489d9aef3..79dab282e3f3 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/boot-install.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/boot-install.nix @@ -1,10 +1,23 @@ { buildPackages, freebsd-lib }: -# Wrap NetBSD's install +# Wrap GNU coreutils' install +# The -l flag causes a symlink instead of a copy to be installed, so +# it is safe to discard during bootstrap since coreutils does not support it. + buildPackages.writeShellScriptBin "boot-install" ( freebsd-lib.install-wrapper + '' + fixed_args=() + while [[ ''${#args[0]} > 0 ]]; do + case "''${args[0]}" in + -l) + args=("''${args[@]:2}") + continue + esac + fixed_args+=("''${args[0]}") + args=("''${args[@]:1}") + done - ${buildPackages.netbsd.install}/bin/xinstall "''${args[@]}" + ${buildPackages.coreutils}/bin/install "''${fixed_args[@]}" '' )