guix-reproducible-system/to-be-run-in-vm.sh
2018-09-12 18:02:11 +02:00

27 lines
589 B
Bash

#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "Usage: $0 shepherd"
echo "where shepherd is the path to shepherd in the GUIX store as"
echo "given by \`shepherd' from (use-modules (gnu packages admin))"
exit 1
fi
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
guix archive --authorize < signing-key.pub
guix archive --import < hello.nar
# Wait for the control socket for shepherd to appear and halt the VM.
(
while [ ! -e /var/run/shepherd/socket ]; do
sleep 1
done
"$1/sbin/halt"
) &