aboutsummaryrefslogtreecommitdiffstats
path: root/meta-mel/conf/distro/mel.conf
blob: 857f28b9191f1c58bd52bde833c07f051a173af3 (plain)
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
# ---------------------------------------------------------------------------------------------------------------------
# SPDX-License-Identifier: MIT
# ---------------------------------------------------------------------------------------------------------------------

## Vendor Integration {{{1
VENDOR_CONF = "${@'conf/vendor/%s.conf' % d.getVar('VENDOR') if d.getVar('VENDOR') else ''}"
require ${VENDOR_CONF}
## }}}1
## MEL Base Configuration {{{1
DISTRO = "mel"
ADE_DISTRO = "mel-flex-os"
DISTRO_NAME = "Mentor Embedded Linux Flex OS"
DISTRO_CODENAME = "kirkstone"
MAINTAINER = "Siemens Digital Industries Software <embedded_support@mentor.com>"
HOME_URL = "https://www.mentor.com/embedded-software/linux/mel-flex-os/"
SUPPORT_URL = "https://support.sw.siemens.com/"
BUG_REPORT_URL = "https://support.sw.siemens.com/"
ADE_PROVIDER = "${DISTRO_NAME}"
TARGET_VENDOR = "-mel"
SDK_VENDOR = "-melsdk"

# Distro and release versioning
DISTRO_VERSION = "13.0+snapshot-${DATE}"
ARCHIVE_RELEASE_VERSION = "${DISTRO_VERSION}.${BSP_VERSION}.${PATCH_VERSION}"
PDK_LICENSE_VERSION_DATE = "20181206"

# Version of the mel-scripts artifact, including setup-mel
SCRIPTS_VERSION ?= "1"

# Default values for BSP and PATCH version, to be redefined in other layers
BSP_VERSION ?= "0"
PATCH_VERSION ?= "0"

SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
DISTRO_VERSION[vardepsexclude] = "DATE"
SDK_VERSION[vardepsexclude] = "DATE"

SDK_NAME = "${DISTRO}-${TCLIBC}-${SDK_ARCH}-${IMAGE_BASENAME}-${TUNE_PKGARCH}"
SDKPATHINSTALL = "/opt/${DISTRO}/${SDK_VERSION}"

# This is a single libc DISTRO, so exclude it from tmpdir name
TCLIBCAPPEND = ""

PSEUDO_IGNORE_PATHS:append = ",/run/"

MEL_DEFAULT_EXTRA_RDEPENDS = "packagegroup-core-boot"
MEL_DEFAULT_EXTRA_RRECOMMENDS = "kernel-module-af-packet"
DISTRO_EXTRA_RDEPENDS += " ${MEL_DEFAULT_EXTRA_RDEPENDS}"
DISTRO_EXTRA_RRECOMMENDS += " ${MEL_DEFAULT_EXTRA_RRECOMMENDS}"

# Easier adjustment of oe-core QA check defaults
WARN_TO_ERROR_QA ??= ""
WARN_QA:remove = "${WARN_TO_ERROR_QA}"
ERROR_QA:append = " ${WARN_TO_ERROR_QA}"

# Default to the external toolchain if available
TCMODE = "${@bb.utils.contains('BBFILE_COLLECTIONS', 'sourcery', 'external-sourcery-rebuild-libc', bb.utils.contains('BBFILE_COLLECTIONS', 'external-toolchain', 'external', 'default', d), d)}"

# We want media to auto-mount
DISTRO_EXTRA_RRECOMMENDS += "udev-extraconf"

# Paths
MELDIR ?= "${COREBASE}/.."

# Use a local PR server by default
PRSERV_HOST ?= "localhost:0"

# Default to ipk packaging
PACKAGE_CLASSES ?= "package_ipk"

# MEL's supported hosts
SANITY_TESTED_DISTROS = "\
    ubuntu-18.04 \n\
    ubuntu-20.04 \n\
    centos-7* \n \
    centoslinux-7* \n \
    debian-10* \n \
    rhel*-8* \n \
    redhatenterprise*-8* \n \
"

# Sane default append for the kernel cmdline (not used by all BSPs)
# TODO: rename APPEND to something more appropriate
APPEND ?= "${APPEND_SERIAL} console=tty0 ${APPEND_SPLASH}"

