shrinkwrap-tool 2026.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- shrinkwrap/__init__.py +1 -0
- shrinkwrap/__main__.py +4 -0
- shrinkwrap/commands/__init__.py +0 -0
- shrinkwrap/commands/build.py +91 -0
- shrinkwrap/commands/buildall.py +180 -0
- shrinkwrap/commands/clean.py +161 -0
- shrinkwrap/commands/inspect.py +235 -0
- shrinkwrap/commands/process.py +106 -0
- shrinkwrap/commands/run.py +311 -0
- shrinkwrap/config/FVP_Base_RevC-2xAEMvA-base.yaml +98 -0
- shrinkwrap/config/FVP_Base_RevC-2xAEMvA-rme.yaml +42 -0
- shrinkwrap/config/arch/v8.0.yaml +22 -0
- shrinkwrap/config/arch/v8.1.yaml +26 -0
- shrinkwrap/config/arch/v8.2.yaml +28 -0
- shrinkwrap/config/arch/v8.3.yaml +25 -0
- shrinkwrap/config/arch/v8.4.yaml +26 -0
- shrinkwrap/config/arch/v8.5.yaml +29 -0
- shrinkwrap/config/arch/v8.6.yaml +28 -0
- shrinkwrap/config/arch/v8.7.yaml +24 -0
- shrinkwrap/config/arch/v8.8.yaml +31 -0
- shrinkwrap/config/arch/v8.9.yaml +32 -0
- shrinkwrap/config/arch/v9.0.yaml +29 -0
- shrinkwrap/config/arch/v9.1.yaml +25 -0
- shrinkwrap/config/arch/v9.2.yaml +29 -0
- shrinkwrap/config/arch/v9.3.yaml +23 -0
- shrinkwrap/config/arch/v9.4.yaml +21 -0
- shrinkwrap/config/arch/v9.5.yaml +20 -0
- shrinkwrap/config/bootwrapper.yaml +76 -0
- shrinkwrap/config/buildroot-cca.yaml +113 -0
- shrinkwrap/config/buildroot.yaml +54 -0
- shrinkwrap/config/cca-3world.yaml +215 -0
- shrinkwrap/config/cca-4world.yaml +57 -0
- shrinkwrap/config/cca-edk2.yaml +58 -0
- shrinkwrap/config/debug/rmm.yaml +15 -0
- shrinkwrap/config/debug/tfa.yaml +18 -0
- shrinkwrap/config/debug/tftf.yaml +17 -0
- shrinkwrap/config/dt-base.yaml +115 -0
- shrinkwrap/config/edk2-base.yaml +59 -0
- shrinkwrap/config/ffa-hafnium-optee.yaml +45 -0
- shrinkwrap/config/ffa-optee.yaml +30 -0
- shrinkwrap/config/ffa-tftf.yaml +26 -0
- shrinkwrap/config/hafnium-base.yaml +51 -0
- shrinkwrap/config/kvm-unit-tests.yaml +32 -0
- shrinkwrap/config/kvmtool-base.yaml +33 -0
- shrinkwrap/config/linux-base.yaml +80 -0
- shrinkwrap/config/ns-edk2-base.yaml +83 -0
- shrinkwrap/config/ns-edk2-optee.yaml +41 -0
- shrinkwrap/config/ns-edk2.yaml +49 -0
- shrinkwrap/config/ns-preload.yaml +98 -0
- shrinkwrap/config/optee-base.yaml +37 -0
- shrinkwrap/config/rfa-base.yaml +49 -0
- shrinkwrap/config/rfa.yaml +47 -0
- shrinkwrap/config/rmm-base.yaml +24 -0
- shrinkwrap/config/rust.yaml +31 -0
- shrinkwrap/config/test/cca.yaml +47 -0
- shrinkwrap/config/tfa-base.yaml +45 -0
- shrinkwrap/config/tfa-rme.yaml +36 -0
- shrinkwrap/config/tftf-base.yaml +32 -0
- shrinkwrap/shrinkwrap_main.py +133 -0
- shrinkwrap/utils/__init__.py +0 -0
- shrinkwrap/utils/clivars.py +16 -0
- shrinkwrap/utils/config.py +1166 -0
- shrinkwrap/utils/graph.py +263 -0
- shrinkwrap/utils/label.py +153 -0
- shrinkwrap/utils/logger.py +160 -0
- shrinkwrap/utils/process.py +230 -0
- shrinkwrap/utils/runtime.py +192 -0
- shrinkwrap/utils/ssh_agent.py +98 -0
- shrinkwrap/utils/tty.py +46 -0
- shrinkwrap/utils/vars.py +14 -0
- shrinkwrap/utils/workspace.py +59 -0
- shrinkwrap_tool-2026.2.1.dist-info/METADATA +63 -0
- shrinkwrap_tool-2026.2.1.dist-info/RECORD +77 -0
- shrinkwrap_tool-2026.2.1.dist-info/WHEEL +5 -0
- shrinkwrap_tool-2026.2.1.dist-info/entry_points.txt +2 -0
- shrinkwrap_tool-2026.2.1.dist-info/licenses/license.rst +41 -0
- shrinkwrap_tool-2026.2.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# Copyright (c) 2022, Arm Limited.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
%YAML 1.2
|
|
5
|
+
---
|
|
6
|
+
description: >-
|
|
7
|
+
Brings together a software stack to demonstrate Arm CCA running on FVP in a
|
|
8
|
+
three-world configuration. Includes TF-A in root world, RMM in realm world,
|
|
9
|
+
and EDK2 and Linux in Normal world on the host. Guests can be launched
|
|
10
|
+
in-realm in a number of configurations using kvmtool. EDK2 can be optionally
|
|
11
|
+
used as guest FW.
|
|
12
|
+
|
|
13
|
+
If the user provides an ext2/4 filesystem image via the GUEST_ROOTFS btvar, a
|
|
14
|
+
guest disk image is created that includes a FAT16 partition containing the
|
|
15
|
+
guest kernel (to be loaded by the guest EDK2 FW), and the provided filesystem
|
|
16
|
+
as the rootfs. The user can provide their own filesystem image, or
|
|
17
|
+
alternatively use a simple buildroot image created with buildroot.yaml:
|
|
18
|
+
|
|
19
|
+
.. code-block:: shell
|
|
20
|
+
$ shrinkwrap build cca-3world.yaml --overlay buildroot.yaml --btvar GUEST_ROOTFS='${artifact:BUILDROOT}'
|
|
21
|
+
|
|
22
|
+
The user can also control the guest kernel command line parameters used on
|
|
23
|
+
the guest disk image via the GUEST_CMDLINE btvar.
|
|
24
|
+
|
|
25
|
+
Once built, the user must get some of the generated artifacts into the FVP
|
|
26
|
+
environment. This can either be done by copying them to the host's rootfs or
|
|
27
|
+
by sharing them into the FVP using 9p.
|
|
28
|
+
|
|
29
|
+
For the time being, there is an issue in the linux kernel's handling of 9p
|
|
30
|
+
which does not share correctly the guest image to the guest EFI, preventing
|
|
31
|
+
the guest to boot. Copying the artifacts into the host's rootfs is the way to
|
|
32
|
+
go. Something like the following example should work. For simplicity, this
|
|
33
|
+
example reuses the guest filesystem generated with buildroot as the host's
|
|
34
|
+
rootfs, after resizing it so that there is room for the guest's rootfs:
|
|
35
|
+
|
|
36
|
+
.. code-block:: shell
|
|
37
|
+
$ cd ~/.shrinkwrap/package/cca-3world
|
|
38
|
+
$ TOOLS_PATH=~/.shrinkwrap/build/build/cca-3world/buildroot/host/sbin
|
|
39
|
+
$ $TOOLS_PATH/e2fsck -fp rootfs.ext2
|
|
40
|
+
$ $TOOLS_PATH/resize2fs rootfs.ext2 256M
|
|
41
|
+
$ sudo su
|
|
42
|
+
# mkdir mnt
|
|
43
|
+
# mount rootfs.ext2 mnt
|
|
44
|
+
# mkdir mnt/cca
|
|
45
|
+
# cp guest-disk.img KVMTOOL_EFI.fd lkvm mnt/cca/.
|
|
46
|
+
# umount mnt
|
|
47
|
+
# rm -rf mnt
|
|
48
|
+
# exit
|
|
49
|
+
|
|
50
|
+
Now you can boot the host, using the rootfs we just modified, either using DT:
|
|
51
|
+
|
|
52
|
+
.. code-block:: shell
|
|
53
|
+
$ shrinkwrap run cca-3world.yaml --rtvar ROOTFS=rootfs.ext2
|
|
54
|
+
|
|
55
|
+
Or alternatively, using ACPI:
|
|
56
|
+
|
|
57
|
+
.. code-block:: shell
|
|
58
|
+
$ shrinkwrap run cca-3world.yaml -r ROOTFS=rootfs.ext2 --rtvar CMDLINE="mem=1G earlycon root=/dev/vda ip=dhcp acpi=force"
|
|
59
|
+
|
|
60
|
+
Finally, once the host has booted, log in as "root" (no password), and launch
|
|
61
|
+
a realm using kvmtool from the /cca directory (that was created above):
|
|
62
|
+
|
|
63
|
+
.. code-block:: shell
|
|
64
|
+
# cd /cca
|
|
65
|
+
# ./lkvm run --realm --disable-sve --irqchip=gicv3-its --firmware KVMTOOL_EFI.fd -c 1 -m 512 --no-pvtime --force-pci --disk guest-disk.img --measurement-algo=sha256 --restricted_mem
|
|
66
|
+
|
|
67
|
+
Be patient while this boots to the UEFI shell. Navigate to "Boot Manager",
|
|
68
|
+
then "UEFI Shell" and wait for the startup.nsh script to execute, which will
|
|
69
|
+
launch the kernel. Continue to be patient, and eventually you will land at a
|
|
70
|
+
login prompt. Login as "root" (no password).
|
|
71
|
+
|
|
72
|
+
When the linux kernel 9p issue will be fixed, the shared directory approach
|
|
73
|
+
can be used. Simply boot the host with the SHARE rtvar. This only works for
|
|
74
|
+
DT-based environments though:
|
|
75
|
+
|
|
76
|
+
.. code-block:: shell
|
|
77
|
+
$ cd ~/.shrinkwrap/package/cca-3world
|
|
78
|
+
$ shrinkwrap run cca-3world.yaml --rtvar ROOTFS=rootfs.ext2 --rtvar SHARE=.
|
|
79
|
+
|
|
80
|
+
Then, once the host has booted, log in as "root" (no password) and mount the
|
|
81
|
+
shared folder to "/cca" and change dir to it. The realm guest can then be
|
|
82
|
+
launched as previously:
|
|
83
|
+
|
|
84
|
+
.. code-block:: shell
|
|
85
|
+
# mkdir /cca
|
|
86
|
+
# mount -t 9p -o trans=virtio,version=9p2000.L FM /cca
|
|
87
|
+
# cd /cca
|
|
88
|
+
# ./lkvm run --realm --disable-sve --irqchip=gicv3-its --firmware KVMTOOL_EFI.fd -c 1 -m 512 --no-pvtime --force-pci --disk guest-disk.img --measurement-algo=sha256 --restricted_mem
|
|
89
|
+
|
|
90
|
+
It is also possible to launch Linux without using EDK2 as the guest FW:
|
|
91
|
+
|
|
92
|
+
.. code-block:: shell
|
|
93
|
+
# ./lkvm run --realm --disable-sve --irqchip=gicv3-its -c 1 -m 512 --no-pvtime --force-pci --console virtio --kernel Image --disk guest-disk.img -p "console=hvc0 root=/dev/vda2" --measurement-algo=sha256 --restricted_mem
|
|
94
|
+
|
|
95
|
+
This config also builds kvm-unit-tests, which can be run in the realm instead
|
|
96
|
+
of Linux:
|
|
97
|
+
|
|
98
|
+
.. code-block:: shell
|
|
99
|
+
# cd /cca/kvm-unit-tests/arm
|
|
100
|
+
# export PATH=/cca:$PATH
|
|
101
|
+
# ./run-realm-tests
|
|
102
|
+
|
|
103
|
+
concrete: true
|
|
104
|
+
|
|
105
|
+
layers:
|
|
106
|
+
- cca-edk2.yaml
|
|
107
|
+
- linux-base.yaml
|
|
108
|
+
- kvmtool-base.yaml
|
|
109
|
+
- kvm-unit-tests.yaml
|
|
110
|
+
|
|
111
|
+
build:
|
|
112
|
+
linux:
|
|
113
|
+
repo:
|
|
114
|
+
remote: https://git.gitlab.arm.com/linux-arm/linux-cca.git
|
|
115
|
+
revision: cca-host/v8
|
|
116
|
+
prebuild:
|
|
117
|
+
# Use source dir modification time as timestamp (for locally reproducible build)
|
|
118
|
+
- export KBUILD_BUILD_TIMESTAMP="@$$(stat -c '%Y' ${param:sourcedir})"
|
|
119
|
+
- ./scripts/config --file ${param:builddir}/.config --enable CONFIG_VIRT_DRIVERS --enable CONFIG_ARM_CCA_GUEST
|
|
120
|
+
# Reduce the number of timer exits from the guest
|
|
121
|
+
- ./scripts/config --file ${param:builddir}/.config --disable CONFIG_HZ_250 --enable CONFIG_HZ_100
|
|
122
|
+
|
|
123
|
+
kvmtool:
|
|
124
|
+
repo:
|
|
125
|
+
dtc:
|
|
126
|
+
revision: v1.6.1
|
|
127
|
+
kvmtool:
|
|
128
|
+
remote: https://gitlab.arm.com/linux-arm/kvmtool-cca
|
|
129
|
+
revision: cca/v6
|
|
130
|
+
|
|
131
|
+
edk2-cca-guest:
|
|
132
|
+
repo:
|
|
133
|
+
edk2:
|
|
134
|
+
remote: https://git.gitlab.arm.com/linux-arm/edk2-cca.git
|
|
135
|
+
revision: 3223_arm_cca_v4
|
|
136
|
+
|
|
137
|
+
toolchain: aarch64-none-elf-
|
|
138
|
+
|
|
139
|
+
stderrfilt: true
|
|
140
|
+
|
|
141
|
+
prebuild:
|
|
142
|
+
- export WORKSPACE=${param:sourcedir}
|
|
143
|
+
- export GCC5_AARCH64_PREFIX=$$CROSS_COMPILE
|
|
144
|
+
- export PACKAGES_PATH=$$WORKSPACE/edk2
|
|
145
|
+
- export IASL_PREFIX=${artifact:ACPICA}/
|
|
146
|
+
- export PYTHON_COMMAND=/usr/bin/python3
|
|
147
|
+
|
|
148
|
+
params:
|
|
149
|
+
-a: AARCH64
|
|
150
|
+
-t: GCC5
|
|
151
|
+
-p: edk2/ArmVirtPkg/ArmVirtKvmTool.dsc
|
|
152
|
+
-b: RELEASE
|
|
153
|
+
--pcd: PcdShellDefaultDelay=0
|
|
154
|
+
' --pcd': PcdPlatformBootTimeOut=0
|
|
155
|
+
' --pcd': PcdUefiShellDefaultBootEnable=1
|
|
156
|
+
|
|
157
|
+
build:
|
|
158
|
+
- source edk2/edksetup.sh --reconfig
|
|
159
|
+
- make -j${param:jobs} -C edk2/BaseTools
|
|
160
|
+
- build -n ${param:jobs} -D EDK2_OUT_DIR=${param:builddir} ${param:join_space}
|
|
161
|
+
|
|
162
|
+
artifacts:
|
|
163
|
+
EDK2_CCA_GUEST: ${param:builddir}/RELEASE_GCC5/FV/KVMTOOL_EFI.fd
|
|
164
|
+
|
|
165
|
+
guest-disk:
|
|
166
|
+
build:
|
|
167
|
+
- BOOTIMG="${param:builddir}/boot.img"
|
|
168
|
+
- ROOTIMG="${btvar:GUEST_ROOTFS}"
|
|
169
|
+
- DISKIMG="${param:builddir}/guest-disk.img"
|
|
170
|
+
- STARTUP="${param:builddir}/startup.nsh"
|
|
171
|
+
|
|
172
|
+
# Automatically boot the kernel when starting the EFI shell.
|
|
173
|
+
- echo "bootaa64.efi ${btvar:GUEST_CMDLINE}" > $${STARTUP}
|
|
174
|
+
|
|
175
|
+
# 64MB fat16 boot partition containing kernel as efi bootloader.
|
|
176
|
+
- dd if=/dev/zero of=$${BOOTIMG} bs=1M count=64 status=none
|
|
177
|
+
- mkfs.vfat -F16 -n boot $${BOOTIMG} &> /dev/null
|
|
178
|
+
- mcopy -spm -i $${BOOTIMG} ${artifact:KERNEL} ::bootaa64.efi
|
|
179
|
+
- mcopy -spm -i $${BOOTIMG} $${STARTUP} ::startup.nsh
|
|
180
|
+
|
|
181
|
+
# If no rootfs was provided, create an empty one to use.
|
|
182
|
+
- if [ -z "$${ROOTIMG}" ]; then
|
|
183
|
+
- ROOTIMG="${param:builddir}/root.img"
|
|
184
|
+
- dd if=/dev/zero of=$${ROOTIMG} bs=1M count=64 status=none
|
|
185
|
+
- mkfs.ext4 $${ROOTIMG} &> /dev/null
|
|
186
|
+
- fi
|
|
187
|
+
|
|
188
|
+
# Disk image with 1MB start and end blocks for GPT, sandwiching the boot
|
|
189
|
+
# partition and the rootfs.
|
|
190
|
+
- dd if=/dev/zero bs=512 count=2048 status=none > $${DISKIMG}
|
|
191
|
+
- dd if=$${BOOTIMG} status=none >> $${DISKIMG}
|
|
192
|
+
- dd if=$${ROOTIMG} status=none >> $${DISKIMG}
|
|
193
|
+
- dd if=/dev/zero bs=512 count=2048 status=none >> $${DISKIMG}
|
|
194
|
+
|
|
195
|
+
# Add the partition table.
|
|
196
|
+
- parted $${DISKIMG} mktable gpt mkpart boot fat16 1MiB 65MiB mkpart root ext4 65MiB 100% &> /dev/null
|
|
197
|
+
|
|
198
|
+
artifacts:
|
|
199
|
+
GUEST_DISK: ${param:builddir}/guest-disk.img
|
|
200
|
+
|
|
201
|
+
buildex:
|
|
202
|
+
btvars:
|
|
203
|
+
GUEST_ROOTFS:
|
|
204
|
+
type: path
|
|
205
|
+
value: ''
|
|
206
|
+
|
|
207
|
+
GUEST_CMDLINE:
|
|
208
|
+
type: string
|
|
209
|
+
value: root=/dev/vda2 acpi=force ip=on
|
|
210
|
+
|
|
211
|
+
run:
|
|
212
|
+
rtvars:
|
|
213
|
+
KERNEL:
|
|
214
|
+
value: ${artifact:KERNEL}
|
|
215
|
+
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Copyright (c) 2022, Arm Limited.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
%YAML 1.2
|
|
5
|
+
---
|
|
6
|
+
description: >-
|
|
7
|
+
Builds on cca-3world.yaml, and adds support for running Hafnium along with some
|
|
8
|
+
secure partitions in Secure World.
|
|
9
|
+
Build with:
|
|
10
|
+
|
|
11
|
+
.. code-block:: shell
|
|
12
|
+
$ shrinkwrap build cca-4world.yaml --overlay buildroot.yaml --btvar GUEST_ROOTFS='${artifact:BUILDROOT}'
|
|
13
|
+
|
|
14
|
+
Then run the model with:
|
|
15
|
+
|
|
16
|
+
.. code-block:: shell
|
|
17
|
+
$ cd ~/.shrinkwrap/package/cca-4world
|
|
18
|
+
$ shrinkwrap run cca-4world.yaml --rtvar ROOTFS=rootfs.ext2 --rtvar SHARE=.
|
|
19
|
+
|
|
20
|
+
Once the host has booted, log in as "root" (no password).
|
|
21
|
+
|
|
22
|
+
Secure partitions can be enumerated by:
|
|
23
|
+
|
|
24
|
+
.. code-block:: shell
|
|
25
|
+
# cat /sys/devices/arm-ffa-*/uuid
|
|
26
|
+
b4b5671e-4a90-4fe1-b81f-fb13dae1dacb
|
|
27
|
+
d1582309-f023-47b9-827c-4464f5578fc8
|
|
28
|
+
79b55c73-1d8c-44b9-8593-61e1770ad8d2
|
|
29
|
+
eaba83d8-baaf-4eaf-8144-f7fdcbe544a7
|
|
30
|
+
|
|
31
|
+
See cca-3worlds.yaml config :ref:`userguide/configstore/cca-3world:description`
|
|
32
|
+
if willing to launch a realm using kvmtool.
|
|
33
|
+
|
|
34
|
+
concrete: true
|
|
35
|
+
|
|
36
|
+
layers:
|
|
37
|
+
- cca-3world.yaml
|
|
38
|
+
- hafnium-base.yaml
|
|
39
|
+
# Provides secure partitions that run under Hafnium for demonstration.
|
|
40
|
+
- tftf-base.yaml
|
|
41
|
+
|
|
42
|
+
build:
|
|
43
|
+
tfa:
|
|
44
|
+
params:
|
|
45
|
+
SPD: spmd
|
|
46
|
+
SPMD_SPM_AT_SEL2: 1
|
|
47
|
+
SP_LAYOUT_FILE: ${artifact:SP_LAYOUT}
|
|
48
|
+
BL32: ${artifact:HAFNIUM}
|
|
49
|
+
|
|
50
|
+
linux:
|
|
51
|
+
prebuild:
|
|
52
|
+
- ./scripts/config --file ${param:builddir}/.config --enable CONFIG_ARM_FFA_TRANSPORT
|
|
53
|
+
|
|
54
|
+
run:
|
|
55
|
+
terminals:
|
|
56
|
+
bp.terminal_2:
|
|
57
|
+
friendly: hafnium
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Copyright (c) 2024, Arm Limited.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
%YAML 1.2
|
|
5
|
+
---
|
|
6
|
+
description: >-
|
|
7
|
+
Brings together TF-A, TF-RMM and EDK2 to provide a 3 world environment running
|
|
8
|
+
on FVP. In this config TF-A is in Root World, TF-RMM is in Realm EL2 and EDK2
|
|
9
|
+
and Linux form the non-secure EL2. Allows easy specification of the kernel
|
|
10
|
+
image and command line, and rootfs at runtime (see rtvars). ACPI is provided
|
|
11
|
+
by UEFI. DT is enabled by default. Use 'acpi=force' command line option to
|
|
12
|
+
enable ACPI boot.
|
|
13
|
+
|
|
14
|
+
By default (if not overriding the rtvars) a sensible command line is used that
|
|
15
|
+
will set up the console for logging and attempt to mount the rootfs image from
|
|
16
|
+
the FVP's virtio block device. However the default rootfs image is empty, so
|
|
17
|
+
the kernel will panic when attempting to mount; the user must supply a rootfs
|
|
18
|
+
if it is required that the kernel completes its boot. No default kernel image
|
|
19
|
+
is supplied and the config will refuse to run unless it is explicitly
|
|
20
|
+
specified.
|
|
21
|
+
|
|
22
|
+
Note that by default, UEFI variables are build time configured directing EDK2
|
|
23
|
+
to boot to the shell. This will cause startup.nsh to be executed and will
|
|
24
|
+
start the kernel boot. This way everything is automatic. By default, all EDK2
|
|
25
|
+
output is muxed to stdout. If you prefer booting UEFI to its UI, override the
|
|
26
|
+
the build pcd parameter `PcdUefiShellDefaultBootEnable` using the overlay and
|
|
27
|
+
override terminals 'bp.terminal_0'.type to 'telnet'.
|
|
28
|
+
|
|
29
|
+
.. code-block:: shell
|
|
30
|
+
$ shrinkwrap build cca-edk2.yaml
|
|
31
|
+
|
|
32
|
+
.. code-block:: shell
|
|
33
|
+
$ shrinkwrap run cca-edk2.yaml --rtvar KERNEL=path/to/Image --rtvar ROOTFS=path/to/rootfs.img
|
|
34
|
+
|
|
35
|
+
When booting with device tree, a directory can optionally be shared from the
|
|
36
|
+
host system into the Linux environment running in the FVP. To do so, set the
|
|
37
|
+
SHARE rtvar to the desired directory, then mount the share inside the FVP with
|
|
38
|
+
the following (or automate it in fstab):
|
|
39
|
+
|
|
40
|
+
.. code-block:: shell
|
|
41
|
+
# mkdir /share
|
|
42
|
+
# mount -t 9p -o trans=virtio,version=9p2000.L FM /share
|
|
43
|
+
|
|
44
|
+
concrete: true
|
|
45
|
+
|
|
46
|
+
layers:
|
|
47
|
+
- tfa-rme.yaml
|
|
48
|
+
- ns-edk2-base.yaml
|
|
49
|
+
|
|
50
|
+
build:
|
|
51
|
+
edk2:
|
|
52
|
+
repo:
|
|
53
|
+
edk2:
|
|
54
|
+
remote: https://git.gitlab.arm.com/linux-arm/edk2-cca.git
|
|
55
|
+
revision: 3223_arm_cca_v4
|
|
56
|
+
edk2-platforms:
|
|
57
|
+
remote: https://git.gitlab.arm.com/linux-arm/edk2-platforms-cca.git
|
|
58
|
+
revision: 3223_arm_cca_v4
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Copyright (c) 2024, Arm Limited.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
%YAML 1.2
|
|
5
|
+
---
|
|
6
|
+
description: >-
|
|
7
|
+
Overlay for RMM to build debug configuration.
|
|
8
|
+
|
|
9
|
+
build:
|
|
10
|
+
rmm:
|
|
11
|
+
params:
|
|
12
|
+
-DCMAKE_BUILD_TYPE: Debug
|
|
13
|
+
|
|
14
|
+
artifacts:
|
|
15
|
+
RMM: ${param:builddir}/Debug/rmm.img
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Copyright (c) 2024, Arm Limited.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
%YAML 1.2
|
|
5
|
+
---
|
|
6
|
+
description: >-
|
|
7
|
+
Overlay for TFA to build debug configuration.
|
|
8
|
+
|
|
9
|
+
build:
|
|
10
|
+
tfa:
|
|
11
|
+
params:
|
|
12
|
+
DEBUG: 1
|
|
13
|
+
|
|
14
|
+
artifacts:
|
|
15
|
+
BL1: ${param:builddir}/fvp/debug/bl1.bin
|
|
16
|
+
BL2: ${param:builddir}/fvp/debug/bl2.bin
|
|
17
|
+
BL31: ${param:builddir}/fvp/debug/bl31.bin
|
|
18
|
+
FIP: ${param:builddir}/fvp/debug/fip.bin
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Copyright (c) 2025, Arm Limited.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
%YAML 1.2
|
|
5
|
+
---
|
|
6
|
+
description: >-
|
|
7
|
+
Overlay for TFTF to build debug configuration.
|
|
8
|
+
|
|
9
|
+
build:
|
|
10
|
+
tftf:
|
|
11
|
+
params:
|
|
12
|
+
DEBUG: 1
|
|
13
|
+
|
|
14
|
+
artifacts:
|
|
15
|
+
TFTF_BIN: ${param:builddir}/fvp/debug/tftf.bin
|
|
16
|
+
SP_LAYOUT: ${param:builddir}/fvp/debug/sp_layout.json
|
|
17
|
+
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Copyright (c) 2022, Arm Limited.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
%YAML 1.2
|
|
5
|
+
---
|
|
6
|
+
description: >-
|
|
7
|
+
Builds a device tree from upstream linux kernel and exports the dtb as an
|
|
8
|
+
artifact called DTB. By default, fvp-base-revc.dts is built, but the user can
|
|
9
|
+
override this by specifying its name in the DTS variable as part of a higher
|
|
10
|
+
layer's prebuild commands. Optionally, a kernel command line is dynamically
|
|
11
|
+
added to the chosen node if any params are specified. Uses a slimmed down
|
|
12
|
+
mirror of the upstream repo to avoid having to sync all of linux.
|
|
13
|
+
|
|
14
|
+
build:
|
|
15
|
+
dt:
|
|
16
|
+
repo:
|
|
17
|
+
remote: https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git
|
|
18
|
+
revision: v6.17-dts
|
|
19
|
+
|
|
20
|
+
toolchain: aarch64-none-elf-
|
|
21
|
+
|
|
22
|
+
prebuild:
|
|
23
|
+
# User can override DTS in prebuild step of higher layer.
|
|
24
|
+
- DTS=fvp-base-revc.dts
|
|
25
|
+
# User can override these to define an initrd in memory.
|
|
26
|
+
- INITRD_START=
|
|
27
|
+
- INITRD_END=
|
|
28
|
+
|
|
29
|
+
build:
|
|
30
|
+
- DT_BASENAME=$$(basename $${DTS} .dts)
|
|
31
|
+
- DTB_INTER=src/arm64/arm/$${DT_BASENAME}.dtb
|
|
32
|
+
- DTB_FINAL=${param:builddir}/dt_bootargs.dtb
|
|
33
|
+
|
|
34
|
+
# This script compiles the selected dts then dynamically adds kernel
|
|
35
|
+
# bootargs to the chosen node. It uses any defined key=value pairs from
|
|
36
|
+
# the `params` key. If none are defined (the default) the dts is compiled
|
|
37
|
+
# without a command line. If an initrd location is provided, it is also
|
|
38
|
+
# added to the chosen node.
|
|
39
|
+
- make CPP=$${CROSS_COMPILE}cpp -j${param:jobs} $${DTB_INTER}
|
|
40
|
+
- CHOSEN=
|
|
41
|
+
- if [ ! -z "${param:join_equal}" ]; then
|
|
42
|
+
- CHOSEN="$${CHOSEN}bootargs = \"${param:join_equal}\";\n"
|
|
43
|
+
- fi
|
|
44
|
+
- if [ ! -z "$${INITRD_START}" ] && [ ! -z "$${INITRD_END}" ]; then
|
|
45
|
+
- INITRD_START_HI=$$((($${INITRD_START} >> 32) & 0xffffffff))
|
|
46
|
+
- INITRD_START_LO=$$(($${INITRD_START} & 0xffffffff))
|
|
47
|
+
- INITRD_END_HI=$$((($${INITRD_END} >> 32) & 0xffffffff))
|
|
48
|
+
- INITRD_END_LO=$$(($${INITRD_END} & 0xffffffff))
|
|
49
|
+
- CHOSEN="$${CHOSEN}linux,initrd-start = <$${INITRD_START_HI} $${INITRD_START_LO}>;\n"
|
|
50
|
+
- CHOSEN="$${CHOSEN}linux,initrd-end = <$${INITRD_END_HI} $${INITRD_END_LO}>;\n"
|
|
51
|
+
- fi
|
|
52
|
+
- if [ -z "$${CHOSEN}" ]; then
|
|
53
|
+
- cp $${DTB_INTER} $${DTB_FINAL}
|
|
54
|
+
- else
|
|
55
|
+
- ( dtc -q -O dts -I dtb $${DTB_INTER} ; echo -e "/ { chosen { $${CHOSEN} }; };" ) | dtc -q -O dtb -o $${DTB_FINAL}
|
|
56
|
+
- fi
|
|
57
|
+
|
|
58
|
+
# When using the default fvp-base-revc.dts, an overlay is added which adds
|
|
59
|
+
# extra properties that TFA requires. This allows embedding this DT
|
|
60
|
+
# directly in the FIP rather than having TFA use its own DT then inject
|
|
61
|
+
# this at a higher level. It's also not always possible to inject the DT
|
|
62
|
+
# at a higher level anyway, due to TFA constraints. Included in the
|
|
63
|
+
# overlay: a 64MB carve-out is reserved at the end of the first memory
|
|
64
|
+
# bank, which is used by tfa and (if present) the rmm, timer frequency,
|
|
65
|
+
# some extra psci properties, and cpu-map to map the cores to clusters.
|
|
66
|
+
# By default the virtio-rng is disabled (because it was not present in
|
|
67
|
+
# older builds of the rev C FVP), so enable it here, so Linux can use it
|
|
68
|
+
# to initialize its RNG and speed up boot.
|
|
69
|
+
- if [ "$${DTS}" = "fvp-base-revc.dts" ]; then
|
|
70
|
+
- >-
|
|
71
|
+
OVERLAY="/ {
|
|
72
|
+
reserved-memory {
|
|
73
|
+
fw: fw@7C000000 {
|
|
74
|
+
reg = <0x00000000 0xFC000000 0 0x04000000>;
|
|
75
|
+
no-map;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
timer {
|
|
79
|
+
clock-frequency = <100000000>;
|
|
80
|
+
};
|
|
81
|
+
psci {
|
|
82
|
+
compatible = \"arm,psci-1.0\", \"arm,psci-0.2\";
|
|
83
|
+
max-pwr-lvl = <2>;
|
|
84
|
+
};
|
|
85
|
+
cpus {
|
|
86
|
+
cpu-map {
|
|
87
|
+
cluster0 {
|
|
88
|
+
core0 { cpu = <&{/cpus/cpu@0}>; };
|
|
89
|
+
core1 { cpu = <&{/cpus/cpu@100}>; };
|
|
90
|
+
core2 { cpu = <&{/cpus/cpu@200}>; };
|
|
91
|
+
core3 { cpu = <&{/cpus/cpu@300}>; };
|
|
92
|
+
};
|
|
93
|
+
cluster1 {
|
|
94
|
+
core0 { cpu = <&{/cpus/cpu@10000}>; };
|
|
95
|
+
core1 { cpu = <&{/cpus/cpu@10100}>; };
|
|
96
|
+
core2 { cpu = <&{/cpus/cpu@10200}>; };
|
|
97
|
+
core3 { cpu = <&{/cpus/cpu@10300}>; };
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
bus@8000000 {
|
|
102
|
+
motherboard-bus@8000000 {
|
|
103
|
+
iofpga-bus@300000000 {
|
|
104
|
+
virtio@200000 {
|
|
105
|
+
status = \"okay\";
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
};"
|
|
111
|
+
- ( dtc -q -O dts -I dtb $${DTB_FINAL} ; echo -e "$${OVERLAY}" ) | dtc -q -O dtb -o $${DTB_FINAL}
|
|
112
|
+
- fi
|
|
113
|
+
|
|
114
|
+
artifacts:
|
|
115
|
+
DTB: ${param:builddir}/dt_bootargs.dtb
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Copyright (c) 2022, Arm Limited.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
%YAML 1.2
|
|
5
|
+
---
|
|
6
|
+
description: >-
|
|
7
|
+
EDK2 UEFI firmware implementation for the FVP.
|
|
8
|
+
|
|
9
|
+
Builds acpica from source as part of the build process.
|
|
10
|
+
|
|
11
|
+
build:
|
|
12
|
+
acpica:
|
|
13
|
+
repo:
|
|
14
|
+
remote: https://github.com/acpica/acpica.git
|
|
15
|
+
revision: R2025_04_04
|
|
16
|
+
|
|
17
|
+
build:
|
|
18
|
+
- make -j${param:jobs}
|
|
19
|
+
|
|
20
|
+
artifacts:
|
|
21
|
+
ACPICA:
|
|
22
|
+
path: ${param:sourcedir}/generate/unix/bin
|
|
23
|
+
export: false
|
|
24
|
+
|
|
25
|
+
edk2:
|
|
26
|
+
repo:
|
|
27
|
+
edk2:
|
|
28
|
+
remote: https://github.com/tianocore/edk2.git
|
|
29
|
+
revision: edk2-stable202508.01
|
|
30
|
+
edk2-platforms:
|
|
31
|
+
remote: https://github.com/tianocore/edk2-platforms.git
|
|
32
|
+
revision: 8cc9da9dc8431d1f0dfab28d92b3941e2c19aeb8
|
|
33
|
+
|
|
34
|
+
toolchain: aarch64-none-elf-
|
|
35
|
+
|
|
36
|
+
stderrfilt: true
|
|
37
|
+
|
|
38
|
+
prebuild:
|
|
39
|
+
- export WORKSPACE=${param:sourcedir}
|
|
40
|
+
- export GCC5_AARCH64_PREFIX=$$CROSS_COMPILE
|
|
41
|
+
- export PACKAGES_PATH=$$WORKSPACE/edk2:$$WORKSPACE/edk2-platforms
|
|
42
|
+
- export IASL_PREFIX=${artifact:ACPICA}/
|
|
43
|
+
- export PYTHON_COMMAND=/usr/bin/python3
|
|
44
|
+
|
|
45
|
+
params:
|
|
46
|
+
-a: AARCH64
|
|
47
|
+
-t: GCC5
|
|
48
|
+
-p: Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
|
|
49
|
+
-b: RELEASE
|
|
50
|
+
--pcd: PcdShellDefaultDelay=0
|
|
51
|
+
' --pcd': PcdUefiShellDefaultBootEnable=1
|
|
52
|
+
|
|
53
|
+
build:
|
|
54
|
+
- source edk2/edksetup.sh --reconfig
|
|
55
|
+
- make -j${param:jobs} -C edk2/BaseTools
|
|
56
|
+
- build -n ${param:jobs} -D EDK2_OUT_DIR=${param:builddir} ${param:join_space}
|
|
57
|
+
|
|
58
|
+
artifacts:
|
|
59
|
+
EDK2: ${param:builddir}/RELEASE_GCC5/FV/FVP_AARCH64_EFI.fd
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Copyright (c) 2023, Arm Limited.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
%YAML 1.2
|
|
5
|
+
---
|
|
6
|
+
description: >-
|
|
7
|
+
Brings together a software stack to demonstrate Arm FF-A running on FVP.
|
|
8
|
+
Includes TF-A in secure EL3 running SPMD(Secure Partition Manager
|
|
9
|
+
Dispatcher), Hafnium as secure Hypervisor at secure EL2 running SPMC
|
|
10
|
+
(Secure Partition Manager Core) and OPTEE as a secure partition/VM
|
|
11
|
+
in secure EL1 and Linux in Normal world.
|
|
12
|
+
|
|
13
|
+
concrete: true
|
|
14
|
+
|
|
15
|
+
layers:
|
|
16
|
+
- ns-edk2.yaml
|
|
17
|
+
- hafnium-base.yaml
|
|
18
|
+
- optee-base.yaml
|
|
19
|
+
- arch/v8.5.yaml
|
|
20
|
+
|
|
21
|
+
build:
|
|
22
|
+
optee:
|
|
23
|
+
params:
|
|
24
|
+
CFG_CORE_SEL2_SPMC: y
|
|
25
|
+
CFG_CORE_ASYNC_NOTIF: y
|
|
26
|
+
CFG_CORE_HAFNIUM_INTC: y
|
|
27
|
+
CFG_ARM_GICV3: n
|
|
28
|
+
CFG_CORE_WORKAROUND_NSITR_CACHE_PRIME: n
|
|
29
|
+
|
|
30
|
+
tfa:
|
|
31
|
+
prebuild:
|
|
32
|
+
- cat <<EOF > ${param:builddir}/sp_layout.json
|
|
33
|
+
- "{"
|
|
34
|
+
- "\"op-tee\" : {"
|
|
35
|
+
- "\"image\" : \"${artifact:OPTEE_PAGER_BIN}\","
|
|
36
|
+
- "\"pm\" : \"${param:sourcedir}/plat/arm/board/fvp/fdts/optee_sp_manifest.dts\""
|
|
37
|
+
- "}"
|
|
38
|
+
- "}"
|
|
39
|
+
- EOF
|
|
40
|
+
params:
|
|
41
|
+
ARM_SPMC_MANIFEST_DTS: ${param:sourcedir}/plat/arm/board/fvp/fdts/fvp_spmc_optee_sp_manifest.dts
|
|
42
|
+
SP_LAYOUT_FILE: ${param:builddir}/sp_layout.json
|
|
43
|
+
BL32: ${artifact:HAFNIUM}
|
|
44
|
+
SPMD_SPM_AT_SEL2: 1
|
|
45
|
+
SPD: spmd
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Copyright (c) 2023, Arm Limited.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
%YAML 1.2
|
|
5
|
+
---
|
|
6
|
+
description: >-
|
|
7
|
+
Brings together a software stack to demonstrate Arm FF-A running on FVP.
|
|
8
|
+
Includes TF-A in secure EL3 running SPMD(Secure Partition Manager
|
|
9
|
+
Dispatcher), with secure EL2 disabled and SPMC(Secure Partition Manager
|
|
10
|
+
Core) inside OPTEE at secure EL1 and Linux in Normal world.
|
|
11
|
+
|
|
12
|
+
concrete: true
|
|
13
|
+
|
|
14
|
+
layers:
|
|
15
|
+
- ns-edk2.yaml
|
|
16
|
+
- optee-base.yaml
|
|
17
|
+
|
|
18
|
+
build:
|
|
19
|
+
optee:
|
|
20
|
+
params:
|
|
21
|
+
CFG_CORE_SEL1_SPMC: y
|
|
22
|
+
CFG_CORE_ASYNC_NOTIF: y
|
|
23
|
+
|
|
24
|
+
tfa:
|
|
25
|
+
params:
|
|
26
|
+
ARM_SPMC_MANIFEST_DTS: ${param:sourcedir}/plat/arm/board/fvp/fdts/fvp_spmc_el1_optee_manifest.dts
|
|
27
|
+
BL32: ${artifact:OPTEE_PAGER_BIN}
|
|
28
|
+
SPMD_SPM_AT_SEL2: 0
|
|
29
|
+
SPMC_OPTEE: 1
|
|
30
|
+
SPD: spmd
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Copyright (c) 2023, Arm Limited.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
%YAML 1.2
|
|
5
|
+
---
|
|
6
|
+
description: >-
|
|
7
|
+
Brings together a software stack to demonstrate Arm FF-A running on FVP.
|
|
8
|
+
Includes TF-A in secure EL3, Hafnium in secure EL2 and some demo TF-A
|
|
9
|
+
test secure partitions.
|
|
10
|
+
|
|
11
|
+
concrete: true
|
|
12
|
+
|
|
13
|
+
layers:
|
|
14
|
+
- ns-edk2.yaml
|
|
15
|
+
- hafnium-base.yaml
|
|
16
|
+
- tftf-base.yaml
|
|
17
|
+
- arch/v8.5.yaml
|
|
18
|
+
|
|
19
|
+
build:
|
|
20
|
+
tfa:
|
|
21
|
+
params:
|
|
22
|
+
BL33: ${artifact:EDK2}
|
|
23
|
+
SPD: spmd
|
|
24
|
+
SPMD_SPM_AT_SEL2: 1
|
|
25
|
+
SP_LAYOUT_FILE: ${artifact:SP_LAYOUT}
|
|
26
|
+
BL32: ${artifact:HAFNIUM}
|