contribute/bin_blobs.html · contribute/bin_blobs.rst 공식 원문 ↗

Zephyr 3.7.0 · Contribute · Project Policy

Binary Blobs

Proprietary binary를 upstream에 연결할 때 지켜야 할 open-source 경계와 책임을 정의합니다.

Official pathcontribute/bin_blobs.html
Source filecontribute/bin_blobs.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

Upstream vanilla Zephyr에 적용되는 blob 정책으로, third-party hosting과 west blobs metadata, tainting, 허용 유형, library의 header·dependency·toolchain·open-source test 요건, maintainer 책임, CI 제외와 TSC 승인 절차를 설명합니다.

Acquire

Modules · west blobs

Boundary

Hardware · Open Source

Governance

Maintainer · TSC

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 FA1CDAD8E07C464C03AD383317E8F8193A693EAA0F48A8C328C2FE6B9F53D092
.. _bin-blobs:

Binary Blobs
############

In the context of an operating system that supports multiple architectures and
many different IC families, some functionality may be unavailable without the
help of executable code distributed in binary form.  Binary blobs (or blobs for
short) are files containing proprietary machine code or data in a binary format,
e.g. without corresponding source code released under an OSI approved license.

Zephyr supports downloading and using third-party binary blobs via its built-in
mechanisms, with some important caveats, described in the following sections. It
is important to note that all the information in this section applies only to
`upstream (vanilla) Zephyr <https://github.com/zephyrproject-rtos/zephyr>`_.

There are no limitations whatsoever (except perhaps license compatibility) in
the support for binary blobs in forks or third-party distributions of Zephyr. In
fact, Zephyr’s build system supports arbitrary use cases related to blobs. This
includes linking against libraries, flashing images to targets, etc. Users are
therefore free to create Zephyr-based downstream software which uses binary
blobs if they cannot meet the requirements described in this page.

Software license
****************

Most binary blobs are distributed under proprietary licenses which vary
significantly in nature and conditions. It is up to the vendor to specify the
license as part of the blob submission process. Blob vendors may impose a
click-through or other EULA-like workflow when users fetch and install blobs.

Hosting
*******

Blobs must be hosted on the Internet and managed by third-party infrastructure.
Two potential examples are Git repositories and web servers managed by
individual hardware vendors.

The Zephyr Project does not host binary blobs in its Git repositories or
anywhere else.

Fetching blobs
**************

Blobs are fetched from official third-party sources by the :ref:`west blobs
<west-blobs>` command.

The blobs themselves must be specified in the :ref:`module.yml
<modules-bin-blobs>` files included in separate Zephyr :ref:`module repositories
<modules>` maintained by their respective vendors.  This means that in order to
include a reference to a binary blob to the upstream Zephyr distribution, a
module repository must exist first or be created as part of the submission
process.

Each blob which may be fetched must be individually identified in the
corresponding :file:`module.yml` file. A specification for a blob must contain:

- An abstract description of the blob itself
- Version information
- A reference to vendor-provided documentation
- The blob’s :ref:`type <bin-blobs-types>`, which must be one of the allowed types
- A checksum for the blob, which ``west blobs`` checks after downloading.
  This is required for reproducibility and to allow bisecting issues as blobs
  change using Git and west
- License text applicable to the blob or a reference to such text, in SPDX
  format

See the :ref:`corresponding section <modules-bin-blobs>` for a more formal
definition of the fields.

The :ref:`west blobs <west-blobs>` command can be used to list metadata of
available blobs and to fetch blobs from user-selected modules.

The ``west blobs`` command only fetches and stores the binary blobs themselves.
Any accompanying code, including interface header files for the blobs, must be
present in the corresponding module repository.

Tainting
********

Inclusion of binary blobs will taint the Zephyr build. The definition of
tainting originates in the `Linux kernel
<https://www.kernel.org/doc/html/latest/admin-guide/tainted-kernels.html>`_ and,
in the context of Zephyr, a tainted image will be one that includes binary blobs
in it.

Tainting will be communicated to the user in the following manners:

- One or more Kconfig options ``TAINT_BLOBS_*`` will be set to ``y``
- The Zephyr build system, during its configuration phase, will issue a warning.
  It will be possible to disable the warning using Kconfig
