From edb8022336d42f8fa2566a83ad9d38fdd9b2bdaa Mon Sep 17 00:00:00 2001 From: Sven Dowideit Date: Mon, 16 Jan 2017 12:37:01 +1000 Subject: [PATCH] fix create-installer to use the installer tarball in the iso Signed-off-by: Sven Dowideit --- scripts/create-installed | 19 ++++++++----------- scripts/run | 1 + scripts/run-common | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/scripts/create-installed b/scripts/create-installed index 9390c47b..cff9dc70 100755 --- a/scripts/create-installed +++ b/scripts/create-installed @@ -1,12 +1,10 @@ #!/bin/bash -set -e +set -ex cd $(dirname $0)/.. source ./scripts/run-common -INSTALLER=${BASE}/dist/artifacts/installer.tar - if [ ! -e ${INITRD} ]; then cp bin/ros ${INITRD_SRC}/usr/bin/ros ./scripts/hash-initrd @@ -25,26 +23,24 @@ trap "poweroff" EXIT sleep 5 -mount -t 9p -o trans=virtio,version=9p2000.L config-2 /mnt - touch log openvt -s -- tail -f log & -cat /mnt/installer.tar | system-docker load -ros install -d /dev/vda -f --no-reboot >log 2>&1 + +mount -t 9p -o trans=virtio,version=9p2000.L config-2 /mnt + +# use the install tarball in the iso +ros install -d /dev/vda -f --no-reboot --append "console=ttyS0 rancher.autologin=ttyS0" >> /mnt/log 2>&1 touch /mnt/success EOF rm -f build/{success,hd.img} qemu-img create -f qcow2 build/hd.img 8G -cp ${INSTALLER} build/installer.tar qemu-system-${QEMUARCH} -serial stdio \ -enable-kvm \ -drive if=virtio,file=build/hd.img \ - -kernel ${KERNEL} \ - -initrd ${INITRD} \ + -boot d -cdrom ./dist/artifacts/rancheros.iso \ -m 2048 \ - -append "${DEFAULT_KERNEL_ARGS}" \ -smp 1 \ -nographic \ -display none \ @@ -55,3 +51,4 @@ qemu-system-${QEMUARCH} -serial stdio \ mkdir -p state cp build/hd.img state/hd.img +echo "------------------------ RancherOS installed to hd.img." \ No newline at end of file diff --git a/scripts/run b/scripts/run index c7e6b1fc..0497c61d 100755 --- a/scripts/run +++ b/scripts/run @@ -70,6 +70,7 @@ while [ "$#" -gt 0 ]; do CONSOLEDISPLAY=1 ;; --installed) + ./scripts/create-installed INSTALLED=1 ;; *) diff --git a/scripts/run-common b/scripts/run-common index ba49042b..79fb0af0 100755 --- a/scripts/run-common +++ b/scripts/run-common @@ -48,4 +48,4 @@ REBUILD=1 QEMUARCH=${qemuarch["${ARCH}"]} TTYCONS=${ttycons["${ARCH}"]} -DEFAULT_KERNEL_ARGS="rancher.debug=true rancher.password=rancher console=${TTYCONS} rancher.autologin=${TTYCONS}" +DEFAULT_KERNEL_ARGS="rancher.debug=false rancher.password=rancher console=${TTYCONS} rancher.autologin=${TTYCONS}"