Files
linuxkit/hyperkit.sh
Justin Cormack 3e020abdb2 Use bin dir and clean up hyperkit test
- make a `bin/` directory
- make hyperkit-test pass, as it writes to pty so redirect was not working

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-02-01 14:15:52 +00:00

24 lines
616 B
Bash
Executable File

#!/bin/sh
set -e
KERNEL="alpine/kernel/x86_64/vmlinuz64"
: ${INITRD:="alpine/initrd.img"}
CMDLINE="earlyprintk=serial console=ttyS0"
[ -f disk.img ] || dd if=/dev/zero of=disk.img bs=1m count=256
MEM="-m 1G"
SMP="-c 1"
SLIRP_SOCK=$(mktemp)
NET="-s 2:0,virtio-vpnkit,path=$SLIRP_SOCK"
IMG_HDD="-s 4,virtio-blk,disk.img"
PCI_DEV="-s 0:0,hostbridge -s 31,lpc"
RND="-s 5,virtio-rnd"
LPC_DEV="-l com1,stdio"
bin/com.docker.slirp --ethernet $SLIRP_SOCK &>/dev/null &
trap "kill $!; rm $SLIRP_SOCK" EXIT
bin/com.docker.hyperkit -A $MEM $SMP $PCI_DEV $LPC_DEV $NET $IMG_HDD $RND -u -f kexec,$KERNEL,$INITRD,"$CMDLINE"