nova-image: write image to stdout
This commit is contained in:
parent
467ecf7cdb
commit
e88537c411
|
@ -30,8 +30,8 @@ rec {
|
||||||
type = "app";
|
type = "app";
|
||||||
program = "${drv}/bin/nova-image";
|
program = "${drv}/bin/nova-image";
|
||||||
function = attrs: bootDesc:
|
function = attrs: bootDesc:
|
||||||
nixpkgs.runCommand "nova-iso" (attrs // { inherit bootDesc; })
|
nixpkgs.runCommand "nova-iso" attrs
|
||||||
"XDG_CACHE_HOME=$TMPDIR ${drv}/bin/nova-image $bootDesc > $out";
|
''XDG_CACHE_HOME=$TMPDIR ${drv}/bin/nova-image "${bootDesc}" > $out'';
|
||||||
};
|
};
|
||||||
|
|
||||||
nova-iso = let
|
nova-iso = let
|
||||||
|
|
|
@ -10,14 +10,6 @@ in nixpkgs.writeScriptBin "nova-image" (with nixpkgs.buildPackages;
|
||||||
#!${runtimeShell}
|
#!${runtimeShell}
|
||||||
set -eu
|
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"
|
CC="${cc}/bin/${cc.targetPrefix}cc"
|
||||||
LD="${buildPackages.binutils}/bin/${buildPackages.binutils.targetPrefix}ld"
|
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 \
|
-T${base-nova.src}/repos/base-nova/src/core/core-bss.ld \
|
||||||
-z max-page-size=0x1000 \
|
-z max-page-size=0x1000 \
|
||||||
-Ttext=0x100000 -gc-sections \
|
-Ttext=0x100000 -gc-sections \
|
||||||
"''${CORE_NOVA:-${base-nova}/lib/core-nova.o}" "$TMPDIR/boot_modules.o" \
|
"''${CORE_NOVA:-${base-nova}/lib/core-nova.o}" "$TMPDIR/boot_modules.o"
|
||||||
-o "$out"
|
cat a.out
|
||||||
'')
|
'')
|
||||||
|
|
|
@ -15,7 +15,7 @@ nixpkgs.writeScriptBin "nova-iso" (with nixpkgs.buildPackages;
|
||||||
trap "rm -rf $TMPDIR" err exit
|
trap "rm -rf $TMPDIR" err exit
|
||||||
|
|
||||||
mkdir -p "$TMPDIR/boot/syslinux"
|
mkdir -p "$TMPDIR/boot/syslinux"
|
||||||
${nova-image.program} "$TMPDIR/boot/image.elf" $@
|
${nova-image.program} $@ > "$TMPDIR/boot/image.elf"
|
||||||
|
|
||||||
pushd "$TMPDIR" > /dev/null
|
pushd "$TMPDIR" > /dev/null
|
||||||
out="nova.iso"
|
out="nova.iso"
|
||||||
|
|
|
@ -145,7 +145,7 @@ let
|
||||||
sotest = hostPkgs.runCommand "nova-${name}-sotest" env' ''
|
sotest = hostPkgs.runCommand "nova-${name}-sotest" env' ''
|
||||||
export XDG_CACHE_HOME=''${TMPDIR:-/tmp}
|
export XDG_CACHE_HOME=''${TMPDIR:-/tmp}
|
||||||
${apps.nova-image.program} \
|
${apps.nova-image.program} \
|
||||||
image.elf "${./driver-nova-config.dhall} ${testConfig}"
|
"${./driver-nova-config.dhall} ${testConfig}" > image.elf
|
||||||
cp "${testPkgs.bender}" bender
|
cp "${testPkgs.bender}" bender
|
||||||
cp "${testPkgs.NOVA}/hypervisor-x86_64" hypervisor
|
cp "${testPkgs.NOVA}/hypervisor-x86_64" hypervisor
|
||||||
mkdir -p $out/nix-support
|
mkdir -p $out/nix-support
|
||||||
|
|
Loading…
Reference in New Issue