Skip to contentSkip to conversation

setup-environment: Add support for set distro

PATCH Superseded Fabio Berton 2 participants 3 messages Nov 7, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 setup-environment: Add support for set distro

To run setup-environment you need to set one of distros listed on supported distros using command like:

MACHINE=imx6qsabresd DISTRO=fslc-framebuffer source setup-environment build

Note that DISTRO is a required variable and won't be set if not defined.

---
 setup-environment | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)
setup-environment +22 -4
index 099b21b..a955182 100755
@@ -27,19 +27,25 @@ usage()
 {
     echo -e "\nUsage: source $PROGNAME <build-dir>
     <build-dir>: specifies the build directory location (required)
+    <distro>:    specifies the disto name
 
 If undefined, this script will set \$MACHINE to 'imx6qsabresd'.
+You need to set DISTRO to use this environment.
 "
 
     ls sources/*/conf/machine/*.conf > /dev/null 2>&1
+    ls sources/meta-freescale-distro/conf/distro/fslc-*.conf > /dev/null 2>&1
     if [ $? -eq 0 ]; then
         echo -e "
 Supported machines: `echo; ls sources/*/conf/machine/*.conf \
 | sed s/\.conf//g | sed -r 's/^.+\///' | xargs -I% echo -e "\t%"`
 
-To build for a machine listed above, run this script as:
-MACHINE=<machine> source $PROGNAME <build-dir>
-"
+Supported distros: `echo; ls sources/meta-freescale-distro/conf/distro/fslc-*.conf \
+| sed s/\.conf//g | sed -r 's/^.+\///' | xargs -I% echo -e "\t%"`
+
+To build for a distro and machine listed above, run this script as:
+MACHINE=<machine> DISTRO=<distro> source $PROGNAME <build-dir>
+Ex: MACHINE=imx6qsabresd DISTRO=fslc-framebuffer source $PROGNAME build"
     fi
 }
 
@@ -105,7 +111,19 @@ if [ -z "$SDKMACHINE" ]; then
 fi
 
 if [ -z "$DISTRO" ]; then
-    DISTRO='poky'
+    echo "You must set DISTRO before setting up the environment."
+fi
+# Check the machine type specified
+LIST_DISTROS=`ls -1 $CWD/sources/meta-freescale-distro/conf/distro`
+VALID_DISTRO=`echo -e "$LIST_DISTROS" | grep ${DISTRO}.conf$ | wc -l`
+if [ "x$DISTRO" = "x" ] || [ "$VALID_DISTRO" = "0" ]; then
+    echo -e "The \$DISTRO you have specified ($DISTRO) is not supported by this build setup\n"
+    usage && clean_up
+    return 1
+else
+    if [ ! -e $1/conf/local.conf.sample ]; then
+        echo "Configuring for ${DISTRO}"
+    fi
 fi
 
 OEROOT=$PWD/sources/poky
Signature · 1 line
2.1.4
#1 lore raw

PATCH 2/2 setup-environment: Move error log from top to bottom

If setup-environment won't be running like expect show error message at bottom of log to be more visible.

---
 setup-environment | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
setup-environment +4 -2
index a955182..53c324f 100755
@@ -97,8 +97,9 @@ fi
 LIST_MACHINES=`ls -1 $CWD/sources/*/conf/machine`
 VALID_MACHINE=`echo -e "$LIST_MACHINES" | grep ${MACHINE}.conf$ | wc -l`
 if [ "x$MACHINE" = "x" ] || [ "$VALID_MACHINE" = "0" ]; then
+    usage
     echo -e "\nThe \$MACHINE you have specified ($MACHINE) is not supported by this build setup"
-    usage && clean_up
+    clean_up
     return 1
 else
     if [ ! -e $1/conf/local.conf.sample ]; then
@@ -117,8 +118,9 @@ fi
 LIST_DISTROS=`ls -1 $CWD/sources/meta-freescale-distro/conf/distro`
 VALID_DISTRO=`echo -e "$LIST_DISTROS" | grep ${DISTRO}.conf$ | wc -l`
 if [ "x$DISTRO" = "x" ] || [ "$VALID_DISTRO" = "0" ]; then
+    usage
     echo -e "The \$DISTRO you have specified ($DISTRO) is not supported by this build setup\n"
-    usage && clean_up
+    clean_up
     return 1
 else
     if [ ! -e $1/conf/local.conf.sample ]; then
Signature · 1 line
2.1.4
#2 lore raw
In reply to Fabio Berton

Hi Fabio,

Quoted 17 lines · On Mon, 7 Nov 2016 09:54:31 -0200 Fabio Berton…

To run setup-environment you need to set one of distros listed on supported distros using command like:

MACHINE=imx6qsabresd DISTRO=fslc-framebuffer source setup-environment build

Note that DISTRO is a required variable and won't be set if not defined.

---
 setup-environment | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)
setup-environment +0 -0
index 099b21b..a955182 100755

setup-environment usage() · line 30

Quoted 4 lines
setup-environment +1 -0
@@ -27,19 +27,25 @@ usage()
 {
     echo -e "\nUsage: source $PROGNAME <build-dir>
     <build-dir>: specifies the build directory location (required)
+    <distro>:    specifies the disto name

Small typo: s/disto/distro/

Quoted 46 lines
setup-environment +21 -4
 If undefined, this script will set \$MACHINE to 'imx6qsabresd'.
+You need to set DISTRO to use this environment.
 "
 
     ls sources/*/conf/machine/*.conf > /dev/null 2>&1
+    ls sources/meta-freescale-distro/conf/distro/fslc-*.conf > /dev/null 2>&1
     if [ $? -eq 0 ]; then
         echo -e "
 Supported machines: `echo; ls sources/*/conf/machine/*.conf \
 | sed s/\.conf//g | sed -r 's/^.+\///' | xargs -I% echo -e "\t%"`
 
-To build for a machine listed above, run this script as:
-MACHINE=<machine> source $PROGNAME <build-dir>
-"
+Supported distros: `echo; ls sources/meta-freescale-distro/conf/distro/fslc-*.conf \
+| sed s/\.conf//g | sed -r 's/^.+\///' | xargs -I% echo -e "\t%"`
+
+To build for a distro and machine listed above, run this script as:
+MACHINE=<machine> DISTRO=<distro> source $PROGNAME <build-dir>
+Ex: MACHINE=imx6qsabresd DISTRO=fslc-framebuffer source $PROGNAME build"
     fi
 }
 
@@ -105,7 +111,19 @@ if [ -z "$SDKMACHINE" ]; then
 fi
 
 if [ -z "$DISTRO" ]; then
-    DISTRO='poky'
+    echo "You must set DISTRO before setting up the environment."
+fi
+# Check the machine type specified
+LIST_DISTROS=`ls -1 $CWD/sources/meta-freescale-distro/conf/distro`
+VALID_DISTRO=`echo -e "$LIST_DISTROS" | grep ${DISTRO}.conf$ | wc -l`
+if [ "x$DISTRO" = "x" ] || [ "$VALID_DISTRO" = "0" ]; then
+    echo -e "The \$DISTRO you have specified ($DISTRO) is not supported by this build setup\n"
+    usage && clean_up
+    return 1
+else
+    if [ ! -e $1/conf/local.conf.sample ]; then
+        echo "Configuring for ${DISTRO}"
+    fi
 fi
 
 OEROOT=$PWD/sources/poky
Signature · 1 line
2.1.4
Signature · 1 line
http://parenteses.org/mario