APPEND_SPLASH = "${@'quiet splash' if '${SPLASH}' else ''}"
APPEND_SPLASH .= "${@' plymouth:ignore-serial-consoles' if '${SPLASH}' == 'plymouth' else ''}"

APPEND_SERIAL = "${@'console=${CMD_SERIAL_CONSOLE}' if '${SERIAL_CONSOLE}' else ''}"
CMD_SERIAL_CONSOLE ?= "${@','.join(reversed('${SERIAL_CONSOLE}'.split()))}"

# Not in APPEND by default, but can be added to it as needed
APPEND_KGDBOC = "kgdbwait kgdboc=${CMD_SERIAL_CONSOLE}"

# Splash screen
SPLASH:mel ?= "psplash"
PLYMOUTH_THEME ?= "mel"
PLYMOUTH_SHOWDELAY ?= "0"
DISTRO_EXTRA_RRECOMMENDS += "${@'plymouth-mel' if '${SPLASH}' == 'plymouth' else ''}"

# Configuring plymouth to use the logo rather than modifying the theme script
# to use it is a tradeoff. It lets you switch themes while keeping the same
# splash screen, which is nice, the downside is a change to the logo requires
# recompilation of plymouth.
PLYMOUTH_LOGO ?= "${datadir}/plymouth/themes/mel/mel.png"
LOGO:pn-plymouth = "${PLYMOUTH_LOGO}"

# Remove MACHINE from default volname
UBI_VOLNAME = "rootfs"

# If a wic image type is enabled, also enable wic.bmap
require conf/distro/include/wic-bmap.inc

# Additional dependencies for deployed files are often pulled in via
# do_image_wic[depends], to ensure the files are available for
# IMAGE_BOOT_FILES, but this bypasses the do_image[recrdeptask] on
# do_populate_lic. Add it for do_image_wic as well.
do_image_wic[recrdeptask] += "do_populate_lic"

# do_image_complete requires licenses, so add recursive dependency
# on do_populate_lic
do_image_complete[recrdeptask] += "do_populate_lic"

# Quadruple the normal extra space in an image. 'du' is not a good way to really
# see how much space will be needed and fails badly as the fs size grows.
IMAGE_ROOTFS_EXTRA_SPACE = "40960"

# Default locale for images
IMAGE_LINGUAS ?= "en-us"

# Make host user contamination an error
WARN_TO_ERROR_QA = "host-user-contaminated"

# Also check for host user contamination in the rootfs
ROOTFS_POSTPROCESS_COMMAND:append = " rootfs_check_host_user_contaminated;"

# Default to systemd, not sysvinit
INIT_MANAGER ?= "systemd"

# Support shallow git tarballs
BB_GENERATE_SHALLOW_TARBALLS ?= "1"
BB_GIT_SHALLOW ?= "1"

BB_GIT_SHALLOW_DEPTH_DEFAULT ?= "1"
BB_GIT_SHALLOW_DEPTH ??= "${@'${BB_GIT_SHALLOW_DEPTH_DEFAULT}' if not '${BB_GIT_SHALLOW_REVS}' else '0'}"
BB_GIT_SHALLOW_REVS ??= ""

# For our kernel repository, we want to ship the user the history which they
# can't easily re-acquire from upstream.
LINUX_VERSION_TAG ??= "v${@'.'.join('${LINUX_VERSION}'.split('.')[:2])}"
LINUX_VERSION ??= ""
BB_GIT_SHALLOW_REVS:pn-linux-mel ??= "${@'${LINUX_VERSION_TAG}' if '${LINUX_VERSION_TAG}' and '${LINUX_VERSION}' else ''}"

# Export path variables into the devshell for convenience
OE_TOPDIR = "${TOPDIR}"
OE_WORKDIR = "${WORKDIR}"
OE_TERMINAL_EXPORTS += "OE_TOPDIR OE_WORKDIR COREBASE"

require conf/distro/include/no-static-libs.inc
require conf/distro/include/yocto-uninative.inc

INHERIT += "uninative"
## }}}1
## Mechanisms provided for user customization {{{1
# Support USER_FEATURES
INHERIT += "user_features"

