From: Denys Dmytriyenko <[email protected]>

Allow passing a different machine on the command line overwriting what
was originally specified in the config file.

Cleanup parameter checks and add usage banner with available options.

Signed-off-by: Denys Dmytriyenko <[email protected]>
---
 build-oesdk.sh | 33 +++++++++++++++++++++++----------
 1 file changed, 23 insertions(+), 10 deletions(-)

diff --git a/build-oesdk.sh b/build-oesdk.sh
index 77c2019..3c0b0c2 100755
--- a/build-oesdk.sh
+++ b/build-oesdk.sh
@@ -16,7 +16,13 @@ then
 fi
 
 usage() {
-    echo "write something"
+    echo -n "Usage: "
+    echo -n `basename $0`
+    echo " [-h] [-s] [-m machine] -f config"
+    echo "   -f config    Config file to use for the build"
+    echo "   -m machine   Build for machine instead of what set in config"
+    echo "   -s           Skip all repositories checkouts"
+    echo "   -h           This help screen"
     exit 0
 }
 
@@ -24,27 +30,34 @@ usage() {
 # Main Script #
 ###############
 
-# Do not allow calling this script without passing the config file option
-if [ "$*" = "" ]
-then
-    log $error_log echo "You must specify at least one option on the command 
line"
-    log $error_log usage
-    exit 1
-fi
-
 # Parse input options
-while getopts :f:h:s arg
+while getopts :f:m:hs arg
 do
     case $arg in
         f ) inputfile="$OPTARG";;
+        m ) machine="$OPTARG";;
         s ) skipcheckout="true";;
         h ) usage;;
     esac
 done
 
+# Do not allow calling this script without passing the config file option
+if [ "$inputfile" = "" ]
+then
+    log $error_log echo "You must specify a config file to use"
+    log $error_log usage
+    exit 1
+fi
+
 # Parse the input config file to set the required build variables
 parse_config_file $inputfile
 
+if [ "$machine" != "" ]
+then
+    echo "Machine $machine was specified as a parameter on the command line"
+    MACHINES=$machine
+fi
+
 # Verify that the MANDATORY_INPUTS have been set.  We know there are some
 # values that absolutely need to be set or else you will end up
 # trashing your host configuration.
-- 
2.7.4



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#13438): 
https://lists.yoctoproject.org/g/meta-arago/message/13438
Mute This Topic: https://lists.yoctoproject.org/mt/87647686/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-arago/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to