├── .github
└── workflows
│ ├── build.yml
│ └── schedule-builds.yml
├── COPYING.MIT
├── DCO
├── README.rst
├── classes-global
└── sanity-meta-rauc.bbclass
├── classes-recipe
└── bundle.bbclass
├── conf
└── layer.conf
├── recipes-bsp
└── dt-utils
│ ├── dt-utils.inc
│ └── dt-utils_2023.11.0.bb
├── recipes-casync
└── casync
│ └── casync_git.bb
├── recipes-core
├── bundles
│ └── core-bundle-minimal.bb
├── busybox
│ ├── busybox_%.bbappend
│ ├── busybox_rauc.inc
│ └── files
│ │ └── rauc.cfg
├── packagegroups
│ ├── packagegroup-base.bbappend
│ └── packagegroup-base_rauc.inc
└── rauc
│ ├── files
│ ├── ca.cert.pem
│ ├── rauc-mark-good.init
│ ├── rauc-mark-good.service
│ └── system.conf
│ ├── nativesdk-rauc.inc
│ ├── nativesdk-rauc_1.14.bb
│ ├── nativesdk-rauc_git.bb
│ ├── rauc-1.14.inc
│ ├── rauc-conf.bb
│ ├── rauc-git.inc
│ ├── rauc-native.inc
│ ├── rauc-native_1.14.bb
│ ├── rauc-native_git.bb
│ ├── rauc-target.inc
│ ├── rauc.inc
│ ├── rauc_1.14.bb
│ └── rauc_git.bb
├── recipes-devtools
└── python-gbulb
│ └── python3-gbulb_0.6.3.bb
├── recipes-kernel
└── linux
│ ├── linux-yocto
│ └── rauc.cfg
│ ├── linux-yocto_%.bbappend
│ └── linux-yocto_rauc.inc
├── recipes-support
├── curl
│ ├── curl_%.bbappend
│ └── curl_rauc.inc
├── rauc-hawkbit-updater
│ ├── rauc-hawkbit-updater.inc
│ ├── rauc-hawkbit-updater_1.3.bb
│ └── rauc-hawkbit-updater_git.bb
└── rauc-hawkbit
│ ├── files
│ └── rauc-hawkbit.service
│ └── rauc-hawkbit_git.bb
└── scripts
├── README
└── openssl-ca.sh
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: build
2 |
3 | on:
4 | push: {}
5 | pull_request: {}
6 | # allow rebuilding without a push
7 | workflow_dispatch: {}
8 |
9 | jobs:
10 | build:
11 | name: meta-rauc Build
12 | # run on self-hosted runner for the main repo or if vars.BUILD_RUNS_ON is set
13 | runs-on: >-
14 | ${{
15 | (vars.BUILD_RUNS_ON != '' && fromJSON(vars.BUILD_RUNS_ON)) ||
16 | (github.repository == 'rauc/meta-rauc' && fromJSON('["self-hosted", "forrest", "build"]')) ||
17 | 'ubuntu-22.04'
18 | }}
19 | # abort if it seems that we're rebuilding too much
20 | timeout-minutes: 120
21 | steps:
22 | - name: Install required packages
23 | run: |
24 | sudo apt-get -q -y --no-install-recommends install diffstat chrpath
25 | - name: Checkout
26 | uses: actions/checkout@v4
27 | with:
28 | path: meta-rauc
29 | - name: Clone poky
30 | run: git clone --shared --reference-if-able /srv/shared-git/poky.git -b master https://github.com/yoctoproject/poky.git
31 | - name: Clone meta-openembedded
32 | run: git clone --shared --reference-if-able /srv/shared-git/meta-openembedded.git -b master https://github.com/openembedded/meta-openembedded.git
33 | - name: Initialize build directory
34 | run: |
35 | source poky/oe-init-build-env build
36 | bitbake-layers add-layer ../meta-rauc
37 | if [ -f ~/.yocto/auto.conf ]; then
38 | cp ~/.yocto/auto.conf conf/
39 | else
40 | echo 'SSTATE_MIRRORS = "file://.* https://github-runner.pengutronix.de/sstate-cache/PATH"' >> conf/auto.conf
41 | echo 'BB_SIGNATURE_HANDLER = "OEBasicHash"' >> conf/auto.conf
42 | echo 'BB_HASHSERVE = ""' >> conf/auto.conf
43 | echo 'OPKGBUILDCMD = "opkg-build -Z gzip -a -1n"' >> conf/auto.conf
44 | echo 'INHERIT += "rm_work"' >> conf/auto.conf
45 | fi
46 | echo 'DISTRO_FEATURES:remove = "alsa bluetooth usbgadget usbhost wifi nfs zeroconf pci 3g nfc x11 opengl ptest wayland vulkan"' >> conf/local.conf
47 | - name: Build rauc, rauc-native
48 | run: |
49 | source poky/oe-init-build-env build
50 | bitbake rauc rauc-native
51 | - name: Build rauc-hawkbit-updater
52 | run: |
53 | source poky/oe-init-build-env build
54 | bitbake rauc-hawkbit-updater
55 | - name: Build dt-utils
56 | run: |
57 | source poky/oe-init-build-env build
58 | bitbake dt-utils
59 | - name: Build casync, casync-native
60 | run: |
61 | source poky/oe-init-build-env build
62 | bitbake-layers add-layer ../meta-openembedded/meta-oe
63 | bitbake-layers add-layer ../meta-openembedded/meta-python
64 | bitbake-layers add-layer ../meta-openembedded/meta-networking
65 | bitbake-layers add-layer ../meta-openembedded/meta-filesystems
66 | bitbake casync casync-native
67 | - name: Build rauc-hawkbit
68 | run: |
69 | source poky/oe-init-build-env build
70 | bitbake-layers add-layer ../meta-openembedded/meta-python
71 | bitbake rauc-hawkbit
72 | - name: Cache Data
73 | env:
74 | CACHE_KEY: ${{ secrets.YOCTO_CACHE_KEY }}
75 | if: ${{ env.CACHE_KEY }}
76 | run: |
77 | mkdir -p ~/.ssh
78 | echo "$CACHE_KEY" >> ~/.ssh/id_ed25519
79 | chmod 600 ~/.ssh/id_ed25519
80 | rsync -rvx --ignore-existing build/downloads yocto-cache: || true
81 | rsync -rvx --ignore-existing build/sstate-cache yocto-cache: || true
82 |
--------------------------------------------------------------------------------
/.github/workflows/schedule-builds.yml:
--------------------------------------------------------------------------------
1 | name: Schedule Builds
2 |
3 | on:
4 | # allow rebuilding manually
5 | workflow_dispatch:
6 | # pre-build sstate regularly
7 | schedule:
8 | - cron: '30 3 * * *'
9 |
10 | jobs:
11 | build:
12 | name: Schedule Builds
13 | runs-on: ubuntu-latest
14 | if: ${{ github.event_name == 'workflow_dispatch' || vars.SCHEDULE_BUILDS }}
15 | env:
16 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 | steps:
18 | - name: Check out the repository
19 | uses: actions/checkout@v4
20 |
21 | - name: Trigger master build
22 | run: gh workflow run build --ref master
23 |
24 | - name: Trigger walnascar build
25 | run: gh workflow run build --ref walnascar
26 |
27 | - name: Trigger styhead build
28 | run: gh workflow run build --ref styhead
29 |
30 | - name: Trigger scarthgap build
31 | run: gh workflow run build --ref scarthgap
32 |
33 | - name: Trigger kirkstone build
34 | run: gh workflow run build --ref kirkstone
35 |
--------------------------------------------------------------------------------
/COPYING.MIT:
--------------------------------------------------------------------------------
1 | Permission is hereby granted, free of charge, to any person obtaining a copy
2 | of this software and associated documentation files (the "Software"), to deal
3 | in the Software without restriction, including without limitation the rights
4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5 | copies of the Software, and to permit persons to whom the Software is
6 | furnished to do so, subject to the following conditions:
7 |
8 | The above copyright notice and this permission notice shall be included in
9 | all copies or substantial portions of the Software.
10 |
11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
17 | THE SOFTWARE.
18 |
--------------------------------------------------------------------------------
/DCO:
--------------------------------------------------------------------------------
1 | Developer's Certificate of Origin
2 | ---------------------------------
3 |
4 | meta-rauc uses the `Developer's Certificate of Origin 1.1
5 | `_ with the same `process
6 | `_
7 | as used for the Linux kernel:
8 |
9 | Developer's Certificate of Origin 1.1
10 |
11 | By making a contribution to this project, I certify that:
12 |
13 | (a) The contribution was created in whole or in part by me and I
14 | have the right to submit it under the open source license
15 | indicated in the file; or
16 |
17 | (b) The contribution is based upon previous work that, to the best
18 | of my knowledge, is covered under an appropriate open source
19 | license and I have the right under that license to submit that
20 | work with modifications, whether created in whole or in part
21 | by me, under the same open source license (unless I am
22 | permitted to submit under a different license), as indicated
23 | in the file; or
24 |
25 | (c) The contribution was provided directly to me by some other
26 | person who certified (a), (b) or (c) and I have not modified
27 | it.
28 |
29 | (d) I understand and agree that this project and the contribution
30 | are public and that a record of the contribution (including all
31 | personal information I submit with it, including my sign-off) is
32 | maintained indefinitely and may be redistributed consistent with
33 | this project or the open source license(s) involved.
34 |
35 | then you just add a line saying:
36 |
37 | Signed-off-by: Random J Developer
38 |
39 | using a known identity (sorry, no anonymous contributions.)
40 | This will be done for you automatically if you use git commit -s.
41 | Reverts should also include "Signed-off-by". git revert -s does that for you.
42 |
--------------------------------------------------------------------------------
/README.rst:
--------------------------------------------------------------------------------
1 | .. list-table::
2 | :header-rows: 1
3 |
4 | * - master
5 | - walnascar
6 | - styhead
7 | - scarthgap
8 | - kirkstone
9 | * - |gh_master|
10 | - |gh_walnascar|
11 | - |gh_styhead|
12 | - |gh_scarthgap|
13 | - |gh_kirkstone|
14 |
15 | |MIT| |Matrix|
16 |
17 | The meta-rauc layer provides support for integrating the RAUC update tool
18 | into your device.
19 |
20 | Please see the corresponding sections below for more information.
21 | For a detailed description on steps necessary to integrate RAUC into your
22 | project, refer https://rauc.readthedocs.io/en/latest/integration.html.
23 |
24 |
25 | Dependencies
26 | ============
27 |
28 | This layer depends on::
29 |
30 | URI: https://github.com/openembedded/bitbake.git
31 | branch: master
32 |
33 | URI: https://github.com/openembedded/openembedded-core.git
34 | layers: meta
35 | branch: master
36 |
37 | For rauc-hawkbit client::
38 |
39 | URI: https://github.com/openembedded/meta-openembedded.git
40 | layers: meta-python
41 | branch: master
42 |
43 | For fuse-support in casync (the default)::
44 |
45 | URI: https://github.com/openembedded/meta-openembedded.git
46 | layers: meta-filesystems
47 | branch: master
48 |
49 | Patches
50 | =======
51 |
52 | Please submit patches via GitHub pull request on https://github.com/rauc/meta-rauc
53 |
54 | Maintainer: Enrico Joerns
55 |
56 | Migration Notes
57 | ===============
58 |
59 | Since **scarthgap**, the platform configuration (system.conf, keyring, etc.) was
60 | moved to a separate ``rauc-conf.bb`` recipe to allow building the rauc package
61 | with ``TUNE_PKGARCH`` and have a clearer separation between the binary and the
62 | configuration.
63 |
64 | Thus when updating to scarthgap or newer, make sure to move all
65 | configuration-specific adaptions from your ``rauc_%.bbappend`` to a
66 | ``rauc-conf.bbappend`` file.
67 |
68 |
69 | I. Adding the rauc Layer to Your Build
70 | ======================================
71 |
72 | In order to use this layer, you need to make the build system aware of
73 | it.
74 |
75 | Assuming the rauc layer exists at the top-level of your
76 | yocto build tree, you can add it to the build system by adding the
77 | location of the rauc layer to bblayers.conf, along with any
78 | other layers needed. e.g.::
79 |
80 | BBLAYERS ?= " \
81 | /path/to/yocto/meta \
82 | /path/to/yocto/meta-poky \
83 | /path/to/yocto/meta-yocto-bsp \
84 | /path/to/yocto/meta-rauc \
85 | "
86 |
87 |
88 | II. Building and Using RAUC Host Tool
89 | =====================================
90 |
91 | If you intend to build and use RAUC as a host tool from your BSP, e.g. for
92 | calling ``rauc info`` on your built bundle, simply run::
93 |
94 | bitbake rauc-native -caddto_recipe_sysroot
95 | oe-run-native rauc-native rauc info --keyring=/path/to/keyring.pem tmp/deploy/images//.raucb
96 |
97 | If you need to execute the ``casync`` host tool manually, you can do this by running::
98 |
99 | bitbake casync-native -caddto_recipe_sysroot
100 | oe-run-native casync-native casync --help
101 |
102 | III. Adding the RAUC Update Service to Your Device
103 | ==================================================
104 |
105 | To prepare your device for using RAUC as its update handler,
106 | you have to follow at least the following steps:
107 |
108 | 1. Add `rauc` to `DISTRO_FEATURES` in your distro (or local) config::
109 |
110 | DISTRO_FEATURES += "rauc"
111 |
112 | 2. Add a ``rauc-conf.bbappend`` in your device-specific (BSP) layer
113 | that installs your RAUC system configuration file under
114 | ``/etc/rauc/system.conf``. For information on how to write the RAUC
115 | update file, please refer to the RAUC user documentation [1]_::
116 |
117 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
118 |
119 | 3. Create a bundle recipe for your device by adding a recipe
120 | that inherits the `bundle` class and adds all desired
121 | configuration::
122 |
123 | inherit bundle
124 |
125 | RAUC_BUNDLE_SLOTS = "rootfs"
126 | RAUC_SLOT_rootfs = "my-rootfs-recipe"
127 |
128 | RAUC_KEY_FILE = "path/to/development-1.key.pem"
129 | RAUC_CERT_FILE = "path/to/development-1.cert.pem"
130 |
131 | For information on how to generate and use the key and certificate files,
132 | please refer to the RAUC user documentation [1]_.
133 |
134 | For a more detailed explanation on the required and available variables,
135 | read the notes in the bundle.bbclass file.
136 |
137 | 4. Build a bundle and the rootfs for your device::
138 |
139 | bitbake my-bundle-recipe
140 |
141 | Note: If you do not use packagegroup-base, you als need to manually add
142 | the `rauc` package to your systems image recipe::
143 |
144 | IMAGE_INSTALL:append = " rauc"
145 |
146 |
147 | IV. Building The RAUC hawkBit Clients
148 | =====================================
149 |
150 | This layer offers support for two clients that interface between RAUC and the
151 | hawkBit deployment server:
152 |
153 | * rauc-hawkbit (python implementation)
154 | * rauc-hawkbit-updater (C implementation)
155 |
156 | To use ``rauc-hawkbit`` as a standalone service add to your systems image
157 | recipe::
158 |
159 | IMAGE_INSTALL:append = " rauc-hawkbit-service"
160 |
161 | To use it as a python library in your demo application instead, simply add to
162 | your recipe::
163 |
164 | DEPENDS += "rauc-hawkbit"
165 |
166 | To use ``rauc-hawkbit-updater`` in your system add to your image recipe::
167 |
168 | IMAGE_INSTALL:append = " rauc-hawkbit-updater"
169 |
170 | V. Configure Custom Kernel
171 | ==========================
172 |
173 | In order to use RAUC on your system, the kernel must support SquashFS and loop
174 | mounts. For the standard yocto kernel, the meta-rauc layer provides a kernel
175 | configuration fragment that enables the config options required for this.
176 |
177 | If you build your own kernel with a full custom ``defconfig`` file, you have to
178 | make sure that the options in ``recipes-kernel/linux/linux-yocto/rauc.cfg`` are
179 | enabled in your configuration, too.
180 |
181 | VI. Build RAUC Development Version
182 | ==================================
183 |
184 | Beside the standard release version recipes, the _git variants of RAUC recipes
185 | allow to build RAUC from a master branch revision that is newer than the latest
186 | release.
187 |
188 | This is especially useful for early testing and adaption to upcoming features
189 | in RAUC.
190 |
191 | By default, the _git recipes are disabled. To enable them, you can set::
192 |
193 | RAUC_USE_DEVEL_VERSION = "1"
194 |
195 | in your local.conf. Note that this has the same effect as setting
196 | ``DEFAULT_PREFERENCE = "1"`` for each recipe (target/native/nativesdk)
197 | individually.
198 |
199 | VII. Contributing
200 | =================
201 |
202 | To report bugs, file a new `issue `_
203 | on GitHub.
204 |
205 | For fixing bugs, bumping recipes or adding new features, open a `pull request
206 | `_ on GitHub.
207 |
208 | Add a ``Signed-off-by`` line to your commits according to the
209 | `Developer’s Certificate of Origin
210 | `_.
211 |
212 | Backporting
213 | -----------
214 |
215 | For backporting changes to a stable or LTS branch, two options exist:
216 |
217 | a) drop a backport request in the original pull request
218 | b) backport on your own and create a new pull request
219 |
220 | When doing backports on your own, make sure to include a cherry-pick note and
221 | the original commit-ish in a line below the original Signed-off-by and add your
222 | own Signed-off-by below.
223 | When using git, this can be done automatically with::
224 |
225 | git cherry-pick -xs
226 |
227 | Note that backports will be acccepted for actively maintained `poky releases
228 | `_ only!
229 |
230 | VIII. References
231 | ================
232 |
233 | .. [1] http://rauc.readthedocs.io/en/latest/
234 |
235 |
236 | .. |MIT| image:: https://img.shields.io/badge/license-MIT-blue.svg
237 | :target: https://raw.githubusercontent.com/rauc/meta-rauc/master/COPYING.MIT
238 | .. |gh_kirkstone| image:: https://github.com/rauc/meta-rauc/actions/workflows/build.yml/badge.svg?branch=kirkstone&event=workflow_dispatch
239 | :target: https://github.com/rauc/meta-rauc/actions?query=event%3Aworkflow_dispatch+branch%3Akirkstone++
240 | .. |gh_scarthgap| image:: https://github.com/rauc/meta-rauc/actions/workflows/build.yml/badge.svg?branch=scarthgap&event=workflow_dispatch
241 | :target: https://github.com/rauc/meta-rauc/actions?query=event%3Aworkflow_dispatch+branch%3Ascarthgap++
242 | .. |gh_styhead| image:: https://github.com/rauc/meta-rauc/actions/workflows/build.yml/badge.svg?branch=styhead&event=workflow_dispatch
243 | :target: https://github.com/rauc/meta-rauc/actions?query=event%3Aworkflow_dispatch+branch%3Astyhead++
244 | .. |gh_walnascar| image:: https://github.com/rauc/meta-rauc/actions/workflows/build.yml/badge.svg?branch=walnascar&event=workflow_dispatch
245 | :target: https://github.com/rauc/meta-rauc/actions?query=event%3Aworkflow_dispatch+branch%3Awalnascar++
246 | .. |gh_master| image:: https://github.com/rauc/meta-rauc/actions/workflows/build.yml/badge.svg?branch=master&event=workflow_dispatch
247 | :target: https://github.com/rauc/meta-rauc/actions?query=event%3Aworkflow_dispatch+branch%3Amaster++
248 | .. |Matrix| image:: https://img.shields.io/matrix/rauc:matrix.org?label=matrix%20chat
249 | :target: https://app.element.io/#/room/#rauc:matrix.org
250 |
--------------------------------------------------------------------------------
/classes-global/sanity-meta-rauc.bbclass:
--------------------------------------------------------------------------------
1 | addhandler rauc_bbappend_distrocheck
2 | rauc_bbappend_distrocheck[eventmask] = "bb.event.SanityCheck"
3 | python rauc_bbappend_distrocheck() {
4 | skip_check = e.data.getVar('SKIP_META_RAUC_FEATURE_CHECK') == "1"
5 | if 'rauc' not in e.data.getVar('DISTRO_FEATURES').split() and not skip_check:
6 | bb.warn("You have included the meta-rauc layer, but \
7 | 'rauc' has not been enabled in your DISTRO_FEATURES. \
8 | See the meta-rauc README.rst for details on enabling RAUC support for your \
9 | platform.")
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/classes-recipe/bundle.bbclass:
--------------------------------------------------------------------------------
1 | # Class for creating rauc bundles
2 | #
3 | # Description:
4 | #
5 | # You have to set the slot images in your recipe file following this example:
6 | #
7 | # RAUC_BUNDLE_COMPATIBLE ?= "My Super Product"
8 | # RAUC_BUNDLE_VERSION ?= "v2015-06-07-1"
9 | #
10 | # SRC_URI += "file://hook.sh"
11 | #
12 | # RAUC_BUNDLE_HOOKS[file] ?= "hook.sh"
13 | # RAUC_BUNDLE_HOOKS[hooks] ?= "install-check"
14 | #
15 | # RAUC_BUNDLE_SLOTS ?= "rootfs kernel dtb bootloader"
16 | #
17 | # RAUC_SLOT_rootfs ?= "core-image-minimal"
18 | # RAUC_SLOT_rootfs[fstype] = "ext4"
19 | # RAUC_SLOT_rootfs[hooks] ?= "pre-install;post-install"
20 | # RAUC_SLOT_rootfs[adaptive] ?= "block-hash-index"
21 | #
22 | # RAUC_SLOT_kernel ?= "linux-yocto"
23 | # RAUC_SLOT_kernel[type] ?= "kernel"
24 | #
25 | # RAUC_SLOT_bootloader ?= "barebox"
26 | # RAUC_SLOT_bootloader[type] ?= "boot"
27 | # RAUC_SLOT_bootloader[file] ?= "barebox.img"
28 | #
29 | # RAUC_SLOT_dtb ?= linux-yocto
30 | # RAUC_SLOT_dtb[type] ?= "file"
31 | # RAUC_SLOT_dtb[file] ?= "${MACHINE}.dtb"
32 | #
33 | # To use a different image name, e.g. for variants
34 | # RAUC_SLOT_dtb ?= linux-yocto
35 | # RAUC_SLOT_dtb[name] ?= "dtb.my,compatible"
36 | # RAUC_SLOT_dtb[type] ?= "file"
37 | # RAUC_SLOT_dtb[file] ?= "${MACHINE}-variant1.dtb"
38 | #
39 | # To override the file name used in the bundle use 'rename'
40 | # RAUC_SLOT_rootfs ?= "core-image-minimal"
41 | # RAUC_SLOT_rootfs[rename] ?= "rootfs.ext4"
42 | #
43 | # To generate an artifact image, use / as the image name:
44 | # RAUC_BUNDLE_SLOTS += "containers/test"
45 | # RAUC_SLOT_containers/test ?= "container-test-image"
46 | # RAUC_SLOT_containers/test[fstype] = "tar.gz"
47 | # RAUC_SLOT_containers/test[convert] = "tar-extract;composefs"
48 | #
49 | # To prepend an offset to a bootloader image, set the following parameter in bytes.
50 | # Optionally you can use units allowed by 'dd' e.g. 'K','kB','MB'.
51 | # If the offset is negative, bytes will not be added, but removed.
52 | # RAUC_SLOT_bootloader[offset] ?= "0"
53 | #
54 | # Enable building verity format bundles with
55 | #
56 | # RAUC_BUNDLE_FORMAT = "verity"
57 | #
58 | # To add additional files to the bundle you can use RAUC_BUNDLE_EXTRA_FILES
59 | # and RAUC_BUNDLE_EXTRA_DEPENDS.
60 | # For files from the UNPACKDIR (fetched using SRC_URI) you can write:
61 | #
62 | # SRC_URI += "file://myfile"
63 | # RAUC_BUNDLE_EXTRA_FILES += "myfile"
64 | #
65 | # For files from the DEPLOY_DIR_IMAGE (generated by another recipe) you can write:
66 | #
67 | # RAUC_BUNDLE_EXTRA_DEPENDS += "myfile-recipe-pn"
68 | # RAUC_BUNDLE_EXTRA_FILES += "myfile.img"
69 | #
70 | # Extra arguments may be passed to the bundle command with BUNDLE_ARGS eg:
71 | # BUNDLE_ARGS += ' --mksquashfs-args="-comp zstd -Xcompression-level 22" '
72 | #
73 | # Likewise, extra arguments can be passed to the convert command with
74 | # CONVERT_ARGS.
75 | #
76 | # Additionally you need to provide a certificate and a key file
77 | #
78 | # RAUC_KEY_FILE ?= "development-1.key.pem"
79 | # RAUC_CERT_FILE ?= "development-1.cert.pem"
80 | #
81 | # For bundle signature verification a keyring file must be provided
82 | #
83 | # RAUC_KEYRING_FILE ?= "ca.cert.pem"
84 | #
85 | # Enable building casync bundles with
86 | #
87 | # RAUC_CASYNC_BUNDLE = "1"
88 | #
89 | # To define custom manifest 'meta' sections, you may use
90 | # 'RAUC_META_SECTIONS' as follows:
91 | #
92 | # RAUC_META_SECTIONS = "mydata foo"
93 | #
94 | # RAUC_META_mydata[release-type] = "beta"
95 | # RAUC_META_mydata[release-notes] = "a few notes here"
96 | #
97 | # RAUC_META_foo[bar] = "baz"
98 | #
99 | # Adding any sort of additional lines to the manifest can be done with the
100 | # RAUC_MANIFEST_EXTRA_LINES variable (using '\n' to indicate newlines):
101 | #
102 | # RAUC_MANIFEST_EXTRA_LINES = "[section]\nkey=value\n"
103 |
104 | LICENSE ?= "MIT"
105 |
106 | PACKAGE_ARCH = "${MACHINE_ARCH}"
107 |
108 | inherit nopackages
109 |
110 | PACKAGES = ""
111 | INHIBIT_DEFAULT_DEPS = "1"
112 |
113 | # [""] is added to avoid "list index out of range" error with empty IMAGE_FSTYPES
114 | RAUC_IMAGE_FSTYPE ??= "${@(d.getVar('IMAGE_FSTYPES').split() + [""])[0]}"
115 | RAUC_IMAGE_FSTYPE[doc] = "Specifies the default file name extension to expect for collecting images. Defaults to first element set in IMAGE_FSTYPES."
116 |
117 | do_fetch[cleandirs] = "${S}"
118 | do_patch[noexec] = "1"
119 | do_compile[noexec] = "1"
120 | do_install[noexec] = "1"
121 | deltask do_populate_sysroot
122 |
123 | RAUC_BUNDLE_COMPATIBLE ??= "${MACHINE}${TARGET_VENDOR}"
124 | RAUC_BUNDLE_VERSION ??= "${PV}"
125 | RAUC_BUNDLE_DESCRIPTION ??= "${SUMMARY}"
126 | RAUC_BUNDLE_BUILD ??= "${DATETIME}"
127 | RAUC_BUNDLE_BUILD[vardepsexclude] = "DATETIME"
128 | RAUC_BUNDLE_COMPATIBLE[doc] = "Specifies the mandatory bundle compatible string. See RAUC documentation for more details."
129 | RAUC_BUNDLE_VERSION[doc] = "Specifies the bundle version string. See RAUC documentation for more details."
130 | RAUC_BUNDLE_DESCRIPTION[doc] = "Specifies the bundle description string. See RAUC documentation for more details."
131 | RAUC_BUNDLE_BUILD[doc] = "Specifies the bundle build stamp. See RAUC documentation for more details."
132 |
133 | RAUC_BUNDLE_SLOTS[doc] = "Space-separated list of slot classes to include in bundle (manifest)"
134 | RAUC_BUNDLE_HOOKS[doc] = "Allows to specify an additional hook executable and bundle hooks (via varflags '[file'] and ['hooks'])"
135 |
136 | RAUC_BUNDLE_EXTRA_FILES[doc] = "Specifies list of additional files to add to bundle. Files must either be located in UNPACKDIR (added by SRC_URI) or DEPLOY_DIR_IMAGE (assured by RAUC_BUNDLE_EXTRA_DEPENDS)"
137 | RAUC_BUNDLE_EXTRA_DEPENDS[doc] = "Specifies list of recipes that create files in DEPLOY_DIR_IMAGE. For recipes not depending on do_deploy task also :do_ notation is supported"
138 |
139 | RAUC_CASYNC_BUNDLE ??= "0"
140 |
141 | RAUC_BUNDLE_FORMAT ??= ""
142 | RAUC_BUNDLE_FORMAT[doc] = "Specifies the bundle format to be used (plain/verity)."
143 |
144 | RAUC_VARFLAGS_SLOTS = "name type fstype file hooks adaptive rename offset depends convert"
145 | RAUC_VARFLAGS_HOOKS = "file hooks"
146 |
147 | # Create dependency list from images
148 | python __anonymous() {
149 | d.appendVarFlag('do_unpack', 'vardeps', ' RAUC_BUNDLE_HOOKS')
150 | for slot in (d.getVar('RAUC_BUNDLE_SLOTS') or "").split():
151 | slot_varflags = d.getVar('RAUC_VARFLAGS_SLOTS').split()
152 | slotflags = d.getVarFlags('RAUC_SLOT_%s' % slot, expand=slot_varflags) or {}
153 |
154 | imgtype = slotflags.get('type')
155 | if not imgtype:
156 | bb.debug(1, "No [type] given for slot '%s', defaulting to 'image'" % slot)
157 | imgtype = 'image'
158 | image = d.getVar('RAUC_SLOT_%s' % slot)
159 |
160 | if not image:
161 | bb.error("No image set for slot '%s'. Specify via 'RAUC_SLOT_%s = \"\"'" % (slot, slot))
162 | return
163 |
164 | d.appendVarFlag('do_unpack', 'vardeps', ' RAUC_SLOT_%s' % slot)
165 | depends = slotflags.get('depends')
166 | if depends:
167 | d.appendVarFlag('do_unpack', 'depends', ' ' + depends)
168 | continue
169 |
170 | if imgtype == 'image':
171 | d.appendVarFlag('do_unpack', 'depends', ' ' + image + ':do_image_complete')
172 | d.appendVarFlag('do_rm_work_all', 'depends', ' ' + image + ':do_rm_work_all')
173 | else:
174 | d.appendVarFlag('do_unpack', 'depends', ' ' + image + ':do_deploy')
175 |
176 | for image in (d.getVar('RAUC_BUNDLE_EXTRA_DEPENDS') or "").split():
177 | imagewithdep = image.split(':')
178 | deptask = imagewithdep[1] if len(imagewithdep) > 1 else 'do_deploy'
179 | d.appendVarFlag('do_unpack', 'depends', ' %s:%s' % (imagewithdep[0], deptask))
180 | bb.note('adding extra dependency %s:%s' % (imagewithdep[0], deptask))
181 | }
182 |
183 | S = "${WORKDIR}/sources"
184 | UNPACKDIR = "${S}"
185 | B = "${WORKDIR}/build"
186 | BUNDLE_DIR = "${S}/bundle"
187 |
188 | RAUC_KEY_FILE ??= ""
189 | RAUC_KEY_FILE[doc] = "Specifies the path to the RAUC key file used for signing. Use COREBASE to reference files located in any shared BSP folder."
190 | RAUC_CERT_FILE ??= ""
191 | RAUC_CERT_FILE[doc] = "Specifies the path to the RAUC cert file used for signing. Use COREBASE to reference files located in any shared BSP folder."
192 | RAUC_KEYRING_FILE ??= ""
193 | RAUC_KEYRING_FILE[doc] = "Specifies the path to the RAUC keyring file used for bundle signature verification. Use COREBASE to reference files located in any shared BSP folder."
194 | BUNDLE_ARGS ??= ""
195 | BUNDLE_ARGS[doc] = "Specifies any extra arguments to pass to the rauc bundle command."
196 | CONVERT_ARGS ??= ""
197 | CONVERT_ARGS[doc] = "Specifies any extra arguments to pass to the rauc convert command."
198 |
199 |
200 | DEPENDS = "rauc-native squashfs-tools-native"
201 | DEPENDS += "${@bb.utils.contains('RAUC_CASYNC_BUNDLE', '1', 'virtual/fakeroot-native casync-native', '', d)}"
202 |
203 | inherit image-artifact-names
204 |
205 | def write_manifest(d):
206 | import shutil
207 | import subprocess
208 | from pathlib import PurePath
209 |
210 | machine = d.getVar('MACHINE')
211 | bundle_path = d.expand("${BUNDLE_DIR}")
212 |
213 | bb.utils.mkdirhier(bundle_path)
214 | try:
215 | manifest = open('%s/manifest.raucm' % bundle_path, 'w')
216 | except OSError:
217 | bb.fatal('Unable to open manifest.raucm')
218 |
219 | manifest.write('[update]\n')
220 | manifest.write(d.expand('compatible=${RAUC_BUNDLE_COMPATIBLE}\n'))
221 | manifest.write(d.expand('version=${RAUC_BUNDLE_VERSION}\n'))
222 | manifest.write(d.expand('description=${RAUC_BUNDLE_DESCRIPTION}\n'))
223 | manifest.write(d.expand('build=${RAUC_BUNDLE_BUILD}\n'))
224 | manifest.write('\n')
225 |
226 | bundle_format = d.getVar('RAUC_BUNDLE_FORMAT')
227 | if not bundle_format:
228 | bb.warn('No RAUC_BUNDLE_FORMAT set. This will default to using legacy \'plain\' format.'
229 | '\nIf you are unsure, set RAUC_BUNDLE_FORMAT = "verity" for new projects.'
230 | '\nRefer to https://rauc.readthedocs.io/en/latest/reference.html#sec-ref-formats for more information about RAUC bundle formats.')
231 | elif bundle_format != "plain":
232 | manifest.write('[bundle]\n')
233 | manifest.write(d.expand('format=${RAUC_BUNDLE_FORMAT}\n'))
234 | manifest.write('\n')
235 |
236 | hooks_varflags = d.getVar('RAUC_VARFLAGS_HOOKS').split()
237 | hooksflags = d.getVarFlags('RAUC_BUNDLE_HOOKS', expand=hooks_varflags) or {}
238 | have_hookfile = False
239 | if 'file' in hooksflags:
240 | have_hookfile = True
241 | manifest.write('[hooks]\n')
242 | manifest.write("filename=%s\n" % hooksflags.get('file'))
243 | if 'hooks' in hooksflags:
244 | manifest.write("hooks=%s\n" % hooksflags.get('hooks'))
245 | manifest.write('\n')
246 | elif 'hooks' in hooksflags:
247 | bb.warn("Suspicious use of RAUC_BUNDLE_HOOKS[hooks] without RAUC_BUNDLE_HOOKS[file]")
248 |
249 | for slot in (d.getVar('RAUC_BUNDLE_SLOTS') or "").split():
250 | slot_varflags = d.getVar('RAUC_VARFLAGS_SLOTS').split()
251 | slotflags = d.getVarFlags('RAUC_SLOT_%s' % slot, expand=slot_varflags) or {}
252 |
253 | slotname = slotflags.get('name', slot)
254 | manifest.write('[image.%s]\n' % slotname)
255 |
256 | imgtype = slotflags.get('type', 'image')
257 |
258 | img_fstype = slotflags.get('fstype', d.getVar('RAUC_IMAGE_FSTYPE'))
259 |
260 | if imgtype == 'image':
261 | fallback = "%s%s%s.%s" % (d.getVar('RAUC_SLOT_%s' % slot), d.getVar('IMAGE_MACHINE_SUFFIX'), d.getVar('IMAGE_NAME_SUFFIX'), img_fstype)
262 | imgname = imgsource = slotflags.get('file', fallback)
263 | elif imgtype == 'kernel':
264 | # TODO: Add image type support
265 | fallback = "%s-%s.bin" % ("zImage", machine)
266 | imgsource = slotflags.get('file', fallback)
267 | imgname = "%s.%s" % (imgsource, "img")
268 | elif imgtype == 'boot':
269 | imgname = imgsource = slotflags.get('file', 'barebox.img')
270 | elif imgtype == 'file':
271 | imgsource = slotflags.get('file')
272 | if not imgsource:
273 | bb.fatal('Image type "file" requires [file] varflag to be set for slot %s' % slot)
274 | imgname = "%s.%s" % (imgsource, "img")
275 | else:
276 | bb.fatal('Unknown image type: %s' % imgtype)
277 |
278 | imgname = slotflags.get('rename', imgname)
279 | if 'offset' in slotflags:
280 | padding = 'seek'
281 | imgoffset = slotflags.get('offset')
282 | if imgoffset:
283 | sign, magnitude = imgoffset[:1], imgoffset[1:]
284 | if sign == '+':
285 | padding = 'seek'
286 | imgoffset = magnitude
287 | elif sign == '-':
288 | padding = 'skip'
289 | imgoffset = magnitude
290 | if imgoffset == '':
291 | imgoffset = '0'
292 |
293 | # Keep only the image name in case the image is in a $DEPLOY_DIR_IMAGE subdirectory
294 | imgname = PurePath(imgname).name
295 | manifest.write("filename=%s\n" % imgname)
296 | if 'hooks' in slotflags:
297 | if not have_hookfile:
298 | bb.warn("A hook is defined for slot %s, but RAUC_BUNDLE_HOOKS[file] is not defined" % slot)
299 | manifest.write("hooks=%s\n" % slotflags.get('hooks'))
300 | if 'adaptive' in slotflags:
301 | manifest.write("adaptive=%s\n" % slotflags.get('adaptive'))
302 | if 'convert' in slotflags:
303 | manifest.write("convert=%s\n" % slotflags.get('convert'))
304 | manifest.write("\n")
305 |
306 | bundle_imgpath = "%s/%s" % (bundle_path, imgname)
307 | bb.note("adding image to bundle dir: '%s'" % imgname)
308 | searchpath = d.expand("${DEPLOY_DIR_IMAGE}/%s") % imgsource
309 | if os.path.isfile(searchpath):
310 | if imgtype == 'boot' and 'offset' in slotflags and imgoffset != '0':
311 | subprocess.call(['dd', 'if=%s' % searchpath,
312 | 'of=%s' % bundle_imgpath,
313 | 'iflag=skip_bytes', 'oflag=seek_bytes',
314 | '%s=%s' % (padding, imgoffset)])
315 | else:
316 | shutil.copy(searchpath, bundle_imgpath)
317 | else:
318 | searchpath = d.expand("${UNPACKDIR}/%s") % imgsource
319 | if os.path.isfile(searchpath):
320 | shutil.copy(searchpath, bundle_imgpath)
321 | else:
322 | raise bb.fatal('Failed to find source %s' % imgsource)
323 | if not os.path.exists(bundle_imgpath):
324 | raise bb.fatal("Failed adding image '%s' to bundle: not present in DEPLOY_DIR_IMAGE or UNPACKDIR" % imgsource)
325 |
326 | for meta_section in (d.getVar('RAUC_META_SECTIONS') or "").split():
327 | manifest.write("[meta.%s]\n" % meta_section)
328 | for meta_key in d.getVarFlags('RAUC_META_%s' % meta_section):
329 | meta_value = d.getVarFlag('RAUC_META_%s' % meta_section, meta_key)
330 | manifest.write("%s=%s\n" % (meta_key, meta_value))
331 | manifest.write("\n");
332 |
333 | manifest.write((d.getVar('RAUC_MANIFEST_EXTRA_LINES') or "").replace(r'\n', '\n'))
334 |
335 | manifest.close()
336 |
337 | def try_searchpath(file, d):
338 | searchpath = d.expand("${DEPLOY_DIR_IMAGE}/%s") % file
339 | if os.path.isfile(searchpath):
340 | bb.note("adding extra file from deploy dir to bundle dir: '%s'" % file)
341 | return searchpath
342 | elif os.path.isdir(searchpath):
343 | bb.note("adding extra directory from deploy dir to bundle dir: '%s'" % file)
344 | return searchpath
345 |
346 | searchpath = d.expand("${UNPACKDIR}/%s") % file
347 | if os.path.isfile(searchpath):
348 | bb.note("adding extra file from workdir to bundle dir: '%s'" % file)
349 | return searchpath
350 | elif os.path.isdir(searchpath):
351 | bb.note("adding extra directory from workdir to bundle dir: '%s'" % file)
352 | return searchpath
353 |
354 | return None
355 |
356 | python do_configure() {
357 | import shutil
358 | import os
359 | import stat
360 | import subprocess
361 |
362 | write_manifest(d)
363 |
364 | hooks_varflags = d.getVar('RAUC_VARFLAGS_HOOKS').split()
365 | hooksflags = d.getVarFlags('RAUC_BUNDLE_HOOKS', expand=hooks_varflags) or {}
366 | if 'file' in hooksflags:
367 | hf = hooksflags.get('file')
368 | if not os.path.exists(d.expand("${UNPACKDIR}/%s" % hf)):
369 | bb.error("hook file '%s' does not exist in UNPACKDIR" % hf)
370 | return
371 | dsthook = d.expand("${BUNDLE_DIR}/%s" % hf)
372 | bb.note("adding hook file to bundle dir: '%s'" % hf)
373 | shutil.copy(d.expand("${UNPACKDIR}/%s" % hf), dsthook)
374 | st = os.stat(dsthook)
375 | os.chmod(dsthook, st.st_mode | stat.S_IEXEC)
376 |
377 | for file in (d.getVar('RAUC_BUNDLE_EXTRA_FILES') or "").split():
378 | bundledir = d.getVar('BUNDLE_DIR')
379 | destpath = d.expand("${BUNDLE_DIR}/%s") % file
380 |
381 | searchpath = try_searchpath(file, d)
382 | if not searchpath:
383 | bb.error("extra file '%s' neither found in workdir nor in deploy dir!" % file)
384 |
385 | destdir = '.'
386 | # strip leading and trailing slashes to prevent installting into wrong location
387 | file = file.rstrip('/').lstrip('/')
388 |
389 | if file.find("/") != -1:
390 | destdir = file.rsplit("/", 1)[0] + '/'
391 | bb.utils.mkdirhier("%s/%s" % (bundledir, destdir))
392 | bb.note("Unpacking %s to %s/" % (file, bundledir))
393 | ret = subprocess.call('cp -fpPRH "%s" "%s"' % (searchpath, destdir), shell=True, cwd=bundledir)
394 | }
395 |
396 | do_configure[cleandirs] = "${BUNDLE_DIR}"
397 |
398 | BUNDLE_BASENAME ??= "${PN}"
399 | BUNDLE_BASENAME[doc] = "Specifies desired output base name of generated RAUC bundle."
400 | BUNDLE_NAME ??= "${BUNDLE_BASENAME}-${MACHINE}-${DATETIME}"
401 | BUNDLE_NAME[doc] = "Specifies desired full output name of generated RAUC bundle."
402 | # Don't include the DATETIME variable in the sstate package sigantures
403 | BUNDLE_NAME[vardepsexclude] = "DATETIME"
404 | BUNDLE_LINK_NAME ??= "${BUNDLE_BASENAME}-${MACHINE}"
405 | BUNDLE_EXTENSION ??= ".raucb"
406 | BUNDLE_EXTENSION[doc] = "Specifies desired custom filename extension of generated RAUC bundle."
407 |
408 | CASYNC_BUNDLE_BASENAME ??= "casync-${BUNDLE_BASENAME}"
409 | CASYNC_BUNDLE_BASENAME[doc] = "Specifies desired output base name of generated RAUC casync bundle."
410 | CASYNC_BUNDLE_NAME ??= "${CASYNC_BUNDLE_BASENAME}-${MACHINE}-${DATETIME}"
411 | CASYNC_BUNDLE_NAME[doc] = "Specifies desired full output name of generated RAUC casync bundle."
412 | # Don't include the DATETIME variable in the sstate package sigantures
413 | CASYNC_BUNDLE_NAME[vardepsexclude] = "DATETIME"
414 | CASYNC_BUNDLE_LINK_NAME ??= "${CASYNC_BUNDLE_BASENAME}-${MACHINE}"
415 | CASYNC_BUNDLE_EXTENSION ??= "${BUNDLE_EXTENSION}"
416 | CASYNC_BUNDLE_EXTENSION[doc] = "Specifies desired custom filename extension of generated RAUC casync bundle."
417 |
418 | fakeroot do_bundle() {
419 | if [ -z "${RAUC_KEY_FILE}" ]; then
420 | bbfatal "'RAUC_KEY_FILE' not set. Please set to a valid key file location."
421 | fi
422 |
423 | if [ -z "${RAUC_CERT_FILE}" ]; then
424 | bbfatal "'RAUC_CERT_FILE' not set. Please set to a valid certificate file location."
425 | fi
426 |
427 | ${STAGING_BINDIR_NATIVE}/rauc bundle \
428 | --debug \
429 | --cert="${RAUC_CERT_FILE}" \
430 | --key="${RAUC_KEY_FILE}" \
431 | ${BUNDLE_ARGS} \
432 | ${BUNDLE_DIR} \
433 | ${B}/bundle.raucb
434 |
435 | if [ ${RAUC_CASYNC_BUNDLE} -eq 1 ]; then
436 | if [ -z "${RAUC_KEYRING_FILE}" ]; then
437 | bbfatal "'RAUC_KEYRING_FILE' not set. Please set a valid keyring file location."
438 | fi
439 |
440 | ${STAGING_BINDIR_NATIVE}/rauc convert \
441 | --debug \
442 | --trust-environment \
443 | --cert=${RAUC_CERT_FILE} \
444 | --key=${RAUC_KEY_FILE} \
445 | --keyring=${RAUC_KEYRING_FILE} \
446 | ${CONVERT_ARGS} \
447 | ${B}/bundle.raucb \
448 | ${B}/casync-bundle.raucb
449 | fi
450 | }
451 | do_bundle[dirs] = "${B}"
452 | do_bundle[cleandirs] = "${B}"
453 | do_bundle[file-checksums] += "${RAUC_CERT_FILE}:False ${RAUC_KEY_FILE}:False"
454 |
455 | addtask bundle after do_configure
456 |
457 | inherit deploy
458 |
459 | SSTATE_SKIP_CREATION:task-deploy = '1'
460 |
461 | do_deploy() {
462 | install -d ${DEPLOYDIR}
463 | install -m 0644 ${B}/bundle.raucb ${DEPLOYDIR}/${BUNDLE_NAME}${BUNDLE_EXTENSION}
464 | ln -sf ${BUNDLE_NAME}${BUNDLE_EXTENSION} ${DEPLOYDIR}/${BUNDLE_LINK_NAME}${BUNDLE_EXTENSION}
465 |
466 | if [ ${RAUC_CASYNC_BUNDLE} -eq 1 ]; then
467 | install -m 0644 ${B}/casync-bundle.raucb ${DEPLOYDIR}/${CASYNC_BUNDLE_NAME}${CASYNC_BUNDLE_EXTENSION}
468 | cp -r ${B}/casync-bundle.castr ${DEPLOYDIR}/${CASYNC_BUNDLE_NAME}.castr
469 | ln -sf ${CASYNC_BUNDLE_NAME}${CASYNC_BUNDLE_EXTENSION} ${DEPLOYDIR}/${CASYNC_BUNDLE_LINK_NAME}${CASYNC_BUNDLE_EXTENSION}
470 | ln -sf ${CASYNC_BUNDLE_NAME}.castr ${DEPLOYDIR}/${CASYNC_BUNDLE_LINK_NAME}.castr
471 | fi
472 | }
473 |
474 | addtask deploy after do_bundle before do_build
475 |
--------------------------------------------------------------------------------
/conf/layer.conf:
--------------------------------------------------------------------------------
1 | # We have a conf and classes directory, add to BBPATH
2 | BBPATH .= ":${LAYERDIR}"
3 |
4 | # We have recipes-* directories, add to BBFILES
5 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
6 | ${LAYERDIR}/recipes-*/*/*.bbappend"
7 |
8 | BBFILE_COLLECTIONS += "rauc"
9 | BBFILE_PATTERN_rauc = "^${LAYERDIR}/"
10 | BBFILE_PRIORITY_rauc = "6"
11 |
12 | LAYERDEPENDS_rauc = "core"
13 |
14 | # meta-python is needed to build/run hawkbit-client
15 | LAYERRECOMMENDS_rauc = "meta-python"
16 |
17 | # meta-filesystems is needed to build cascync with fuse support (the default)
18 | LAYERRECOMMENDS_rauc += "meta-filesystems"
19 |
20 | LAYERSERIES_COMPAT_rauc = "styhead walnascar"
21 |
22 | # Sanity check for meta-rauc layer.
23 | # Setting SKIP_META_RAUC_FEATURE_CHECK to "1" would skip the bbappend files check.
24 | INHERIT += "sanity-meta-rauc"
25 |
--------------------------------------------------------------------------------
/recipes-bsp/dt-utils/dt-utils.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rauc/meta-rauc/407903bebdf11ec6ddf53b7088f92ea835f9f595/recipes-bsp/dt-utils/dt-utils.inc
--------------------------------------------------------------------------------
/recipes-bsp/dt-utils/dt-utils_2023.11.0.bb:
--------------------------------------------------------------------------------
1 | DESCRIPTION = "device-tree and barebox-related tools"
2 | HOMEPAGE = "http://git.pengutronix.de/?p=tools/dt-utils.git"
3 | SECTION = "base"
4 | LICENSE = "GPL-2.0-only"
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=18d902a0242c37a4604224b47d02f802"
6 | DEPENDS = "udev"
7 |
8 | SRC_URI = "http://www.pengutronix.de/software/dt-utils/download/${BPN}-${PV}.tar.xz"
9 | SRC_URI[sha256sum] = "d224d941c076c143f43d59cd7c6e1c522926064a31ac34a67720632ddecb6b53"
10 |
11 | inherit autotools pkgconfig gettext
12 |
13 | NOAUTOPACKAGEDEBUG = "1"
14 |
15 | FILES:${PN}-dbg = "${libdir}/.debug/"
16 |
17 | PACKAGES =+ "${PN}-barebox-state ${PN}-barebox-state-dbg"
18 | FILES:${PN}-barebox-state = "${bindir}/barebox-state"
19 | FILES:${PN}-barebox-state-dbg = "${bindir}/.debug/barebox-state"
20 |
21 | PACKAGES =+ "${PN}-fdtdump ${PN}-fdtdump-dbg"
22 | FILES:${PN}-fdtdump = "${bindir}/fdtdump"
23 | FILES:${PN}-fdtdump-dbg = "${bindir}/.debug/fdtdump"
24 |
25 | PACKAGES =+ "${PN}-dtblint ${PN}-dtblint-dbg"
26 | FILES:${PN}-dtblint = "${bindir}/dtblint"
27 | FILES:${PN}-dtblint-dbg = "${bindir}/.debug/dtblint"
28 |
--------------------------------------------------------------------------------
/recipes-casync/casync/casync_git.bb:
--------------------------------------------------------------------------------
1 | SUMMARY = "Content-Addressable Data Synchronization Tool"
2 | HOMEPAGE = "https://github.com/systemd/casync"
3 | LICENSE = "LGPL-2.1-or-later"
4 | LIC_FILES_CHKSUM = "file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c"
5 |
6 | DEPENDS = "xz curl openssl acl zstd"
7 |
8 | SRCREV = "0efa7abffe5fffbde8c457d3c8fafbdde0bb6e4f"
9 | PV = "2+git${SRCPV}"
10 |
11 | SRC_URI = " \
12 | git://github.com/systemd/casync.git;protocol=https;branch=main \
13 | "
14 |
15 | S = "${WORKDIR}/git"
16 |
17 | inherit meson pkgconfig
18 |
19 | EXTRA_OEMESON += "-Dselinux=false -Dman=false -Dudevrulesdir=${nonarch_base_libdir}/udev/rules.d/"
20 |
21 | BBCLASSEXTEND = "native nativesdk"
22 |
23 | PACKAGECONFIG:class-native = ""
24 | PACKAGECONFIG:class-nativesdk = ""
25 | PACKAGECONFIG ?= "fuse udev"
26 |
27 | PACKAGECONFIG[fuse] = "-Dfuse=true,-Dfuse=false,fuse"
28 | PACKAGECONFIG[udev] = "-Dudev=true,-Dudev=false,udev"
29 |
30 | FILES:${PN} += "${datadir}/bash-completion"
31 |
--------------------------------------------------------------------------------
/recipes-core/bundles/core-bundle-minimal.bb:
--------------------------------------------------------------------------------
1 | # A minimal demo bundle
2 | #
3 | # Note: The created bundle will not contain RAUC itself yet!
4 | # To add this, properly configure it for your specific system and add it to
5 | # your image recipe you intend to build a bundle from:
6 | #
7 | # IMAGE_INSTALL:append = " rauc"
8 | #
9 | # Also note that you need to configure RAUC_KEY_FILE and RAUC_CERT_FILE to
10 | # point to contain the full path to your key and cert.
11 | # Depending on you requirements you can either set them via global
12 | # configuration or from a bundle recipe bbappend.
13 | #
14 | # For testing purpose, you may use the scripts/openssl-ca.sh to create some.
15 |
16 | inherit bundle
17 |
18 | RAUC_BUNDLE_FORMAT = "verity"
19 |
20 | RAUC_BUNDLE_COMPATIBLE ?= "Demo Board"
21 |
22 | RAUC_BUNDLE_SLOTS ?= "rootfs"
23 |
24 | RAUC_SLOT_rootfs ?= "core-image-minimal"
25 |
--------------------------------------------------------------------------------
/recipes-core/busybox/busybox_%.bbappend:
--------------------------------------------------------------------------------
1 | require ${@bb.utils.contains('DISTRO_FEATURES', 'rauc', '${BPN}_rauc.inc', '', d)}
2 |
--------------------------------------------------------------------------------
/recipes-core/busybox/busybox_rauc.inc:
--------------------------------------------------------------------------------
1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
2 |
3 | SRC_URI += "file://rauc.cfg"
4 |
--------------------------------------------------------------------------------
/recipes-core/busybox/files/rauc.cfg:
--------------------------------------------------------------------------------
1 | CONFIG_FEATURE_TAR_LONG_OPTIONS=y
2 | CONFIG_FEATURE_TAR_AUTODETECT=y
3 |
--------------------------------------------------------------------------------
/recipes-core/packagegroups/packagegroup-base.bbappend:
--------------------------------------------------------------------------------
1 | require ${@bb.utils.contains('DISTRO_FEATURES', 'rauc', '${BPN}_rauc.inc', '', d)}
2 |
--------------------------------------------------------------------------------
/recipes-core/packagegroups/packagegroup-base_rauc.inc:
--------------------------------------------------------------------------------
1 | PACKAGES += "packagegroup-base-rauc"
2 | RDEPENDS:packagegroup-base += "packagegroup-base-rauc"
3 |
4 | SUMMARY:packagegroup-base-rauc = "RAUC update framework support"
5 | RDEPENDS:packagegroup-base-rauc = "\
6 | rauc"
7 |
--------------------------------------------------------------------------------
/recipes-core/rauc/files/ca.cert.pem:
--------------------------------------------------------------------------------
1 | # This is a dummy keyring file. Please overwrite this with one that matches
2 | # your X509 infrastructure if you intend to use RAUC for secure updates!
3 | #
4 | # If you really do not intend to actively use the security features or for
5 | # testing you may create a self-signed development certificate by executing the
6 | # script `openssl-ca.sh` from the `scripts` folder.
7 |
--------------------------------------------------------------------------------
/recipes-core/rauc/files/rauc-mark-good.init:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | ### BEGIN INIT INFO
3 | # Provides: rauc-mark-good
4 | # Required-Start:
5 | # Required-Stop:
6 | # Default-Start: 2 3 4 5
7 | # Default-Stop: 0 1 6
8 | # Short-Description: Rauc Good-marking Service
9 | ### END INIT INFO
10 | # Author:
11 |
12 | # Aktionen
13 | case "$1" in
14 | start)
15 | rauc status mark-good
16 | ;;
17 | stop)
18 | ;;
19 | restart)
20 | ;;
21 | esac
22 |
23 | exit 0
24 |
--------------------------------------------------------------------------------
/recipes-core/rauc/files/rauc-mark-good.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=RAUC Good-marking Service
3 | ConditionKernelCommandLine=|bootchooser.active
4 | ConditionKernelCommandLine=|rauc.slot
5 | After=boot-complete.target
6 | Requires=boot-complete.target
7 | DefaultDependencies=no
8 |
9 | [Service]
10 | Type=oneshot
11 | RemainAfterExit=yes
12 | ExecStart=@BINDIR@/rauc status mark-good
13 |
14 | [Install]
15 | WantedBy=multi-user.target
16 |
--------------------------------------------------------------------------------
/recipes-core/rauc/files/system.conf:
--------------------------------------------------------------------------------
1 | ## This is an example RAUC system configuration. This file will be installed
2 | ## into /etc/rauc/system.conf on your target and describes your system from the
3 | ## perspective of the RAUC update service.
4 | ##
5 | ## Adapt and extend the below configuration to your needs and place it in the
6 | ## BSP layer of you project. Create a rauc .bbappend file that adds this file
7 | ## to your build:
8 | ##
9 | ## FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
10 | ##
11 | ## ---
12 | ##
13 | # [system]
14 | # compatible=My Example System
15 | # bootloader=
16 | # bundle-formats=-plain
17 | #
18 | # [slot.rootfs.0]
19 | # device=/dev/mmcblkXp1
20 | # type=ext4
21 | # bootname=system0
22 | #
23 | # [slot.rootfs.1]
24 | # device=/dev/mmcblkXp2
25 | # type=ext4
26 | # bootname=system1
27 | #
28 | # [slot.appfs.0]
29 | # device=/dev/mmcblkXp3
30 | # type=ext4
31 | # parent=rootfs.0
32 | #
33 | # [slot.appfs.1]
34 | # device=/dev/mmcblkXp4
35 | # type=ext4
36 | # parent=rootfs.1
37 |
--------------------------------------------------------------------------------
/recipes-core/rauc/nativesdk-rauc.inc:
--------------------------------------------------------------------------------
1 | do_install:append() {
2 | rm -rf ${D}${datadir}
3 | }
4 |
5 | inherit nativesdk
6 |
--------------------------------------------------------------------------------
/recipes-core/rauc/nativesdk-rauc_1.14.bb:
--------------------------------------------------------------------------------
1 | require rauc.inc
2 | require rauc-1.14.inc
3 | require nativesdk-rauc.inc
4 |
--------------------------------------------------------------------------------
/recipes-core/rauc/nativesdk-rauc_git.bb:
--------------------------------------------------------------------------------
1 | require rauc.inc
2 | require rauc-git.inc
3 | require nativesdk-rauc.inc
4 |
--------------------------------------------------------------------------------
/recipes-core/rauc/rauc-1.14.inc:
--------------------------------------------------------------------------------
1 | SRC_URI = "https://github.com/rauc/rauc/releases/download/v${PV}/rauc-${PV}.tar.xz"
2 |
3 | SRC_URI[sha256sum] = "f48c85573d82bf9378e907f6eba0cbe4f2021839a1e9fe3f8431f61dd54ef42c"
4 |
5 | UPSTREAM_CHECK_URI = "https://github.com/${BPN}/${BPN}/releases"
6 |
--------------------------------------------------------------------------------
/recipes-core/rauc/rauc-conf.bb:
--------------------------------------------------------------------------------
1 | SUMMARY = "RAUC system configuration & verification keyring"
2 | LICENSE = "MIT"
3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4 |
5 | RAUC_KEYRING_FILE ??= "ca.cert.pem"
6 | RAUC_KEYRING_URI ??= "file://${RAUC_KEYRING_FILE}"
7 |
8 | RPROVIDES:${PN} += "virtual-rauc-conf"
9 |
10 | INHIBIT_DEFAULT_DEPS = "1"
11 | do_compile[noexec] = "1"
12 |
13 | SRC_URI = " \
14 | file://system.conf \
15 | ${RAUC_KEYRING_URI} \
16 | "
17 |
18 | S = "${WORKDIR}/sources"
19 | UNPACKDIR = "${S}"
20 |
21 | do_install () {
22 | # Create rauc config dir
23 | # Warn if system configuration was not overwritten
24 | if ! grep -q "^[^#]" ${UNPACKDIR}/system.conf; then
25 | bbwarn "Please overwrite example system.conf with a project specific one!"
26 | fi
27 | install -d ${D}${sysconfdir}/rauc
28 | install -m 0644 ${UNPACKDIR}/system.conf ${D}${sysconfdir}/rauc/
29 |
30 | # Warn if CA file was not overwritten
31 | if ! grep -q "^[^#]" ${UNPACKDIR}/${RAUC_KEYRING_FILE}; then
32 | bbwarn "Please overwrite example ca.cert.pem with a project specific one, or set the RAUC_KEYRING_FILE variable with your file!"
33 | fi
34 | install -d ${D}${sysconfdir}/rauc
35 | install -m 0644 ${UNPACKDIR}/${RAUC_KEYRING_FILE} ${D}${sysconfdir}/rauc/
36 | }
37 |
--------------------------------------------------------------------------------
/recipes-core/rauc/rauc-git.inc:
--------------------------------------------------------------------------------
1 | SRC_URI = " \
2 | git://github.com/rauc/rauc.git;protocol=https;branch=master \
3 | "
4 |
5 | PV = "1.14+git${SRCPV}"
6 | S = "${WORKDIR}/git"
7 |
8 | SRCREV = "2c455f87b96400779b77a3f87ac3d655a4c80bcf"
9 |
10 | RAUC_USE_DEVEL_VERSION[doc] = "Global switch to enable RAUC development (git) version."
11 | RAUC_USE_DEVEL_VERSION ??= "-1"
12 | DEFAULT_PREFERENCE ??= "${RAUC_USE_DEVEL_VERSION}"
13 |
--------------------------------------------------------------------------------
/recipes-core/rauc/rauc-native.inc:
--------------------------------------------------------------------------------
1 | inherit native
2 |
3 | DEPENDS = "openssl-native glib-2.0-native"
4 | RRECOMMENDS:${PN} = "squashfs-tools-native"
5 |
--------------------------------------------------------------------------------
/recipes-core/rauc/rauc-native_1.14.bb:
--------------------------------------------------------------------------------
1 | require rauc.inc
2 | require rauc-native.inc
3 | require rauc-1.14.inc
4 |
--------------------------------------------------------------------------------
/recipes-core/rauc/rauc-native_git.bb:
--------------------------------------------------------------------------------
1 | require rauc.inc
2 | require rauc-native.inc
3 | require rauc-git.inc
4 |
--------------------------------------------------------------------------------
/recipes-core/rauc/rauc-target.inc:
--------------------------------------------------------------------------------
1 | RRECOMMENDS:${PN} += "virtual-rauc-conf"
2 | RRECOMMENDS:${PN} += "squashfs-tools"
3 |
4 | SRC_URI:append = " \
5 | file://rauc-mark-good.service \
6 | file://rauc-mark-good.init \
7 | "
8 |
9 | SYSTEMD_PACKAGES += "${PN}-mark-good"
10 | SYSTEMD_SERVICE:${PN}-mark-good = "rauc-mark-good.service"
11 |
12 | INITSCRIPT_PACKAGES = "${PN}-mark-good"
13 | INITSCRIPT_NAME:${PN}-mark-good = "rauc-mark-good"
14 | INITSCRIPT_PARAMS:${PN}-mark-good = "start 99 5 2 . stop 20 0 1 6 ."
15 |
16 | inherit systemd update-rc.d
17 |
18 | do_install () {
19 | meson_do_install
20 |
21 | install -d ${D}${systemd_unitdir}/system/
22 | install -m 0644 ${UNPACKDIR}/rauc-mark-good.service ${D}${systemd_unitdir}/system/
23 | sed -i -e 's!@BINDIR@!${bindir}!g' ${D}${systemd_unitdir}/system/*.service
24 |
25 | install -d "${D}${sysconfdir}/init.d"
26 | install -m 755 "${UNPACKDIR}/rauc-mark-good.init" "${D}${sysconfdir}/init.d/rauc-mark-good"
27 | }
28 |
29 | PACKAGES =+ "${PN}-mark-good"
30 |
31 | # some magic to get the tool to interact with bootloader storage
32 | python __anonymous () {
33 | bootloader = d.getVar("PREFERRED_PROVIDER_virtual/bootloader")
34 |
35 | if not bootloader:
36 | return
37 |
38 | if "barebox" in bootloader:
39 | boothelper = " dt-utils-barebox-state"
40 | elif "u-boot" in bootloader:
41 | boothelper = " u-boot-fw-utils"
42 | elif "grub" in bootloader:
43 | boothelper = " grub-editenv"
44 | else:
45 | return
46 |
47 | d.appendVar("RDEPENDS:%s" % d.getVar('PN'), boothelper)
48 | }
49 |
50 | RRECOMMENDS:${PN}:append = " ${PN}-mark-good"
51 |
52 | FILES:${PN}-mark-good = "${systemd_unitdir}/system/rauc-mark-good.service ${sysconfdir}/init.d/rauc-mark-good"
53 |
54 | PACKAGES =+ "${PN}-service"
55 | SYSTEMD_SERVICE:${PN}-service = "${@bb.utils.contains('PACKAGECONFIG', 'service', 'rauc.service', '', d)}"
56 | SYSTEMD_PACKAGES += "${PN}-service"
57 | RDEPENDS:${PN}-service += "dbus"
58 |
59 | FILES:${PN}-service = "\
60 | ${systemd_unitdir}/system/rauc.service \
61 | ${datadir}/dbus-1/system.d/de.pengutronix.rauc.conf \
62 | ${datadir}/dbus-1/system-services/de.pengutronix.rauc.service \
63 | ${nonarch_libdir}/systemd/catalog \
64 | "
65 |
66 | PACKAGECONFIG ??= "service network streaming json nocreate gpt"
67 |
--------------------------------------------------------------------------------
/recipes-core/rauc/rauc.inc:
--------------------------------------------------------------------------------
1 | DESCRIPTION = "RAUC update controller for host and target"
2 | HOMEPAGE = "https://github.com/rauc/rauc"
3 | LICENSE = "LGPL-2.1-or-later"
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
5 | DEPENDS = "openssl glib-2.0 glib-2.0-native"
6 |
7 | inherit meson pkgconfig gettext
8 |
9 | EXTRA_OEMESON += "\
10 | -Dtests=false \
11 | -Dsystemdunitdir=${systemd_system_unitdir} \
12 | -Ddbuspolicydir=${datadir}/dbus-1/system.d \
13 | -Ddbussystemservicedir=${datadir}/dbus-1/system-services \
14 | -Ddbusinterfacesdir=${datadir}/dbus-1/interfaces \
15 | "
16 |
17 | PACKAGECONFIG[nocreate] = "-Dcreate=false,-Dcreate=true,"
18 | PACKAGECONFIG[service] = "-Dservice=true,-Dservice=false,dbus,${PN}-service"
19 | PACKAGECONFIG[streaming] = "-Dstreaming=true,-Dstreaming=false,libnl"
20 | PACKAGECONFIG[network] = "-Dnetwork=true,-Dnetwork=false,curl"
21 | PACKAGECONFIG[json] = "-Djson=enabled,-Djson=disabled,json-glib"
22 | PACKAGECONFIG[gpt] = "-Dgpt=enabled,-Dgpt=disabled,util-linux"
23 | PACKAGECONFIG[composefs] = "-Dcomposefs=enabled,-Dcomposefs=disabled,composefs"
24 |
25 | FILES:${PN}-dev += "\
26 | ${datadir}/dbus-1/interfaces/de.pengutronix.rauc.Installer.xml \
27 | "
28 |
--------------------------------------------------------------------------------
/recipes-core/rauc/rauc_1.14.bb:
--------------------------------------------------------------------------------
1 | require rauc.inc
2 | require rauc-target.inc
3 | require rauc-1.14.inc
4 |
--------------------------------------------------------------------------------
/recipes-core/rauc/rauc_git.bb:
--------------------------------------------------------------------------------
1 | require rauc.inc
2 | require rauc-target.inc
3 | require rauc-git.inc
4 |
--------------------------------------------------------------------------------
/recipes-devtools/python-gbulb/python3-gbulb_0.6.3.bb:
--------------------------------------------------------------------------------
1 | SUMMARY = "GLib implementation of PEP 3156"
2 | HOMEPAGE = "http://github.com/beeware/gbulb"
3 | LICENSE = "Apache-2.0"
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=edfe3d91d4b439ac8a8c23cebbf00501"
5 |
6 | SRC_URI[sha256sum] = "da003c5b17d3a2ba15c7255bb174defaa0f6b77e8b23f229685eb2714ceaeeec"
7 |
8 | PYPI_PACKAGE = "gbulb"
9 |
10 | # python3-misc is needed for the signal module
11 | RDEPENDS:${PN} = "python3-pygobject python3-asyncio python3-misc"
12 |
13 | inherit pypi setuptools3
14 |
--------------------------------------------------------------------------------
/recipes-kernel/linux/linux-yocto/rauc.cfg:
--------------------------------------------------------------------------------
1 | CONFIG_BLK_DEV_LOOP=y
2 | CONFIG_SQUASHFS=y
3 | CONFIG_MD=y
4 | CONFIG_BLK_DEV_DM=y
5 | CONFIG_BLK_DEV_NBD=y
6 | CONFIG_DM_VERITY=y
7 | CONFIG_CRYPTO_SHA256=y
8 |
--------------------------------------------------------------------------------
/recipes-kernel/linux/linux-yocto_%.bbappend:
--------------------------------------------------------------------------------
1 | require ${@bb.utils.contains('DISTRO_FEATURES', 'rauc', '${BPN}_rauc.inc', '', d)}
2 |
--------------------------------------------------------------------------------
/recipes-kernel/linux/linux-yocto_rauc.inc:
--------------------------------------------------------------------------------
1 | FILESEXTRAPATHS:prepend := "${THISDIR}/linux-yocto:"
2 |
3 | SRC_URI += "file://rauc.cfg"
4 |
--------------------------------------------------------------------------------
/recipes-support/curl/curl_%.bbappend:
--------------------------------------------------------------------------------
1 | require ${@bb.utils.contains('DISTRO_FEATURES', 'rauc', '${BPN}_rauc.inc', '', d)}
2 |
--------------------------------------------------------------------------------
/recipes-support/curl/curl_rauc.inc:
--------------------------------------------------------------------------------
1 | # HTTP/2 allows having multiple parallel (range-) requests in flight on the
2 | # same connection without requiring multiple TCP and TLS handshakes.
3 | # This speeds up adaptive updates a lot, since they work by making many
4 | # range-requests for parts of the update bundle.
5 | PACKAGECONFIG:append:class-target = " nghttp2"
6 |
--------------------------------------------------------------------------------
/recipes-support/rauc-hawkbit-updater/rauc-hawkbit-updater.inc:
--------------------------------------------------------------------------------
1 | SUMMARY = "The RAUC hawkBit updater operates as an interface between the RAUC D-Bus API and the hawkBit DDI API."
2 | HOMEPAGE = "https://github.com/rauc/rauc-hawkbit-updater"
3 |
4 | LICENSE = "LGPL-2.1-only"
5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=1a6d268fd218675ffea8be556788b780"
6 |
7 | inherit meson pkgconfig systemd useradd
8 |
9 | SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'rauc-hawkbit-updater.service', '', d)}"
10 |
11 | PACKAGECONFIG ??= " \
12 | ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
13 | "
14 | PACKAGECONFIG[systemd] = "-Dsystemd=enabled,-Dsystemd=disabled,systemd"
15 |
16 | USERADD_PACKAGES = "${PN}"
17 | USERADD_PARAM:${PN} = "--system --home-dir / --no-create-home --shell /bin/false rauc-hawkbit"
18 |
19 | DEPENDS = "curl glib-2.0-native json-glib"
20 |
21 | do_install:append () {
22 | install -d ${D}${sysconfdir}/${PN}
23 | install -m 644 ${S}/config.conf.example ${D}${sysconfdir}/${PN}/config.conf
24 | }
25 |
26 |
--------------------------------------------------------------------------------
/recipes-support/rauc-hawkbit-updater/rauc-hawkbit-updater_1.3.bb:
--------------------------------------------------------------------------------
1 | include rauc-hawkbit-updater.inc
2 |
3 | SRC_URI = "https://github.com/rauc/${BPN}/releases/download/v${PV}/${BPN}-${PV}.tar.xz"
4 | SRC_URI[sha256sum] = "42318e96a464e6c716edb45c48bd3ec3b874462973db902fbe099a395e4acb4b"
5 |
--------------------------------------------------------------------------------
/recipes-support/rauc-hawkbit-updater/rauc-hawkbit-updater_git.bb:
--------------------------------------------------------------------------------
1 | include rauc-hawkbit-updater.inc
2 |
3 | SRC_URI = "git://github.com/rauc/rauc-hawkbit-updater.git;protocol=https;branch=master"
4 | SRCREV = "e19bc259a615ea31584c4056f365db46237d70f9"
5 | S = "${WORKDIR}/git"
6 | PV = "1.3+git${SRCPV}"
7 |
8 | DEFAULT_PREFERENCE = "-1"
9 |
--------------------------------------------------------------------------------
/recipes-support/rauc-hawkbit/files/rauc-hawkbit.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=rauc-hawkbit client service
3 | Requires=rauc.service
4 |
5 | [Service]
6 | ExecStart=@BINDIR@/rauc-hawkbit-client -c @SYSCONFDIR@/rauc-hawkbit/config.cfg
7 |
8 | [Install]
9 | WantedBy=multi-user.target
10 |
--------------------------------------------------------------------------------
/recipes-support/rauc-hawkbit/rauc-hawkbit_git.bb:
--------------------------------------------------------------------------------
1 | LICENSE = "LGPL-2.1-or-later"
2 | LIC_FILES_CHKSUM = " \
3 | file://COPYING;md5=4fbd65380cdd255951079008b364516c \
4 | file://README.rst;beginline=114;endline=132;md5=aff2a45fabc5c8d959b72f97ffc77465 \
5 | "
6 |
7 | SUMMARY = "hawkBit client for RAUC"
8 |
9 | DEPENDS = "python3-setuptools-scm-native"
10 |
11 | SRC_URI = " \
12 | git://github.com/rauc/rauc-hawkbit.git;protocol=https;branch=master \
13 | file://rauc-hawkbit.service \
14 | "
15 |
16 | PV = "0.2.0+git${SRCPV}"
17 | SRCREV = "47bebb4a011768817f13f7796ec1b4e67edaffc5"
18 |
19 | S = "${WORKDIR}/git"
20 |
21 | inherit setuptools3 systemd
22 |
23 | PACKAGES =+ "${PN}-service"
24 | SYSTEMD_SERVICE:${PN}-service = "rauc-hawkbit.service"
25 | SYSTEMD_PACKAGES = "${PN}-service"
26 |
27 | do_install:append() {
28 | install -d ${D}${sysconfdir}/${BPN}/
29 | install -m 0644 ${S}/rauc_hawkbit/config.cfg ${D}${sysconfdir}/${BPN}/config.cfg
30 | install -d ${D}${systemd_unitdir}/system/
31 | install -m 0644 ${UNPACKDIR}/rauc-hawkbit.service ${D}${systemd_unitdir}/system/
32 | sed -i -e 's!@BINDIR@!${bindir}!g' -e 's!@SYSCONFDIR@!${sysconfdir}!g' \
33 | ${D}${systemd_unitdir}/system/rauc-hawkbit.service
34 | }
35 |
36 | RDEPENDS:${PN} += "python3-aiohttp python3-gbulb"
37 | FILES:${PN}-service = " \
38 | ${bindir}/rauc-hawkbit-client \
39 | ${sysconfdir}/${BPN}/config.cfg \
40 | ${systemd_unitdir}/system/rauc-hawkbit.service \
41 | "
42 |
--------------------------------------------------------------------------------
/scripts/README:
--------------------------------------------------------------------------------
1 | Generate Testing Certificate
2 | ----------------------------
3 |
4 | The script `openssl-ca.sh` allows you to create a certificate and key that you
5 | can use for a test-setup of RAUC.
6 |
7 | To generate the required files, execute
8 |
9 | ./openssl-ca.sh
10 |
11 | This will generate a folder `openssl-ca/` that contains the generated openssl
12 | configuration file and a development certificate and key.
13 |
14 | To use them in your BSP in order to sign and verify bundles, you have to:
15 |
16 | 1) Make the target rauc package use the generated keyring file:
17 |
18 | Copy the keyring file `dev/ca.cert.pem` into your projects meta layer under
19 | `recipes-core/rauc/files` and add a simple .bbappend file
20 | `recipes-core/rauc/rauc-conf.bbappend` that adds the keyring file to the rauc
21 | config package search path:
22 |
23 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
24 |
25 | 2) Make your bundle recipe use the generated key and certificate:
26 |
27 | Copy the key file `dev/private/development-1.key.pem` and the cert file
28 | `dev/development-1.cert.pem` to your projects meta layer in a global `files`
29 | folder.
30 |
31 | In your bundle recipe, let the variables `RAUC_KEY_FILE` and `RAUC_CERT_FILE`
32 | point to these key and cert files:
33 |
34 | RAUC_KEY_FILE = "${COREBASE}/meta-/files/development-1.key.pem"
35 | RAUC_CERT_FILE = "${COREBASE}/meta-/files/development-1.cert.pem"
36 |
37 | Now you are able to build and sign bundles that contain a rootfs that will
38 | allow RAUC to verify the content of further bundles.
39 |
--------------------------------------------------------------------------------
/scripts/openssl-ca.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -xe
4 |
5 | ORG="Test Org"
6 | CA="rauc CA"
7 |
8 | # After the CRL expires, signatures cannot be verified anymore
9 | CRL="-crldays 5000"
10 |
11 | BASE="$(pwd)/openssl-ca"
12 |
13 | if [ -e $BASE ]; then
14 | echo "$BASE already exists"
15 | exit 1
16 | fi
17 |
18 | mkdir -p $BASE/dev/{private,certs}
19 | touch $BASE/dev/index.txt
20 | echo 01 > $BASE/dev/serial
21 |
22 | cat > $BASE/openssl.cnf <