# The PACKAGECONFIG_REMOVE indirection exists to make it possible to override
# the removals, as bitbake doesn't provide a mechanism to do so yet
PACKAGECONFIG_REMOVE ??= ""
PACKAGECONFIG:remove = "${PACKAGECONFIG_REMOVE}"

# Ease adding to the SDK from a global context
TOOLCHAIN_HOST_TASK_EXTRA ?= ""
TOOLCHAIN_HOST_TASK:append = " ${TOOLCHAIN_HOST_TASK_EXTRA}"
TOOLCHAIN_TARGET_TASK_EXTRA ?= ""
TOOLCHAIN_TARGET_TASK_EXTRA:pn-buildtools-tarball = ""
TOOLCHAIN_TARGET_TASK:append = " ${TOOLCHAIN_TARGET_TASK_EXTRA}"

# Easier addition of shared state mirrors
SSTATE_MIRROR_SITES ?= ""
SSTATE_MIRRORS += "${@''.join(r'file://.* %s/PATH;downloadfilename=PATH \n' % u for u in '${SSTATE_MIRROR_SITES}'.split())}"
## }}}1
## Distro Features & Recipe Configuration {{{1
MEL_DEFAULT_DISTRO_FEATURES = "opengl multiarch pam"

# This violates typical MACHINE/DISTRO boundaries, but is part of MEL's
# supported features. If the vendor supports x11 and not wayland for its
# machines, so do we.
DISTRO_FEATURES_DEFAULT:remove = "x11"
MEL_DEFAULT_DISTRO_FEATURES += "${@bb.utils.contains('MACHINE_FEATURES', 'x11', \
                                   bb.utils.contains('MACHINE_FEATURES', 'wayland', 'wayland', 'x11', d), 'wayland', d)}"

DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT} ${DISTRO_FEATURES_LIBC} ${MEL_DEFAULT_DISTRO_FEATURES}"

# Enable our staged fixes that are on their way upstream
DISTRO_FEATURES:append = " mentor-staging"

# Since many embedded systems don't have non-root users, allow autospawn for
# root as well.
PACKAGECONFIG:append:pn-pulseaudio = " autospawn-for-root"

# We don't use dracut to build initramfs
PACKAGECONFIG_REMOVE:pn-plymouth = "initrd"

# Do not fetch the anti-virus db at compile-time
INSTALL_CLAMAV_CVD ?= ""
## }}}1
## Inherits {{{1
# We want information and history about build output
INHERIT += "buildhistory"

# Copy the image license manifest into DEPLOY_DIR_IMAGE
INHERIT += "deploy-license-manifest"

# Warn if there are available update layers which are not included in the
# current configuration
INHERIT += "mentor-updates-check"

# Check PDK license
INHERIT += "${@bb.utils.contains('BBFILE_COLLECTIONS', 'mentor-private', 'pdk-license', '', d)}"

# Warn the user and disable rootfs resizing for non-GPLv3 builds
INHERIT += "resize-rootfs-gplv3"

# Ensure that our DISTRO_CODENAME aligns with LAYERSERIES_CORENAMES
INHERIT += "codename_is_corename"

# Ensure we're building the toolchain in a supported configuration
ERROR_QA:append = " disallowed-tuning"
ALLOWED_TUNING = "armv5te armv7ahf-neon armv7a-neon armv7at armv8a i686 riscv64 x86-64"
INHERIT += "required_toolchain_config"

# Use our toolchain relocation scripts
INHERIT += "${@bb.utils.contains('BBFILE_COLLECTIONS', 'mentor-staging', 'toolchain_ship_relocate_sdk', '', d)}"
TOOLCHAIN_SHAR_REL_TMPL = "${LAYERDIR_mentor-staging}/files/toolchain-shar-relocate.sh"
TOOLCHAIN_EXT_REL_TMPL = "${LAYERDIR_mentor-staging}/files/toolchain-shar-extract.sh"
RELOCATE_SDK_SH ?= "${LAYERDIR_mentor-staging}/files/relocate_sdk.sh"
## }}}1
## Preferences & Package Selection {{{1
# Default to the Xorg X server if the BSP doesn't specify
XSERVER ??= "\
    xserver-xorg \
    xf86-input-evdev \
    xf86-input-mouse \
    xf86-input-keyboard \
    xf86-video-fbdev \
"

