1
0
mirror of https://github.com/rancher/os.git synced 2025-07-07 20:08:37 +00:00

Merge pull request #458 from imikushin/xhyve-state

persistent state disk on xhyve
This commit is contained in:
Darren Shepherd 2015-07-29 01:26:08 -07:00
commit 5d93d51fc5

View File

@ -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
@ -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,9 +94,7 @@ else
done
fi
UNAME=$(uname)
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
@ -105,14 +105,15 @@ 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} \
-s 4,virtio-blk,${HD} \
-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 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 \