- The ``west spdx`` command will include the tainted status in its output
- The kernel's default fatal error handler will also explicitly print out the
  kernel's tainted status

.. _bin-blobs-types:

Allowed types
*************

The following binary blob types are acceptable in Zephyr:

* Precompiled libraries: Hardware enablement libraries, distributed in
  precompiled binary form, typically for SoC peripherals. An example could be an
  enablement library for a wireless peripheral
* Firmware images: An image containing the executable code for a secondary
  processor or CPU.  This can be full or partial (typically delta or patch data)
  and is generally copied into RAM or flash memory by the main CPU. An example
  could be the firmware for the core running a Bluetooth LE Controller
* Miscellaneous binary data files. An example could be pre-trained neural
  network model data

Hardware agnostic features provided via a proprietary library are not
acceptable. For example, a proprietary and hardware agnostic TCP/IP stack
distributed as a static archive would be rejected.

Note that just because a blob has an acceptable type does not imply that it will
be unconditionally accepted by the project; any blob may be rejected for other
reasons on a case by case basis (see library-specific requirements below).
In case of disagreement, the TSC is the arbiter of whether a particular blob
fits in one of the above types.

Precompiled library-specific requirements
*****************************************

This section contains additional requirements specific to precompiled library
blobs.

Any person who wishes to submit a precompiled library must represent that it
meets these requirements. The project may remove a blob from the upstream
distribution if it is discovered that the blob fails to meet these requirements
later on.

Interface header files
======================

The precompiled library must be accompanied by one or more header files,
distributed under a non-copyleft OSI approved license, that define the interface
to the library.

Allowed dependencies
====================

This section defines requirements related to external symbols that a library
blob requires the build system to provide.

* The blob must not depend on Zephyr APIs directly. In other words, it must have
  been possible to build the binary without any Zephyr source code present at
  all. This is required for loose coupling and maintainability, since Zephyr
  APIs may change and such blobs cannot be modified by all project maintainers
* Instead, if the code in the precompiled library requires functionality
  provided by Zephyr (or an RTOS in general), an implementation of an OS
  abstraction layer (aka porting layer) can be provided alongside the library.
  The implementation of this OS abstraction layer must be in source code form,
  released under an OSI approved license and documented using Doxygen

Toolchain requirements
======================

Precompiled library blobs must be in a data format which is compatible with and
can be linked by a toolchain supported by the Zephyr Project.  This is required
for maintainability and usability. Use of such libraries may require special
compiler and/or linker flags, however. For example, a porting layer may require
special flags, or a static archive may require use of specific linker flags.

Limited scope
=============

Allowing arbitrary library blobs carries a risk of degrading the degree to
which the upstream Zephyr software distribution is open source. As an extreme
example, a target with a zephyr kernel clock driver that is just a porting layer
around a library blob would not be bootable with open source software.

To mitigate this risk, the scope of upstream library blobs is limited. The
project maintainers define an open source test suite that an upstream
target must be able to pass using only open source software included in the
mainline distribution and its modules. The open source test suite currently
consists of:

- :file:`samples/philosophers`
- :file:`tests/kernel`

The scope of this test suite may grow over time. The goal is to specify
tests for a minimal feature set which must be supported via open source software
for any target with upstream Zephyr support.

At the discretion of the release team, the project may remove support for a
hardware target if it cannot pass this test suite.

Support and maintenance
***********************

The Zephyr Project is not expected to be responsible for the maintenance and
support of contributed binary blobs. As a consequence, at the discretion of the
Zephyr Project release team, and on a case-by-case basis:

- GitHub issues reported on the zephyr repository tracker that require use of
  blobs to reproduce may not be treated as bugs
- Such issues may be closed as out of scope of the Zephyr project

This does not imply that issues which require blobs to reproduce will be closed
without investigation. For example, the issue may be exposing a bug in a Zephyr
code path that is difficult or impossible to trigger without a blob. Project
maintainers may accept and attempt to resolve such issues.

However, some flexibility is required because project maintainers may not be
able to determine if a given issue is due to a bug in Zephyr or the blob itself,
may be unable to reproduce the bug due to lack of hardware, etc.

