src/main: init
This commit adds several useful scripts (alongside the coreboot image) in a `main` expression, which should be the primary build expression going forward. The following scripts should exists on all platforms: - flashrom wrappers: - `flashrom.sh` - `flash-write-all.sh` - `flash-write-fallback.sh` - `flash-write-normal.sh` - scripts to select which image (normal or fallback) is used for the next boot: - `nextboot-show.sh` - `nextboot-use-fallback.sh` - `nextboot-use-normal.sh` - a script to write an image to the em100 flash-chip-emulator device: - `em100-write.sh`master
parent
52e330e4aa
commit
b48635fa1d
@ -0,0 +1,34 @@
|
||||
# This is the "top level" derivation for an ownerboot build
|
||||
{ nixpkgsOnBuildForHost
|
||||
, nixpkgsOnBuildForBuild
|
||||
, lib
|
||||
, coreboot
|
||||
, scripts
|
||||
}:
|
||||
|
||||
let
|
||||
writeShellScript = name: text:
|
||||
(nixpkgsOnBuildForHost.writeShellScript name text)
|
||||
.overrideAttrs(previousAttrs: {
|
||||
preferLocalBuild = true;
|
||||
});
|
||||
|
||||
in nixpkgsOnBuildForHost.stdenv.mkDerivation (finalAttrs: {
|
||||
name = "ownerboot";
|
||||
dontUnpack = true;
|
||||
dontBuild = true;
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/{etc,bin}
|
||||
ln -s ${coreboot}/coreboot.rom $out/
|
||||
ln -s ${coreboot}/config $out/etc/coreboot.config
|
||||
ln -s ${coreboot.passthru.fmap} $out/etc/coreboot.fmap
|
||||
|
||||
'' + (lib.concatStringsSep "\n" (lib.mapAttrsToList (scriptName: scriptText: ''
|
||||
ln -s ${writeShellScript scriptName scriptText} $out/bin/${scriptName}.sh
|
||||
|
||||
'') scripts)) + ''
|
||||
runHook postInstall
|
||||
'';
|
||||
})
|
Loading…
Reference in New Issue