Merge pull request #244544 from Artturin/systemddarwfix

This commit is contained in:
Artturi 2023-07-21 01:19:28 +03:00 committed by GitHub
commit 1afd51dece
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 7 deletions

View File

@ -122,7 +122,7 @@ let
# code, using default options and effectively ignore security relevant
# ZFS properties such as `setuid=off` and `exec=off` (unless manually
# duplicated in `fileSystems.*.options`, defeating "zfsutil"'s purpose).
copy_bin_and_libs ${pkgs.util-linux.mount}/bin/mount
copy_bin_and_libs ${lib.getOutput "mount" pkgs.util-linux}/bin/mount
copy_bin_and_libs ${pkgs.zfs}/bin/mount.zfs
''}

View File

@ -517,8 +517,8 @@ stdenv.mkDerivation (finalAttrs: {
"-Dsulogin-path=${util-linux.login}/bin/sulogin"
"-Dnologin-path=${util-linux.login}/bin/nologin"
"-Dmount-path=${util-linux.mount}/bin/mount"
"-Dumount-path=${util-linux.mount}/bin/umount"
"-Dmount-path=${lib.getOutput "mount" util-linux}/bin/mount"
"-Dumount-path=${lib.getOutput "mount" util-linux}/bin/umount"
"-Dcreate-log-dirs=false"
# Use cgroupsv2. This is already the upstream default, but better be explicit.
@ -569,8 +569,8 @@ stdenv.mkDerivation (finalAttrs: {
"man/systemd-makefs@.service.xml"
];
}
{ search = "/sbin/swapon"; replacement = "${util-linux.swap}/sbin/swapon"; where = [ "src/core/swap.c" "src/basic/unit-def.h" ]; }
{ search = "/sbin/swapoff"; replacement = "${util-linux.swap}/sbin/swapoff"; where = [ "src/core/swap.c" ]; }
{ search = "/sbin/swapon"; replacement = "${lib.getOutput "swap" util-linux}/sbin/swapon"; where = [ "src/core/swap.c" "src/basic/unit-def.h" ]; }
{ search = "/sbin/swapoff"; replacement = "${lib.getOutput "swap" util-linux}/sbin/swapoff"; where = [ "src/core/swap.c" ]; }
{
search = "/bin/echo";
replacement = "${coreutils}/bin/echo";

View File

@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
# the greater util-linux toolset.
# Compatibility is maintained by symlinking the binaries from the
# smaller outputs in the bin output.
outputs = [ "bin" "dev" "out" "lib" "man" "mount" "login" "swap" ];
outputs = [ "bin" "dev" "out" "lib" "man" ] ++ lib.optionals stdenv.isLinux [ "mount" ] ++ [ "login" ] ++ lib.optionals stdenv.isLinux [ "swap" ];
separateDebugInfo = true;
postPatch = ''
@ -110,20 +110,23 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
postInstall = ''
postInstall = lib.optionalString stdenv.isLinux ''
moveToOutput bin/mount "$mount"
moveToOutput bin/umount "$mount"
ln -svf "$mount/bin/"* $bin/bin/
'' + ''
moveToOutput sbin/nologin "$login"
moveToOutput sbin/sulogin "$login"
prefix=$login _moveSbin
ln -svf "$login/bin/"* $bin/bin/
'' + lib.optionalString stdenv.isLinux ''
moveToOutput sbin/swapon "$swap"
moveToOutput sbin/swapoff "$swap"
prefix=$swap _moveSbin
ln -svf "$swap/bin/"* $bin/bin/
'' + ''
installShellCompletion --bash bash-completion/*
'';