# Obey our graphics image feature
SYSTEMD_DEFAULT_TARGET ?= '${@bb.utils.contains_any("IMAGE_FEATURES", ["x11-base", "graphics", "weston"], "graphical.target", "multi-user.target", d)}'

# We split out the initramfs install script bits into
# core-image-minimal-install-initramfs, to keep core-image-minimal-initramfs
# as generic as possible, but image-live may well expect the install bits.
INITRD_IMAGE_LIVE ?= "core-image-minimal-install-initramfs"

# Additional package groups
#
# We prefer wayland/weston, unless the vendor supports x11 but not wayland.
FEATURE_PACKAGES_mel-weston = "weston weston-init weston-examples"
FEATURE_PACKAGES_mel-x11 = "${FEATURE_PACKAGES_x11-base} ${FEATURE_PACKAGES_hwcodecs}"
FEATURE_PACKAGES_graphics += "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '${FEATURE_PACKAGES_mel-weston}', '', d)}"
FEATURE_PACKAGES_graphics += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${FEATURE_PACKAGES_mel-x11}', '', d)}"
FEATURE_PACKAGES_tools-audio     ?= "packagegroup-tools-audio"
FEATURE_PACKAGES_tools-benchmark ?= "packagegroup-tools-benchmark"
FEATURE_PACKAGES_multimedia      ?= "gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad"
FEATURE_PACKAGES_virtualization  ?= "docker-ce python3-docker-compose"
FEATURE_PACKAGES_codebench-debug ?= "gdbserver strace openssh-sftp-server"

# Baseline runtime for third party multilib executables.
# libc/libgcc/libstdc++, plus lttng for tracing. Only applies to images
# without MLPREFIX set (i.e. development-image, not lib32-development-image).
MULTILIB_RUNTIME_PACKAGES = "glibc libgcc libstdc++ ${@bb.utils.contains('IMAGE_FEATURES', 'tools-profile', 'lttng-ust', '', d)}"
MULTILIB_RUNTIME_FEATURE_PACKAGES = "${@' '.join(multilib_pkg_extend(d, pkg) for pkg in d.getVar('MULTILIB_RUNTIME_PACKAGES').split())}"
FEATURE_PACKAGES_multilib-runtime ?= "${@d.getVar('MULTILIB_RUNTIME_FEATURE_PACKAGES') if not d.getVar('MLPREFIX') else ''}"

# Analogous to the nfs-server group
FEATURE_PACKAGES_samba-server    ?= "samba swat"

# Include nss-myhostname for sysvinit, so the hostname resolves. systemd
# includes myhostname itself.
DISTRO_EXTRA_RRECOMMENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'nss-myhostname', d)}"
## }}}1
## Workarounds & Overrides {{{1
# Override arm tuning to reduce specificity and increase reuse.
require conf/distro/include/mel-arm-tuning.inc

# Ensure that the output directory always exists, this fixes use of meta-sca
# with certain meta-imx recipes.
do_sca_tracefiles[dirs] =+ "${SCA_SOURCES_DIR}"

# We aren't supporting meta-intel's RMC
BBMASK += "/meta-intel/common/recipes-bsp/systemd-boot/"

# webkitgtk link fails due to memory exhaustion, so disable debug info to
# reduce the memory footprint
DEBUG_FLAGS:remove:pn-webkitgtk = "-g"

# Work around git safe directory issue with METADATA_*, by forcing early expansion
# while in a build user context.
require classes/metadata_scm.bbclass
METADATA_BRANCH := "${@base_detect_branch(d)}"
METADATA_REVISION := "${@base_detect_revision(d)}"
## }}}1
## SDK & Application Development Environment {{{1
# Use DEPLOY_DIR_ naming for consistency
SDK_DEPLOY:mel = "${DEPLOY_DIR_SDK}"
DEPLOY_DIR_SDK ?= "${DEPLOY_DIR}/sdk"

# As we remove the toolchain from the sdk, naming it 'toolchain' is not
# accurate, and sdk better describes what it is anyway.
TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-sdk-${SDK_VERSION}"

