From cd3088455d518b4416cfaec569b9614d92f97023 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Sun, 23 Aug 2015 13:32:05 +0300 Subject: nixos/stage-2: Build readonly-mountpoint with normal mkDerivation phases This way the binary gets stripped & rpath-shrinked etc. as usual. We'd seem to get a runtime reference to gcc otherwise. TODO: Maybe we should be able to set e.g. 'dontUnpack = true;' to make this more pretty. --- nixos/modules/system/boot/stage-2.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/system/boot/stage-2.nix b/nixos/modules/system/boot/stage-2.nix index c0ef4e02d1ff..b67f42a017e6 100644 --- a/nixos/modules/system/boot/stage-2.nix +++ b/nixos/modules/system/boot/stage-2.nix @@ -7,11 +7,14 @@ let kernel = config.boot.kernelPackages.kernel; activateConfiguration = config.system.activationScripts.script; - readonlyMountpoint = pkgs.runCommand "readonly-mountpoint" {} '' - mkdir -p $out/bin - cc -O3 ${./readonly-mountpoint.c} -o $out/bin/readonly-mountpoint - strip -s $out/bin/readonly-mountpoint - ''; + readonlyMountpoint = pkgs.stdenv.mkDerivation { + name = "readonly-mountpoint"; + unpackPhase = "true"; + installPhase = '' + mkdir -p $out/bin + cc -O3 ${./readonly-mountpoint.c} -o $out/bin/readonly-mountpoint + ''; + }; bootStage2 = pkgs.substituteAll { src = ./stage-2-init.sh; -- cgit 1.4.1