mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-07-19 16:57:09 +00:00
Compare commits
272 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cec4d317e9 | |||
| bcbd365cfe | |||
| f723b6b593 | |||
| 696773771f | |||
| 5c5cd66675 | |||
| 65382e51b7 | |||
| b43c30089c | |||
| 8baef3984a | |||
| 70e9b1ffde | |||
| 2354c9e06e | |||
| 587b8ab87d | |||
| 850c324189 | |||
| e3bfb5d746 | |||
| f88a69768a | |||
| 1c151dba07 | |||
| 0519634f2d | |||
| 31e1428ea5 | |||
| 0f29c11d2a | |||
| 4b3343b4a9 | |||
| 976cebdf6e | |||
| d45c837137 | |||
| cbf547e222 | |||
| c1123c3d63 | |||
| 738c20d752 | |||
| 43203a464d | |||
| 219fd34b76 | |||
| 2f2258d1d2 | |||
| a7f4f7d2bd | |||
| 2261d39412 | |||
| 77ac287518 | |||
| 8b123ffe85 | |||
| 885415312b | |||
| 16b93fa033 | |||
| 3032b80ed3 | |||
| d1cb358f52 | |||
| 7b0e704dfd | |||
| f65c5c4217 | |||
| a52d805faf | |||
| d2f8a13d3c | |||
| e5ed951abe | |||
| 95087cf374 | |||
| e45cfb9e8f | |||
| de5dc9be14 | |||
| 682c330600 | |||
| d6e18c885d | |||
| 8855e397bc | |||
| 452bc97276 | |||
| 465471fbb9 | |||
| e37127939b | |||
| 205e4bb760 | |||
| e6770c2160 | |||
| 92da257b83 | |||
| 66939c8f35 | |||
| 943dd5943a | |||
| 8195b2c953 | |||
| 5e3d09e234 | |||
| 1a77ae9d5f | |||
| e74b3c2f24 | |||
| 7fd85df7d7 | |||
| e875122778 | |||
| 79d60476bb | |||
| 01a13b11ad | |||
| ac1dc0b894 | |||
| 950c68dbab | |||
| 61291f6d80 | |||
| 4f1f77d660 | |||
| 403de1121e | |||
| d4f7fd1788 | |||
| f8d65dddc8 | |||
| debff92415 | |||
| 67faf6c7dc | |||
| 4f8766b081 | |||
| a949ebfd06 | |||
| a82ed3cfc9 | |||
| 255ca59858 | |||
| 2bc44548b9 | |||
| 1682eb1f44 | |||
| 7c1cb547b9 | |||
| 4865c69658 | |||
| 676caf30d0 | |||
| 5d401b9a77 | |||
| 214e3eb43a | |||
| aaaf3fac58 | |||
| e06ae8431c | |||
| d0de844df6 | |||
| af36a66128 | |||
| 9b830fbd97 | |||
| 856291f071 | |||
| a915ff3931 | |||
| b4659361b3 | |||
| 50850e8eca | |||
| 9eeeda7169 | |||
| d38e10e58b | |||
| 0d50124e51 | |||
| 78c8bfdd34 | |||
| 977c7e6613 | |||
| a8cb17f982 | |||
| 46bb624631 | |||
| fc0bed464e | |||
| 2c44ddd93a | |||
| 957fefc816 | |||
| 2720a1b32b | |||
| 808115fe13 | |||
| 0cec3e584d | |||
| aa63e31b6e | |||
| fdcf7b7b3b | |||
| d3c35b4a0e | |||
| e5523d626f | |||
| a9644d39c5 | |||
| 1f872c3c83 | |||
| 3be0996065 | |||
| 101abf89c6 | |||
| 549f362d2f | |||
| cb4c230b56 | |||
| 460210f4a8 | |||
| 568d4d7f9c | |||
| 1350f983ae | |||
| 15512adf39 | |||
| 63c9974493 | |||
| a6de147dc0 | |||
| ea931f83e3 | |||
| d692df24cd | |||
| e0c74f3b3b | |||
| 82b31654b0 | |||
| 57192fd8a5 | |||
| 67f57f35da | |||
| 0978f5a74c | |||
| 232b411b47 | |||
| 98f3779210 | |||
| 7ae8a30b6b | |||
| 933df12da8 | |||
| bc4cd77370 | |||
| 5b823a1eb4 | |||
| a8f32f990a | |||
| 51e014fd47 | |||
| f8e79562f9 | |||
| 980f559e87 | |||
| 44a3c5cf80 | |||
| 603a7657e2 | |||
| 7453f06afc | |||
| b595d1ea47 | |||
| a3481e5016 | |||
| 9fdf9297ac | |||
| 9e00b6b884 | |||
| ee8a242e7a | |||
| 43a25b2e96 | |||
| e25c325197 | |||
| 761bcbb365 | |||
| d9fe9a3eac | |||
| e627b698e7 | |||
| 84683227ed | |||
| 312a25202b | |||
| 1f548fce10 | |||
| 75c9cc3bf8 | |||
| 9e2ff72858 | |||
| 68a113c0a0 | |||
| f14be5995f | |||
| eb3a6b74b7 | |||
| a56011bf30 | |||
| 0a1d96948f | |||
| 6dbf49d633 | |||
| e454387d9f | |||
| b566fbce82 | |||
| 756e695b48 | |||
| 1f6d3f6ef2 | |||
| 9ed331bbd7 | |||
| a780470d96 | |||
| 800249ac61 | |||
| 5a44edaa0e | |||
| cff5aafc67 | |||
| 60ef8543f4 | |||
| 235b7539d8 | |||
| d9a0f4fe59 | |||
| 6a85fdbd77 | |||
| 7fdd34516c | |||
| 9b7905b994 | |||
| caaa21d84f | |||
| 65618b753f | |||
| 511c1ca429 | |||
| 16d10f9c58 | |||
| 7a3e9d5087 | |||
| 35adaace0e | |||
| e40b99e131 | |||
| fecf206b7d | |||
| 9b5f0a0cc4 | |||
| 88a5524a61 | |||
| eea9ce959a | |||
| 98014d1c1c | |||
| a230baa675 | |||
| da32f5c1c8 | |||
| 293d1e0e8d | |||
| e59fc3233b | |||
| c90cf8ce5a | |||
| 5b98ef9d65 | |||
| 35c0bcceea | |||
| fabf4a3c0f | |||
| b578b45092 | |||
| e05be1a396 | |||
| be19ce6b94 | |||
| 7cd87c3ee3 | |||
| a49c59daf6 | |||
| 7577cecab6 | |||
| 3c9486fb31 | |||
| 2a530c3419 | |||
| 0d83df0bd2 | |||
| 966e15826a | |||
| 719a003508 | |||
| 79360345fb | |||
| d683a5bc92 | |||
| 780fba3481 | |||
| afa281b7a9 | |||
| f54bb78861 | |||
| de5d5e611a | |||
| 2ab2f5e179 | |||
| 9d8bb0bea2 | |||
| 4b1d39b87d | |||
| 4ba96e72fd | |||
| cd9cdaad2a | |||
| e3b06f63b1 | |||
| 03f2d78e45 | |||
| e64c553fa0 | |||
| 7f5a3b06ee | |||
| a8a44f6916 | |||
| fda2117467 | |||
| 095d9e314d | |||
| 148103bf84 | |||
| f8fc3b463d | |||
| e18ee052f7 | |||
| 22948879f8 | |||
| 99da50c473 | |||
| b0188cd0cc | |||
| fb045c9019 | |||
| df93a23ad4 | |||
| 87d12f6fa4 | |||
| 42b114e5e0 | |||
| 39ae13d44e | |||
| 390aa6e354 | |||
| 8e2fa5edc8 | |||
| 342d2ec158 | |||
| ce8369461e | |||
| 3bbddbe213 | |||
| 02994f94df | |||
| aa35796c80 | |||
| 5331993f8c | |||
| 9b075d12de | |||
| 91225be953 | |||
| 7c34d0affc | |||
| d8dbaa20b2 | |||
| e52410e281 | |||
| 60f5176196 | |||
| 136207e7c1 | |||
| 56180fce2b | |||
| 067a259cbd | |||
| 197b0732e3 | |||
| 214ec04498 | |||
| 42c4ba9c96 | |||
| 9872afc6c7 | |||
| a996166e85 | |||
| e9e01e9be7 | |||
| ce9650ec84 | |||
| a9cd4fc12f | |||
| 171616a183 | |||
| 3c738c4f69 | |||
| 222fcf4281 | |||
| aee22517e4 | |||
| 167c854412 | |||
| 9a2847c0d6 | |||
| 55daf196a6 | |||
| 5fa6bc3a9c | |||
| 0f0a971458 | |||
| 658faaff76 | |||
| db1d714029 |
+54
-55
@@ -1,5 +1,5 @@
|
|||||||
# We need 2.6.3 as this is the latest container with an old enough distro
|
# Use our custom Crops-derived image
|
||||||
image: ghcr.io/siemens/kas/kas:2.6.3
|
image: $CI_REGISTRY/$CI_PROJECT_NAMESPACE/yocto-builder:master
|
||||||
|
|
||||||
# First do a common bootstrap, and then build all the targets
|
# First do a common bootstrap, and then build all the targets
|
||||||
stages:
|
stages:
|
||||||
@@ -10,33 +10,27 @@ stages:
|
|||||||
# Common job fragment to get a worker ready
|
# Common job fragment to get a worker ready
|
||||||
.setup:
|
.setup:
|
||||||
stage: build
|
stage: build
|
||||||
interruptible: true
|
|
||||||
variables:
|
variables:
|
||||||
KAS_WORK_DIR: $CI_PROJECT_DIR/work
|
KAS_WORK_DIR: $CI_PROJECT_DIR/work
|
||||||
KAS_REPO_REF_DIR: $CI_BUILDS_DIR/persist/repos
|
KAS_REPO_REF_DIR: $CI_BUILDS_DIR/persist/repos
|
||||||
SSTATE_DIR: $CI_BUILDS_DIR/persist/sstate
|
SSTATE_DIR: $CI_BUILDS_DIR/persist/sstate
|
||||||
DL_DIR: $CI_BUILDS_DIR/persist/downloads
|
DL_DIR: $CI_BUILDS_DIR/persist/downloads
|
||||||
BB_LOGCONFIG: $CI_PROJECT_DIR/ci/logging.yml
|
BB_LOGCONFIG: $CI_PROJECT_DIR/ci/logging.yml
|
||||||
TOOLCHAIN_DIR: $CI_BUILDS_DIR/persist/toolchains
|
|
||||||
IMAGE_DIR: $CI_PROJECT_DIR/work/build/tmp/deploy/images
|
|
||||||
TOOLCHAIN_LINK_DIR: $CI_PROJECT_DIR/work/build/toolchains
|
|
||||||
before_script:
|
before_script:
|
||||||
- echo KAS_WORK_DIR = $KAS_WORK_DIR
|
- echo KAS_WORK_DIR = $KAS_WORK_DIR
|
||||||
- echo SSTATE_DIR = $SSTATE_DIR
|
- echo SSTATE_DIR = $SSTATE_DIR
|
||||||
- echo DL_DIR = $DL_DIR
|
- echo DL_DIR = $DL_DIR
|
||||||
- rm -rf $KAS_WORK_DIR
|
- mkdir --verbose --parents $KAS_WORK_DIR $KAS_REPO_REF_DIR $SSTATE_DIR $DL_DIR
|
||||||
- mkdir --verbose --parents $KAS_WORK_DIR $KAS_REPO_REF_DIR $SSTATE_DIR $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
|
|
||||||
# Must do this here, as it's the only way to make sure the toolchain is installed on the same builder
|
|
||||||
- ./ci/get-binary-toolchains $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
|
|
||||||
|
|
||||||
# Generalised fragment to do a Kas build
|
# Generalised fragment to do a Kas build
|
||||||
.build:
|
.build:
|
||||||
extends: .setup
|
extends: .setup
|
||||||
script:
|
script:
|
||||||
- KASFILES=$(./ci/jobs-to-kas $CI_JOB_NAME)
|
- KASFILES=$(./ci/jobs-to-kas $CI_JOB_NAME)
|
||||||
- kas shell --update --force-checkout $KASFILES -c 'cat conf/*.conf'
|
- kas shell --update --force-checkout $KASFILES -c 'cat conf/*.conf'
|
||||||
- kas build $KASFILES
|
- kas build $KASFILES
|
||||||
- ./ci/check-warnings $KAS_WORK_DIR/build/warnings.log
|
- ./ci/check-warnings $KAS_WORK_DIR/build/warnings.log
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Prep stage, update repositories once
|
# Prep stage, update repositories once
|
||||||
@@ -47,6 +41,7 @@ update-repos:
|
|||||||
script:
|
script:
|
||||||
- flock --verbose --timeout 60 $KAS_REPO_REF_DIR ./ci/update-repos
|
- flock --verbose --timeout 60 $KAS_REPO_REF_DIR ./ci/update-repos
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Bootstrap stage, bootstrap and machine coverage
|
# Bootstrap stage, bootstrap and machine coverage
|
||||||
#
|
#
|
||||||
@@ -60,7 +55,6 @@ n1sdp/bootstrap:
|
|||||||
# What percentage of machines in the layer do we build
|
# What percentage of machines in the layer do we build
|
||||||
machine-coverage:
|
machine-coverage:
|
||||||
stage: bootstrap
|
stage: bootstrap
|
||||||
interruptible: true
|
|
||||||
script:
|
script:
|
||||||
- ./ci/check-machine-coverage
|
- ./ci/check-machine-coverage
|
||||||
coverage: '/Coverage: \d+/'
|
coverage: '/Coverage: \d+/'
|
||||||
@@ -70,7 +64,7 @@ machine-coverage:
|
|||||||
# Build stage, the actual build jobs
|
# Build stage, the actual build jobs
|
||||||
#
|
#
|
||||||
|
|
||||||
a5ds:
|
corstone500:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|
||||||
corstone700-fvp:
|
corstone700-fvp:
|
||||||
@@ -79,27 +73,39 @@ corstone700-fvp:
|
|||||||
corstone700-mps3:
|
corstone700-mps3:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|
||||||
foundation-armv8:
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
fvp-base:
|
fvp-base:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|
||||||
fvp-base-arm32:
|
fvp-base-arm32:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|
||||||
fvp-base-arm32/external-gccarm:
|
fvp-base-arm32/external-gcc-arm32:
|
||||||
|
extends: .build
|
||||||
|
|
||||||
|
fvp-baser-aemv8r64:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|
||||||
gem5-arm64:
|
gem5-arm64:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|
||||||
|
gem5-arm64-xen:
|
||||||
|
extends: .build
|
||||||
|
|
||||||
|
gem5-atp-arm64:
|
||||||
|
extends: .build
|
||||||
|
|
||||||
|
generic-arm64:
|
||||||
|
extends: .build
|
||||||
|
|
||||||
juno:
|
juno:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|
||||||
juno/clang:
|
juno/clang:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|
||||||
|
microbit-v1:
|
||||||
|
extends: .build
|
||||||
|
|
||||||
musca-b1:
|
musca-b1:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|
||||||
@@ -109,29 +115,31 @@ musca-s1:
|
|||||||
n1sdp:
|
n1sdp:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|
||||||
# This job currently fails when building gcc-runtime:
|
|
||||||
# cc1: error: switch '-mcpu=armv8.2-a' conflicts with '-march=armv8-a' switch [-Werror]
|
|
||||||
# Mark as manual so it doesn't get executed automatically
|
|
||||||
n1sdp/armgcc:
|
n1sdp/armgcc:
|
||||||
extends: .build
|
extends: .build
|
||||||
when: manual
|
|
||||||
|
|
||||||
qemuarm/testimage:
|
qemu-cortex-a53:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|
||||||
qemuarm64-secureboot/testimage:
|
qemuarm:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|
||||||
qemuarm64-secureboot/clang/testimage:
|
qemuarm64-sbsa:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|
||||||
qemuarm64-secureboot/clang/musl/testimage:
|
qemuarm64-secureboot:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|
||||||
qemuarm64-secureboot/musl/testimage:
|
qemuarm64-secureboot/clang:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|
||||||
qemuarmv5/testimage:
|
qemuarm64-secureboot/clang/musl:
|
||||||
|
extends: .build
|
||||||
|
|
||||||
|
qemuarm64-secureboot/musl:
|
||||||
|
extends: .build
|
||||||
|
|
||||||
|
qemuarmv5:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|
||||||
sgi575:
|
sgi575:
|
||||||
@@ -145,6 +153,14 @@ tc0:
|
|||||||
# Utility tasks, not executed automatically
|
# Utility tasks, not executed automatically
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# Report on disk usage
|
||||||
|
usage:
|
||||||
|
extends: .setup
|
||||||
|
stage: prep
|
||||||
|
when: manual
|
||||||
|
script:
|
||||||
|
- du -h -s $DL_DIR $SSTATE_DIR $KAS_REPO_REF_DIR
|
||||||
|
|
||||||
delete-dl-dir:
|
delete-dl-dir:
|
||||||
extends: .setup
|
extends: .setup
|
||||||
stage: prep
|
stage: prep
|
||||||
@@ -159,6 +175,14 @@ delete-repo-dir:
|
|||||||
script:
|
script:
|
||||||
- rm -rf $KAS_REPO_REF_DIR/*
|
- rm -rf $KAS_REPO_REF_DIR/*
|
||||||
|
|
||||||
|
# Wipe out old sstate
|
||||||
|
prune-sstate:
|
||||||
|
extends: .setup
|
||||||
|
stage: prep
|
||||||
|
when: manual
|
||||||
|
script:
|
||||||
|
- find $SSTATE_DIR -type f -atime +30 -delete
|
||||||
|
|
||||||
# Delete all sstate
|
# Delete all sstate
|
||||||
delete-sstate:
|
delete-sstate:
|
||||||
extends: .setup
|
extends: .setup
|
||||||
@@ -166,28 +190,3 @@ delete-sstate:
|
|||||||
when: manual
|
when: manual
|
||||||
script:
|
script:
|
||||||
- rm -rf $SSTATE_DIR/*
|
- rm -rf $SSTATE_DIR/*
|
||||||
|
|
||||||
delete-toolchains:
|
|
||||||
extends: .setup
|
|
||||||
stage: prep
|
|
||||||
when: manual
|
|
||||||
script:
|
|
||||||
- rm -rf $TOOLCHAIN_DIR/*
|
|
||||||
|
|
||||||
# Wipe out old sstate
|
|
||||||
prune-sstate:
|
|
||||||
extends: .setup
|
|
||||||
stage: prep
|
|
||||||
when: manual
|
|
||||||
script:
|
|
||||||
- du -h -s $SSTATE_DIR
|
|
||||||
- find $SSTATE_DIR -type f -atime +30 -delete
|
|
||||||
- du -h -s $SSTATE_DIR
|
|
||||||
|
|
||||||
# Report on disk usage
|
|
||||||
usage:
|
|
||||||
extends: .setup
|
|
||||||
stage: prep
|
|
||||||
when: manual
|
|
||||||
script:
|
|
||||||
- du -h -s $DL_DIR $SSTATE_DIR $KAS_REPO_REF_DIR $TOOLCHAIN_DIR
|
|
||||||
|
|||||||
+2
-2
@@ -2,5 +2,5 @@ header:
|
|||||||
version: 9
|
version: 9
|
||||||
|
|
||||||
local_conf_header:
|
local_conf_header:
|
||||||
libc: |
|
cc: |
|
||||||
GCCVERSION = "arm-9.2"
|
GCCVERSION = "arm-10.2"
|
||||||
|
|||||||
+3
-4
@@ -5,7 +5,7 @@ distro: poky
|
|||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
repos:
|
repos:
|
||||||
refspec: gatesgarth
|
refspec: hardknott
|
||||||
|
|
||||||
repos:
|
repos:
|
||||||
meta-arm:
|
meta-arm:
|
||||||
@@ -22,7 +22,6 @@ repos:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
BB_LOGCONFIG: ""
|
BB_LOGCONFIG: ""
|
||||||
TOOLCHAIN_DIR: ""
|
|
||||||
|
|
||||||
local_conf_header:
|
local_conf_header:
|
||||||
base: |
|
base: |
|
||||||
@@ -30,12 +29,12 @@ local_conf_header:
|
|||||||
PACKAGE_CLASSES = "package_ipk"
|
PACKAGE_CLASSES = "package_ipk"
|
||||||
LICENSE_FLAGS_WHITELIST += "armcompiler"
|
LICENSE_FLAGS_WHITELIST += "armcompiler"
|
||||||
PACKAGECONFIG_remove_pn-qemu-system-native = "gtk+ sdl"
|
PACKAGECONFIG_remove_pn-qemu-system-native = "gtk+ sdl"
|
||||||
EXTRA_IMAGE_FEATURES_append = " debug-tweaks"
|
|
||||||
BB_NUMBER_THREADS = "16"
|
BB_NUMBER_THREADS = "16"
|
||||||
PARALLEL_MAKE = "-j16"
|
PARALLEL_MAKE = "-j16"
|
||||||
INHERIT += "rm_work"
|
INHERIT += "rm_work"
|
||||||
PACKAGECONFIG_append_pn-perf = " coresight"
|
PACKAGECONFIG_append_pn-perf = " coresight"
|
||||||
ptest: |
|
ERROR_QA = "${WARN_QA}"
|
||||||
|
noptest: |
|
||||||
DISTRO_FEATURES_remove = "ptest"
|
DISTRO_FEATURES_remove = "ptest"
|
||||||
|
|
||||||
machine: unset
|
machine: unset
|
||||||
|
|||||||
@@ -13,11 +13,11 @@ if metaarm.name != "meta-arm":
|
|||||||
machines = metaarm.glob("meta-*/conf/machine/*.conf")
|
machines = metaarm.glob("meta-*/conf/machine/*.conf")
|
||||||
machines = set(p.stem for p in machines)
|
machines = set(p.stem for p in machines)
|
||||||
|
|
||||||
# All ci files
|
# All kas files
|
||||||
ci = metaarm.glob("ci/*.yml")
|
kas = metaarm.glob("ci/*.yml")
|
||||||
ci = set(p.stem for p in ci)
|
kas = set(p.stem for p in kas)
|
||||||
|
|
||||||
missing = machines - ci
|
missing = machines - kas
|
||||||
print(f"The following machines are missing: {', '.join(sorted(missing))}.")
|
print(f"The following machines are missing: {', '.join(sorted(missing))}.")
|
||||||
|
|
||||||
covered = len(machines) - len(missing)
|
covered = len(machines) - len(missing)
|
||||||
|
|||||||
+1
-2
@@ -7,8 +7,7 @@ set -e -u
|
|||||||
|
|
||||||
LOGFILE=$1
|
LOGFILE=$1
|
||||||
|
|
||||||
LINES=$(grep --invert-match "attempting MIRRORS if available" $LOGFILE | wc -l)
|
if test -s $LOGFILE; then
|
||||||
if test "$LINES" -ne 0; then
|
|
||||||
echo ==============================
|
echo ==============================
|
||||||
echo The build had warnings/errors:
|
echo The build had warnings/errors:
|
||||||
echo ==============================
|
echo ==============================
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ header:
|
|||||||
repos:
|
repos:
|
||||||
meta-clang:
|
meta-clang:
|
||||||
url: https://github.com/kraj/meta-clang
|
url: https://github.com/kraj/meta-clang
|
||||||
refspec: gatesgarth
|
|
||||||
|
|
||||||
local_conf_header:
|
local_conf_header:
|
||||||
clang: |
|
clang: |
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ header:
|
|||||||
includes:
|
includes:
|
||||||
- base.yml
|
- base.yml
|
||||||
|
|
||||||
machine: a5ds
|
machine: corstone500
|
||||||
@@ -5,4 +5,4 @@ local_conf_header:
|
|||||||
cc: |
|
cc: |
|
||||||
PNBLACKLIST[gcc-cross-arm] = "Using external toolchain"
|
PNBLACKLIST[gcc-cross-arm] = "Using external toolchain"
|
||||||
TCMODE = "external-arm"
|
TCMODE = "external-arm"
|
||||||
EXTERNAL_TOOLCHAIN = "${TOPDIR}/toolchains/${TARGET_ARCH}"
|
EXTERNAL_TOOLCHAIN = "/usr/local/gcc-arm-10.2-2020.11-aarch64-arm-none-linux-gnueabihf"
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
header:
|
||||||
|
version: 9
|
||||||
|
includes:
|
||||||
|
- base.yml
|
||||||
|
|
||||||
|
machine: fvp-baser-aemv8r64
|
||||||
|
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
header:
|
||||||
|
version: 9
|
||||||
|
includes:
|
||||||
|
- base.yml
|
||||||
|
- meta-python.yml
|
||||||
|
|
||||||
|
repos:
|
||||||
|
meta-arm:
|
||||||
|
layers:
|
||||||
|
meta-gem5:
|
||||||
|
meta-openembedded:
|
||||||
|
url: https://git.openembedded.org/meta-openembedded
|
||||||
|
layers:
|
||||||
|
meta-oe:
|
||||||
|
meta-filesystems:
|
||||||
|
meta-networking:
|
||||||
|
meta-virtualization:
|
||||||
|
url: git://git.yoctoproject.org/meta-virtualization
|
||||||
|
|
||||||
|
machine: gem5-arm64
|
||||||
|
|
||||||
|
local_conf_header:
|
||||||
|
meta-virt:
|
||||||
|
DISTRO_FEATURES_append = " virtualization xen"
|
||||||
|
|
||||||
|
target:
|
||||||
|
- xen-image-minimal
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
header:
|
||||||
|
version: 9
|
||||||
|
includes:
|
||||||
|
- gem5-arm64.yml
|
||||||
|
|
||||||
|
repos:
|
||||||
|
meta-arm:
|
||||||
|
layers:
|
||||||
|
meta-atp:
|
||||||
|
|
||||||
|
machine: gem5-atp-arm64
|
||||||
|
|
||||||
|
target:
|
||||||
|
- atp-native
|
||||||
|
- core-image-minimal
|
||||||
@@ -3,4 +3,4 @@ header:
|
|||||||
includes:
|
includes:
|
||||||
- base.yml
|
- base.yml
|
||||||
|
|
||||||
machine: foundation-armv8
|
machine: generic-arm64
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -u
|
|
||||||
|
|
||||||
HOST_ARCH=$(uname -m)
|
|
||||||
VER="10.2-2020.11"
|
|
||||||
|
|
||||||
DOWNLOAD_DIR=$1
|
|
||||||
TOOLCHAIN_DIR=$2
|
|
||||||
TOOLCHAIN_LINK_DIR=$3
|
|
||||||
|
|
||||||
# These should be already created by .gitlab-ci.yml, but do here if run outside of that env
|
|
||||||
mkdir -p $DOWNLOAD_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
|
|
||||||
|
|
||||||
if [ $HOST_ARCH = "aarch64" ]; then
|
|
||||||
#AArch64 Linux hosted cross compilers
|
|
||||||
|
|
||||||
#AArch32 target with hard float (arm-none-linux-gnueabihf)
|
|
||||||
wget -P $DOWNLOAD_DIR -nc https://developer.arm.com/-/media/Files/downloads/gnu-a/$VER/binrel/gcc-arm-$VER-$HOST_ARCH-arm-none-linux-gnueabihf.tar.xz
|
|
||||||
elif [ $HOST_ARCH = "x86_64" ]; then
|
|
||||||
#x86_64 Linux hosted cross compilers
|
|
||||||
|
|
||||||
#AArch32 target with hard float (arm-linux-none-gnueabihf)
|
|
||||||
wget -P $DOWNLOAD_DIR -nc https://developer.arm.com/-/media/Files/downloads/gnu-a/$VER/binrel/gcc-arm-$VER-$HOST_ARCH-arm-none-linux-gnueabihf.tar.xz
|
|
||||||
|
|
||||||
#AArch64 GNU/Linux target (aarch64-none-linux-gnu)
|
|
||||||
wget -P $DOWNLOAD_DIR -nc https://developer.arm.com/-/media/Files/downloads/gnu-a/$VER/binrel/gcc-arm-$VER-$HOST_ARCH-aarch64-none-linux-gnu.tar.xz
|
|
||||||
|
|
||||||
#AArch64 GNU/Linux target (aarch64_be-none-linux-gnu)
|
|
||||||
wget -P $DOWNLOAD_DIR -nc https://developer.arm.com/-/media/Files/downloads/gnu-a/$VER/binrel/gcc-arm-$VER-$HOST_ARCH-aarch64_be-none-linux-gnu.tar.xz
|
|
||||||
else
|
|
||||||
echo "ERROR - Unknown build arch of $HOST_ARCH"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
for i in arm aarch64 aarch64_be; do
|
|
||||||
if [ ! -d $TOOLCHAIN_DIR/gcc-arm-$VER-$HOST_ARCH-$i-none-linux-gnu*/ ]; then
|
|
||||||
if [ ! -f $DOWNLOAD_DIR/gcc-arm-$VER-$HOST_ARCH-$i-none-linux-gnu*.tar.xz ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
tar -C $TOOLCHAIN_DIR -axvf $DOWNLOAD_DIR/gcc-arm-$VER-$HOST_ARCH-$i-none-linux-gnu*.tar.xz
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Setup a link for the toolchain to use local to the building machine (e.g., not in a shared location)
|
|
||||||
ln -s $TOOLCHAIN_DIR/gcc-arm-$VER-$HOST_ARCH-$i-none-linux-gnu* $TOOLCHAIN_LINK_DIR/$i
|
|
||||||
done
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
header:
|
||||||
|
version: 9
|
||||||
|
includes:
|
||||||
|
- base.yml
|
||||||
|
- meta-zephyr.yml
|
||||||
|
|
||||||
|
machine: microbit-v1
|
||||||
|
|
||||||
|
target:
|
||||||
|
- zephyr-philosophers
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
header:
|
||||||
|
version: 9
|
||||||
|
includes:
|
||||||
|
- base.yml
|
||||||
|
- meta-zephyr.yml
|
||||||
|
|
||||||
|
machine: qemu-cortex-a53
|
||||||
|
|
||||||
|
target:
|
||||||
|
- zephyr-philosophers
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
header:
|
||||||
|
version: 9
|
||||||
|
includes:
|
||||||
|
- base.yml
|
||||||
|
|
||||||
|
machine: qemuarm64-sbsa
|
||||||
|
|
||||||
|
target:
|
||||||
|
- core-image-base
|
||||||
|
- perf
|
||||||
|
- sbsa-acs
|
||||||
@@ -5,11 +5,6 @@ header:
|
|||||||
|
|
||||||
machine: qemuarm64-secureboot
|
machine: qemuarm64-secureboot
|
||||||
|
|
||||||
local_conf_header:
|
|
||||||
bugs: |
|
|
||||||
# Only ping until errors can be resolved
|
|
||||||
TEST_SUITES = "ping"
|
|
||||||
|
|
||||||
target:
|
target:
|
||||||
- core-image-base
|
- core-image-base
|
||||||
- perf
|
- perf
|
||||||
|
|||||||
@@ -4,8 +4,3 @@ header:
|
|||||||
- base.yml
|
- base.yml
|
||||||
|
|
||||||
machine: qemuarmv5
|
machine: qemuarmv5
|
||||||
|
|
||||||
local_conf_header:
|
|
||||||
bugs: |
|
|
||||||
# Remove parselogs until errors can be resolved
|
|
||||||
TEST_SUITES_remove = "parselogs"
|
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
header:
|
|
||||||
version: 9
|
|
||||||
|
|
||||||
local_conf_header:
|
|
||||||
testimage: |
|
|
||||||
IMAGE_CLASSES += "testimage"
|
|
||||||
TESTIMAGE_AUTO = "1"
|
|
||||||
slirp: |
|
|
||||||
TEST_RUNQEMUPARAMS = "slirp"
|
|
||||||
TEST_SERVER_IP = "127.0.0.1"
|
|
||||||
QEMU_USE_SLIRP = "1"
|
|
||||||
packages: |
|
|
||||||
IMAGE_FEATURES_append = " ssh-server-dropbear"
|
|
||||||
|
|
||||||
# Multiple targets are available, put it down to just one
|
|
||||||
target:
|
|
||||||
- core-image-base
|
|
||||||
@@ -36,6 +36,8 @@ if __name__ == "__main__":
|
|||||||
for repo in repositories:
|
for repo in repositories:
|
||||||
repodir = base_repodir / repo_shortname(repo)
|
repodir = base_repodir / repo_shortname(repo)
|
||||||
if repodir.exists():
|
if repodir.exists():
|
||||||
|
print("Updating %s..." % repo)
|
||||||
subprocess.run(["git", "-C", repodir, "fetch"], check=True)
|
subprocess.run(["git", "-C", repodir, "fetch"], check=True)
|
||||||
else:
|
else:
|
||||||
|
print("Cloning %s..." % repo)
|
||||||
subprocess.run(["git", "clone", "--bare", repo, repodir], check=True)
|
subprocess.run(["git", "clone", "--bare", repo, repodir], check=True)
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
header:
|
||||||
|
version: 9
|
||||||
|
|
||||||
|
distro: poky
|
||||||
|
machine: fvp-baser-aemv8r64
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
repos:
|
||||||
|
refspec: hardknott
|
||||||
|
|
||||||
|
repos:
|
||||||
|
meta-arm:
|
||||||
|
layers:
|
||||||
|
meta-arm:
|
||||||
|
meta-arm-bsp:
|
||||||
|
meta-arm-toolchain:
|
||||||
|
|
||||||
|
poky:
|
||||||
|
url: https://git.yoctoproject.org/git/poky
|
||||||
|
layers:
|
||||||
|
meta:
|
||||||
|
meta-poky:
|
||||||
|
|
||||||
|
local_conf_header:
|
||||||
|
base: |
|
||||||
|
CONF_VERSION = "1"
|
||||||
|
PACKAGE_CLASSES = "package_ipk"
|
||||||
|
PACKAGECONFIG_remove_pn-qemu-system-native = "gtk+ sdl"
|
||||||
|
EXTRA_IMAGE_FEATURES_append = " debug-tweaks"
|
||||||
|
|
||||||
|
target:
|
||||||
|
- core-image-minimal
|
||||||
+18
-17
@@ -4,8 +4,8 @@ meta-arm-autonomy Yocto Layer
|
|||||||
Introduction
|
Introduction
|
||||||
------------
|
------------
|
||||||
This layer provides an hypervisor based solution (currently based on Xen) for
|
This layer provides an hypervisor based solution (currently based on Xen) for
|
||||||
autonomous system. It contains recipes and classes to build host and guests
|
autonomous system. It contains recipes and classes to build host and guest
|
||||||
systems.
|
images.
|
||||||
|
|
||||||
To start using this layer, please check the
|
To start using this layer, please check the
|
||||||
[Quick Start Guide](documentation/arm-autonomy-quickstart.md).
|
[Quick Start Guide](documentation/arm-autonomy-quickstart.md).
|
||||||
@@ -16,13 +16,14 @@ This layer depends on several other Yocto layers:
|
|||||||
* meta-openembedded (https://git.openembedded.org/meta-openembedded)
|
* meta-openembedded (https://git.openembedded.org/meta-openembedded)
|
||||||
* poky (https://git.yoctoproject.org/poky)
|
* poky (https://git.yoctoproject.org/poky)
|
||||||
* meta-virtualization (https://git.yoctoproject.org/meta-virtualization)
|
* meta-virtualization (https://git.yoctoproject.org/meta-virtualization)
|
||||||
|
* meta-networking (git://git.openembedded.org/meta-openembedded)
|
||||||
|
|
||||||
Distribution Features
|
Distribution Features
|
||||||
---------------------
|
---------------------
|
||||||
This layer is adding the following Yocto DISTRO_FEATURES:
|
This layer adds the following Yocto DISTRO_FEATURES:
|
||||||
|
|
||||||
* arm-autonomy-host: this feature activates functionalities required to build
|
* arm-autonomy-host: this feature activates functionalities required to build
|
||||||
an autonomy host system. It is doing the following:
|
an autonomy host system. It has the following effects:
|
||||||
- add 'xen' and 'ipv4' to DISTRO_FEATURES.
|
- add 'xen' and 'ipv4' to DISTRO_FEATURES.
|
||||||
- add xen backend drivers to linux kernel configuration.
|
- add xen backend drivers to linux kernel configuration.
|
||||||
- To reduce the root filesystem image size the kernel image is not installed.
|
- To reduce the root filesystem image size the kernel image is not installed.
|
||||||
@@ -43,40 +44,40 @@ its documentation.
|
|||||||
Those documentation files should be checked for variables:
|
Those documentation files should be checked for variables:
|
||||||
- [xen-devicetree](documentation/xen-devicetree.md)
|
- [xen-devicetree](documentation/xen-devicetree.md)
|
||||||
- [xenguest-manager](documentation/xenguest-manager.md)
|
- [xenguest-manager](documentation/xenguest-manager.md)
|
||||||
- [xenguest-network-bridge](documentation/xenguest-network-bridge.md)
|
- [xenguest-network](documentation/xenguest-network.md)
|
||||||
|
|
||||||
BSPs
|
BSPs
|
||||||
----
|
----
|
||||||
This layer is adding the following machines:
|
This layer adds the following machine:
|
||||||
|
|
||||||
* arm64-autonomy-guest: this machines creates a minimal BSP suitable to be used
|
* arm64-autonomy-guest: This machine creates a minimal BSP suitable to be used
|
||||||
as an autonomy guest. It is in fact only activating ARM64 architecture and
|
as an autonomy guest. It is in fact only activating ARM64 architecture and
|
||||||
SMP in the linux kernel and is enabling the DISTRO_FEATURE
|
SMP in the linux kernel and is enabling the DISTRO_FEATURE
|
||||||
arm-autonomy-guest.
|
'arm-autonomy-guest'.
|
||||||
|
|
||||||
Images
|
Images
|
||||||
------
|
------
|
||||||
This layer is adding the following images:
|
This layer is adding the following images:
|
||||||
|
|
||||||
* arm-autonomy-host-image-minimal: this image includes all elements required
|
* arm-autonomy-host-image-minimal: This image includes all elements required
|
||||||
to create a minimal arm-autonomy-host system. This includes xen and tools to
|
to create a minimal arm-autonomy-host system. This includes xen, and tools to
|
||||||
manage xen guests. This image depends on 'arm-autonomy-host' distribution
|
manage xen guests and xenguest images. This image depends on
|
||||||
feature.
|
'arm-autonomy-host' distribution feature.
|
||||||
|
|
||||||
Recipes and classes
|
Recipes and classes
|
||||||
-------------------
|
-------------------
|
||||||
This layer is adding the following recipes and classes:
|
This layer adds the following recipes and classes:
|
||||||
|
|
||||||
* [xen-devicetree](documentation/xen-devicetree.md): this is a recipe to modify
|
* [xen-devicetree](documentation/xen-devicetree.md): This is a recipe to modify
|
||||||
a device tree blob to add information required to boot xen and a Dom0 linux.
|
a device tree blob to add information required to boot xen and a Dom0 linux.
|
||||||
|
|
||||||
* [xenguest-mkimage](documentation/xenguest-mkimage.md): this is a tool to
|
* [xenguest-mkimage](documentation/xenguest-mkimage.md): This is a tool used to
|
||||||
create and modify images to be used as Xen guests.
|
create and modify images to be used as Xen guests.
|
||||||
|
|
||||||
* [xenguest-manager](documentation/xenguest-manager.md): this is a tool to
|
* [xenguest-manager](documentation/xenguest-manager.md): This is a tool used to
|
||||||
create/remove/start/stop xen guest generated using xenguest-mkimage.
|
create/remove/start/stop xen guest generated using xenguest-mkimage.
|
||||||
|
|
||||||
* [xenguest-network-bridge](documentation/xenguest-network-bridge.md): this
|
* [xenguest-network](documentation/xenguest-network.md): This
|
||||||
recipe add tools and init scripts to create a bridge connected to the
|
recipe add tools and init scripts to create a bridge connected to the
|
||||||
external network on the host and allow guests to be connected to it.
|
external network on the host and allow guests to be connected to it.
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# This class is to be inherited by image recipes that want to build and install
|
||||||
|
# an alternate kernel (set via PREFERRED_PROVIDER_alternate/kernel).
|
||||||
|
#
|
||||||
|
# It is mandatory to also set the KERNEL_PACKAGE_NAME for the alternate kernel
|
||||||
|
# recipe via KERNEL_PACKAGE_NAME_pn-${PREFERRED_PROVIDER_alternate/kernel} and
|
||||||
|
# its value needs to be different from "kernel" since this is the default set
|
||||||
|
# for PREFERRED_PROVIDER_virtual/kernel.
|
||||||
|
#
|
||||||
|
# An example of these settings can be found at meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/n1sdp-extra-settings.inc
|
||||||
|
#
|
||||||
|
# When building and installing an alternate kernel, the kernel-modules packages
|
||||||
|
# for both virtual/kernel and alternate/kernel will be installed.
|
||||||
|
|
||||||
|
PREFERRED_PROVIDER_alternate/kernel ??= ""
|
||||||
|
|
||||||
|
python () {
|
||||||
|
alternate_kernel = d.getVar('PREFERRED_PROVIDER_alternate/kernel')
|
||||||
|
if alternate_kernel:
|
||||||
|
alternate_kernel_pkg_name = d.getVar('KERNEL_PACKAGE_NAME_pn-%s' % alternate_kernel)
|
||||||
|
if alternate_kernel_pkg_name:
|
||||||
|
d.appendVar('EXTRA_IMAGEDEPENDS', ' ' + alternate_kernel)
|
||||||
|
d.appendVar('IMAGE_INSTALL', ' kernel-modules')
|
||||||
|
d.appendVar('IMAGE_INSTALL', ' ' + alternate_kernel_pkg_name + '-modules')
|
||||||
|
else:
|
||||||
|
raise bb.parse.SkipRecipe("No KERNEL_PACKAGE_NAME_pn-%s set" % alternate_kernel )
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
# Docker Extern Containers
|
||||||
|
#
|
||||||
|
# This class allows docker image tarballs to be installed in the rootfs
|
||||||
|
#
|
||||||
|
# The images can be selected using the variable CONTAINER_IMAGE_FILES which
|
||||||
|
# should contain a space seperated list of absolute paths or yocto urls for
|
||||||
|
# docker images that have been exported using docker export:
|
||||||
|
# - https://docs.docker.com/engine/reference/commandline/export/
|
||||||
|
#
|
||||||
|
# src_uri_parse_var.bbclass is used to parse CONTAINER_IMAGE_FILES
|
||||||
|
#
|
||||||
|
# There are 4 supported formats for CONTAINER_IMAGE_FILES entries:
|
||||||
|
#
|
||||||
|
# - http/https url
|
||||||
|
# - CONTAINER_IMAGE_FILES = "https://[url]:[port]/alpine.tar;md5sum=..."
|
||||||
|
#
|
||||||
|
# - file:// absolute local path from root
|
||||||
|
# - CONTAINER_IMAGE_FILES = "file:///containers/alpine2.tar"
|
||||||
|
#
|
||||||
|
# - file:// path relative to FILESEXTRAPATHS
|
||||||
|
# - CONTAINER_IMAGE_FILES = "file://foo/alpine3.tar"
|
||||||
|
# FILESEXTRAPATHS .= "/containers:"
|
||||||
|
#
|
||||||
|
# - plain absolute local path from root
|
||||||
|
# - CONTAINER_IMAGE_FILES = "/containers/foo/bar/alpine4.tar"
|
||||||
|
#
|
||||||
|
# It is not recommended to use other yocto URL types, as they may result in
|
||||||
|
# undefined behaviour.
|
||||||
|
#
|
||||||
|
# A semicolon seperated list of install arguments can follow each image path:
|
||||||
|
# - conname : the name that will be attached when the image is imported
|
||||||
|
# (default: [filename, without extension])
|
||||||
|
# - contag : the tag that will be attached when the image is imported
|
||||||
|
# (default: local)
|
||||||
|
# - conkeep : Flag for whether the exported container image file should be
|
||||||
|
# kept once the import has been completed
|
||||||
|
# (default: 0)
|
||||||
|
#
|
||||||
|
# Any other arguments, for example an md5sum, will be assumed to be fetch
|
||||||
|
# arguments, and will be kept when the path is added to the SRC_URI
|
||||||
|
#
|
||||||
|
# e.g. CONTAINER_IMAGE_FILES = "\
|
||||||
|
# https://[url]:[port]/alpine.tar;md5sum=[checksum];conkeep=1 \
|
||||||
|
# file:///containers/alpine2.tar;contag=latest;conname=docker2 \
|
||||||
|
# file://foo/alpine3.tar \
|
||||||
|
# /containers/foo/bar/alpine4.tar;contag=1.0;conkeep=1 "
|
||||||
|
#
|
||||||
|
# Resulting Manifest:
|
||||||
|
# ARCHIVE NAME TAG KEEP
|
||||||
|
# alpine.tar alpine local 1
|
||||||
|
# alpine2.tar docker2 latest 0
|
||||||
|
# alpine3.tar alpine3 local 0
|
||||||
|
# alpine4.tar alpine4 1.0 1
|
||||||
|
#
|
||||||
|
# Other configurable variables:
|
||||||
|
# CONTAINERS_INSTALL_DIR : The folder underneath ${WORKDIR} where the docker
|
||||||
|
# images will be stored
|
||||||
|
# (default: "/usr/share/docker/images")
|
||||||
|
# CONTAINERS_MANIFEST : The name of the manifest file containing image
|
||||||
|
# parameters, also stored in CONTAINERS_INSTALL_DIR
|
||||||
|
# (default: "containers.manifest")
|
||||||
|
# CONTAINERS_TAG_DEFAULT : Use this to change the value that will be used as
|
||||||
|
# contag if no value is provided
|
||||||
|
# (default: "local")
|
||||||
|
# CONTAINERS_KEEP_DEFAULT : Use this to change the value that will be used for
|
||||||
|
# conkeep if no value is provided
|
||||||
|
# (default: "0")
|
||||||
|
#
|
||||||
|
|
||||||
|
inherit features_check
|
||||||
|
|
||||||
|
REQUIRED_DISTRO_FEATURES = "docker"
|
||||||
|
|
||||||
|
RDEPENDS_${PN} = "packagegroup-docker-runtime-minimal"
|
||||||
|
|
||||||
|
CONTAINER_IMAGE_FILES ??= ""
|
||||||
|
CONTAINERS_INSTALL_DIR ??= "${datadir}/docker/images"
|
||||||
|
CONTAINERS_MANIFEST ??= "containers.manifest"
|
||||||
|
CONTAINERS_TAG_DEFAULT ??= "local"
|
||||||
|
CONTAINERS_KEEP_DEFAULT ??= "0"
|
||||||
|
|
||||||
|
inherit set_src_uri_from_var
|
||||||
|
|
||||||
|
SRC_URI_FROM_VAR_NAME = "CONTAINER_IMAGE_FILES"
|
||||||
|
# Define installation params
|
||||||
|
SRC_URI_FROM_VAR_MANIFEST_PARAMS = "conname=[basename] \
|
||||||
|
contag=${CONTAINERS_TAG_DEFAULT} conkeep=${CONTAINERS_KEEP_DEFAULT}"
|
||||||
|
|
||||||
|
SRC_URI_FROM_VAR_UNPACK_DIR = "containers"
|
||||||
|
|
||||||
|
# Read manifest and install container images
|
||||||
|
do_install() {
|
||||||
|
local archive name tag keep
|
||||||
|
|
||||||
|
if [ -f "${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}/manifest" ]; then
|
||||||
|
|
||||||
|
install -d "${D}${CONTAINERS_INSTALL_DIR}"
|
||||||
|
install -m 644 \
|
||||||
|
"${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}/manifest" \
|
||||||
|
"${D}${CONTAINERS_INSTALL_DIR}/${CONTAINERS_MANIFEST}"
|
||||||
|
|
||||||
|
while read -r archive name tag keep _; do
|
||||||
|
[ -f "${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}/${archive}" ] ||
|
||||||
|
bbfatal "${archive} does not exist"
|
||||||
|
|
||||||
|
install -m 644 \
|
||||||
|
"${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}/${archive}" \
|
||||||
|
"${D}${CONTAINERS_INSTALL_DIR}/${archive}"
|
||||||
|
done < "${D}${CONTAINERS_INSTALL_DIR}/${CONTAINERS_MANIFEST}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
do_install[vardeps] += "CONTAINER_IMAGE_FILES"
|
||||||
|
|
||||||
|
FILES_${PN} += "${CONTAINERS_INSTALL_DIR}"
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# Create a xenguest image with kernel and filesystem produced by Yocto
|
# Create a xenguest image with kernel and filesystem produced by Yocto
|
||||||
# This will create a .xenguest file that the xenguest-manager can use.
|
# This will create a .xenguest file that the xenguest-manager can use.
|
||||||
|
|
||||||
inherit xenguest-image
|
inherit xenguest_image
|
||||||
|
|
||||||
# We are creating our guest in a local subdirectory
|
# We are creating our guest in a local subdirectory
|
||||||
# force the value so that we are not impacted if the user is changing it
|
# force the value so that we are not impacted if the user is changing it
|
||||||
@@ -63,6 +63,67 @@ IMAGE_TYPEDEP_xenguest ?= "tar"
|
|||||||
IMAGE_TYPES_MASKED += "xenguest"
|
IMAGE_TYPES_MASKED += "xenguest"
|
||||||
IMAGE_TYPES += "xenguest"
|
IMAGE_TYPES += "xenguest"
|
||||||
|
|
||||||
|
XENGUEST_IMAGE_RECIPE = "${PN}"
|
||||||
|
XENGUEST_IMAGE_VARS += "XENGUEST_IMAGE_RECIPE"
|
||||||
|
|
||||||
|
# Merge intermediate env files from all recipes into a single file
|
||||||
|
python do_merge_xenguestenv () {
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
# Open final merged file in DEPLOY_DIR_IMAGE for writing, or create
|
||||||
|
outdir = d.getVar('DEPLOY_DIR_IMAGE')
|
||||||
|
with open(os.path.join(outdir,'xenguest.env'), 'w') as merged_file:
|
||||||
|
|
||||||
|
# Adds vars from xenguest_image to list
|
||||||
|
merged_env = []
|
||||||
|
xenguest_vars = d.getVar('XENGUEST_IMAGE_VARS')
|
||||||
|
for var in xenguest_vars.split():
|
||||||
|
value = d.getVar(var)
|
||||||
|
if value:
|
||||||
|
merged_env.append(var + "=" + " ".join(value.split()) + "\n")
|
||||||
|
|
||||||
|
# Resolve dependencies for this task to find names of intermediate
|
||||||
|
# .xenguestenv files
|
||||||
|
taskdepdata = d.getVar('BB_TASKDEPDATA')
|
||||||
|
task_mc = d.getVar('BB_CURRENT_MC')
|
||||||
|
task_file = d.getVar('FILE')
|
||||||
|
|
||||||
|
# See runqueue.py function build_taskdepdata
|
||||||
|
DEPS_INDEX = 3
|
||||||
|
|
||||||
|
depdata_key = task_file + ":do_merge_xenguestenv"
|
||||||
|
|
||||||
|
# If in a multiconfig, need to add that to the key
|
||||||
|
if task_mc != "default":
|
||||||
|
depdata_key = "mc:" + task_mc + ":" + depdata_key
|
||||||
|
|
||||||
|
# Retrieve filename using regex
|
||||||
|
get_filename = re.compile(r'/([^/]+\.bb):do_deploy_xenguestenv$')
|
||||||
|
env_dir = d.getVar('XENGUEST_ENV_STAGING_DIR')
|
||||||
|
|
||||||
|
for task_dep in taskdepdata[depdata_key][DEPS_INDEX]:
|
||||||
|
if task_dep.endswith(":do_deploy_xenguestenv"):
|
||||||
|
filename = re.search(get_filename, task_dep).group(1) + ".xenguestenv"
|
||||||
|
bb.note("Merging: " + filename)
|
||||||
|
try:
|
||||||
|
with open(env_dir + "/" + filename, 'r') as f:
|
||||||
|
# Eliminate duplicates
|
||||||
|
merged_env = list(set(merged_env + f.readlines()))
|
||||||
|
except (FileNotFoundError, IOError):
|
||||||
|
bb.note(" " + filename + " has no extra vars")
|
||||||
|
|
||||||
|
# Sort Alphabetically and write
|
||||||
|
merged_env.sort()
|
||||||
|
merged_file.write("".join(merged_env))
|
||||||
|
}
|
||||||
|
do_merge_xenguestenv[dirs] = "${DEPLOY_DIR_IMAGE}"
|
||||||
|
do_merge_xenguestenv[vardeps] += "${XENGUEST_IMAGE_VARS}"
|
||||||
|
do_merge_xenguestenv[vardepsexclude] += "BB_TASKDEPDATA"
|
||||||
|
do_merge_xenguestenv[recrdeptask] += "do_deploy_xenguestenv"
|
||||||
|
|
||||||
|
addtask merge_xenguestenv before do_populate_lic_deploy after do_image_complete
|
||||||
|
|
||||||
python __anonymous() {
|
python __anonymous() {
|
||||||
# Do not do anything if we are not in the want FSTYPES
|
# Do not do anything if we are not in the want FSTYPES
|
||||||
if bb.utils.contains_any('IMAGE_FSTYPES', 'xenguest', '1', '0', d):
|
if bb.utils.contains_any('IMAGE_FSTYPES', 'xenguest', '1', '0', d):
|
||||||
|
|||||||
@@ -3,7 +3,10 @@
|
|||||||
# This is done using kernel-fitimage as model
|
# This is done using kernel-fitimage as model
|
||||||
# To activate this, kernel-xenguest must be added to KERNEL_CLASSES
|
# To activate this, kernel-xenguest must be added to KERNEL_CLASSES
|
||||||
|
|
||||||
inherit xenguest-image
|
# Add a variable name to XENGUEST_IMAGE_VARS_EXTRA if you want it to
|
||||||
|
# appear in xenguest.env when the image is deployed
|
||||||
|
|
||||||
|
inherit xenguest_image
|
||||||
|
|
||||||
# use a local copy to pack all together
|
# use a local copy to pack all together
|
||||||
XENGUEST_IMAGE_DEPLOY_DIR = "${WORKDIR}/tmp-xenguest"
|
XENGUEST_IMAGE_DEPLOY_DIR = "${WORKDIR}/tmp-xenguest"
|
||||||
@@ -24,7 +27,7 @@ do_assemble_xenguest_initramfs() {
|
|||||||
rm -f ${B}/${KERNEL_OUTPUT_DIR}/Image-initramfs.xenguest
|
rm -f ${B}/${KERNEL_OUTPUT_DIR}/Image-initramfs.xenguest
|
||||||
call_xenguest_mkimage pack ${B}/${KERNEL_OUTPUT_DIR}/Image-initramfs.xenguest
|
call_xenguest_mkimage pack ${B}/${KERNEL_OUTPUT_DIR}/Image-initramfs.xenguest
|
||||||
}
|
}
|
||||||
do_assemble_xenguest_initramfs[depends] += "${INITRAMFS_IMAGE}:do_image_complete"
|
do_assemble_xenguest_initramfs[depends] += "${INITRAMFS_IMAGE}:do_merge_xenguestenv"
|
||||||
|
|
||||||
kernel_do_deploy_append() {
|
kernel_do_deploy_append() {
|
||||||
if [ -f "${B}/${KERNEL_OUTPUT_DIR}/Image-initramfs.xenguest" ]; then
|
if [ -f "${B}/${KERNEL_OUTPUT_DIR}/Image-initramfs.xenguest" ]; then
|
||||||
|
|||||||
@@ -0,0 +1,224 @@
|
|||||||
|
# Set SRC_URI from Variable
|
||||||
|
|
||||||
|
# This class parses a variable named in SRC_URI_FROM_VAR_NAME for entries that
|
||||||
|
# should be added to the SRC_URI
|
||||||
|
#
|
||||||
|
# There are 4 supported formats for entries:
|
||||||
|
#
|
||||||
|
# - http/https url
|
||||||
|
# - Note that a checksum (md5sum or sha256sum) must be provided for http(s)
|
||||||
|
#
|
||||||
|
# - file:// absolute local path from root
|
||||||
|
# - In this case the filename will be added to SRC_URI and the path from '/'
|
||||||
|
# added to FILESEXTRAPATHS
|
||||||
|
#
|
||||||
|
# - file:// path relative to FILESEXTRAPATHS
|
||||||
|
# - In this case the filename will be added to SRC_URI and the preceding path
|
||||||
|
# added to FILESOVERRIDES, so that the full path to the file will
|
||||||
|
# be available in FILESPATH when it is generated by combining
|
||||||
|
# FILESEXTRAPATHS and FILESOVERRIDES.
|
||||||
|
#
|
||||||
|
# - plain absolute local path from root
|
||||||
|
# - This will be treated the same as an file:// path from root. Plain paths
|
||||||
|
# must be absolute, and cannot be relative to FILESEXTRAPATHS
|
||||||
|
#
|
||||||
|
# It is not recommended to use other yocto URL types, as they may result in
|
||||||
|
# undefined behaviour.
|
||||||
|
#
|
||||||
|
# These entries will be added to the SRC_URI so that the yocto fetcher can
|
||||||
|
# unpack a copy into ${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# A list of arguments can follow each entry in the input variable, seperated
|
||||||
|
# by semi-colons (;). Arguments may be FETCH arguments or MANIFEST arguments.
|
||||||
|
#
|
||||||
|
# FETCH arguments will be appended to the entry in SRC_URI, for example
|
||||||
|
# "downloadfilename" to specify the filename used when storing a
|
||||||
|
# downloaded file.
|
||||||
|
# Each SRC_URI entry will automatically have the arguments
|
||||||
|
# "unpack=0;subdir=${SRC_URI_FROM_VAR_UNPACK_DIR}" added to them, so do not
|
||||||
|
# attempt to set these options.
|
||||||
|
#
|
||||||
|
# MANIFEST arguments are defined in the variable
|
||||||
|
# SRC_URI_FROM_VAR_MANIFEST_PARAMS which should be a space seperated list of
|
||||||
|
# names, each optionally followed by an equals sign (=) and a default value.
|
||||||
|
#
|
||||||
|
# The values provided for the manifest arguments will be written to the manifest
|
||||||
|
# file in ${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR} as columns, in the same
|
||||||
|
# order as they appear in SRC_URI_FROM_VAR_MANIFEST_PARAMS.
|
||||||
|
#
|
||||||
|
# For entries that do not provide a value for a manifest argument, the default
|
||||||
|
# value will be used if possible.
|
||||||
|
# If no default is availale, omitting the parameter on any item will cause
|
||||||
|
# an error.
|
||||||
|
#
|
||||||
|
# "[basename]" is a special case default that will set the value to
|
||||||
|
# the filename without the path or file extension.
|
||||||
|
#
|
||||||
|
# e.g.
|
||||||
|
# SRC_URI_FROM_VAR_MANIFEST_PARAMS="conname=[basename] contag=local conkeep"
|
||||||
|
#
|
||||||
|
# Any arguments that follow an entry in SRC_URI_FROM_VAR_NAME, that are not
|
||||||
|
# named in SRC_URI_FROM_VAR_MANIFEST_PARAMS are assumed to be FETCH arguments,
|
||||||
|
# so are added to the corresponding entry in the SRC_URI.
|
||||||
|
|
||||||
|
SRC_URI_FROM_VAR_NAME ??= ""
|
||||||
|
SRC_URI_FROM_VAR_MANIFEST_PARAMS ??= ""
|
||||||
|
SRC_URI_FROM_VAR_UNPACK_DIR ??= "items"
|
||||||
|
|
||||||
|
python __anonymous() {
|
||||||
|
|
||||||
|
parse_var = d.getVar('SRC_URI_FROM_VAR_NAME')
|
||||||
|
|
||||||
|
if not parse_var:
|
||||||
|
return
|
||||||
|
|
||||||
|
parse_var_items = d.getVar(parse_var)
|
||||||
|
|
||||||
|
if parse_var_items:
|
||||||
|
for item in parse_var_items.split(' '):
|
||||||
|
if not item:
|
||||||
|
continue
|
||||||
|
|
||||||
|
if item.startswith('/'):
|
||||||
|
# If not a Yocto URL, must be an absolute path
|
||||||
|
yocto_url = "file://" + item
|
||||||
|
else:
|
||||||
|
# Otherwise assume valid Yocto URL.
|
||||||
|
# Error case is caught later
|
||||||
|
yocto_url = item
|
||||||
|
|
||||||
|
fetcher = host = path = parm = None
|
||||||
|
try:
|
||||||
|
# Attempt to parse a Yocto URL
|
||||||
|
fetcher,host,path,_,_,parm = bb.fetch.decodeurl(yocto_url)
|
||||||
|
except:
|
||||||
|
# Something invalid is in the variable!
|
||||||
|
raise bb.parse.SkipRecipe(parse_var + \
|
||||||
|
" contains an invalid entry:\n'" + \
|
||||||
|
item + "'")
|
||||||
|
|
||||||
|
# This var is space seperated list of parameter names,
|
||||||
|
# with optional default value following an equals sign
|
||||||
|
# (name=default)
|
||||||
|
item_params_str = d.getVar('SRC_URI_FROM_VAR_MANIFEST_PARAMS')
|
||||||
|
|
||||||
|
# remove directories from path
|
||||||
|
filename = os.path.basename(path)
|
||||||
|
|
||||||
|
if "downloadfilename" in parm:
|
||||||
|
filename = parm["downloadfilename"]
|
||||||
|
|
||||||
|
item_manifest_args = {"filename": filename}
|
||||||
|
|
||||||
|
if item_params_str:
|
||||||
|
# required manifest arguments have been provided
|
||||||
|
|
||||||
|
# If no default is given add "=" for map parsing
|
||||||
|
item_params_list = [ arg + "=" if '=' not in arg
|
||||||
|
else arg
|
||||||
|
for arg in item_params_str.split(' ')
|
||||||
|
]
|
||||||
|
|
||||||
|
# Generate key value pairs of argument names and
|
||||||
|
# default values
|
||||||
|
item_params_map = dict( (name.strip(), val.strip())
|
||||||
|
for name, val in (arg.split('=')
|
||||||
|
for arg in item_params_list)
|
||||||
|
)
|
||||||
|
|
||||||
|
for argname in item_params_map:
|
||||||
|
# Iterate over required manifest arguments
|
||||||
|
|
||||||
|
argvalue = parm.pop(argname, None)
|
||||||
|
if argvalue:
|
||||||
|
# a value has been provided for this item
|
||||||
|
item_manifest_args[argname] = argvalue
|
||||||
|
|
||||||
|
else:
|
||||||
|
# No value provided, process default value
|
||||||
|
default = item_params_map[argname]
|
||||||
|
if default:
|
||||||
|
# A default value is provided
|
||||||
|
if default == "[basename]":
|
||||||
|
# use the filename without extension
|
||||||
|
default = os.path.splitext(filename)[0]
|
||||||
|
|
||||||
|
# store default value in dict
|
||||||
|
item_manifest_args[argname] = default
|
||||||
|
|
||||||
|
else:
|
||||||
|
# No default provided
|
||||||
|
raise bb.fatal(parse_var + \
|
||||||
|
" entry is missing a required parameter '" + \
|
||||||
|
argname + "':\n'" + item + "'")
|
||||||
|
|
||||||
|
# Write value to var flags to ensure data structure is preserved
|
||||||
|
# Each entry of parse_var will have a varflag where the value
|
||||||
|
# is a dictionary of argument names and values
|
||||||
|
d.setVarFlags(parse_var, {item: item_manifest_args})
|
||||||
|
|
||||||
|
src_uri_entry_suffix = ';'
|
||||||
|
|
||||||
|
# HTTP(S) fetcher must provide a checksum
|
||||||
|
if fetcher.startswith('http') and not \
|
||||||
|
( 'md5sum' in parm or 'sha256sum' in parm ):
|
||||||
|
# Ensure http/https fetchers get a checksum
|
||||||
|
raise bb.parse.SkipRecipe(parse_var + \
|
||||||
|
" entry is missing a checksum:\n'" + \
|
||||||
|
item + "'")
|
||||||
|
|
||||||
|
# add remaining fetch parameters including checksum
|
||||||
|
for arg in parm:
|
||||||
|
src_uri_entry_suffix += ";" + arg + "=" + parm[arg]
|
||||||
|
|
||||||
|
# Add default and extra parameters to SRC_URI entry
|
||||||
|
src_uri_entry_suffix += ';unpack=0;subdir=' + \
|
||||||
|
d.getVar('SRC_URI_FROM_VAR_UNPACK_DIR')
|
||||||
|
|
||||||
|
if fetcher == 'file':
|
||||||
|
# Prevent local fetcher from re-creating dir structure
|
||||||
|
filedir = os.path.split(path)[0]
|
||||||
|
if filedir.startswith('/'):
|
||||||
|
# Path is from the root
|
||||||
|
d.appendVar('FILESEXTRAPATHS', filedir + ':')
|
||||||
|
else:
|
||||||
|
# Path is relative to FILESEXTRAPATHS
|
||||||
|
d.appendVar('FILESOVERRIDES', ':' + filedir)
|
||||||
|
|
||||||
|
# Add filename without path to SRC_URI
|
||||||
|
d.appendVar('SRC_URI', ' file://' + \
|
||||||
|
filename + src_uri_entry_suffix)
|
||||||
|
else:
|
||||||
|
# Add full entry to SRC_URI
|
||||||
|
d.appendVar('SRC_URI', ' ' + fetcher + \
|
||||||
|
"://" + host + path + src_uri_entry_suffix)
|
||||||
|
}
|
||||||
|
|
||||||
|
python generate_manifest() {
|
||||||
|
|
||||||
|
parse_var = d.getVar('SRC_URI_FROM_VAR_NAME')
|
||||||
|
|
||||||
|
if not parse_var:
|
||||||
|
return
|
||||||
|
|
||||||
|
target_dir = os.path.join(d.getVar('WORKDIR'),
|
||||||
|
d.getVar('SRC_URI_FROM_VAR_UNPACK_DIR'))
|
||||||
|
|
||||||
|
# Write a manifest file containing the parameters so SRC_URI
|
||||||
|
# doesn't need to be parsed by do_install
|
||||||
|
with open (target_dir + "/manifest", 'w') as manifest_file:
|
||||||
|
manifest_args = d.getVarFlags(parse_var)
|
||||||
|
|
||||||
|
parse_var_items = d.getVar(parse_var)
|
||||||
|
|
||||||
|
if parse_var_items:
|
||||||
|
for item in parse_var_items.split():
|
||||||
|
|
||||||
|
manifest_file.write(" ".join(manifest_args[item].values())+"\n")
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
do_unpack[cleandirs] += "${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}"
|
||||||
|
do_unpack[postfuncs] += "generate_manifest"
|
||||||
|
do_unpack[vardeps] += "${SRC_URI_FROM_VAR_NAME}"
|
||||||
+73
-21
@@ -30,7 +30,7 @@ XENGUEST_IMAGE_ROOT ??= "/dev/xvda1"
|
|||||||
# Guest kernel command line arguments
|
# Guest kernel command line arguments
|
||||||
XENGUEST_IMAGE_CMDLINE ??= "earlyprintk=xenboot console=hvc0 rw"
|
XENGUEST_IMAGE_CMDLINE ??= "earlyprintk=xenboot console=hvc0 rw"
|
||||||
|
|
||||||
# Extra commands to add to xenguest-image when creating the image
|
# Extra commands to add to xenguest_image when creating the image
|
||||||
XENGUEST_IMAGE_EXTRA_CMD ??= ""
|
XENGUEST_IMAGE_EXTRA_CMD ??= ""
|
||||||
|
|
||||||
# Kernel binary
|
# Kernel binary
|
||||||
@@ -43,14 +43,17 @@ XENGUEST_IMAGE_KERNEL ??= "Image"
|
|||||||
# be included in the xenguest image)
|
# be included in the xenguest image)
|
||||||
XENGUEST_IMAGE_DISK_SIZE ??= "${@ '4' if not d.getVar('INITRAMFS_IMAGE') else '0'}"
|
XENGUEST_IMAGE_DISK_SIZE ??= "${@ '4' if not d.getVar('INITRAMFS_IMAGE') else '0'}"
|
||||||
|
|
||||||
|
# set empty partition to be used by xenguest-manager for this image
|
||||||
|
XENGUEST_IMAGE_DISK_DEVICE ??= ""
|
||||||
|
|
||||||
#
|
#
|
||||||
# XENGUEST_IMAGE_DISK PARTITIONS is used to describe the partitions to setup
|
# XENGUEST_IMAGE_DISK_PARTITIONS is used to describe the partitions to setup
|
||||||
# and their content.
|
# and their content.
|
||||||
# It must be set to a space separated list of entries with each entry having
|
# It must be set to a space separated list of entries with each entry having
|
||||||
# the format num:sz:fs:[file] where:
|
# the format num:sz:[fs]:[file] where:
|
||||||
# - num is a partition number
|
# - num is a partition number
|
||||||
# - sz is the partition size in Gigabit
|
# - sz is the partition size in MB or GB(default), e.g 1000M or 1[G]
|
||||||
# - fs is the filesystem to use for the partition
|
# - fs is optional filesystem to use for the partition
|
||||||
# - file is optionally pointing to a file to use as content of the partition
|
# - file is optionally pointing to a file to use as content of the partition
|
||||||
# Please check image_types_xenguest.bbclass for rootfs handling of files
|
# Please check image_types_xenguest.bbclass for rootfs handling of files
|
||||||
#
|
#
|
||||||
@@ -80,6 +83,18 @@ XENGUEST_IMAGE_DEPLOY_SUBDIR ?= "xenguest"
|
|||||||
# - something in ${WORKDIR} if you need to clone and manipulate an image
|
# - something in ${WORKDIR} if you need to clone and manipulate an image
|
||||||
XENGUEST_IMAGE_DEPLOY_DIR ??= "${DEPLOYDIR}"
|
XENGUEST_IMAGE_DEPLOY_DIR ??= "${DEPLOYDIR}"
|
||||||
|
|
||||||
|
# These vars are used by image_types_xenguest.bbclass to generate the
|
||||||
|
# xenguest.env file. In a recipe that inherits this class and extra variables
|
||||||
|
# that should be included in xenguest.env need to be added to
|
||||||
|
# XENGUEST_IMAGE_VARS_EXTRA
|
||||||
|
XENGUEST_IMAGE_VARS ?= "\
|
||||||
|
MACHINE DISTRO DISTRO_VERSION DISTRO_FEATURES TUNE_FEATURES TARGET_FPU \
|
||||||
|
IMAGE_FEATURES INITRAMFS_IMAGE_BUNDLE INITRAMFS_IMAGE \
|
||||||
|
XENGUEST_IMAGE_MEMORY_SIZE XENGUEST_IMAGE_NUM_VCPUS XENGUEST_IMAGE_AUTOBOOT \
|
||||||
|
XENGUEST_IMAGE_ROOT XENGUEST_IMAGE_CMDLINE XENGUEST_IMAGE_EXTRA_CMD \
|
||||||
|
XENGUEST_IMAGE_KERNEL XENGUEST_IMAGE_DISK_SIZE XENGUEST_IMAGE_DISK_DEVICE \
|
||||||
|
XENGUEST_IMAGE_DISK_PARTITIONS XENGUEST_IMAGE_NETWORK_TYPE"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Wrapper to call xenguest-mkimage
|
# Wrapper to call xenguest-mkimage
|
||||||
# It is using XENGUEST_IMAGE_DEPLOY_DIR and XENGUEST_IMAGE_DEPLOY_SUBDIR
|
# It is using XENGUEST_IMAGE_DEPLOY_DIR and XENGUEST_IMAGE_DEPLOY_SUBDIR
|
||||||
@@ -129,21 +144,27 @@ xenguest_image_create() {
|
|||||||
|
|
||||||
# create disk if needed
|
# create disk if needed
|
||||||
disksize="${XENGUEST_IMAGE_DISK_SIZE}"
|
disksize="${XENGUEST_IMAGE_DISK_SIZE}"
|
||||||
if [ -z "$disksize" ]; then
|
case ${disksize:=0} in
|
||||||
disksize="0"
|
0|0M|0G)
|
||||||
fi
|
;;
|
||||||
if [ $disksize -gt 0 ]; then
|
*)
|
||||||
# setup disk size
|
# setup disk size
|
||||||
call_xenguest_mkimage update --disk-reset-config --disk-size=$disksize
|
call_xenguest_mkimage update --disk-reset-config --disk-size=$disksize
|
||||||
|
|
||||||
|
diskparts="${XENGUEST_IMAGE_DISK_PARTITIONS}"
|
||||||
|
if [ -n "$diskparts" ]; then
|
||||||
|
for arg in $diskparts; do
|
||||||
|
call_xenguest_mkimage update --disk-add-part=$arg
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
diskdevice="${XENGUEST_IMAGE_DISK_DEVICE}"
|
||||||
|
if [ -n "$diskdevice" ]; then
|
||||||
|
call_xenguest_mkimage update --disk-device="${diskdevice}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
diskparts="${XENGUEST_IMAGE_DISK_PARTITIONS}"
|
|
||||||
if [ -n "$diskparts" ]; then
|
|
||||||
for arg in $diskparts; do
|
|
||||||
call_xenguest_mkimage update --disk-add-part=$arg
|
|
||||||
partnum="$(expr $partnum + 1)"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${XENGUEST_IMAGE_AUTOBOOT}" = "1" ]; then
|
if [ "${XENGUEST_IMAGE_AUTOBOOT}" = "1" ]; then
|
||||||
call_xenguest_mkimage update --set-param=GUEST_AUTOBOOT=1
|
call_xenguest_mkimage update --set-param=GUEST_AUTOBOOT=1
|
||||||
@@ -158,7 +179,38 @@ xenguest_image_create() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
XENGUEST_ENV_STAGING_DIR ??= "${STAGING_DIR}/${MACHINE}/xenguestenv"
|
||||||
|
|
||||||
|
# Create an intermediary file containing all variables used to by a
|
||||||
|
# particular recipe that inherits this class
|
||||||
|
|
||||||
|
# File will contain the values of all variables listed in:
|
||||||
|
# XENGUEST_IMAGE_VARS_EXTRA
|
||||||
|
python do_deploy_xenguestenv () {
|
||||||
|
xenguest_vars = d.getVar('XENGUEST_IMAGE_VARS_EXTRA')
|
||||||
|
if not xenguest_vars:
|
||||||
|
return
|
||||||
|
|
||||||
|
outdir = d.getVar('XENGUEST_ENV_STAGING_DIR')
|
||||||
|
|
||||||
|
# Writes file to tmp/sysroots/${MACHINE}/xenguestenv/ by default
|
||||||
|
filename = os.path.basename(d.getVar('FILE')) + '.xenguestenv'
|
||||||
|
with open(os.path.join(outdir, filename), 'w') as envf:
|
||||||
|
for var in xenguest_vars.split():
|
||||||
|
value = d.getVar(var)
|
||||||
|
if value:
|
||||||
|
# Write value only if set
|
||||||
|
envf.write('%s="%s"\n' % (var, " ".join(value.split())))
|
||||||
|
envf.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
# Since the intermediary file is deleted by do_merge_xenguestenv it
|
||||||
|
# must be re-created every time
|
||||||
|
do_deploy_xenguestenv[vardeps] += "${XENGUEST_IMAGE_VARS_EXTRA}"
|
||||||
|
do_deploy_xenguestenv[dirs] = "${XENGUEST_ENV_STAGING_DIR}"
|
||||||
|
|
||||||
|
addtask deploy_xenguestenv before do_populate_sysroot
|
||||||
|
|
||||||
# Clone the current xenguest from deploy to manipulate it locally
|
# Clone the current xenguest from deploy to manipulate it locally
|
||||||
# This is required if you need to change things before packing an image
|
# This is required if you need to change things before packing an image
|
||||||
# To set the local directory where to clone you must set
|
# To set the local directory where to clone you must set
|
||||||
@@ -172,7 +224,7 @@ xenguest_image_clone() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f ${DEPLOY_DIR_IMAGE}/${XENGUEST_IMAGE_DEPLOY_SUBDIR}/guest.cfg ]; then
|
if [ ! -f ${DEPLOY_DIR_IMAGE}/${XENGUEST_IMAGE_DEPLOY_SUBDIR}/guest.cfg ]; then
|
||||||
die "xenguest-image: ${DEPLOY_DIR_IMAGE}/${XENGUEST_IMAGE_DEPLOY_SUBDIR} does not contain a valid guest"
|
die "xenguest_image: ${DEPLOY_DIR_IMAGE}/${XENGUEST_IMAGE_DEPLOY_SUBDIR} does not contain a valid guest"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -rf ${XENGUEST_IMAGE_DEPLOY_DIR}/${XENGUEST_IMAGE_DEPLOY_SUBDIR}
|
rm -rf ${XENGUEST_IMAGE_DEPLOY_DIR}/${XENGUEST_IMAGE_DEPLOY_SUBDIR}
|
||||||
+20
-11
@@ -4,8 +4,11 @@
|
|||||||
# The class is extending deploy function so you recipe must inherit deploy and
|
# The class is extending deploy function so you recipe must inherit deploy and
|
||||||
# have a do_deploy function (even if it is empty)
|
# have a do_deploy function (even if it is empty)
|
||||||
|
|
||||||
# Use standard xenguest-image
|
# Add a variable name to XENGUEST_IMAGE_VARS_EXTRA if you want it to
|
||||||
inherit xenguest-image
|
# appear in xenguest.env when the image is deployed
|
||||||
|
|
||||||
|
# Use standard xenguest_image
|
||||||
|
inherit xenguest_image
|
||||||
|
|
||||||
# Add a DTB file for the guest
|
# Add a DTB file for the guest
|
||||||
# Only one file should be added, if this is set multiple times or in several
|
# Only one file should be added, if this is set multiple times or in several
|
||||||
@@ -39,6 +42,12 @@ XENGUEST_EXTRA_FILES ??= ""
|
|||||||
# dir1/file1 file in the disk content parameters).
|
# dir1/file1 file in the disk content parameters).
|
||||||
XENGUEST_EXTRA_DISK_FILES ??= ""
|
XENGUEST_EXTRA_DISK_FILES ??= ""
|
||||||
|
|
||||||
|
# Extra vars to be written to xenguest.env
|
||||||
|
XENGUEST_IMAGE_VARS_EXTRA += "\
|
||||||
|
XENGUEST_EXTRA_DTB XENGUEST_EXTRA_RAMDISK XENGUEST_EXTRA_XENCONFIG \
|
||||||
|
XENGUEST_EXTRA_INIT_PRE XENGUEST_EXTRA_INIT XENGUEST_EXTRA_INIT_POST \
|
||||||
|
XENGUEST_EXTRA_FILES XENGUEST_EXTRA_DISK_FILES"
|
||||||
|
|
||||||
do_deploy_append() {
|
do_deploy_append() {
|
||||||
if [ -z "${XENGUEST_IMAGE_DEPLOY_DIR}" -o \
|
if [ -z "${XENGUEST_IMAGE_DEPLOY_DIR}" -o \
|
||||||
-z "${XENGUEST_IMAGE_DEPLOY_SUBDIR}" ]; then
|
-z "${XENGUEST_IMAGE_DEPLOY_SUBDIR}" ]; then
|
||||||
@@ -49,14 +58,14 @@ do_deploy_append() {
|
|||||||
|
|
||||||
if [ -n "${XENGUEST_EXTRA_DTB}" ]; then
|
if [ -n "${XENGUEST_EXTRA_DTB}" ]; then
|
||||||
if [ ! -f ${XENGUEST_EXTRA_DTB} ]; then
|
if [ ! -f ${XENGUEST_EXTRA_DTB} ]; then
|
||||||
die "xenguest-image: DTB file ${XENGUEST_EXTRA_DTB} does not exist"
|
die "xenguest_image: DTB file ${XENGUEST_EXTRA_DTB} does not exist"
|
||||||
fi
|
fi
|
||||||
call_xenguest_mkimage partial --xen-device-tree=${XENGUEST_EXTRA_DTB}
|
call_xenguest_mkimage partial --xen-device-tree=${XENGUEST_EXTRA_DTB}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${XENGUEST_EXTRA_RAMDISK}" ]; then
|
if [ -n "${XENGUEST_EXTRA_RAMDISK}" ]; then
|
||||||
if [ ! -f ${XENGUEST_EXTRA_RAMDISK} ]; then
|
if [ ! -f ${XENGUEST_EXTRA_RAMDISK} ]; then
|
||||||
die "xenguest-image: DTB file ${XENGUEST_EXTRA_RAMDISK} does not exist"
|
die "xenguest_image: DTB file ${XENGUEST_EXTRA_RAMDISK} does not exist"
|
||||||
fi
|
fi
|
||||||
call_xenguest_mkimage partial --xen-ramdisk=${XENGUEST_EXTRA_RAMDISK}
|
call_xenguest_mkimage partial --xen-ramdisk=${XENGUEST_EXTRA_RAMDISK}
|
||||||
fi
|
fi
|
||||||
@@ -64,7 +73,7 @@ do_deploy_append() {
|
|||||||
if [ -n "${XENGUEST_EXTRA_XENCONFIG}" ]; then
|
if [ -n "${XENGUEST_EXTRA_XENCONFIG}" ]; then
|
||||||
for f in ${XENGUEST_EXTRA_XENCONFIG}; do
|
for f in ${XENGUEST_EXTRA_XENCONFIG}; do
|
||||||
if [ ! -f $f ]; then
|
if [ ! -f $f ]; then
|
||||||
die "xenguest-image: Xen config $f does not exist"
|
die "xenguest_image: Xen config $f does not exist"
|
||||||
fi
|
fi
|
||||||
call_xenguest_mkimage partial --xen-append=$f
|
call_xenguest_mkimage partial --xen-append=$f
|
||||||
done
|
done
|
||||||
@@ -72,21 +81,21 @@ do_deploy_append() {
|
|||||||
|
|
||||||
if [ -n "${XENGUEST_EXTRA_INIT_PRE}" ]; then
|
if [ -n "${XENGUEST_EXTRA_INIT_PRE}" ]; then
|
||||||
if [ ! -f ${XENGUEST_EXTRA_INIT_PRE} ]; then
|
if [ ! -f ${XENGUEST_EXTRA_INIT_PRE} ]; then
|
||||||
die "xenguest-image: Init script ${XENGUEST_EXTRA_INIT_PRE} does not exist"
|
die "xenguest_image: Init script ${XENGUEST_EXTRA_INIT_PRE} does not exist"
|
||||||
fi
|
fi
|
||||||
call_xenguest_mkimage partial --init-pre=${XENGUEST_EXTRA_INIT_PRE}
|
call_xenguest_mkimage partial --init-pre=${XENGUEST_EXTRA_INIT_PRE}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${XENGUEST_EXTRA_INIT}" ]; then
|
if [ -n "${XENGUEST_EXTRA_INIT}" ]; then
|
||||||
if [ ! -f ${XENGUEST_EXTRA_INIT} ]; then
|
if [ ! -f ${XENGUEST_EXTRA_INIT} ]; then
|
||||||
die "xenguest-image: Init script ${XENGUEST_EXTRA_INIT} does not exist"
|
die "xenguest_image: Init script ${XENGUEST_EXTRA_INIT} does not exist"
|
||||||
fi
|
fi
|
||||||
call_xenguest_mkimage partial --init-script=${XENGUEST_EXTRA_INIT}
|
call_xenguest_mkimage partial --init-script=${XENGUEST_EXTRA_INIT}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${XENGUEST_EXTRA_INIT_POST}" ]; then
|
if [ -n "${XENGUEST_EXTRA_INIT_POST}" ]; then
|
||||||
if [ ! -f ${XENGUEST_EXTRA_INIT_POST} ]; then
|
if [ ! -f ${XENGUEST_EXTRA_INIT_POST} ]; then
|
||||||
die "xenguest-image: Init script ${XENGUEST_EXTRA_INIT_POST} does not exist"
|
die "xenguest_image: Init script ${XENGUEST_EXTRA_INIT_POST} does not exist"
|
||||||
fi
|
fi
|
||||||
call_xenguest_mkimage partial --init-post=${XENGUEST_EXTRA_INIT_POST}
|
call_xenguest_mkimage partial --init-post=${XENGUEST_EXTRA_INIT_POST}
|
||||||
fi
|
fi
|
||||||
@@ -94,7 +103,7 @@ do_deploy_append() {
|
|||||||
if [ -n "${XENGUEST_EXTRA_FILES}" ]; then
|
if [ -n "${XENGUEST_EXTRA_FILES}" ]; then
|
||||||
for f in ${XENGUEST_EXTRA_FILES}; do
|
for f in ${XENGUEST_EXTRA_FILES}; do
|
||||||
if [ ! -f $f ]; then
|
if [ ! -f $f ]; then
|
||||||
die "xenguest-image: Xen file $f does not exist"
|
die "xenguest_image: Xen file $f does not exist"
|
||||||
fi
|
fi
|
||||||
call_xenguest_mkimage partial --xen-add-file=$f
|
call_xenguest_mkimage partial --xen-add-file=$f
|
||||||
done
|
done
|
||||||
@@ -103,12 +112,12 @@ do_deploy_append() {
|
|||||||
if [ -n "${XENGUEST_EXTRA_DISK_FILES}" ]; then
|
if [ -n "${XENGUEST_EXTRA_DISK_FILES}" ]; then
|
||||||
for f in ${XENGUEST_EXTRA_DISK_FILES}; do
|
for f in ${XENGUEST_EXTRA_DISK_FILES}; do
|
||||||
if [ ! -f $f ]; then
|
if [ ! -f $f ]; then
|
||||||
die "xenguest-image: Disk file $f does not exist"
|
die "xenguest_image: Disk file $f does not exist"
|
||||||
fi
|
fi
|
||||||
call_xenguest_mkimage partial --disk-add-file=$f
|
call_xenguest_mkimage partial --disk-add-file=$f
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
# Need to have xenguest-image tool
|
# Need to have xenguest_image tool
|
||||||
do_deploy[depends] += "xenguest-base-image:do_deploy"
|
do_deploy[depends] += "xenguest-base-image:do_deploy"
|
||||||
|
|
||||||
@@ -4,6 +4,11 @@
|
|||||||
DISTRO_FEATURES_append = " xen ipv4"
|
DISTRO_FEATURES_append = " xen ipv4"
|
||||||
DISTRO_FEATURES_NATIVE_append = " arm-autonomy-host"
|
DISTRO_FEATURES_NATIVE_append = " arm-autonomy-host"
|
||||||
|
|
||||||
|
# Since meta-virtualization master branch bumped to 4.15+stable we need to
|
||||||
|
# force the 4.14+stable selection until we validate the new version
|
||||||
|
PREFERRED_VERSION_xen = "4.14+stable%"
|
||||||
|
PREFERRED_VERSION_xen-tools = "4.14+stable%"
|
||||||
|
|
||||||
# Don't include kernels in standard images when building arm-autonomy-host
|
# Don't include kernels in standard images when building arm-autonomy-host
|
||||||
# If the kernel image is needed in the rootfs the following should be set from
|
# If the kernel image is needed in the rootfs the following should be set from
|
||||||
# a bbappend: RDEPENDS_${KERNEL_PACKAGE_NAME}-base = "${KERNEL_PACKAGE_NAME}-image"
|
# a bbappend: RDEPENDS_${KERNEL_PACKAGE_NAME}-base = "${KERNEL_PACKAGE_NAME}-image"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ BBFILES += " \
|
|||||||
|
|
||||||
BBFILE_COLLECTIONS += "meta-arm-autonomy"
|
BBFILE_COLLECTIONS += "meta-arm-autonomy"
|
||||||
BBFILE_PATTERN_meta-arm-autonomy = "^${LAYERDIR}/"
|
BBFILE_PATTERN_meta-arm-autonomy = "^${LAYERDIR}/"
|
||||||
BBFILE_PRIORITY_meta-arm-autonomy = "6"
|
BBFILE_PRIORITY_meta-arm-autonomy = "5"
|
||||||
LAYERDEPENDS_meta-arm-autonomy = " \
|
LAYERDEPENDS_meta-arm-autonomy = " \
|
||||||
core \
|
core \
|
||||||
yocto \
|
yocto \
|
||||||
@@ -17,7 +17,7 @@ LAYERDEPENDS_meta-arm-autonomy = " \
|
|||||||
networking-layer \
|
networking-layer \
|
||||||
virtualization-layer \
|
virtualization-layer \
|
||||||
"
|
"
|
||||||
LAYERSERIES_COMPAT_meta-arm-autonomy = "gatesgarth"
|
LAYERSERIES_COMPAT_meta-arm-autonomy = "hardknott"
|
||||||
|
|
||||||
# We don't activate virtualization feature from meta-virtualization as it
|
# We don't activate virtualization feature from meta-virtualization as it
|
||||||
# brings in lots of stuff we don't need. We need to disable the sanity check
|
# brings in lots of stuff we don't need. We need to disable the sanity check
|
||||||
@@ -33,7 +33,7 @@ USER_CLASSES_append = " arm-autonomy-features"
|
|||||||
|
|
||||||
BBFILES_DYNAMIC += " \
|
BBFILES_DYNAMIC += " \
|
||||||
meta-arm-bsp:${LAYERDIR}/dynamic-layers/meta-arm-bsp/*/*/*.bbappend \
|
meta-arm-bsp:${LAYERDIR}/dynamic-layers/meta-arm-bsp/*/*/*.bbappend \
|
||||||
meta-gem5:${LAYERDIR}/dynamic-layers/meta-gem5/*/*/*.bbappend \
|
meta-arm-bsp:${LAYERDIR}/dynamic-layers/meta-arm-bsp/*/*/*.bb \
|
||||||
"
|
"
|
||||||
# Root directory for the meta-arm-autonomy/dynamic-layers/meta-arm-bsp
|
# Root directory for the meta-arm-autonomy/dynamic-layers/meta-arm-bsp
|
||||||
ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR = "${ARM_AUTONOMY_LAYERDIR}/dynamic-layers/meta-arm-bsp"
|
ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR = "${ARM_AUTONOMY_LAYERDIR}/dynamic-layers/meta-arm-bsp"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ KERNEL_IMAGETYPE = "Image"
|
|||||||
IMAGE_FSTYPES += "tar.bz2"
|
IMAGE_FSTYPES += "tar.bz2"
|
||||||
|
|
||||||
PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
|
PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
|
||||||
PREFERRED_VERSION_linux-yocto ?= "5.4%"
|
PREFERRED_VERSION_linux-yocto ?= "5.10%"
|
||||||
|
|
||||||
DISTRO_FEATURES += "arm-autonomy-guest"
|
DISTRO_FEATURES += "arm-autonomy-guest"
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# This file will be required by different xenguest recipes to provide
|
||||||
|
# common variables, which can be configured in local.conf
|
||||||
|
|
||||||
|
# Xenguest image file install location
|
||||||
|
XENGUEST_MANAGER_GUEST_DIR ?= "${datadir}/guests/"
|
||||||
@@ -32,16 +32,16 @@ Ensure it has all the required layers in bblayers.conf as listed in
|
|||||||
Add multiconfig
|
Add multiconfig
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
Here are the steps required to make the project build both the host and any
|
The steps required to make the project build both the host and any
|
||||||
number of guests as required.
|
number of guests as required are:
|
||||||
|
|
||||||
1. Create a new directory under `conf/` named `multiconfig/`
|
1. Create a new directory under `conf/` named `multiconfig/`
|
||||||
|
|
||||||
2. Create two new files in this directory:
|
2. Create two new files in this directory:
|
||||||
`multiconfig/host.conf`
|
`multiconfig/host.conf`
|
||||||
`multiconfig/guest.conf`
|
`multiconfig/guest.conf`
|
||||||
These files will contain any configurations that a specific to either the
|
These files will contain any configurations that are specific to either the
|
||||||
host or the guest
|
host or the guest. The resulting directory tree should be:
|
||||||
|
|
||||||
```
|
```
|
||||||
-- conf
|
-- conf
|
||||||
@@ -73,12 +73,12 @@ MC_GUEST_INITRAMFS_IMAGE ?= ""
|
|||||||
#MC_GUEST_INITRAMFS_IMAGE_BUNDLE = "1"
|
#MC_GUEST_INITRAMFS_IMAGE_BUNDLE = "1"
|
||||||
#MC_GUEST_INITRAMFS_IMAGE = "${MC_GUEST_IMAGERECIPE}"
|
#MC_GUEST_INITRAMFS_IMAGE = "${MC_GUEST_IMAGERECIPE}"
|
||||||
|
|
||||||
# These variables are set automatically, don't edit them!
|
# These variables are set automatically, don't override them!
|
||||||
MC_GUEST_FILENAME_PREFIX = "${@ 'Image-initramfs' if d.getVar('MC_GUEST_INITRAMFS_IMAGE_BUNDLE',d) else '${MC_GUEST_IMAGERECIPE}' }"
|
MC_GUEST_FILENAME_PREFIX = "${@ 'Image-initramfs' if d.getVar('MC_GUEST_INITRAMFS_IMAGE_BUNDLE',d) else '${MC_GUEST_IMAGERECIPE}' }"
|
||||||
|
|
||||||
MC_GUEST_FILENAME = "${MC_GUEST_FILENAME_PREFIX}-${MC_GUEST_MACHINE}.xenguest"
|
MC_GUEST_FILENAME = "${MC_GUEST_FILENAME_PREFIX}-${MC_GUEST_MACHINE}.xenguest"
|
||||||
|
|
||||||
MC_GUEST_DEP = "${@ 'virtual/kernel:do_deploy' if d.getVar('MC_GUEST_INITRAMFS_IMAGE_BUNDLE',d) else '${MC_GUEST_IMAGERECIPE}:do_image_complete'}"
|
MC_GUEST_DEP = "${@ 'virtual/kernel:do_deploy' if d.getVar('MC_GUEST_INITRAMFS_IMAGE_BUNDLE',d) else '${MC_GUEST_IMAGERECIPE}:do_merge_xenguestenv'}"
|
||||||
|
|
||||||
MC_DOIMAGE_MCDEPENDS += "mc:${MC_HOST}:${MC_GUEST}:${MC_GUEST_DEP} "
|
MC_DOIMAGE_MCDEPENDS += "mc:${MC_HOST}:${MC_GUEST}:${MC_GUEST_DEP} "
|
||||||
|
|
||||||
@@ -114,9 +114,10 @@ IMAGE_FSTYPES += "${@ 'cpio' if d.getVar('MC_GUEST_INITRAMFS_IMAGE_BUNDLE',d) el
|
|||||||
# ANY OTHER GUEST CONFIG
|
# ANY OTHER GUEST CONFIG
|
||||||
```
|
```
|
||||||
|
|
||||||
This contents shouldn't be changed directly, rather change the equivalent
|
To modify the MACHINE or INITRAMFS variables change the equivalent
|
||||||
config in local.conf. You can append any other config desired for the
|
config in local.conf rather than modifying this file directly. You can also
|
||||||
guest at this point, for example `XENGUEST_IMAGE_DISK_SIZE`
|
append any other config desired for the guest after "ANY OTHER GUEST CONFIG",
|
||||||
|
for example `XENGUEST_IMAGE_DISK_SIZE`.
|
||||||
|
|
||||||
Make sure not to change `${DEPLOY_DIR_IMAGE}` to anything other than
|
Make sure not to change `${DEPLOY_DIR_IMAGE}` to anything other than
|
||||||
`${TMPDIR}/deploy/images`, as this is assumed by local.conf.
|
`${TMPDIR}/deploy/images`, as this is assumed by local.conf.
|
||||||
@@ -127,6 +128,8 @@ Make sure not to change `${DEPLOY_DIR_IMAGE}` to anything other than
|
|||||||
TMPDIR = "${TOPDIR}/${MC_HOST}"
|
TMPDIR = "${TOPDIR}/${MC_HOST}"
|
||||||
|
|
||||||
DISTRO_FEATURES += " arm-autonomy-host"
|
DISTRO_FEATURES += " arm-autonomy-host"
|
||||||
|
|
||||||
|
# ANY OTHER HOST CONFIG
|
||||||
```
|
```
|
||||||
|
|
||||||
Building the image
|
Building the image
|
||||||
@@ -137,29 +140,56 @@ To build the multiconfig image the command is:
|
|||||||
bitbake mc:host:arm-autonomy-host-image-minimal
|
bitbake mc:host:arm-autonomy-host-image-minimal
|
||||||
```
|
```
|
||||||
|
|
||||||
You should see that this triggers guest tasks to be built in
|
The first time this is run you may see a warning related to the SRC_URI:
|
||||||
parallel. Once the build completes the guest will already be in the
|
```
|
||||||
rootfs of the host thanks to `ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUEST`
|
Unable to get checksum for xenguest-extern-guests SRC_URI entry foo.xenguest: file could not be found
|
||||||
|
```
|
||||||
|
|
||||||
The deployed image including the guest will be in `host/deploy/images/`
|
This is expected, and only indicates that the guest image has not yet been
|
||||||
|
generated when the host parses the SRC_URI. By the time it is needed by the
|
||||||
|
host recipe fetch task it will be present.
|
||||||
|
|
||||||
|
During the build you should see that guest tasks are also being executed in
|
||||||
|
parallel. Once the build completes the guest will already be in the rootfs of
|
||||||
|
the host thanks to `ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUEST`
|
||||||
|
|
||||||
|
The final host image including the guests will be deployed in
|
||||||
|
`host/deploy/images/`
|
||||||
|
|
||||||
|
|
||||||
Multiple Guests
|
Multiple Guests
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
To have multiple guests with the same config the line which appends to
|
To have multiple guests with the same config the line which appends to
|
||||||
`ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUEST` just needs to be duplicated with
|
`ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS` just needs to pass the argument
|
||||||
a different guestname.
|
'guestcount=#' to install symlink copies of the xenguest file on the host.
|
||||||
|
Documentation for the guestcount parameter can be found in
|
||||||
|
documentation/arm-autonomy-quickstart.md in the section titled
|
||||||
|
'Include guests directly in the host image'. This will ensure that the guest
|
||||||
|
is still only built once, despite resulting in multiple copies on the target.
|
||||||
|
|
||||||
To have different config for each guest, each will need its own config
|
If guests are required to have different configurations, each will need its own
|
||||||
file similar to guest.conf, ensuring TMPDIR is set to a different path,
|
config file, e.g. 'netguest.conf'. Ensure that the name of the conf file does
|
||||||
and everything between `---Guest Config Start---` and
|
not contain any hyphens, as this will create errors when it becomes part of a
|
||||||
`---Guest Config End---` will need to be duplicated.
|
function name. In this file the values of TMPDIR, MACHINE, DISTRO_FEATURES etc.
|
||||||
|
should be the same as above, but with the prefix "MC_GUEST_*" modified to
|
||||||
|
something different to avoid collisions (e.g. MC_GUEST_2_*).
|
||||||
|
|
||||||
Any copies of variables that start `MC_GUEST` must be altered to avoid
|
As before, your additional config for the guest type should
|
||||||
collisions (e.g. `MC_GUEST_2_*`), and the name of the conf file must also
|
follow "ANY OTHER GUEST CONFIG"
|
||||||
be added to BBMULTICONFIG.
|
|
||||||
|
|
||||||
|
In your local.conf, everything between `---Guest Config Start---` and
|
||||||
|
`---Guest Config End---` will need to be duplicated for each desired guest type.
|
||||||
|
All copies of variables that start `MC_GUEST` must be modified with the same
|
||||||
|
prefix as in the new guest config file (e.g. `MC_GUEST_2_*`).
|
||||||
|
|
||||||
|
Each chunk of guest config in local.conf has automatic guest variables
|
||||||
|
(found after the line "These variables are set automatically...").
|
||||||
|
These should all use the same prefix as their chunk in their values,
|
||||||
|
for example:
|
||||||
|
```
|
||||||
|
MC_GUEST_2_FILENAME_PREFIX = "${@ 'Image-initramfs' if d.getVar('MC_GUEST_2_INITRAMFS_IMAGE_BUNDLE',d) else '${MC_GUEST_2_IMAGERECIPE}' }"
|
||||||
|
```
|
||||||
|
|
||||||
Guest with provisioned disk
|
Guest with provisioned disk
|
||||||
----------------
|
----------------
|
||||||
@@ -172,11 +202,12 @@ AUTONOMY_HOST_EXTRA_PARTITION = "part --label provisioned-guest --source rawcopy
|
|||||||
--sourceparams=file=${TOPDIR}/${MC_GUEST}/deploy/images/${MC_GUEST_MACHINE}/${MC_GUEST_FILENAME_PREFIX}-${MC_GUEST_MACHINE}.ext4"
|
--sourceparams=file=${TOPDIR}/${MC_GUEST}/deploy/images/${MC_GUEST_MACHINE}/${MC_GUEST_FILENAME_PREFIX}-${MC_GUEST_MACHINE}.ext4"
|
||||||
```
|
```
|
||||||
|
|
||||||
inside host.conf file.
|
inside your host.conf file.
|
||||||
|
|
||||||
The rest of the configuration has to be appended to guest.conf file:
|
The rest of the configuration has to be appended to guest.conf file:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
# ANY OTHER GUEST CONFIG
|
||||||
XENGUEST_IMAGE_DISK_SIZE = "0"
|
XENGUEST_IMAGE_DISK_SIZE = "0"
|
||||||
XENGUEST_IMAGE_SRC_URI_XEN_CONFIG = "file://\${TOPDIR}/path/to/rootdisk.cfg"
|
XENGUEST_IMAGE_SRC_URI_XEN_CONFIG = "file://\${TOPDIR}/path/to/rootdisk.cfg"
|
||||||
XENGUEST_IMAGE_DISK_DEVICE = "_GUEST_DISK_DEVICE_"
|
XENGUEST_IMAGE_DISK_DEVICE = "_GUEST_DISK_DEVICE_"
|
||||||
@@ -185,7 +216,7 @@ IMAGE_ROOTFS_SIZE = "102400"
|
|||||||
IMAGE_FSTYPES = "ext4"
|
IMAGE_FSTYPES = "ext4"
|
||||||
```
|
```
|
||||||
|
|
||||||
content of rootdisk.cfg"
|
Example content of rootdisk.cfg:
|
||||||
|
|
||||||
```
|
```
|
||||||
disk = ["phy:_GUEST_DISK_DEVICE_,xvda,w"]
|
disk = ["phy:_GUEST_DISK_DEVICE_,xvda,w"]
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
arm-autonomy Quick Start
|
arm-autonomy Quick Start
|
||||||
==================
|
==================
|
||||||
|
|
||||||
This documentation is explaining how to quickly start with arm-autonomy layer
|
This documentation explains how to quickly start with the arm-autonomy layer,
|
||||||
and the main features provided.
|
and the main features provided.
|
||||||
You will find in the documentation directory some more detailed documentation
|
In the documentation directory you will find some more detailed documentation
|
||||||
for each of the functionalites provided by this layer.
|
for each of the functionalites provided by this layer.
|
||||||
|
|
||||||
What to use this layer for?
|
What to use this layer for?
|
||||||
@@ -29,7 +29,7 @@ First you must download the Yocto layers needed:
|
|||||||
- all other layers you might want to use
|
- all other layers you might want to use
|
||||||
|
|
||||||
For each of the downloaded layer make sure you checkout the release of Yocto
|
For each of the downloaded layer make sure you checkout the release of Yocto
|
||||||
you want to use (for example zeus using `git checkout zeus`).
|
you want to use (for example hardknott using `git checkout hardknott`).
|
||||||
|
|
||||||
Please follow [Yocto documentation](https://www.yoctoproject.org/docs/latest/brief-yoctoprojectqs/brief-yoctoprojectqs.html)
|
Please follow [Yocto documentation](https://www.yoctoproject.org/docs/latest/brief-yoctoprojectqs/brief-yoctoprojectqs.html)
|
||||||
in order to have the required dependencies.
|
in order to have the required dependencies.
|
||||||
@@ -110,7 +110,8 @@ The project will generate a Linux kernel, a root filesystem, a Xen binary and
|
|||||||
a DTB modified to include the required entries to boot Xen and Linux as Dom0
|
a DTB modified to include the required entries to boot Xen and Linux as Dom0
|
||||||
(this DTB has the extension `-xen.dtb`).
|
(this DTB has the extension `-xen.dtb`).
|
||||||
|
|
||||||
To boot the system using an u-boot base board you will need to:
|
To boot the system using a u-boot base board for machines other than FVP-Base
|
||||||
|
you will need to:
|
||||||
- Load the kernel (by default at 0x80080000 unless you modify
|
- Load the kernel (by default at 0x80080000 unless you modify
|
||||||
XEN_DEVICETREE_DOM0_ADDR value)
|
XEN_DEVICETREE_DOM0_ADDR value)
|
||||||
- Load the xen device tree (for example at 0x83000000)
|
- Load the xen device tree (for example at 0x83000000)
|
||||||
@@ -119,53 +120,88 @@ To boot the system using an u-boot base board you will need to:
|
|||||||
|
|
||||||
In this example the addresses might need to be adapted depending on your board.
|
In this example the addresses might need to be adapted depending on your board.
|
||||||
|
|
||||||
For arm-autonomy host on FVP-Base u-boot has been modified such that
|
For arm-autonomy host on FVP-Base, u-boot has been modified such that
|
||||||
`booti 0x84000000 - 0x83000000` is the default boot command. If FVP-Base is your
|
`booti 0x84000000 - 0x83000000` is the default boot command. If FVP-Base is your
|
||||||
MACHINE target there should be no need to interfere with u-boot.
|
MACHINE target there should be no need to interfere with u-boot.
|
||||||
|
|
||||||
Guest project
|
Guest project
|
||||||
-------------
|
-------------
|
||||||
The guest projects are not target specific and will use a Yocto MACHINE defined
|
The guest projects are not target specific and will instead use a Yocto MACHINE
|
||||||
in meta-arm-autonomy to include only the Linux configuration required to run
|
defined in meta-arm-autonomy to include only the Linux configuration required to
|
||||||
a xen guest.
|
run a xen guest.
|
||||||
|
|
||||||
To create a guest project:
|
To create a guest project:
|
||||||
|
|
||||||
1. Follow the steps of "Create a project"
|
1. Follow the steps of "Create a project"
|
||||||
|
|
||||||
2. Optionaly add layers required to build the image and features you need.
|
2. Optionally add layers required to build the guest image, and any features you
|
||||||
|
need.
|
||||||
|
|
||||||
3. edit conf/local.conf to add `arm-autonomy-guest` to the DISTRO_FEATURES and
|
3. Edit conf/local.conf to add `arm-autonomy-guest` to the DISTRO_FEATURES and
|
||||||
set MACHINE to `arm64-autonomy-guest`:
|
set MACHINE to `arm64-autonomy-guest`:
|
||||||
```
|
```
|
||||||
MACHINE = "arm64-autonomy-guest"
|
MACHINE = "arm64-autonomy-guest"
|
||||||
DISTRO_FEATURES += "arm-autonomy-guest"
|
DISTRO_FEATURES += "arm-autonomy-guest"
|
||||||
```
|
```
|
||||||
|
|
||||||
4. build the image you want.
|
4. Build the image you want.
|
||||||
For example `bitbake core-image-minimal`
|
For example `bitbake core-image-minimal`
|
||||||
|
|
||||||
The build will create a ".xenguest" image that can be use on an host project
|
The build will create a ".xenguest" image that can be use on an host project
|
||||||
with the xenguest-manager.
|
with the xenguest-manager, as well as a file "xenguest.env" containing the
|
||||||
|
variables used to configure and generate the guest image.
|
||||||
|
|
||||||
The guest can also be built as a 'multiconfig' sub project of the host, see
|
The guest can also be built as a 'multiconfig' sub project of the host, see
|
||||||
`meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md` for more information
|
`meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md` for more
|
||||||
|
information
|
||||||
|
|
||||||
Include guests directly in the host image
|
Include guests directly in the host image
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
The layer provides a way to directly include in the host project one or several
|
The layer provides a way to directly include one or more images generated by
|
||||||
images generated by guest projects.
|
guest projects in the host project.
|
||||||
|
|
||||||
To use this feature, you must edit your host project `local.conf` file and
|
To use this feature, you must edit your host project `local.conf` file and
|
||||||
add set ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS to the list of xenguest images
|
add set the value of 'ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS' to the list of
|
||||||
you want to include in your host. Each xenguest image must be given using a
|
paths to xenguest images you want to include in your host.
|
||||||
full path to it.
|
|
||||||
|
There are 4 supported formats for ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS
|
||||||
|
entries:
|
||||||
|
|
||||||
|
- http/https url
|
||||||
|
- "https://[url]:[port]/foo.xenguest;md5sum=..."
|
||||||
|
|
||||||
|
- file:// absolute local path from root
|
||||||
|
- "file:///xenguests/bar.xenguest"
|
||||||
|
|
||||||
|
- file:// path relative to FILESEXTRAPATHS
|
||||||
|
- "file://relative/baz.xenguest"
|
||||||
|
|
||||||
|
- plain absolute local path from root
|
||||||
|
- "/xenguests/absolute/xyzzy.xenguest"
|
||||||
|
|
||||||
|
It is not recommended to use other bitbake URL types, as they may result in
|
||||||
|
undefined behaviour.
|
||||||
|
|
||||||
|
A semicolon seperated list of install arguments can follow each image path:
|
||||||
|
- guestname : the name that will be attached when the image is imported
|
||||||
|
(default: [filename, without extension])
|
||||||
|
- guestcount : the number of copies of the guest to install, with
|
||||||
|
incrementing numbers appended to the name
|
||||||
|
(default: 1)
|
||||||
|
|
||||||
|
Any other arguments, for example an md5sum, will be assumed to be fetch
|
||||||
|
arguments, and will be appended to the path in the SRC_URI.
|
||||||
For example:
|
For example:
|
||||||
```
|
```
|
||||||
ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS = "/home/user/guest-project/tmp/deploy/images/arm64-autonomy-guest/core-image-minimal-arm64-autonomy-guest.xenguest;guestname=myguest"
|
ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS = "\
|
||||||
|
https://[url]:[port]/base.xenguest;md5sum=[checksum];guestname=http \
|
||||||
|
file:///guests/base.xenguest;guestname=file_abs \
|
||||||
|
file://foo/base.xenguest;guestname=file_rel;guestcount=2 \
|
||||||
|
/guests/foo/bar/base.xenguest;guestname=no_fetcher \ "
|
||||||
```
|
```
|
||||||
This will add the guest and name it `myguest` on the host project image and
|
|
||||||
the xenguest-manager will automatically boot it during startup.
|
Documentation for setting up a multiconfig build can be found in:
|
||||||
|
meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md
|
||||||
|
|
||||||
Add support for your board
|
Add support for your board
|
||||||
--------------------------
|
--------------------------
|
||||||
@@ -186,7 +222,7 @@ started). You can find the complete list of the kernel configuration elements
|
|||||||
required in `recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-host.cfg`.
|
required in `recipes-kernel/linux/arm-autonomy-kmeta/features/arm-autonomy/xen-host.cfg`.
|
||||||
|
|
||||||
### Define the drive and partition to use for the LVM volume
|
### Define the drive and partition to use for the LVM volume
|
||||||
The xenguest-manager is creating disk hard drive using LVM on an empty
|
The xenguest-manager creates guest storage drives using LVM on an empty
|
||||||
partition. The default value is set to use /dev/sda2.
|
partition. The default value is set to use /dev/sda2.
|
||||||
You can change this for your board by setting XENGUEST_MANAGER_VOLUME_DEVICE.
|
You can change this for your board by setting XENGUEST_MANAGER_VOLUME_DEVICE.
|
||||||
|
|
||||||
@@ -195,37 +231,37 @@ Check `recipes-extended/xenguest/xenguest-manager.bbappend` for examples.
|
|||||||
Please also read xenguest-manager.md.
|
Please also read xenguest-manager.md.
|
||||||
|
|
||||||
### Define the interface to add to xenguest network bridge
|
### Define the interface to add to xenguest network bridge
|
||||||
xenguest-network bridge is creating a bridge on the host and adds network
|
xenguest-network bridge creates a bridge on the host and adds network
|
||||||
interfaces to it so that guest connected to it have access to external network.
|
interfaces to it so that guests connected to it have access to external network.
|
||||||
By default `eth0` is set as the list of interfaces to be added to the bridge.
|
By default `eth0` is set as the list of interfaces to be added to the bridge.
|
||||||
Depending on your board or use case you might want to use an other interface
|
Depending on your board or use case you might want to use an other interface
|
||||||
or use multiple interfaces.
|
or use multiple interfaces.
|
||||||
You can change this for your board by setting XENGUEST_NETWORK_BRIDGE_MEMBERS.
|
You can change this for your board by setting XENGUEST_NETWORK_BRIDGE_MEMBERS.
|
||||||
|
|
||||||
Check `recipes-extended/xenguest/xenguest-network-bridge.bbappend` for
|
Check `recipes-extended/xenguest/xenguest-network.bbappend` for
|
||||||
exmaples.
|
exmaples.
|
||||||
|
|
||||||
Please also read xenguest-network-bridge.md.
|
Please also read xenguest-network-bridge.md.
|
||||||
|
|
||||||
### Define the network configuration of the xenguest network bridge
|
### Define the network configuration of the xenguest network bridge
|
||||||
xenguest network bridge is putting the host network interfaces in a bridge
|
xenguest-network puts the host network interfaces in a bridge and configures it
|
||||||
and is configuring it by default to use dhcp.
|
by default to use dhcp.
|
||||||
If you need a different type of configuration you can set
|
If you need a different type of configuration you can set
|
||||||
XENGUEST_NETWORK_BRIDGE_CONFIG in a xenguest-network-bridge.bbappend to use
|
XENGUEST_NETWORK_BRIDGE_CONFIG in your xenguest-network-bridge.bbappend to use
|
||||||
a different file.
|
a different file.
|
||||||
The recipe will look for the file in ${WORKDIR} so you will need to add it to
|
The recipe will look for the file in ${WORKDIR}, so you will need to add it to
|
||||||
SRC_URI in your bbappend.
|
the SRC_URI in your bbappend.
|
||||||
The recipe will also substitute `###BRIDGE_NAME###` with the bridge name
|
The recipe will also substitute `###BRIDGE_NAME###` with the bridge name
|
||||||
configured in ${XENGUEST_NETWORK_BRIDGE_NAME}.
|
configured in ${XENGUEST_NETWORK_BRIDGE_NAME} when the config file is installed.
|
||||||
|
|
||||||
You can find an example configuration file in
|
You can find an example configuration file in
|
||||||
`recipes-extended/xenguest/files/xenguest-network-bridge-dhcp.cfg.in`.
|
`recipes-extended/xenguest/files/xenguest-network-bridge-dhcp.cfg.in`.
|
||||||
|
|
||||||
Please also read xenguest-network-bridge.md.
|
Please also read xenguest-network.md.
|
||||||
|
|
||||||
### Customize Dom0 and Xen boot arguments for you board
|
### Customize Dom0 and Xen boot arguments for you board
|
||||||
xen-devicetree is writting inside the generated DTB Xen and Linux boot
|
xen-devicetree modifies the generated DTB Xen and Linux boot arguments,
|
||||||
arguments as long as the address where Dom0 Linux kernel can be found.
|
as long as the address where Dom0 Linux kernel can be found.
|
||||||
You might need to have different values for your board or depending on your
|
You might need to have different values for your board or depending on your
|
||||||
use case.
|
use case.
|
||||||
|
|
||||||
|
|||||||
@@ -11,19 +11,24 @@ perform a couple of customizations in the generated wic image:
|
|||||||
1 MiB per physical volume, hence it needs to be taken into account when
|
1 MiB per physical volume, hence it needs to be taken into account when
|
||||||
setting GUEST_PART_SIZE.
|
setting GUEST_PART_SIZE.
|
||||||
|
|
||||||
2. The wic image partition layout and contents with a custom wks file via
|
2. Set the boot partition size (default: 100M) via `BOOT_PART_SIZE` and
|
||||||
|
`BOOT_PART_SIZE_UNIT` (M or G) variables in any conf file. The default
|
||||||
|
bootimg is ~44M so 100M leaves just over 50M of free space.
|
||||||
|
|
||||||
|
3. The wic image partition layout and contents with a custom wks file via
|
||||||
`ARM_AUTONOMY_WKS_FILE` variable (default:
|
`ARM_AUTONOMY_WKS_FILE` variable (default:
|
||||||
arm-autonomy-n1sdp-efidisk.wks.in which is affected by GUEST_PART_SIZE,
|
arm-autonomy-n1sdp-efidisk.wks.in which is affected by GUEST_PART_SIZE,
|
||||||
GUEST_PART_SIZE_UNIT and GRUB_CFG_FILE variables).
|
GUEST_PART_SIZE_UNIT, BOOT_PART_SIZE, BOOT_PART_SIZE_UNIT and
|
||||||
|
GRUB_CFG_FILE variables).
|
||||||
|
|
||||||
3. Custom grub.cfg file via `GRUB_CFG_FILE` (default:
|
4. Custom grub.cfg file via `GRUB_CFG_FILE` (default:
|
||||||
arm-autonomy-n1sdp-grub.cfg) variable to be set in any conf file. The full
|
arm-autonomy-n1sdp-grub.cfg) variable to be set in any conf file. The full
|
||||||
path or relative to `ARM_AUTONOMY_WKS_FILE` should be set.
|
path or relative to `ARM_AUTONOMY_WKS_FILE` should be set.
|
||||||
|
|
||||||
The `arm-autonomy-n1sdp-efidisk.wks.in` and `arm-autonomy-n1sdp-grub.cfg` files
|
The `arm-autonomy-n1sdp-efidisk.wks.in` and `arm-autonomy-n1sdp-grub.cfg` files
|
||||||
are located at `meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic`.
|
are located at `meta-arm-autonomy/dynamic-layers/meta-arm-bsp/wic`.
|
||||||
|
|
||||||
Other variables can also be custmized to set what files need to be included
|
Other variables can also be customized to set what files need to be included
|
||||||
in the wic image boot partition. Please refer to
|
in the wic image boot partition. Please refer to
|
||||||
`meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/n1sdp-extra-settings.inc`
|
`meta-arm-autonomy/dynamic-layers/meta-arm-bsp/conf/machine/n1sdp-extra-settings.inc`
|
||||||
for more details.
|
for more details.
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ The following parameters are available:
|
|||||||
the xen devicetrees are properly regenerated if the source DTBs are changed.
|
the xen devicetrees are properly regenerated if the source DTBs are changed.
|
||||||
This variable is set by default to "virtual/kernel:do_deploy" to use DTBs
|
This variable is set by default to "virtual/kernel:do_deploy" to use DTBs
|
||||||
generated during the compilation of the Linux kernel. This must be changed
|
generated during the compilation of the Linux kernel. This must be changed
|
||||||
if the machine your are using is not using a DTB listed in KERNEL_DEVICETREE.
|
if the machine you are using is not using a DTB listed in
|
||||||
|
KERNEL_DEVICETREE.
|
||||||
|
|
||||||
- XEN_DEVICETREE_DTBS: This should be set to the list of DTBs you want to be
|
- XEN_DEVICETREE_DTBS: This should be set to the list of DTBs you want to be
|
||||||
modified by xen-devicetree. Those must be files that xen-devicetree can find
|
modified by xen-devicetree. Those must be files that xen-devicetree can find
|
||||||
@@ -70,7 +71,10 @@ The following parameters are available:
|
|||||||
This variable is only used if XEN_DEVICETREE_XEN_BOOTARGS has a value
|
This variable is only used if XEN_DEVICETREE_XEN_BOOTARGS has a value
|
||||||
containing "dom0_mem=${XEN_DEVICETREE_DOM0_MEM}" as the memory assigned to
|
containing "dom0_mem=${XEN_DEVICETREE_DOM0_MEM}" as the memory assigned to
|
||||||
dom0 is defined using Xen boot arguments.
|
dom0 is defined using Xen boot arguments.
|
||||||
This variable is set by default to "1024M".
|
This variable is set by default to "1024M,max:1024", and cannot be empty.
|
||||||
|
The value can simply specify a size, e.g. "1024M", but best practice is to
|
||||||
|
also provide a max, documented here:
|
||||||
|
https://wiki.xenproject.org/wiki/Xen_Project_Best_Practices
|
||||||
|
|
||||||
- XEN_DEVICETREE_DOM0_BOOTARGS: Boot arguments to pass to Dom0 Linux when
|
- XEN_DEVICETREE_DOM0_BOOTARGS: Boot arguments to pass to Dom0 Linux when
|
||||||
booting it.
|
booting it.
|
||||||
@@ -84,7 +88,8 @@ The following parameters are available:
|
|||||||
- XEN_DEVICETREE_DOM0_ADDR: This is the address from which the Linux kernel to
|
- XEN_DEVICETREE_DOM0_ADDR: This is the address from which the Linux kernel to
|
||||||
be used for Dom0 will be copied. When using u-boot, this is the address at
|
be used for Dom0 will be copied. When using u-boot, this is the address at
|
||||||
which you will load the kernel Image before starting Xen.
|
which you will load the kernel Image before starting Xen.
|
||||||
This variable is set by default to "0x80080000".
|
This variable is set by default to "0x80080000", and cannot be empty.
|
||||||
|
Values for this variable can be in hex (prefixed with '0x') or in decimal.
|
||||||
|
|
||||||
- XEN_DEVICETREE_DOM0_SIZE: This is the size of the kernel loaded at
|
- XEN_DEVICETREE_DOM0_SIZE: This is the size of the kernel loaded at
|
||||||
${XEN_DEVICETREE_DOM0_ADDR}. Xen will copy this amount of data inside the
|
${XEN_DEVICETREE_DOM0_ADDR}. Xen will copy this amount of data inside the
|
||||||
@@ -92,7 +97,8 @@ The following parameters are available:
|
|||||||
size but can be bigger. You must be careful not to have a value too big as it
|
size but can be bigger. You must be careful not to have a value too big as it
|
||||||
could slow down boot or copy other parts with it (like the DTB).
|
could slow down boot or copy other parts with it (like the DTB).
|
||||||
You might need to increase this if you use a kernel with a bundled initramfs.
|
You might need to increase this if you use a kernel with a bundled initramfs.
|
||||||
This variable is set by default to "0x01000000".
|
This variable is set by default to "0x01000000" and cannot be empty.
|
||||||
|
Values for this variable can be in hex (prefixed with '0x') or in decimal.
|
||||||
|
|
||||||
- XEN_DEVICETREE_DTSI_MERGE: This variable contains the list of dtsi files that
|
- XEN_DEVICETREE_DTSI_MERGE: This variable contains the list of dtsi files that
|
||||||
must be included inside the generated DTB file. By default the only one
|
must be included inside the generated DTB file. By default the only one
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Introduction
|
|||||||
xenguest-manager is a tool to manage Xenguest images generated by
|
xenguest-manager is a tool to manage Xenguest images generated by
|
||||||
[xenguest-mkimage](xenguest-mkimage.md).
|
[xenguest-mkimage](xenguest-mkimage.md).
|
||||||
|
|
||||||
On a Xen Dom0 system it will:
|
On a Xen Dom0 system it can:
|
||||||
- create a xen guest from a xenguest image: extract its components, create a
|
- create a xen guest from a xenguest image: extract its components, create a
|
||||||
disk for the guest using LVM volumes.
|
disk for the guest using LVM volumes.
|
||||||
- start/stop a xen guest (during init or using xenguest-manager directly).
|
- start/stop a xen guest (during init or using xenguest-manager directly).
|
||||||
@@ -23,7 +23,7 @@ Usage
|
|||||||
-----
|
-----
|
||||||
|
|
||||||
xenguest-manager must be called like this:
|
xenguest-manager must be called like this:
|
||||||
`xenguest-manager OPERATION [OPTIONS]`
|
`xenguest-manager [-v(v)] OPERATION [OPTIONS]`
|
||||||
The following operations are available:
|
The following operations are available:
|
||||||
- create XENGUEST_IMAGE [GUESTNAME]: create a guest from a xenguest image file
|
- create XENGUEST_IMAGE [GUESTNAME]: create a guest from a xenguest image file
|
||||||
as guest GUESTNAME. If GUESTNAME is not given the image file name is used
|
as guest GUESTNAME. If GUESTNAME is not given the image file name is used
|
||||||
@@ -37,6 +37,9 @@ The following operations are available:
|
|||||||
- status [GUESTNAME]: print the current status of GUESTNAME. If GUESTNAME is
|
- status [GUESTNAME]: print the current status of GUESTNAME. If GUESTNAME is
|
||||||
not given, print the status of all guests.
|
not given, print the status of all guests.
|
||||||
|
|
||||||
|
Passing -v or -vv will increase the logging written to the logfile.
|
||||||
|
The terminal will always show only error messages, regardless of the logfile.
|
||||||
|
|
||||||
For a detailed help on available options please use:
|
For a detailed help on available options please use:
|
||||||
`xenguest-manager --help`
|
`xenguest-manager --help`
|
||||||
|
|
||||||
@@ -45,6 +48,7 @@ Bitbake parameters
|
|||||||
|
|
||||||
Several parameters are available to configure the xenguest manager during Yocto
|
Several parameters are available to configure the xenguest manager during Yocto
|
||||||
project compilation (those can be set in your project local.conf, for example).
|
project compilation (those can be set in your project local.conf, for example).
|
||||||
|
This config will be written to a file xenguest-manager.conf in /etc/xenguest/.
|
||||||
|
|
||||||
The following parameters are available:
|
The following parameters are available:
|
||||||
|
|
||||||
@@ -65,6 +69,22 @@ The following parameters are available:
|
|||||||
name).
|
name).
|
||||||
This is set by default to "/usr/share/guests".
|
This is set by default to "/usr/share/guests".
|
||||||
|
|
||||||
|
- XENGUEST_MANAGER_LOG_LEVEL: Set the default log level for xenguest manager.
|
||||||
|
Must be one of ERROR, INFO, VERBOSE (default: ERROR). The logs will be
|
||||||
|
written to /var/log/xenguest.
|
||||||
|
|
||||||
|
If a verbosity argument (-v or -vv) is passed to xenguest-manager directly, it
|
||||||
|
will override the setting in xenguest-manager.conf
|
||||||
|
|
||||||
|
Since /var/log is by default a volatile location, extra configuration is
|
||||||
|
required if logs are desired to be kept between reboots:
|
||||||
|
VOLATILE_LOG_DIR="no"
|
||||||
|
|
||||||
|
Read more here: https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#var-VOLATILE_LOG_DIR
|
||||||
|
|
||||||
|
When this is enabled, logrotate will monitor the file to ensure it does not
|
||||||
|
grow excessively large. See recipes-extended/xenguest/files/logrotate-xenguest
|
||||||
|
|
||||||
Init scripts
|
Init scripts
|
||||||
------------
|
------------
|
||||||
|
|
||||||
@@ -80,7 +100,7 @@ directory on the target:
|
|||||||
|
|
||||||
Inside the directory, scripts will be executed in alphabetical order.
|
Inside the directory, scripts will be executed in alphabetical order.
|
||||||
|
|
||||||
Since these scripts are sourced by xenguest-manager they can acccess functions
|
Since these scripts are sourced by xenguest-manager, they can acccess functions
|
||||||
and variables from the parent file's scope, including:
|
and variables from the parent file's scope, including:
|
||||||
|
|
||||||
- ${guestname} : The name of the guest being created
|
- ${guestname} : The name of the guest being created
|
||||||
@@ -89,11 +109,34 @@ and variables from the parent file's scope, including:
|
|||||||
|
|
||||||
- ${guestcfgfile} : The name of the config file for the starting guest
|
- ${guestcfgfile} : The name of the config file for the starting guest
|
||||||
|
|
||||||
- ${LOGFILE} : The file to append any logging to, e.g.
|
- log() : Used to write a log to the logfile, default level INFO.
|
||||||
echo "Hello, World" >> ${LOGFILE}
|
Takes an optional log level and a message body
|
||||||
|
e.g. log ERROR "blah"
|
||||||
|
|
||||||
Sourcing also allows the script to access params.cfg.
|
Options for log level: ERROR, INFO, VERBOSE,
|
||||||
|
and FATAL which will call exit 1 immediately after logging
|
||||||
|
the message at level ERROR.
|
||||||
|
|
||||||
|
- log_command() : Used to call a shell command and log that it has been
|
||||||
|
called, as well as capturing both stdout and stderr.
|
||||||
|
|
||||||
|
By default the command output is dumped to the logfile as an
|
||||||
|
error if the command returns a status > 0, or as a verbose
|
||||||
|
message if the whole script is running in verbose mode.
|
||||||
|
|
||||||
|
An optional log level can be passed to alter the level the
|
||||||
|
log should be if the command returns a status >0, which may
|
||||||
|
be useful if the command is expected to return a non-zero
|
||||||
|
result.
|
||||||
|
e.g. log_command INFO "ls -lh ~"
|
||||||
|
|
||||||
|
Options for log level: ERROR, INFO, and VERBOSE
|
||||||
|
|
||||||
|
Attempting to call any other functions from xenguest_manager in an init script
|
||||||
|
may result in a fatal error, from which cleanup is not guarenteed.
|
||||||
|
|
||||||
|
|
||||||
|
Init scripts also have access to config variables defined in params.cfg.
|
||||||
|
|
||||||
An example of how to create the directory and install an init shell script can
|
An example of how to create the directory and install an init shell script can
|
||||||
be found in:
|
be found in:
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ Xenguest mkimage
|
|||||||
Introduction
|
Introduction
|
||||||
------------
|
------------
|
||||||
|
|
||||||
xenguest-mkimage is a tool to create and modify images to be used as Guest with
|
xenguest-mkimage is a tool to create and modify images to be used as a Guest
|
||||||
Xen. It defines a format to store completely defined guests as a file or as
|
with Xen. It defines a format to store completely defined guests as a file or as
|
||||||
a directory and provides options to create and modify those images.
|
a directory, and provides options to create and modify those images.
|
||||||
|
|
||||||
A xenguest image contains all elements required to create a xen guest.
|
A xenguest image contains all elements required to create a xen guest.
|
||||||
This is the base elements like a Xen configuration and a Linux kernel binary
|
This is the base elements like a Xen configuration and a Linux kernel binary
|
||||||
@@ -15,8 +15,8 @@ but also some more advanced elements like init scripts or a disk definition.
|
|||||||
The format is made to be deployable easily by storing everything in a single
|
The format is made to be deployable easily by storing everything in a single
|
||||||
file and provide tools to easily manipulate the images. It can also easily be
|
file and provide tools to easily manipulate the images. It can also easily be
|
||||||
extended to have features like encryption or signature of images, updates or
|
extended to have features like encryption or signature of images, updates or
|
||||||
complex configurations by providing features to have init script that will be
|
complex configurations by providing the ability to have init scripts embedded
|
||||||
executed on the host embedded inside the image.
|
inside the image that will be executed on the host when the guest is started.
|
||||||
|
|
||||||
Xenguest images content
|
Xenguest images content
|
||||||
-----------------------
|
-----------------------
|
||||||
@@ -35,7 +35,7 @@ before starting the guest.
|
|||||||
|
|
||||||
### files
|
### files
|
||||||
This directory contains files that can be used by the xen configuration, for
|
This directory contains files that can be used by the xen configuration, for
|
||||||
example the binary of the kernel referenced in xen configuration).
|
example the kernel image referenced in xen configuration.
|
||||||
This is where the kernel binary, the dtb or a ramdisk will be stored.
|
This is where the kernel binary, the dtb or a ramdisk will be stored.
|
||||||
|
|
||||||
### init.pre, init.d and init.post
|
### init.pre, init.d and init.post
|
||||||
@@ -47,7 +47,7 @@ contains scripts called at a different time:
|
|||||||
generate part of the xen configuration dynamically.
|
generate part of the xen configuration dynamically.
|
||||||
- init.d: scripts executed when the guest has been created but before it is
|
- init.d: scripts executed when the guest has been created but before it is
|
||||||
started. This can be used to do some xenstore operations or configure the
|
started. This can be used to do some xenstore operations or configure the
|
||||||
guest behaviour using xl, for example.
|
guest behaviour, using xl for example.
|
||||||
- init.post: scripts executed just after starting the guest. This can be
|
- init.post: scripts executed just after starting the guest. This can be
|
||||||
used to configure things created by xen for the guest like network
|
used to configure things created by xen for the guest like network
|
||||||
network interfaces.
|
network interfaces.
|
||||||
@@ -58,12 +58,19 @@ order.
|
|||||||
### disk.cfg and disk-files
|
### disk.cfg and disk-files
|
||||||
disk.cfg contains the guest disk description (disk size and disk partitions).
|
disk.cfg contains the guest disk description (disk size and disk partitions).
|
||||||
The file contains the following entries:
|
The file contains the following entries:
|
||||||
- `DISK_SIZE=X`: size of the disk to create in GB
|
- `DISK_SIZE=X`: size of the disk to create in MB or GB(default),
|
||||||
|
e.g. 1000M or 4[G]
|
||||||
- `DISK_PARTX=SIZE:FS:CONTENT`: create a partition number X (1 to 4) with a
|
- `DISK_PARTX=SIZE:FS:CONTENT`: create a partition number X (1 to 4) with a
|
||||||
size of SIZE GB, format it with filesystem FS (can be ext2, ext3, ext4, vfat
|
size of SIZE MB or GB(default), e.g 1000M or 2[G].
|
||||||
or swap) and extract CONTENT as initial partition content
|
Format it with filesystem FS (can be ext2, ext3, ext4, vfat or swap)
|
||||||
(.tar[.gz|.xz|.bz2] file or img[.gz|.bz2] file to be dumped in the partition). FS and
|
and extract CONTENT as initial partition content (.tar[.gz|.xz|.bz2] file
|
||||||
CONTENT can be empty.
|
or img[.gz|.bz2] file to be dumped in the partition).
|
||||||
|
FS and CONTENT can be empty.
|
||||||
|
- `DISK_DEVICE=X`: disk or partition to be used by lvm. Setting this option
|
||||||
|
allows to bind guest disk with any partition or disk available on host,
|
||||||
|
e.g. /dev/sda3 or /dev/sdb.
|
||||||
|
This variable is not set by default, but if set, it overrides disk settings
|
||||||
|
inside xenguest-manager.conf - 'XENGUEST_VOLUME_DEVICE'.
|
||||||
|
|
||||||
The disk-files contain files to be used for initializing the disk partitions
|
The disk-files contain files to be used for initializing the disk partitions
|
||||||
content. Those should be used to create a LVM or a physical disk and initialize
|
content. Those should be used to create a LVM or a physical disk and initialize
|
||||||
@@ -105,12 +112,12 @@ For a detailed help on available operations, please use:
|
|||||||
image file. Several script can be added and the basename of FILE is used to
|
image file. Several script can be added and the basename of FILE is used to
|
||||||
distinguish them (calling the option twice with the same file will update the
|
distinguish them (calling the option twice with the same file will update the
|
||||||
script in the image with the second one).
|
script in the image with the second one).
|
||||||
--disk-size=SIZE: set the guest disk size to SIZE in GB. Calling this with 0
|
--disk-size=SIZE: set the guest disk size to SIZE in MB or GB(default),
|
||||||
disable the guest disk.
|
e.g 1000M or 2[G]. Calling this with 0 disable the guest disk.
|
||||||
- --disk-add-part=NUM:SIZE:FS:CONTENT: This is adding a partition to the
|
- --disk-add-part=NUM:SIZE:FS:CONTENT: This is adding a partition to the
|
||||||
xenguest image disk. The partition is described with the arguments:
|
xenguest image disk. The partition is described with the arguments:
|
||||||
- NUM: partition number.
|
- NUM: partition number.
|
||||||
- SIZE: partition size in GB.
|
- SIZE: partition size in MB or GB(default), e.g 1000M or 2[G].
|
||||||
- FS: filesystem to format the partition with. This can be ext2, ext3, ext4,
|
- FS: filesystem to format the partition with. This can be ext2, ext3, ext4,
|
||||||
vfat of swap. If empty the partition is not formated.
|
vfat of swap. If empty the partition is not formated.
|
||||||
- CONTENT: tar of img file to use to initialize the partition. The file must
|
- CONTENT: tar of img file to use to initialize the partition. The file must
|
||||||
|
|||||||
+47
-1
@@ -14,8 +14,19 @@ WKS_FILE = "${ARM_AUTONOMY_WKS_FILE}"
|
|||||||
GUEST_PART_SIZE ?= "4097"
|
GUEST_PART_SIZE ?= "4097"
|
||||||
GUEST_PART_SIZE_UNIT ?= "M"
|
GUEST_PART_SIZE_UNIT ?= "M"
|
||||||
|
|
||||||
|
# Set default boot partition size and unit
|
||||||
|
BOOT_PART_SIZE ?= "100"
|
||||||
|
BOOT_PART_SIZE_UNIT ?= "M"
|
||||||
|
|
||||||
# The GRUB_CFG_FILE affects arm-autonomy-n1sdp-efidisk.wks.in file
|
# The GRUB_CFG_FILE affects arm-autonomy-n1sdp-efidisk.wks.in file
|
||||||
GRUB_CFG_FILE ?= "${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-grub.cfg"
|
#
|
||||||
|
# When alternate-kernel DISTRO_FEATURE is present we set the
|
||||||
|
# arm-autonomy-n1sdp-rt-grub.cfg by default. This GRUB config file has
|
||||||
|
# additional entries for booting with the PREEMPT_RT kernel.
|
||||||
|
GRUB_CFG_FILE ?= "${@bb.utils.contains('DISTRO_FEATURES','alternate-kernel', \
|
||||||
|
'${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-rt-grub.cfg', \
|
||||||
|
'${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-grub.cfg' \
|
||||||
|
, d)}"
|
||||||
|
|
||||||
# From arm-autonomy-n1sdp-efidisk.wks.in, the /boot partition is /dev/sda1, and
|
# From arm-autonomy-n1sdp-efidisk.wks.in, the /boot partition is /dev/sda1, and
|
||||||
# the "/" partition is /dev/sda2.
|
# the "/" partition is /dev/sda2.
|
||||||
@@ -38,3 +49,38 @@ do_image_wic[depends] += "xen:do_deploy"
|
|||||||
IMAGE_EFI_BOOT_FILES += "xen-n1sdp.efi;xen.efi"
|
IMAGE_EFI_BOOT_FILES += "xen-n1sdp.efi;xen.efi"
|
||||||
IMAGE_EFI_BOOT_FILES += "${XEN_MOD_DEVICETREE_DTBS}"
|
IMAGE_EFI_BOOT_FILES += "${XEN_MOD_DEVICETREE_DTBS}"
|
||||||
|
|
||||||
|
# When alternate-kernel DISTRO_FEATURE is present we set the linux-yocto-rt
|
||||||
|
# by default
|
||||||
|
PREFERRED_PROVIDER_alternate/kernel ?= "\
|
||||||
|
${@bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', \
|
||||||
|
'linux-yocto-rt', '', d)}"
|
||||||
|
|
||||||
|
KERNEL_PACKAGE_NAME_alternate/kernel ?= "kernel-rt"
|
||||||
|
# When alternate-kernel DISTRO_FEATURE is present we set the kernel-rt by
|
||||||
|
# default
|
||||||
|
KERNEL_PACKAGE_NAME_pn-linux-yocto-rt = "\
|
||||||
|
${@ d.getVar('KERNEL_PACKAGE_NAME_alternate/kernel') \
|
||||||
|
if bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', True, False, d) \
|
||||||
|
else 'kernel' }"
|
||||||
|
|
||||||
|
# Relative path from DEPLOY_DIR_IMAGE of the Kernel PREEMPT_RT deployed Image
|
||||||
|
KERNEL_RT_IMAGE ?= "kernel-rt/Image-n1sdp.bin;Image-preempt-rt"
|
||||||
|
# Only include the Kernel PREEMPT_RT Image if we are building with
|
||||||
|
# alternate-kernel DISTRO_FEATURE
|
||||||
|
IMAGE_EFI_BOOT_FILES += "\
|
||||||
|
${@ d.getVar('KERNEL_RT_IMAGE',d) or '' \
|
||||||
|
if bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', True, False, d) and \
|
||||||
|
d.getVar('PREFERRED_PROVIDER_alternate/kernel') else ''}"
|
||||||
|
|
||||||
|
|
||||||
|
EFIDIR ?= "/EFI/BOOT"
|
||||||
|
GRUB_CFG_EXTRA_FILE ?= "${ARM_AUTONOMY_ARM_BSP_DYNAMIC_DIR}/wic/arm-autonomy-n1sdp-grub.cfg;.${EFIDIR}}"
|
||||||
|
|
||||||
|
# When alternate-kernel DISTRO_FEATURE is present we set the
|
||||||
|
# arm-autonomy-n1sdp-rt-grub.cfg by default. This GRUB config file has
|
||||||
|
# additional entries for booting with the PREEMPT_RT kernel and also includes
|
||||||
|
# the main GRUB config file set by GRUB_CFG_EXTRA_FILE.
|
||||||
|
IMAGE_EFI_BOOT_FILES += "\
|
||||||
|
${@ d.getVar('GRUB_CFG_EXTRA_FILE',d) or '' \
|
||||||
|
if bb.utils.contains('DISTRO_FEATURES', 'alternate-kernel', True, False, d) and \
|
||||||
|
d.getVar('PREFERRED_PROVIDER_alternate/kernel') else ''}"
|
||||||
|
|||||||
+8
-8
@@ -1,14 +1,14 @@
|
|||||||
# Use OVERRIDES to minimize the usage of
|
# Use OVERRIDES to minimize the usage of
|
||||||
# ${@bb.utils.contains('DISTRO_FEATURES', 'xen', ...
|
# ${@bb.utils.contains('DISTRO_FEATURES', 'autonomy-host', ...
|
||||||
OVERRIDES_append = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ':xen', '', d)}"
|
OVERRIDES_append = "${@bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', ':autonomy-host', '', d)}"
|
||||||
|
|
||||||
FILESEXTRAPATHS_prepend_xen := "${THISDIR}/${PN}:"
|
FILESEXTRAPATHS_prepend_autonomy-host := "${THISDIR}/${PN}:"
|
||||||
|
|
||||||
DEPENDS_append_xen = " dos2unix-native"
|
DEPENDS_append_autonomy-host = " dos2unix-native"
|
||||||
|
|
||||||
SRC_URI_append_xen = " file://add-xen-support.patch;patchdir=../"
|
SRC_URI_append_autonomy-host = " file://add-xen-support.patch;patchdir=../"
|
||||||
|
|
||||||
do_install_append_xen() {
|
do_install_append_autonomy-host() {
|
||||||
mv -v ${D}/${UNPACK_DIR}/SOFTWARE/uEnv.txt \
|
mv -v ${D}/${UNPACK_DIR}/SOFTWARE/uEnv.txt \
|
||||||
${D}/${UNPACK_DIR}/SOFTWARE/uenvfile
|
${D}/${UNPACK_DIR}/SOFTWARE/uenvfile
|
||||||
for dir in $(ls ${D}/${UNPACK_DIR}/SITE1/)
|
for dir in $(ls ${D}/${UNPACK_DIR}/SITE1/)
|
||||||
@@ -18,11 +18,11 @@ do_install_append_xen() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DEPLOY_EXTRA_DEPS ??= ""
|
DEPLOY_EXTRA_DEPS ??= ""
|
||||||
DEPLOY_EXTRA_DEPS_xen = "xen:do_deploy xen-devicetree:do_deploy"
|
DEPLOY_EXTRA_DEPS_autonomy-host = "xen:do_deploy xen-devicetree:do_deploy"
|
||||||
|
|
||||||
do_deploy[depends] += "${DEPLOY_EXTRA_DEPS}"
|
do_deploy[depends] += "${DEPLOY_EXTRA_DEPS}"
|
||||||
|
|
||||||
do_deploy_prepend_xen() {
|
do_deploy_prepend_autonomy-host() {
|
||||||
# To avoid dependency loop between firmware-image-juno:do_install,
|
# To avoid dependency loop between firmware-image-juno:do_install,
|
||||||
# xen:do_deploy and xen-devicetree:do_deploy when
|
# xen:do_deploy and xen-devicetree:do_deploy when
|
||||||
# INITRAMFS_IMAGE_BUNDLE = "1", we need to handle the xen and
|
# INITRAMFS_IMAGE_BUNDLE = "1", we need to handle the xen and
|
||||||
|
|||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
# Yocto kernel-cache sets CONFIG_NLS_CODEPAGE_437=m for LINUX_KERNEL_TYPR=preempt-rt
|
||||||
|
CONFIG_NLS_CODEPAGE_437=y
|
||||||
|
# Yocto kernel-cache sets CONFIG_NLS_ISO8859_1=m for LINUX_KERNEL_TYPR=preempt-rt
|
||||||
|
CONFIG_NLS_ISO8859_1=y
|
||||||
|
|
||||||
|
# Set the timer interrupt run at 1000 Hz to have a fast response
|
||||||
|
CONFIG_HZ_1000=y
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
define KFEATURE_DESCRIPTION "Extra kernel configs when building with PREEMPT_RT"
|
||||||
|
|
||||||
|
kconf non-hardware preempt-rt-extras.cfg
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
# can directly dd to boot media. Uses a custom grub.cfg file to configure the boot.
|
# can directly dd to boot media. Uses a custom grub.cfg file to configure the boot.
|
||||||
|
|
||||||
# First boot partition normally populated as /dev/sda1
|
# First boot partition normally populated as /dev/sda1
|
||||||
part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024
|
part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --size="${BOOT_PART_SIZE}${BOOT_PART_SIZE_UNIT}" --label msdos --active --align 1024
|
||||||
|
|
||||||
# Second rootfs partition normally populated as /dev/sda2
|
# Second rootfs partition normally populated as /dev/sda2
|
||||||
part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 1024
|
part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 1024
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
set term="vt100"
|
||||||
|
set default="3"
|
||||||
|
set timeout="5"
|
||||||
|
|
||||||
|
source $prefix/arm-autonomy-n1sdp-grub.cfg
|
||||||
|
|
||||||
|
menuentry 'N1SDP PREEMPT_RT ACPI Boot' {
|
||||||
|
linux /Image-preempt-rt $kernel_cmdline acpi=force
|
||||||
|
}
|
||||||
|
|
||||||
|
menuentry 'N1SDP PREEMPT_RT Single-Chip Boot (Device Tree)' {
|
||||||
|
devicetree /n1sdp-single-chip.dtb
|
||||||
|
linux /Image-preempt-rt $kernel_cmdline
|
||||||
|
}
|
||||||
|
|
||||||
|
menuentry 'N1SDP PREEMPT_RT Multi-Chip Boot (Device Tree)' {
|
||||||
|
devicetree /n1sdp-multi-chip.dtb
|
||||||
|
linux /Image-preempt-rt $kernel_cmdline
|
||||||
|
}
|
||||||
|
|
||||||
|
menuentry 'N1SDP PREEMPT_RT Arm Autonomy (Xen) Single-Chip Boot (Device Tree)' {
|
||||||
|
# no_argumants under here is a workaround for a bug
|
||||||
|
# also any kernel or dom0 cmdline arguments has to be passed via dtb
|
||||||
|
# because any arguments put here will be ignored by xen
|
||||||
|
xen_hypervisor /xen.efi no_arguments=use_dtb_for_xen_or_kernel_cmdline
|
||||||
|
xen_module /Image-preempt-rt
|
||||||
|
devicetree /n1sdp-single-chip-xen.dtb
|
||||||
|
}
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
XENGUEST_NETWORK_BRIDGE_MEMBERS_gem5-arm64 ?= "eth0"
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
FILESEXTRAPATHS_prepend_gem5-arm64 := "${THISDIR}:"
|
|
||||||
|
|
||||||
#
|
|
||||||
# arm-autonomy kmeta extra
|
|
||||||
#
|
|
||||||
SRC_URI_append_gem5-arm64 = " file://arm-autonomy-kmeta-extra-gem5;type=kmeta;name=arm-autonomy-kmeta-extra-gem5;destsuffix=arm-autonomy-kmeta-extra-gem5"
|
|
||||||
|
|
||||||
# We need to turn off SVE support in the Linux kernel otherwise Xen is stopping
|
|
||||||
# Linux kernel with a coredump while trying to access XEN bit of CPACR1 core
|
|
||||||
# register.
|
|
||||||
LINUX_ARM_AUTONOMY_DISABLE_ARM64_SVE_gem5-arm64 = "${@bb.utils.contains_any('DISTRO_FEATURES', \
|
|
||||||
'arm-autonomy-host arm-autonomy-guest', \
|
|
||||||
' features/arm-autonomy/disable-arm64-sve.scc','',d)}"
|
|
||||||
|
|
||||||
KERNEL_FEATURES_append_gem5-arm64 = "${LINUX_ARM_AUTONOMY_DISABLE_ARM64_SVE}"
|
|
||||||
@@ -1 +1 @@
|
|||||||
GRUB_BUILDIN += "${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'xen_boot', '', d)}"
|
GRUB_BUILDIN += "${@bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', 'xen_boot', '', d)}"
|
||||||
|
|||||||
+70
@@ -0,0 +1,70 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
INSTALL_DIR="###CONTAINERS_INSTALL_DIR###"
|
||||||
|
MANIFEST="${INSTALL_DIR}/###CONTAINERS_MANIFEST###"
|
||||||
|
|
||||||
|
INIT_DIR="/etc/init.d"
|
||||||
|
DOCKER_INIT="docker.init"
|
||||||
|
|
||||||
|
find_docker_init() {
|
||||||
|
if [ -f "$INIT_DIR/$DOCKER_INIT" ]; then
|
||||||
|
$INIT_DIR/$DOCKER_INIT "start"
|
||||||
|
else
|
||||||
|
echo "ERROR: Couldn't find docker init script! ($INIT_DIR/$DOCKER_INIT)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
is_docker_started() {
|
||||||
|
if ! docker info > /dev/null 2>&1; then
|
||||||
|
find_docker_init
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_manifest() {
|
||||||
|
if [ ! -f ${MANIFEST} ]; then
|
||||||
|
echo "No manifest found!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
has_docker_image() {
|
||||||
|
docker image inspect "$1" >/dev/null 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
check_manifest
|
||||||
|
is_docker_started
|
||||||
|
|
||||||
|
while read -r archive name tag keep _; do
|
||||||
|
|
||||||
|
CONTAINER_IMAGE_NAME_AND_TAG="${name}:${tag}"
|
||||||
|
|
||||||
|
# Image does not exist and image file exists: Import the image.
|
||||||
|
if ! has_docker_image "${CONTAINER_IMAGE_NAME_AND_TAG}" && \
|
||||||
|
[ -f "${INSTALL_DIR}/${archive}" ]; then
|
||||||
|
echo "Importing ${CONTAINER_IMAGE_NAME_AND_TAG} container image..."
|
||||||
|
docker import "${INSTALL_DIR}/${archive}" \
|
||||||
|
"${CONTAINER_IMAGE_NAME_AND_TAG}" 2>&1 || {
|
||||||
|
echo "Import ${CONTAINER_IMAGE_NAME_AND_TAG} container image: Failed."
|
||||||
|
exit $?
|
||||||
|
}
|
||||||
|
echo "Import ${CONTAINER_IMAGE_NAME_AND_TAG} container image: Done."
|
||||||
|
|
||||||
|
if [ "${keep}" != "1" ]; then
|
||||||
|
rm "${INSTALL_DIR}/${archive}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done < ${MANIFEST}
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
start && exit 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $0 {start}"
|
||||||
|
exit 2
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit $?
|
||||||
+36
@@ -0,0 +1,36 @@
|
|||||||
|
#
|
||||||
|
# This recipe adds an init script to import the containers added by
|
||||||
|
# docker_extern_containers.bbclass at boot time
|
||||||
|
# Notes:
|
||||||
|
# docker_extern_containers.bbclass creates a manifest file which contains
|
||||||
|
# the columns: archive name tag keep
|
||||||
|
# for each container. This file is read by the import_containers
|
||||||
|
# script to determine the parameters of the import
|
||||||
|
#
|
||||||
|
# Since the script needs knowledge of the values of $CONTAINERS_INSTALL_DIR
|
||||||
|
# and $CONTAINERS_MANIFEST these are substituted for placeholder strings when
|
||||||
|
# the script is installed.
|
||||||
|
|
||||||
|
DESCRIPTION = "Add init script to import docker images at boot"
|
||||||
|
LICENSE = "MIT"
|
||||||
|
|
||||||
|
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||||
|
|
||||||
|
inherit docker_extern_containers
|
||||||
|
|
||||||
|
SRC_URI = "file://import_containers.sh"
|
||||||
|
|
||||||
|
inherit update-rc.d
|
||||||
|
INITSCRIPT_PARAMS = "start 30 2 3 4 5 ."
|
||||||
|
INITSCRIPT_NAME = "import_containers.sh"
|
||||||
|
|
||||||
|
S = "${WORKDIR}"
|
||||||
|
do_install_append() {
|
||||||
|
install -d ${D}${sysconfdir}/init.d
|
||||||
|
install -m 755 import_containers.sh ${D}${sysconfdir}/init.d
|
||||||
|
|
||||||
|
sed -i "s,###CONTAINERS_INSTALL_DIR###,${CONTAINERS_INSTALL_DIR}," \
|
||||||
|
${D}${sysconfdir}/init.d/import_containers.sh
|
||||||
|
sed -i "s,###CONTAINERS_MANIFEST###,${CONTAINERS_MANIFEST}," \
|
||||||
|
${D}${sysconfdir}/init.d/import_containers.sh
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
CONFIG_FEATURE_TAR_LONG_OPTIONS=y
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
|
||||||
|
|
||||||
|
# The --exclude flag in Busybox tar is required by xenguest-mkimage
|
||||||
|
SRC_URI += "file://feature_tar_long_options.cfg"
|
||||||
@@ -1,36 +1,16 @@
|
|||||||
# Recipe to create a minimal Arm Autonomy stack host image
|
# Recipe to create a minimal Arm Autonomy reference stack host image
|
||||||
|
|
||||||
DESCRIPTION = "Arm Autonomy stack host minimal image"
|
DESCRIPTION = "Arm Autonomy stack host minimal image"
|
||||||
|
|
||||||
inherit core-image
|
# When alternate-kernel DISTRO_FEATURE is present we will build
|
||||||
|
# and install the alternate kernel
|
||||||
|
inherit ${@bb.utils.filter('DISTRO_FEATURES', 'alternate-kernel', d)}
|
||||||
|
|
||||||
|
inherit core-image features_check
|
||||||
|
|
||||||
LICENSE = "MIT"
|
LICENSE = "MIT"
|
||||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||||
|
|
||||||
# The ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS variable can be used to include in the
|
|
||||||
# image one or several xenguest images.
|
|
||||||
# The list must be space separated and each entry must have the following
|
|
||||||
# format: URL[;guestname=NAME]
|
|
||||||
# - URL can be the full path to a file or a Yocto compatible SRC_URI url
|
|
||||||
# - guestname=NAME can be used to specify the name of the guest. If not
|
|
||||||
# specified the basename of the file (without .xenguest extension) is used.
|
|
||||||
# Here are examples of values:
|
|
||||||
# /home/mydir/myguest.xenguest;guestname=guest1
|
|
||||||
# http://www.url.com/testguest.xenguest
|
|
||||||
#
|
|
||||||
# If you are using the output of an other Yocto project, you should use the
|
|
||||||
# full path syntax instead of the Yocto SRC_URI to be able to use the
|
|
||||||
# symlink version of your image (as the real file has a new name on each
|
|
||||||
# build as it includes the date). You must not use SRC_URI type file:// as
|
|
||||||
# it will try to include the symlink and not the destination file which will
|
|
||||||
# be detected by the recipe and output an error 'Guest file is a symlink'.
|
|
||||||
#
|
|
||||||
# Guests can also be added using a bbapend to this recipe by adding entries
|
|
||||||
# to SRC_URI with parameter ;guestname=NAME to specify the destination
|
|
||||||
# guestname. The parameter guestname must be present as it is used to detect
|
|
||||||
# guests to be added
|
|
||||||
ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS ??= ""
|
|
||||||
|
|
||||||
# Includes minimal set required to start and manage guest. The xen specific
|
# Includes minimal set required to start and manage guest. The xen specific
|
||||||
# modules are not explicitly included as they are built as part of the kernel
|
# modules are not explicitly included as they are built as part of the kernel
|
||||||
# image for performance reasons. It doesn't include all kernel modules to
|
# image for performance reasons. It doesn't include all kernel modules to
|
||||||
@@ -40,6 +20,7 @@ IMAGE_INSTALL += " \
|
|||||||
packagegroup-core-boot \
|
packagegroup-core-boot \
|
||||||
packagegroup-core-ssh-openssh \
|
packagegroup-core-ssh-openssh \
|
||||||
qemu-system-i386 \
|
qemu-system-i386 \
|
||||||
|
xenguest-extern-guests \
|
||||||
xenguest-manager \
|
xenguest-manager \
|
||||||
xenguest-network \
|
xenguest-network \
|
||||||
"
|
"
|
||||||
@@ -50,96 +31,5 @@ EXTRA_IMAGEDEPENDS += "xen"
|
|||||||
# Build xen-devicetree to produce a xen ready devicetree
|
# Build xen-devicetree to produce a xen ready devicetree
|
||||||
EXTRA_IMAGEDEPENDS += "xen-devicetree"
|
EXTRA_IMAGEDEPENDS += "xen-devicetree"
|
||||||
|
|
||||||
# Documentation for setting up a multiconfig build can be found in:
|
REQUIRED_DISTRO_FEATURES += 'arm-autonomy-host'
|
||||||
# meta-arm-autonomy/documentation/arm-autonomy-multiconfig.md
|
REQUIRED_DISTRO_FEATURES += 'xen'
|
||||||
|
|
||||||
# In a multiconfig build this variable will hold a dependency string, which differs based
|
|
||||||
# on whether the guest has initramfs or not.
|
|
||||||
# It may have a space seperated list of dependency strings if mulitple guest types are
|
|
||||||
# configured
|
|
||||||
MC_DOIMAGE_MCDEPENDS ?= ""
|
|
||||||
# Example value: mc:host:guest:core-image-minimal:do_image_complete
|
|
||||||
|
|
||||||
# In a multiconfig build the host task 'do_image' has a dependency on multiconfig guest.
|
|
||||||
# This ensures that the guest image file already exists when it is needed by the host
|
|
||||||
DO_IMAGE_MCDEPENDS := "${@ '${MC_DOIMAGE_MCDEPENDS}' if d.getVar('BBMULTICONFIG') else ''}"
|
|
||||||
|
|
||||||
# Apply mc dependency. Empty string if multiconfig not enabled
|
|
||||||
do_image[mcdepends] += "${DO_IMAGE_MCDEPENDS}"
|
|
||||||
|
|
||||||
|
|
||||||
python __anonymous() {
|
|
||||||
if bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', False, True, d):
|
|
||||||
raise bb.parse.SkipRecipe("DISTRO_FEATURES does not contain 'arm-autonomy-host'")
|
|
||||||
|
|
||||||
if bb.utils.contains('DISTRO_FEATURES', 'xen', False, True, d):
|
|
||||||
raise bb.parse.SkipRecipe("DISTRO_FEATURES does not contain 'xen'")
|
|
||||||
|
|
||||||
# Check in ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS for extra guests and add them
|
|
||||||
# to SRC_URI with xenguest parameter if not set
|
|
||||||
guestlist = d.getVar('ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS')
|
|
||||||
if guestlist:
|
|
||||||
for guest in guestlist.split():
|
|
||||||
# If the user just specified a file instead of file://FILE, add
|
|
||||||
# the file:// prefix
|
|
||||||
if guest.startswith('/'):
|
|
||||||
guestfile = ''
|
|
||||||
guestname = ''
|
|
||||||
if ';guestname=' in guest:
|
|
||||||
# user specified a guestname
|
|
||||||
guestname = guest.split(';guestname=')[1]
|
|
||||||
guestfile = guest.split(';guestname=')[0]
|
|
||||||
else:
|
|
||||||
# no guestname so use the basename
|
|
||||||
guestname = os.path.basename(guest)
|
|
||||||
guestfile = guest
|
|
||||||
# in case we have a link we need the destination
|
|
||||||
guestfile = os.path.realpath(guestfile)
|
|
||||||
|
|
||||||
# make sure the file exist to give a meaningfull error
|
|
||||||
if not os.path.exists(guestfile):
|
|
||||||
raise bb.parse.SkipRecipe("ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS entry does not exist: " + guest)
|
|
||||||
|
|
||||||
# In case the file is a symlink make sure we use the destination
|
|
||||||
d.appendVar('SRC_URI', ' file://' + guestfile + ';guestname=' + guestname)
|
|
||||||
else:
|
|
||||||
# we have a Yocto URL
|
|
||||||
try:
|
|
||||||
_, _, path, _, _, parm = bb.fetch.decodeurl(guest)
|
|
||||||
# force guestname param in if not already there
|
|
||||||
if not 'guestname' in parm:
|
|
||||||
guest += ';guestname=' + os.path.basename(path)
|
|
||||||
d.appendVar('SRC_URI', ' ' + guest)
|
|
||||||
except:
|
|
||||||
raise bb.parse.SkipRecipe("ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS contains an invalid entry: " + guest)
|
|
||||||
}
|
|
||||||
|
|
||||||
python add_extern_guests () {
|
|
||||||
# Destination directory on the rootfs
|
|
||||||
guestdir = d.getVar('IMAGE_ROOTFS') + d.getVar('datadir') + '/guests'
|
|
||||||
|
|
||||||
# Parse SRC_URI for files with ;guestname= parameter
|
|
||||||
src_uri = d.getVar('SRC_URI')
|
|
||||||
for entry in src_uri.split():
|
|
||||||
_, _, path, _, _, parm = bb.fetch.decodeurl(entry)
|
|
||||||
if 'guestname' in parm:
|
|
||||||
if os.path.islink(path):
|
|
||||||
realpath = os.path.realpath(path)
|
|
||||||
|
|
||||||
if not os.path.exists(realpath):
|
|
||||||
bb.fatal("ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS link does not resolve: " + path)
|
|
||||||
|
|
||||||
bb.note("Guest file is a symlink:\n " + path + "\nResolved to:\n " + realpath)
|
|
||||||
path = realpath
|
|
||||||
|
|
||||||
bb.utils.mkdirhier(guestdir)
|
|
||||||
dstname = parm['guestname']
|
|
||||||
# Add file extension if not there
|
|
||||||
if not dstname.endswith('.xenguest'):
|
|
||||||
dstname += '.xenguest'
|
|
||||||
if not bb.utils.copyfile(path, guestdir + '/' + dstname):
|
|
||||||
bb.fatal("Fail to copy Guest file " + path)
|
|
||||||
}
|
|
||||||
|
|
||||||
IMAGE_PREPROCESS_COMMAND += "add_extern_guests; "
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
# Use OVERRIDES to minimize the usage of
|
# Use OVERRIDES to minimize the usage of
|
||||||
# ${@bb.utils.contains('DISTRO_FEATURES', 'xen', ...
|
# ${@bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', ...
|
||||||
OVERRIDES_append = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ':xen', '', d)}"
|
OVERRIDES_append = "${@bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', ':autonomy-host', '', d)}"
|
||||||
|
|
||||||
# For Xen we only need the i386 binaries
|
# For Xen we only need the i386 binaries
|
||||||
QEMU_TARGETS_xen = "i386"
|
QEMU_TARGETS_autonomy-host = "i386"
|
||||||
|
|
||||||
PACKAGECONFIG[noaudio] = "--audio-drv-list='',,"
|
PACKAGECONFIG[noaudio] = "--audio-drv-list='',,"
|
||||||
PACKAGECONFIG_append_xen = " noaudio"
|
PACKAGECONFIG_append_autonomy-host = " noaudio"
|
||||||
PACKAGECONFIG_remove_xen = "fdt sdl kvm"
|
PACKAGECONFIG_remove_autonomy-host = "fdt sdl kvm"
|
||||||
|
|
||||||
require ${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'recipes-devtools/qemu/${BPN}-package-split.inc', '', d)}
|
require ${@bb.utils.contains('DISTRO_FEATURES', 'arm-autonomy-host', 'recipes-devtools/qemu/${BPN}-package-split.inc', '', d)}
|
||||||
|
|||||||
@@ -12,29 +12,54 @@ S = "${WORKDIR}"
|
|||||||
|
|
||||||
DESCRIPTION = "Add entries in DTB for Xen and Dom0"
|
DESCRIPTION = "Add entries in DTB for Xen and Dom0"
|
||||||
|
|
||||||
# Please refer to documentation/xen-devicetree.md for documentation on those
|
# Please refer to documentation/xen-devicetree.md for documentation on these
|
||||||
# parameters
|
# customizable parameters
|
||||||
# kernel size is passed to xen via xen.dtb so wee need to add
|
# kernel size is passed to xen via xen.dtb so we need to add
|
||||||
# 'virtual/kernel:do_deploy' as a dependency
|
# 'virtual/kernel:do_deploy' as a dependency
|
||||||
XEN_DEVICETREE_DEPEND_append = " virtual/kernel:do_deploy"
|
XEN_DEVICETREE_DEPEND_append = " virtual/kernel:do_deploy"
|
||||||
XEN_DEVICETREE_DTBS ?= "${KERNEL_DEVICETREE}"
|
XEN_DEVICETREE_DTBS ?= "${KERNEL_DEVICETREE}"
|
||||||
XEN_DEVICETREE_XEN_BOOTARGS ?= "noreboot dom0_mem=${XEN_DEVICETREE_DOM0_MEM}"
|
XEN_DEVICETREE_XEN_BOOTARGS ?= "noreboot dom0_mem=${XEN_DEVICETREE_DOM0_MEM}"
|
||||||
XEN_DEVICETREE_DOM0_MEM ?= "1024M"
|
XEN_DEVICETREE_DOM0_MEM ?= "1024M,max:1024M"
|
||||||
XEN_DEVICETREE_DOM0_BOOTARGS ?= "console=hvc0 earlycon=xen"
|
XEN_DEVICETREE_DOM0_BOOTARGS ?= "console=hvc0 earlycon=xen"
|
||||||
XEN_DEVICETREE_DOM0_ADDR ?= "0x80080000"
|
XEN_DEVICETREE_DOM0_ADDR ?= "0x80080000"
|
||||||
XEN_DEVICETREE_DOM0_SIZE ?= "0x01000000"
|
XEN_DEVICETREE_DOM0_SIZE ?= "0x01000000"
|
||||||
XEN_DEVICETREE_DTSI_MERGE ?= "xen.dtsi"
|
XEN_DEVICETREE_DTSI_MERGE ?= "xen.dtsi"
|
||||||
|
|
||||||
# Our package does not generate any package for the rootfs but contributes to
|
# Our package does not generate any packages for the rootfs, but instead
|
||||||
# deploy
|
# contributes to deploy
|
||||||
inherit nopackages deploy
|
inherit nopackages deploy
|
||||||
|
|
||||||
DEPENDS += "dtc-native"
|
DEPENDS += "dtc-native"
|
||||||
|
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||||
|
|
||||||
do_configure[noexec] = "1"
|
do_configure[noexec] = "1"
|
||||||
do_compile[noexec] = "1"
|
do_compile[noexec] = "1"
|
||||||
do_install[noexec] = "1"
|
do_install[noexec] = "1"
|
||||||
|
|
||||||
|
# Validate xen devicetree variables
|
||||||
|
python __anonymous() {
|
||||||
|
|
||||||
|
# Compare values of a list of variables to a regex pattern
|
||||||
|
def validate_type(pattern, var_list):
|
||||||
|
for varname in var_list:
|
||||||
|
if d.getVar(varname):
|
||||||
|
if not pattern.match(d.getVar(varname)):
|
||||||
|
raise bb.parse.SkipRecipe(d.getVar(varname) + "' is not a valid value for " + varname + "!")
|
||||||
|
else:
|
||||||
|
raise bb.parse.SkipRecipe('Required variable ' + varname + ' is empty!')
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
num_vars_to_check = ['XEN_DEVICETREE_DOM0_ADDR', 'XEN_DEVICETREE_DOM0_SIZE']
|
||||||
|
size_vars_to_check = ['XEN_DEVICETREE_DOM0_MEM']
|
||||||
|
|
||||||
|
num_pattern = re.compile(r'((0x[0-9a-fA-F]+)|[0-9]+)$')
|
||||||
|
size_pattern = re.compile(r'[0-9]+[MG](,max:[0-9]+[MG])?$')
|
||||||
|
|
||||||
|
validate_type(num_pattern, num_vars_to_check)
|
||||||
|
validate_type(size_pattern, size_vars_to_check)
|
||||||
|
}
|
||||||
|
|
||||||
do_deploy() {
|
do_deploy() {
|
||||||
if [ ! -f ${WORKDIR}/xen.dtsi.in ]; then
|
if [ ! -f ${WORKDIR}/xen.dtsi.in ]; then
|
||||||
die "xen.dtsi.in does not exist"
|
die "xen.dtsi.in does not exist"
|
||||||
@@ -88,14 +113,18 @@ python calc_xen_dtb_dom0_size() {
|
|||||||
bb.note('size in bytes: %d' % size)
|
bb.note('size in bytes: %d' % size)
|
||||||
# Ceil to MiB
|
# Ceil to MiB
|
||||||
size_required = ceil(size / (2 ** 20)) * (2 ** 20)
|
size_required = ceil(size / (2 ** 20)) * (2 ** 20)
|
||||||
size_defined = int(d.getVar('XEN_DEVICETREE_DOM0_SIZE'), 16)
|
xen_devicetree_dom0_size = d.getVar('XEN_DEVICETREE_DOM0_SIZE')
|
||||||
|
if xen_devicetree_dom0_size[:2] == "0x":
|
||||||
|
size_defined = int(xen_devicetree_dom0_size, 16)
|
||||||
|
else:
|
||||||
|
size_defined = int(xen_devicetree_dom0_size)
|
||||||
|
|
||||||
if size_required > size_defined:
|
if size_required > size_defined:
|
||||||
bb.warn ("Wrong kernel size setting inside xen dtb!\n"\
|
bb.note ("Wrong kernel size setting inside xen dtb!\n"\
|
||||||
"Required:\t%(req)d (%(req)#010X)\n"\
|
"Required:\t%(req)d (%(req)#010X)\n"\
|
||||||
"Requested:\t%(def)d (%(def)#010X)"\
|
"Requested:\t%(def)d (%(def)#010X)"\
|
||||||
% {"req": size_required, "def": size_defined})
|
% {"req": size_required, "def": size_defined})
|
||||||
bb.warn ("Overriding XEN_DEVICETREE_DOM0_SIZE with "\
|
bb.note ("Overriding XEN_DEVICETREE_DOM0_SIZE with "\
|
||||||
"%(req)d (%(req)#010X)" % {"req": size_required})
|
"%(req)d (%(req)#010X)" % {"req": size_required})
|
||||||
d.setVar('XEN_DEVICETREE_DOM0_SIZE', hex(size_required))
|
d.setVar('XEN_DEVICETREE_DOM0_SIZE', hex(size_required))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ case "$1" in
|
|||||||
*)
|
*)
|
||||||
# do not advertise unreasonable commands that there is no reason
|
# do not advertise unreasonable commands that there is no reason
|
||||||
# to use with this device
|
# to use with this device
|
||||||
echo $"Usage: $0 {start|stop|status|restart|force-reload}"
|
echo "Usage: $0 {start|stop|status|restart|force-reload}"
|
||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
/var/log/xenguest {
|
||||||
|
missingok
|
||||||
|
size 10k
|
||||||
|
copytruncate
|
||||||
|
rotate 2
|
||||||
|
}
|
||||||
@@ -10,12 +10,14 @@ BRIDGE_NAME="###BRIDGE_NAME###"
|
|||||||
|
|
||||||
case "${XENGUEST_NETWORK_TYPE:=}" in
|
case "${XENGUEST_NETWORK_TYPE:=}" in
|
||||||
nat)
|
nat)
|
||||||
echo "vif = ['script=vif-nat']" >> ${guestcfgfile}
|
echo "vif = ['script=vif-nat']" >> "${guestcfgfile:?}"
|
||||||
|
log info "Network type is NAT"
|
||||||
;;
|
;;
|
||||||
bridge)
|
bridge)
|
||||||
echo "vif = ['script=vif-bridge,bridge=${BRIDGE_NAME}']" >> ${guestcfgfile}
|
echo "vif = ['script=vif-bridge,bridge=${BRIDGE_NAME}']" >> "${guestcfgfile:?}"
|
||||||
|
log info "Network type is bridge: ${BRIDGE_NAME}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "${@}: XENGUEST_NETWORK_TYPE=$XENGUEST_NETWORK_TYPE invalid"
|
log error "XENGUEST_NETWORK_TYPE=$XENGUEST_NETWORK_TYPE invalid"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -25,19 +25,19 @@ case "$1" in
|
|||||||
echo "Starting xenguest"
|
echo "Starting xenguest"
|
||||||
|
|
||||||
# Create unconfigured guests
|
# Create unconfigured guests
|
||||||
if [ -d ${XENGUEST_GUEST_DIR} ]; then
|
if [ -d "${XENGUEST_GUEST_DIR}" ]; then
|
||||||
for f in $(find ${XENGUEST_GUEST_DIR} -name "*.xenguest" \
|
shopt -s nullglob
|
||||||
-exec basename {} .xenguest \;); do
|
for path in "${XENGUEST_GUEST_DIR}"/*.xenguest; do
|
||||||
if [ ! -f ${XENGUEST_CONF_BASE}/guests/${f}/guest.cfg ]; then
|
f=$(basename "${path}" .xenguest)
|
||||||
|
if [ ! -f "${XENGUEST_CONF_BASE}/guests/${f}/guest.cfg" ]; then
|
||||||
# Check if this guest should be auto booted
|
# Check if this guest should be auto booted
|
||||||
autoboot=$(/usr/bin/xenguest-mkimage dump-paramsconfig \
|
autoboot=$(/usr/bin/xenguest-mkimage dump-paramsconfig \
|
||||||
${XENGUEST_GUEST_DIR}/${f}.xenguest | \
|
"${path}" | \
|
||||||
grep GUEST_AUTOBOOT | sed -e "s,.*=,," | tr -d '"')
|
grep GUEST_AUTOBOOT | sed -e "s,.*=,," | tr -d '"')
|
||||||
if [ "$autoboot" = "0" ]; then
|
if [ "$autoboot" = "0" ]; then
|
||||||
echo "Do not create $f, autoboot disabled"
|
echo "Do not create $f, autoboot disabled"
|
||||||
else
|
else
|
||||||
/usr/bin/xenguest-manager create \
|
/usr/bin/xenguest-manager create "${path}"
|
||||||
${XENGUEST_GUEST_DIR}/${f}.xenguest
|
|
||||||
# Update guestlist
|
# Update guestlist
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
guestlist="${guestlist} ${f}"
|
guestlist="${guestlist} ${f}"
|
||||||
@@ -49,11 +49,11 @@ case "$1" in
|
|||||||
if [ -n "${guestlist}" ]; then
|
if [ -n "${guestlist}" ]; then
|
||||||
for f in ${guestlist}; do
|
for f in ${guestlist}; do
|
||||||
GUEST_AUTOBOOT="1"
|
GUEST_AUTOBOOT="1"
|
||||||
if [ -f ${XENGUEST_CONF_BASE}/guests/${f}/params.cfg ]; then
|
if [ -f "${XENGUEST_CONF_BASE}/guests/${f}/params.cfg" ]; then
|
||||||
source ${XENGUEST_CONF_BASE}/guests/${f}/params.cfg
|
source "${XENGUEST_CONF_BASE}/guests/${f}/params.cfg"
|
||||||
fi
|
fi
|
||||||
if [ "${GUEST_AUTOBOOT}" = "1" ]; then
|
if [ "${GUEST_AUTOBOOT}" = "1" ]; then
|
||||||
/usr/bin/xenguest-manager start ${f}
|
/usr/bin/xenguest-manager start "${f}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
@@ -68,7 +68,7 @@ case "$1" in
|
|||||||
# update guest list
|
# update guest list
|
||||||
guestlist=$(xenguest-manager status | grep Running | cut -d ":" -f1)
|
guestlist=$(xenguest-manager status | grep Running | cut -d ":" -f1)
|
||||||
for f in ${guestlist}; do
|
for f in ${guestlist}; do
|
||||||
xl shutdown -w ${f} || xl destroy ${f}
|
xenguest-manager shutdown "${f}" --kill
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
reload)
|
reload)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -110,7 +110,8 @@ Init configuration
|
|||||||
|
|
||||||
Disk configuration
|
Disk configuration
|
||||||
--disk-reset-config reset disk guest configuration to default (no disk)
|
--disk-reset-config reset disk guest configuration to default (no disk)
|
||||||
--disk-size=SZ set guest disk size (in GB)
|
--disk-size=SZ set guest disk size in MB or GB(default),
|
||||||
|
e.g 1000M or 2[G].
|
||||||
--disk-device=DEV set device to be used to create the guest disk
|
--disk-device=DEV set device to be used to create the guest disk
|
||||||
if unset or set to an empty string, the volume will be
|
if unset or set to an empty string, the volume will be
|
||||||
create in the default manager volume group.
|
create in the default manager volume group.
|
||||||
@@ -127,7 +128,7 @@ Disk configuration
|
|||||||
--disk-rm-part=ID remove partition ID from the guest disk
|
--disk-rm-part=ID remove partition ID from the guest disk
|
||||||
--disk-add-file=SRC:DST add file SRC as disk file DST in the xenguest image.
|
--disk-add-file=SRC:DST add file SRC as disk file DST in the xenguest image.
|
||||||
DST can then be used as a partition CONTENT.
|
DST can then be used as a partition CONTENT.
|
||||||
--disk--rm-file=DST remove disk file DST from the xenguest image.
|
--disk-rm-file=DST remove disk file DST from the xenguest image.
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -370,13 +371,159 @@ disk_config_rm_part() {
|
|||||||
sed -i "/DISK_PART${partid}=.*/d" ${IMAGE_TMPDIR}/disk.cfg
|
sed -i "/DISK_PART${partid}=.*/d" ${IMAGE_TMPDIR}/disk.cfg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_integer() {
|
||||||
|
if ! [[ "${1}" =~ ^[0-9]+$ ]]; then
|
||||||
|
>&2 echo "error: invalid number '${1}'"; exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# check size and convert it to MB, e.g '1[G]' => '1000M'
|
||||||
|
check_size() {
|
||||||
|
local disksize="${1}"
|
||||||
|
|
||||||
|
[ -n "${disksize}" ] || disksize="invalid"
|
||||||
|
|
||||||
|
# disksize may have appended M or G suffix, let's extract it
|
||||||
|
# ${var:offset:length}, where #var is var length
|
||||||
|
local lastchar="${disksize:${#disksize}-1}"
|
||||||
|
case "${lastchar}" in
|
||||||
|
[0-9])
|
||||||
|
# backwards compatibility
|
||||||
|
is_integer "${disksize}"
|
||||||
|
echo -e "$((${disksize} * 1000))M"
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
G|M)
|
||||||
|
if [ "${#disksize}" -gt "1" ]; then
|
||||||
|
local size="${disksize::${#disksize}-1}"
|
||||||
|
is_integer "${size}"
|
||||||
|
# convert GB to MB
|
||||||
|
[ "${lastchar}" = "M" ] || size=$((${size} * 1000))
|
||||||
|
echo -e "${size}M"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
>&2 echo -e "Invalid size format '${1}'" \
|
||||||
|
"\n\tSupported size format is e.g 1000M or 2[G]"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
disk_config_get_size() {
|
||||||
|
disksize=$(echo -e "$( . ${IMAGE_TMPDIR}/disk.cfg && echo $DISK_SIZE)")
|
||||||
|
check_size "${disksize}"
|
||||||
|
}
|
||||||
|
|
||||||
|
disk_config_get_parts() {
|
||||||
|
echo -e "$( . ${IMAGE_TMPDIR}/disk.cfg && \
|
||||||
|
typeset -p | awk '$3 ~ /^DISK_PART/ { print $3 }')"
|
||||||
|
}
|
||||||
|
|
||||||
|
disk_config_get_free_space() {
|
||||||
|
disk_usage="0"
|
||||||
|
for partinfo in $(disk_config_get_parts)
|
||||||
|
do
|
||||||
|
partsize=$(echo "${partinfo}" | cut -d '"' -f2 | sed -e "s/:.*//")
|
||||||
|
sizeMB=$(check_size "${partsize}")
|
||||||
|
[ -n "${sizeMB}" ] || exit 1
|
||||||
|
disk_usage=$((${sizeMB::${#sizeMB}-1} + $disk_usage))
|
||||||
|
done
|
||||||
|
|
||||||
|
disk_size=$(disk_config_get_size)
|
||||||
|
echo -e "$((${disk_size::${#disk_size}-1} - ${disk_usage}))M"
|
||||||
|
}
|
||||||
|
|
||||||
|
disk_check_partition_format() {
|
||||||
|
local partformat="${1}"
|
||||||
|
# if partformat is not defined let's skip this check
|
||||||
|
[ -n "${partformat}" ] || return 0
|
||||||
|
|
||||||
|
case "${partformat}" in
|
||||||
|
vfat|ext2|ext3|ext4|swap)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# invalid/unknown fstype
|
||||||
|
echo "Invalid file fstype ${partformat}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
disk_check_partition_content() {
|
||||||
|
local partcontent="${1}"
|
||||||
|
# if partcontent is not defined let's skip this check
|
||||||
|
[ -n "${partcontent}" ] || return 0
|
||||||
|
|
||||||
|
case "${partcontent}" in
|
||||||
|
*.img*)
|
||||||
|
case "${partcontent}" in
|
||||||
|
*.img.gz|*.img.bz2|*.img)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# invalid/unknown compression type
|
||||||
|
echo "Invalid file format in disk ${partcontent}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
*.tar*)
|
||||||
|
case "${partcontent}" in
|
||||||
|
*.tar.gz|*.tar.bz2|*.tar.xz|*.tar)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# invalid/unknown tar type
|
||||||
|
echo "Invalid file format in disk ${partcontent}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
#invalid content type
|
||||||
|
echo "Unsupported content type ${partcontent}!"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
# do not allow to create multiple partitions the same content
|
||||||
|
if grep ":${partcontent}\"" <<< "$(disk_config_get_parts)"; then
|
||||||
|
echo "Error ${partcontent} is already inside guest image"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
disk_config_add_part() {
|
disk_config_add_part() {
|
||||||
partconf="${1}"
|
partconf="${1}"
|
||||||
partid=$(echo ${partconf} | sed -e "s/:.*//")
|
partid=$(echo ${partconf} | sed -e "s/:.*//")
|
||||||
partinfo=$(echo ${partconf} | sed -e "s/[^:]*://")
|
partinfo=$(echo ${partconf} | sed -e "s/[^:]*://")
|
||||||
|
partsize=$(echo ${partinfo} | cut -d ":" -f1)
|
||||||
|
partformat=$(echo ${partinfo} | cut -d ":" -f2)
|
||||||
|
partcontent=$(echo ${partinfo} | cut -d ":" -f3)
|
||||||
|
|
||||||
|
# check size "ID:*SIZE*:FORMAT:CONTENT"
|
||||||
|
partsizeMB=$(check_size "${partsize}")
|
||||||
|
|
||||||
# Make sure we don't add the same partition twice
|
# Make sure we don't add the same partition twice
|
||||||
disk_config_rm_part ${partid}
|
disk_config_rm_part "${partid}"
|
||||||
|
|
||||||
|
# check available disk space
|
||||||
|
freespace=$(disk_config_get_free_space)
|
||||||
|
if ((${partsizeMB::${#partsizeMB}-1} > ${freespace::${#freespace}-1}))
|
||||||
|
then
|
||||||
|
echo -e "Not enough free disk space(${freespace}) for partition "\
|
||||||
|
"'${partconf}'!"\
|
||||||
|
"\tTo adjust disk size use '--disk-size' parameter"\
|
||||||
|
"\tor shrink the partition with '--disk-add-part' parameter"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# check format "ID:SIZE:*FORMAT*:CONTENT"
|
||||||
|
disk_check_partition_format "${partformat}"
|
||||||
|
|
||||||
|
# check content "ID:SIZE:FORMAT:*CONTENT*"
|
||||||
|
disk_check_partition_content "${partcontent}"
|
||||||
|
|
||||||
echo "DISK_PART${partid}=\"${partinfo}\"" >> \
|
echo "DISK_PART${partid}=\"${partinfo}\"" >> \
|
||||||
${IMAGE_TMPDIR}/disk.cfg
|
${IMAGE_TMPDIR}/disk.cfg
|
||||||
}
|
}
|
||||||
@@ -742,11 +889,13 @@ for arg in "${@}"; do
|
|||||||
disk_config_reset
|
disk_config_reset
|
||||||
;;
|
;;
|
||||||
--disk-size=*)
|
--disk-size=*)
|
||||||
sed -i "s/DISK_SIZE=.*/DISK_SIZE=\"${optarg}\"/" \
|
size=$(check_size "${optarg}")
|
||||||
|
[ -n "size" ] || exit 1
|
||||||
|
sed -i "s/DISK_SIZE=.*/DISK_SIZE=\"${size}\"/" \
|
||||||
${IMAGE_TMPDIR}/disk.cfg
|
${IMAGE_TMPDIR}/disk.cfg
|
||||||
;;
|
;;
|
||||||
--disk-device=*)
|
--disk-device=*)
|
||||||
sed -i "s/DISK_DEVICE=.*/DISK_SIZE=\"${optarg}\"/" \
|
sed -i "s@DISK_DEVICE=.*@DISK_DEVICE=\"${optarg}\"@" \
|
||||||
${IMAGE_TMPDIR}/disk.cfg
|
${IMAGE_TMPDIR}/disk.cfg
|
||||||
;;
|
;;
|
||||||
--disk-add-part=*)
|
--disk-add-part=*)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ case "$1" in
|
|||||||
*)
|
*)
|
||||||
# do not advertise unreasonable commands that there is no reason
|
# do not advertise unreasonable commands that there is no reason
|
||||||
# to use with this device
|
# to use with this device
|
||||||
echo $"Usage: $0 {start|stop|status|restart|force-reload}"
|
echo "Usage: $0 {start|stop|status|restart|force-reload}"
|
||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|||||||
@@ -11,19 +11,20 @@ set +u
|
|||||||
#
|
#
|
||||||
|
|
||||||
check_if_vif_is_ready() {
|
check_if_vif_is_ready() {
|
||||||
ret=($(xl network-list "${guestname}" | grep "${1}"))
|
ret=$(xl network-list "${guestname:?}" | grep "${1}" \
|
||||||
# ${ret[4]} is network interface status value
|
| tr -s ' ' | cut -d' ' -f5)
|
||||||
|
# ${ret} is network interface status value
|
||||||
# 1 means vif is not ready
|
# 1 means vif is not ready
|
||||||
# 4 means vif is ready
|
# 4 means vif is ready
|
||||||
[ "${ret[4]}" = "4" ] && return 0
|
[ "${ret}" = "4" ] && return 0
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
case "${XENGUEST_NETWORK_TYPE:-}" in
|
case "${XENGUEST_NETWORK_TYPE:-}" in
|
||||||
nat)
|
nat)
|
||||||
vif_name="$(xl network-list ${guestname} | grep -o vif.*)"
|
vif_name="$(xl network-list "${guestname:?}" | grep -o "vif.*")"
|
||||||
|
|
||||||
for try in {1..20}
|
for try in $(seq 20)
|
||||||
do
|
do
|
||||||
if check_if_vif_is_ready "${vif_name}"; then
|
if check_if_vif_is_ready "${vif_name}"; then
|
||||||
claim_lock "vif-nat-kea"
|
claim_lock "vif-nat-kea"
|
||||||
@@ -31,15 +32,14 @@ case "${XENGUEST_NETWORK_TYPE:-}" in
|
|||||||
release_lock "vif-nat-kea"
|
release_lock "vif-nat-kea"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo "Waiting for ${vif_name} - network interface is not ready..."\
|
log info "Waiting for ${vif_name} - network interface is not ready..."
|
||||||
" try #${try}" >> "${LOGFILE}" 2>&1
|
log info "try #${try}"
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
echo "ERROR: Failed to get ${vif_name} "\
|
log error "Failed to get ${vif_name}. network interface ready!"
|
||||||
"network interface ready!" >> "${LOGFILE}" 2>&1
|
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "No action needed" >> "${LOGFILE}" 2>&1
|
log verbose "No action needed"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
# Create a xenguest base image
|
# Create a xenguest base image
|
||||||
#
|
#
|
||||||
# This recipe creates a base image that is then extended by other recipes
|
# This recipe creates a base image that is then extended by other recipes
|
||||||
# through xenguest-image class.
|
# through xenguest_image class.
|
||||||
# xenguest image type is using this as base to add a kernel and a disk image
|
# xenguest image type uses this recipe as a base to add a kernel and a disk
|
||||||
# to create a guest
|
# image to create a guest
|
||||||
#
|
#
|
||||||
# The recipe is also adding files in those directories to the xenguest image:
|
# The recipe also adds files in those directories to the xenguest image:
|
||||||
# - ${WORKDIR}/extend/disk-files: all files in this directory will be added to
|
# - ${WORKDIR}/extend/disk-files: all files in this directory will be added to
|
||||||
# the guest disk files (using --disk-add-file)
|
# the guest disk files (using --disk-add-file)
|
||||||
# - ${WORKDIR}/extend/files: all files in this directory will be added to the
|
# - ${WORKDIR}/extend/files: all files in this directory will be added to the
|
||||||
@@ -72,7 +72,15 @@ XENGUEST_IMAGE_SRC_URI_INIT_POST ??= ""
|
|||||||
|
|
||||||
S = "${WORKDIR}"
|
S = "${WORKDIR}"
|
||||||
|
|
||||||
inherit deploy xenguest-image
|
# Extra vars to add to xenguest.env
|
||||||
|
XENGUEST_IMAGE_VARS_EXTRA += "\
|
||||||
|
XENGUEST_IMAGE_HOST_PORT XENGUEST_IMAGE_GUEST_PORT \
|
||||||
|
XENGUEST_IMAGE_NAT_PORT_FORWARD_SCRIPT XENGUEST_IMAGE_SRC_URI_DISK_FILES \
|
||||||
|
XENGUEST_IMAGE_SRC_URI_XEN_FILES XENGUEST_IMAGE_SRC_URI_XEN_CONFIG \
|
||||||
|
XENGUEST_IMAGE_SRC_URI_INIT_PRE XENGUEST_IMAGE_SRC_URI_INIT \
|
||||||
|
XENGUEST_IMAGE_SRC_URI_INIT_POST"
|
||||||
|
|
||||||
|
inherit deploy xenguest_image
|
||||||
|
|
||||||
# parse XENGUEST_IMAGE_SRC_URI_ variables and add them to SRC_URI
|
# parse XENGUEST_IMAGE_SRC_URI_ variables and add them to SRC_URI
|
||||||
python __anonymous() {
|
python __anonymous() {
|
||||||
|
|||||||
@@ -0,0 +1,85 @@
|
|||||||
|
# Xenguest Extern Guests
|
||||||
|
#
|
||||||
|
# This recipe installs the extern guest files specified in
|
||||||
|
# ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS into the host image, They are installed
|
||||||
|
# to the directory XENGUEST_MANAGER_GUEST_DIR
|
||||||
|
#
|
||||||
|
# src_uri_parse_var.bbclass is used to parse
|
||||||
|
# ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS and add the guest paths to the SRC_URI
|
||||||
|
# to be fetched and unpacked to ${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}
|
||||||
|
#
|
||||||
|
# Further documentation can be found in documentation/arm-autonomy-quickstart.md,
|
||||||
|
# in the section named "Include guests directly in the host image"
|
||||||
|
|
||||||
|
DESCRIPTION = "Xenguest Extern Guests"
|
||||||
|
LICENSE = "MIT"
|
||||||
|
|
||||||
|
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||||
|
|
||||||
|
# Global value of XENGUEST_MANAGER_GUEST_DIR set here
|
||||||
|
require conf/xenguest.conf
|
||||||
|
|
||||||
|
ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS ??= ""
|
||||||
|
|
||||||
|
# Parse the variable ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS for xenguest files,
|
||||||
|
# unpack them to SRC_URI_FROM_VAR_UNPACK_DIR and create a manifest file
|
||||||
|
# containing each of SRC_URI_FROM_VAR_MANIFEST_PARAMS for each entry
|
||||||
|
inherit set_src_uri_from_var
|
||||||
|
SRC_URI_FROM_VAR_NAME = "ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS"
|
||||||
|
SRC_URI_FROM_VAR_MANIFEST_PARAMS= "guestname=[basename] guestcount=1"
|
||||||
|
SRC_URI_FROM_VAR_UNPACK_DIR = "xenguests"
|
||||||
|
|
||||||
|
# Unnecessary tasks
|
||||||
|
do_compile[noexec] = "1"
|
||||||
|
do_configure[noexec] = "1"
|
||||||
|
do_patch[noexec] = "1"
|
||||||
|
|
||||||
|
# Install guest files to XENGUEST_MANAGER_GUEST_DIR
|
||||||
|
do_install() {
|
||||||
|
|
||||||
|
local guestfile guestname guestcount
|
||||||
|
|
||||||
|
if [ -f "${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}/manifest" ]; then
|
||||||
|
|
||||||
|
install -d "${D}${XENGUEST_MANAGER_GUEST_DIR}"
|
||||||
|
|
||||||
|
# Iterate over manifest file containing parameters
|
||||||
|
while read -r guestfile guestname guestcount _; do
|
||||||
|
[ -f "${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}/${guestfile}" ] ||
|
||||||
|
bbfatal "${guestfile} does not exist"
|
||||||
|
|
||||||
|
install -m 644 \
|
||||||
|
"${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}/${guestfile}" \
|
||||||
|
"${D}${XENGUEST_MANAGER_GUEST_DIR}/${guestname}.xenguest"
|
||||||
|
|
||||||
|
# Create symlinks for duplicate guests, appending numbers to
|
||||||
|
# guestname
|
||||||
|
for i in `seq 2 $guestcount`
|
||||||
|
do
|
||||||
|
ln -s -r \
|
||||||
|
"${D}${XENGUEST_MANAGER_GUEST_DIR}/${guestname}.xenguest" \
|
||||||
|
"${D}${XENGUEST_MANAGER_GUEST_DIR}/${guestname}$i.xenguest"
|
||||||
|
done
|
||||||
|
|
||||||
|
done < "${WORKDIR}/${SRC_URI_FROM_VAR_UNPACK_DIR}/manifest"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
do_install[vardeps] += "ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS"
|
||||||
|
|
||||||
|
FILES_${PN} += "${XENGUEST_MANAGER_GUEST_DIR}"
|
||||||
|
|
||||||
|
# In a multiconfig build this variable will hold a dependency string, which
|
||||||
|
# differs based on whether the guest has initramfs or not. It may have a space
|
||||||
|
# seperated list of dependency strings if mulitple guest types are configured
|
||||||
|
MC_DOIMAGE_MCDEPENDS ?= ""
|
||||||
|
# Example value: mc:host:guest:core-image-minimal:do_merge_xenguestenv
|
||||||
|
|
||||||
|
# In a multiconfig build the host task 'do_image' has a dependency on
|
||||||
|
# multiconfig guest. This ensures that the guest image file already exists
|
||||||
|
# when it is needed by the host
|
||||||
|
DO_IMAGE_MCDEPENDS := "${@ '${MC_DOIMAGE_MCDEPENDS}' \
|
||||||
|
if d.getVar('BBMULTICONFIG') else ''}"
|
||||||
|
|
||||||
|
# Apply mc dependency. Empty string if multiconfig not enabled
|
||||||
|
do_fetch[mcdepends] += "${DO_IMAGE_MCDEPENDS}"
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
# Xenguest manager recipe
|
# Xenguest manager recipe
|
||||||
#
|
#
|
||||||
# xenguest-manager is a tool to control xen guest (e.g. create, start, stop)
|
# xenguest-manager is a tool to control xen guests (e.g. create, start, stop)
|
||||||
#
|
#
|
||||||
|
# Usage documentation for the xenguest-manager tool can be found in
|
||||||
|
# meta-arm-autonomy/documentation/xenguest-manager.md including the
|
||||||
|
# customizable bitbake variables.
|
||||||
|
|
||||||
DESCRIPTION = "Xen Guest Manager"
|
DESCRIPTION = "Xen Guest Manager"
|
||||||
LICENSE = "MIT"
|
LICENSE = "MIT"
|
||||||
@@ -9,23 +12,25 @@ LICENSE = "MIT"
|
|||||||
SRC_URI = " \
|
SRC_URI = " \
|
||||||
file://xenguest-manager \
|
file://xenguest-manager \
|
||||||
file://xenguest-init \
|
file://xenguest-init \
|
||||||
|
file://logrotate-xenguest \
|
||||||
"
|
"
|
||||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||||
|
|
||||||
S = "${WORKDIR}"
|
S = "${WORKDIR}"
|
||||||
|
|
||||||
# Please refer to documentation/xenguest-manager.md for documentation on those
|
|
||||||
# parameters
|
|
||||||
XENGUEST_MANAGER_VOLUME_DEVICE ?= "/dev/sda2"
|
XENGUEST_MANAGER_VOLUME_DEVICE ?= "/dev/sda2"
|
||||||
XENGUEST_MANAGER_VOLUME_NAME ?= "vg-xen"
|
XENGUEST_MANAGER_VOLUME_NAME ?= "vg-xen-$(basename ${XENGUEST_MANAGER_VOLUME_DEVICE})"
|
||||||
XENGUEST_MANAGER_GUEST_DIR ?= "${datadir}/guests/"
|
XENGUEST_MANAGER_LOG_LEVEL ?= "ERROR"
|
||||||
|
#XENGUEST_MANAGER_GUEST_DIR set in xenguest.conf
|
||||||
|
|
||||||
|
require conf/xenguest.conf
|
||||||
|
|
||||||
# We add an init script to create and start guests automatically
|
# We add an init script to create and start guests automatically
|
||||||
# run start script after xen-tools and run stop script before xen-tools
|
# run start script after xen-tools and run stop script before xen-tools
|
||||||
INITSCRIPT_NAME = "xenguest"
|
INITSCRIPT_NAME = "xenguest"
|
||||||
INITSCRIPT_PARAMS = "start 90 2 3 4 5 . stop 79 0 1 6 ."
|
INITSCRIPT_PARAMS = "start 90 2 3 4 5 . stop 79 0 1 6 ."
|
||||||
|
|
||||||
inherit update-rc.d
|
inherit allarch update-rc.d
|
||||||
|
|
||||||
do_compile() {
|
do_compile() {
|
||||||
echo "XENGUEST_VOLUME_DEVICE=\"${XENGUEST_MANAGER_VOLUME_DEVICE}\"" > \
|
echo "XENGUEST_VOLUME_DEVICE=\"${XENGUEST_MANAGER_VOLUME_DEVICE}\"" > \
|
||||||
@@ -34,6 +39,8 @@ do_compile() {
|
|||||||
xenguest-manager.conf
|
xenguest-manager.conf
|
||||||
echo "XENGUEST_GUEST_DIR=\"${XENGUEST_MANAGER_GUEST_DIR}\"" >> \
|
echo "XENGUEST_GUEST_DIR=\"${XENGUEST_MANAGER_GUEST_DIR}\"" >> \
|
||||||
xenguest-manager.conf
|
xenguest-manager.conf
|
||||||
|
echo "XENGUEST_LOG_LEVEL=\"${XENGUEST_MANAGER_LOG_LEVEL}\"" >> \
|
||||||
|
xenguest-manager.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
do_install() {
|
do_install() {
|
||||||
@@ -44,10 +51,13 @@ do_install() {
|
|||||||
install -d -m 755 ${D}${sysconfdir}/init.d
|
install -d -m 755 ${D}${sysconfdir}/init.d
|
||||||
install -m 755 xenguest-init ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
|
install -m 755 xenguest-init ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
|
||||||
install -d -m 755 ${D}${XENGUEST_GUEST_DIR}
|
install -d -m 755 ${D}${XENGUEST_GUEST_DIR}
|
||||||
|
install -d -m 755 ${D}${sysconfdir}/logrotate.d
|
||||||
|
install -m 644 logrotate-xenguest ${D}${sysconfdir}/logrotate.d/xenguest
|
||||||
}
|
}
|
||||||
|
|
||||||
# Things that we need on the target
|
# Things that we need on the target
|
||||||
RDEPENDS_${PN} += "bash tar xenguest-mkimage lvm2 xen-tools parted e2fsprogs dosfstools"
|
RDEPENDS_${PN} += "bash xenguest-mkimage lvm2 xen-tools parted e2fsprogs \
|
||||||
|
dosfstools logrotate"
|
||||||
|
|
||||||
FILES_${PN} += "${bindir}/xenguest-manager \
|
FILES_${PN} += "${bindir}/xenguest-manager \
|
||||||
${sysconfdir}/xenguest"
|
${sysconfdir}/xenguest"
|
||||||
|
|||||||
@@ -2,8 +2,11 @@
|
|||||||
#
|
#
|
||||||
# xenguest-mkimage is a tool to create/modify images to be used as xen guests
|
# xenguest-mkimage is a tool to create/modify images to be used as xen guests
|
||||||
# Produced images contains a xen configuration and several optional components
|
# Produced images contains a xen configuration and several optional components
|
||||||
# (kernel, device-tree, disk definition and files, init scripts) which all
|
# (kernel, device-tree, disk definition and files, and init scripts) which all
|
||||||
# together fully define a full xen guest
|
# together fully define a xen guest image
|
||||||
|
#
|
||||||
|
# Usage documentation for the xenguest-mkimage tool can be found in
|
||||||
|
# meta-arm-autonomy/documentation/xenguest-mkimage.md
|
||||||
|
|
||||||
DESCRIPTION = "Xenguest mkimage tool"
|
DESCRIPTION = "Xenguest mkimage tool"
|
||||||
LICENSE = "MIT"
|
LICENSE = "MIT"
|
||||||
@@ -17,6 +20,8 @@ S = "${WORKDIR}"
|
|||||||
# Can be built native also to produce xenguest images during Yocto build
|
# Can be built native also to produce xenguest images during Yocto build
|
||||||
BBCLASSEXTEND = "native"
|
BBCLASSEXTEND = "native"
|
||||||
|
|
||||||
|
inherit allarch
|
||||||
|
|
||||||
do_configure[noexec] = "1"
|
do_configure[noexec] = "1"
|
||||||
do_compile[noexec] = "1"
|
do_compile[noexec] = "1"
|
||||||
|
|
||||||
@@ -25,7 +30,7 @@ do_install() {
|
|||||||
install -m 755 xenguest-mkimage ${D}${bindir}/.
|
install -m 755 xenguest-mkimage ${D}${bindir}/.
|
||||||
}
|
}
|
||||||
|
|
||||||
# We need bash and tar
|
# We need bash
|
||||||
RDEPENDS_${PN} = "bash tar"
|
RDEPENDS_${PN} = "bash"
|
||||||
FILES_${PN} = "${bindir}/xenguest-mkimage"
|
FILES_${PN} = "${bindir}/xenguest-mkimage"
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda
|
|||||||
S = "${WORKDIR}"
|
S = "${WORKDIR}"
|
||||||
|
|
||||||
# Please refer to documentation/xenguest-network-bridge.md for documentation on
|
# Please refer to documentation/xenguest-network-bridge.md for documentation on
|
||||||
# those parameters
|
# the parameters available for customization
|
||||||
XENGUEST_NETWORK_BRIDGE_NAME ?= "xenbr0"
|
XENGUEST_NETWORK_BRIDGE_NAME ?= "xenbr0"
|
||||||
|
|
||||||
# The XENGUEST_NETWORK_BRIDGE_MEMBERS should be set in a machine.conf
|
# The XENGUEST_NETWORK_BRIDGE_MEMBERS should be set in a machine.conf
|
||||||
@@ -39,7 +39,7 @@ INITSCRIPT_PARAMS_${PN} = "start 01 2 3 4 5 . stop 81 0 1 6 ."
|
|||||||
INITSCRIPT_NAME_${PN}-kea-dhcp4 = "kea-restore-default-config"
|
INITSCRIPT_NAME_${PN}-kea-dhcp4 = "kea-restore-default-config"
|
||||||
INITSCRIPT_PARAMS_${PN}-kea-dhcp4 = "defaults 20"
|
INITSCRIPT_PARAMS_${PN}-kea-dhcp4 = "defaults 20"
|
||||||
|
|
||||||
inherit update-rc.d
|
inherit allarch update-rc.d
|
||||||
|
|
||||||
do_install() {
|
do_install() {
|
||||||
cat ${WORKDIR}/xenguest-network-bridge.in \
|
cat ${WORKDIR}/xenguest-network-bridge.in \
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda
|
|||||||
|
|
||||||
S = "${WORKDIR}"
|
S = "${WORKDIR}"
|
||||||
|
|
||||||
inherit deploy xenguest-image
|
inherit deploy xenguest_image
|
||||||
|
|
||||||
# Name of the file we create in deploy
|
# Name of the file we create in deploy
|
||||||
XENGUEST_IMAGE_NODISK_DEPLOY = "xenguest-nodisk-image.xenguest"
|
XENGUEST_IMAGE_NODISK_DEPLOY = "xenguest-nodisk-image.xenguest"
|
||||||
|
|||||||
+1
@@ -5,5 +5,6 @@
|
|||||||
define KFEATURE_DESCRIPTION "Enable netfilter + conn tracking + extras"
|
define KFEATURE_DESCRIPTION "Enable netfilter + conn tracking + extras"
|
||||||
define KFEATURE_COMPATIBILITY all
|
define KFEATURE_COMPATIBILITY all
|
||||||
|
|
||||||
|
include cfg/net/bridge.scc
|
||||||
include features/netfilter/netfilter.scc
|
include features/netfilter/netfilter.scc
|
||||||
kconf non-hardware netfilter-extra.cfg
|
kconf non-hardware netfilter-extra.cfg
|
||||||
|
|||||||
-95
@@ -1,95 +0,0 @@
|
|||||||
From 18d691d837b340c941ad778bc8dfa77446e48bb4 Mon Sep 17 00:00:00 2001
|
|
||||||
Message-Id: <18d691d837b340c941ad778bc8dfa77446e48bb4.1613579395.git.diego.sueiro@arm.com>
|
|
||||||
From: Julien Grall <jgrall@amazon.com>
|
|
||||||
Date: Wed, 10 Feb 2021 17:06:54 +0000
|
|
||||||
Subject: [PATCH] arm/xen: Don't probe xenbus as part of an early initcall
|
|
||||||
|
|
||||||
commit c4295ab0b485b8bc50d2264bcae2acd06f25caaf upstream.
|
|
||||||
|
|
||||||
After Commit 3499ba8198cad ("xen: Fix event channel callback via
|
|
||||||
INTX/GSI"), xenbus_probe() will be called too early on Arm. This will
|
|
||||||
recent to a guest hang during boot.
|
|
||||||
|
|
||||||
If the hang wasn't there, we would have ended up to call
|
|
||||||
xenbus_probe() twice (the second time is in xenbus_probe_initcall()).
|
|
||||||
|
|
||||||
We don't need to initialize xenbus_probe() early for Arm guest.
|
|
||||||
Therefore, the call in xen_guest_init() is now removed.
|
|
||||||
|
|
||||||
After this change, there is no more external caller for xenbus_probe().
|
|
||||||
So the function is turned to a static one. Interestingly there were two
|
|
||||||
prototypes for it.
|
|
||||||
|
|
||||||
Cc: stable@vger.kernel.org
|
|
||||||
Fixes: 3499ba8198cad ("xen: Fix event channel callback via INTX/GSI")
|
|
||||||
Reported-by: Ian Jackson <iwj@xenproject.org>
|
|
||||||
Signed-off-by: Julien Grall <jgrall@amazon.com>
|
|
||||||
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
|
|
||||||
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
|
|
||||||
Link: https://lore.kernel.org/r/20210210170654.5377-1-julien@xen.org
|
|
||||||
Signed-off-by: Juergen Gross <jgross@suse.com>
|
|
||||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
||||||
|
|
||||||
Upstream-Status: Backport
|
|
||||||
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
|
|
||||||
---
|
|
||||||
arch/arm/xen/enlighten.c | 2 --
|
|
||||||
drivers/xen/xenbus/xenbus.h | 1 -
|
|
||||||
drivers/xen/xenbus/xenbus_probe.c | 2 +-
|
|
||||||
include/xen/xenbus.h | 2 --
|
|
||||||
4 files changed, 1 insertion(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
|
|
||||||
index f45bff158fc2..57dfc13b2752 100644
|
|
||||||
--- a/arch/arm/xen/enlighten.c
|
|
||||||
+++ b/arch/arm/xen/enlighten.c
|
|
||||||
@@ -370,8 +370,6 @@ static int __init xen_guest_init(void)
|
|
||||||
return -ENOMEM;
|
|
||||||
}
|
|
||||||
gnttab_init();
|
|
||||||
- if (!xen_initial_domain())
|
|
||||||
- xenbus_probe();
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Making sure board specific code will not set up ops for
|
|
||||||
diff --git a/drivers/xen/xenbus/xenbus.h b/drivers/xen/xenbus/xenbus.h
|
|
||||||
index a9bb5f91082d..88516a8a9f93 100644
|
|
||||||
--- a/drivers/xen/xenbus/xenbus.h
|
|
||||||
+++ b/drivers/xen/xenbus/xenbus.h
|
|
||||||
@@ -115,7 +115,6 @@ int xenbus_probe_node(struct xen_bus_type *bus,
|
|
||||||
const char *type,
|
|
||||||
const char *nodename);
|
|
||||||
int xenbus_probe_devices(struct xen_bus_type *bus);
|
|
||||||
-void xenbus_probe(void);
|
|
||||||
|
|
||||||
void xenbus_dev_changed(const char *node, struct xen_bus_type *bus);
|
|
||||||
|
|
||||||
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
|
|
||||||
index 786494bb7f20..652894d61967 100644
|
|
||||||
--- a/drivers/xen/xenbus/xenbus_probe.c
|
|
||||||
+++ b/drivers/xen/xenbus/xenbus_probe.c
|
|
||||||
@@ -683,7 +683,7 @@ void unregister_xenstore_notifier(struct notifier_block *nb)
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL_GPL(unregister_xenstore_notifier);
|
|
||||||
|
|
||||||
-void xenbus_probe(void)
|
|
||||||
+static void xenbus_probe(void)
|
|
||||||
{
|
|
||||||
xenstored_ready = 1;
|
|
||||||
|
|
||||||
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h
|
|
||||||
index fe9a9fa2ebc4..14d47ed4114f 100644
|
|
||||||
--- a/include/xen/xenbus.h
|
|
||||||
+++ b/include/xen/xenbus.h
|
|
||||||
@@ -187,8 +187,6 @@ void xs_suspend_cancel(void);
|
|
||||||
|
|
||||||
struct work_struct;
|
|
||||||
|
|
||||||
-void xenbus_probe(void);
|
|
||||||
-
|
|
||||||
#define XENBUS_IS_ERR_READ(str) ({ \
|
|
||||||
if (!IS_ERR(str) && strlen(str) == 0) { \
|
|
||||||
kfree(str); \
|
|
||||||
--
|
|
||||||
2.17.1
|
|
||||||
|
|
||||||
+77
@@ -0,0 +1,77 @@
|
|||||||
|
From 3bc59ed7bc26c967cfe6eb9c1ef9a1ef9108e99d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Luca Fancellu <luca.fancellu@arm.com>
|
||||||
|
Date: Tue, 23 Mar 2021 16:16:39 +0000
|
||||||
|
Subject: [PATCH 4/4] xen/evtchn: Change irq_info lock to raw_spinlock_t
|
||||||
|
|
||||||
|
Unmask operation must be called with interrupt disabled,
|
||||||
|
on preempt_rt spin_lock_irqsave/spin_unlock_irqrestore
|
||||||
|
don't disable/enable interrupts, so use raw_* implementation
|
||||||
|
and change lock variable in struct irq_info from spinlock_t
|
||||||
|
to raw_spinlock_t
|
||||||
|
|
||||||
|
Issue-Id: SCM-2147
|
||||||
|
|
||||||
|
Upstream-Status: Pending
|
||||||
|
Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
|
||||||
|
---
|
||||||
|
drivers/xen/events/events_base.c | 12 ++++++------
|
||||||
|
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
|
||||||
|
index 7bd03f6e0422..b91c19b90b8b 100644
|
||||||
|
--- a/drivers/xen/events/events_base.c
|
||||||
|
+++ b/drivers/xen/events/events_base.c
|
||||||
|
@@ -108,7 +108,7 @@ struct irq_info {
|
||||||
|
unsigned short eoi_cpu; /* EOI must happen on this cpu-1 */
|
||||||
|
unsigned int irq_epoch; /* If eoi_cpu valid: irq_epoch of event */
|
||||||
|
u64 eoi_time; /* Time in jiffies when to EOI. */
|
||||||
|
- spinlock_t lock;
|
||||||
|
+ raw_spinlock_t lock;
|
||||||
|
|
||||||
|
union {
|
||||||
|
unsigned short virq;
|
||||||
|
@@ -280,7 +280,7 @@ static int xen_irq_info_common_setup(struct irq_info *info,
|
||||||
|
info->evtchn = evtchn;
|
||||||
|
info->cpu = cpu;
|
||||||
|
info->mask_reason = EVT_MASK_REASON_EXPLICIT;
|
||||||
|
- spin_lock_init(&info->lock);
|
||||||
|
+ raw_spin_lock_init(&info->lock);
|
||||||
|
|
||||||
|
ret = set_evtchn_to_irq(evtchn, irq);
|
||||||
|
if (ret < 0)
|
||||||
|
@@ -432,28 +432,28 @@ static void do_mask(struct irq_info *info, u8 reason)
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
|
- spin_lock_irqsave(&info->lock, flags);
|
||||||
|
+ raw_spin_lock_irqsave(&info->lock, flags);
|
||||||
|
|
||||||
|
if (!info->mask_reason)
|
||||||
|
mask_evtchn(info->evtchn);
|
||||||
|
|
||||||
|
info->mask_reason |= reason;
|
||||||
|
|
||||||
|
- spin_unlock_irqrestore(&info->lock, flags);
|
||||||
|
+ raw_spin_unlock_irqrestore(&info->lock, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void do_unmask(struct irq_info *info, u8 reason)
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
|
- spin_lock_irqsave(&info->lock, flags);
|
||||||
|
+ raw_spin_lock_irqsave(&info->lock, flags);
|
||||||
|
|
||||||
|
info->mask_reason &= ~reason;
|
||||||
|
|
||||||
|
if (!info->mask_reason)
|
||||||
|
unmask_evtchn(info->evtchn);
|
||||||
|
|
||||||
|
- spin_unlock_irqrestore(&info->lock, flags);
|
||||||
|
+ raw_spin_unlock_irqrestore(&info->lock, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_X86
|
||||||
|
--
|
||||||
|
2.17.1
|
||||||
|
|
||||||
@@ -40,15 +40,12 @@ python() {
|
|||||||
kernelVersion = d.getVar('LINUX_VERSION')
|
kernelVersion = d.getVar('LINUX_VERSION')
|
||||||
pn = d.getVar('PN')
|
pn = d.getVar('PN')
|
||||||
|
|
||||||
if kernelVersion and LooseVersion(kernelVersion) < '5.4.99' \
|
if kernelVersion and pn != 'linux-libc-headers' \
|
||||||
and pn != 'linux-libc-headers' \
|
|
||||||
and oe.utils.any_distro_features(d, "arm-autonomy-guest"):
|
|
||||||
d.appendVar('SRC_URI', ' file://files/0001-arm-xen-Don-t-probe-xenbus-as-part-of-an-early-initc.patch' )
|
|
||||||
|
|
||||||
if kernelVersion and LooseVersion(kernelVersion) < '5.9' \
|
|
||||||
and pn != 'linux-libc-headers' \
|
|
||||||
and oe.utils.any_distro_features(d, "arm-autonomy-host arm-autonomy-guest"):
|
and oe.utils.any_distro_features(d, "arm-autonomy-host arm-autonomy-guest"):
|
||||||
d.appendVar('SRC_URI', ' file://files/0001-arm-arm64-xen-Fix-to-convert-percpu-address-to-gfn-c.patch' )
|
if LooseVersion(kernelVersion) < '5.9':
|
||||||
|
d.appendVar('SRC_URI', ' file://files/0001-arm-arm64-xen-Fix-to-convert-percpu-address-to-gfn-c.patch' )
|
||||||
|
if '5.10' <= LooseVersion(kernelVersion) < '5.12':
|
||||||
|
d.appendVar('SRC_URI', ' file://files/0001-xen-evtchn-Change-irq_info-lock-to-raw_spinlock_t.patch' )
|
||||||
|
|
||||||
if kernelVersion and LooseVersion(kernelVersion) < '5.10':
|
if kernelVersion and LooseVersion(kernelVersion) < '5.10':
|
||||||
if oe.utils.any_distro_features(d, "arm-autonomy-host arm-autonomy-guest"):
|
if oe.utils.any_distro_features(d, "arm-autonomy-host arm-autonomy-guest"):
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
#
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
#
|
|
||||||
|
|
||||||
# The empty wic plugin is used to create unformatted empty partitions for wic
|
|
||||||
# images.
|
|
||||||
# To use it you must pass "empty" as argument for the "--source" parameter in
|
|
||||||
# the wks file. For example:
|
|
||||||
# part foo --source empty --ondisk sda --size="1024" --align 1024
|
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from wic.pluginbase import SourcePlugin
|
|
||||||
|
|
||||||
logger = logging.getLogger('wic')
|
|
||||||
|
|
||||||
class EmptyPartitionPlugin(SourcePlugin):
|
|
||||||
"""
|
|
||||||
Populate unformatted empty partition.
|
|
||||||
"""
|
|
||||||
|
|
||||||
name = 'empty'
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def do_prepare_partition(cls, part, source_params, cr, cr_workdir,
|
|
||||||
oe_builddir, bootimg_dir, kernel_dir,
|
|
||||||
rootfs_dir, native_sysroot):
|
|
||||||
"""
|
|
||||||
Called to do the actual content population for a partition i.e. it
|
|
||||||
'prepares' the partition to be incorporated into the image.
|
|
||||||
"""
|
|
||||||
return
|
|
||||||
@@ -7,9 +7,9 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
|
|||||||
|
|
||||||
BBFILE_COLLECTIONS += "meta-arm-bsp"
|
BBFILE_COLLECTIONS += "meta-arm-bsp"
|
||||||
BBFILE_PATTERN_meta-arm-bsp = "^${LAYERDIR}/"
|
BBFILE_PATTERN_meta-arm-bsp = "^${LAYERDIR}/"
|
||||||
BBFILE_PRIORITY_meta-arm-bsp = "6"
|
BBFILE_PRIORITY_meta-arm-bsp = "5"
|
||||||
|
|
||||||
LAYERSERIES_COMPAT_meta-arm-bsp = "gatesgarth"
|
LAYERSERIES_COMPAT_meta-arm-bsp = "hardknott"
|
||||||
|
|
||||||
LAYERDEPENDS_meta-arm-bsp = "core meta-arm"
|
LAYERDEPENDS_meta-arm-bsp = "core meta-arm"
|
||||||
# This won't be used by layerindex-fetch, but works everywhere else
|
# This won't be used by layerindex-fetch, but works everywhere else
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
# Configuration for Cortex-A5 DesignStart development board
|
|
||||||
|
|
||||||
#@TYPE: Machine
|
|
||||||
#@NAME: a5ds machine
|
|
||||||
#@DESCRIPTION: Machine configuration for Cortex-A5 DesignStart
|
|
||||||
|
|
||||||
require conf/machine/include/tune-cortexa5.inc
|
|
||||||
|
|
||||||
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
|
|
||||||
PREFERRED_VERSION_linux-yocto ?= "5.3%"
|
|
||||||
KBUILD_DEFCONFIG = "multi_v7_defconfig"
|
|
||||||
KCONFIG_MODE = "--alldefconfig"
|
|
||||||
|
|
||||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot"
|
|
||||||
|
|
||||||
SERIAL_CONSOLES = "115200;ttyAMA0"
|
|
||||||
|
|
||||||
IMAGE_FSTYPES += "tar.bz2 cpio.gz"
|
|
||||||
|
|
||||||
# Cortex-a5 u-boot configuration
|
|
||||||
UBOOT_MACHINE = "designstart_ca5_defconfig"
|
|
||||||
UBOOT_IMAGE_ENTRYPOINT = "0x84000000"
|
|
||||||
UBOOT_IMAGE_LOADADDRESS = "0x84000000"
|
|
||||||
|
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
#@TYPE: Machine
|
||||||
|
#@NAME: Corstone-500 machine
|
||||||
|
#@DESCRIPTION: Machine configuration for the Corstone-500 platform
|
||||||
|
|
||||||
|
require conf/machine/include/tune-cortexa5.inc
|
||||||
|
|
||||||
|
#
|
||||||
|
# Corstone-500 is built against poky-tiny distro.
|
||||||
|
# poky-tiny sets PREFERRED_PROVIDER_virtual/kernel to linux-yocto-tiny.
|
||||||
|
# Since distro config is evaluated after the machine config, we need to
|
||||||
|
# use the strongest override possible (forcevariable) so the
|
||||||
|
# PREFERRED_PROVIDER_virtual/kernel specified in the machine config will
|
||||||
|
# apply.
|
||||||
|
#
|
||||||
|
PREFERRED_PROVIDER_virtual/kernel_forcevariable = "linux-yocto"
|
||||||
|
PREFERRED_VERSION_linux-yocto ?= "5.3%"
|
||||||
|
KBUILD_DEFCONFIG = "multi_v7_defconfig"
|
||||||
|
KCONFIG_MODE = "--alldefconfig"
|
||||||
|
|
||||||
|
PREFERRED_VERSION_trusted-firmware-a ?= "2.4%"
|
||||||
|
|
||||||
|
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot"
|
||||||
|
|
||||||
|
SERIAL_CONSOLES = "115200;ttyAMA0"
|
||||||
|
|
||||||
|
IMAGE_FSTYPES += "tar.bz2 cpio.gz"
|
||||||
|
|
||||||
|
# Corstone-500 u-boot configuration
|
||||||
|
UBOOT_MACHINE = "designstart_ca5_defconfig"
|
||||||
|
UBOOT_IMAGE_ENTRYPOINT = "0x84000000"
|
||||||
|
UBOOT_IMAGE_LOADADDRESS = "0x84000000"
|
||||||
|
PREFERRED_VERSION_u-boot ?= "2020.07"
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
# Configuration for Armv8-A Foundation
|
|
||||||
|
|
||||||
#@TYPE: Machine
|
|
||||||
#@NAME: Armv8-A Foundation Platform machine
|
|
||||||
#@DESCRIPTION: Machine configuration for Armv8-A Foundation Platform model
|
|
||||||
|
|
||||||
require conf/machine/fvp-common.inc
|
|
||||||
require conf/machine/include/arm/arch-armv8a.inc
|
|
||||||
|
|
||||||
TUNE_FEATURES = "aarch64"
|
|
||||||
|
|
||||||
# FVP u-boot configuration
|
|
||||||
UBOOT_MACHINE = "vexpress_aemv8a_semi_defconfig"
|
|
||||||
|
|
||||||
KERNEL_IMAGETYPE = "Image"
|
|
||||||
|
|
||||||
KERNEL_DEVICETREE = "arm/foundation-v8-gicv3-psci.dtb"
|
|
||||||
@@ -9,8 +9,6 @@ require conf/machine/include/arm/arch-armv7a.inc
|
|||||||
|
|
||||||
KERNEL_IMAGETYPE = "zImage"
|
KERNEL_IMAGETYPE = "zImage"
|
||||||
|
|
||||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.2%"
|
|
||||||
|
|
||||||
# FVP u-boot configuration
|
# FVP u-boot configuration
|
||||||
UBOOT_MACHINE = "vexpress_aemv8a_aarch32_defconfig"
|
UBOOT_MACHINE = "vexpress_aemv8a_aarch32_defconfig"
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# Configuration for Fixed Virtual Platform BaseR AEMv8r64 Machine
|
||||||
|
|
||||||
|
#@TYPE: Machine
|
||||||
|
#@NAME: FVP BaseR AEMv8r64 Machine
|
||||||
|
#@DESCRIPTION: Machine configuration for FVP BaseR AEMv8r64
|
||||||
|
|
||||||
|
require conf/machine/include/arm/armv8r/arch-armv8r64.inc
|
||||||
|
|
||||||
|
EXTRA_IMAGEDEPENDS += "boot-wrapper-aarch64"
|
||||||
|
|
||||||
|
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
|
||||||
|
PREFERRED_VERSION_linux-yocto ?= "5.10%"
|
||||||
|
|
||||||
|
KERNEL_IMAGETYPE = "Image"
|
||||||
|
KERNEL_DEVICETREE = "arm/fvp-baser-aemv8r64.dtb"
|
||||||
|
|
||||||
|
SERIAL_CONSOLES = "115200;ttyAMA0"
|
||||||
|
|
||||||
|
IMAGE_FSTYPES += "wic"
|
||||||
|
WKS_FILE ?= "${MACHINE}.wks"
|
||||||
|
|
||||||
|
# As this is a virtual target that will not be used in the real world there is
|
||||||
|
# no need for real SSH keys. Disable rng-tools (which takes too long to
|
||||||
|
# initialise) and install the pre-generated keys.
|
||||||
|
PACKAGECONFIG_remove_pn-openssh = "rng-tools"
|
||||||
|
MACHINE_EXTRA_RRECOMMENDS += "ssh-pregen-hostkeys"
|
||||||
@@ -29,7 +29,10 @@ DISK_IMG_PARTITION3_CONTENT = ""
|
|||||||
SERIAL_CONSOLES = "115200;ttyAMA0"
|
SERIAL_CONSOLES = "115200;ttyAMA0"
|
||||||
|
|
||||||
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
|
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
|
||||||
PREFERRED_VERSION_linux-yocto ?= "5.4%"
|
PREFERRED_VERSION_linux-yocto ?= "5.10%"
|
||||||
|
|
||||||
|
PREFERRED_VERSION_u-boot ?= "2021.01"
|
||||||
|
PREFERRED_VERSION_trusted-firmware-a ?= "2.4%"
|
||||||
|
|
||||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot"
|
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot"
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
DEFAULTTUNE ?= "armv8-4a"
|
||||||
|
|
||||||
|
TUNEVALID[armv8-4a] = "Enable instructions for ARMv8.4-a"
|
||||||
|
TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'armv8-4a', ' -march=armv8.4-a', '', d)}"
|
||||||
|
# TUNE crypto will be handled by arch-armv8a.inc below
|
||||||
|
MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv8-4a', 'armv8-4a:', '', d)}"
|
||||||
|
|
||||||
|
require conf/machine/include/arm/arch-armv8a.inc
|
||||||
|
|
||||||
|
# Little Endian base configs
|
||||||
|
AVAILTUNES += "armv8-4a armv8-4a-crypto"
|
||||||
|
ARMPKGARCH_tune-armv8-4a ?= "armv8-4a"
|
||||||
|
ARMPKGARCH_tune-armv8-4a-crypto ?= "armv8-4a"
|
||||||
|
TUNE_FEATURES_tune-armv8-4a = "aarch64 armv8-4a"
|
||||||
|
TUNE_FEATURES_tune-armv8-4a-crypto = "${TUNE_FEATURES_tune-armv8-4a} crypto"
|
||||||
|
PACKAGE_EXTRA_ARCHS_tune-armv8-4a = "${PACKAGE_EXTRA_ARCHS_tune-armv8a} armv8-4a"
|
||||||
|
PACKAGE_EXTRA_ARCHS_tune-armv8-4a-crypto = "${PACKAGE_EXTRA_ARCHS_tune-armv8-4a} armv8-4a-crypto"
|
||||||
|
BASE_LIB_tune-armv8-4a = "lib64"
|
||||||
|
BASE_LIB_tune-armv8-4a-crypto = "lib64"
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
# We are temporarily using armv8-4a until GCC 11 is released and supported by
|
||||||
|
# oe-core which will include the armv8-r support for aarch64.
|
||||||
|
|
||||||
|
require conf/machine/include/arm/arch-armv8-4a.inc
|
||||||
@@ -11,11 +11,9 @@ SERIAL_CONSOLES ?= "115200;ttyAMA0"
|
|||||||
PREFERRED_PROVIDER_virtual/kernel_corstone700 = "linux-yocto"
|
PREFERRED_PROVIDER_virtual/kernel_corstone700 = "linux-yocto"
|
||||||
PREFERRED_VERSION_linux-yocto ?= "5.6%"
|
PREFERRED_VERSION_linux-yocto ?= "5.6%"
|
||||||
|
|
||||||
PREFERRED_PROVIDER_virtual/trusted-firmware-a ?= "trusted-firmware-a"
|
PREFERRED_VERSION_trusted-firmware-a ?= "2.4%"
|
||||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
|
|
||||||
|
|
||||||
PREFERRED_PROVIDER_virtual/control-processor-firmware ?= "scp-firmware"
|
PREFERRED_PROVIDER_virtual/control-processor-firmware ?= "boot-firmware"
|
||||||
PREFERRED_VERSION_control-processor-firmware ?= "2.6.0"
|
|
||||||
|
|
||||||
EXTRA_IMAGEDEPENDS += " \
|
EXTRA_IMAGEDEPENDS += " \
|
||||||
virtual/trusted-firmware-a \
|
virtual/trusted-firmware-a \
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ SERIAL_CONSOLES = "115200;ttyAMA0"
|
|||||||
# Use kernel provided by yocto
|
# Use kernel provided by yocto
|
||||||
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
|
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
|
||||||
PREFERRED_VERSION_linux-yocto ?= "5.4%"
|
PREFERRED_VERSION_linux-yocto ?= "5.4%"
|
||||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
|
PREFERRED_VERSION_scp-firmware ?= "2.7%"
|
||||||
|
PREFERRED_VERSION_trusted-firmware-a ?= "2.4%"
|
||||||
|
PREFERRED_VERSION_u-boot ?= "2020.07"
|
||||||
|
|
||||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot firmware-image-juno"
|
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot firmware-image-juno"
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,6 @@
|
|||||||
#@NAME: Musca-B1 machine
|
#@NAME: Musca-B1 machine
|
||||||
#@DESCRIPTION: Machine configuration for Musca-B1
|
#@DESCRIPTION: Machine configuration for Musca-B1
|
||||||
|
|
||||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-m"
|
|
||||||
PREFERRED_VERSION_trusted-firmware-m = "1.0"
|
|
||||||
|
|
||||||
DEFAULTTUNE ?= "armv8m-main"
|
DEFAULTTUNE ?= "armv8m-main"
|
||||||
require conf/machine/include/tune-cortexm33.inc
|
require conf/machine/include/tune-cortexm33.inc
|
||||||
|
|
||||||
@@ -14,14 +11,18 @@ require conf/machine/include/tune-cortexm33.inc
|
|||||||
TCLIBC = "newlib"
|
TCLIBC = "newlib"
|
||||||
|
|
||||||
# For runqemu
|
# For runqemu
|
||||||
require conf/machine/include/qemu.inc
|
IMAGE_FSTYPES += "ext4"
|
||||||
|
IMAGE_CLASSES += "qemuboot"
|
||||||
QB_SYSTEM_NAME = "qemu-system-arm"
|
QB_SYSTEM_NAME = "qemu-system-arm"
|
||||||
QB_MACHINE = "-machine musca-b1"
|
QB_MACHINE = "-machine musca-b1"
|
||||||
QB_CPU = "-cpu cortex-m33"
|
QB_CPU = "-cpu cortex-m33"
|
||||||
QB_OPT_APPEND = "-nographic -vga none"
|
QB_OPT_APPEND = "-nographic -vga none"
|
||||||
QB_MEM = "512k"
|
QB_MEM = "512k"
|
||||||
|
QB_RNG = ""
|
||||||
|
|
||||||
# Zephyr RTOS settings
|
# Zephyr RTOS settings
|
||||||
ZEPHYR_BOARD = "v2m_musca_b1"
|
ZEPHYR_BOARD = "v2m_musca_b1"
|
||||||
ZEPHYR_INHERIT_CLASSES += "zephyr-qemuboot"
|
ZEPHYR_INHERIT_CLASSES += "zephyr-qemuboot"
|
||||||
ARCH_musca-b1 = "arm"
|
ARCH_musca-b1 = "arm"
|
||||||
|
|
||||||
|
TFM_PLATFORM = "musca_b1"
|
||||||
|
|||||||
@@ -4,10 +4,9 @@
|
|||||||
#@NAME: Musca-S1 machine
|
#@NAME: Musca-S1 machine
|
||||||
#@DESCRIPTION: Machine configuration for Musca-S1
|
#@DESCRIPTION: Machine configuration for Musca-S1
|
||||||
|
|
||||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-m"
|
|
||||||
PREFERRED_VERSION_trusted-firmware-m = "1.0"
|
|
||||||
|
|
||||||
require conf/machine/include/tune-cortexm33.inc
|
require conf/machine/include/tune-cortexm33.inc
|
||||||
|
|
||||||
# GLIBC will not work with Cortex-M.
|
# GLIBC will not work with Cortex-M.
|
||||||
TCLIBC = "newlib"
|
TCLIBC = "newlib"
|
||||||
|
|
||||||
|
TFM_PLATFORM = "musca_s1"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ require conf/machine/include/tune-neoversen1.inc
|
|||||||
|
|
||||||
KERNEL_IMAGETYPE = "Image"
|
KERNEL_IMAGETYPE = "Image"
|
||||||
|
|
||||||
IMAGE_FSTYPES += "wic tar.bz2 ext4"
|
IMAGE_FSTYPES += "wic wic.gz wic.bmap tar.bz2 ext4"
|
||||||
|
|
||||||
SERIAL_CONSOLES = "115200;ttyAMA0"
|
SERIAL_CONSOLES = "115200;ttyAMA0"
|
||||||
|
|
||||||
@@ -17,22 +17,23 @@ WKS_FILE ?= "n1sdp-efidisk.wks"
|
|||||||
IMAGE_EFI_BOOT_FILES ?= "n1sdp-multi-chip.dtb n1sdp-single-chip.dtb"
|
IMAGE_EFI_BOOT_FILES ?= "n1sdp-multi-chip.dtb n1sdp-single-chip.dtb"
|
||||||
WKS_FILE_DEPENDS_append = " ${EXTRA_IMAGEDEPENDS}"
|
WKS_FILE_DEPENDS_append = " ${EXTRA_IMAGEDEPENDS}"
|
||||||
|
|
||||||
# Use kernel provided by linaro (Contains support for SCMi or HDMI)
|
# Use kernel provided by yocto
|
||||||
PREFERRED_PROVIDER_virtual/kernel ?= "linux-linaro-arm"
|
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
|
||||||
PREFERRED_VERSION_linux-linaro-arm ?= "5.4%"
|
PREFERRED_VERSION_linux-yocto ?= "5.10%"
|
||||||
|
|
||||||
# RTL8168E Gigabit Ethernet Controller is attached to the PCIe interface
|
# RTL8168E Gigabit Ethernet Controller is attached to the PCIe interface
|
||||||
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "linux-firmware-rtl8168"
|
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "linux-firmware-rtl8168"
|
||||||
|
|
||||||
# Trusted firmware v2.3 version
|
PREFERRED_VERSION_trusted-firmware-a ?= "2.4%"
|
||||||
PREFERRED_PROVIDER_virtual/trusted-firmware-a ?= "trusted-firmware-a"
|
|
||||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
|
|
||||||
|
|
||||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a"
|
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a"
|
||||||
EXTRA_IMAGEDEPENDS += "virtual/control-processor-firmware"
|
EXTRA_IMAGEDEPENDS += "virtual/control-processor-firmware"
|
||||||
|
|
||||||
|
PREFERRED_VERSION_scp-firmware ?= "2.7%"
|
||||||
|
|
||||||
#UEFI EDK2 firmware
|
#UEFI EDK2 firmware
|
||||||
EXTRA_IMAGEDEPENDS += "virtual/uefi-firmware"
|
EXTRA_IMAGEDEPENDS += "virtual/uefi-firmware"
|
||||||
|
PREFERRED_VERSION_edk2-firmware ?= "202102%"
|
||||||
|
|
||||||
#grub-efi
|
#grub-efi
|
||||||
EFI_PROVIDER ?= "grub-efi"
|
EFI_PROVIDER ?= "grub-efi"
|
||||||
|
|||||||
@@ -8,9 +8,7 @@ require conf/machine/include/arm/armv8-2a/tune-cortexa75.inc
|
|||||||
|
|
||||||
EXTRA_IMAGEDEPENDS += "virtual/control-processor-firmware"
|
EXTRA_IMAGEDEPENDS += "virtual/control-processor-firmware"
|
||||||
|
|
||||||
# Trusted firmware v2.2 version
|
PREFERRED_VERSION_trusted-firmware-a ?= "2.4%"
|
||||||
PREFERRED_PROVIDER_virtual/trusted-firmware-a ?= "trusted-firmware-a"
|
|
||||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.2%"
|
|
||||||
|
|
||||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a"
|
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a"
|
||||||
|
|
||||||
|
|||||||
@@ -10,19 +10,34 @@ require conf/machine/include/arm/arch-armv8a.inc
|
|||||||
|
|
||||||
# Das U-boot
|
# Das U-boot
|
||||||
UBOOT_MACHINE ?= "total_compute_defconfig"
|
UBOOT_MACHINE ?= "total_compute_defconfig"
|
||||||
|
PREFERRED_VERSION_u-boot ?= "2020.10"
|
||||||
|
UBOOT_RD_LOADADDRESS = "0x88000000"
|
||||||
|
UBOOT_RD_ENTRYPOINT = "0x88000000"
|
||||||
|
UBOOT_LOADADDRESS = "0x80080000"
|
||||||
|
UBOOT_ENTRYPOINT = "0x80080000"
|
||||||
|
# Below options will generate a key to sign the kernel Image and INITRAMFS_IMAGE
|
||||||
|
# according to the default parameters of kernel-fitimage.bbclass. If the user
|
||||||
|
# would prefer to use their own keys, disable the key generation using the
|
||||||
|
# FIT_GENERATE_KEYS parameter and specify the location of the keys using the
|
||||||
|
# below paramters.
|
||||||
|
UBOOT_SIGN_ENABLE = "1"
|
||||||
|
UBOOT_MKIMAGE_DTCOPTS = "-I dts -O dtb"
|
||||||
|
UBOOT_SIGN_KEYNAME = "dev_key"
|
||||||
|
UBOOT_SIGN_KEYDIR = "${DEPLOY_DIR_IMAGE}/keys"
|
||||||
|
FIT_GENERATE_KEYS = "1"
|
||||||
|
|
||||||
# Trusted firmware A v2.3
|
|
||||||
PREFERRED_PROVIDER_virtual/trusted-firmware-a ?= "trusted-firmware-a"
|
PREFERRED_PROVIDER_virtual/trusted-firmware-a ?= "trusted-firmware-a"
|
||||||
PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
|
PREFERRED_VERSION_trusted-firmware-a ?= "2.4%"
|
||||||
PREFERRED_VERSION_linux-arm64-ack ?= "5.4"
|
|
||||||
|
|
||||||
EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a"
|
|
||||||
|
|
||||||
PREFERRED_PROVIDER_virtual/kernel ?= "linux-arm64-ack"
|
PREFERRED_PROVIDER_virtual/kernel ?= "linux-arm64-ack"
|
||||||
|
PREFERRED_VERSION_linux-arm64-ack ?= "5.4"
|
||||||
|
|
||||||
# Cannot use the default zImage on arm64
|
# Cannot use the default zImage on arm64
|
||||||
KERNEL_IMAGETYPE = "Image"
|
KERNEL_IMAGETYPE = "Image"
|
||||||
KERNEL_BOOTCMD = "booti"
|
KERNEL_IMAGETYPES += "fitImage"
|
||||||
IMAGE_FSTYPES += "cpio.gz.u-boot"
|
KERNEL_CLASSES = " kernel-fitimage "
|
||||||
|
|
||||||
|
IMAGE_FSTYPES += "cpio.gz"
|
||||||
|
INITRAMFS_IMAGE ?= "core-image-minimal"
|
||||||
|
|
||||||
SERIAL_CONSOLES = "115200;ttyAMA0"
|
SERIAL_CONSOLES = "115200;ttyAMA0"
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
# Cortex-A5 DesignStart A5DS Platform Support in meta-arm-bsp
|
# Corstone-500 Platform Support in meta-arm-bsp
|
||||||
|
|
||||||
## Howto Build and Run
|
## Howto Build and Run
|
||||||
|
|
||||||
### Configuration:
|
### Configuration:
|
||||||
In the local.conf file, MACHINE should be set as follow:
|
In the local.conf file, MACHINE should be set as follow:
|
||||||
MACHINE ?= "a5ds"
|
MACHINE ?= "corstone500"
|
||||||
DISTRO ?= "iota-tiny"
|
DISTRO ?= "poky-tiny"
|
||||||
|
|
||||||
Or set environment variables with that values:
|
Or set environment variables with that values:
|
||||||
|
|
||||||
MACHINE "a5ds"
|
MACHINE "corstone500"
|
||||||
DISTRO "iota-tiny"
|
DISTRO "poky-tiny"
|
||||||
|
|
||||||
### Build:
|
### Build:
|
||||||
``bash$ bitbake iota-tiny-image```
|
``bash$ bitbake arm-reference-image```
|
||||||
|
|
||||||
### Run:
|
### Run:
|
||||||
To run the result in a Fixed Virtual Platform please get:
|
To run the result in a Fixed Virtual Platform please get:
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
# Armv8-A Base Platform Support in meta-arm-bsp
|
|
||||||
|
|
||||||
## Howto Build and Run
|
|
||||||
|
|
||||||
### Configuration:
|
|
||||||
In the local.conf file, MACHINE should be set as follow:
|
|
||||||
MACHINE ?= "foundation-armv8"
|
|
||||||
|
|
||||||
### Build:
|
|
||||||
```bash$ bitbake core-image-minimal```
|
|
||||||
|
|
||||||
### Run:
|
|
||||||
To Run the Fixed Virtual Platform simulation tool you must download "Armv8-A
|
|
||||||
Foundation Platform" from Arm developer (This might require the user to
|
|
||||||
register) from this address:
|
|
||||||
https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms
|
|
||||||
and install it on your host PC.
|
|
||||||
|
|
||||||
Fast Models Fixed Virtual Platforms (FVP) Reference Guide:
|
|
||||||
https://developer.arm.com/docs/100966/latest
|
|
||||||
|
|
||||||
Armv8‑A Foundation Platform User Guide:
|
|
||||||
https://developer.arm.com/docs/100961/latest/
|
|
||||||
|
|
||||||
|
|
||||||
Once done, do the following to build and run an image:
|
|
||||||
```bash$ bitbake core-image-minimal```
|
|
||||||
```bash$ export YOCTO_DEPLOY_IMGS_DIR="<yocto-build-dir/tmp/deploy/images/foundation-v8>"```
|
|
||||||
```bash$ cd <path-to-Foundation_Platformpkg-dir/models/Linux64_GCC-X.X/>```
|
|
||||||
```
|
|
||||||
bash$ ./Foundation_Platform --cores=4 --no-sve --gicv3 \
|
|
||||||
--data=${YOCTO_DEPLOY_IMGS_DIR}/bl1-fvp.bin@0x0 \
|
|
||||||
--data=${YOCTO_DEPLOY_IMGS_DIR}/fip-fvp.bin@0x8000000 \
|
|
||||||
--data=${YOCTO_DEPLOY_IMGS_DIR}/Image@0x80080000 \
|
|
||||||
--data=${YOCTO_DEPLOY_IMGS_DIR}/foundation-v8-gicv3-psci.dtb@0x83000000 \
|
|
||||||
--block-device=${YOCTO_DEPLOY_IMGS_DIR}/core-image-minimal-foundation-armv8.disk.img
|
|
||||||
```
|
|
||||||
|
|
||||||
If you have built a configuration without a ramdisk, you can use the following
|
|
||||||
command in U-boot to start Linux:
|
|
||||||
```VExpress64# booti 0x80080000 - 0x83000000```
|
|
||||||
|
|
||||||
## Devices supported in the kernel
|
|
||||||
- serial
|
|
||||||
- virtio disk
|
|
||||||
- network
|
|
||||||
- watchdog
|
|
||||||
- rtc
|
|
||||||
|
|
||||||
## Devices not supported or not functional
|
|
||||||
None
|
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
# Armv8-R AArch64 AEM FVP Support in meta-arm-bsp
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
Fixed Virtual Platforms (FVP) are complete simulations of an Arm system,
|
||||||
|
including processor, memory and peripherals. These are set out in a
|
||||||
|
"programmer's view", which gives you a comprehensive model on which to build
|
||||||
|
and test your software.
|
||||||
|
|
||||||
|
The Armv8-R AEM FVP is a free of charge Armv8-R Fixed Virtual Platform. It
|
||||||
|
supports the latest Armv8-R feature set.
|
||||||
|
|
||||||
|
This BSP implements a reference stack for the AArch64 support in the R-class
|
||||||
|
first announced with the Cortex-R82 processor:
|
||||||
|
https://developer.arm.com/ip-products/processors/cortex-r/cortex-r82
|
||||||
|
|
||||||
|
Fast Models Fixed Virtual Platforms (FVP) Reference Guide:
|
||||||
|
https://developer.arm.com/docs/100966/latest
|
||||||
|
|
||||||
|
## BSP Support
|
||||||
|
The fvp-baser-aemv8r64 Yocto MACHINE supports the following BSP components:
|
||||||
|
|
||||||
|
- boot-wrapper-aarch64
|
||||||
|
- Kernel: linux-yocto-5.10
|
||||||
|
|
||||||
|
## Quick start: Howto Build and Run
|
||||||
|
|
||||||
|
### Host environment setup
|
||||||
|
Install the Required Packages for the Build Host:
|
||||||
|
https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#required-packages-for-the-build-host
|
||||||
|
|
||||||
|
Install the kas setup tool for bitbake based projects:
|
||||||
|
https://kas.readthedocs.io/en/latest/userguide.html#dependencies-installation
|
||||||
|
|
||||||
|
### Fetch sources
|
||||||
|
Fetch meta-arm repository:
|
||||||
|
```
|
||||||
|
mkdir -p ~/fvp-baser-aemv8r64-bsp
|
||||||
|
cd ~/fvp-baser-aemv8r64-bsp
|
||||||
|
git clone https://git.yoctoproject.org/git/meta-arm
|
||||||
|
```
|
||||||
|
|
||||||
|
### Build
|
||||||
|
```
|
||||||
|
cd ~/fvp-baser-aemv8r64-bsp
|
||||||
|
kas build meta-arm/kas/fvp-baser-aemv8r64-bsp.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
### Run
|
||||||
|
To Run the Fixed Virtual Platform simulation tool you must download "Armv8-R
|
||||||
|
AEM FVP" from Arm developer (This might require the user to register) from this
|
||||||
|
address:
|
||||||
|
https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms/arm-ecosystem-models
|
||||||
|
and install it on your host PC.
|
||||||
|
|
||||||
|
To run an image after the build is done:
|
||||||
|
```
|
||||||
|
export YOCTO_DEPLOY_IMGS_DIR="~/fvp-baser-aemv8r64-bsp/build/tmp/deploy/images/fvp-baser-aemv8r64/"
|
||||||
|
cd <path-to-AEMv8R_base_pkg>/models/Linux64_GCC-6.4/
|
||||||
|
./FVP_BaseR_AEMv8R \
|
||||||
|
-C bp.dram_metadata.init_value=0 \
|
||||||
|
-C bp.dram_metadata.is_enabled=true \
|
||||||
|
-C bp.dram_size=8 \
|
||||||
|
-C bp.exclusive_monitor.monitor_access_level=1 \
|
||||||
|
-C bp.pl011_uart0.unbuffered_output=1 \
|
||||||
|
-C bp.pl011_uart0.untimed_fifos=true \
|
||||||
|
-C bp.refcounter.non_arch_start_at_default=1 \
|
||||||
|
-C bp.smsc_91c111.enabled=0 \
|
||||||
|
-C bp.ve_sysregs.mmbSiteDefault=0 \
|
||||||
|
-C cache_state_modelled=true \
|
||||||
|
-C cluster0.gicv3.cpuintf-mmap-access-level=2 \
|
||||||
|
-C cluster0.gicv3.SRE-enable-action-on-mmap=2 \
|
||||||
|
-C cluster0.gicv3.SRE-EL2-enable-RAO=1 \
|
||||||
|
-C cluster0.gicv3.extended-interrupt-range-support=1 \
|
||||||
|
-C cluster0.has_aarch64=1 \
|
||||||
|
-C cluster0.NUM_CORES=4 \
|
||||||
|
-C cluster0.stage12_tlb_size=512 \
|
||||||
|
-C gic_distributor.GICD_CTLR-DS-1-means-secure-only=1 \
|
||||||
|
-C gic_distributor.GITS_BASER0-type=1 \
|
||||||
|
-C gic_distributor.ITS-count=1 \
|
||||||
|
-C gic_distributor.ITS-hardware-collection-count=1 \
|
||||||
|
-C gic_distributor.direct-lpi-support=1 \
|
||||||
|
-C gic_distributor.has-two-security-states=0 \
|
||||||
|
-C pctl.startup=0.0.0.* \
|
||||||
|
-C bp.virtio_net.enabled=1 \
|
||||||
|
-C cache_state_modelled=0 \
|
||||||
|
-C bp.vis.rate_limit-enable=0 \
|
||||||
|
-C bp.virtio_net.hostbridge.interfaceName=tap0 \
|
||||||
|
-a cluster0*=${YOCTO_DEPLOY_IMGS_DIR}/linux-system.axf \
|
||||||
|
-C bp.virtioblockdevice.image_path=${YOCTO_DEPLOY_IMGS_DIR}/core-image-minimal-fvp-baser-aemv8r64.wic
|
||||||
|
```
|
||||||
|
|
||||||
|
The terminal console login is `root` without password.
|
||||||
|
|
||||||
|
## Devices supported in the kernel
|
||||||
|
- serial
|
||||||
|
- virtio disk
|
||||||
|
- virtio network
|
||||||
|
- watchdog
|
||||||
|
- rtc
|
||||||
|
|
||||||
|
## Devices not supported or not functional
|
||||||
|
- Only one CPU since SMP is not functional in boot-wrapper-aarch64 yet
|
||||||
|
|
||||||
|
## Networking
|
||||||
|
|
||||||
|
To enable networking on the FVP via a host network interface, set up tap0 using
|
||||||
|
the following commands (Ubuntu 18.04 Host):
|
||||||
|
```
|
||||||
|
sudo apt-get install libvirt-bin
|
||||||
|
sudo virsh net-start default
|
||||||
|
sudo ip tuntap add dev tap0 mode tap user $(whoami)
|
||||||
|
sudo ifconfig tap0 0.0.0.0 promisc up
|
||||||
|
sudo brctl addif virbr0 tap0
|
||||||
|
```
|
||||||
|
|
||||||
|
To clean up the tap0 interface on the host use the following commands:
|
||||||
|
```
|
||||||
|
sudo brctl delif virbr0 tap0
|
||||||
|
sudo ip link set virbr0 down
|
||||||
|
sudo brctl delbr virbr0
|
||||||
|
sudo virsh net-destroy default
|
||||||
|
sudo ip link delete tap0
|
||||||
|
```
|
||||||
@@ -15,9 +15,12 @@ https://git.linaro.org/landing-teams/working/arm/arm-reference-platforms.git/tre
|
|||||||
In the local.conf file, MACHINE should be set as follows:
|
In the local.conf file, MACHINE should be set as follows:
|
||||||
MACHINE = "tc0"
|
MACHINE = "tc0"
|
||||||
|
|
||||||
To build the required binaries for tc0, run the commmand for the required image,
|
To build the required binaries for tc0, run the commmand:
|
||||||
for e.g for core-image-minimal:
|
```bash$ bitbake tc0-artifacts-image```
|
||||||
```bash$ bitbake core-image-minimal```
|
|
||||||
|
Trusted-firmware-a is the final component to be built with the rest of the
|
||||||
|
components dependent of it, therefore building tc0-artifacts-image which depends
|
||||||
|
on trusted-firmware-a will build all the required binaries.
|
||||||
|
|
||||||
## Running
|
## Running
|
||||||
To run the produced binaries in a TC0 Fixed Virtual Platform please get
|
To run the produced binaries in a TC0 Fixed Virtual Platform please get
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
SUMMARY = "Boot Processor firmware for Corstone700"
|
||||||
|
DESCRIPTION = "Boot Processor firmware"
|
||||||
|
|
||||||
|
LICENSE = "BSD-3-Clause & Apache-2.0"
|
||||||
|
LIC_FILES_CHKSUM = "file://license.md;md5=e44b2531cd6ffe9dece394dbe988d9a0 \
|
||||||
|
file://cmsis/LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e"
|
||||||
|
|
||||||
|
SRC_URI = "gitsm://git.linaro.org/landing-teams/working/arm/boot-firmware.git;protocol=https"
|
||||||
|
SRCREV = "af7eeb1bb8c5a85a5e5a76d48acc6fe864d715a9"
|
||||||
|
PV = "2020.02.10+git${SRCPV}"
|
||||||
|
|
||||||
|
PROVIDES += "virtual/control-processor-firmware"
|
||||||
|
|
||||||
|
DEPENDS = "virtual/arm-none-eabi-gcc-native virtual/trusted-firmware-a"
|
||||||
|
|
||||||
|
inherit deploy
|
||||||
|
|
||||||
|
B = "${WORKDIR}/build"
|
||||||
|
S = "${WORKDIR}/git"
|
||||||
|
|
||||||
|
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||||
|
COMPATIBLE_MACHINE = "(corstone700-*)"
|
||||||
|
SCP_PLATFORM = "corstone-700"
|
||||||
|
|
||||||
|
LDFLAGS[unexport] = "1"
|
||||||
|
|
||||||
|
do_configure[noexec] = "1"
|
||||||
|
|
||||||
|
EXTRA_OEMAKE = "PRODUCT='${SCP_PLATFORM}' \
|
||||||
|
BUILD_PATH=${B} \
|
||||||
|
CROSS_COMPILE='arm-none-eabi-' \
|
||||||
|
V=y \
|
||||||
|
"
|
||||||
|
|
||||||
|
do_compile() {
|
||||||
|
oe_runmake -C ${S}/tools/spitoc CC=${BUILD_CC} all
|
||||||
|
oe_runmake -C ${S}
|
||||||
|
}
|
||||||
|
do_compile[cleandirs] += "${B}"
|
||||||
|
|
||||||
|
do_install() {
|
||||||
|
install -D -p -m 0644 ${B}/product/${SCP_PLATFORM}/se_ramfw/release/bin/firmware.bin ${D}/firmware/se_ramfw.bin
|
||||||
|
install -D -p -m 0644 ${B}/product/${SCP_PLATFORM}/se_romfw/release/bin/firmware.bin ${D}/firmware/se_romfw.bin
|
||||||
|
${S}/tools/spitoc/spitoc \
|
||||||
|
--seram ${D}/firmware/se_ramfw.bin \
|
||||||
|
--offset 1 \
|
||||||
|
--fip ${RECIPE_SYSROOT}/firmware/fip.bin-${TFA_PLATFORM} \
|
||||||
|
--offset 33 \
|
||||||
|
--out ${D}/firmware/spitoc.bin
|
||||||
|
}
|
||||||
|
|
||||||
|
FILES_${PN} = "/firmware"
|
||||||
|
SYSROOT_DIRS += "/firmware"
|
||||||
|
# Skip QA check for relocations in .text of elf binaries
|
||||||
|
INSANE_SKIP_${PN} = "textrel"
|
||||||
|
|
||||||
|
do_deploy() {
|
||||||
|
# Copy the images to deploy directory
|
||||||
|
cp -rf ${D}/firmware/* ${DEPLOYDIR}/
|
||||||
|
}
|
||||||
|
addtask deploy after do_install
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
COMPATIBLE_MACHINE = "fvp-baser-aemv8r64"
|
||||||
|
|
||||||
|
FILESEXTRAPATHS_prepend := "${THISDIR}/files/${MACHINE}:"
|
||||||
|
SRC_URI_append = " \
|
||||||
|
file://0001-Decouple-V2M_SYS-config-by-auto-detect-dtb-node.patch \
|
||||||
|
file://0002-arch64-Introduce-EL2-boot-code-for-v8-r64.patch \
|
||||||
|
"
|
||||||
|
|
||||||
|
BOOT_WRAPPER_AARCH64_CMDLINE = "\
|
||||||
|
earlycon console=ttyAMA0 loglevel=8 rootfstype=ext4 root=/dev/vda1 rw"
|
||||||
|
|
||||||
|
EXTRA_OECONF_remove = "--enable-psci"
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
MACHINE_BOOT_WRAPPER_AARCH64_REQUIRE ?= ""
|
||||||
|
MACHINE_BOOT_WRAPPER_AARCH64_REQUIRE_fvp-baser-aemv8r64 ?= "boot-wrapper-aarch64-fvp-baser-aemv8r64.inc"
|
||||||
|
|
||||||
|
require ${MACHINE_BOOT_WRAPPER_AARCH64_REQUIRE}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user