From 5d199b9591085b2eb6af73ce0844c2996444af4e Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Tue, 15 Dec 2015 11:22:19 +0000 Subject: [PATCH] support /dev/vda as a disk as well as /dev/sda and mount one for xhyve run Signed-off-by: Justin Cormack --- alpine/etc/init.d/automount | 3 +-- xhyve/.gitignore | 1 + xhyve/Makefile | 5 ++++- xhyve/xhyverun.sh | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/alpine/etc/init.d/automount b/alpine/etc/init.d/automount index bee305551..b939ac270 100755 --- a/alpine/etc/init.d/automount +++ b/alpine/etc/init.d/automount @@ -10,8 +10,7 @@ start() { ebegin "Configuring host block device" - # XXX this may change on other ports - DEV="sda" + DEV="$(ls /dev/[xv]da | head -1 | sed s@/dev/@@)" DRIVE="/dev/${DEV}" SWAP="${DRIVE}1" DATA="${DRIVE}2" diff --git a/xhyve/.gitignore b/xhyve/.gitignore index 84c048a73..424ae5ff3 100644 --- a/xhyve/.gitignore +++ b/xhyve/.gitignore @@ -1 +1,2 @@ /build/ +disk.img diff --git a/xhyve/Makefile b/xhyve/Makefile index 3016bf072..df5f92aa8 100644 --- a/xhyve/Makefile +++ b/xhyve/Makefile @@ -106,7 +106,10 @@ $(TARGET): $(TARGET).sym @echo strip $(notdir $@) $(VERBOSE) $(ENV) $(STRIP) $(TARGET).sym -o $@ -run: $(TARGET) +disk.img: + dd if=/dev/zero of=disk.img bs=4096 count=100k + +run: $(TARGET) disk.img ./xhyverun.sh || true clean: diff --git a/xhyve/xhyverun.sh b/xhyve/xhyverun.sh index eadd56d07..b3a191025 100755 --- a/xhyve/xhyverun.sh +++ b/xhyve/xhyverun.sh @@ -14,7 +14,7 @@ else NET="-s 2:0,virtio-net" fi #IMG_CD="-s 3,ahci-cd,/somepath/somefile.iso" -#IMG_HDD="-s 4,virtio-blk,/somepath/somefile.img" +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"