diff options
| author | Jonathan Bauer | 2015-05-07 18:12:30 +0200 |
|---|---|---|
| committer | Jonathan Bauer | 2015-05-07 18:12:30 +0200 |
| commit | 46ba927a27fc6d6b2fc76096e57ae127c41b65b9 (patch) | |
| tree | 81225400b12967f7e1d0a2018fdfbf527baef69d /testModule | |
| parent | added pids to log messages for better debugging (diff) | |
| download | systemd-init-46ba927a27fc6d6b2fc76096e57ae127c41b65b9.tar.gz systemd-init-46ba927a27fc6d6b2fc76096e57ae127c41b65b9.tar.xz systemd-init-46ba927a27fc6d6b2fc76096e57ae127c41b65b9.zip | |
started configuration stuff
Diffstat (limited to 'testModule')
| -rwxr-xr-x | testModule/hooks/pre-mount/fetch-config.sh | 12 | ||||
| -rw-r--r-- | testModule/module-setup.sh | 3 | ||||
| -rwxr-xr-x | testModule/scripts/setup-qcow2 | 9 |
3 files changed, 21 insertions, 3 deletions
diff --git a/testModule/hooks/pre-mount/fetch-config.sh b/testModule/hooks/pre-mount/fetch-config.sh new file mode 100755 index 00000000..013b0058 --- /dev/null +++ b/testModule/hooks/pre-mount/fetch-config.sh @@ -0,0 +1,12 @@ +command -v info >/dev/null || . /lib/dracut-lib.sh + +info "Getting configuration from OPENSLX-Server..." + +WGET="$(busybox which wget)" +if [ -z $WGET ]; then + # do nothing + warn "'wget' not found. Skipping openslx configuration..." + exit 1 +fi +mkdir -p /opt/openslx +$WGET http://10.4.9.51/openslx/config -O /opt/openslx/config diff --git a/testModule/module-setup.sh b/testModule/module-setup.sh index c06435c9..e40069ce 100644 --- a/testModule/module-setup.sh +++ b/testModule/module-setup.sh @@ -79,6 +79,9 @@ install() { inst_hook pre-udev 00 "$moddir/hooks/pre-udev/load-dnbd3-nbd-modules.sh" ## HOOK pre-mount + # this is the configuration hook where the config stuff is wget'ed + inst_hook pre-mount 00 "$moddir/hooks/pre-mount/fetch-config.sh" + # this is the main hook where all the magic is triggered inst_hook pre-mount 10 "$moddir/hooks/pre-mount/mount-qcow.sh" diff --git a/testModule/scripts/setup-qcow2 b/testModule/scripts/setup-qcow2 index 86b69db2..cc74457b 100755 --- a/testModule/scripts/setup-qcow2 +++ b/testModule/scripts/setup-qcow2 @@ -9,10 +9,13 @@ command -v emergency_shell >/dev/null || . /lib/dracut-lib.sh # # TODO make this configurable [ -f /opt/openslx/config ] && . /opt/openslx/config +[ -z $SLX_DNBD3_SERVER ] && SLX_DNBD3_SERVER="132.230.4.1" +[ -z $SLX_STAGE4 ] && SLX_STAGE4="stage4/joe/centos7" +[ -z $SLX_STAGE4_RID ] && SLX_STAGE4_RID="4" +declare -rg DNBD3_SERVER="$SLX_DNBD3_SERVER" +declare -rg DNBD3_IMAGE="$SLX_STAGE4" +declare -rg DNBD3_RID="$SLX_STAGE4_RID" declare -rg DNBD3_DEVICE="/dev/dnbd0" -declare -rg DNBD3_SERVER="132.230.4.1" -declare -rg DNBD3_IMAGE="stage4/joe/centos7" -declare -rg DNBD3_RID="4" declare -rg QCOW_CONTAINER="/opt/openslx/system/system.qcow2" # # END GLOBALS |
