From de3bfed8100a5fec8916a8d1c3bf9ef0c337d380 Mon Sep 17 00:00:00 2001 From: Ivan Mikushin Date: Tue, 28 Jul 2015 21:56:04 +0500 Subject: [PATCH] scripts/run: create an empty raw disk image if not present use autoformat with formatzero=true to format the disk --- scripts/run | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/run b/scripts/run index 14f29225..0facff84 100755 --- a/scripts/run +++ b/scripts/run @@ -74,7 +74,9 @@ find . | cpio -H newc -o > ${INITRD_TEST} if [ ! -e ${HD} ]; then mkdir -p $(dirname ${HD}) - gzip -dc ${HD_GZ} > ${HD} + if [ "$UNAME" == "Darwin" ]; then qemu-img create -f raw -o size=10G ${HD} + elif [ "$UNAME" == "Linux" ]; then gzip -dc ${HD_GZ} > ${HD}; + fi fi mkdir -p $(dirname $USER_DATA) @@ -92,7 +94,7 @@ else done fi -KERNEL_ARGS="quiet rancher.password=rancher console=ttyS0 ${QEMU_APPEND}" +KERNEL_ARGS="rancher.password=rancher console=ttyS0 ${QEMU_APPEND}" if [ "$UNAME" == "Darwin" ] && [ -x $(which xhyve) ]; then @@ -109,8 +111,9 @@ if [ "$UNAME" == "Darwin" ] && [ -x $(which xhyve) ]; then -l com1,stdio \ -s 2:0,virtio-net \ -s 3,ahci-cd,${CLOUD_CONFIG_ISO} \ + -s 4,virtio-blk,${HD} \ -U a01fb25c-3a19-4759-a47a-2e353e51807d \ - -f kexec,${KERNEL},${INITRD_TEST},"earlyprintk=serial elevator=noop ${KERNEL_ARGS}" + -f kexec,${KERNEL},${INITRD_TEST},"earlyprintk=serial elevator=noop rancher.state.formatzero=true rancher.state.autoformat=[/dev/sda,/dev/vda] ${KERNEL_ARGS}" elif [ "$UNAME" == "Linux" ] && [ -x $(which qemu-system-x86_64) ]; then exec qemu-system-x86_64 -serial stdio \