# Restore the default to buildtools-tarball, as that recipe sets it with ?=
TOOLCHAIN_OUTPUTNAME:pn-buildtools-tarball = "${SDK_ARCH}-buildtools-nativesdk-standalone-${DISTRO_VERSION}"

# Add KERNEL_* to the SDK environment (unexported) for use by the user
TOOLCHAIN_TARGET_TASK_EXTRA += " sdk-env-kernelvars"

# Set this so the ADE can set the right Yocto multilib display option
EXTERNAL_SETUP_SCRIPT_VARS += "REAL_MULTIMACH_TARGET_SYS"
EXTERNAL_REAL_MULTIMACH_TARGET_SYS ??= "${REAL_MULTIMACH_TARGET_SYS}"
CB_MBS_OPTIONS[general.yocto.sdk.value] = "${EXTERNAL_REAL_MULTIMACH_TARGET_SYS}"

# This allows us to control what base target packages are installed for the
# configured multilibs, by altering SDK_MULTILIB_VARIANTS to differ from
# MULTILIB_VARIANTS. We also append meta-environment to obey
# SDK_MULTILIB_VARIANTS as well.
IMAGE_CLASSES += "image-sdk-multilib-variants"

# Cull duplicate/invalid files for windows SDKMACHINEs
IMAGE_CLASSES += "${@bb.utils.contains('BBFILE_COLLECTIONS', 'mentor-staging', 'win_sdk_cull', '', d)}"

# We need to ensure we can distribute downloads for SDK/ADE builds
IMAGE_CLASSES += "archive_sdk_downloads"

# Create a 'latest' symlink for the SDK
IMAGE_CLASSES += "sdk_latest_link"

# If meta-mentor-private is available, pull in the populate-ade class
ADE_IMAGE_CLASS = "${@bb.utils.contains('BBFILE_COLLECTIONS', 'mentor-private', 'populate_ade archive_ade_downloads', '', d)}"
IMAGE_CLASSES += "${ADE_IMAGE_CLASS}"
## }}}1
## MEL Releases {{{1
# Default image for our installers
RELEASE_IMAGE ?= "development-image"
RELEASE_ARTIFACTS ?= "mel_layers mel_downloads templates images"

# Apply any release-time srcrev lockdowns for AUTOREV recipes
include ${MELDIR}/${MACHINE}/conf/autorevs.conf

# LAYERDIRs for our layers, by name
INHERIT += "layerdirs"

# Populate a tree of downloads organized by layer
ARCHIVE_RELEASE_DL_DIR ?= "${DEPLOY_DIR}/release-downloads"
DL_LICENSE_INCLUDE ?= "*"
INHERIT += "archive-release-downloads"

# For our forks, also point an 'upstream' remote at upstream
UPSTREAM_URL_meta-virtualization = "git://git.yoctoproject.org/meta-virtualization"
FORKED_REPOS ?= "meta-virtualization"

# Our public layers should use non-ssh URIs for their remotes
PUBLIC_REPOS ?= "meta-mentor meta-sourcery meta-tracing ${FORKED_REPOS}"

# Define a location for placing external artifacts to be used by the build
MEL_EXTERNAL_ARTIFACTS ?= "${TOPDIR}/mel-external-artifacts"
## }}}1
## Includes {{{1

# Support for SOURCERY_VERSION_REQUIRED
require conf/distro/include/sourcery-version-check.inc

# Handle GPLv3 gdbserver
require conf/distro/include/gdbserver-gplv3.inc

# QT5 configuration. These are includes rather than requires, as they live in
# other layers.
include conf/distro/include/qt5-mel.conf
include conf/distro/include/qt5-versions.inc

# Security configuration.
include conf/distro/include/mel-security.conf

# SWUpdate configuration.
include conf/distro/include/mel-swupdate.conf

# MCF configuration
include conf/distro/include/mel-mcf.conf

# INITRAMFS
INITRAMFS_IMAGE ?= "mel-initramfs-image"
INITRAMFS_IMAGE_BUNDLE ?= "${@bb.utils.contains('KERNEL_IMAGETYPES', 'fitimage', '', '1', d)}"
## }}}1
# vim: set fdm=marker fdl=0 :