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:
parent
54dcadad6c
commit
cd3088455d
@ -7,11 +7,14 @@ let
|
|||||||
kernel = config.boot.kernelPackages.kernel;
|
kernel = config.boot.kernelPackages.kernel;
|
||||||
activateConfiguration = config.system.activationScripts.script;
|
activateConfiguration = config.system.activationScripts.script;
|
||||||
|
|
||||||
readonlyMountpoint = pkgs.runCommand "readonly-mountpoint" {} ''
|
readonlyMountpoint = pkgs.stdenv.mkDerivation {
|
||||||
|
name = "readonly-mountpoint";
|
||||||
|
unpackPhase = "true";
|
||||||
|
installPhase = ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
cc -O3 ${./readonly-mountpoint.c} -o $out/bin/readonly-mountpoint
|
cc -O3 ${./readonly-mountpoint.c} -o $out/bin/readonly-mountpoint
|
||||||
strip -s $out/bin/readonly-mountpoint
|
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
bootStage2 = pkgs.substituteAll {
|
bootStage2 = pkgs.substituteAll {
|
||||||
src = ./stage-2-init.sh;
|
src = ./stage-2-init.sh;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user