diff --git a/.gitignore b/.gitignore index fbeaa0d..ccb4219 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /*.nar /*.sizes +/*.tar /signing-key.pub /vm-image \ No newline at end of file diff --git a/Makefile b/Makefile index ca822ec..daa80f0 100644 --- a/Makefile +++ b/Makefile @@ -8,21 +8,22 @@ all: hello.tar hello.sizes vm-image to-be-run-in-vm.sh Makefile vm-image-${tmp_image} \ -drive format=raw,file=hello.sizes,if=ide,index=1,media=disk \ -drive format=raw,file=to-be-run-in-vm.sh,if=ide,index=2,media=disk \ - -drive format=raw,file=hello.nar,if=ide,index=3,media=disk \ - # -drive format=raw,file=signing-key.pub,if=ide,index=4,media=disk + -drive format=raw,file=hello.tar,if=ide,index=3,media=disk rm vm-image-${tmp_image} -%.sizes: %.nar signing-key.pub to-be-run-in-vm.sh Makefile - printf "%020d\\n%020d\\n%020d\\n%$$((512-((20+1)*3)-1))s\\n" \ +%.sizes: %.tar signing-key.pub to-be-run-in-vm.sh Makefile + printf "%020d\\n%020d\\n%$$((512-((20+1)*2)-1))s\\n" \ "$$(wc -c "to-be-run-in-vm.sh" | sed -e 's/^[[:space:]]*\([0-9][0-9]*\)[[:space:]].*$$/\1/')" \ - "$$(wc -c "$*.nar" | sed -e 's/^[[:space:]]*\([0-9][0-9]*\)[[:space:]].*$$/\1/')" \ - "$$(wc -c "signing-key.pub" | sed -e 's/^[[:space:]]*\([0-9][0-9]*\)[[:space:]].*$$/\1/')" \ + "$$(wc -c "$*.tar" | sed -e 's/^[[:space:]]*\([0-9][0-9]*\)[[:space:]].*$$/\1/')" \ "" \ > $@ %.nar: Makefile guix archive --export --recursive '$*' > '$@' +%.tar: %.nar signing-key.pub Makefile + tar -cf '$@' '$*.nar' signing-key.pub + signing-key.pub: /etc/guix/signing-key.pub Makefile cp '$<' '$@' chmod +w '$@' diff --git a/to-be-run-in-vm.sh b/to-be-run-in-vm.sh index 4fd3f86..c4bd2a0 100644 --- a/to-be-run-in-vm.sh +++ b/to-be-run-in-vm.sh @@ -1,9 +1,8 @@ #!/bin/sh -echo LALALA -{ read len_script; read len_nar; read len_key; } < /dev/sdb -echo x $len_script y $len_nar z $len_key t -head -c "$len_nar" /dev/sdd | sha1sum -echo DONE -# dd if=/dev/sde bs=1 count=$len_key | sha1sum -# +echo +{ read len_script; read len_tar; } < /dev/sdb +pwd +head -c "$len_tar" /dev/sdd | tar -xf - +sha1sum hello.nar +sha1sum signing-key.pub