Blobs must have designated maintainers that must be responsive to issue reports
from users and provide updates to the blobs to address issues. At the discretion
of the Zephyr Project release team, module revisions referencing blobs may be
removed from :file:`zephyr/west.yml` at any time due to lack of responsiveness or
support from their maintainers. This is required to maintain project control
over bit-rot, security issues, etc.

The submitter of the proposal to integrate a binary blob must commit to maintain
the integration of such blob for the foreseeable future.

Regarding Continuous Integration, binary blobs will **not** be fetched in the
project's CI infrastructure that builds and optionally executes tests and samples
to prevent regressions and issues from entering the codebase. This includes
both CI ran when a new GitHub Pull Request is opened as well as any other
regularly scheduled execution of the CI infrastructure.

.. _blobs-process:

Submission and review process
*****************************

For references to binary blobs to be included in the project, they must be
reviewed and accepted by the Technical Steering Committee (TSC). This process is
only required for new binary blobs, updates to binary blobs follow the
:ref:`module update procedure <modules_changes>`.

A request for integration with binary blobs must be made by creating a new
issue in the Zephyr project issue tracking system on GitHub with details
about the blobs and the functionality they provide to the project.

Follow the steps below to begin the submission process:

#. Make sure to read through the :ref:`bin-blobs` section in
   detail, so that you are informed of the criteria used by the TSC in order to
   approve or reject a request
