Skip to content

Commit 112fd5e

Browse files
authored
Update EBcLfSA Integration (#112)
Due to the previous refactoring, a few paths and targets were wrongly named.
1 parent 036c22d commit 112fd5e

3 files changed

Lines changed: 23 additions & 24 deletions

File tree

.github/workflows/build_and_test_ebclfsa.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# SPDX-License-Identifier: Apache-2.0
1212
# *******************************************************************************
1313

14-
name: EB Corbos Linux for Safety - Build & Integration Test
14+
name: EB corbos Linux for Safety Applications - Build & Integration Test
1515

1616
on:
1717
pull_request:
@@ -53,4 +53,4 @@ jobs:
5353
with:
5454
name: test-logs
5555
path: |
56-
ebclfsa/bazel-bin/scrample_integration/*.log
56+
bazel-bin/images/ebclfsa_aarch64/scrample_integration/*.log

images/ebclfsa_aarch64/README.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ However, please understand that we cannot advise you about possible costs in you
2424
> - Copy and paste the following command into the terminal and hit "Enter":
2525
>
2626
> ```bash
27-
> cd ./ebclfsa && bazel build --config=aarch64-ebclfsa //scrample_integration:run
27+
> bazel build --config=eb-aarch64 //images/ebclfsa_aarch64/scrample_integration:run
2828
> ```
2929
>
3030
> This will build and run the example.
@@ -35,12 +35,12 @@ However, please understand that we cannot advise you about possible costs in you
3535
>
3636
> ```console
3737
> [...]
38-
> Target //scrample_integration:run up-to-date:
39-
> bazel-bin/scrample_integration/qemu_run.log
40-
> bazel-bin/scrample_integration/ssh_scrample_run.log
41-
>INFO: Elapsed time: 361.273s, Critical Path: 91.92s
42-
>INFO: 836 processes: 10 internal, 826 local.
43-
>INFO: Build completed successfully, 836 total actions
38+
> Target //images/ebclfsa_aarch64/scrample_integration:run up-to-date:
39+
> bazel-bin/images/ebclfsa_aarch64/scrample_integration/qemu_run.log
40+
> bazel-bin/images/ebclfsa_aarch64/scrample_integration/ssh_scrample_run.log
41+
> INFO: Elapsed time: 217.949s, Critical Path: 100.88s
42+
> INFO: 932 processes: 9 action cache hit, 1 internal, 931 local.
43+
> INFO: Build completed successfully, 932 total actions
4444
> ```
4545
>
4646
> The two log files mentioned in this output are the main results of the test execution.
@@ -220,16 +220,15 @@ This way `cflinit` keeps its static entrypoint for the Eclipse S-CORE example ap
220220
221221
### S-CORE Toolchain in Linux for Safety Applications
222222
223-
The demo SDK integrates the [S-CORE toolchain with two extensions](https://github.com/elektrobit-contrib/eclipse-score_toolchains_gcc/releases/tag/0.5.0-alpha):
223+
The demo SDK integrates the [S-CORE toolchain with two extensions](https://github.com/elektrobit-contrib/eclipse-score_toolchains_gcc/releases/tag/0.5.0-beta):
224224
225225
- Additional tooling for AArch64 cross-building.
226226
- Additional tool `lisa-elf-enabler`: It marks an ELF header of an application in a way that Linux for Safety Applications detects it as an HI application.
227-
The tool is available to Bazel via `@eb_toolchain_gcc//:elf-enabler`.
228227
229228
### Bazel Rules for the Example Applications
230229
231230
The example extends the [`scrample` example](https://github.com/eclipse-score/scrample) of S-CORE with the application setup and the toolchain extensions described above.
232-
With those changes, the toolchain can be used via `bazel build --config=aarch64-ebclfsa //scrample_integration:<target>`.
231+
With those changes, the toolchain can be used via `bazel build --config=eb-aarch64 //images/ebclfsa_aarch64/scrample_integration:<target>`.
233232
234233
> [!IMPORTANT]
235234
> Building inside a sandbox is currently not possible.
@@ -253,7 +252,7 @@ The following sections introduce some of the rules mentioned above.
253252
The `run` target provides an easy entry point, to build, post-process, deploy, run and stop the example:
254253
255254
```bash
256-
bazel build --config=aarch64-ebclfsa //scrample_integration:run
255+
bazel build --config=eb-aarch64 //images/ebclfsa_aarch64/scrample_integration:run
257256
```
258257
259258
This command will take a while to finish, since it performs some downloads and starts the fast-dev image.
@@ -322,7 +321,7 @@ SDK:handler_do_el0_svc_pre: syscall __NR_clone3 (435) is not allowed
322321
Building all components of the example application can be performed with the `hi_app` rule.
323322
324323
```bash
325-
bazel build --config=aarch64-ebclfsa //scrample_integration:hi_app
324+
bazel build --config=eb-aarch64 //images/ebclfsa_aarch64/scrample_integration:hi_app
326325
```
327326
328327
Due the dependencies towards `:scrample_sil` and `:scrample_sil_wrapper` this will build all required binaries.
@@ -333,16 +332,16 @@ Including the LI `scrample` binary, a temporary `scrample_sil_wrapper` binary as
333332
The easiest way to setup the fast-dev image, is to use the `fastdev-image` rule.
334333
335334
```bash
336-
bazel build --config=aarch64-ebclfsa //scrample_integration:fastdev-image
335+
bazel build --config=eb-aarch64 //images/ebclfsa_aarch64/scrample_integration:fastdev-image
337336
```
338337
339338
This will first download the image via the `fetch-fastdev-archive` rule and cache the archive.
340-
Afterwards, the `fastdev-image` rule extracts the archive (containing a disk image and a kernel) to `bazel-bin/scrample_integration/deb-qemuarm64/`.
339+
Afterwards, the `fastdev-image` rule extracts the archive (containing a disk image and a kernel) to `bazel-bin/images/ebclfsa_aarch64/scrample_integration/ebcl-qemuarm64/`.
341340
342341
To start the unmodified base image (without the Eclipse S-CORE example application) manually, the included `run_qemu.sh` script can be used.
343342
344343
```bash
345-
./scrample_integration/run_qemu.sh bazel-bin/scrample_integration/deb-qemuarm64/
344+
./images/ebclfsa_aarch64/scrample_integration/run_qemu.sh bazel-bin/images/ebclfsa_aarch64/scrample_integration/ebcl-qemuarm64/
346345
```
347346
348347
This is of course optional, and only needed if a deeper manual look into the image is wished.
@@ -357,19 +356,19 @@ ssh -p 2222 root@localhost
357356
> [!NOTE]
358357
> Be aware, that running the image via qemu, will change the stored disk image.
359358
> Bazel will detect this change and overwrite the disk image with the original one from the downloaded archive.
360-
> If it is planned to have persistent changes on the image, copy the content of `bazel-bin/scrample_integration/deb-qemuarm64/` to a location outside of `bazel-bin` and adapt the command line argument in the above `run_qemu.sh` call accordingly.
359+
> If it is planned to have persistent changes on the image, copy the content of `bazel-bin/images/ebclfsa_aarch64/scrample_integration/ebcl-qemuarm64/` to a location outside of `bazel-bin` and adapt the command line argument in the above `run_qemu.sh` call accordingly.
361360
362361
For deploying the example application to the image, the `upload` rule is available, which will start the image based on the content of `bazel-bin/scrample_integration/deb-qemuarm64/` and deploy all needed files via `scp`.
363362
364363
```bash
365-
bazel build --config=aarch64-ebclfsa //scrample_integration:upload
364+
bazel build --config=eb-aarch64 //images/ebclfsa_aarch64/scrample_integration:upload
366365
```
367366
368-
Since the deployment step will change the stored disk image, the `upload` rule stores its output in `bazel-bin/scrample_integration/deb-qemuarm64-modified/`.
367+
Since the deployment step will change the stored disk image, the `upload` rule stores its output in `bazel-bin/images/ebclfsa_aarch64/scrample_integration/ebcl-qemuarm64-modified/`.
369368
Running the image with the deployed example applications works the same way as before, just with a different folder for the used image and kernel:
370369
371370
```bash
372-
./scrample_integration/run_qemu.sh bazel-bin/scrample_integration/deb-qemuarm64-modified/
371+
./images/ebclfsa_aarch64/scrample_integration/run_qemu.sh bazel-bin/images/ebclfsa_aarch64/scrample_integration/ebcl-qemuarm64-modified/
373372
```
374373
375374
Like before you can interact with the image via the serial console or ssh.
@@ -394,5 +393,5 @@ crinit-ctl poweroff
394393
395394
* The toolchain and librares are provided for demonstration and prototyping purposes without further qualification.
396395
* A second test case for S-CORE persistency is also integrated. You can run it via
397-
`bazel build --config=aarch64-ebclfsa //persistency_integration:run`
396+
`bazel build --config=eb-aarch64 //images/ebclfsa_aarch64/persistency_integration:run`
398397
However, this is not integrated as HI application to avoid the additional complexity of the required wrapper.

images/ebclfsa_aarch64/persistency_integration/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ genrule(
3232
genrule(
3333
name = "upload",
3434
srcs = [
35-
"@score_persistency//tests/cpp_test_scenarios:cpp_test_scenarios",
35+
"@score_persistency//tests/test_scenarios/cpp:test_scenarios",
3636
":fastdev-image",
3737
"scripts/cpp_tests_persistency.sh",
3838
"run_qemu.sh",
@@ -42,7 +42,7 @@ genrule(
4242
cp $(RULEDIR)/ebcl-qemuarm64/* $(RULEDIR)/ebcl-qemuarm64-modified/ &&\
4343
$(location run_qemu.sh) $(RULEDIR)/ebcl-qemuarm64-modified -pidfile $(RULEDIR)/qemu.pid > $(RULEDIR)/qemu_upload.log &\
4444
sleep 30 ; \
45-
sshpass -p linux scp -o StrictHostKeyChecking=no -P 2222 $(location @score_persistency//tests/cpp_test_scenarios:cpp_test_scenarios) root@localhost:/usr/bin/cpp_tests_persistency &&\
45+
sshpass -p linux scp -o StrictHostKeyChecking=no -P 2222 $(location @score_persistency//tests/test_scenarios/cpp:test_scenarios) root@localhost:/usr/bin/cpp_tests_persistency &&\
4646
sshpass -p linux scp -o StrictHostKeyChecking=no -P 2222 $(location scripts/cpp_tests_persistency.sh) root@localhost:/usr/bin/cpp_tests_persistency.sh &&\
4747
sshpass -p linux ssh -o StrictHostKeyChecking=no -p 2222 root@localhost sync &&\
4848
sshpass -p linux ssh -o StrictHostKeyChecking=no -p 2222 root@localhost crinit-ctl poweroff || true \

0 commit comments

Comments
 (0)