Browse Source

Replace apps.linux-boot with apps.linux-image

Replace a script that builds a Linux boot image into the current workings
directory and boots it with a script that only builds the image.
20.02
Emery Hemingway 2 years ago
parent
commit
9fc90076d6
  1. 6
      apps/default.nix
  2. 7
      apps/linux-image/default.nix
  3. 1
      apps/linux-image/script.dhall
  4. 14
      tests/driver-linux.nix

6
apps/default.nix

@ -4,11 +4,11 @@
rec {
linux-boot =
let drv = import ./linux-boot { inherit nixpkgs dhallApps packages; };
linux-image =
let drv = import ./linux-image { inherit nixpkgs dhallApps packages; };
in {
type = "app";
program = "${drv}/bin/linux-boot";
program = "${drv}/bin/linux-image";
};
nova-image = let

7
apps/linux-boot/default.nix → apps/linux-image/default.nix

@ -2,17 +2,14 @@
{ nixpkgs, dhallApps, packages }:
nixpkgs.writeScriptBin "linux-boot" (with nixpkgs.buildPackages; ''
nixpkgs.writeScriptBin "linux-image" (with nixpkgs.buildPackages; ''
#!${runtimeShell}
set -eu
if [ -z "$@" ]; then
echo "Error: a boot description must be passed as an argument - $0" > /dev/stderr
exit 1
fi
export DHALL_PRELUDE=''${DHALL_PRELUDE:-${packages.dhallPrelude}/package.dhall}
export DHALL_GENODE=''${DHALL_GENODE:-${packages.dhallGenode}/package.dhall}
export BASE_LINUX_MANIFEST=''${BASE_LINUX_MANIFEST:-${packages.genode.base-linux.manifest}}
export OS_MANIFEST=''${OS_MANIFEST:-${packages.genode.os.manifest}}
${dhallApps.dhall.program} text <<< "${./script.dhall} ($@)" > boot.sh
source boot.sh
rm boot.sh
'')

1
apps/linux-boot/script.dhall → apps/linux-image/script.dhall

@ -26,5 +26,4 @@ in λ(args : Args)
#!/bin/sh
${links}
echo ${Text/show (Genode.Init.render args.config)} > config
exec ./core-linux
''

14
tests/driver-linux.nix

@ -40,6 +40,7 @@ let
env' = {
DHALL_PRELUDE = "${testPkgs.dhallPrelude}/package.dhall";
DHALL_GENODE = "${testPkgs.dhallGenode}/package.dhall";
BASE_MANIFEST = testPkgs.genode.base.manifest;
BASE_LINUX_MANIFEST = testPkgs.genode.base-linux.manifest;
OS_MANIFEST = testPkgs.genode.os.manifest;
} // env;
@ -66,8 +67,14 @@ let
global image_dir spawn_id
spawn ${apps.linux-boot.program} \
global env
set env(XDG_CACHE_HOME) /tmp
puts "${apps.linux-image.program} ${./driver-linux-config.dhall} ${testConfig}"
exec ${apps.linux-image.program} \
${./driver-linux-config.dhall} ${testConfig}
spawn ./core-linux
wait_for_output $wait_for_re $timeout_value $spawn_id
}
'';
@ -102,6 +109,11 @@ let
./driver-linux-config.dhall
} ${testConfig}).config" > $out
'';
image = hostPkgs.runCommand (name + ".config") env' ''
mkdir -p $out
pushd $out
${apps.linux-image.program} "${./driver-linux-config.dhall} ${testConfig}"
'';
};
in {

Loading…
Cancel
Save