inital Makefile struct with bm metal3 22/1422/1
authorKuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>
Fri, 16 Aug 2019 19:27:35 +0000 (12:27 -0700)
committerKuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>
Fri, 16 Aug 2019 19:27:35 +0000 (12:27 -0700)
Change-Id: Icceed6c014c867926cd413cbfa0a086736ead6b7

Makefile
deploy/metal3/scripts/metal3.sh
env/metal3/01_install_package.sh [moved from env/01_install_package.sh with 96% similarity]
env/metal3/02_configure.sh [moved from env/02_configure.sh with 98% similarity]
env/metal3/03_launch_prereq.sh [moved from env/03_launch_prereq.sh with 96% similarity]

index e69de29..567ea2e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -0,0 +1,12 @@
+SHELL:=/bin/bash
+BMDIR:=$(CURDIR)/env/metal3
+METAL3DIR:=$(CURDIR)/deploy/metal3/scripts
+all: bm_install
+
+bm_preinstall:
+       pushd $(BMDIR) && ./01_install_package.sh && ./02_configure.sh && ./03_launch_prereq.sh && popd
+
+bm_install:
+       pushd $(METAL3DIR) && ./metal3.sh && popd 
+
+.PHONY: all bm_preinstall bm_install
index b5ba520..f268d8b 100755 (executable)
@@ -9,6 +9,11 @@ BM_OPERATOR="${BM_OPERATOR:-https://github.com/metal3-io/baremetal-operator.git}
 
 source $LIBDIR/env/lib/common.sh
 
+if [[ $EUID -ne 0 ]]; then
+    echo "This script must be run as root"
+    exit 1
+fi
+
 function get_default_inteface_ipaddress() {
     local _ip=$1
     local _default_interface=$(awk '$2 == 00000000 { print $1 }' /proc/net/route)
similarity index 96%
rename from env/01_install_package.sh
rename to env/metal3/01_install_package.sh
index b38cce9..36beb04 100755 (executable)
@@ -1,8 +1,10 @@
 #!/usr/bin/env bash
 set -ex
 
-lib/common.sh
-lib/logging.sh
+LIBDIR="$(dirname "$PWD")"
+
+source $LIBDIR/lib/common.sh
+source $LIBDIR/lib/logging.sh
 
 if [[ $EUID -ne 0 ]]; then
     echo "This script must be run as root"
similarity index 98%
rename from env/02_configure.sh
rename to env/metal3/02_configure.sh
index 016f202..15864d6 100755 (executable)
@@ -1,8 +1,9 @@
 #!/usr/bin/env bash
 set -xe
+LIBDIR="$(dirname "$PWD")"
 
-source lib/logging.sh
-source lib/common.sh
+source $LIBDIR/lib/logging.sh
+source $LIBDIR/lib/common.sh
 
 if [[ $EUID -ne 0 ]]; then
     echo "confgiure script must be run as root"
similarity index 96%
rename from env/03_launch_prereq.sh
rename to env/metal3/03_launch_prereq.sh
index 544ae0a..95c17f0 100755 (executable)
@@ -1,11 +1,13 @@
 #!/bin/bash
 set -xe
 
-source lib/logging.sh
-source lib/common.sh
+LIBDIR="$(dirname "$PWD")"
+
+source $LIBDIR/lib/logging.sh
+source $LIBDIR/lib/common.sh
 
 if [[ $EUID -ne 0 ]]; then
-    echo "confgiure script must be run as root"
+    echo "launch script must be run as root"
     exit 1
 fi