From 75b959e5526a2d427562cfa609d700989d386a84 Mon Sep 17 00:00:00 2001 From: Alexandre Bard Date: Fri, 3 Dec 2021 17:33:18 +0100 Subject: [PATCH] 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 --- env.common | 15 ------------ env.image | 3 --- env.image-fct | 3 --- env.image-lava | 3 --- env.image-ostree | 3 --- env.image-vcu | 3 --- env/common | 24 +++++++++++++++++++ env/distro/base-image | 4 ++++ env/distro/fct-image | 4 ++++ env/distro/lava-image | 4 ++++ env.image-minimal => env/distro/minimal-image | 3 ++- env/distro/ostree-image | 4 ++++ env/distro/vcu-image | 4 ++++ .../interactive-machine-selector | 0 env/machine/hw16 | 3 +++ env/machine/hw18 | 3 +++ env/machine/hw20 | 3 +++ env/machine/hw21 | 3 +++ env/machine/hw23 | 3 +++ env/machine/hw24 | 3 +++ env/machine/hw25 | 3 +++ env/machine/hw26 | 3 +++ 22 files changed, 70 insertions(+), 31 deletions(-) delete mode 100644 env.common delete mode 100644 env.image delete mode 100644 env.image-fct delete mode 100644 env.image-lava delete mode 100644 env.image-ostree delete mode 100644 env.image-vcu create mode 100644 env/common create mode 100644 env/distro/base-image create mode 100644 env/distro/fct-image create mode 100644 env/distro/lava-image rename env.image-minimal => env/distro/minimal-image (51%) create mode 100644 env/distro/ostree-image create mode 100644 env/distro/vcu-image rename machine_select => env/interactive-machine-selector (100%) create mode 100644 env/machine/hw16 create mode 100644 env/machine/hw18 create mode 100644 env/machine/hw20 create mode 100644 env/machine/hw21 create mode 100644 env/machine/hw23 create mode 100644 env/machine/hw24 create mode 100644 env/machine/hw25 create mode 100644 env/machine/hw26 diff --git a/env.common b/env.common deleted file mode 100644 index 293a722..0000000 --- a/env.common +++ /dev/null @@ -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 diff --git a/env.image b/env.image deleted file mode 100644 index c7e8550..0000000 --- a/env.image +++ /dev/null @@ -1,3 +0,0 @@ -DISTRO="netmodule-linux" -BUILD_FOLDER_APPEND="" -. ./env.common diff --git a/env.image-fct b/env.image-fct deleted file mode 100644 index af4d431..0000000 --- a/env.image-fct +++ /dev/null @@ -1,3 +0,0 @@ -DISTRO="netmodule-linux-fct" -BUILD_FOLDER_APPEND="-fct" -. ./env.common diff --git a/env.image-lava b/env.image-lava deleted file mode 100644 index 71de9c7..0000000 --- a/env.image-lava +++ /dev/null @@ -1,3 +0,0 @@ -DISTRO="netmodule-linux-lava" -BUILD_FOLDER_APPEND="-fct" -. ./env.common diff --git a/env.image-ostree b/env.image-ostree deleted file mode 100644 index 4d99a4d..0000000 --- a/env.image-ostree +++ /dev/null @@ -1,3 +0,0 @@ -DISTRO="netmodule-linux-ostree" -BUILD_FOLDER_APPEND="" -. ./env.common diff --git a/env.image-vcu b/env.image-vcu deleted file mode 100644 index a0494d4..0000000 --- a/env.image-vcu +++ /dev/null @@ -1,3 +0,0 @@ -DISTRO="netmodule-linux-ostree-vcu" -BUILD_FOLDER_APPEND="" -. ./env.common diff --git a/env/common b/env/common new file mode 100644 index 0000000..dc2eea2 --- /dev/null +++ b/env/common @@ -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 diff --git a/env/distro/base-image b/env/distro/base-image new file mode 100644 index 0000000..e0f9d8d --- /dev/null +++ b/env/distro/base-image @@ -0,0 +1,4 @@ +DISTRO="netmodule-linux" +BUILD_FOLDER_APPEND="" +env_path=${BASH_SOURCE:-$0} +. $(dirname $env_path)/../common diff --git a/env/distro/fct-image b/env/distro/fct-image new file mode 100644 index 0000000..af75f9a --- /dev/null +++ b/env/distro/fct-image @@ -0,0 +1,4 @@ +DISTRO="netmodule-linux-fct" +BUILD_FOLDER_APPEND="-fct" +env_path=${BASH_SOURCE:-$0} +. $(dirname $env_path)/../common diff --git a/env/distro/lava-image b/env/distro/lava-image new file mode 100644 index 0000000..07cf312 --- /dev/null +++ b/env/distro/lava-image @@ -0,0 +1,4 @@ +DISTRO="netmodule-linux-lava" +BUILD_FOLDER_APPEND="-fct" +env_path=${BASH_SOURCE:-$0} +. $(dirname $env_path)/../common diff --git a/env.image-minimal b/env/distro/minimal-image similarity index 51% rename from env.image-minimal rename to env/distro/minimal-image index f46764b..c4edf9b 100644 --- a/env.image-minimal +++ b/env/distro/minimal-image @@ -1,3 +1,4 @@ DISTRO="netmodule-linux-minimal" BUILD_FOLDER_APPEND="-minimal" -. ./env.common +env_path=${BASH_SOURCE:-$0} +. $(dirname $env_path)/../common diff --git a/env/distro/ostree-image b/env/distro/ostree-image new file mode 100644 index 0000000..e67ea06 --- /dev/null +++ b/env/distro/ostree-image @@ -0,0 +1,4 @@ +DISTRO="netmodule-linux-ostree" +BUILD_FOLDER_APPEND="" +env_path=${BASH_SOURCE:-$0} +. $(dirname $env_path)/../common diff --git a/env/distro/vcu-image b/env/distro/vcu-image new file mode 100644 index 0000000..0eec2f9 --- /dev/null +++ b/env/distro/vcu-image @@ -0,0 +1,4 @@ +DISTRO="netmodule-linux-ostree-vcu" +BUILD_FOLDER_APPEND="" +env_path=${BASH_SOURCE:-$0} +. $(dirname $env_path)/../common diff --git a/machine_select b/env/interactive-machine-selector similarity index 100% rename from machine_select rename to env/interactive-machine-selector diff --git a/env/machine/hw16 b/env/machine/hw16 new file mode 100644 index 0000000..faa6e9c --- /dev/null +++ b/env/machine/hw16 @@ -0,0 +1,3 @@ +MACHINE=am335x-nrhw16 +env_path=${BASH_SOURCE:-$0} +. $(dirname $env_path)/../common diff --git a/env/machine/hw18 b/env/machine/hw18 new file mode 100644 index 0000000..7d6d48e --- /dev/null +++ b/env/machine/hw18 @@ -0,0 +1,3 @@ +MACHINE=armada-385-nrhw18 +env_path=${BASH_SOURCE:-$0} +. $(dirname $env_path)/../common diff --git a/env/machine/hw20 b/env/machine/hw20 new file mode 100644 index 0000000..0ba3a94 --- /dev/null +++ b/env/machine/hw20 @@ -0,0 +1,3 @@ +MACHINE=am335x-nrhw20 +env_path=${BASH_SOURCE:-$0} +. $(dirname $env_path)/../common diff --git a/env/machine/hw21 b/env/machine/hw21 new file mode 100644 index 0000000..4904630 --- /dev/null +++ b/env/machine/hw21 @@ -0,0 +1,3 @@ +MACHINE=am335x-nmhw21 +env_path=${BASH_SOURCE:-$0} +. $(dirname $env_path)/../common diff --git a/env/machine/hw23 b/env/machine/hw23 new file mode 100644 index 0000000..94a6cf9 --- /dev/null +++ b/env/machine/hw23 @@ -0,0 +1,3 @@ +MACHINE=imx8-nmhw23 +env_path=${BASH_SOURCE:-$0} +. $(dirname $env_path)/../common diff --git a/env/machine/hw24 b/env/machine/hw24 new file mode 100644 index 0000000..8416868 --- /dev/null +++ b/env/machine/hw24 @@ -0,0 +1,3 @@ +MACHINE=am335x-nmhw24 +env_path=${BASH_SOURCE:-$0} +. $(dirname $env_path)/../common diff --git a/env/machine/hw25 b/env/machine/hw25 new file mode 100644 index 0000000..88ed648 --- /dev/null +++ b/env/machine/hw25 @@ -0,0 +1,3 @@ +MACHINE=am335x-hw25 +env_path=${BASH_SOURCE:-$0} +. $(dirname $env_path)/../common diff --git a/env/machine/hw26 b/env/machine/hw26 new file mode 100644 index 0000000..d5ae33a --- /dev/null +++ b/env/machine/hw26 @@ -0,0 +1,3 @@ +MACHINE=am335x-hw26 +env_path=${BASH_SOURCE:-$0} +. $(dirname $env_path)/../common