From 7b957d8fc63be718d9bf2072883bf454a2ef736d Mon Sep 17 00:00:00 2001 From: Ivan Mikushin Date: Tue, 28 Jul 2015 18:58:25 +0500 Subject: [PATCH 1/3] scripts/run: minor cleanup --- scripts/run | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/run b/scripts/run index 175d268f..c9194343 100755 --- a/scripts/run +++ b/scripts/run @@ -16,11 +16,11 @@ HD_GZ=${ARTIFACTS}/empty-hd.img.gz INITRD_TMP=${BUILD}/$(sha1sum ${INITRD} | awk '{print $1}') INITRD_CURRENT=${BUILD}/initrd-current INITRD_TEST=${BUILD}/initrd.test +UNAME=$(uname) USER_DATA=cloud-init/openstack/latest/user_data # PREREQ: brew install coreutils path() { - local UNAME=$(uname) if [ "$UNAME" == "Darwin" ]; then greadlink -f "$1" elif [ "$UNAME" == "Linux" ]; then readlink -f "$1"; fi @@ -92,8 +92,6 @@ else done fi -UNAME=$(uname) - KERNEL_ARGS="quiet rancher.password=rancher console=ttyS0 ${QEMU_APPEND}" if [ "$UNAME" == "Darwin" ] && [ -x $(which xhyve) ]; then From 5c84f36d79d1e99b801861d34669837e31159b90 Mon Sep 17 00:00:00 2001 From: Ivan Mikushin Date: Wed, 29 Jul 2015 11:54:17 +0500 Subject: [PATCH 2/3] enable ACPI in xhyve --- scripts/run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/run b/scripts/run index c9194343..14f29225 100755 --- a/scripts/run +++ b/scripts/run @@ -103,14 +103,14 @@ if [ "$UNAME" == "Darwin" ] && [ -x $(which xhyve) ]; then mkisofs -R -V config-2 -o "${CLOUD_CONFIG_ISO}" "$(pwd)/cloud-init" echo PWD=`pwd` - exec sudo xhyve -H -P \ + exec sudo xhyve -A -H -P -u \ -m 4G \ -s 0:0,hostbridge -s 31,lpc \ -l com1,stdio \ -s 2:0,virtio-net \ -s 3,ahci-cd,${CLOUD_CONFIG_ISO} \ -U a01fb25c-3a19-4759-a47a-2e353e51807d \ - -f kexec,${KERNEL},${INITRD_TEST},"earlyprintk=serial acpi=off elevator=noop ${KERNEL_ARGS}" + -f kexec,${KERNEL},${INITRD_TEST},"earlyprintk=serial elevator=noop ${KERNEL_ARGS}" elif [ "$UNAME" == "Linux" ] && [ -x $(which qemu-system-x86_64) ]; then exec qemu-system-x86_64 -serial stdio \ From de3bfed8100a5fec8916a8d1c3bf9ef0c337d380 Mon Sep 17 00:00:00 2001 From: Ivan Mikushin Date: Tue, 28 Jul 2015 21:56:04 +0500 Subject: [PATCH 3/3] 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 \