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.
This commit is contained in:
Tuomas Tynkkynen 2015-08-23 13:32:05 +03:00 committed by Vladimír Čunát
parent 54dcadad6c
commit cd3088455d

View File

@ -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;