-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
125 lines (102 loc) · 6.4 KB
/
Copy pathjustfile
File metadata and controls
125 lines (102 loc) · 6.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Copyright (c) 2026 Elektrobit Automotive GmbH
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
RELEASE := "whinlatter"
BITBAKE_SETUP_CONFIG := "./bitbake-setup-ankaios-" + RELEASE + ".conf.json"
# Set EB_MIRROR=1 to layer the Elektrobit Artifactory mirror (kas-eb-mirror.yml)
# on top of the kas targets. Off by default so public builds need no EB access.
EB_MIRROR := ""
kas_mirror := if EB_MIRROR != "" { ":kas-eb-mirror.yml" } else { "" }
bitbake-setup-repo:
./scripts/bitbake-setup-repo.sh
# Preview what would be uploaded to the Elektrobit Artifactory mirror (no PUT)
push-mirror-dry:
./scripts/push_mirror.sh --dry-run
# Publish DL_DIR + SSTATE_DIR to the Elektrobit Artifactory mirror
push-mirror:
./scripts/push_mirror.sh
# Run init or update depending on whether the setup directory already exists
[private]
bitbake-setup-init-or-update runtime machine:
#!/usr/bin/env bash
set -euo pipefail
setup_dir="bitbake-builds/ankaios-{{runtime}}-{{RELEASE}}-{{machine}}"
if [[ -d "${setup_dir}/layers" ]]; then
bitbake-setup update --setup-dir "${setup_dir}"
else
bitbake-setup init --non-interactive {{BITBAKE_SETUP_CONFIG}} ankaios-{{runtime}} machine/{{machine}}
fi
# Build wrynose minimal sysvinit image for QEMU (override with RELEASE=whinlatter)
build-sysvinit-minimal-qemu: bitbake-setup-repo (bitbake-setup-init-or-update "sysvinit" "qemux86-64")
bash -c '. bitbake-builds/ankaios-sysvinit-{{RELEASE}}-qemux86-64/build/init-build-env && bitbake core-image-minimal'
# Build and run wrynose minimal sysvinit image in QEMU (override with RELEASE=whinlatter)
run-sysvinit-minimal-qemu: build-sysvinit-minimal-qemu
bash -c '. bitbake-builds/ankaios-sysvinit-{{RELEASE}}-qemux86-64/build/init-build-env && runqemu snapshot nographic slirp qemuparams="-m 1024"'
# Build wrynose full-cmdline systemd image for QEMU (override with RELEASE=whinlatter)
build-systemd-full-qemu: bitbake-setup-repo (bitbake-setup-init-or-update "systemd" "qemux86-64")
bash -c '. bitbake-builds/ankaios-systemd-{{RELEASE}}-qemux86-64/build/init-build-env && bitbake core-image-full-cmdline'
# Build and run wrynose full-cmdline systemd image in QEMU (override with RELEASE=whinlatter)
run-systemd-full-qemu: build-systemd-full-qemu
bash -c '. bitbake-builds/ankaios-systemd-{{RELEASE}}-qemux86-64/build/init-build-env && runqemu snapshot nographic slirp qemuparams="-m 1024"'
# Build wrynose minimal sysvinit image for Raspberry Pi 4 (override with RELEASE=whinlatter)
build-sysvinit-minimal-rpi4: bitbake-setup-repo (bitbake-setup-init-or-update "sysvinit" "raspberrypi4-64")
bash -c '. bitbake-builds/ankaios-sysvinit-{{RELEASE}}-raspberrypi4-64/build/init-build-env && bitbake core-image-minimal'
# Build wrynose full-cmdline sysvinit image for Raspberry Pi 4 (override with RELEASE=whinlatter)
build-sysvinit-full-rpi4: bitbake-setup-repo (bitbake-setup-init-or-update "sysvinit" "raspberrypi4-64")
bash -c '. bitbake-builds/ankaios-sysvinit-{{RELEASE}}-raspberrypi4-64/build/init-build-env && bitbake core-image-full-cmdline'
# Build wrynose full-cmdline systemd image for Raspberry Pi 4 (override with RELEASE=whinlatter)
build-systemd-full-rpi4: bitbake-setup-repo (bitbake-setup-init-or-update "systemd" "raspberrypi4-64")
bash -c '. bitbake-builds/ankaios-systemd-{{RELEASE}}-raspberrypi4-64/build/init-build-env && bitbake core-image-full-cmdline'
# Build wrynose minimal sysvinit image for Raspberry Pi 5 (override with RELEASE=whinlatter)
build-sysvinit-minimal-rpi5: bitbake-setup-repo (bitbake-setup-init-or-update "sysvinit" "raspberrypi5")
bash -c '. bitbake-builds/ankaios-sysvinit-{{RELEASE}}-raspberrypi5/build/init-build-env && bitbake core-image-minimal'
# Build wrynose full-cmdline systemd image for Raspberry Pi 5 (override with RELEASE=whinlatter)
build-systemd-full-rpi5: bitbake-setup-repo (bitbake-setup-init-or-update "systemd" "raspberrypi5")
bash -c '. bitbake-builds/ankaios-systemd-{{RELEASE}}-raspberrypi5/build/init-build-env && bitbake core-image-full-cmdline'
# --- kas builds ------------------------------------------------------------
# kas cannot set the build directory from the config file (it defaults to
# ./build for every config), so these targets give each variant its own
# KAS_BUILD_DIR to avoid clobbering each other. The shared DL_DIR/SSTATE_DIR
# cache is on absolute paths, so dedicated build dirs still reuse it.
# Build a kas variant into its own build dir. 'variant' is the config basename
# without the leading "kas-" and trailing "-<release>.yml" (e.g. "minimal-sysvinit").
[private]
kas-build variant:
mkdir -p kas-builds/{{variant}}-{{RELEASE}}
KAS_BUILD_DIR=kas-builds/{{variant}}-{{RELEASE}} kas build kas-{{variant}}-{{RELEASE}}.yml{{kas_mirror}}
# Run a previously built kas variant in QEMU.
[private]
kas-run variant:
mkdir -p kas-builds/{{variant}}-{{RELEASE}}
KAS_BUILD_DIR=kas-builds/{{variant}}-{{RELEASE}} kas shell kas-{{variant}}-{{RELEASE}}.yml{{kas_mirror}} -c 'runqemu snapshot nographic slirp qemuparams="-m 1024"'
# Build minimal sysvinit image with kas (override with RELEASE=wrynose or RELEASE=kirkstone)
kas-build-sysvinit-minimal: (kas-build "minimal-sysvinit")
# Build and run minimal sysvinit image with kas in QEMU (override with RELEASE=...)
kas-run-sysvinit-minimal: (kas-build "minimal-sysvinit") (kas-run "minimal-sysvinit")
# Build full-cmdline systemd image with kas (override with RELEASE=wrynose or RELEASE=kirkstone)
kas-build-systemd-full: (kas-build "full-cmd-systemd")
# Build and run full-cmdline systemd image with kas in QEMU (override with RELEASE=...)
kas-run-systemd-full: (kas-build "full-cmd-systemd") (kas-run "full-cmd-systemd")
lint:
@set -eu; \
files="$(find recipes-ankaios recipes-helpers recipes-kernel -type f -name '*.bb' | sort)"; \
failed=0; \
for file in $files; do \
echo "PARSED: $file"; \
output="$(oelint-adv --quiet --hide info --relpaths "$file" 2>&1 | grep -v '\.inc:' || true)"; \
if [ -n "$output" ]; then \
printf '%s\n' "$output"; \
failed=1; \
fi; \
done; \
[ "$failed" -eq 0 ]