setup-environment: Simplify use model for pre-existing build directory
PATCH 1/1 setup-environment: Simplify use model for pre-existing build directory
The script setup-environment requires that MACHINE and DISTRO be set. However, these variables are only used when creating a new build directory, and they should not be required when using a pre-existing build directory.
--- setup-environment | 48 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 14 deletions(-)
setup-environment +34 -14
@@ -25,12 +25,21 @@ PROGNAME="setup-environment" usage() { - echo -e "\nUsage:MACHINE=<machine> DISTRO=<distro> source $PROGNAME <build-dir> - <build-dir>: specifies the build directory location (required) - <machine>: specifies the machine name (required) - <distro>: specifies the distro name (required) - -You must set \$MACHINE and \$DISTRO before setting up the environment. + echo -e " +Usage: MACHINE=<machine> DISTRO=<distro> source $PROGNAME <build-dir> +Usage: source $PROGNAME <build-dir> + <machine> machine name + <distro> distro name + <build-dir> build directory + +The first usage is for creating a new build directory. In this case, the +script creates the build directory <build-dir>, configures it for the +specified <machine> and <distro>, and prepares the calling shell for running +bitbake on the build directory. + +The second usage is for using an existing build directory. In this case, +the script prepares the calling shell for running bitbake on the build +directory <build-dir>. The build directory configuration is unchanged. " ls sources/*/conf/machine/*.conf > /dev/null 2>&1
@@ -46,9 +55,14 @@ Supported Freescale's distros: `echo; ls sources/meta-freescale-distro/conf/dist Available Poky's distros: `echo; ls sources/poky/meta-poky/conf/distro/*.conf \ | sed s/\.conf//g | sed -r 's/^.+\///' | xargs -I% echo -e "\t%"` -To build for a machine and distro listed above, run this script as: -MACHINE=<machine> DISTRO=<distro> source $PROGNAME <build-dir> -Ex: MACHINE=imx6qsabresd DISTRO=fslc-framebuffer source $PROGNAME build" +Examples: + +- To create a new Yocto build directory: + $ MACHINE=imx6qsabresd DISTRO=fslc-framebuffer source $PROGNAME build + +- To use an existing Yocto build directory: + $ source $PROGNAME build +" fi }
@@ -92,9 +106,15 @@ if [ "$(whoami)" = "root" ]; then echo "ERROR: do not use the BSP as root. Exiting..." fi -if [ -z "$MACHINE" ]; then +if [ ! -e $1/conf/local.conf.sample ]; then + build_dir_setup_enabled="true" +else + build_dir_setup_enabled="false" +fi + +if [ "$build_dir_setup_enabled" = "true" ] && [ -z "$MACHINE" ]; then usage - echo -e "\nYou must set \$MACHINE before setting up the environment." + echo -e "ERROR: You must set MACHINE when creating a new build directory." clean_up return 1 fi
@@ -103,9 +123,9 @@ if [ -z "$SDKMACHINE" ]; then SDKMACHINE='i686' fi -if [ -z "$DISTRO" ]; then +if [ "$build_dir_setup_enabled" = "true" ] && [ -z "$DISTRO" ]; then usage - echo -e "\nYou must set \$DISTRO before setting up the environment." + echo -e "ERROR: You must set DISTRO when creating a new build directory." clean_up return 1 fi
@@ -146,7 +166,7 @@ fi export PATH="`echo $PATH | sed 's/\(:.\|:\)*:/:/g;s/^.\?://;s/:.\?$//'`" generated_config= -if [ ! -e conf/local.conf.sample ]; then +if [ "$build_dir_setup_enabled" = "true" ]; then mv conf/local.conf conf/local.conf.sample # Generate the local.conf based on the Yocto defaults
Signature · 1 line
1.9.1
Hi,
Poky already provide a versatile mechanism for setting up the build environment [1]:
TEMPLATECONF=/path/to/my/conf . [path_to]/oe-init-build-env [build_dir].
Is it a particular reason to diverge from this?
With this script I can no longer point to my template conf directory.
The chances are that my machine, my distro name and my common target are all custom.
I see that one think this script is doing is explicitly accepting the EULA (one time only).
Most probably this is implicitly accepted as per the content of my/conf/local.conf.sample. I assume I'm allowed to do this; is that true? For this purpose a separate script modifying the existing conf/local.conf is more simple and more intuitive.
The same approach could be used for setting up the (SDK)MACHINE and DISTRO if those aren't already set on local.conf.sample The conf-notest.txt might issue the fact that above script(s) need to be run (once) to complete the environment setup.
Regards,
Tudor.
Quoted 118 lines
-----Original Message-----
From: [email protected] [mailto:meta-freescale- [email protected]] On Behalf Of Tom Hochstein
Sent: Friday, 11 November, 2016 19:30
To: [email protected]
Subject: [meta-freescale] [base][PATCH] setup-environment: Simplify use model for pre-existing build directoryThe script setup-environment requires that MACHINE and DISTRO be set. However, these variables are only used when creating a new build directory, and they should not be required when using a pre-existing build directory.
Signed-off-by Tom Hochstein <[email protected]>--- setup-environment | 48 ++++++++++++++++++++++++++++++++++--------- ----- 1 file changed, 34 insertions(+), 14 deletions(-)setup-environment index a3eae7b..a04ffae renamed from setup-environment +0
-0100755
setup-environment +0
-1@@ -25,12 +25,21 @@ PROGNAME="setup-environment" usage() { - echo -e "\nUsage:MACHINE=<machine> DISTRO=<distro> source$PROGNAME <build-dir>
setup-environment +2
-5- <build-dir>: specifies the build directory location (required) - <machine>: specifies the machine name (required) - <distro>: specifies the distro name (required) - -You must set \$MACHINE and \$DISTRO before setting up the environment. + echo -e " +Usage: MACHINE=<machine> DISTRO=<distro> source $PROGNAME<build-dir>
setup-environment +13
-0+Usage: source $PROGNAME <build-dir> + <machine> machine name + <distro> distro name + <build-dir> build directory + +The first usage is for creating a new build directory. In this case, +the script creates the build directory <build-dir>, configures it for +the specified <machine> and <distro>, and prepares the calling shell +for running bitbake on the build directory. + +The second usage is for using an existing build directory. In this +case, the script prepares the calling shell for running bitbake on the +build directory <build-dir>. The build directory configuration is unchanged. " ls sources/*/conf/machine/*.conf > /dev/null 2>&1 @@ -46,9 +55,14 @@Supported Freescale's distros: `echo; ls sources/meta-freescale- distro/conf/dist
Available Poky's distros: `echo; ls sources/poky/meta-
poky/conf/distro/*.conf \ | sed s/\.conf//g | sed -r 's/^.+\///' | xargs -I% echo -e "\t%"`setup-environment +0
-3-To build for a machine and distro listed above, run this script as: -MACHINE=<machine> DISTRO=<distro> source $PROGNAME <build-dir> -Ex: MACHINE=imx6qsabresd DISTRO=fslc-framebuffer source $PROGNAMEbuild"
setup-environment +4
-0+Examples: + +- To create a new Yocto build directory: + $ MACHINE=imx6qsabresd DISTRO=fslc-framebuffer source $PROGNAMEbuild
setup-environment +12
-2+ +- To use an existing Yocto build directory: + $ source $PROGNAME build +" fi }@@ -92,9 +106,15 @@ if [ "$(whoami)" = "root" ]; then echo "ERROR: do not use the BSP as root. Exiting..." fi -if [ -z "$MACHINE" ]; then +if [ ! -e $1/conf/local.conf.sample ]; then + build_dir_setup_enabled="true" +else + build_dir_setup_enabled="false" +fi + +if [ "$build_dir_setup_enabled" = "true" ] && [ -z "$MACHINE" ]; then usage - echo -e "\nYou must set \$MACHINE before setting up the environment." + echo -e "ERROR: You must set MACHINE when creating a new builddirectory."
clean_up
return 1
fisetup-environment +2
-2@@ -103,9 +123,9 @@ if [ -z "$SDKMACHINE" ]; then SDKMACHINE='i686' fi -if [ -z "$DISTRO" ]; then +if [ "$build_dir_setup_enabled" = "true" ] && [ -z "$DISTRO" ]; then usage - echo -e "\nYou must set \$DISTRO before setting up the environment." + echo -e "ERROR: You must set DISTRO when creating a new builddirectory."
clean_up
return 1
fisetup-environment +1
-2@@ -146,7 +166,7 @@ fi export PATH="`echo $PATH | sed 's/\(:.\|:\)*:/:/g;s/^.\?://;s/:.\?$//'`" generated_config= -if [ ! -e conf/local.conf.sample ]; then +if [ "$build_dir_setup_enabled" = "true" ]; then mv conf/local.conf conf/local.conf.sample # Generate the local.conf based on the Yocto defaults --1.9.1
Quoted 5 lines
--
_______________________________________________
meta-freescale mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-freescale
_______________________________________________________________________
This e-mail and any files transmitted with it are proprietary and intended solely for the use of the individual or entity to whom they are addressed. If you have reason to believe that you have received this e-mail in error, please notify the sender and destroy this e-mail and any attached files. Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the Curtiss-Wright Corporation or any of its subsidiaries. Documents attached hereto may contain technology subject to government export regulations. Recipient is solely responsible for ensuring that any re-export, transfer or disclosure of this information is in accordance with applicable government export regulations. The recipient should check this e-mail and any attachments for the presence of viruses. Curtiss-Wright Corporation and its subsidiaries accept no liability for any damage caused by any virus transmitted by this e-mail.
Hello Tudor,
Quoted 7 lines · Tudor
Poky already provide a versatile mechanism for setting up the build environment [1]:
TEMPLATECONF=/path/to/my/conf . [path_to]/oe-init-build-env [build_dir].Is it a particular reason to diverge from this?
With this script I can no longer point to my template conf directory.
Quoted 7 lines
The chances are that my machine, my distro name and my common target are all custom.
I see that one think this script is doing is explicitly accepting the EULA (one time only).
Most probably this is implicitly accepted as per the content of my/conf/local.conf.sample. I assume I'm allowed to do this; is that true? For this purpose a separate script modifying the existingconf/local.confis more simple and more intuitive.
The same approach could be used for setting up the (SDK)MACHINE and DISTRO if those aren't already set on local.conf.sample The conf-notest.txt might issue the fact that above script(s) need to be run (once) to complete the environment setup.
The idea of our setup-environment script is to allow for easy use of the FSL Community BSP. We are wide open to trim the script down, if it keep supporting the current features and become more generic. Please feel free to send any patches you have which help us to move on this direction :-)
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750