#. Use the :github:`New Binary Blobs Issue
   <new?assignees=&labels=RFC&template=008_bin-blobs.md&title=>` to open an issue
#. Fill out all required sections, making sure you provide enough detail for the
   TSC to assess the merit of the request. Additionally you must also create a Pull
   Request that demonstrates the integration of the binary blobs and then
   link to it from the issue
#. Wait for feedback from the TSC, respond to any additional questions added as
   GitHub issue comments

If, after consideration by the TSC, the submission of the binary blob(s) is
approved, the submission process is complete and the binary blob(s) can be
integrated.

Part 3

한국어 전문 번역

Binary Blob

여러 architecture와 다양한 IC family를 지원하는 operating system에서는 binary 형태로 배포되는 executable code의 도움 없이는 일부 기능을 사용할 수 없는 경우가 있습니다. Binary blob, 줄여서 blob은 OSI 승인 license로 공개된 대응 source code 없이 proprietary machine code 또는 binary data를 담은 file입니다.

Zephyr는 built-in mechanism으로 third-party binary blob을 내려받아 사용할 수 있지만 중요한 조건이 있습니다. 이 절의 내용은 upstream vanilla Zephyr에만 적용됩니다.

Zephyr fork나 third-party distribution에서 binary blob을 지원하는 방식에는 license compatibility를 제외하면 제한이 없습니다. Zephyr build system은 library link, target에 image flash 등 blob과 관련된 임의의 use case를 지원합니다. 이 페이지의 요구 사항을 충족할 수 없다면 downstream software에서 blob을 사용하는 것은 자유입니다.

Software license

대부분의 binary blob은 성격과 조건이 크게 다른 proprietary license로 배포됩니다. Blob 제출 과정에서 license를 명시하는 책임은 vendor에게 있습니다. Blob vendor는 사용자가 blob을 fetch하고 install할 때 click-through 또는 EULA와 유사한 절차를 요구할 수 있습니다.

Hosting

Blob은 Internet에서 접근 가능해야 하며 third-party infrastructure가 관리해야 합니다. Hardware vendor가 관리하는 Git repository나 web server가 예입니다.

Zephyr Project는 Git repository를 포함한 어떤 위치에도 binary blob을 host하지 않습니다.

Blob 가져오기

west blobs command는 공식 third-party source에서 blob을 가져옵니다.

Blob 자체는 해당 vendor가 관리하는 별도 Zephyr module repository의 module.yml file에 명시해야 합니다. 따라서 upstream Zephyr distribution에 binary blob reference를 포함하려면 module repository가 먼저 존재해야 하며, 없다면 제출 과정에서 만들어야 합니다.

module.yml은 가져올 수 있는 각 blob을 개별 식별해야 합니다. Blob specification에는 다음 항목이 필요합니다.

  • Blob 자체의 개괄적인 설명
  • Version 정보
  • Vendor 제공 문서의 reference
  • 허용된 유형 가운데 하나인 blob type
  • west blobs가 download 후 확인하는 checksum. Reproducibility를 보장하고 blob 변경으로 생긴 문제를 Git과 west로 bisect하는 데 필요합니다.
  • Blob에 적용되는 license text 또는 그 text에 대한 reference. SPDX format을 사용합니다.

Field의 정식 정의는 module binary blob 절을 따릅니다.

west blobs command로 사용 가능한 blob의 metadata를 나열하고 사용자가 선택한 module에서 blob을 가져올 수 있습니다.

west blobs는 binary blob 자체만 가져와 저장합니다. Blob interface header file을 포함한 동반 code는 해당 module repository 안에 있어야 합니다.

Tainting

Binary blob을 포함하면 Zephyr build는 tainted 상태가 됩니다. Tainting의 개념은 Linux kernel에서 유래했으며, Zephyr에서는 binary blob이 들어간 image를 tainted image라고 합니다.

Tainted 상태는 다음 방식으로 사용자에게 전달됩니다.

  • TAINT_BLOBS_* Kconfig option 하나 이상이 y로 설정됩니다.
  • Zephyr build system이 configuration 단계에서 warning을 출력합니다. 이 warning은 Kconfig로 끌 수 있습니다.
  • west spdx command가 출력에 tainted status를 포함합니다.
  • Kernel 기본 fatal error handler도 kernel의 tainted status를 명시적으로 출력합니다.

허용되는 유형

Zephyr가 허용할 수 있는 binary blob 유형은 다음과 같습니다.

  • Precompiled library: 미리 compile된 binary로 배포하는 hardware enablement library이며 보통 SoC peripheral용입니다. Wireless peripheral enablement library가 예입니다.
  • Firmware image: secondary processor 또는 CPU에서 실행할 code를 담은 image입니다. 전체 image 또는 delta·patch 같은 부분 image일 수 있으며 보통 main CPU가 RAM이나 flash에 복사합니다. Bluetooth LE Controller core firmware가 예입니다.
  • 기타 binary data file: pre-trained neural network model data가 예입니다.

Proprietary library가 제공하는 hardware 독립 기능은 허용하지 않습니다. 예를 들어 proprietary이며 hardware와 무관한 TCP/IP stack을 static archive로 배포하면 거부됩니다.

Blob 유형이 허용 목록에 있다는 사실만으로 project가 무조건 수락하는 것은 아닙니다. 다른 이유로 case-by-case 거부할 수 있으며 library 전용 요구 사항도 적용됩니다. 의견이 일치하지 않으면 특정 blob이 허용 유형에 드는지 TSC가 최종 판단합니다.

Precompiled library 전용 요구 사항

이 절은 precompiled library blob에 추가로 적용되는 요구 사항입니다.

Precompiled library를 제출하는 사람은 해당 library가 다음 요구 사항을 충족한다고 진술해야 합니다. 나중에 충족하지 않는 것으로 밝혀지면 project는 upstream distribution에서 blob을 제거할 수 있습니다.

Interface header file

Precompiled library에는 library interface를 정의하는 header file이 하나 이상 따라야 합니다. Header는 non-copyleft OSI 승인 license로 배포해야 합니다.

허용되는 dependency

이 절은 library blob이 build system에 제공해 달라고 요구하는 external symbol에 관한 조건을 정의합니다.

  • Blob은 Zephyr API에 직접 의존하면 안 됩니다. 즉 Zephyr source code가 전혀 없는 상태에서도 binary를 build할 수 있어야 합니다. Zephyr API는 변경될 수 있고 project maintainer 모두가 blob을 수정할 수 없으므로 loose coupling과 maintainability를 위해 필요합니다.
  • Precompiled library code가 Zephyr 또는 일반 RTOS 기능을 필요로 한다면 OS abstraction layer, 즉 porting layer 구현을 library와 함께 제공할 수 있습니다. 이 layer는 source code 형태여야 하고 OSI 승인 license로 공개하며 Doxygen으로 문서화해야 합니다.

Toolchain 요구 사항

Precompiled library blob은 Zephyr Project가 지원하는 toolchain과 호환되고 link 가능한 data format이어야 합니다. Maintainability와 usability를 위해 필요합니다. 다만 porting layer나 static archive 때문에 특정 compiler 또는 linker flag가 필요할 수 있습니다.

제한된 범위

임의의 library blob을 허용하면 upstream Zephyr software distribution의 open-source 정도가 낮아질 위험이 있습니다. 극단적으로 Zephyr kernel clock driver가 library blob을 감싼 porting layer에 불과하다면 그 target은 open-source software만으로 boot할 수 없습니다.

이 위험을 줄이기 위해 upstream library blob의 범위를 제한합니다. Project maintainer는 upstream target이 mainline distribution과 module에 포함된 open-source software만 사용해 통과해야 하는 open-source test suite를 정의합니다. 현재 suite는 다음으로 구성됩니다.

  • samples/philosophers
  • tests/kernel

이 test suite의 범위는 향후 커질 수 있습니다. 목표는 upstream Zephyr 지원 target이 open-source software로 반드시 제공해야 하는 최소 feature set의 test를 명시하는 것입니다.

Release team의 판단에 따라 이 test suite를 통과하지 못하는 hardware target의 지원을 project에서 제거할 수 있습니다.

지원과 유지보수

Zephyr Project는 기여된 binary blob의 유지보수와 지원을 책임지지 않습니다. 따라서 Zephyr Project release team은 case-by-case로 다음과 같이 판단할 수 있습니다.

  • 재현하려면 blob이 필요한 zephyr repository tracker의 GitHub issue를 bug로 취급하지 않을 수 있습니다.
  • 그런 issue를 Zephyr project의 범위 밖으로 보고 닫을 수 있습니다.

Blob이 있어야 재현되는 issue를 조사 없이 닫는다는 뜻은 아닙니다. 예를 들어 blob 없이는 trigger하기 어렵거나 불가능한 Zephyr code path의 bug를 드러낼 수 있으며, project maintainer가 이를 받아 해결할 수 있습니다.

그러나 maintainer가 issue 원인이 Zephyr bug인지 blob bug인지 판단하지 못하거나 hardware가 없어 재현하지 못할 수 있으므로 유연성이 필요합니다.

Blob에는 지정 maintainer가 있어야 하며 사용자 issue report에 응답하고 문제를 해결한 blob update를 제공해야 합니다. Maintainer의 대응이나 지원이 부족하면 Zephyr Project release team은 blob을 참조하는 module revision을 언제든 `zephyr/west.yml`에서 제거할 수 있습니다. Bit rot과 security issue에 대한 project 통제력을 유지하기 위한 조건입니다.

Binary blob 통합을 제안한 제출자는 예측 가능한 미래 동안 해당 blob integration을 유지보수하겠다고 약속해야 합니다.

Continuous Integration에서는 regression과 issue가 codebase에 들어오는 것을 막기 위해 test와 sample을 build하고 선택적으로 실행하지만 binary blob은 가져오지 않습니다. 새 GitHub Pull Request가 열릴 때의 CI와 정기 실행 CI 모두에 적용됩니다.

제출과 review 절차

Project에 binary blob reference를 포함하려면 Technical Steering Committee(TSC)의 review와 승인이 필요합니다. 이 절차는 새 binary blob에만 필요하며 기존 blob update는 module update 절차를 따릅니다.

Binary blob 통합 요청은 Zephyr project GitHub issue tracking system에 새 issue를 만들고 blob과 project에 제공하는 기능을 설명하는 방식으로 제출합니다.

제출 절차를 시작하려면 다음 단계를 따릅니다.

  1. TSC가 요청 승인 또는 거부에 사용하는 기준을 이해하도록 Binary Blob 절 전체를 자세히 읽습니다.
  2. New Binary Blobs Issue template으로 issue를 엽니다.
  3. 필수 section을 모두 작성하고 TSC가 요청의 가치를 판단할 만큼 충분한 정보를 제공합니다. Binary blob 통합을 보여 주는 Pull Request도 만들고 issue에서 link해야 합니다.
  4. TSC feedback을 기다리고 GitHub issue comment에 추가된 질문에 답합니다.

TSC 검토 결과 binary blob 제출이 승인되면 제출 절차가 완료되고 blob을 통합할 수 있습니다.

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.