mirror of
https://github.com/rancher/os.git
synced 2025-08-14 04:46:18 +00:00
add scripts/run --openstack, and use the iso if --cloud-config file.iso
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
parent
ecdd081c27
commit
d4ae014f76
8
Makefile
8
Makefile
@ -1,4 +1,4 @@
|
||||
TARGETS := $(shell ls scripts | grep -vE 'clean|run|help|docs')
|
||||
TARGETS := $(shell ls scripts | grep -vE 'clean|run|help|docs|release')
|
||||
|
||||
.dapper:
|
||||
@echo Downloading dapper
|
||||
@ -34,12 +34,18 @@ shell-bind: .dapper
|
||||
clean:
|
||||
@./scripts/clean
|
||||
|
||||
release: release-build openstack
|
||||
|
||||
release-build:
|
||||
./.dapper release
|
||||
|
||||
itest:
|
||||
./.dapper integration-test 2>&1 | tee dist/itest.log
|
||||
|
||||
openstack:
|
||||
cp dist/artifacts/rancheros.iso scripts/images/openstack/
|
||||
cd scripts/images/openstack && ../../../.dapper
|
||||
cp ./scripts/images/openstack/dist/*.img dist/
|
||||
|
||||
openstack-run:
|
||||
qemu-system-x86_64 -curses \
|
||||
|
@ -62,10 +62,12 @@ func Main() {
|
||||
func SaveCloudConfig() error {
|
||||
log.Debugf("SaveCloudConfig")
|
||||
|
||||
// TODO: can't run these here, but it needs to be triggered from here :()
|
||||
cfg := rancherConfig.LoadConfig()
|
||||
log.Debugf("init: SaveCloudConfig(pre ApplyNetworkConfig): %#v", cfg.Rancher.Network)
|
||||
network.ApplyNetworkConfig(cfg)
|
||||
|
||||
log.Debugf("datasources that will be consided: %#v", cfg.Rancher.CloudInit.Datasources)
|
||||
dss := getDatasources(cfg)
|
||||
if len(dss) == 0 {
|
||||
log.Errorf("currentDatasource - none found")
|
||||
@ -74,6 +76,7 @@ func SaveCloudConfig() error {
|
||||
|
||||
selectDatasource(dss)
|
||||
|
||||
// TODO: can't run these here, but it needs to be triggered from here :()
|
||||
// Apply any newly detected network config.
|
||||
cfg = rancherConfig.LoadConfig()
|
||||
log.Debugf("init: SaveCloudConfig(post ApplyNetworkConfig): %#v", cfg.Rancher.Network)
|
||||
|
@ -3,3 +3,4 @@ set -e
|
||||
|
||||
cd $(dirname $0)/..
|
||||
rm -rf build dist bin images/*/build state
|
||||
rm -rf ./scripts/images/openstack/dist
|
||||
|
17
scripts/run
17
scripts/run
@ -25,6 +25,9 @@ while [ "$#" -gt 0 ]; do
|
||||
--pxe)
|
||||
BOOT_PXE=1
|
||||
;;
|
||||
--openstack)
|
||||
USE_OPENSTACK_IMG=1
|
||||
;;
|
||||
--append)
|
||||
shift 1
|
||||
QEMU_APPEND="${QEMU_APPEND} $1"
|
||||
@ -152,6 +155,13 @@ if [ "$QEMU" == "1" ] || [ "$BOOT_ISO" == "1" ] || [ "$BOOT_HD" == "1" ]; then
|
||||
|
||||
if [ ! -e ${HD} ]; then
|
||||
mkdir -p $(dirname ${HD})
|
||||
if [ "$USE_OPENSTACK_IMG" == "1" ]; then
|
||||
if [ ! -e "dist/rancheros-openstack.img" ]; then
|
||||
echo "please build the open stack image first (run make release)."
|
||||
exit 1
|
||||
fi
|
||||
cp dist/rancheros-openstack.img $HD
|
||||
else
|
||||
if [ ¨$INSTALLED¨ == ¨1¨ ]; then
|
||||
./scripts/create-installed
|
||||
else
|
||||
@ -164,6 +174,7 @@ if [ "$QEMU" == "1" ] || [ "$BOOT_ISO" == "1" ] || [ "$BOOT_HD" == "1" ]; then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$SECOND_DRIVE" == "1" ]; then
|
||||
if [ "$FRESH" == "1" ]; then
|
||||
@ -180,6 +191,9 @@ if [ "$QIND" != "1" ]; then
|
||||
CPU="-cpu host"
|
||||
fi
|
||||
|
||||
if [[ "${CLOUD_CONFIG}" == *".iso" ]]; then
|
||||
CLOUD_CONFIG_DISK="-cdrom ${CLOUD_CONFIG}"
|
||||
else
|
||||
CCROOT=${BUILD}/cloud-config
|
||||
rm -rf ${CCROOT}
|
||||
mkdir -p ${CCROOT}
|
||||
@ -208,6 +222,7 @@ if [ "$QIND" != "1" ]; then
|
||||
-device virtio-9p-pci,id=fs0,fsdev=fsdev0,mount_tag=config-2"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
HOME=${HOME:-/}
|
||||
fi
|
||||
@ -251,7 +266,6 @@ elif [ "$BOOT_ISO" == "1" ] ||
|
||||
[ "$BOOT_HD" == "1" ]; then
|
||||
if [ "$BOOT_ISO" == "1" ]; then
|
||||
ISO_OPTS="-boot d -cdrom ./dist/artifacts/rancheros.iso \
|
||||
${CLOUD_CONFIG_DISK} \
|
||||
-fsdev local,security_model=none,id=fsdev1,path=${HOME} \
|
||||
-device virtio-9p-pci,id=fs1,fsdev=fsdev1,mount_tag=home "
|
||||
echo "----- $ISO_OPTS"
|
||||
@ -259,6 +273,7 @@ elif [ "$BOOT_ISO" == "1" ] ||
|
||||
set -x
|
||||
exec qemu-system-${QEMUARCH} \
|
||||
${DISPLAY_OPTS} \
|
||||
${CLOUD_CONFIG_DISK} \
|
||||
-rtc base=utc,clock=host \
|
||||
${KVM_ENABLE} \
|
||||
${CPU} \
|
||||
|
Loading…
Reference in New Issue
Block a user