Improve environment files

With this changes it is possible to source from anywhere a machine or
distro file.

It is also cleaning all the environment files in the main directory.

As example, to load environment for HW21 and lava image for example the
following command can be used:

. env/distro/lava-image && . ../env/machine/hw21
This commit is contained in:
Alexandre Bard 2021-12-03 17:33:18 +01:00
parent 2f3120ccca
commit 75b959e552
22 changed files with 70 additions and 31 deletions

View File

@ -1,15 +0,0 @@
if [ -z "$DISTRO" ]; then
echo "No distro selected. Please source a helper script (env.*)"
fi
if [ -z "$MACHINE" ]; then
. ./machine_select
fi
echo Building for machine $MACHINE, distro: $DISTRO
export DISTRO
export MACHINE
export OSTREE_OSNAME=nm-linux
. ./openembedded-core/oe-init-build-env build$BUILD_FOLDER_APPEND

View File

@ -1,3 +0,0 @@
DISTRO="netmodule-linux"
BUILD_FOLDER_APPEND=""
. ./env.common

View File

@ -1,3 +0,0 @@
DISTRO="netmodule-linux-fct"
BUILD_FOLDER_APPEND="-fct"
. ./env.common

View File

@ -1,3 +0,0 @@
DISTRO="netmodule-linux-lava"
BUILD_FOLDER_APPEND="-fct"
. ./env.common

View File

@ -1,3 +0,0 @@
DISTRO="netmodule-linux-ostree"
BUILD_FOLDER_APPEND=""
. ./env.common

View File

@ -1,3 +0,0 @@
DISTRO="netmodule-linux-ostree-vcu"
BUILD_FOLDER_APPEND=""
. ./env.common

24
env/common vendored Normal file
View File

@ -0,0 +1,24 @@
if [ -z "$DISTRO" ]; then
echo "No distro selected. Please source a helper script (env/distro/*)"
return
fi
if [ -z "$MACHINE" ]; then
echo "No machine selected. Please source a helper script (env/machine/*)"
return
fi
echo
echo Build parameters:
printf "\tMACHINE = $MACHINE\n"
printf "\tDISTRO = $DISTRO\n"
echo
export DISTRO
export MACHINE
export OSTREE_OSNAME=nm-linux
# Moving back to top yocto directory (env/..)
env_path=${BASH_SOURCE:-$0}
cd $(dirname $env_path)/..
source openembedded-core/oe-init-build-env build$BUILD_FOLDER_APPEND

4
env/distro/base-image vendored Normal file
View File

@ -0,0 +1,4 @@
DISTRO="netmodule-linux"
BUILD_FOLDER_APPEND=""
env_path=${BASH_SOURCE:-$0}
. $(dirname $env_path)/../common

4
env/distro/fct-image vendored Normal file
View File

@ -0,0 +1,4 @@
DISTRO="netmodule-linux-fct"
BUILD_FOLDER_APPEND="-fct"
env_path=${BASH_SOURCE:-$0}
. $(dirname $env_path)/../common

4
env/distro/lava-image vendored Normal file
View File

@ -0,0 +1,4 @@
DISTRO="netmodule-linux-lava"
BUILD_FOLDER_APPEND="-fct"
env_path=${BASH_SOURCE:-$0}
. $(dirname $env_path)/../common

View File

@ -1,3 +1,4 @@
DISTRO="netmodule-linux-minimal" DISTRO="netmodule-linux-minimal"
BUILD_FOLDER_APPEND="-minimal" BUILD_FOLDER_APPEND="-minimal"
. ./env.common env_path=${BASH_SOURCE:-$0}
. $(dirname $env_path)/../common

4
env/distro/ostree-image vendored Normal file
View File

@ -0,0 +1,4 @@
DISTRO="netmodule-linux-ostree"
BUILD_FOLDER_APPEND=""
env_path=${BASH_SOURCE:-$0}
. $(dirname $env_path)/../common

4
env/distro/vcu-image vendored Normal file
View File

@ -0,0 +1,4 @@
DISTRO="netmodule-linux-ostree-vcu"
BUILD_FOLDER_APPEND=""
env_path=${BASH_SOURCE:-$0}
. $(dirname $env_path)/../common

3
env/machine/hw16 vendored Normal file
View File

@ -0,0 +1,3 @@
MACHINE=am335x-nrhw16
env_path=${BASH_SOURCE:-$0}
. $(dirname $env_path)/../common

3
env/machine/hw18 vendored Normal file
View File

@ -0,0 +1,3 @@
MACHINE=armada-385-nrhw18
env_path=${BASH_SOURCE:-$0}
. $(dirname $env_path)/../common

3
env/machine/hw20 vendored Normal file
View File

@ -0,0 +1,3 @@
MACHINE=am335x-nrhw20
env_path=${BASH_SOURCE:-$0}
. $(dirname $env_path)/../common

3
env/machine/hw21 vendored Normal file
View File

@ -0,0 +1,3 @@
MACHINE=am335x-nmhw21
env_path=${BASH_SOURCE:-$0}
. $(dirname $env_path)/../common

3
env/machine/hw23 vendored Normal file
View File

@ -0,0 +1,3 @@
MACHINE=imx8-nmhw23
env_path=${BASH_SOURCE:-$0}
. $(dirname $env_path)/../common

3
env/machine/hw24 vendored Normal file
View File

@ -0,0 +1,3 @@
MACHINE=am335x-nmhw24
env_path=${BASH_SOURCE:-$0}
. $(dirname $env_path)/../common

3
env/machine/hw25 vendored Normal file
View File

@ -0,0 +1,3 @@
MACHINE=am335x-hw25
env_path=${BASH_SOURCE:-$0}
. $(dirname $env_path)/../common

3
env/machine/hw26 vendored Normal file
View File

@ -0,0 +1,3 @@
MACHINE=am335x-hw26
env_path=${BASH_SOURCE:-$0}
. $(dirname $env_path)/../common