Skip to content
Snippets Groups Projects
Commit 46583de7 authored by Nicola Sparnacci's avatar Nicola Sparnacci
Browse files

[FIX] Adapt to seco-build-configurator


Adapt the tool to the seco-build-configurator modified features such as:
- new Yconfig syntax
- new custom layer placement (into meta-seco)

Update the usage guidelines.

Signed-off-by: default avatarNicola Sparnacci <nicola.sparnacci@seco.com>
parent 0dab9317
No related branches found
No related tags found
1 merge request!4[FIX] Adapt to seco-build-configurator
......@@ -83,7 +83,7 @@ Keep in mind that `setup.py` is mainly used for packaging and distributing Pytho
# Script usage
This script requires 3 arguments to work properly:
- custom layer's git URL.
- custom layer's git URL. NOTE: the tool will clone the repository with its own name. To avoid compiatibility issues, it's recommended to name the repository as `meta-seco-XXX` where `XXX` is the custom name.
- custom manifest's git URL.
- local CSV file containing the metadata related to the custom layer.
......@@ -110,7 +110,7 @@ The first column holds the name of the strings that will be replaced in the temp
| Variable | Description |
| - | - |
| CUSTOM_PY | Name of the customer |
| MASTER_BRANCH_PY | Branch of the manifest, e.g. `kirkstone` |
| MASTER_BRANCH_PY | Branch of the manifest, e.g. `scarthgap` |
| MANIFEST_PROJECT_ID_PY | Project ID of the repository that can be found in GitLab |
| MACHINES_PY | Name of the custom machine (used in the SW artifacts naming) |
| PROCESSOR_PY | Name of the processor for the custom board, e.g. `rk3568` |
......@@ -152,7 +152,7 @@ Let's say the new customer `example` needs a new layer based on C57 iMX8QXP with
```
Variable, Value
CUSTOM_PY, example
MASTER_BRANCH_PY, kirkstone
MASTER_BRANCH_PY, scarthgap
MANIFEST_PROJECT_ID_PY, 1234
MACHINES_PY, c57
PROCESSOR_PY, imx8qxp
......@@ -165,25 +165,25 @@ KERNEL_FILE_PY, Image
UBOOT_FILE_PY, imx-boot
```
Now, create the new empty repositories in GitLab, for example:
- `https://git.seco.com/nicola.sparnacci/meta-layer-add.git`
- `https://git.seco.com/nicola.sparnacci/manifest-add.git`
- `https://git.seco.com/nicola.sparnacci/meta-seco-example.git`
- `https://git.seco.com/nicola.sparnacci/manifest-example.git`
New repositories must be initialized, so push a commit on each one (e.g. push the `README.md`)
Finally run the script:
```
~ python3 layer_manager.py --layer-git https://git.seco.com/nicola.sparnacci/meta-layer-add.git \
--manifest-git https://git.seco.com/nicola.sparnacci/manifest-add.git \
~ python3 layer_manager.py --layer-git https://git.seco.com/nicola.sparnacci/meta-seco-example.git \
--manifest-git https://git.seco.com/nicola.sparnacci/manifest-example.git \
--csv /home/nicolaspa/Documents/Seco/Edgehog/test/layer-manager-dev-env/seco-layer-manager/layer-manager/layer-metadata-example.csv \
--layer-branch main \
--manifest-branch main \
--force
Layer git: https://git.seco.com/nicola.sparnacci/meta-layer-add.git
Manifest git: https://git.seco.com/nicola.sparnacci/manifest-add.git
Layer git: https://git.seco.com/nicola.sparnacci/meta-seco-example.git
Manifest git: https://git.seco.com/nicola.sparnacci/manifest-example.git
Metadata CSV path: seco-layer-manager/layer-manager/layer-metadata-example.csv
Set variable: CUSTOM_PY=example
Set variable: MASTER_BRANCH_PY=kirkstone
Set variable: MASTER_BRANCH_PY=scarthgap
Set variable: MANIFEST_PROJECT_ID_PY=1234
Set variable: MACHINES_PY=c57
Set variable: PROCESSOR_PY=imx8qxp
......@@ -196,7 +196,7 @@ Set variable: KERNEL_FILE_PY=Image
Set variable: UBOOT_FILE_PY=imx-boot
All expected variables are present in the CSV file.
Output directory already exists. Overwriting it.
Clone of https://git.seco.com/nicola.sparnacci/meta-layer-add.git completed.
Clone of https://git.seco.com/nicola.sparnacci/meta-seco-example.git completed.
Submodule https://git.seco.com/edgehog/infrastructure/gitlab-ci/ added as .gitlab-ci
Strings replaced successfully in file: .gitlab-ci.yml
Strings replaced successfully in file: conf/Yconfig/Yconfig_machine
......@@ -208,21 +208,21 @@ Strings replaced successfully in file: conf/configs/seco_example_c57_edgehog_emb
Strings replaced successfully in file: conf/machine/seco-example-imx8qxp-c57.conf
Strings replaced successfully in file: conf/Yconfig/Yconfig_machine
Strings replaced successfully in all files
Clone of https://git.seco.com/nicola.sparnacci/manifest-add.git completed.
Clone of https://git.seco.com/nicola.sparnacci/manifest-example.git completed.
Submodule https://git.seco.com/edgehog/infrastructure/gitlab-ci/ added as .gitlab-ci
Submodule https://git.seco.com/edgehog/seco-manifest.git added as main
Strings replaced successfully in file: .gitlab-ci.yml
Strings replaced successfully in file: default.xml
Manifest and layer are now populated:
- Manifest: /home/nicolaspa/Documents/Seco/Edgehog/test/layer-manager-dev-env/seco-layer-manager/layer-manager/output/manifest-add
- Layer: /home/nicolaspa/Documents/Seco/Edgehog/test/layer-manager-dev-env/seco-layer-manager/layer-manager/output/meta-layer-add
- Manifest: /home/nicolaspa/Documents/Seco/Edgehog/test/layer-manager-dev-env/seco-layer-manager/layer-manager/output/manifest-example
- Layer: /home/nicolaspa/Documents/Seco/Edgehog/test/layer-manager-dev-env/seco-layer-manager/layer-manager/output/meta-seco-example
Please carefully check the result before committing.
```
In the same folder of the script there will be a directory called `output` with the two processed repositories:
- layer with the structure:
```
meta-layer-add
meta-seco-example
├── conf
│ ├── bblayers.conf
│ ├── configs
......@@ -241,7 +241,7 @@ In the same folder of the script there will be a directory called `output` with
- manifest with the structure:
```
manifest-add
manifest-example
├── base -> main/base
├── default.xml
├── distro -> main/distro
......@@ -254,4 +254,13 @@ In the same folder of the script there will be a directory called `output` with
│ └── SRCREV.conf
├── README.md
└── soc -> main/soc
```
\ No newline at end of file
```
To include the new layer in Seco's Yocto project:
- Copy the layer into the folder `layers/meta-seco/`.
- Create the symbolic link `custom_layer` in the `workdir` with:
```bash
$ cd workdir
$ ln -s layers/meta-seco/meta-seco-example/custom_layer custom_layer
```
- Configure all the files in the layer.
\ No newline at end of file
......@@ -224,7 +224,7 @@ def main(args):
# Replace marked strings with the one related to the custom project
replace_strings_in_file(const.GITLAB_CI_YML, replacements)
replace_strings_in_directory(const.CONF + "/Yconfig", replacements_uppercase)
replace_strings_in_directory(const.CONF + "/Yconfig", replacements)
replace_strings_in_directory(const.CONF, replacements)
os.chdir(out_dir)
......
......@@ -68,9 +68,9 @@ Let's briefly describe each file:
2. **bblayers.conf**: The `bblayers.conf` file is a configuration file used in Yocto Project to specify the layers to be included in the build. Its purpose is to define the layers that BitBake, the build tool used in Yocto, should scan for recipes and configuration files during the build process. It specifies the paths to the directories containing Yocto layers (meta-layers). BitBake scans these directories to find recipes, configuration files, and other metadata needed for the build. The layers to include should be added as follow in the example:
```
BBLAYERS += "\
${BSPDIR}/layers/meta-seco-XXX \
${BSPDIR}/layers/meta-layer-one \
${BSPDIR}/layers/meta-layer-two \
${BSPDIR}/layers/meta-seco/meta-seco-XXX \
${BSPDIR}/layers/meta-seco/meta-layer-one \
${BSPDIR}/layers/meta-seco/meta-layer-two \
"
```
where the paths of the directories containing the layers to be included in the build are separated with a trailing space.
......
config MACHINE_SECO_${CUSTOM_PY}_${PROCESSOR_PY}_${MACHINES_PY}
config MACH_MACHINE_seco-${CUSTOM_PY}-${PROCESSOR_PY}-${MACHINES_PY}
bool "${CUSTOM_PY} system - codename ${MACHINES_PY}"
select <ARCH_SPECIFIC>
depends on ARCHITECTURE_<ARCH_GENERIC>
depends on ARCH_ARCHITECTURE_<ARCH_GENERIC>
help
Custom board based on ${PROCESSOR_PY} SoC
Custom board based on ${PROCESSOR_PY} SoC. See seco-build-configurator
README.md for the correct syntax more information.
# Custom layer for ${CUSTOM_PY}
BBLAYERS += "\
${BSPDIR}/layers/meta-seco-${CUSTOM_PY} \
${BSPDIR}/layers/meta-seco/meta-seco-${CUSTOM_PY} \
"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment