2
0
Fork 0

nova-image: write image to stdout

This commit is contained in:
Ehmry - 2020-01-28 00:38:09 +01:00
parent 467ecf7cdb
commit e88537c411
4 changed files with 6 additions and 14 deletions

View File

@ -30,8 +30,8 @@ rec {
type = "app";
program = "${drv}/bin/nova-image";
function = attrs: bootDesc:
nixpkgs.runCommand "nova-iso" (attrs // { inherit bootDesc; })
"XDG_CACHE_HOME=$TMPDIR ${drv}/bin/nova-image $bootDesc > $out";
nixpkgs.runCommand "nova-iso" attrs
''XDG_CACHE_HOME=$TMPDIR ${drv}/bin/nova-image "${bootDesc}" > $out'';
};
nova-iso = let

View File

@ -10,14 +10,6 @@ in nixpkgs.writeScriptBin "nova-image" (with nixpkgs.buildPackages;
#!${runtimeShell}
set -eu
out="$1"
shift
if [ -e "$out" ]; then
echo "refusing to overwrite $out as output" > /dev/stderr
exit 1
fi
CC="${cc}/bin/${cc.targetPrefix}cc"
LD="${buildPackages.binutils}/bin/${buildPackages.binutils.targetPrefix}ld"
@ -39,6 +31,6 @@ in nixpkgs.writeScriptBin "nova-image" (with nixpkgs.buildPackages;
-T${base-nova.src}/repos/base-nova/src/core/core-bss.ld \
-z max-page-size=0x1000 \
-Ttext=0x100000 -gc-sections \
"''${CORE_NOVA:-${base-nova}/lib/core-nova.o}" "$TMPDIR/boot_modules.o" \
-o "$out"
"''${CORE_NOVA:-${base-nova}/lib/core-nova.o}" "$TMPDIR/boot_modules.o"
cat a.out
'')

View File

@ -15,7 +15,7 @@ nixpkgs.writeScriptBin "nova-iso" (with nixpkgs.buildPackages;
trap "rm -rf $TMPDIR" err exit
mkdir -p "$TMPDIR/boot/syslinux"
${nova-image.program} "$TMPDIR/boot/image.elf" $@
${nova-image.program} $@ > "$TMPDIR/boot/image.elf"
pushd "$TMPDIR" > /dev/null
out="nova.iso"

View File

@ -145,7 +145,7 @@ let
sotest = hostPkgs.runCommand "nova-${name}-sotest" env' ''
export XDG_CACHE_HOME=''${TMPDIR:-/tmp}
${apps.nova-image.program} \
image.elf "${./driver-nova-config.dhall} ${testConfig}"
"${./driver-nova-config.dhall} ${testConfig}" > image.elf
cp "${testPkgs.bender}" bender
cp "${testPkgs.NOVA}/hypervisor-x86_64" hypervisor
mkdir -p $out/nix-support