2
0
Fork 0

apps.nova-iso: write ISO to stdout

This commit is contained in:
Emery Hemingway 2020-01-25 17:25:54 +01:00
parent 638f072d9b
commit 093430d8f9
2 changed files with 5 additions and 12 deletions

View File

@ -31,7 +31,7 @@ rec {
program = "${drv}/bin/nova-image";
function = attrs: bootDesc:
nixpkgs.runCommand "nova-iso" (attrs // { inherit bootDesc; })
"${drv}/bin/nova-image $out $bootDesc";
"${drv}/bin/nova-image $bootDesc > $out";
};
nova-iso = let
@ -44,7 +44,7 @@ rec {
program = "${drv}/bin/nova-iso";
function = attrs: bootDesc:
nixpkgs.runCommand "nova.iso" attrs
''${drv}/bin/nova-iso $out "${bootDesc}"'';
''${drv}/bin/nova-iso "${bootDesc}" > $out'';
};
render-init =

View File

@ -9,14 +9,6 @@ nixpkgs.writeScriptBin "nova-iso" (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
SYSLINUX="${syslinux}/share/syslinux"
TMPDIR="$(${coreutils}/bin/mktemp -d)"
@ -25,7 +17,8 @@ nixpkgs.writeScriptBin "nova-iso" (with nixpkgs.buildPackages;
mkdir -p "$TMPDIR/boot/syslinux"
${nova-image.program} "$TMPDIR/boot/image.elf" $@
pushd "$TMPDIR"
pushd "$TMPDIR" > /dev/null
out="nova.iso"
# build ISO layout
cp ${packages.NOVA}/hypervisor* boot/hypervisor
@ -46,5 +39,5 @@ nixpkgs.writeScriptBin "nova-iso" (with nixpkgs.buildPackages;
boot
${syslinux}/bin/isohybrid "$out"
echo ISO is at $out
cat "$out"
'')