├── .github ├── stale.yml └── workflows │ ├── build_boards.yml │ ├── build_demos.yml │ ├── build_experimental.yml │ ├── build_validation.yml │ └── cache_layers.yml ├── .gitignore ├── .gitlab-ci.yml ├── LICENSE ├── README.md ├── ci ├── collect_artifacts.sh └── update-repos ├── kas ├── beaglebone-ai64.yml ├── beaglebone-uboot.yml ├── beaglebone.yml ├── beagleplay-ti.yml ├── demos │ ├── meta-mender-demo-app-updates │ │ ├── LICENSE │ │ ├── README │ │ ├── conf │ │ │ └── layer.conf │ │ ├── dynamic-layers │ │ │ └── raspberrypi │ │ │ │ └── recipes-kernel │ │ │ │ └── linux-raspberrypi │ │ │ │ ├── linux-raspberrypi │ │ │ │ └── netfilter.cfg │ │ │ │ └── linux-raspberrypi_6.1.bbappend │ │ └── recipes-demo │ │ │ └── images │ │ │ └── mender-app-update-image.bb │ ├── meta-mender-raspberrypi-wifi │ │ ├── LICENSE │ │ ├── README │ │ ├── conf │ │ │ └── layer.conf │ │ └── recipes-raspberrypi │ │ │ ├── images │ │ │ └── core-image-raspberrypi-wifi.bb │ │ │ ├── wificonfig │ │ │ ├── files │ │ │ │ └── wlan.network │ │ │ └── wificonfig_1.0.bb │ │ │ └── wpa-supplicant │ │ │ ├── files │ │ │ └── wpa_supplicant-wlan0.conf │ │ │ └── wpa-supplicant_%.bbappend │ ├── qemuarm64-bootloader-validation.yml │ ├── qemuarm64-client-only.yml │ ├── raspberrypi4-64-app-updates.yml │ └── raspberrypi4-64-wifi.yml ├── imx93-var-som.yml ├── include │ ├── arm.yml │ ├── mender-base.yml │ ├── mender-full-ubi.yml │ ├── mender-full.yml │ ├── nxp.yml │ ├── qemu.yml │ ├── raspberrypi.yml │ ├── rockchip.yml │ ├── tegra-base.yml │ ├── tegra-jetpack5.yml │ ├── tegra-jetpack6.yml │ ├── ti.yml │ └── validation.yml ├── nezha-allwinner-d1.yml ├── olimex-imx8mp-evb.yml ├── qemuarm64.yml ├── qemux86-64.yml ├── raspberrypi-cm.yml ├── raspberrypi-cm3.yml ├── raspberrypi.yml ├── raspberrypi0-2w-64.yml ├── raspberrypi0-2w.yml ├── raspberrypi0-wifi.yml ├── raspberrypi0.yml ├── raspberrypi2.yml ├── raspberrypi3-64.yml ├── raspberrypi3.yml ├── raspberrypi4-64.yml ├── raspberrypi4.yml ├── raspberrypi5.yml ├── rock-4c-plus.yml ├── tegra │ ├── jetpack5 │ │ ├── jetson-agx-orin-devkit-64.yml │ │ ├── jetson-agx-orin-devkit.yml │ │ ├── jetson-agx-xavier-devkit.yml │ │ ├── jetson-orin-16gb-nx-p3786.yml │ │ └── jetson-orin-nano-devkit.yml │ └── jetpack6 │ │ ├── jetson-agx-orin-devkit-64.yml │ │ ├── jetson-agx-orin-devkit.yml │ │ ├── jetson-orin-16gb-nx-p3786.yml │ │ └── jetson-orin-nano-devkit.yml ├── vexpress-qemu-flash.yml ├── vexpress-qemu.yml └── x86-virtual.yml ├── meta-mender-beaglebone ├── README.md ├── conf │ └── layer.conf ├── recipes-bsp │ └── u-boot │ │ ├── files │ │ └── reduce-spl-size.cfg │ │ └── u-boot_%.bbappend └── templates │ ├── bblayers.conf.sample │ └── local.conf.append ├── meta-mender-client-only ├── LICENSE ├── README ├── conf │ └── layer.conf └── recipes-mender │ └── mender-client │ └── mender_%.bbappend ├── meta-mender-nxp ├── README.md ├── conf │ └── layer.conf └── recipes-bsp │ ├── u-boot-scr │ ├── files │ │ ├── imx93-voipac │ │ │ └── boot.cmd │ │ └── olimex-imx8mp-evb │ │ │ └── boot.cmd │ └── u-boot-scr.bb │ └── u-boot │ ├── u-boot-imx │ ├── imx93-voipac │ │ └── 0001-imx93-voipac-evk-Enable-various-configuration-for-me.patch │ └── olimex-imx8mp-evb │ │ ├── 0001-configs-olimex-imx8mp-evb-mender-integration.patch │ │ └── 0002-Integration-of-Mender-boot-code-into-U-Boot.patch │ └── u-boot-imx_%.bbappend ├── meta-mender-qemu-community ├── LICENSE ├── README ├── conf │ └── layer.conf ├── recipes-bsp │ └── uefi │ │ └── edk2-firmware_%.bbappend └── recipes-kernel │ └── linux │ ├── linux-yocto │ └── efi.cfg │ └── linux-yocto_%.bbappend ├── meta-mender-raspberrypi ├── classes │ └── rpi-update-firmware.bbclass ├── conf │ └── layer.conf ├── recipes-bsp │ ├── bootfiles │ │ ├── rpi-cmdline-mender.inc │ │ └── rpi-cmdline.bbappend │ ├── rpi-u-boot-scr │ │ ├── files │ │ │ └── boot.cmd.in │ │ └── rpi-u-boot-scr.bbappend │ └── u-boot │ │ ├── patches │ │ ├── 0001-configs-rpi-enable-mender-requirements.patch │ │ ├── 0001-pci-fdt-ignore-checks-for-address-range.patch │ │ └── memory_size.cfg │ │ ├── u-boot-raspberrypi.inc │ │ └── u-boot_%.bbappend └── recipes-mender │ ├── mender-configure │ └── mender-configure_%.bbappend │ └── update-firmware-state-script │ ├── files │ └── ArtifactInstall_Leave_50.in │ └── update-firmware-state-script.bb ├── meta-mender-riscv ├── LICENSE ├── README ├── conf │ └── layer.conf ├── recipes-bsp │ └── u-boot │ │ ├── u-boot-allwinnerd1-mender-common.inc │ │ ├── u-boot-allwinnerd1.bbappend │ │ └── u-boot-allwinnerd1 │ │ ├── 0001-add-mender-related-config-items.patch │ │ └── tftp-mmc-boot.txt └── recipes-kernel │ └── linux │ ├── linux-allwinnerd1-dev.bbappend │ └── linux-allwinnerd1-dev │ └── dosfs.cfg ├── meta-mender-rockchip ├── README.md ├── classes │ └── rockchip-sdimg.bbclass ├── conf │ └── layer.conf └── recipes-bsp │ └── u-boot │ ├── u-boot │ └── 0001-Add-mender-settings.patch │ └── u-boot_%.bbappend ├── meta-mender-tegra ├── README.md ├── meta-mender-tegra-common │ ├── README.md │ ├── classes-global │ │ └── tegra-mender-setup.bbclass │ ├── classes-recipe │ │ └── image_types_mender_tegra.bbclass │ ├── conf │ │ └── layer.conf │ ├── recipes-bsp │ │ ├── tegra-binaries │ │ │ ├── tegra-redundant-boot │ │ │ │ ├── nv_update_verifier.init │ │ │ │ ├── nv_update_verifier.service │ │ │ │ └── nv_update_verifier.sh │ │ │ ├── tegra-redundant-boot_%.bbappend │ │ │ ├── tegra-storage-layout-base_%.bbappend │ │ │ ├── tegra-storage-layout │ │ │ │ └── flash_l4t_t234_nvme_rootfs_ab.xml │ │ │ └── tegra-storage-layout_%.bbappend │ │ ├── u-boot │ │ │ ├── libubootenv-fake │ │ │ │ ├── fw_printenv │ │ │ │ └── fw_setenv │ │ │ └── libubootenv-fake_1.0.bb │ │ └── uefi │ │ │ ├── edk2-firmware-tegra_%.bbappend │ │ │ ├── files │ │ │ └── 0001-Enable-runtime-access-to-KernelCommandLine-efivar.patch │ │ │ └── l4t-launcher-extlinux.bbappend │ └── recipes-mender │ │ ├── mender-client │ │ ├── files │ │ │ ├── efi_systemd_machine_id.sh │ │ │ └── tegra-mender-client-set-systemd-machine-id.sh │ │ ├── mender-client_%.bbappend │ │ ├── mender-tegra.inc │ │ └── mender_%.bbappend │ │ ├── mender-update-verifier │ │ ├── files │ │ │ ├── mender-update-verifier.service │ │ │ └── mender-update-verifier.sh │ │ └── mender-update-verifier.bb │ │ └── tegra-state-scripts │ │ ├── files │ │ ├── abort-blupdate │ │ ├── switch-rootfs │ │ └── verify-slot │ │ └── tegra-state-scripts_1.0.bb ├── meta-mender-tegra-jetpack5 │ ├── README.md │ ├── conf │ │ └── layer.conf │ ├── recipes-bsp │ │ └── uefi │ │ │ ├── edk2-firmware-tegra_%.bbappend │ │ │ └── files │ │ │ └── L4TConfiguration-RootfsRedundancyLevelABEnable.dtsi │ └── recipes-kernel │ │ └── linux │ │ └── linux-tegra_%.bbappend └── meta-mender-tegra-jetpack6 │ ├── README.md │ ├── conf │ └── layer.conf │ ├── recipes-bsp │ └── uefi │ │ ├── files │ │ └── L4TConfiguration-RootfsRedundancyLevelABEnable.dtsi │ │ └── l4t-launcher-rootfs-ab-config_%.bbappend │ └── recipes-kernel │ └── linux │ └── linux-jammy-nvidia-tegra_5.15%.bbappend ├── meta-mender-update-modules ├── README.md ├── conf │ └── layer.conf ├── dynamic-layers │ └── virtualization │ │ └── recipes-mender │ │ └── mender-update-modules │ │ └── mender-app-update_git.bb └── recipes-mender │ └── mender-update-modules │ ├── mender-dir-overlay_git.bb │ ├── mender-ipk_git.bb │ ├── mender-rootfs-version-check_git.bb │ └── mender-update-modules.inc ├── meta-mender-validation ├── LICENSE ├── README ├── conf │ └── layer.conf └── recipes-mender │ ├── bootloader-validation │ └── bootloader-validation_0.1.bb │ └── images │ └── mender-validation-image.bb └── meta-mender-variscite ├── README.md ├── conf └── layer.conf └── recipes-bsp └── u-boot ├── patches ├── 0001-u-boot-variscite-configuration-adjustments-for-Mende.patch └── 0002-u-boot-variscite-Mender-integration-to-bootcmd.patch ├── u-boot-variscite-mender-common.inc └── u-boot-variscite.bbappend /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 60 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Issues with these labels will never be considered stale 6 | # exemptLabels: 7 | # - pinned 8 | # - security 9 | # Label to use when marking an issue as stale 10 | staleLabel: wontfix 11 | # Comment to post when marking an issue as stale. Set to `false` to disable 12 | markComment: > 13 | This issue has been automatically marked as stale because it has not had 14 | recent activity. It will be closed if no further activity occurs. Thank you 15 | for your contributions. 16 | # Comment to post when closing a stale issue. Set to `false` to disable 17 | closeComment: false 18 | -------------------------------------------------------------------------------- /.github/workflows/build_boards.yml: -------------------------------------------------------------------------------- 1 | name: build_boards 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | # * is a special character in YAML so you have to quote this string 7 | - cron: '5 2 * * 6' 8 | 9 | env: 10 | BUILDDIR: build 11 | 12 | jobs: 13 | prepare: 14 | runs-on: [self-hosted, linux, x64, builder] 15 | outputs: 16 | artifact_path: ${{ steps.artifact_path.outputs.artifact_path }} 17 | steps: 18 | - name: Clean up 19 | run: rm -fR $BUILDDIR 20 | - uses: actions/checkout@v4 21 | - id: artifact_path 22 | name: create artifact output directory 23 | run: echo "artifact_path=${{ vars.ARTIFACT_OUTPUT_DIR }}/$GITHUB_REPOSITORY/$GITHUB_WORKFLOW/$GITHUB_RUN_NUMBER-$GITHUB_RUN_ATTEMPT" >> $GITHUB_OUTPUT 24 | 25 | build: 26 | needs: [prepare] 27 | strategy: 28 | fail-fast: false 29 | matrix: 30 | board: [ 31 | beaglebone, 32 | beaglebone-ai64, 33 | beagleplay, 34 | raspberrypi, 35 | raspberrypi-cm, 36 | raspberrypi0, 37 | raspberrypi0-wifi, 38 | raspberrypi2, 39 | raspberrypi0-2w, 40 | raspberrypi0-2w-64, 41 | raspberrypi3, 42 | raspberrypi3-64, 43 | raspberrypi-cm3, 44 | raspberrypi4, 45 | raspberrypi4-64, 46 | raspberrypi5, 47 | qemuarm64, 48 | qemux86-64, 49 | vexpress-qemu, 50 | vexpress-qemu-flash, 51 | x86-virtual, 52 | beaglebone-uboot, 53 | rock-4c-plus, 54 | ] 55 | subpath: [.] 56 | 57 | runs-on: [self-hosted, linux, x64, builder] 58 | container: 59 | # the container image needs to be effectively hardcoded, it seems. 60 | image: ghcr.io/theyoctojester/devcontainer-base-yoep:main 61 | volumes: 62 | - ${{ vars.PERSISTENT_DIR }}/downloads:${{ vars.BUILD_DL_DIR }} 63 | - ${{ vars.PERSISTENT_DIR }}/sstate-cache:${{ vars.BUILD_SSTATE_DIR }} 64 | - ${{ vars.PERSISTENT_DIR }}/layers:${{ vars.BUILD_LAYERCACHE_DIR }} 65 | - ${{ vars.PERSISTENT_DIR }}/assets:${{ vars.BUILD_ASSETS_DIR }} 66 | options: --user ${{ vars.KAS_UID }}:${{ vars.KAS_GID }} 67 | steps: 68 | - name: enter build dir and build 69 | env: 70 | DL_DIR: ${{ vars.BUILD_DL_DIR}} 71 | SSTATE_DIR: ${{ vars.BUILD_SSTATE_DIR}} 72 | KAS_REPO_REF_DIR: ${{ vars.BUILD_LAYERCACHE_DIR}} 73 | run: > 74 | mkdir -p $BUILDDIR/${{ matrix.board }} && 75 | cd $BUILDDIR/${{ matrix.board }} && 76 | kas checkout ../../kas/${{ matrix.subpath }}/${{ matrix.board }}.yml && 77 | if [ -f "${{ vars.BUILD_ASSETS_DIR }}/site.conf" ]; then 78 | cp ${{ vars.BUILD_ASSETS_DIR }}/site.conf build/conf/site.conf; 79 | fi && 80 | kas build ../../kas/${{ matrix.subpath }}/${{ matrix.board }}.yml 81 | 82 | collect: 83 | needs: [prepare, build] 84 | runs-on: [self-hosted, linux, x64, builder] 85 | steps: 86 | - name: collect artifacts 87 | env: 88 | ARTIFACT_PATH: ${{ needs.prepare.outputs.artifact_path }} 89 | run: ./ci/collect_artifacts.sh 90 | -------------------------------------------------------------------------------- /.github/workflows/build_demos.yml: -------------------------------------------------------------------------------- 1 | name: build_demos 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | # * is a special character in YAML so you have to quote this string 7 | - cron: '5 2 * * 6' 8 | 9 | env: 10 | BUILDDIR: demos 11 | 12 | jobs: 13 | prepare: 14 | runs-on: [self-hosted, linux, x64, builder] 15 | outputs: 16 | artifact_path: ${{ steps.artifact_path.outputs.artifact_path }} 17 | steps: 18 | - name: Clean up 19 | run: rm -fR $BUILDDIR 20 | - uses: actions/checkout@v4 21 | - id: artifact_path 22 | name: create artifact output directory 23 | run: echo "artifact_path=${{ vars.ARTIFACT_OUTPUT_DIR }}/$GITHUB_REPOSITORY/$GITHUB_WORKFLOW/$GITHUB_RUN_NUMBER-$GITHUB_RUN_ATTEMPT" >> $GITHUB_OUTPUT 24 | 25 | build: 26 | needs: [prepare] 27 | strategy: 28 | fail-fast: false 29 | matrix: 30 | board: [ 31 | raspberrypi4-64-app-updates, 32 | qemuarm64-bootloader-validation, 33 | qemuarm64-client-only, 34 | raspberrypi4-64-wifi 35 | ] 36 | subpath: [demos] 37 | 38 | runs-on: [self-hosted, linux, x64, builder] 39 | container: 40 | # the container image needs to be effectively hardcoded, it seems. 41 | image: ghcr.io/theyoctojester/devcontainer-base-yoep:main 42 | volumes: 43 | - ${{ vars.PERSISTENT_DIR }}/downloads:${{ vars.BUILD_DL_DIR }} 44 | - ${{ vars.PERSISTENT_DIR }}/sstate-cache:${{ vars.BUILD_SSTATE_DIR }} 45 | - ${{ vars.PERSISTENT_DIR }}/layers:${{ vars.BUILD_LAYERCACHE_DIR }} 46 | - ${{ vars.PERSISTENT_DIR }}/assets:${{ vars.BUILD_ASSETS_DIR }} 47 | options: --user ${{ vars.KAS_UID }}:${{ vars.KAS_GID }} 48 | steps: 49 | - name: enter build dir and build 50 | env: 51 | DL_DIR: ${{ vars.BUILD_DL_DIR}} 52 | SSTATE_DIR: ${{ vars.BUILD_SSTATE_DIR}} 53 | KAS_REPO_REF_DIR: ${{ vars.BUILD_LAYERCACHE_DIR}} 54 | run: > 55 | mkdir -p $BUILDDIR/${{ matrix.board }} && 56 | cd $BUILDDIR/${{ matrix.board }} && 57 | kas checkout ../../kas/${{ matrix.subpath }}/${{ matrix.board }}.yml && 58 | if [ -f "${{ vars.BUILD_ASSETS_DIR }}/site.conf" ]; then 59 | cp ${{ vars.BUILD_ASSETS_DIR }}/site.conf build/conf/site.conf; 60 | fi && 61 | kas build ../../kas/${{ matrix.subpath }}/${{ matrix.board }}.yml 62 | 63 | collect: 64 | needs: [prepare, build] 65 | runs-on: [self-hosted, linux, x64, builder] 66 | steps: 67 | - name: collect artifacts 68 | env: 69 | ARTIFACT_PATH: ${{ needs.prepare.outputs.artifact_path }} 70 | run: ./ci/collect_artifacts.sh -------------------------------------------------------------------------------- /.github/workflows/build_experimental.yml: -------------------------------------------------------------------------------- 1 | name: build_experimental 2 | 3 | on: 4 | workflow_dispatch: 5 | workflow_run: 6 | workflows: ["cache layers"] 7 | types: 8 | - completed 9 | 10 | env: 11 | BUILDDIR: experimental 12 | 13 | jobs: 14 | prepare: 15 | runs-on: [self-hosted, linux, x64, builder] 16 | steps: 17 | - name: Clean up 18 | run: rm -fR $BUILDDIR 19 | - uses: actions/checkout@v4 20 | 21 | build: 22 | needs: [prepare] 23 | strategy: 24 | fail-fast: false 25 | matrix: 26 | board: [ 27 | olimex-imx8mp-evb, 28 | imx93-var-som, 29 | nezha-allwinner-d1 30 | ] 31 | subpath: [.] 32 | include: 33 | - board: jetson-agx-orin-devkit 34 | subpath: tegra/jetpack5 35 | - board: jetson-agx-orin-devkit-64 36 | subpath: tegra/jetpack5 37 | - board: jetson-agx-xavier-devkit 38 | subpath: tegra/jetpack5 39 | - board: jetson-orin-16gb-nx-p3786 40 | subpath: tegra/jetpack5 41 | - board: jetson-orin-nano-devkit 42 | subpath: tegra/jetpack5 43 | - board: jetson-agx-orin-devkit 44 | subpath: tegra/jetpack6 45 | - board: jetson-agx-orin-devkit-64 46 | subpath: tegra/jetpack6 47 | - board: jetson-orin-nano-devkit 48 | subpath: tegra/jetpack6 49 | - board: jetson-orin-16gb-nx-p3786 50 | subpath: tegra/jetpack6 51 | 52 | runs-on: [self-hosted, linux, x64, builder] 53 | container: 54 | # the container image needs to be effectively hardcoded, it seems. 55 | image: ghcr.io/theyoctojester/devcontainer-base-yoep:main 56 | volumes: 57 | - ${{ vars.PERSISTENT_DIR }}/downloads:${{ vars.BUILD_DL_DIR }} 58 | - ${{ vars.PERSISTENT_DIR }}/sstate-cache:${{ vars.BUILD_SSTATE_DIR }} 59 | - ${{ vars.PERSISTENT_DIR }}/layers:${{ vars.BUILD_LAYERCACHE_DIR }} 60 | - ${{ vars.PERSISTENT_DIR }}/assets:${{ vars.BUILD_ASSETS_DIR }} 61 | options: --user ${{ vars.KAS_UID }}:${{ vars.KAS_GID }} 62 | steps: 63 | - name: enter build dir and build 64 | env: 65 | DL_DIR: ${{ vars.BUILD_DL_DIR}} 66 | SSTATE_DIR: ${{ vars.BUILD_SSTATE_DIR}} 67 | KAS_REPO_REF_DIR: ${{ vars.BUILD_LAYERCACHE_DIR}} 68 | run: > 69 | mkdir -p $BUILDDIR/${{ matrix.board }} && 70 | cd $BUILDDIR/${{ matrix.board }} && 71 | kas checkout ../../kas/${{ matrix.subpath }}/${{ matrix.board }}.yml && 72 | if [ -f "${{ vars.BUILD_ASSETS_DIR }}/site.conf" ]; then 73 | cp ${{ vars.BUILD_ASSETS_DIR }}/site.conf build/conf/site.conf; 74 | fi && 75 | kas build ../../kas/${{ matrix.subpath }}/${{ matrix.board }}.yml 76 | -------------------------------------------------------------------------------- /.github/workflows/build_validation.yml: -------------------------------------------------------------------------------- 1 | name: build_validation 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | schedule: 7 | # * is a special character in YAML so you have to quote this string 8 | - cron: '5 2 * * 6' 9 | 10 | env: 11 | BUILDDIR: validation 12 | 13 | jobs: 14 | prepare: 15 | runs-on: [self-hosted, linux, x64, builder] 16 | outputs: 17 | artifact_path: ${{ steps.artifact_path.outputs.artifact_path }} 18 | artifact_latest: ${{ steps.artifact_latest.outputs.artifact_latest }} 19 | steps: 20 | - name: Clean up 21 | run: rm -fR $BUILDDIR 22 | - uses: actions/checkout@v4 23 | - id: artifact_path 24 | name: generate artifact output directory name 25 | run: echo "artifact_path=${{ vars.ARTIFACT_OUTPUT_DIR }}/$GITHUB_REPOSITORY/$GITHUB_REF_NAME/$GITHUB_WORKFLOW/$GITHUB_RUN_NUMBER-$GITHUB_RUN_ATTEMPT" >> $GITHUB_OUTPUT 26 | - id: artifact_latest 27 | name: generate latest artifact symlink name 28 | run: echo "artifact_latest=${{ vars.ARTIFACT_OUTPUT_DIR }}/$GITHUB_REPOSITORY/$GITHUB_REF_NAME/$GITHUB_WORKFLOW/latest" >> $GITHUB_OUTPUT 29 | 30 | build: 31 | needs: [prepare] 32 | strategy: 33 | fail-fast: false 34 | matrix: 35 | board: [ 36 | beaglebone, 37 | beaglebone-uboot, 38 | raspberrypi3, 39 | raspberrypi3-64, 40 | raspberrypi4, 41 | raspberrypi4-64, 42 | raspberrypi5, 43 | ] 44 | subpath: [.] 45 | 46 | runs-on: [self-hosted, linux, x64, builder] 47 | container: 48 | # the container image needs to be effectively hardcoded, it seems. 49 | image: ghcr.io/theyoctojester/devcontainer-base-yoep:main 50 | volumes: 51 | - ${{ vars.PERSISTENT_DIR }}/downloads:${{ vars.BUILD_DL_DIR }} 52 | - ${{ vars.PERSISTENT_DIR }}/sstate-cache:${{ vars.BUILD_SSTATE_DIR }} 53 | - ${{ vars.PERSISTENT_DIR }}/layers:${{ vars.BUILD_LAYERCACHE_DIR }} 54 | - ${{ vars.PERSISTENT_DIR }}/assets:${{ vars.BUILD_ASSETS_DIR }} 55 | options: --user ${{ vars.KAS_UID }}:${{ vars.KAS_GID }} 56 | steps: 57 | - name: enter build dir and build 58 | env: 59 | DL_DIR: ${{ vars.BUILD_DL_DIR}} 60 | SSTATE_DIR: ${{ vars.BUILD_SSTATE_DIR}} 61 | KAS_REPO_REF_DIR: ${{ vars.BUILD_LAYERCACHE_DIR}} 62 | run: > 63 | mkdir -p $BUILDDIR/${{ matrix.board }} && 64 | cd $BUILDDIR/${{ matrix.board }} && 65 | kas checkout ../../kas/${{ matrix.subpath }}/${{ matrix.board }}.yml && 66 | if [ -f "${{ vars.BUILD_ASSETS_DIR }}/site.conf" ]; then 67 | cp ${{ vars.BUILD_ASSETS_DIR }}/site.conf build/conf/site.conf; 68 | fi && 69 | kas build ../../kas/${{ matrix.subpath }}/${{ matrix.board }}.yml:../../kas/include/validation.yml 70 | 71 | collect: 72 | needs: [prepare, build] 73 | runs-on: [self-hosted, linux, x64, builder] 74 | steps: 75 | - name: collect artifacts 76 | env: 77 | ARTIFACT_PATH: ${{ needs.prepare.outputs.artifact_path }} 78 | run: ./ci/collect_artifacts.sh 79 | - name: mark latest 80 | run: > 81 | rm -fR ${{ needs.prepare.outputs.artifact_latest }}; 82 | echo "using artifact path ${{ needs.prepare.outputs.artifact_path }}, latest ${{ needs.prepare.outputs.artifact_latest }}" && 83 | ln -s ${{ needs.prepare.outputs.artifact_path }} ${{ needs.prepare.outputs.artifact_latest }} 84 | -------------------------------------------------------------------------------- /.github/workflows/cache_layers.yml: -------------------------------------------------------------------------------- 1 | name: cache_layers 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | schedule: 7 | # * is a special character in YAML so you have to quote this string 8 | - cron: '5 1 * * *' 9 | 10 | jobs: 11 | prepare: 12 | runs-on: [self-hosted, linux, x64, builder] 13 | steps: 14 | - name: cache metadata layers 15 | run: ./ci/update-repos 16 | env: 17 | LAYERCACHE: ${{ vars.PERSISTENT_DIR }}/layers 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | my-* 3 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | stages: 2 | - test 3 | 4 | include: 5 | - project: 'Northern.tech/Mender/mendertesting' 6 | file: '.gitlab-ci-check-commits-signoffs.yml' 7 | - project: 'Northern.tech/Mender/mendertesting' 8 | file: '.gitlab-ci-github-status-updates.yml' 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Yocto community integration layers for Mender 2 | 3 | Mender is an open source over-the-air (OTA) software updater for embedded Linux 4 | devices. Mender comprises a client running at the embedded device, as well as 5 | a server that manages deployments across many devices. 6 | 7 | This repository contains Yocto integration layers for various boards. 8 | 9 | Please check out https://hub.mender.io for more information on 10 | supported boards and instructions on how to setup environment and build images. 11 | 12 | ![Mender logo](https://github.com/mendersoftware/mender/raw/master/mender_logo.png) 13 | 14 | ## Structure 15 | 16 | This section is for anyone interested in contributing support for a board. 17 | 18 | meta-mender-community is a repository containing multiple Yocto layers for 19 | integrating Mender onto various boards. 20 | 21 | The layers are structured based on upstream BSP layers and not individual 22 | boards. 23 | 24 | There are multiple types of layers included here. 25 | 26 | SoC-oriented: 27 | 28 | - meta-mender-amlogic 29 | - meta-mender-nxp 30 | - meta-mender-tegra 31 | ... 32 | 33 | Vendor-oriented: 34 | 35 | - meta-mender-raspberrypi 36 | - meta-mender-toradex-nxp 37 | - meta-mender-octavo-osd32mp 38 | ... 39 | 40 | Naming of integration layers follows the upstream naming conventions with SoM 41 | vendor layer name having priority. The convention is: 42 | 43 | ``` 44 | meta-mender- 45 | ``` 46 | 47 | This should make it clear which layer is targeting what BSP. 48 | 49 | ## Build setup 50 | 51 | Traditionally `meta-mender-community` has required board integrations to provide build setup configuration through the [repo](https://gerrit.googlesource.com/git-repo) tool by Google. As it has a number of shortcomings, things are being moved to [kas](https://github.com/siemens/kas). 52 | 53 | All submitted board integrations need to provide a build setup strategy. New `repo`-based setups will usually be rejected. 54 | 55 | ### `kas` 56 | 57 | For an introduction on `kas`, please see the [tutorial article](https://hub.mender.io/t/using-kas-to-reproduce-your-yocto-builds/6020) on the Mender Hub. 58 | 59 | #### Building an image for a supported board 60 | 61 | ##### Quick start 62 | 63 | To build an image using `kas`, you simply call it with the `build` verb and the desired configuration. Example for the Raspberry Pi 4, 64bit: 64 | ``` 65 | kas build meta-mender-community/kas/raspberrypi4-64.yml 66 | ``` 67 | 68 | ##### A full getting started build procedure 69 | 70 | Install the `kas` tool (optionally, you can install globally for all users. Run as `root`, respectively under `sudo` then): 71 | ``` 72 | pip install kas 73 | ``` 74 | 75 | Clone this repository: 76 | ``` 77 | git clone https://github.com/mendersoftware/meta-mender-community 78 | ``` 79 | 80 | Create a build directory and change into it: 81 | ``` 82 | mkdir -p meta-mender-community/my-build && cd meta-mender-community/my-build 83 | ``` 84 | 85 | Call kas to build for the Raspberry Pi 4, 64bit: 86 | ``` 87 | kas build ../kas/raspberrypi4-64.yml 88 | ``` 89 | 90 | The canonical build structure including resulting deployable images is located under `meta-mender-community/my-build/build`. 91 | 92 | #### Adding a new build configuration 93 | 94 | In the most straightforward case, a board integration can simply consist of a `kas` configuration file. Those are located in the `kas` top level directory. 95 | 96 | Some relevant best practises: 97 | - if possible, common parts of board integrations should be factored out into includes. Those are located in the `kas/include` directory. 98 | - the `mender-full.yml` or `mender-full-ubi.yml` includes should be used as baseline 99 | - a minimal approach concerning image and `DISTRO` should be preferred 100 | - the default image is `core-image-minimal`, consider keeping it unless your platform has specific requirements 101 | - the default `DISTRO` is a `nodistro`, pure OpenEmbedded setup. While selecting a larger or custom `DISTRO` is acceptable, consider being as slim as possible to provide the highest degree of freedom to your users. 102 | 103 | Requirements: 104 | - revisions of metadata layers defined in the configurations must be fixed. Exception: the `master` branch which tracks the Yocto Project / OpenEmbedded upstream 105 | - the primary targetted branch must be a Yocto Project LTS correlated one 106 | - add your board to the automated build configuration at `.github/workflows/build.yml`, marked as `experimental`. It will be moved out of experimental after a number of successful builds by the Mender team. 107 | 108 | ## Contributing 109 | 110 | We welcome and ask for your contribution. If you would like to contribute to 111 | Mender, please read our guide on how to best get started [contributing code or 112 | documentation](https://github.com/mendersoftware/mender/blob/master/CONTRIBUTING.md). 113 | 114 | Community contributed layers will be co-maintained by the Mender team on a best-effort 115 | base. Coordination of reviews and merges happens case by case and based on responsiveness, 116 | respectively activity. Reviews and acknowledgements by the original contributors are explicitly 117 | not required for further contributions, in order to not block development and maintenance. 118 | 119 | ## License 120 | 121 | Mender is licensed under the Apache License, Version 2.0. See 122 | [LICENSE](https://github.com/mendersoftware/meta-mender-community/blob/master/LICENSE) for the 123 | full license text. 124 | 125 | 126 | ## Connect with us 127 | 128 | * Join the [Mender Hub discussion forum](https://hub.mender.io) 129 | * Follow us on [Twitter](https://twitter.com/mender_io). Please 130 | feel free to tweet us questions. 131 | * Fork us on [Github](https://github.com/mendersoftware) 132 | * Create an issue in the [bugtracker](https://tracker.mender.io/projects/MEN) 133 | * Email us at [contact@mender.io](mailto:contact@mender.io) 134 | * Connect to the [#mender IRC channel on Libera](https://web.libera.chat/?#mender) 135 | 136 | 137 | ## Authors 138 | 139 | Mender was created by the team at [Northern.tech AS](https://northern.tech), with many contributions from 140 | the community. Thanks [everyone](https://github.com/mendersoftware/mender/graphs/contributors)! 141 | 142 | [Mender](https://mender.io) is sponsored by [Northern.tech AS](https://northern.tech). 143 | -------------------------------------------------------------------------------- /ci/collect_artifacts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | 4 | if [ -z ${BUILDDIR+x} ]; then 5 | echo "BUILDDIR is unset, exiting"; 6 | exit 1; 7 | fi 8 | if [ -z ${ARTIFACT_PATH+x} ]; then 9 | echo "ARTIFACT_PATH is unset, exiting"; 10 | exit 1; 11 | fi 12 | 13 | echo "using BUILDDIR: $BUILDDIR" 14 | echo "using ARTIFACT_PATH: $ARTIFACT_PATH" 15 | 16 | mkdir -p $ARTIFACT_PATH 17 | 18 | IMAGE_SUBPATH="build/tmp/deploy/images" 19 | 20 | for build in $(ls $BUILDDIR); do 21 | echo "found build: $build" 22 | 23 | if [ ! -d "$BUILDDIR/$build/$IMAGE_SUBPATH" ]; then 24 | echo "no artifacts found" 25 | continue 26 | fi 27 | 28 | for board in $(ls $BUILDDIR/$build/$IMAGE_SUBPATH); do 29 | echo ".. found board $board" 30 | mkdir -p $ARTIFACT_PATH/$build 31 | echo "$board" > $ARTIFACT_PATH/$build/board.txt 32 | cp -fR $BUILDDIR/$build/$IMAGE_SUBPATH/$board $ARTIFACT_PATH/$build/images 33 | cp -fR $BUILDDIR/$build/build/conf $ARTIFACT_PATH/$build 34 | 35 | if [ -d "$BUILDDIR/$build/build/tmp/buildstats" ]; then 36 | cp -fR $BUILDDIR/$build/build/tmp/buildstats $ARTIFACT_PATH/$build 37 | fi 38 | done 39 | done 40 | -------------------------------------------------------------------------------- /ci/update-repos: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python3 2 | 3 | # Update clones of the repositories we need in KAS_REPO_REF_DIR to speed up fetches 4 | 5 | import sys 6 | import os 7 | import shutil 8 | import subprocess 9 | import pathlib 10 | 11 | def repo_shortname(url): 12 | # Taken from Kas (Repo.__getattr__) to ensure the logic is right 13 | from urllib.parse import urlparse 14 | url = urlparse(url) 15 | return ('{url.netloc}{url.path}' 16 | .format(url=url) 17 | .replace('@', '.') 18 | .replace(':', '.') 19 | .replace('/', '.') 20 | .replace('*', '.')) 21 | 22 | repositories = ( 23 | "https://git.yoctoproject.org/git/poky", 24 | "https://git.openembedded.org/meta-openembedded", 25 | "https://git.yoctoproject.org/git/meta-virtualization", 26 | "https://github.com/kraj/meta-clang", 27 | "https://github.com/mendersoftware/meta-mender", 28 | "https://github.com/agherzan/meta-raspberrypi", 29 | "https://github.com/OE4T/meta-tegra.git", 30 | "https://github.com/Freescale/meta-freescale", 31 | "https://github.com/Freescale/meta-freescale-distro", 32 | "https://github.com/Freescale/meta-freescale-3rdparty", 33 | "https://git.openembedded.org/openembedded-core", 34 | "https://git.openembedded.org/bitbake", 35 | "https://git.yoctoproject.org/git/meta-yocto", 36 | ) 37 | 38 | if __name__ == "__main__": 39 | if "LAYERCACHE" not in os.environ: 40 | print("LAYERCACHE needs to be set") 41 | sys.exit(1) 42 | 43 | base_repodir = pathlib.Path(os.environ["LAYERCACHE"]) 44 | failed = False 45 | 46 | for repo in repositories: 47 | repodir = base_repodir / repo_shortname(repo) 48 | 49 | if "CI_CLEAN_REPOS" in os.environ: 50 | print("Cleaning %s..." % repo) 51 | shutil.rmtree(repodir, ignore_errors=True) 52 | 53 | if repodir.exists(): 54 | try: 55 | print("Updating %s..." % repo) 56 | subprocess.run(["git", "-C", repodir, "-c", "gc.autoDetach=false", "fetch"], check=True) 57 | except subprocess.CalledProcessError as e: 58 | print(e) 59 | failed = True 60 | else: 61 | print("Cloning %s..." % repo) 62 | subprocess.run(["git", "clone", "--bare", repo, repodir], check=True) 63 | 64 | if failed: 65 | sys.exit(128) 66 | -------------------------------------------------------------------------------- /kas/beaglebone-ai64.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/arm.yml 6 | - kas/include/ti.yml 7 | 8 | machine: beaglebone-ai64 9 | 10 | local_conf_header: 11 | beagleplay: | 12 | MENDER_FEATURES_ENABLE:append = " mender-image-sd" 13 | MENDER_FEATURES_DISABLE:append = "mender-image-uefi" 14 | MENDER_STORAGE_DEVICE = "/dev/mmcblk1" 15 | MENDER_BOOT_PART_SIZE_MB = "128" 16 | MENDER_PARTITION_ALIGNMENT = "1048576" 17 | IMAGE_FSTYPES:remove = "wic wic.bmap mender.bmap sdimg.bmap" -------------------------------------------------------------------------------- /kas/beaglebone-uboot.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/beaglebone.yml 5 | 6 | local_conf_header: 7 | beaglebone-uboot: | 8 | MENDER_FEATURES_ENABLE:append = " mender-uboot" 9 | MENDER_FEATURES_DISABLE:append = "mender-grub" -------------------------------------------------------------------------------- /kas/beaglebone.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | 6 | repos: 7 | meta-mender-community: 8 | layers: 9 | meta-mender-beaglebone: 10 | 11 | machine: beaglebone-yocto 12 | -------------------------------------------------------------------------------- /kas/beagleplay-ti.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/arm.yml 6 | - kas/include/ti.yml 7 | 8 | machine: beagleplay-ti 9 | 10 | local_conf_header: 11 | beagleplay: | 12 | MENDER_FEATURES_ENABLE:append = " mender-image-sd" 13 | MENDER_FEATURES_DISABLE:append = "mender-image-uefi" 14 | MENDER_STORAGE_DEVICE = "/dev/mmcblk1" 15 | MENDER_BOOT_PART_SIZE_MB = "128" 16 | MENDER_PARTITION_ALIGNMENT = "1048576" 17 | IMAGE_FSTYPES:remove = "wic wic.bmap mender.bmap sdimg.bmap" 18 | -------------------------------------------------------------------------------- /kas/demos/meta-mender-demo-app-updates/README: -------------------------------------------------------------------------------- 1 | This README file contains information on the contents of the meta-mender-demo-app-updates layer. 2 | 3 | Please see the corresponding sections below for details. 4 | 5 | Dependencies 6 | ============ 7 | 8 | URI: https://git.openembedded.org/meta-openembedded 9 | branch: master / mickledore 10 | 11 | URI: https://github.com/mendersoftware/meta-mender 12 | branch: master-next 13 | 14 | URI: https://git.yoctoproject.org/meta-virtualization 15 | branch: master / mickledore 16 | 17 | URI: https://github.com/agherzan/meta-raspberrypi 18 | branch: master / mickledore 19 | 20 | Contributions 21 | ============= 22 | 23 | Please the README file in the top level directory. 24 | 25 | Table of Contents 26 | ================= 27 | 28 | I. Adding the meta-mender-demo-app-updates layer to your build 29 | II. Purpose 30 | III. Included functionality 31 | 32 | 33 | I. Adding the meta-mender-demo-app-updates layer to your build 34 | ================================================= 35 | 36 | Run 'bitbake-layers add-layer meta-mender-demo-app-updates' 37 | 38 | II. Purpose 39 | =========== 40 | 41 | The layer contains an example setup for a Yocto build which is enabled 42 | to receive docker-compose orchestrated application updates, as described 43 | in the [Mender documentation](https://docs.mender.io/artifact-creation/create-an-artifact/docker-compose). 44 | 45 | The example image "mender-app-update-image" installs the required Update Module 46 | onto a `core-image-full-cmdline` image. 47 | 48 | III. Included functionality 49 | =========================== 50 | 51 | The docker-compose based Update Module requires 52 | - docker & docker-compose to be installed 53 | - the respective kernel features to be enabled 54 | - the `iptables` NAT/masquerading functionality to be built in. 55 | 56 | The former two are provided by the `meta-virtualization`. 57 | 58 | For the Raspberry Pi, an example kernel configuration fragment is supplied that 59 | configures `iptables` as required. To use the layer on different board, porting 60 | the `netfilter.cfg` fragment is probably required. 61 | -------------------------------------------------------------------------------- /kas/demos/meta-mender-demo-app-updates/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 += "meta-mender-demo-app-updates" 9 | BBFILE_PATTERN_meta-mender-demo-app-updates = "^${LAYERDIR}/" 10 | BBFILE_PRIORITY_meta-mender-demo-app-updates = "6" 11 | 12 | LAYERDEPENDS_meta-mender-demo-app-updates = "core virtualization-layer" 13 | LAYERSERIES_COMPAT_meta-mender-demo-app-updates = "scarthgap" 14 | 15 | BBFILES_DYNAMIC += " \ 16 | raspberrypi:${LAYERDIR}/dynamic-layers/raspberrypi/*/*/*.bb \ 17 | raspberrypi:${LAYERDIR}/dynamic-layers/raspberrypi/*/*/*.bbappend \ 18 | " 19 | -------------------------------------------------------------------------------- /kas/demos/meta-mender-demo-app-updates/dynamic-layers/raspberrypi/recipes-kernel/linux-raspberrypi/linux-raspberrypi/netfilter.cfg: -------------------------------------------------------------------------------- 1 | CONFIG_NETFILTER_NETLINK=y 2 | CONFIG_NF_NAT=y 3 | CONFIG_NF_TABLES=y 4 | CONFIG_NFT_NAT=y 5 | CONFIG_NETFILTER_XTABLES=y 6 | CONFIG_NETFILTER_XT_NAT=y 7 | CONFIG_NETFILTER_XT_TARGET_NETMAP=y 8 | CONFIG_NETFILTER_XT_TARGET_REDIRECT=y 9 | CONFIG_NETFILTER_XT_TARGET_MASQUERADE=y 10 | CONFIG_IP_NF_IPTABLES=y 11 | CONFIG_IP_NF_NAT=y 12 | CONFIG_IP_NF_TARGET_MASQUERADE=y 13 | CONFIG_IP_NF_TARGET_NETMAP=y 14 | CONFIG_IP_NF_TARGET_REDIRECT=y 15 | -------------------------------------------------------------------------------- /kas/demos/meta-mender-demo-app-updates/dynamic-layers/raspberrypi/recipes-kernel/linux-raspberrypi/linux-raspberrypi_6.1.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | SRC_URI += "file://netfilter.cfg" -------------------------------------------------------------------------------- /kas/demos/meta-mender-demo-app-updates/recipes-demo/images/mender-app-update-image.bb: -------------------------------------------------------------------------------- 1 | require recipes-extended/images/core-image-full-cmdline.bb 2 | 3 | IMAGE_INSTALL:append = " mender-app-update" -------------------------------------------------------------------------------- /kas/demos/meta-mender-raspberrypi-wifi/README: -------------------------------------------------------------------------------- 1 | This README file contains information on the contents of the meta-mender-raspberrypi-wifi layer. 2 | 3 | Please see the corresponding sections below for details. 4 | 5 | Dependencies 6 | ============ 7 | URI: https://git.yoctoproject.org/poky 8 | branch: scarthgap 9 | 10 | URI: https://git.openembedded.org/meta-openembedded 11 | branch: scarthgap 12 | 13 | URI: https://github.com/mendersoftware/meta-mender 14 | branch: scarthgap 15 | 16 | URI: https://github.com/agherzan/meta-raspberrypi 17 | branch: scarthgap 18 | 19 | Contributions 20 | ============= 21 | 22 | Please the README file in the top level directory. 23 | 24 | Table of Contents 25 | ================= 26 | 27 | I. Adding the meta-mender-raspberrypi-wifi layer to your build 28 | II. Purpose 29 | III. Legal notice 30 | IV. Included functionality 31 | 32 | 33 | I. Adding the meta-mender-raspberrypi-wifi layer to your build 34 | ================================================= 35 | 36 | Run 'bitbake-layers add-layer meta-mender-raspberrypi-wifi' 37 | 38 | II. Purpose 39 | =========== 40 | 41 | The layer contains an example setup for a Yocto build which enables 42 | wifi on a Raspberry Pi 4 including SSID/password configuration. 43 | 44 | The example image "core-image-raspberrypi-wifi" does so based on a 45 | `core-image-base` image. 46 | 47 | III. Legal notice 48 | ================= 49 | 50 | The layer requires accepting the "synaptics-killswitch" license as 51 | documented at https://meta-raspberrypi.readthedocs.io/en/latest/ipcompliance.html#linux-firmware-rpidistro 52 | 53 | The kas file [`raspberrypi4-64-state-scripts.yml`](../raspberrypi4-64-wifi.yml) therefore adds the directive 54 | ``` 55 | LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch" 56 | ``` 57 | in order to be functional. Please note that this is for the sake of 58 | testing, and by default not suitable for redistribution. 59 | 60 | IV. Included functionality 61 | ========================== 62 | 63 | The `wificonfig` package is the core trigger for the example functionality, 64 | so adding it to other images will enable most of the functionality. 65 | 66 | By setting the DEMO_WIFI_SSID and DEMO_WIFI_PASSKEY variables in your configuration, 67 | you can inject SSID and password for the desired network into the image. -------------------------------------------------------------------------------- /kas/demos/meta-mender-raspberrypi-wifi/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 += "meta-mender-raspberrypi-wifi" 9 | BBFILE_PATTERN_meta-mender-raspberrypi-wifi = "^${LAYERDIR}/" 10 | BBFILE_PRIORITY_meta-mender-raspberrypi-wifi = "6" 11 | 12 | LAYERDEPENDS_meta-mender-raspberrypi-wifi = "core" 13 | LAYERSERIES_COMPAT_meta-mender-raspberrypi-wifi = "scarthgap" 14 | -------------------------------------------------------------------------------- /kas/demos/meta-mender-raspberrypi-wifi/recipes-raspberrypi/images/core-image-raspberrypi-wifi.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "A console-only image that fully supports the target device \ 2 | hardware." 3 | 4 | inherit core-image 5 | 6 | IMAGE_INSTALL:append = " \ 7 | wificonfig \ 8 | " -------------------------------------------------------------------------------- /kas/demos/meta-mender-raspberrypi-wifi/recipes-raspberrypi/wificonfig/files/wlan.network: -------------------------------------------------------------------------------- 1 | [Match] 2 | Name=wlan* 3 | 4 | [Network] 5 | DHCP=ipv4 6 | 7 | [DHCPv4] 8 | UseHostname=false 9 | -------------------------------------------------------------------------------- /kas/demos/meta-mender-raspberrypi-wifi/recipes-raspberrypi/wificonfig/wificonfig_1.0.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "networkctl matcher config for bringing up wlan*" 2 | 3 | LICENSE = "Apache-2.0" 4 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" 5 | 6 | SRC_URI = " \ 7 | file://wlan.network \ 8 | " 9 | 10 | RDEPENDS:${PN} = "systemd wpa-supplicant" 11 | 12 | do_install() { 13 | install -d 755 ${D}${sysconfdir}/systemd 14 | install -d 755 ${D}${sysconfdir}/systemd/network 15 | install -m 644 ${WORKDIR}/wlan.network ${D}${sysconfdir}/systemd/network/wlan.network 16 | } 17 | 18 | FILES_${PN} = " \ 19 | ${sysconfdir}/systemd/network/wlan.network \ 20 | " 21 | 22 | do_configure[noexec] = "1" 23 | do_compile[noexec] = "1" 24 | -------------------------------------------------------------------------------- /kas/demos/meta-mender-raspberrypi-wifi/recipes-raspberrypi/wpa-supplicant/files/wpa_supplicant-wlan0.conf: -------------------------------------------------------------------------------- 1 | ctrl_interface=/var/run/wpa_supplicant 2 | ctrl_interface_group=0 3 | update_config=1 4 | 5 | network={ 6 | ssid="@DEMO_WIFI_SSID@" 7 | scan_ssid=1 8 | psk="@DEMO_WIFI_PASSKEY@" 9 | } 10 | -------------------------------------------------------------------------------- /kas/demos/meta-mender-raspberrypi-wifi/recipes-raspberrypi/wpa-supplicant/wpa-supplicant_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend:mender-systemd := "${THISDIR}/files:" 2 | 3 | SRC_URI:append:mender-systemd = " file://wpa_supplicant-wlan0.conf" 4 | 5 | FILES:${PN}:append:mender-systemd = " /data/wpa_supplicant/wpa_supplicant-nl80211-wlan0.conf" 6 | 7 | DEMO_WIFI_SSID ?= "ssid" 8 | DEMO_WIFI_PASSKEY ?= "password" 9 | 10 | do_install:append:mender-systemd() { 11 | install -d ${D}${sysconfdir}/wpa_supplicant 12 | 13 | sed -i -e 's#[@]DEMO_WIFI_PASSKEY[@]#${DEMO_WIFI_PASSKEY}#' ${WORKDIR}/wpa_supplicant-wlan0.conf 14 | sed -i -e 's#[@]DEMO_WIFI_SSID[@]#${DEMO_WIFI_SSID}#' ${WORKDIR}/wpa_supplicant-wlan0.conf 15 | 16 | install -d ${D}/data 17 | install -d ${D}/data/wpa_supplicant 18 | install -m 0755 ${WORKDIR}/wpa_supplicant-wlan0.conf ${D}/data/wpa_supplicant/wpa_supplicant-nl80211-wlan0.conf 19 | ln -s /data/wpa_supplicant/wpa_supplicant-nl80211-wlan0.conf ${D}${sysconfdir}/wpa_supplicant/wpa_supplicant-nl80211-wlan0.conf 20 | 21 | # Make sure the system directory for systemd exists. 22 | install -d ${D}${sysconfdir}/systemd/system/multi-user.target.wants/ 23 | 24 | # Link the service file for autostart. 25 | ln -s ${systemd_unitdir}/system/wpa_supplicant-nl80211@.service \ 26 | ${D}${sysconfdir}/systemd/system/multi-user.target.wants/wpa_supplicant-nl80211@wlan0.service 27 | } 28 | -------------------------------------------------------------------------------- /kas/demos/qemuarm64-bootloader-validation.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 11 3 | includes: 4 | - kas/qemuarm64.yml 5 | 6 | repos: 7 | meta-mender: 8 | # note: this is the first commit to support the 9 | # "mender-prepopulate-inactive-partition" 10 | commit: 3d6099368742f1a461fb0aa14eccd2284c98f3b2 11 | 12 | meta-mender-community: 13 | layers: 14 | meta-mender-validation: 15 | 16 | local_conf_header: 17 | bootloader-validation: | 18 | MENDER_FEATURES_ENABLE:append = " mender-prepopulate-inactive-partition" 19 | IMAGE_INSTALL:append = " bootloader-validation" 20 | -------------------------------------------------------------------------------- /kas/demos/qemuarm64-client-only.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-base.yml 5 | 6 | repos: 7 | meta-openembedded: 8 | layers: 9 | meta-python: 10 | meta-networking: 11 | meta-filesystems: 12 | 13 | meta-mender: 14 | layers: 15 | meta-mender-demo: 16 | 17 | meta-mender-community: 18 | layers: 19 | meta-mender-client-only: 20 | 21 | local_conf_header: 22 | no-full-client: | 23 | MENDER_EFI_LOADER = "" 24 | MENDER_UPDATE_POLL_INTERVAL_SECONDS = "5" 25 | MENDER_INVENTORY_POLL_INTERVAL_SECONDS = "5" 26 | MENDER_RETRY_POLL_INTERVAL_SECONDS = "30" 27 | IMAGE_INSTALL:append = "mender-auth mender-update mender-connect" 28 | # quickfix: adding mender-systemd to fix packaging of mender-connect 29 | DISTROOVERRIDES:append = ":mender-systemd" 30 | 31 | machine: qemuarm64 32 | -------------------------------------------------------------------------------- /kas/demos/raspberrypi4-64-app-updates.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/raspberrypi4-64.yml 5 | 6 | repos: 7 | meta-openembedded: 8 | layers: 9 | meta-python: 10 | meta-networking: 11 | meta-filesystems: 12 | 13 | meta-virtualization: 14 | url: git://git.yoctoproject.org/meta-virtualization 15 | refspec: scarthgap 16 | 17 | meta-mender: 18 | layers: 19 | meta-mender-demo: 20 | 21 | meta-mender-community: 22 | layers: 23 | meta-mender-update-modules: 24 | kas/demos/meta-mender-demo-app-updates: 25 | 26 | local_conf_header: 27 | app-updates: | 28 | MENDER_STORAGE_TOTAL_SIZE_MB_DEFAULT = "2048" 29 | BBMASK += "meta-virtualization/dynamic-layers/raspberrypi" 30 | DISTRO_FEATURES:append = " virtualization" 31 | 32 | target: 33 | - mender-app-update-image 34 | -------------------------------------------------------------------------------- /kas/demos/raspberrypi4-64-wifi.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/raspberrypi4-64.yml 5 | 6 | repos: 7 | meta-mender-community: 8 | layers: 9 | meta-mender-update-modules: 10 | kas/demos/meta-mender-raspberrypi-wifi: 11 | 12 | local_conf_header: 13 | wifi: | 14 | DEMO_WIFI_SSID = "Demo_SSID" 15 | DEMO_WIFI_PASSKEY = "Demo_Password" 16 | LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch" 17 | 18 | target: 19 | - core-image-raspberrypi-wifi 20 | -------------------------------------------------------------------------------- /kas/imx93-var-som.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/arm.yml 6 | 7 | repos: 8 | meta-mender-community: 9 | layers: 10 | meta-mender-variscite: 11 | 12 | meta-openembedded: 13 | layers: 14 | meta-filesystems: 15 | meta-multimedia: 16 | meta-networking: 17 | meta-oe: 18 | meta-python: 19 | 20 | meta-freescale: 21 | url: https://github.com/Freescale/meta-freescale 22 | refspec: scarthgap 23 | 24 | meta-freescale-3rdparty: 25 | url: https://github.com/Freescale/meta-freescale-3rdparty 26 | refspec: scarthgap 27 | 28 | meta-freescale-distro: 29 | url: https://github.com/Freescale/meta-freescale-distro 30 | refspec: scarthgap 31 | 32 | meta-nxp: 33 | url: https://github.com/nxp-imx/meta-imx 34 | refspec: scarthgap 35 | layers: 36 | meta-bsp: 37 | meta-sdk: 38 | 39 | meta-variscite-bsp-common: 40 | url: https://github.com/varigit/meta-variscite-bsp-common 41 | refspec: scarthgap 42 | 43 | meta-variscite-bsp-imx: 44 | url: https://github.com/varigit/meta-variscite-bsp-imx 45 | refspec: scarthgap 46 | 47 | local_conf_header: 48 | imx93-var-som: | 49 | MENDER_BOOT_PART_SIZE_MB = "64" 50 | MENDER_STORAGE_TOTAL_SIZE_MB = "4096" 51 | MENDER_FEATURES_ENABLE:append = " mender-uboot mender-image-sd" 52 | MENDER_FEATURES_DISABLE:append = " mender-grub mender-image-uefi" 53 | IMAGE_BOOT_FILES = "" 54 | MENDER_IMAGE_BOOTLOADER_FILE = "imx-boot" 55 | MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET = "64" 56 | MENDER_BOOT_PART_SIZE_MB = "0" 57 | MENDER_PARTITION_ALIGNMENT = "8388608" 58 | MENDER_STORAGE_DEVICE = "/dev/mmcblk1" 59 | MENDER_UBOOT_CONFIG_SYS_MMC_ENV_PART = "1" 60 | ACCEPT_FSL_EULA = "1" 61 | 62 | machine: imx93-var-som 63 | distro: fsl-imx-xwayland 64 | -------------------------------------------------------------------------------- /kas/include/arm.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | 4 | repos: 5 | meta-arm: 6 | url: https://git.yoctoproject.org/meta-arm 7 | commit: 8e0f8af90fefb03f08cd2228cde7a89902a6b37c 8 | layers: 9 | meta-arm: 10 | meta-arm-toolchain: 11 | -------------------------------------------------------------------------------- /kas/include/mender-base.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | 4 | distro: poky 5 | 6 | repos: 7 | poky: 8 | url: git://git.yoctoproject.org/poky 9 | commit: c162696dae5798e2ab1198403d0bc1d65d64068d 10 | layers: 11 | meta: 12 | meta-poky: 13 | meta-yocto-bsp: 14 | 15 | meta-openembedded: 16 | url: git://git.openembedded.org/meta-openembedded 17 | commit: e92d0173a80ea7592c866618ef5293203c50544c 18 | layers: 19 | meta-oe: 20 | 21 | meta-mender: 22 | url: https://github.com/mendersoftware/meta-mender.git 23 | commit: 0d393c2267a92091f975eb932338c07109f5f5fd 24 | 25 | layers: 26 | meta-mender-core: 27 | 28 | local_conf_header: 29 | base: | 30 | CONF_VERSION = "2" 31 | PACKAGE_CLASSES = "package_ipk" 32 | INIT_MANAGER = "systemd" 33 | 34 | mender-artifact: | 35 | MENDER_ARTIFACT_NAME = "gha_autobuild" 36 | 37 | target: 38 | - core-image-minimal 39 | -------------------------------------------------------------------------------- /kas/include/mender-full-ubi.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-base.yml 5 | 6 | local_conf_header: 7 | mender-full: | 8 | INHERIT += "mender-full-ubi" 9 | -------------------------------------------------------------------------------- /kas/include/mender-full.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-base.yml 5 | 6 | local_conf_header: 7 | mender-full: | 8 | INHERIT += "mender-full" 9 | -------------------------------------------------------------------------------- /kas/include/nxp.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | 4 | repos: 5 | meta-freescale: 6 | url: https://github.com/Freescale/meta-freescale.git 7 | # branch: scarthgap 8 | commit: f52fe2b709e70d1d864adfad2754213bce7abcd7 9 | meta-freescale-3rdparty: 10 | url: https://github.com/Freescale/meta-freescale-3rdparty.git 11 | # branch: scarthgap 12 | commit: 70c83e96c7f75e73245cb77f1b0cada9ed4bbc6d 13 | meta-freescale-distro: 14 | url: https://github.com/Freescale/meta-freescale-distro.git 15 | # branch: scarthgap 16 | commit: b9d6a5d9931922558046d230c1f5f4ef6ee72345 17 | 18 | meta-mender-community: 19 | layers: 20 | meta-mender-nxp: 21 | 22 | distro: poky 23 | 24 | local_conf_header: 25 | nxp: | 26 | ACCEPT_FSL_EULA = "1" 27 | MENDER_BOOT_PART_SIZE_MB = "64" 28 | MENDER_FEATURES_ENABLE:append = " mender-uboot mender-image-sd" 29 | MENDER_FEATURES_DISABLE:append = " mender-grub mender-image-uefi" 30 | -------------------------------------------------------------------------------- /kas/include/qemu.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | 4 | repos: 5 | meta-mender: 6 | layers: 7 | meta-mender-qemu: 8 | -------------------------------------------------------------------------------- /kas/include/raspberrypi.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | 4 | repos: 5 | meta-raspberrypi: 6 | url: https://github.com/agherzan/meta-raspberrypi.git 7 | commit: 3b27c95c163a042f8056066ec3d27edfcc42da7f 8 | 9 | meta-lts-mixins: 10 | url: https://git.yoctoproject.org/meta-lts-mixins 11 | commit: 66ceeebd047d7fdfc8668b300319a76da8ae257d 12 | 13 | meta-mender-community: 14 | layers: 15 | meta-mender-raspberrypi: 16 | 17 | local_conf_header: 18 | raspberrypi: | 19 | RPI_USE_U_BOOT = "1" 20 | ENABLE_UART = "1" 21 | MENDER_BOOT_PART_SIZE_MB = "100" 22 | IMAGE_INSTALL:append = " kernel-image kernel-devicetree" 23 | IMAGE_FSTYPES:remove = " rpi-sdimg" 24 | -------------------------------------------------------------------------------- /kas/include/rockchip.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | 4 | repos: 5 | meta-rockchip: 6 | url: https://git.yoctoproject.org/meta-rockchip 7 | commit: 63a3d6fa336318dffb3e5bb913bc239026ae9015 8 | 9 | meta-mender-community: 10 | layers: 11 | meta-mender-rockchip: 12 | 13 | local_conf_header: 14 | rockchip: | 15 | MENDER_FEATURES_ENABLE:append = " mender-uboot mender-image mender-image-sd" 16 | MENDER_FEATURES_DISABLE:append = " mender-grub mender-image-uefi" 17 | IMAGE_FSTYPES:remove = "wic wic.bmap mender.bmap" 18 | MENDER_PARTITION_ALIGNMENT = "10485760" 19 | MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET = "64" 20 | IMAGE_INSTALL:append = " kernel-modules " 21 | -------------------------------------------------------------------------------- /kas/include/tegra-base.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | 4 | repos: 5 | meta-mender: 6 | commit: 2f70dbad1441055c299332b7ef33dfe1e4f50c1c # this one fixes the persistent-id for now! 7 | 8 | meta-tegra: 9 | url: https://github.com/OE4T/meta-tegra.git 10 | meta-tegra-community: 11 | url: https://github.com/OE4T/meta-tegra-community.git 12 | meta-tegrademo: 13 | url: https://github.com/OE4T/tegra-demo-distro.git 14 | layers: 15 | layers/meta-tegra-support: 16 | layers/meta-demo-ci: 17 | layers/meta-tegrademo: 18 | 19 | meta-openembedded: 20 | layers: 21 | meta-filesystems: 22 | meta-networking: 23 | meta-python: 24 | 25 | meta-virtualization: 26 | url: https://git.yoctoproject.org/meta-virtualization.git 27 | commit: 6a80f140e387621f62964209a2e07d3bcfb125ce 28 | 29 | meta-mender-community: 30 | layers: 31 | meta-mender-tegra/meta-mender-tegra-common: 32 | 33 | distro: tegrademo 34 | 35 | local_conf_header: 36 | tegra: | 37 | # these two classes only work as intended when being inherited in the 38 | # OE4t setup-env.sh style environment, as they modify bblayers.conf 39 | # and expect additional information on the host. 40 | INHERIT:remove = "tegra-support-sanity distro_layer_buildinfo" 41 | INHERIT += "tegra-mender-setup" 42 | MENDER_FEATURES_ENABLE:append = " mender-growfs-data" 43 | MENDER_FEATURES_DISABLE:append = " mender-uboot" 44 | IMAGE_FSTYPES:tegra = "tegraflash mender dataimg" 45 | IMAGE_FSTYPES:pn-tegra-minimal-initramfs:tegra = "${INITRAMFS_FSTYPES}" 46 | IMAGE_FSTYPES:pn-tegra-initrd-flash-initramfs:tegra = "${TEGRA_INITRD_FLASH_INITRAMFS_FSTYPES}" 47 | -------------------------------------------------------------------------------- /kas/include/tegra-jetpack5.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | 4 | includes: 5 | - kas/include/tegra-base.yml 6 | 7 | repos: 8 | meta-tegra: 9 | # refers to the scarthgap-l4t-r35.x branch 10 | commit: e836736de0a439c8893ede4cef6973bd6347affa 11 | meta-tegra-community: 12 | # refers to the scarthgap-l4t-r35.x branch 13 | commit: c03675e45fa229a4c067f5bd2e8461b713d789f4 14 | meta-tegrademo: 15 | # refers to the scarthgap-l4t-r35.x branch 16 | commit: a9132a76ae8f35a962e5970fdd422fa0c2fc6fc1 17 | 18 | meta-mender-community: 19 | layers: 20 | meta-mender-tegra/meta-mender-tegra-jetpack5: 21 | -------------------------------------------------------------------------------- /kas/include/tegra-jetpack6.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | 4 | includes: 5 | - kas/include/tegra-base.yml 6 | 7 | repos: 8 | meta-tegra: 9 | # refers to the scarthgap branch 10 | commit: 8f9748b0178a4d93bceffd86d9d436cd0e685750 11 | meta-tegra-community: 12 | # refers to the scarthgap branch 13 | commit: 241d1073ba8e610ef8da3fe8470b0a4d0567521f 14 | meta-tegrademo: 15 | # refers to the scarthgap branch 16 | commit: 3f2641444d6c50c3fa4eea8a4c770bd30db70ee9 17 | 18 | meta-mender-community: 19 | layers: 20 | meta-mender-tegra/meta-mender-tegra-jetpack6: 21 | -------------------------------------------------------------------------------- /kas/include/ti.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | 4 | repos: 5 | meta-ti: 6 | url: https://git.yoctoproject.org/meta-ti 7 | commit: d62c047d4b8424603c6996a5755cf7004bd13254 8 | layers: 9 | meta-ti-bsp: 10 | -------------------------------------------------------------------------------- /kas/include/validation.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | 4 | repos: 5 | meta-mender-community: 6 | layers: 7 | meta-mender-validation: 8 | 9 | local_conf_header: 10 | validation: | 11 | MENDER_FEATURES_ENABLE:append = " mender-prepopulate-inactive-partition " 12 | MENDER_FEATURES_DISABLE:append = " mender-growfs-data " 13 | 14 | target: 15 | - mender-validation-image -------------------------------------------------------------------------------- /kas/nezha-allwinner-d1.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | 6 | repos: 7 | meta-mender-community: 8 | layers: 9 | meta-mender-riscv: 10 | 11 | meta-riscv: 12 | url: https://github.com/riscv/meta-riscv 13 | commit: 76727db91108f53afc8a5b72651167c4446b5fcb 14 | 15 | machine: nezha-allwinner-d1 16 | 17 | local_conf_header: 18 | nezha-allwinner-d1: | 19 | MENDER_FEATURES_ENABLE:append = " mender-uboot mender-image-sd " 20 | MENDER_FEATURES_DISABLE:append = " mender-grub mender-image-uefi " 21 | MENDER_IMAGE_BOOTLOADER_FILE = "u-boot-sunxi-with-spl.bin" 22 | MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET = "16" 23 | # this is just a dummy, as the current state of Mender wants a declared DTB 24 | MENDER_DTB_NAME_FORCE = "allwinner/sun20i-d1-nezha.dtb" 25 | CORE_IMAGE_EXTRA_INSTALL:append = " kernel-image kernel-modules " -------------------------------------------------------------------------------- /kas/olimex-imx8mp-evb.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/nxp.yml 6 | 7 | machine: olimex-imx8mp-evb 8 | 9 | target: 10 | - core-image-base 11 | 12 | local_conf_header: 13 | olimex-imx8mp-evb: | 14 | MENDER_IMAGE_BOOTLOADER_FILE = "imx-boot" 15 | MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET = "64" 16 | MENDER_UBOOT_STORAGE_INTERFACE = "mmc" 17 | MENDER_UBOOT_STORAGE_DEVICE = "1" 18 | MENDER_STORAGE_DEVICE = "/dev/mmcblk1" 19 | IMAGE_BOOT_FILES:append = "boot.scr" 20 | -------------------------------------------------------------------------------- /kas/qemuarm64.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/arm.yml 6 | - kas/include/qemu.yml 7 | 8 | repos: 9 | meta-mender-community: 10 | layers: 11 | meta-mender-qemu-community: 12 | 13 | local_conf_header: 14 | efi: | 15 | EFI_PROVIDER = "grub-efi" 16 | MACHINE_FEATURES += "efi" 17 | MENDER_EFI_LOADER = "edk2-firmware" 18 | MENDER_STORAGE_DEVICE = "/dev/vda" 19 | 20 | qemu: | 21 | QB_MACHINE = "-machine virt,secure=on" 22 | QB_OPT_APPEND += "-no-acpi" 23 | QB_MEM = "-m 2048" 24 | QB_DEFAULT_FSTYPE = "uefiimg" 25 | QB_DEFAULT_BIOS = "QEMU_EFI.fd" 26 | QB_ROOTFS_OPT = "" 27 | QB_KERNEL_ROOT = "/dev/vda2" 28 | 29 | machine: qemuarm64 30 | -------------------------------------------------------------------------------- /kas/qemux86-64.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/qemu.yml 6 | 7 | machine: qemux86-64 8 | 9 | local_conf_header: 10 | qemu: | 11 | MENDER_STORAGE_DEVICE = "/dev/vda" 12 | QB_DEFAULT_FSTYPE = "uefiimg" 13 | QB_KERNEL_ROOT = "/dev/vda2" 14 | -------------------------------------------------------------------------------- /kas/raspberrypi-cm.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/raspberrypi.yml 6 | 7 | machine: raspberrypi-cm 8 | -------------------------------------------------------------------------------- /kas/raspberrypi-cm3.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/raspberrypi.yml 6 | 7 | machine: raspberrypi-cm3 8 | -------------------------------------------------------------------------------- /kas/raspberrypi.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/raspberrypi.yml 6 | 7 | machine: raspberrypi 8 | -------------------------------------------------------------------------------- /kas/raspberrypi0-2w-64.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/raspberrypi.yml 6 | 7 | machine: raspberrypi0-2w-64 8 | -------------------------------------------------------------------------------- /kas/raspberrypi0-2w.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/raspberrypi.yml 6 | 7 | machine: raspberrypi0-2w 8 | -------------------------------------------------------------------------------- /kas/raspberrypi0-wifi.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/raspberrypi.yml 6 | 7 | machine: raspberrypi0-wifi 8 | -------------------------------------------------------------------------------- /kas/raspberrypi0.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/raspberrypi.yml 6 | 7 | machine: raspberrypi0 8 | -------------------------------------------------------------------------------- /kas/raspberrypi2.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/raspberrypi.yml 6 | 7 | machine: raspberrypi2 8 | -------------------------------------------------------------------------------- /kas/raspberrypi3-64.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/raspberrypi.yml 6 | 7 | machine: raspberrypi3-64 8 | -------------------------------------------------------------------------------- /kas/raspberrypi3.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/raspberrypi.yml 6 | 7 | machine: raspberrypi3 8 | -------------------------------------------------------------------------------- /kas/raspberrypi4-64.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/raspberrypi.yml 6 | 7 | machine: raspberrypi4-64 8 | -------------------------------------------------------------------------------- /kas/raspberrypi4.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/raspberrypi.yml 6 | 7 | machine: raspberrypi4 8 | -------------------------------------------------------------------------------- /kas/raspberrypi5.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/raspberrypi.yml 6 | 7 | machine: raspberrypi5 8 | 9 | local_conf_header: 10 | raspberrypi5: | 11 | KERNEL_IMAGETYPE_UBOOT ?= "Image" 12 | KERNEL_BOOTCMD ?= "booti" 13 | UBOOT_MACHINE = "rpi_arm64_config" 14 | 15 | raspberrypi5_BCM2712D0: | 16 | # at least the 2GB RAM version uses the D0 chip variant, which requires this 17 | RPI_KERNEL_DEVICETREE_OVERLAYS:append = " overlays/bcm2712d0.dtbo" 18 | -------------------------------------------------------------------------------- /kas/rock-4c-plus.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/arm.yml 6 | - kas/include/rockchip.yml 7 | 8 | machine: rock-4c-plus 9 | 10 | # This is the setup for MMC microSD cards. The rock-4c-plus has other boot options e.g. emmc which is /dev/mmcblk0 11 | # kernel-module-dwmac-rk is the driver for the ethernet it is a kernel module (which can't be build in ) 12 | # it isn't install in minimal mender yocto builds 13 | local_conf_header: 14 | rock-4c-plus: | 15 | MENDER_UBOOT_STORAGE_INTERFACE = "mmc" 16 | MENDER_UBOOT_STORAGE_DEVICE = "1" 17 | IMAGE_CLASSES += "rockchip-sdimg" 18 | MENDER_STORAGE_DEVICE = "/dev/mmcblk1" -------------------------------------------------------------------------------- /kas/tegra/jetpack5/jetson-agx-orin-devkit-64.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/tegra-jetpack5.yml 6 | 7 | machine: p3737-0000-p3701-0005 8 | 9 | local_conf_header: 10 | AB-upgrades: | 11 | USE_REDUNDANT_FLASH_LAYOUT_DEFAULT = "1" 12 | -------------------------------------------------------------------------------- /kas/tegra/jetpack5/jetson-agx-orin-devkit.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/tegra-jetpack5.yml 6 | 7 | machine: jetson-agx-orin-devkit 8 | 9 | local_conf_header: 10 | AB-upgrades: | 11 | USE_REDUNDANT_FLASH_LAYOUT_DEFAULT = "1" -------------------------------------------------------------------------------- /kas/tegra/jetpack5/jetson-agx-xavier-devkit.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | 4 | includes: 5 | - kas/include/mender-full.yml 6 | - kas/include/tegra-jetpack5.yml 7 | 8 | machine: jetson-agx-xavier-devkit 9 | 10 | local_conf_header: 11 | AB-upgrades: | 12 | USE_REDUNDANT_FLASH_LAYOUT_DEFAULT = "1" 13 | -------------------------------------------------------------------------------- /kas/tegra/jetpack5/jetson-orin-16gb-nx-p3786.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/tegra-jetpack5.yml 6 | 7 | machine: p3768-0000-p3767-0000 8 | 9 | local_conf_header: 10 | AB-upgrades: | 11 | USE_REDUNDANT_FLASH_LAYOUT_DEFAULT = "1" 12 | eMMC: | 13 | # equivalent: EMMC_SIZE = "32 * 1024 * 1024 * 1024" 14 | EMMC_SIZE = "34359738368" 15 | # id defined in custom partition layout 16 | MENDER_DATA_PART_NUMBER = "17" 17 | MENDER_STORAGE_DEVICE = "/dev/nvme0n1" 18 | -------------------------------------------------------------------------------- /kas/tegra/jetpack5/jetson-orin-nano-devkit.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/tegra-jetpack5.yml 6 | 7 | machine: jetson-orin-nano-devkit 8 | 9 | local_conf_header: 10 | AB-upgrades: | 11 | UBOOT_EXTLINUX = "1" 12 | USE_REDUNDANT_FLASH_LAYOUT_DEFAULT = "1" 13 | eMMC: | 14 | # equivalent: EMMC_SIZE = "32 * 1024 * 1024 * 1024" 15 | EMMC_SIZE = "34359738368" 16 | -------------------------------------------------------------------------------- /kas/tegra/jetpack6/jetson-agx-orin-devkit-64.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/tegra-jetpack6.yml 6 | 7 | machine: p3737-0000-p3701-0005 8 | 9 | local_conf_header: 10 | AB-upgrades: | 11 | USE_REDUNDANT_FLASH_LAYOUT_DEFAULT = "1" 12 | -------------------------------------------------------------------------------- /kas/tegra/jetpack6/jetson-agx-orin-devkit.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/tegra-jetpack6.yml 6 | 7 | machine: jetson-agx-orin-devkit 8 | 9 | local_conf_header: 10 | AB-upgrades: | 11 | USE_REDUNDANT_FLASH_LAYOUT_DEFAULT = "1" -------------------------------------------------------------------------------- /kas/tegra/jetpack6/jetson-orin-16gb-nx-p3786.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/tegra-jetpack6.yml 6 | 7 | machine: p3768-0000-p3767-0000 8 | 9 | local_conf_header: 10 | AB-upgrades: | 11 | USE_REDUNDANT_FLASH_LAYOUT_DEFAULT = "1" 12 | eMMC: | 13 | # equivalent: EMMC_SIZE = "32 * 1024 * 1024 * 1024" 14 | EMMC_SIZE = "34359738368" 15 | # id defined in custom partition layout 16 | MENDER_DATA_PART_NUMBER = "17" 17 | MENDER_STORAGE_DEVICE = "/dev/nvme0n1" 18 | -------------------------------------------------------------------------------- /kas/tegra/jetpack6/jetson-orin-nano-devkit.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | - kas/include/tegra-jetpack6.yml 6 | 7 | machine: jetson-orin-nano-devkit 8 | 9 | local_conf_header: 10 | AB-upgrades: | 11 | UBOOT_EXTLINUX = "1" 12 | USE_REDUNDANT_FLASH_LAYOUT_DEFAULT = "1" 13 | eMMC: | 14 | # equivalent: EMMC_SIZE = "32 * 1024 * 1024 * 1024" 15 | EMMC_SIZE = "34359738368" 16 | -------------------------------------------------------------------------------- /kas/vexpress-qemu-flash.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full-ubi.yml 5 | - kas/include/qemu.yml 6 | 7 | machine: vexpress-qemu-flash -------------------------------------------------------------------------------- /kas/vexpress-qemu.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-base.yml 5 | - kas/include/qemu.yml 6 | 7 | machine: vexpress-qemu 8 | 9 | local_conf_header: 10 | mender-efi: | 11 | MENDER_EFI_LOADER = "" 12 | -------------------------------------------------------------------------------- /kas/x86-virtual.yml: -------------------------------------------------------------------------------- 1 | header: 2 | version: 14 3 | includes: 4 | - kas/include/mender-full.yml 5 | 6 | repos: 7 | meta-intel: 8 | url: https://git.yoctoproject.org/meta-intel 9 | refspec: scarthgap 10 | 11 | local_conf_header: 12 | x86-virtual: | 13 | # The size of core-image-base is 936 MB, meaning that if one tries to build 14 | # that specific image you get an build error saying that it does not fit in the 15 | # allocated part. This is because the default *total size* is set to 1024MB in 16 | # mender-setup.bbclass, this value is used to calculate IMAGE_ROOTFS_MAXSIZE 17 | # 18 | # Lets increase the total storage as the core-image-base target is quite 19 | # common and is the only image type that fully supports target device hardware. 20 | MENDER_STORAGE_TOTAL_SIZE_MB_DEFAULT = "4096" 21 | IMAGE_FSTYPES += "uefiimg.vmdk" 22 | 23 | machine: intel-corei7-64 24 | -------------------------------------------------------------------------------- /meta-mender-beaglebone/README.md: -------------------------------------------------------------------------------- 1 | # meta-mender-beaglebone 2 | 3 | Mender integration for Beaglebone boards 4 | 5 | The supported and tested boards are: 6 | 7 | - [BeagleBone Black](https://hub.mender.io/t/beaglebone-black/83) 8 | 9 | 10 | Visit the individual board links above for more information on status of the 11 | integration and more detailed instructions on how to build and use images 12 | together with Mender for the mentioned boards. 13 | 14 | ## Dependencies 15 | 16 | This layer depends on: 17 | 18 | ``` 19 | URI: https://git.yoctoproject.org/git/poky 20 | branch: scarthgap 21 | revision: HEAD 22 | ``` 23 | 24 | ``` 25 | URI: https://github.com/mendersoftware/meta-mender.git 26 | layers: meta-mender-core 27 | branch: scarthgap 28 | revision: HEAD 29 | ``` 30 | 31 | ## Quick start 32 | 33 | See the top level [README](../README.md) for instructions to build using the `kas` tool. Supported configurations are 34 | 35 | - [`beaglebone.yml`](../kas/beaglebone.yml) 36 | - [`beaglebone-uboot.yml`](../kas/beaglebone-uboot.yml) 37 | -------------------------------------------------------------------------------- /meta-mender-beaglebone/conf/layer.conf: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Northern.tech AS 2 | 3 | # We have a conf and classes directory, add to BBPATH 4 | BBPATH .= ":${LAYERDIR}" 5 | 6 | # We have recipes-* directories, add to BBFILES 7 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ 8 | ${LAYERDIR}/recipes-*/*/*.bbappend" 9 | 10 | BBFILE_COLLECTIONS += "mender-community-beaglebone" 11 | BBFILE_PATTERN_mender-community-beaglebone = "^${LAYERDIR}/" 12 | BBFILE_PRIORITY_mender-community-beaglebone = "92" 13 | LAYERSERIES_COMPAT_mender-community-beaglebone = "scarthgap" 14 | -------------------------------------------------------------------------------- /meta-mender-beaglebone/recipes-bsp/u-boot/files/reduce-spl-size.cfg: -------------------------------------------------------------------------------- 1 | # CONFIG_SPL_USB_GADGET is not set 2 | # CONFIG_SPL_USB_ETHER is not set 3 | # CONFIG_SPL_USB_ETH_RNDIS is not set 4 | # CONFIG_SPL_MUSB_NEW is not set 5 | -------------------------------------------------------------------------------- /meta-mender-beaglebone/recipes-bsp/u-boot/u-boot_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | SRC_URI:append:mender-uboot:beaglebone-yocto = " file://reduce-spl-size.cfg " 4 | 5 | MENDER_UBOOT_PRE_SETUP_COMMANDS:beaglebone-yocto = "run findfdt; setenv mender_dtb_name \${fdtfile}" 6 | MENDER_UBOOT_PRE_SETUP_COMMANDS:append:beaglebone-yocto:mender-uboot = "; setenv bootargs \${bootargs} rootwait" 7 | -------------------------------------------------------------------------------- /meta-mender-beaglebone/templates/bblayers.conf.sample: -------------------------------------------------------------------------------- 1 | # POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf 2 | # changes incompatibly 3 | POKY_BBLAYERS_CONF_VERSION = "2" 4 | 5 | BBPATH = "${TOPDIR}" 6 | BBFILES ?= "" 7 | 8 | BBLAYERS ?= " \ 9 | ${TOPDIR}/../sources/poky/meta \ 10 | ${TOPDIR}/../sources/poky/meta-poky \ 11 | ${TOPDIR}/../sources/poky/meta-yocto-bsp \ 12 | ${TOPDIR}/../sources/meta-mender/meta-mender-core \ 13 | ${TOPDIR}/../sources/meta-mender/meta-mender-demo \ 14 | ${TOPDIR}/../sources/meta-mender-community/meta-mender-beaglebone \ 15 | ${TOPDIR}/../sources/meta-openembedded/meta-oe \ 16 | " 17 | -------------------------------------------------------------------------------- /meta-mender-beaglebone/templates/local.conf.append: -------------------------------------------------------------------------------- 1 | 2 | # Appended fragment from meta-mender-community/meta-mender-beaglebone/templates 3 | 4 | MACHINE ?= "beaglebone-yocto" 5 | -------------------------------------------------------------------------------- /meta-mender-client-only/README: -------------------------------------------------------------------------------- 1 | This README file contains information on the contents of the meta-mender-client-only layer. 2 | 3 | Please see the corresponding sections below for details. 4 | 5 | Dependencies 6 | ============ 7 | 8 | URI: https://git.yoctoproject.org/poky 9 | branch: scarthgap 10 | 11 | URI: https://github.com/mendersoftware/meta-mender 12 | branch: scarthgap 13 | 14 | Contributions 15 | ============= 16 | 17 | Please see the README file in the top level directory. 18 | 19 | Table of Contents 20 | ================= 21 | 22 | I. Adding the meta-mender-qemu-client-only layer to your build 23 | II. Misc 24 | 25 | 26 | I. Adding the meta-mender-qemu-client-only layer to your build 27 | ================================================= 28 | 29 | Run 'bitbake-layers add-layer meta-mender-client-only' 30 | 31 | II. Misc 32 | ======== 33 | 34 | This layer enables the Mender client to be installed and operated without the full integration. With the layer added to the build, you can add `mender-auth mender-update` and optionally `mender-connect` to the `IMAGE_INSTALL` variable and have those installed. The `MACHINE` will be used as device type. 35 | 36 | With client and connect installed, you can use all Update Modules and the Troubleshoot Add-On. Installing a root filesystem update is not supported. -------------------------------------------------------------------------------- /meta-mender-client-only/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 += "meta-mender-client-only" 9 | BBFILE_PATTERN_meta-mender-client-only = "^${LAYERDIR}/" 10 | BBFILE_PRIORITY_meta-mender-client-only = "6" 11 | 12 | LAYERDEPENDS_meta-mender-client-only = "core" 13 | LAYERSERIES_COMPAT_meta-mender-client-only = "scarthgap" 14 | -------------------------------------------------------------------------------- /meta-mender-client-only/recipes-mender/mender-client/mender_%.bbappend: -------------------------------------------------------------------------------- 1 | do_configure:prepend() { 2 | if [ -n "${MENDER_FEATURES}" ]; then 3 | bbwarn "having both the Mender integration and the meta-mender-client-only layer enabled will cause unexpected effects!" 4 | fi 5 | } 6 | 7 | do_compile:append() { 8 | echo "device_type=${MACHINE}" > ${B}/device_type 9 | } 10 | 11 | do_install:append() { 12 | install -m 755 -d ${D}/${localstatedir}/lib/mender 13 | install -m 444 ${B}/device_type ${D}/${localstatedir}/lib/mender/ 14 | } 15 | 16 | RDEPENDS:${PN} = " ca-certificates" -------------------------------------------------------------------------------- /meta-mender-nxp/README.md: -------------------------------------------------------------------------------- 1 | # meta-mender-nxp 2 | 3 | Mender integration for nxp based boards 4 | 5 | The supported and tested boards are: 6 | 7 | - [Olimex iMX8MP-SOM-4GB-IND and iMX8MP-SOM-EVB-IND](https://www.olimex.com/Products/SOM/NXP-iMX8/) 8 | 9 | 10 | Visit the individual board links above for more information on status of the 11 | integration and more detailed instructions on how to build and use images 12 | together with Mender for the mentioned boards. 13 | 14 | ## Dependencies 15 | 16 | This layer depends on: 17 | 18 | ``` 19 | URI: https://github.com/Freescale/meta-freescale 20 | branch: scarthgap 21 | revision: HEAD 22 | ``` 23 | 24 | ``` 25 | URI: https://github.com/Freescale/meta-freescale-3rdparty 26 | branch: scarthgap 27 | revision: HEAD 28 | ``` 29 | 30 | ``` 31 | URI: https://github.com/Freescale/meta-freescale-distro 32 | branch: scarthgap 33 | revision: HEAD 34 | ``` 35 | 36 | ## Quick start 37 | 38 | The following commands will setup the environment and allow you to build images 39 | that have Mender integrated. 40 | 41 | 42 | ``` 43 | mkdir -p meta-mender-community/mender-nxp && cd meta-mender-community/mender-nxp 44 | kas build ../kas/olimex-imx8mp-evb.yml 45 | ``` 46 | 47 | 48 | -------------------------------------------------------------------------------- /meta-mender-nxp/conf/layer.conf: -------------------------------------------------------------------------------- 1 | # Copyright 2024, Leon Anavi 2 | 3 | # We have a conf and classes directory, add to BBPATH 4 | BBPATH .= ":${LAYERDIR}" 5 | 6 | # We have recipes-* directories, add to BBFILES 7 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ 8 | ${LAYERDIR}/recipes-*/*/*.bbappend" 9 | 10 | BBFILE_COLLECTIONS += "mender-nxp" 11 | BBFILE_PATTERN_mender-nxp = "^${LAYERDIR}/" 12 | BBFILE_PRIORITY_mender-nxp = "10" 13 | 14 | LAYERSERIES_COMPAT_mender-nxp = "scarthgap" 15 | -------------------------------------------------------------------------------- /meta-mender-nxp/recipes-bsp/u-boot-scr/files/imx93-voipac/boot.cmd: -------------------------------------------------------------------------------- 1 | setenv bootargs 'console=${console},${baudrate} root=${mender_kernel_root} rootwait rw' 2 | run mender_setup 3 | mmc dev ${mender_uboot_dev} 4 | load ${mender_uboot_root} ${loadaddr} /boot/${image} 5 | load ${mender_uboot_root} ${fdt_addr} /boot/${fdt_file} 6 | booti ${loadaddr} - ${fdt_addr} 7 | run mender_try_to_recover 8 | -------------------------------------------------------------------------------- /meta-mender-nxp/recipes-bsp/u-boot-scr/files/olimex-imx8mp-evb/boot.cmd: -------------------------------------------------------------------------------- 1 | run sr_ir_v2_cmd 2 | mmc dev 1 3 | setenv devtype mmc 4 | setenv devnum 1 5 | setenv distro_bootpart 1 6 | run scan_dev_for_efi 7 | setenv bootargs '${jh_clk} ${mcore_clk} console=${console},${baudrate} root=${mender_kernel_root} rootwait rw' 8 | run mender_setup 9 | mmc dev ${mender_uboot_dev} 10 | fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image} 11 | booti ${loadaddr} - ${fdt_addr_r} 12 | run mender_try_to_recover 13 | -------------------------------------------------------------------------------- /meta-mender-nxp/recipes-bsp/u-boot-scr/u-boot-scr.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "U-Boot boot script generator" 2 | LICENSE = "MIT" 3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" 4 | 5 | DEPENDS = "u-boot-mkimage-native" 6 | 7 | SRC_URI = "file://boot.cmd" 8 | 9 | do_compile() { 10 | mkimage -C none -A arm -T script -d "${WORKDIR}/boot.cmd" boot.scr 11 | } 12 | 13 | inherit deploy 14 | 15 | do_deploy() { 16 | install -d ${DEPLOYDIR} 17 | install -m 0644 boot.scr ${DEPLOYDIR} 18 | } 19 | 20 | addtask do_deploy after do_compile before do_build 21 | 22 | PACKAGE_ARCH = "${MACHINE_ARCH}" 23 | COMPATIBLE_MACHINE = "(olimex-imx8mp-evb|imx93-voipac)" 24 | -------------------------------------------------------------------------------- /meta-mender-nxp/recipes-bsp/u-boot/u-boot-imx/imx93-voipac/0001-imx93-voipac-evk-Enable-various-configuration-for-me.patch: -------------------------------------------------------------------------------- 1 | From 3ff0072a28d92034e488dd69e9537812502b62fd Mon Sep 17 00:00:00 2001 2 | From: Marek Belisko 3 | Date: Sat, 14 Sep 2024 23:08:30 +0200 4 | Subject: [PATCH] imx93-voipac-evk: Enable various configuration for mender 5 | 6 | Signed-off-by: Marek Belisko 7 | --- 8 | configs/imx93_voipac_evk_defconfig | 12 +++++++----- 9 | 1 file changed, 7 insertions(+), 5 deletions(-) 10 | 11 | diff --git a/configs/imx93_voipac_evk_defconfig b/configs/imx93_voipac_evk_defconfig 12 | index f342068d12f..4ea7b5b54bd 100644 13 | --- a/configs/imx93_voipac_evk_defconfig 14 | +++ b/configs/imx93_voipac_evk_defconfig 15 | @@ -7,7 +7,7 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y 16 | CONFIG_SPL_LIBGENERIC_SUPPORT=y 17 | CONFIG_NR_DRAM_BANKS=2 18 | CONFIG_SF_DEFAULT_SPEED=40000000 19 | -CONFIG_ENV_SIZE=0x4000 20 | +CONFIG_ENV_SIZE=0x20000 21 | CONFIG_ENV_OFFSET=0x700000 22 | CONFIG_DM_GPIO=y 23 | CONFIG_DEFAULT_DEVICE_TREE="imx93-voipac-evk" 24 | @@ -20,6 +20,7 @@ CONFIG_SPL_SERIAL=y 25 | CONFIG_SPL_DRIVERS_MISC=y 26 | CONFIG_SPL_STACK=0x20519dd0 27 | CONFIG_SPL=y 28 | +CONFIG_ENV_OFFSET_REDUND=0x740000 29 | CONFIG_CMD_DEKBLOB=y 30 | CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x88000000 31 | CONFIG_SYS_LOAD_ADDR=0x80400000 32 | @@ -28,6 +29,7 @@ CONFIG_SYS_MEMTEST_END=0x90000000 33 | CONFIG_REMAKE_ELF=y 34 | CONFIG_FIT=y 35 | CONFIG_FIT_SIGNATURE=y 36 | +CONFIG_LEGACY_IMAGE_FORMAT=y 37 | CONFIG_DISTRO_DEFAULTS=y 38 | CONFIG_OF_SYSTEM_SETUP=y 39 | CONFIG_BOOTCOMMAND="run sr_ir_v2_cmd;run distro_bootcmd;run bsp_bootcmd" 40 | @@ -84,10 +86,9 @@ CONFIG_CMD_EXT4_WRITE=y 41 | CONFIG_OF_CONTROL=y 42 | CONFIG_SPL_OF_CONTROL=y 43 | CONFIG_ENV_OVERWRITE=y 44 | -CONFIG_ENV_IS_NOWHERE=y 45 | CONFIG_ENV_IS_IN_MMC=y 46 | +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y 47 | CONFIG_SYS_RELOC_GD_ENV_ADDR=y 48 | -CONFIG_SYS_MMC_ENV_DEV=1 49 | CONFIG_USE_ETHPRIME=y 50 | CONFIG_ETHPRIME="eth1" 51 | CONFIG_NET_RANDOM_ETHADDR=y 52 | @@ -95,6 +96,8 @@ CONFIG_SPL_DM=y 53 | CONFIG_SYSCON=y 54 | CONFIG_ADC=y 55 | CONFIG_ADC_IMX93=y 56 | +CONFIG_BOOTCOUNT_LIMIT=y 57 | +CONFIG_BOOTCOUNT_ENV=y 58 | CONFIG_SPL_CLK_IMX93=y 59 | CONFIG_CLK_IMX93=y 60 | CONFIG_CPU=y 61 | @@ -184,7 +187,6 @@ CONFIG_VIDEO_ADV7535=y 62 | CONFIG_ULP_WATCHDOG=y 63 | CONFIG_SPL_RSA=y 64 | CONFIG_SHA384=y 65 | -CONFIG_LEGACY_IMAGE_FORMAT=y 66 | CONFIG_LZO=y 67 | CONFIG_BZIP2=y 68 | CONFIG_EFI_MM_COMM_TEE=y 69 | @@ -192,8 +194,8 @@ CONFIG_EFI_VAR_BUF_SIZE=139264 70 | CONFIG_EFI_SET_TIME=y 71 | CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y 72 | CONFIG_EFI_CAPSULE_ON_DISK=y 73 | -CONFIG_EFI_SECURE_BOOT=y 74 | CONFIG_EFI_IGNORE_OSINDICATIONS=y 75 | CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y 76 | CONFIG_EFI_CAPSULE_AUTHENTICATE=y 77 | CONFIG_EFI_CAPSULE_ESL_FILE="CRT.esl" 78 | +CONFIG_EFI_SECURE_BOOT=y 79 | -- 80 | 2.25.1 81 | 82 | -------------------------------------------------------------------------------- /meta-mender-nxp/recipes-bsp/u-boot/u-boot-imx/olimex-imx8mp-evb/0001-configs-olimex-imx8mp-evb-mender-integration.patch: -------------------------------------------------------------------------------- 1 | From 6f0ac7836f92efe24aeb7e2c3640f1b870d561ea Mon Sep 17 00:00:00 2001 2 | From: Leon Anavi 3 | Date: Mon, 15 Jul 2024 13:14:34 +0000 4 | Subject: [PATCH] configs: olimex-imx8mp-evb: mender integration 5 | 6 | Apply configuration changes for Mender. 7 | 8 | Signed-off-by: Leon Anavi 9 | --- 10 | configs/imx8mp_olimex_defconfig | 7 ++++--- 11 | include/configs/imx8mp_olimex.h | 3 +++ 12 | 2 files changed, 7 insertions(+), 3 deletions(-) 13 | 14 | diff --git a/configs/imx8mp_olimex_defconfig b/configs/imx8mp_olimex_defconfig 15 | index 8f763537537..990cb70bebd 100644 16 | --- a/configs/imx8mp_olimex_defconfig 17 | +++ b/configs/imx8mp_olimex_defconfig 18 | @@ -10,7 +10,9 @@ CONFIG_NR_DRAM_BANKS=3 19 | CONFIG_SYS_MEMTEST_START=0x60000000 20 | CONFIG_SYS_MEMTEST_END=0xC0000000 21 | CONFIG_ENV_SIZE=0x4000 22 | -CONFIG_ENV_OFFSET=0x700000 23 | +CONFIG_ENV_OFFSET=0x800000 24 | +CONFIG_ENV_OFFSET_REDUND=0x1000000 25 | +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y 26 | CONFIG_ENV_SECT_SIZE=0x10000 27 | CONFIG_SYS_I2C_MXC_I2C1=y 28 | CONFIG_SYS_I2C_MXC_I2C2=y 29 | @@ -92,11 +94,10 @@ CONFIG_CMD_LED=y 30 | CONFIG_OF_CONTROL=y 31 | CONFIG_SPL_OF_CONTROL=y 32 | CONFIG_ENV_OVERWRITE=y 33 | -CONFIG_ENV_IS_NOWHERE=y 34 | CONFIG_ENV_IS_IN_MMC=y 35 | -CONFIG_ENV_IS_IN_SPI_FLASH=y 36 | CONFIG_SYS_RELOC_GD_ENV_ADDR=y 37 | CONFIG_SYS_MMC_ENV_DEV=1 38 | +CONFIG_SYS_MMC_ENV_PART=0 39 | CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y 40 | CONFIG_USE_ETHPRIME=y 41 | CONFIG_ETHPRIME="eth1" 42 | diff --git a/include/configs/imx8mp_olimex.h b/include/configs/imx8mp_olimex.h 43 | index 6941d3ede4c..be0624da558 100644 44 | --- a/include/configs/imx8mp_olimex.h 45 | +++ b/include/configs/imx8mp_olimex.h 46 | @@ -181,4 +181,7 @@ 47 | #include "imx8mp_evk_android.h" 48 | #endif 49 | 50 | +#define CONFIG_BOOTCOUNT_ENV 51 | +#define CONFIG_BOOTCOUNT_LIMIT 52 | + 53 | #endif 54 | -- 55 | 2.44.1 56 | 57 | -------------------------------------------------------------------------------- /meta-mender-nxp/recipes-bsp/u-boot/u-boot-imx/olimex-imx8mp-evb/0002-Integration-of-Mender-boot-code-into-U-Boot.patch: -------------------------------------------------------------------------------- 1 | From a6b7e8b0f8ec0a98a6437807e7e057a1f9bc3651 Mon Sep 17 00:00:00 2001 2 | From: Marcin Pasinski 3 | Date: Wed, 31 Jan 2018 18:10:04 +0100 4 | Subject: [PATCH] Integration of Mender boot code into U-Boot. 5 | 6 | Upstream-Status: Inappropriate [Mender specific] 7 | 8 | Signed-off-by: Kristian Amlie 9 | Signed-off-by: Maciej Borzecki 10 | Signed-off-by: Marcin Pasinski 11 | Signed-off-by: Leon Anavi 12 | --- 13 | include/env_default.h | 3 +++ 14 | scripts/Makefile.autoconf | 3 ++- 15 | 2 files changed, 5 insertions(+), 1 deletion(-) 16 | 17 | diff --git a/include/env_default.h b/include/env_default.h 18 | index 2ca4a087d3b..7db7be7b6ac 100644 19 | --- a/include/env_default.h 20 | +++ b/include/env_default.h 21 | @@ -12,6 +12,8 @@ 22 | 23 | #include 24 | 25 | +#include 26 | + 27 | #ifdef DEFAULT_ENV_INSTANCE_EMBEDDED 28 | env_t embedded_environment __UBOOT_ENV_SECTION__(environment) = { 29 | ENV_CRC, /* CRC Sum */ 30 | @@ -26,6 +28,7 @@ char default_environment[] = { 31 | #else 32 | const char default_environment[] = { 33 | #endif 34 | + MENDER_ENV_SETTINGS 35 | #ifndef CONFIG_USE_DEFAULT_ENV_FILE 36 | #ifdef CONFIG_ENV_CALLBACK_LIST_DEFAULT 37 | ENV_CALLBACK_VAR "=" CONFIG_ENV_CALLBACK_LIST_DEFAULT "\0" 38 | diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf 39 | index 0ade91642ae..c653f1afaa1 100644 40 | --- a/scripts/Makefile.autoconf 41 | +++ b/scripts/Makefile.autoconf 42 | @@ -116,7 +116,8 @@ define filechk_config_h 43 | echo \#include \; \ 44 | echo \#include \; \ 45 | echo \#include \; \ 46 | - echo \#include \;) 47 | + echo \#include \; \ 48 | + echo \#include \;) 49 | endef 50 | 51 | include/config.h: scripts/Makefile.autoconf create_symlink FORCE 52 | -- 53 | 2.44.1 54 | 55 | -------------------------------------------------------------------------------- /meta-mender-nxp/recipes-bsp/u-boot/u-boot-imx_%.bbappend: -------------------------------------------------------------------------------- 1 | require recipes-bsp/u-boot/u-boot-mender.inc 2 | 3 | FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot-imx:" 4 | 5 | DEPENDS:append = " u-boot-scr" 6 | 7 | SRC_URI:append:olimex-imx8mp-evb = " \ 8 | file://0001-configs-olimex-imx8mp-evb-mender-integration.patch \ 9 | " 10 | 11 | SRC_URI:append:imx93-voipac = " \ 12 | file://0001-imx93-voipac-evk-Enable-various-configuration-for-me.patch \ 13 | " 14 | 15 | BOOTENV_SIZE:olimex-imx8mp-evb = "0x4000" 16 | BOOTENV_SIZE:imx93-voipac = "0x20000" 17 | 18 | MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET:imx93-voipac = "0x700000" 19 | MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET_2:imx93-voipac = "0x740000" 20 | 21 | MENDER_UBOOT_AUTO_CONFIGURE = "0" 22 | -------------------------------------------------------------------------------- /meta-mender-qemu-community/README: -------------------------------------------------------------------------------- 1 | This README file contains information on the contents of the meta-mender-qemu-community layer. 2 | 3 | Please see the corresponding sections below for details. 4 | 5 | Dependencies 6 | ============ 7 | 8 | URI: https://git.yoctoproject.org/poky 9 | branch: scarthgap 10 | 11 | URI: https://git.openembedded.org/meta-openembedded 12 | branch: scarthgap 13 | 14 | URI: https://git.yoctoproject.org/meta-arm 15 | branch: scarthgap 16 | 17 | URI: https://github.com/mendersoftware/meta-mender 18 | branch: scarthgap 19 | 20 | Contributions 21 | ============= 22 | 23 | Please the README file in the top level directory. 24 | 25 | Table of Contents 26 | ================= 27 | 28 | I. Adding the meta-mender-qemu-community layer to your build 29 | II. Misc 30 | 31 | 32 | I. Adding the meta-mender-qemu-community layer to your build 33 | ================================================= 34 | 35 | Run 'bitbake-layers add-layer meta-mender-qemu-community' 36 | 37 | II. Misc 38 | ======== 39 | 40 | The layer supports building for QEMU Aarch64 with EFI. Add the following to your configuration: 41 | 42 | ``` 43 | EFI_PROVIDER = "grub-efi" 44 | MACHINE_FEATURES += "efi" 45 | MENDER_EFI_LOADER = "edk2-firmware" 46 | MENDER_STORAGE_DEVICE = "/dev/vda" 47 | ``` 48 | 49 | -------------------------------------------------------------------------------- /meta-mender-qemu-community/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 += "meta-mender-qemu-community" 9 | BBFILE_PATTERN_meta-mender-qemu-community = "^${LAYERDIR}/" 10 | BBFILE_PRIORITY_meta-mender-qemu-community = "6" 11 | 12 | LAYERDEPENDS_meta-mender-qemu-community = "core" 13 | LAYERSERIES_COMPAT_meta-mender-qemu-community = "scarthgap" 14 | -------------------------------------------------------------------------------- /meta-mender-qemu-community/recipes-bsp/uefi/edk2-firmware_%.bbappend: -------------------------------------------------------------------------------- 1 | export GCC5_ARM_PREFIX = "${TARGET_PREFIX}" 2 | 3 | export CLANG38_ARM_PREFIX = "${TARGET_PREFIX}" 4 | 5 | #FIXME - arm32 doesn't work with clang due to a linker issue 6 | TOOLCHAIN:arm = "gcc" 7 | 8 | COMPATIBLE_MACHINE:qemuarm64 = "qemuarm64" 9 | EDK2_PLATFORM:qemuarm64 = "ArmVirtQemu-AARCH64" 10 | EDK2_PLATFORM_DSC:qemuarm64 = "ArmVirtPkg/ArmVirtQemu.dsc" 11 | EDK2_BIN_NAME:qemuarm64 = "QEMU_EFI.fd" 12 | 13 | COMPATIBLE_MACHINE:qemuarm = "qemuarm" 14 | EDK2_PLATFORM:qemuarm = "ArmVirtQemu-ARM" 15 | EDK2_PLATFORM_DSC:qemuarm = "ArmVirtPkg/ArmVirtQemu.dsc" 16 | EDK2_BIN_NAME:qemuarm = "QEMU_EFI.fd" 17 | 18 | do_install:append:qemuarm64() { 19 | install ${B}/Build/${EDK2_PLATFORM}/${EDK2_BUILD_MODE}_${EDK_COMPILER}/FV/${EDK2_BIN_NAME} ${D}/firmware/ 20 | } 21 | 22 | do_install:append:qemuarm() { 23 | install ${B}/Build/${EDK2_PLATFORM}/${EDK2_BUILD_MODE}_${EDK_COMPILER}/FV/${EDK2_BIN_NAME} ${D}/firmware/ 24 | } -------------------------------------------------------------------------------- /meta-mender-qemu-community/recipes-kernel/linux/linux-yocto/efi.cfg: -------------------------------------------------------------------------------- 1 | CONFIG_ACPI=y 2 | CONFIG_EFI=y -------------------------------------------------------------------------------- /meta-mender-qemu-community/recipes-kernel/linux/linux-yocto_%.bbappend: -------------------------------------------------------------------------------- 1 | ARMFILESPATHS_MENDER := "${THISDIR}/${PN}:" 2 | 3 | FILESEXTRAPATHS:prepend:qemuarm64 = "${ARMFILESPATHS_MENDER}" 4 | SRC_URI:append:qemuarm64 = " file://efi.cfg" 5 | 6 | FILESEXTRAPATHS:prepend:qemuarm = "${ARMFILESPATHS_MENDER}" 7 | SRC_URI:append:qemuarm = " file://efi.cfg" -------------------------------------------------------------------------------- /meta-mender-raspberrypi/classes/rpi-update-firmware.bbclass: -------------------------------------------------------------------------------- 1 | rpi_install_firmware_to_rootfs() { 2 | install -d ${IMAGE_ROOTFS}/boot/firmware/overlays 3 | 4 | cp ${DEPLOY_DIR_IMAGE}/${BOOTFILES_DIR_NAME}/* ${IMAGE_ROOTFS}/boot/firmware/ 5 | 6 | # To exclude files such as bcm2710-rpi-3-b-1-4.19.88+git0+988cc7beac-r0-raspberrypi3-20200323173633.dtb 7 | # as only the link names are actually valid and searched for on the device. 8 | find ${DEPLOY_DIR_IMAGE}/ -type l \( -iname "*.dtb" \) -exec cp {} ${IMAGE_ROOTFS}/boot/ \; 9 | find ${DEPLOY_DIR_IMAGE}/ -type l \( -iname "*.dtbo" \) -exec cp {} ${IMAGE_ROOTFS}/boot/overlays/ \; 10 | 11 | cp ${DEPLOY_DIR_IMAGE}/u-boot.bin ${IMAGE_ROOTFS}/boot/${SDIMG_KERNELIMAGE} 12 | cp ${DEPLOY_DIR_IMAGE}/boot.scr ${IMAGE_ROOTFS}/boot/ 13 | } 14 | ROOTFS_POSTPROCESS_COMMAND += "rpi_install_firmware_to_rootfs; " 15 | 16 | IMAGE_INSTALL:append = " update-firmware-state-script" 17 | -------------------------------------------------------------------------------- /meta-mender-raspberrypi/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 += "mender-raspberrypi" 9 | BBFILE_PATTERN_mender-raspberrypi = "^${LAYERDIR}/" 10 | BBFILE_PRIORITY_mender-raspberrypi = "10" 11 | 12 | LAYERDEPENDS_mender-raspberrypi = "mender raspberrypi" 13 | 14 | # Recommended for u-boot support for raspberrypi5 15 | # https://git.yoctoproject.org/meta-lts-mixins 'scarthgap/u-boot' branch 16 | LAYERRECOMMENDS_mender-raspberrypi = "lts-u-boot-mixin" 17 | 18 | LAYERSERIES_COMPAT_mender-raspberrypi = "scarthgap" 19 | 20 | # Raspberry Pi doesn't work with GRUB currently. 21 | _MENDER_IMAGE_TYPE_DEFAULT:rpi = "mender-image-sd" 22 | _MENDER_BOOTLOADER_DEFAULT:rpi = "mender-uboot" 23 | -------------------------------------------------------------------------------- /meta-mender-raspberrypi/recipes-bsp/bootfiles/rpi-cmdline-mender.inc: -------------------------------------------------------------------------------- 1 | CMDLINE_ROOTFS:remove = "root=/dev/mmcblk0p2" 2 | CMDLINE_ROOTFS:append = " root=\${mender_kernel_root} " 3 | -------------------------------------------------------------------------------- /meta-mender-raspberrypi/recipes-bsp/bootfiles/rpi-cmdline.bbappend: -------------------------------------------------------------------------------- 1 | include ${@mender_feature_is_enabled("mender-update-install","rpi-cmdline-mender.inc","",d)} 2 | -------------------------------------------------------------------------------- /meta-mender-raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.in: -------------------------------------------------------------------------------- 1 | fdt addr ${fdt_addr} && fdt get value bootargs /chosen bootargs 2 | run mender_setup 3 | mmc dev ${mender_uboot_dev} 4 | load ${mender_uboot_root} ${kernel_addr_r} /boot/@@KERNEL_IMAGETYPE@@ 5 | @@KERNEL_BOOTCMD@@ ${kernel_addr_r} - ${fdt_addr} 6 | run mender_try_to_recover 7 | -------------------------------------------------------------------------------- /meta-mender-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend:rpi:mender-update-install := "${THISDIR}/files:" 2 | -------------------------------------------------------------------------------- /meta-mender-raspberrypi/recipes-bsp/u-boot/patches/0001-configs-rpi-enable-mender-requirements.patch: -------------------------------------------------------------------------------- 1 | From e4f3cb28ff0360199b15e34ed9c96be8b8c50a2f Mon Sep 17 00:00:00 2001 2 | From: Josef Holzmayr 3 | Date: Wed, 26 Jul 2023 10:53:51 +0200 4 | Subject: [PATCH] configs: rpi: enable mender requirements 5 | 6 | Which are CONFIG_BOOTCOUNT_ENV and CONFIG_BOOTCOUNT_LIMIT. 7 | 8 | Mender also requires that the environment is on MMC 9 | (CONFIG_ENV_IS_IN_MMC) 10 | 11 | Upstream-Status: Inappropriate 12 | Signed-off-by: Mirza Krak 13 | Signed-off-by: Drew Moseley 14 | Signed-off-by: Josef Holzmayr 15 | 16 | This patch is a refresh. 17 | 18 | Signed-off-by: Josef Holzmayr 19 | Signed-off-by: Leon Anavi 20 | --- 21 | configs/rpi_0_w_defconfig | 5 ++++- 22 | configs/rpi_2_defconfig | 5 ++++- 23 | configs/rpi_3_32b_defconfig | 5 ++++- 24 | configs/rpi_3_b_plus_defconfig | 5 ++++- 25 | configs/rpi_3_defconfig | 5 ++++- 26 | configs/rpi_4_32b_defconfig | 5 ++++- 27 | configs/rpi_4_defconfig | 5 ++++- 28 | configs/rpi_arm64_defconfig | 5 ++++- 29 | configs/rpi_defconfig | 5 ++++- 30 | env/Kconfig | 1 - 31 | include/configs/rpi.h | 5 +++++ 32 | 11 files changed, 41 insertions(+), 10 deletions(-) 33 | 34 | diff --git a/configs/rpi_0_w_defconfig b/configs/rpi_0_w_defconfig 35 | index ac3b40c1c1..390477e36a 100644 36 | --- a/configs/rpi_0_w_defconfig 37 | +++ b/configs/rpi_0_w_defconfig 38 | @@ -25,7 +25,6 @@ CONFIG_CMD_MMC=y 39 | CONFIG_CMD_USB=y 40 | CONFIG_CMD_FS_UUID=y 41 | CONFIG_OF_EMBED=y 42 | -CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" 43 | CONFIG_SYS_RELOC_GD_ENV_ADDR=y 44 | CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y 45 | CONFIG_TFTP_TSIZE=y 46 | @@ -50,3 +49,7 @@ CONFIG_VIDEO_BCM2835=y 47 | CONFIG_CONSOLE_SCROLL_LINES=10 48 | CONFIG_PHYS_TO_BUS=y 49 | CONFIG_EFI_LOADER=y 50 | +CONFIG_ENV_IS_IN_MMC=y 51 | +CONFIG_ENV_OFFSET=0x800000 52 | +CONFIG_ENV_OFFSET_REDUND=0x1000000 53 | +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y 54 | diff --git a/configs/rpi_2_defconfig b/configs/rpi_2_defconfig 55 | index b6e06cfe20..9375b8df6d 100644 56 | --- a/configs/rpi_2_defconfig 57 | +++ b/configs/rpi_2_defconfig 58 | @@ -26,7 +26,6 @@ CONFIG_CMD_MMC=y 59 | CONFIG_CMD_USB=y 60 | CONFIG_CMD_FS_UUID=y 61 | CONFIG_OF_EMBED=y 62 | -CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" 63 | CONFIG_SYS_RELOC_GD_ENV_ADDR=y 64 | CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y 65 | CONFIG_TFTP_TSIZE=y 66 | @@ -50,3 +49,7 @@ CONFIG_SYS_WHITE_ON_BLACK=y 67 | CONFIG_VIDEO_BCM2835=y 68 | CONFIG_CONSOLE_SCROLL_LINES=10 69 | CONFIG_PHYS_TO_BUS=y 70 | +CONFIG_ENV_IS_IN_MMC=y 71 | +CONFIG_ENV_OFFSET=0x800000 72 | +CONFIG_ENV_OFFSET_REDUND=0x1000000 73 | +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y 74 | diff --git a/configs/rpi_3_32b_defconfig b/configs/rpi_3_32b_defconfig 75 | index eadc418927..d9883507df 100644 76 | --- a/configs/rpi_3_32b_defconfig 77 | +++ b/configs/rpi_3_32b_defconfig 78 | @@ -25,7 +25,6 @@ CONFIG_CMD_MMC=y 79 | CONFIG_CMD_USB=y 80 | CONFIG_CMD_FS_UUID=y 81 | CONFIG_OF_EMBED=y 82 | -CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" 83 | CONFIG_SYS_RELOC_GD_ENV_ADDR=y 84 | CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y 85 | CONFIG_TFTP_TSIZE=y 86 | @@ -51,3 +50,7 @@ CONFIG_SYS_WHITE_ON_BLACK=y 87 | CONFIG_VIDEO_BCM2835=y 88 | CONFIG_CONSOLE_SCROLL_LINES=10 89 | CONFIG_PHYS_TO_BUS=y 90 | +CONFIG_ENV_IS_IN_MMC=y 91 | +CONFIG_ENV_OFFSET=0x800000 92 | +CONFIG_ENV_OFFSET_REDUND=0x1000000 93 | +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y 94 | diff --git a/configs/rpi_3_b_plus_defconfig b/configs/rpi_3_b_plus_defconfig 95 | index 0e2faeec64..59805918c3 100644 96 | --- a/configs/rpi_3_b_plus_defconfig 97 | +++ b/configs/rpi_3_b_plus_defconfig 98 | @@ -24,7 +24,6 @@ CONFIG_CMD_MMC=y 99 | CONFIG_CMD_USB=y 100 | CONFIG_CMD_FS_UUID=y 101 | CONFIG_OF_EMBED=y 102 | -CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" 103 | CONFIG_SYS_RELOC_GD_ENV_ADDR=y 104 | CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y 105 | CONFIG_TFTP_TSIZE=y 106 | @@ -50,3 +49,7 @@ CONFIG_SYS_WHITE_ON_BLACK=y 107 | CONFIG_VIDEO_BCM2835=y 108 | CONFIG_CONSOLE_SCROLL_LINES=10 109 | CONFIG_PHYS_TO_BUS=y 110 | +CONFIG_ENV_IS_IN_MMC=y 111 | +CONFIG_ENV_OFFSET=0x800000 112 | +CONFIG_ENV_OFFSET_REDUND=0x1000000 113 | +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y 114 | diff --git a/configs/rpi_3_defconfig b/configs/rpi_3_defconfig 115 | index 6890af4d1d..3baabdab45 100644 116 | --- a/configs/rpi_3_defconfig 117 | +++ b/configs/rpi_3_defconfig 118 | @@ -24,7 +24,6 @@ CONFIG_CMD_MMC=y 119 | CONFIG_CMD_USB=y 120 | CONFIG_CMD_FS_UUID=y 121 | CONFIG_OF_EMBED=y 122 | -CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" 123 | CONFIG_SYS_RELOC_GD_ENV_ADDR=y 124 | CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y 125 | CONFIG_TFTP_TSIZE=y 126 | @@ -50,3 +49,7 @@ CONFIG_SYS_WHITE_ON_BLACK=y 127 | CONFIG_VIDEO_BCM2835=y 128 | CONFIG_CONSOLE_SCROLL_LINES=10 129 | CONFIG_PHYS_TO_BUS=y 130 | +CONFIG_ENV_IS_IN_MMC=y 131 | +CONFIG_ENV_OFFSET=0x800000 132 | +CONFIG_ENV_OFFSET_REDUND=0x1000000 133 | +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y 134 | diff --git a/configs/rpi_4_32b_defconfig b/configs/rpi_4_32b_defconfig 135 | index 734335cbf0..786b88127f 100644 136 | --- a/configs/rpi_4_32b_defconfig 137 | +++ b/configs/rpi_4_32b_defconfig 138 | @@ -26,7 +26,6 @@ CONFIG_CMD_MMC=y 139 | CONFIG_CMD_PCI=y 140 | CONFIG_CMD_USB=y 141 | CONFIG_CMD_FS_UUID=y 142 | -CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" 143 | CONFIG_SYS_RELOC_GD_ENV_ADDR=y 144 | CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y 145 | CONFIG_TFTP_TSIZE=y 146 | @@ -67,3 +66,7 @@ CONFIG_CONSOLE_SCROLL_LINES=10 147 | CONFIG_PHYS_TO_BUS=y 148 | CONFIG_ADDR_MAP=y 149 | CONFIG_SYS_NUM_ADDR_MAP=2 150 | +CONFIG_ENV_IS_IN_MMC=y 151 | +CONFIG_ENV_OFFSET=0x800000 152 | +CONFIG_ENV_OFFSET_REDUND=0x1000000 153 | +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y 154 | diff --git a/configs/rpi_4_defconfig b/configs/rpi_4_defconfig 155 | index 2541b83a3d..0fc07882bd 100644 156 | --- a/configs/rpi_4_defconfig 157 | +++ b/configs/rpi_4_defconfig 158 | @@ -26,7 +26,6 @@ CONFIG_CMD_MMC=y 159 | CONFIG_CMD_PCI=y 160 | CONFIG_CMD_USB=y 161 | CONFIG_CMD_FS_UUID=y 162 | -CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" 163 | CONFIG_SYS_RELOC_GD_ENV_ADDR=y 164 | CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y 165 | CONFIG_TFTP_TSIZE=y 166 | @@ -65,3 +64,7 @@ CONFIG_SYS_WHITE_ON_BLACK=y 167 | CONFIG_VIDEO_BCM2835=y 168 | CONFIG_CONSOLE_SCROLL_LINES=10 169 | CONFIG_PHYS_TO_BUS=y 170 | +CONFIG_ENV_IS_IN_MMC=y 171 | +CONFIG_ENV_OFFSET=0x800000 172 | +CONFIG_ENV_OFFSET_REDUND=0x1000000 173 | +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y 174 | diff --git a/configs/rpi_arm64_defconfig b/configs/rpi_arm64_defconfig 175 | index f9dade18f6..d267cd7c87 100644 176 | --- a/configs/rpi_arm64_defconfig 177 | +++ b/configs/rpi_arm64_defconfig 178 | @@ -25,7 +25,6 @@ CONFIG_CMD_MMC=y 179 | CONFIG_CMD_PCI=y 180 | CONFIG_CMD_USB=y 181 | CONFIG_CMD_FS_UUID=y 182 | -CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" 183 | CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y 184 | CONFIG_TFTP_TSIZE=y 185 | CONFIG_DM_DMA=y 186 | @@ -57,3 +56,7 @@ CONFIG_SYS_WHITE_ON_BLACK=y 187 | CONFIG_VIDEO_BCM2835=y 188 | CONFIG_CONSOLE_SCROLL_LINES=10 189 | CONFIG_PHYS_TO_BUS=y 190 | +CONFIG_ENV_IS_IN_MMC=y 191 | +CONFIG_ENV_OFFSET=0x800000 192 | +CONFIG_ENV_OFFSET_REDUND=0x1000000 193 | +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y 194 | diff --git a/configs/rpi_defconfig b/configs/rpi_defconfig 195 | index 29c10060cf..b5a1b9dac4 100644 196 | --- a/configs/rpi_defconfig 197 | +++ b/configs/rpi_defconfig 198 | @@ -25,7 +25,6 @@ CONFIG_CMD_MMC=y 199 | CONFIG_CMD_USB=y 200 | CONFIG_CMD_FS_UUID=y 201 | CONFIG_OF_EMBED=y 202 | -CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" 203 | CONFIG_SYS_RELOC_GD_ENV_ADDR=y 204 | CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y 205 | CONFIG_TFTP_TSIZE=y 206 | @@ -50,3 +49,7 @@ CONFIG_VIDEO_BCM2835=y 207 | CONFIG_CONSOLE_SCROLL_LINES=10 208 | CONFIG_PHYS_TO_BUS=y 209 | CONFIG_EFI_LOADER=y 210 | +CONFIG_ENV_IS_IN_MMC=y 211 | +CONFIG_ENV_OFFSET=0x800000 212 | +CONFIG_ENV_OFFSET_REDUND=0x1000000 213 | +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y 214 | diff --git a/env/Kconfig b/env/Kconfig 215 | index f5f0969233..68d7569755 100644 216 | --- a/env/Kconfig 217 | +++ b/env/Kconfig 218 | @@ -96,7 +96,6 @@ config ENV_IS_IN_EEPROM 219 | config ENV_IS_IN_FAT 220 | bool "Environment is in a FAT filesystem" 221 | depends on !CHAIN_OF_TRUST 222 | - default y if ARCH_BCM283X 223 | default y if ARCH_SUNXI && MMC 224 | default y if MMC_OMAP_HS && TI_COMMON_CMD_OPTIONS 225 | select FS_FAT 226 | diff --git a/include/configs/rpi.h b/include/configs/rpi.h 227 | index 8e56bdc84a..efa75c8099 100644 228 | --- a/include/configs/rpi.h 229 | +++ b/include/configs/rpi.h 230 | @@ -31,4 +31,9 @@ 231 | */ 232 | #define CFG_SYS_SDRAM_SIZE SZ_128M 233 | 234 | +/* Environment */ 235 | + 236 | +#define CONFIG_BOOTCOUNT_ENV 237 | +#define CONFIG_BOOTCOUNT_LIMIT 238 | + 239 | #endif 240 | -- 241 | 2.44.0 242 | 243 | -------------------------------------------------------------------------------- /meta-mender-raspberrypi/recipes-bsp/u-boot/patches/0001-pci-fdt-ignore-checks-for-address-range.patch: -------------------------------------------------------------------------------- 1 | From ff74c7034ee5c1b3943232ddd6ef773fe903fd8b Mon Sep 17 00:00:00 2001 2 | From: Josef Holzmayr 3 | Date: Mon, 18 Nov 2024 06:41:20 +0000 4 | Subject: [PATCH] pci/fdt: ignore checks for address range 5 | 6 | On Raspberry Pi platforms running in 32bit mode, the checks 7 | will skip one or more sections and block booting. By ignoring 8 | the check result the boot process is successful. 9 | 10 | A verbose message is printed to identify an ignored check. 11 | 12 | Upstream-Status: Inappropriate [Mender specific] 13 | 14 | Signed-off-by: Josef Holzmayr 15 | --- 16 | drivers/pci/pci-uclass.c | 24 ++++++++++++++++-------- 17 | 1 file changed, 16 insertions(+), 8 deletions(-) 18 | 19 | diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c 20 | index e0d01f6a85..8c9c430101 100644 21 | --- a/drivers/pci/pci-uclass.c 22 | +++ b/drivers/pci/pci-uclass.c 23 | @@ -1039,23 +1039,31 @@ static int decode_regions(struct pci_controller *hose, ofnode parent_node, 24 | 25 | if (!IS_ENABLED(CONFIG_SYS_PCI_64BIT) && 26 | type == PCI_REGION_MEM && upper_32_bits(pci_addr)) { 27 | - debug(" - pci_addr beyond the 32-bit boundary, ignoring\n"); 28 | - continue; 29 | + printf("%s: region %d, pci_addr=%llx, addr=%llx, size=%llx, space_code=%d\n", 30 | + __func__, hose->region_count, pci_addr, addr, size, space_code); 31 | + printf(" - pci_addr beyond the 32-bit boundary, ignoring\n"); 32 | +// continue; 33 | } 34 | 35 | if (!IS_ENABLED(CONFIG_PHYS_64BIT) && upper_32_bits(addr)) { 36 | - debug(" - addr beyond the 32-bit boundary, ignoring\n"); 37 | - continue; 38 | + printf("%s: region %d, pci_addr=%llx, addr=%llx, size=%llx, space_code=%d\n", 39 | + __func__, hose->region_count, pci_addr, addr, size, space_code); 40 | + printf(" - addr beyond the 32-bit boundary, ignoring\n"); 41 | +// continue; 42 | } 43 | 44 | if (~((pci_addr_t)0) - pci_addr < size) { 45 | - debug(" - PCI range exceeds max address, ignoring\n"); 46 | - continue; 47 | + printf("%s: region %d, pci_addr=%llx, addr=%llx, size=%llx, space_code=%d\n", 48 | + __func__, hose->region_count, pci_addr, addr, size, space_code); 49 | + printf(" - PCI range exceeds max address, ignoring\n"); 50 | +// continue; 51 | } 52 | 53 | if (~((phys_addr_t)0) - addr < size) { 54 | - debug(" - phys range exceeds max address, ignoring\n"); 55 | - continue; 56 | + printf("%s: region %d, pci_addr=%llx, addr=%llx, size=%llx, space_code=%d\n", 57 | + __func__, hose->region_count, pci_addr, addr, size, space_code); 58 | + printf(" - phys range exceeds max address, ignoring\n"); 59 | +// continue; 60 | } 61 | 62 | pos = -1; 63 | -- 64 | 2.34.1 65 | 66 | -------------------------------------------------------------------------------- /meta-mender-raspberrypi/recipes-bsp/u-boot/patches/memory_size.cfg: -------------------------------------------------------------------------------- 1 | CONFIG_SYS_BOOTM_LEN=0x1000000 -------------------------------------------------------------------------------- /meta-mender-raspberrypi/recipes-bsp/u-boot/u-boot-raspberrypi.inc: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend:rpi := "${THISDIR}/patches:" 2 | 3 | BOOTENV_SIZE:rpi ?= "0x4000" 4 | 5 | # U-Boot auto-configuration doesn't work properly for Raspberry Pi, due to its 6 | # use of boot.scr and cmdline.txt. 7 | MENDER_UBOOT_AUTO_CONFIGURE:rpi = "0" 8 | 9 | SRC_URI:append:rpi = " file://memory_size.cfg" 10 | 11 | SRC_URI:append:rpi:mender-uboot = "${@bb.utils.contains('MENDER_UBOOT_AUTO_CONFIGURE', \ 12 | '1', \ 13 | '', \ 14 | ' file://0001-configs-rpi-enable-mender-requirements.patch \ 15 | file://0001-pci-fdt-ignore-checks-for-address-range.patch \ 16 | ', \ 17 | d)}" 18 | -------------------------------------------------------------------------------- /meta-mender-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend: -------------------------------------------------------------------------------- 1 | require u-boot-raspberrypi.inc 2 | -------------------------------------------------------------------------------- /meta-mender-raspberrypi/recipes-mender/mender-configure/mender-configure_%.bbappend: -------------------------------------------------------------------------------- 1 | do_install:append:rpi() { 2 | # Insert key. 3 | sed -i -e '1s/$/\n "mender-demo-raspberrypi-led": "mmc0",/' ${D}/data/mender-configure/device-config.json 4 | } 5 | -------------------------------------------------------------------------------- /meta-mender-raspberrypi/recipes-mender/update-firmware-state-script/files/ArtifactInstall_Leave_50.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | trap_exit() { 6 | umount -l /tmp/inactive_part 7 | } 8 | trap trap_exit EXIT 9 | 10 | MENDER_ROOTFS_PART_A="@@MENDER_ROOTFS_PART_A@@" 11 | MENDER_ROOTFS_PART_B="@@MENDER_ROOTFS_PART_B@@" 12 | 13 | safe_copy() { 14 | if [ $# -gt 2 ]; then 15 | echo "safe_copy can only handle one file copy at a time" >&2 16 | exit 2 17 | fi 18 | cp -a "$1" "$2".tmp || return $? 19 | sync "$2".tmp || return $? 20 | mv "$2".tmp "$2" || return $? 21 | sync "$(dirname "$2")" || return $? 22 | } 23 | 24 | if mount | grep ${MENDER_ROOTFS_PART_A}; then 25 | inactive_part="${MENDER_ROOTFS_PART_B}" 26 | else 27 | inactive_part="${MENDER_ROOTFS_PART_A}" 28 | fi 29 | 30 | mkdir -p /tmp/inactive_part 31 | mount -o ro ${inactive_part} /tmp/inactive_part 32 | 33 | # These are dangerous operations and if they fail (partial copy) it might 34 | # render the device unusable. 35 | 36 | # Copy 'core' firmware files first 37 | for f in $(find /tmp/inactive_part/boot -maxdepth 1 -type f ! -name "*.dtbo"); do 38 | safe_copy $f /uboot/$(basename $f) 39 | done 40 | 41 | # Copy overlays 42 | for f in $(find /tmp/inactive_part/boot/*.dtbo -maxdepth 1 -type f); do 43 | safe_copy $f /uboot/overlays/$(basename $f) 44 | done 45 | 46 | 47 | exit 0 48 | -------------------------------------------------------------------------------- /meta-mender-raspberrypi/recipes-mender/update-firmware-state-script/update-firmware-state-script.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "Mender state-script to update firmware files on Raspberry Pi boards" 2 | LICENSE = "Apache-2.0" 3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" 4 | 5 | inherit mender-state-scripts 6 | 7 | SRC_URI = "file://ArtifactInstall_Leave_50.in" 8 | 9 | do_deploy() { 10 | sed -e 's#@@MENDER_ROOTFS_PART_A@@#'"${MENDER_ROOTFS_PART_A}"'#' \ 11 | -e 's#@@MENDER_ROOTFS_PART_B@@#'"${MENDER_ROOTFS_PART_B}"'#' \ 12 | "${WORKDIR}/ArtifactInstall_Leave_50.in" > "${WORKDIR}/ArtifactInstall_Leave_50" 13 | cp ${WORKDIR}/ArtifactInstall_Leave_50 ${MENDER_STATE_SCRIPTS_DIR}/ArtifactInstall_Leave_50 14 | } 15 | 16 | ALLOW_EMPTY:${PN} = "1" 17 | -------------------------------------------------------------------------------- /meta-mender-riscv/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /meta-mender-riscv/README: -------------------------------------------------------------------------------- 1 | This README file contains information on the contents of the meta-mender-riscv layer. 2 | 3 | Please see the corresponding sections below for details. 4 | 5 | Dependencies 6 | ============ 7 | 8 | URI: https://git.yoctoproject.org/poky 9 | branch: scarthgap 10 | 11 | URI: https://github.com/riscv/meta-riscv 12 | branch: scarthgap 13 | 14 | URI: https://github.com/mendersoftware/meta-mender 15 | branch: scarthgap 16 | 17 | Contributions 18 | ============= 19 | 20 | Please the README file in the top level directory. 21 | 22 | Table of Contents 23 | ================= 24 | 25 | I. Adding the meta-mender-riscv layer to your build 26 | 27 | 28 | I. Adding the meta-mender-riscv layer to your build 29 | ================================================= 30 | 31 | Run 'bitbake-layers add-layer meta-mender-riscv' 32 | -------------------------------------------------------------------------------- /meta-mender-riscv/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 += "meta-mender-riscv" 9 | BBFILE_PATTERN_meta-mender-riscv = "^${LAYERDIR}/" 10 | BBFILE_PRIORITY_meta-mender-riscv = "6" 11 | 12 | LAYERDEPENDS_meta-mender-riscv = "core" 13 | LAYERSERIES_COMPAT_meta-mender-riscv = "scarthgap" 14 | -------------------------------------------------------------------------------- /meta-mender-riscv/recipes-bsp/u-boot/u-boot-allwinnerd1-mender-common.inc: -------------------------------------------------------------------------------- 1 | MENDER_UBOOT_STORAGE_DEVICE:nezha-allwinner-d1 = "0" 2 | MENDER_UBOOT_CONFIG_SYS_MMC_ENV_PART:nezha-allwinner-d1 = "0" 3 | MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET:nezha-allwinner-d1 = "0x100000" 4 | MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET_2:nezha-allwinner-d1 = "0x120000" 5 | BOOTENV_SIZE:nezha-allwinner-d1 = "0x20000" -------------------------------------------------------------------------------- /meta-mender-riscv/recipes-bsp/u-boot/u-boot-allwinnerd1.bbappend: -------------------------------------------------------------------------------- 1 | require recipes-bsp/u-boot/u-boot-allwinnerd1-mender-common.inc 2 | require recipes-bsp/u-boot/u-boot-mender.inc 3 | 4 | FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" 5 | 6 | SRC_URI:append:nezha-allwinner-d1 = " \ 7 | file://0001-add-mender-related-config-items.patch \ 8 | " 9 | 10 | MENDER_UBOOT_AUTO_CONFIGURE:nezha-allwinner-d1 = "0" 11 | 12 | PROVIDES += "u-boot" 13 | -------------------------------------------------------------------------------- /meta-mender-riscv/recipes-bsp/u-boot/u-boot-allwinnerd1/0001-add-mender-related-config-items.patch: -------------------------------------------------------------------------------- 1 | From 3653495d47bae15ff5fdd618efa1ba54e412a7be Mon Sep 17 00:00:00 2001 2 | From: Josef Holzmayr 3 | Date: Thu, 8 May 2025 19:59:40 +0000 4 | Subject: [PATCH] add mender related config items 5 | 6 | --- 7 | configs/nezha_defconfig | 8 ++++++++ 8 | 1 file changed, 8 insertions(+) 9 | 10 | diff --git a/configs/nezha_defconfig b/configs/nezha_defconfig 11 | index 65e0fb5b4f1..d4954c193e7 100644 12 | --- a/configs/nezha_defconfig 13 | +++ b/configs/nezha_defconfig 14 | @@ -1,14 +1,22 @@ 15 | CONFIG_RISCV=y 16 | CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y 17 | CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x43e00000 18 | +CONFIG_ENV_SIZE=0x20000 19 | +CONFIG_ENV_OFFSET=0x100000 20 | CONFIG_DEFAULT_DEVICE_TREE="sun20i-d1-nezha" 21 | +CONFIG_ENV_OFFSET_REDUND=0x120000 22 | CONFIG_TARGET_SUN20I_D1=y 23 | CONFIG_ARCH_RV64I=y 24 | CONFIG_RISCV_SMODE=y 25 | # CONFIG_SPL_SMP is not set 26 | CONFIG_SPL_SYS_MALLOC=y 27 | CONFIG_SPL_OPENSBI_SCRATCH_OPTIONS=0x0 28 | +# CONFIG_ENV_IS_IN_FAT is not set 29 | +CONFIG_ENV_IS_IN_MMC=y 30 | +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y 31 | CONFIG_NET_RANDOM_ETHADDR=y 32 | +CONFIG_BOOTCOUNT_LIMIT=y 33 | +CONFIG_BOOTCOUNT_ENV=y 34 | # CONFIG_SYS_I2C_MVTWSI is not set 35 | CONFIG_PHY_REALTEK=y 36 | CONFIG_SUN8I_EMAC=y 37 | -------------------------------------------------------------------------------- /meta-mender-riscv/recipes-bsp/u-boot/u-boot-allwinnerd1/tftp-mmc-boot.txt: -------------------------------------------------------------------------------- 1 | run mender_setup 2 | setenv bootargs earlycon=sbi clk_ignore_unused initcall_debug=0 console=ttyS0,115200 loglevel=8 root=${mender_kernel_root} rootwait 3 | load ${mender_uboot_root} ${ramdisk_addr_r} boot/fitImage 4 | bootm ${ramdisk_addr_r} - ${fdtcontroladdr} 5 | run mender_try_to_recover 6 | -------------------------------------------------------------------------------- /meta-mender-riscv/recipes-kernel/linux/linux-allwinnerd1-dev.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" 2 | SRC_URI += "file://dosfs.cfg" -------------------------------------------------------------------------------- /meta-mender-riscv/recipes-kernel/linux/linux-allwinnerd1-dev/dosfs.cfg: -------------------------------------------------------------------------------- 1 | CONFIG_FAT_FS=m 2 | CONFIG_MSDOS_FS=m 3 | CONFIG_VFAT_FS=m 4 | CONFIG_FAT_DEFAULT_CODEPAGE=437 5 | CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" 6 | # CONFIG_FAT_DEFAULT_UTF8 is not set 7 | -------------------------------------------------------------------------------- /meta-mender-rockchip/README.md: -------------------------------------------------------------------------------- 1 | # meta-mender-rockchip 2 | 3 | Mender integration for rockchip based boards 4 | 5 | The supported and tested boards are: 6 | 7 | - [ROCK 4C+](https://radxa.com/products/rock4/4cp/) 8 | 9 | Visit the individual board links above for more information on status of the 10 | integration and more detailed instructions on how to build and use images 11 | together with Mender for the mentioned boards. 12 | 13 | ## Dependencies 14 | 15 | This layer depends on: 16 | 17 | ``` 18 | URI: https://git.yoctoproject.org/meta-rockchip/ 19 | branch: scarthgap 20 | revision: HEAD 21 | ``` 22 | 23 | ``` 24 | URI: https://git.yoctoproject.org/meta-arm/ 25 | branch: scarthgap 26 | revision: HEAD 27 | ``` 28 | 29 | ## Quick start 30 | 31 | The following commands will setup the environment and allow you to build images 32 | that have Mender integrated. 33 | 34 | ``` 35 | mkdir -p meta-mender-community/mender-rockchip && cd meta-mender-community/mender-rockchip 36 | kas build ../kas/rock-4c-plus.yml 37 | ``` 38 | 39 | ## UART 40 | 41 | https://wiki.radxa.com/Rockpi4/dev/serial-console 42 | 43 | baudrate: 1500000 44 | data bit: 8 45 | stop bit: 1 46 | parity : none 47 | flow control: none 48 | 49 | UART being connected can stop it from booting 50 | 51 | 52 | -------------------------------------------------------------------------------- /meta-mender-rockchip/classes/rockchip-sdimg.bbclass: -------------------------------------------------------------------------------- 1 | inherit image_types 2 | 3 | # It is not possible to specify this using MENDER_IMAGE_BOOTLOADER_FILE/OFFSET, 4 | # instead we use an append to "sdimg" to embed the bootloader 5 | # https://wiki.radxa.com/Rockpi4/dev/u-boot 6 | # using the command: 7 | # rkdeveloptool wl 0x40 idbloader.img 8 | # using rkdeveloptool wl 0x4000 uboot.img 9 | 10 | 11 | IMAGE_CMD:sdimg:append() { 12 | outimgname="${IMGDEPLOYDIR}/${IMAGE_NAME}.$suffix" 13 | dd if=${DEPLOY_DIR_IMAGE}/idbloader.img of=${outimgname} conv=notrunc seek=64 14 | dd if=${DEPLOY_DIR_IMAGE}/u-boot.itb of=${outimgname} conv=notrunc seek=16384 15 | } 16 | -------------------------------------------------------------------------------- /meta-mender-rockchip/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 += "mender-rockchip" 9 | BBFILE_PATTERN_mender-rockchip = "^${LAYERDIR}/" 10 | BBFILE_PRIORITY_mender-rockchip = "10" 11 | 12 | LAYERSERIES_COMPAT_mender-rockchip = "scarthgap" 13 | -------------------------------------------------------------------------------- /meta-mender-rockchip/recipes-bsp/u-boot/u-boot/0001-Add-mender-settings.patch: -------------------------------------------------------------------------------- 1 | From 95402fc3a67d410e234e8cdb4bb3871853aa0904 Mon Sep 17 00:00:00 2001 2 | From: Ed Watson 3 | Date: Mon, 25 Nov 2024 20:42:53 +0100 4 | Subject: [PATCH] Add mender settings 5 | Upstream-Status: Inappropriate [Mender specific] 6 | --- 7 | configs/rock-4c-plus-rk3399_defconfig | 7 +++++++ 8 | 1 file changed, 7 insertions(+) 9 | 10 | diff --git a/configs/rock-4c-plus-rk3399_defconfig b/configs/rock-4c-plus-rk3399_defconfig 11 | index 3028a86705..e7d1481f3a 100644 12 | --- a/configs/rock-4c-plus-rk3399_defconfig 13 | +++ b/configs/rock-4c-plus-rk3399_defconfig 14 | @@ -96,3 +96,10 @@ CONFIG_SPL_TINY_MEMSET=y 15 | CONFIG_ERRNO_STR=y 16 | CONFIG_EFI_CAPSULE_ON_DISK=y 17 | CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y 18 | +CONFIG_ENV_SIZE=0x20000 19 | +CONFIG_ENV_OFFSET=0xa00000 20 | +CONFIG_SYS_MMC_ENV_DEV=1 21 | +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y 22 | +CONFIG_BOOTCOUNT_ENV=y 23 | +CONFIG_BOOTCOUNT_LIMIT=y 24 | +CONFIG_ENV_OFFSET_REDUND=0x1400000 25 | \ No newline at end of file 26 | -------------------------------------------------------------------------------- /meta-mender-rockchip/recipes-bsp/u-boot/u-boot_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | 4 | # Add uboot envirment offset that didn't get by mender autoconfigure 5 | # Will boot but fw_printenv do not work. 6 | 7 | SRC_URI += "file://0001-Add-mender-settings.patch \ 8 | " 9 | MENDER_UBOOT_AUTO_CONFIGURE = "1" 10 | MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET_1 = "0xa00000" 11 | MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET_2 = "0x1400000" 12 | -------------------------------------------------------------------------------- /meta-mender-tegra/README.md: -------------------------------------------------------------------------------- 1 | # meta-mender-tegra 2 | 3 | Mender integration layer for NVIDIA Tegra hardware. 4 | 5 | The supported and tested boards are: 6 | 7 | - AGX Orin 8 | - AGX Xavier 9 | - Orin Nano 10 | - Orin NX 11 | 12 | ## Dependencies 13 | 14 | These layers depend on: 15 | 16 | ``` 17 | URI: https://github.com/OE4T/meta-tegra.git 18 | layers: meta-tegra 19 | branch: scarthgap-l4t-r35.x (JP5) or scarthgap (JP6) 20 | revision: HEAD 21 | ``` 22 | 23 | ``` 24 | URI: https://github.com/mendersoftware/meta-mender.git 25 | layers: meta-mender-core 26 | branch: scarthgap 27 | revision: HEAD 28 | ``` 29 | 30 | ## Layer structure 31 | 32 | - `meta-mender-tegra-common` 33 | Holds all common parts of the Mender integration for Tegra across all 34 | currently supported releases of Jetpack 35 | 36 | - `meta-mender-tegra-jetpack5` 37 | Holds Jetpack release 5 specific parts of the Mender integration for Tegra. 38 | This correlates with the `scarthgap-l4t-r35.x` branch of `meta-tegra`. 39 | 40 | - `meta-mender-tegra-jetpack6` 41 | Holds Jetpack release 6 specific parts of the Mender integration for Tegra. 42 | This correlates with the `scarthgap` branch of `meta-tegra`. 43 | 44 | ## Quick start 45 | 46 | See the mender hub pages and the documentation for the `tegrademo-mender` 47 | distro on the [tegra-demo-distro](https://github.com/OE4T/tegra-demo-distro) repository 48 | for the most up to date instructions on starting out with mender and tegra. 49 | 50 | ## [`kas`](https://github.com/siemens/kas) configurations 51 | 52 | The following configuration files for building using the `kas` tool are provided: 53 | 54 | ### Jetpack 5 55 | 56 | - [jetson-agx-orin-devkit.yml](../kas/tegra/jetpack5/jetson-agx-orin-devkit.yml) 57 | - [jetson-agx-xavier-devkit.yml](../kas/tegra/jetpack5/jetson-agx-xavier-devkit.yml) 58 | - [jetson-orin-16gb-nx-p3786.yml](../kas/tegra/jetpack6/jetson-orin-16gb-nx-p3786.yml) 59 | - [jetson-orin-nano-devkit.yml](../kas/tegra/jetpack5/jetson-orin-nano-devkit.yml) 60 | 61 | ### Jetpack 6 62 | 63 | - [jetson-agx-orin-devkit-64.yml](../kas/tegra/jetpack6/jetson-agx-orin-devkit-64.yml) 64 | - [jetson-agx-orin-devkit.yml](../kas/tegra/jetpack6/jetson-agx-orin-devkit.yml) 65 | - [jetson-orin-16gb-nx-p3786.yml](../kas/tegra/jetpack6/jetson-orin-16gb-nx-p3786.yml) 66 | - [jetson-orin-nano-devkit.yml](../kas/tegra/jetpack6/jetson-orin-nano-devkit.yml) 67 | 68 | ### Jetson Orin NX 69 | 70 | Mender leverages the UDA partition to store the persistent data between updates. But with the 71 | Orin NX which uses an NVMe the current process doesn't work. Based on nvidia feedback [UDA is 72 | reserved](https://forums.developer.nvidia.com/t/jetson-orin-nx-custom-partition-layout-fails-with-uda-at-the-end/316401/6) by nvidia. 73 | 74 | To solve this issue we create a new [custom partition layout](recipes-bsp/tegra-binaries/tegra-storage-layout/flash_l4t_t234_nvme_rootfs_ab.xml) with a dedicated partition `id=17` for persistent data. 75 | 76 | ### Auto Grow UDA Partition 77 | 78 | It is possible to auto-grow the UDA partition to fill remaining space with [this](https://gist.github.com/rishabnayak/a734d2720f43b8908e59564c14fa52e9) bbappend in a layer above `meta-mender-tegra`. It sets the UDA allocation attribute to `0x808`, removes partition id numbers, and moves the UDA partition to right before the `secondary_gpt` partition following [Nvidia documentation](https://docs.nvidia.com/jetson/archives/r35.6.0/DeveloperGuide/AR/BootArchitecture/PartitionConfiguration.html#partition-child-elements). 79 | 80 | ## Acknowlegements 81 | 82 | Special thanks to [Matt Madison](https://github.com/madisongh) for his contributions to 83 | support zeus and later branches and his work on meta-tegra which makes this mender 84 | integration possible. 85 | 86 | Thanks also to [Kurt Keifer](https://github.com/kekiefer/) for his contributions and 87 | cleanup to support additional platforms and the tegra-demo-distro on the dunfell release. 88 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/README.md: -------------------------------------------------------------------------------- 1 | This layer holds common parts of the Mender integration for Tegra 2 | platforms across all supported Jetpack releasess. 3 | 4 | See ../README.md for more details and other layers. 5 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/classes-global/tegra-mender-setup.bbclass: -------------------------------------------------------------------------------- 1 | inherit l4t_version 2 | 3 | python () { 4 | # insert l4t-mender- as a machine-specific override for tegra platforms 5 | machine_overrides = d.getVar('MACHINEOVERRIDES', False).split(':') 6 | try: 7 | i = machine_overrides.index('tegra') 8 | l4t_ver = 'l4t-mender-%s' % d.getVar('L4T_VERSION').replace('.','-') 9 | d.setVar('MACHINEOVERRIDES', ':'.join(machine_overrides[:i] + [l4t_ver] + machine_overrides[i:])) 10 | except ValueError: 11 | pass 12 | } 13 | 14 | def tegra_mender_set_rootfs_partsize(calc_rootfs_size_kb): 15 | return calc_rootfs_size_kb * 1024 16 | 17 | def tegra_mender_image_rootfs_size(d): 18 | rootfspart_size = d.getVar('ROOTFSPART_SIZE') 19 | if rootfspart_size: 20 | calc_rootfs_size = int(rootfspart_size) // 1024 21 | else: 22 | calc_rootfs_size = int(d.getVar('MENDER_CALC_ROOTFS_SIZE')) 23 | calc_rootfs_size = (calc_rootfs_size * 95) // 100 24 | return calc_rootfs_size - eval(d.getVar('IMAGE_ROOTFS_EXTRA_SPACE')) 25 | 26 | # meta-tegra and tegraflash requirements 27 | IMAGE_CLASSES += "image_types_mender_tegra" 28 | IMAGE_FSTYPES += "tegraflash" 29 | 30 | ARTIFACTIMG_FSTYPE = "ext4" 31 | # Generate dataimg for use with tegraflash 32 | IMAGE_TYPEDEP:tegraflash += " dataimg" 33 | IMAGE_FSTYPES += "dataimg" 34 | PREFERRED_PROVIDER_u-boot-fw-utils = "u-boot-fw-utils-tegra" 35 | PREFERRED_PROVIDER_libubootenv:tegra = "${@'libubootenv-fake' if d.getVar('PREFERRED_PROVIDER_virtual/bootloader').startswith('cboot') else 'libubootenv'}" 36 | PREFERRED_RPROVIDER_u-boot-fw-utils = "u-boot-fw-utils-tegra" 37 | PREFERRED_RPROVIDER_libubootenv-bin:tegra = "${@'libubootenv-fake' if d.getVar('PREFERRED_PROVIDER_virtual/bootloader').startswith('cboot') else 'libubootenv-bin'}" 38 | PREFERRED_PROVIDER_virtual/bootloader:tegra194 = "edk2-firmware-tegra" 39 | PREFERRED_PROVIDER_libubootenv:tegra234 = "libubootenv-fake" 40 | PREFERRED_PROVIDER_libubootenv:tegra194 = "libubootenv-fake" 41 | MENDER_FEATURES_DISABLE:append:tegra194 = " mender-uboot" 42 | 43 | # Note: this isn't really a boot file, just put it here to keep the mender build from 44 | # complaining about empty IMAGE_BOOT_FILES. We won't use the full image anyway, just the mender file 45 | IMAGE_BOOT_FILES = "u-boot-dtb.bin" 46 | # Mender customizations to support jetson platforms. This needs to 47 | # match up with your defined flash or sdcard layout. 48 | # You will need to update these partition values when you update the flash layout. One way to find the correct number is to 49 | # boot into an emergency shell and examine the /dev/mmcblk* devices, 50 | # or use the uboot console to look at mtdparts 51 | MENDER_DATA_PART_NUMBER_DEFAULT:tegra186 = "34" 52 | MENDER_DATA_PART_NUMBER_DEFAULT:tegra194 = "42" 53 | MENDER_DATA_PART_NUMBER_DEFAULT:xavier-nx = "23" 54 | MENDER_DATA_PART_NUMBER_DEFAULT:tegra210 = "${@'16' if (d.getVar('TEGRA_SPIFLASH_BOOT') or '') == '1' else '23'}" 55 | MENDER_DATA_PART_NUMBER_DEFAULT:jetson-nano-emmc = "19" 56 | MENDER_DATA_PART_NUMBER_DEFAULT:tegra234 = "15" 57 | MENDER_ROOTFS_PART_A_NUMBER_DEFAULT = "1" 58 | MENDER_ROOTFS_PART_B_NUMBER_DEFAULT:tegra186 = "33" 59 | MENDER_ROOTFS_PART_B_NUMBER_DEFAULT:tegra194 = "2" 60 | MENDER_ROOTFS_PART_B_NUMBER_DEFAULT:tegra210 = "${@'15' if (d.getVar('TEGRA_SPIFLASH_BOOT') or '') == '1' else '22'}" 61 | MENDER_ROOTFS_PART_B_NUMBER_DEFAULT:jetson-nano-emmc = "18" 62 | MENDER_ROOTFS_PART_B_NUMBER_DEFAULT:tegra234 = "2" 63 | MENDER_STORAGE_DEVICE_DEFAULT:jetson-orin-nano-devkit = "/dev/mmcblk1" 64 | 65 | # Machine name and flash layout changed for SDcard Nanos in L4T R32.5.x 66 | MENDER_DATA_PART_NUMBER_DEFAULT:jetson-nano-devkit = "3" 67 | MENDER_ROOTFS_PART_B_NUMBER_DEFAULT:jetson-nano-devkit = "2" 68 | # Machine name changed for Nano-eMMC in L4T R32.5.x 69 | MENDER_DATA_PART_NUMBER_DEFAULT:jetson-nano-devkit-emmc = "19" 70 | MENDER_ROOTFS_PART_B_NUMBER_DEFAULT:jetson-nano-devkit-emmc = "18" 71 | # Added in L4T R32.5.x 72 | MENDER_DATA_PART_NUMBER_DEFAULT:jetson-nano-2gb-devkit = "4" 73 | MENDER_ROOTFS_PART_B_NUMBER_DEFAULT:jetson-nano-2gb-devkit = "2" 74 | 75 | # Use a 4096 byte alignment for support of tegraflash scheme and default partition locations 76 | MENDER_PARTITION_ALIGNMENT = "4096" 77 | 78 | MENDER_RESERVED_SPACE_BOOTLOADER_DATA = "0" 79 | 80 | # See note in https://docs.mender.io/1.7/troubleshooting/running-yocto-project-image#i-moved-from-an-older-meta-mender-branch-to-the-thud-branch-and 81 | # Prevents build failure during mkfs.ext4 step on warrior 82 | MENDER_PARTITIONING_OVERHEAD_KB = "0" 83 | # We don't use a boot partition in the mender image, we use tegraflash to setup our boot partition 84 | MENDER_BOOT_PART = "" 85 | MENDER_BOOT_PART_SIZE_MB = "0" 86 | 87 | # Calculate the ROOTFSPART_SIZE value based on the *calculated* 88 | # IMAGE_ROOTFS_SIZE set by mender. Do *not* use ${IMAGE_ROOTFS_SIZE} 89 | # here; when we're called on in the context of an initramfs image 90 | # build (for BUP payload generation), its size is set smaller than 91 | # the actual rootfs image, so the resulting flash layout XML files 92 | # will be different between the two contexts, leading to boot 93 | # failures after bootloader updates. 94 | ROOTFSPART_SIZE = "${@tegra_mender_set_rootfs_partsize(${MENDER_CALC_ROOTFS_SIZE})}" 95 | 96 | # See https://hub.mender.io/t/yocto-thud-release-and-mender/144 97 | # Default for thud and later is grub integration but we need to use u-boot integration already included. 98 | # Leave out sdimg since we don't use this with tegra (instead use 99 | # tegraflash) 100 | MENDER_FEATURES_ENABLE:append:tegra = "${@tegra_mender_uboot_feature(d)}" 101 | MENDER_FEATURES_DISABLE:append:tegra = " mender-grub mender-image-uefi" 102 | 103 | # Use these variables to adjust your total rootfs size across both 104 | # images. Rootfs size will be approximately 1/2 of 105 | # MENDER_STORAGE_TOTAL_SIZE_MB (ignoring alignment). 106 | # Calculate the total size based on the eMMC or SDcard size configured 107 | # for the machine, subtracting off space for the boot-related files 108 | # and other NVIDIA-specific partitions (by default, 1GiB). 109 | def tegra_mender_calc_total_size(d): 110 | # For pre-production Nanos, use SDCard size, which in the machine 111 | # config ends with a size factor (K, M, or G). Note that the 112 | # factors are kilo/mega/giga, rather than kibi/mibi/gibi. 113 | if (d.getVar('TEGRA_SPIFLASH_BOOT') or '') == '1': 114 | sdcard_size = d.getVar('TEGRAFLASH_SDCARD_SIZE') 115 | fchar = sdcard_size[-1:].upper() 116 | sdcard_size = int(sdcard_size[:-1]) 117 | if fchar == 'G': 118 | total_size_bytes = sdcard_size * 1000 * 1000 * 1000 119 | elif fchar == 'K': 120 | total_size_bytes = sdcard_size * 1000 121 | elif fchar == 'M': 122 | total_size_bytes = sdcard_size * 1000 * 1000 123 | else: 124 | bb.error('TEGRAFLASH_SDCARD_SIZE does not end with G, K, or M') 125 | else: 126 | emmc_size = d.getVar('EMMC_SIZE') 127 | if not emmc_size: 128 | bb.fatal('neither EMMC_SIZE nor TEGRA_SPIFLASH_BOOT configured, aborting') 129 | total_size_bytes = int(emmc_size) 130 | # Mender uses mibibytes, not megabytes 131 | return total_size_bytes // (1024*1024) - int(d.getVar('TEGRA_MENDER_RESERVED_SPACE_MB')) 132 | 133 | MENDER_IMAGE_ROOTFS_SIZE_DEFAULT = "${@tegra_mender_image_rootfs_size(d)}" 134 | TEGRA_MENDER_RESERVED_SPACE_MB_DEFAULT = "1024" 135 | TEGRA_MENDER_RESERVED_SPACE_MB_DEFAULT:jetson-nano-2gb-devkit = "5120" 136 | TEGRA_MENDER_RESERVED_SPACE_MB ?= "${TEGRA_MENDER_RESERVED_SPACE_MB_DEFAULT}" 137 | MENDER_STORAGE_TOTAL_SIZE_MB_DEFAULT:tegra = "${@tegra_mender_calc_total_size(d)}" 138 | 139 | def tegra_mender_uboot_feature(d): 140 | if (d.getVar('PREFERRED_PROVIDER_virtual/bootloader') or '').startswith('cboot'): 141 | return " mender-persist-systemd-machine-id" 142 | return " mender-uboot mender-persist-systemd-machine-id" 143 | 144 | _MENDER_IMAGE_DEPS_EXTRA = "" 145 | _MENDER_IMAGE_DEPS_EXTRA:tegra = "tegra-state-scripts:do_deploy" 146 | do_image_mender[depends] += "${_MENDER_IMAGE_DEPS_EXTRA}" 147 | 148 | # mender-setup-image adds kernel-image and kernel-devicetree 149 | # to MACHINE_ESSENTIAL_EXTRA_RDEPENDS, but they should *not* 150 | # be included by default on cboot platforms. 151 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS:remove:tegra194 = "kernel-image kernel-devicetree" 152 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS:remove:tegra186 = "${@'kernel-image kernel-devicetree' if (d.getVar('PREFERRED_PROVIDER_virtual/bootloader') or '').startswith('cboot') else ''}" 153 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS:remove:tegra234 = "kernel-image kernel-devicetree" 154 | 155 | # Compatibility settings for handling the machine name changes 156 | # made in L4T R32.5.x, to allow for upgrades. This does not 157 | # include jetson-nano-qspi-sd (now jetson-nano-devkit) due to 158 | # major changes in the flash layout. 159 | MENDER_DEVICE_TYPES_COMPATIBLE:append:jetson-tx1-devkit = " jetson-tx1" 160 | MENDER_DEVICE_TYPES_COMPATIBLE:append:jetson-tx2-devkit = " jetson-tx2" 161 | MENDER_DEVICE_TYPES_COMPATIBLE:append:jetson-tx2-devkit-tx2i = " jetson-tx2i" 162 | MENDER_DEVICE_TYPES_COMPATIBLE:append:jetson-tx2-devkit-4gb = " jetson-tx2-4gb" 163 | MENDER_DEVICE_TYPES_COMPATIBLE:append:jetson-agx-xavier-devkit = " jetson-xavier" 164 | MENDER_DEVICE_TYPES_COMPATIBLE:append:jetson-agx-xavier-devkit-8gb = " jetson-xavier-8gb" 165 | MENDER_DEVICE_TYPES_COMPATIBLE:append:jetson-nano-devkit-emmc = " jetson-nano-emmc" 166 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/classes-recipe/image_types_mender_tegra.bbclass: -------------------------------------------------------------------------------- 1 | inherit image_types_tegra 2 | 3 | DATAFILE ?= "${IMAGE_BASENAME}-${MACHINE}.dataimg" 4 | IMAGE_TEGRAFLASH_DATA ?= "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.dataimg" 5 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/conf/layer.conf: -------------------------------------------------------------------------------- 1 | # We have a conf and classes directory, add to BBPATH 2 | BBPATH .= ":${LAYERDIR}" 3 | # We have recipes-* directories, add to BBFILES 4 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ 5 | ${LAYERDIR}/recipes-*/*/*.bbappend" 6 | 7 | BBFILE_COLLECTIONS += "meta-mender-tegra-common" 8 | BBFILE_PATTERN_meta-mender-tegra-common = "^${LAYERDIR}/" 9 | BBFILE_PRIORITY_meta-mender-tegra-common = "10" 10 | LAYERVERSION_meta-mender-tegra-common = "1" 11 | LAYERSERIES_COMPAT_meta-mender-tegra-common = "scarthgap" 12 | LAYERDEPENDS_meta-mender-tegra-common = "tegra" 13 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-bsp/tegra-binaries/tegra-redundant-boot/nv_update_verifier.init: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | NAME=nv_update_verifier 3 | DESC="OTA bootloader update verifier" 4 | 5 | case "$1" in 6 | start|restart) 7 | echo -n "Running $DESC: " 8 | /usr/sbin/nv_update_verifier < /dev/null 9 | echo "[OK]" 10 | ;; 11 | stop) 12 | ;; 13 | *) 14 | N=/etc/init.d/$NAME 15 | echo "Usage: $N {start|stop|restart}" >&2 16 | exit 1 17 | ;; 18 | esac 19 | 20 | exit 0 21 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-bsp/tegra-binaries/tegra-redundant-boot/nv_update_verifier.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=OTA bootloader update verifier 3 | After=nvstartup.service 4 | 5 | [Service] 6 | Type=simple 7 | ExecStart=/usr/sbin/nv_update_verifier 8 | 9 | [Install] 10 | WantedBy=basic.target 11 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-bsp/tegra-binaries/tegra-redundant-boot/nv_update_verifier.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | boot_flag="/var/lib/mender/boot_attempted" 4 | current_slot=$(/usr/sbin/nvbootctrl get-current-slot) 5 | upgrade_available=$(/sbin/fw_printenv upgrade_available | cut -d "=" -f2) 6 | 7 | # Only verify booted slot if we are not in an upgrade process 8 | # since mender will do that on commit (through fw_setenv) 9 | if [ "$upgrade_available" = "0" ]; then 10 | /usr/sbin/nvbootctrl verify 11 | if [ -f $boot_flag ]; then 12 | rm $boot_flag 13 | fi 14 | exit 0 15 | fi 16 | 17 | if [ -f $boot_flag ]; then 18 | prev_boot_attempt="$(cat $boot_flag)" 19 | rm $boot_flag 20 | if [ "$prev_boot_attempt" = "$current_slot" ]; then 21 | systemctl reboot -f 22 | exit 1 23 | fi 24 | fi 25 | echo $current_slot > $boot_flag 26 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-bsp/tegra-binaries/tegra-redundant-boot_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | SRC_URI:append = "\ 4 | file://nv_update_verifier.sh \ 5 | " 6 | 7 | do_install:append() { 8 | install -d ${D}/${sbindir} 9 | install -m 0755 ${S}/nv_update_verifier.sh ${D}/${sbindir}/nv_update_verifier 10 | } 11 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-bsp/tegra-binaries/tegra-storage-layout-base_%.bbappend: -------------------------------------------------------------------------------- 1 | DEPENDS:append = " tegra-helper-scripts-native" 2 | PATH =. "${STAGING_BINDIR_NATIVE}/tegra-flash:" 3 | 4 | mender_flash_layout_adjust() { 5 | local file=$1 6 | mv ${D}${datadir}/l4t-storage-layout/$file ${WORKDIR}/$file 7 | nvflashxmlparse -v --rewrite-contents-from=${WORKDIR}/UDA.xml \ 8 | --output=${D}${datadir}/l4t-storage-layout/$file \ 9 | ${WORKDIR}/$file 10 | } 11 | 12 | do_install:append() { 13 | cat <${WORKDIR}/UDA.xml 14 | 15 | 16 | 17 | DATAFILE 18 | 19 | 20 | 21 | EOF 22 | 23 | mender_flash_layout_adjust "${PARTITION_LAYOUT_TEMPLATE}" 24 | mender_flash_layout_adjust "${PARTITION_LAYOUT_EXTERNAL}" 25 | } 26 | 27 | do_install:append:tegra194() { 28 | # Remove invalid start locations from upstream L4T partition layout files that 29 | # prevents the Mender data partition to use remaining space. 30 | sed -i -e 's# 0x708400000 ##g' \ 31 | -e 's# 0x710800000 ##g' \ 32 | ${D}${datadir}/l4t-storage-layout/${PARTITION_LAYOUT_TEMPLATE} 33 | sed -i -e 's# 0x708400000 ##g' \ 34 | -e 's# 0x710800000 ##g' \ 35 | ${D}${datadir}/l4t-storage-layout/${PARTITION_LAYOUT_EXTERNAL} 36 | } 37 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-bsp/tegra-binaries/tegra-storage-layout/flash_l4t_t234_nvme_rootfs_ab.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | 16 | 17 | 18 | 19 | 20 | sequential 21 | basic 22 | 512 23 | 0 24 | 8 25 | 0 26 | 27 | 28 | sequential 29 | basic 30 | 19968 31 | 0 32 | 8 33 | 0 34 | 35 | 36 | sequential 37 | basic 38 | 134217728 39 | 0 40 | 8 41 | 0 42 | LNXFILE 43 | 44 | 45 | sequential 46 | basic 47 | 786432 48 | 0 49 | 8 50 | 0 51 | DTB_FILE 52 | 53 | 54 | sequential 55 | basic 56 | 33161216 57 | 0 58 | 8 59 | 0 60 | 61 | 62 | sequential 63 | basic 64 | 134217728 65 | 0 66 | 8 67 | 0 68 | LNXFILE_b 69 | 70 | 71 | sequential 72 | basic 73 | 786432 74 | 0 75 | 8 76 | 0 77 | DTB_FILE 78 | 79 | 80 | sequential 81 | basic 82 | 33161216 83 | 0 84 | 8 85 | 0 86 | 87 | 88 | sequential 89 | basic 90 | RECSIZE 91 | 0 92 | 8 93 | 0 94 | RECFILE 95 | 96 | 97 | sequential 98 | basic 99 | 524288 100 | 0 101 | 8 102 | 0 103 | RECDTB-FILE 104 | 105 | 106 | sequential 107 | basic 108 | 67108864 109 | 0 110 | 0x8 111 | 0 112 | ESP_FILE 113 | C12A7328-F81F-11D2-BA4B-00A0C93EC93B 114 | **Required.** EFI system partition with L4T Launcher. 115 | 116 | 117 | sequential 118 | basic 119 | RECSIZE 120 | 0 121 | 8 122 | 0 123 | 124 | 125 | sequential 126 | basic 127 | 524288 128 | 0 129 | 8 130 | 0 131 | 132 | 133 | sequential 134 | basic 135 | 67108864 136 | 0 137 | 0x8 138 | 0 139 | **Required.** EFI system partition for fail-safe ESP update. 140 | 141 | 142 | sequential 143 | basic 144 | 419430400 145 | 0 146 | 8 147 | 0 148 | 16384 149 | **Required.** This partition may be mounted and used to store user 150 | data. 151 | 152 | 153 | sequential 154 | basic 155 | 502792192 156 | 0 157 | 8 158 | 0 159 | **Required.** Reserve space in case there is any partition change 160 | required in the future, for example, adding new partitions or increasing size 161 | of some partitions. 162 | 163 | 164 | sequential 165 | basic 166 | APPSIZE 167 | 0 168 | 0x8 169 | 16384 170 | 0 171 | APPUUID 172 | APPFILE 173 | **Required.** Contains the rootfs. This partition must be assigned 174 | the "1" for id as it is physically put to the end of the device, so that it 175 | can be accessed as the fixed known special device `/dev/nvme0n1p1`. 176 | 177 | 178 | sequential 179 | basic 180 | APPSIZE 181 | 0 182 | 0x8 183 | 16384 184 | 0 185 | APPUUID_b 186 | APPFILE_b 187 | **Required.** Contains the rootfs. This partition must be assigned 188 | the "2" for id as it is physically put to the end of the device, so that it 189 | can be accessed as the fixed known special device `/dev/nvme0n1p2`. 190 | 191 | 192 | sequential 193 | basic 194 | 419430400 195 | 0 196 | 0x808 197 | 0 198 | 16384 199 | DATAFILE 200 | **Required.** This partition is used to store permanent user 201 | and device data between A/B updates 202 | 203 | 204 | sequential 205 | basic 206 | 0xFFFFFFFFFFFFFFFF 207 | 0 208 | 8 209 | 0 210 | 211 | 212 | 213 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-bsp/tegra-binaries/tegra-storage-layout_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | SRC_URI:append:p3768-0000-p3767-0000 = " \ 4 | file://flash_l4t_t234_nvme_rootfs_ab.xml \ 5 | " 6 | 7 | PARTITION_FILE_EXTERNAL:p3768-0000-p3767-0000 = "${WORKDIR}/flash_l4t_t234_nvme_rootfs_ab.xml" 8 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-bsp/u-boot/libubootenv-fake/fw_printenv: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | LABELCHARS="AB" 3 | 4 | get_bootpart() { 5 | local current_slot=`nvbootctrl get-current-slot 2>/dev/null || tegra-boot-control --current-slot 2>/dev/null` 6 | if [ -z "$current_slot" ]; then 7 | echo "ERR: could not identify current boot slot" >&2 8 | echo "UNKNOWN" 9 | return 10 | fi 11 | local cfglbl="\"RootfsPart${LABELCHARS:$current_slot:1}\"" 12 | local devnam=`grep -h "$cfglbl:" /etc/mender/mender.conf /var/lib/mender/mender.conf | tr -d '" ,' | grep -o '[0-9]\+$'` 13 | echo "$devnam" 14 | } 15 | 16 | quiet= 17 | if [ "$1" = "-n" ]; then 18 | quiet="yes" 19 | shift 20 | if [ -z "$1" ]; then 21 | echo "ERR: missing var name with -n" >&2 22 | exit 1 23 | fi 24 | fi 25 | if [ -z "$1" ]; then 26 | bootpart=`get_bootpart` 27 | echo "mender_boot_part=$bootpart" 28 | exit 0 29 | fi 30 | while [ -n "$1" ]; do 31 | case "$1" in 32 | mender_boot_part) 33 | bootpart=`get_bootpart` 34 | [ -n "$quiet" ] || echo -n "$1=" 35 | echo "$bootpart" 36 | ;; 37 | mender_boot_part_hex) 38 | bootpart=`get_bootpart` 39 | bootpart_hex=`echo 16o${bootpart}p | dc` 40 | [ -n "$quiet" ] || echo -n "$1=" 41 | echo "$bootpart_hex" 42 | ;; 43 | mender_uboot_separator) 44 | [ -n "$quiet" ] || echo -n "$1=" 45 | echo "something other than just 1" 46 | ;; 47 | upgrade_available) 48 | [ -n "$quiet" ] || echo -n "$1=" 49 | if [ -e "/var/lib/mender/upgrade_available" ]; then 50 | echo "1" 51 | else 52 | echo "0" 53 | fi 54 | ;; 55 | mender_check_saveenv_canary) 56 | [ -n "$quiet" ] || echo -n "$1=" 57 | echo "0" 58 | ;; 59 | *) 60 | echo "ERR: no such variable: $1" >&2 61 | exit 1 62 | esac 63 | shift 64 | done 65 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-bsp/u-boot/libubootenv-fake/fw_setenv: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ "$1" = "-s" ]; then 3 | while IFS="= " read var restofline; do 4 | if [ "$var" = "upgrade_available" ]; then 5 | if [ "$restofline" = "1" ]; then 6 | touch /var/lib/mender/upgrade_available 7 | else 8 | rm -f /var/lib/mender/upgrade_available 9 | fi 10 | fi 11 | done 12 | elif [ "$1" = "upgrade_available" ]; then 13 | if [ "$2" = "1" ]; then 14 | touch /var/lib/mender/upgrade_available 15 | else 16 | rm -f /var/lib/mender/upgrade_available 17 | fi 18 | fi 19 | exit 0 20 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-bsp/u-boot/libubootenv-fake_1.0.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "Fake implementation of fw_printenv and fw_setenv for Mender" 2 | LICENSE = "Apache-2.0" 3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" 4 | 5 | SRC_URI = " \ 6 | file://fw_printenv \ 7 | file://fw_setenv \ 8 | " 9 | 10 | PROVIDES += "libubootenv" 11 | 12 | S = "${WORKDIR}" 13 | 14 | do_configure[noexec] = "1" 15 | do_compile[noexec] = "1" 16 | 17 | do_install() { 18 | install -d ${D}${base_sbindir} 19 | install -m 0755 ${S}/fw_printenv ${S}/fw_setenv ${D}${base_sbindir}/ 20 | } 21 | 22 | PACKAGE_ARCH = "${MACHINE_ARCH}" 23 | 24 | RPROVIDES:${PN} += "libubootenv-bin u-boot-fw-utils" 25 | RDEPENDS:${PN} = "tegra-boot-tools" 26 | RDEPENDS:${PN}:tegra234 = "" 27 | RDEPENDS:${PN}:tegra194 = "" 28 | RCONFLICTS:${PN} = "libubootenv-bin" 29 | RREPLACES:${PN} = "libubootenv-bin" 30 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-bsp/uefi/edk2-firmware-tegra_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | SRC_URI += "file://0001-Enable-runtime-access-to-KernelCommandLine-efivar.patch;patchdir=../edk2-nvidia" -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-bsp/uefi/files/0001-Enable-runtime-access-to-KernelCommandLine-efivar.patch: -------------------------------------------------------------------------------- 1 | From 9b2b9fbca52c8979b41722936617696622722ecf Mon Sep 17 00:00:00 2001 2 | From: Alexander Knaub 3 | Date: Tue, 19 Nov 2024 09:24:56 +0100 4 | Subject: [PATCH] edk2-nvidia: Enable runtime access to KernelCommandLine 5 | efivar 6 | 7 | --- 8 | Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigDxe.c | 2 +- 9 | Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigHii.vfr | 2 +- 10 | Silicon/NVIDIA/Library/PlatformBootManagerLib/PlatformBm.c | 2 +- 11 | 3 files changed, 3 insertions(+), 3 deletions(-) 12 | 13 | diff --git a/Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigDxe.c b/Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigDxe.c 14 | index cd896efc..3b927636 100644 15 | --- a/Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigDxe.c 16 | +++ b/Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigDxe.c 17 | @@ -1827,7 +1827,7 @@ InitializeSettings ( 18 | if (KernelCmdLineLen < sizeof (CmdLine)) { 19 | KernelCmdLineLen = sizeof (CmdLine); 20 | ZeroMem (&CmdLine, KernelCmdLineLen); 21 | - Status = gRT->SetVariable (L"KernelCommandLine", &gNVIDIAPublicVariableGuid, EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS, KernelCmdLineLen, (VOID *)&CmdLine); 22 | + Status = gRT->SetVariable (L"KernelCommandLine", &gNVIDIAPublicVariableGuid, EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, KernelCmdLineLen, (VOID *)&CmdLine); 23 | if (EFI_ERROR (Status)) { 24 | DEBUG ((DEBUG_ERROR, "%a: Error setting command line variable %r\r\n", __FUNCTION__, Status)); 25 | } 26 | diff --git a/Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigHii.vfr b/Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigHii.vfr 27 | index 328b7789..2d196376 100644 28 | --- a/Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigHii.vfr 29 | +++ b/Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigHii.vfr 30 | @@ -61,7 +61,7 @@ formset 31 | guid = NVIDIA_TOKEN_SPACE_GUID; 32 | 33 | efivarstore NVIDIA_KERNEL_COMMAND_LINE, 34 | - attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, // EFI variable attributes 35 | + attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS, // EFI variable attributes 36 | name = KernelCommandLine, 37 | guid = NVIDIA_PUBLIC_VARIABLE_GUID; 38 | 39 | diff --git a/Silicon/NVIDIA/Library/PlatformBootManagerLib/PlatformBm.c b/Silicon/NVIDIA/Library/PlatformBootManagerLib/PlatformBm.c 40 | index b2c69f47..51299d60 100644 41 | --- a/Silicon/NVIDIA/Library/PlatformBootManagerLib/PlatformBm.c 42 | +++ b/Silicon/NVIDIA/Library/PlatformBootManagerLib/PlatformBm.c 43 | @@ -1318,7 +1318,7 @@ IsPlatformConfigurationNeeded ( 44 | AddlCmdLen = sizeof (AddlCmdLine); 45 | Status = gRT->GetVariable (L"KernelCommandLine", &gNVIDIAPublicVariableGuid, &AddlCmdLineAttributes, &AddlCmdLen, &AddlCmdLine); 46 | if (EFI_ERROR (Status)) { 47 | - AddlCmdLineAttributes = EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS; 48 | + AddlCmdLineAttributes = EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS; 49 | ZeroMem (&AddlCmdLine, sizeof (AddlCmdLine)); 50 | } 51 | 52 | -- 53 | 2.34.1 54 | 55 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-bsp/uefi/l4t-launcher-extlinux.bbappend: -------------------------------------------------------------------------------- 1 | UBOOT_EXTLINUX_FDT:jetson-orin-nano-devkit ?= "/boot/${DTBFILE}" 2 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-mender/mender-client/files/efi_systemd_machine_id.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | function to_unicode() { 4 | local in="$1" 5 | local out 6 | 7 | for (( i=0; i<${#in}; i++)); do 8 | char=${in:i:1} 9 | out+="$char" 10 | out+="\x00" 11 | done 12 | echo -n "$out" 13 | } 14 | 15 | 16 | function fill_to_size() { 17 | local size="$2" 18 | local out="$1" 19 | local fill_size=$(( $size - (${#out}*2/5) )) 20 | 21 | for i in $(seq $fill_size) 22 | do 23 | out+="\x00" 24 | done 25 | 26 | echo -n "$out" 27 | } 28 | 29 | 30 | function write_efivar() { 31 | local readonly varname="781e084c-a330-417c-b678-38e696380cb9-KernelCommandLine" 32 | local readonly total_size=514 33 | local readonly attr_size=4 34 | local readonly data_size=$(( $total_size - $attr_size)) 35 | local in="$1" 36 | 37 | #printf "\nin=$in\n" 38 | local out="$(to_unicode "$in")" 39 | out="$(fill_to_size "$out" $data_size)" 40 | 41 | local f=$(mktemp) 42 | printf "$out" > $f 43 | efivar -n $varname -f $f -w 44 | rm ${f} 45 | } 46 | 47 | function read_efivar() { 48 | local readonly varname="/sys/firmware/efi/efivars/KernelCommandLine-781e084c-a330-417c-b678-38e696380cb9" 49 | local var=$(cat $varname | tail -c +5 | tr -d '[\000]') 50 | 51 | echo -n "$var" 52 | } 53 | 54 | 55 | function read_efi_machine_id() { 56 | local var=$(read_efivar) 57 | local id 58 | 59 | for i in $var; do 60 | case $i in 61 | systemd.machine_id=*) 62 | id="${i#*=}" 63 | ;; 64 | *) 65 | ;; 66 | esac 67 | done 68 | echo -n "$id" 69 | } 70 | 71 | 72 | function write_efi_machine_id() { 73 | local id="$1" 74 | local var=$(read_efivar) 75 | local out_var 76 | local sep="" 77 | local id_mod=false 78 | 79 | for i in $var; do 80 | out_var+="$sep" 81 | case $i in 82 | systemd.machine_id=*) 83 | out_var+="systemd.machine_id=$id" 84 | id_mod=true 85 | ;; 86 | *) 87 | out_var+="$i" 88 | ;; 89 | esac 90 | sep=" " 91 | done 92 | 93 | if [ "$id_mod" = false ] ; then 94 | out_var+="${sep}systemd.machine_id=$id" 95 | fi 96 | 97 | write_efivar "$out_var" 98 | } 99 | 100 | 101 | usage="Usage: efi_systemd_machine_id.sh [-r] [-w val]" 102 | 103 | while getopts "rw:" opt; do 104 | case ${opt} in 105 | r ) 106 | printf "$(read_efi_machine_id)\n" 107 | ;; 108 | w ) 109 | write_efi_machine_id $OPTARG 110 | ;; 111 | \? ) 112 | echo "$usage";exit 2 113 | ;; 114 | esac 115 | done 116 | 117 | 118 | if [ $OPTIND -eq 1 ]; then 119 | echo "$usage"; exit 1 120 | fi 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-mender/mender-client/files/tegra-mender-client-set-systemd-machine-id.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -eu 4 | 5 | BOOTENV_PRINT="efi_systemd_machine_id.sh -r" 6 | BOOTENV_SET="efi_systemd_machine_id.sh -w" 7 | 8 | CURRENT_BOOTLOADER_ID=$($BOOTENV_PRINT 2>/dev/null | cut -d= -f2) 9 | CURRENT_SYSTEMD_ID=$(cat /etc/machine-id) 10 | 11 | rc=0 12 | if [ -z "${CURRENT_BOOTLOADER_ID}" ] && [ ! -z "${CURRENT_SYSTEMD_ID}" ]; then 13 | $BOOTENV_SET "${CURRENT_SYSTEMD_ID}" 14 | rc=$? 15 | elif [ "${CURRENT_BOOTLOADER_ID}" != "${CURRENT_SYSTEMD_ID}" ]; then 16 | echo "Error; bootloader and systemd disagree on machine-id." >&2 17 | rc=1 18 | fi 19 | 20 | exit $rc 21 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-mender/mender-client/mender-client_%.bbappend: -------------------------------------------------------------------------------- 1 | require mender-tegra.inc 2 | 3 | RDEPENDS:${PN} += "${EXTRADEPS}" -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-mender/mender-client/mender-tegra.inc: -------------------------------------------------------------------------------- 1 | EXTRADEPS:tegra = "tegra-uefi-capsules libubootenv-fake mender-update-verifier tegra-redundant-boot" 2 | 3 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 4 | SRC_URI:remove:mender-persist-systemd-machine-id = " \ 5 | file://mender-set-systemd-machine-id.sh \ 6 | " 7 | SRC_URI:append:mender-persist-systemd-machine-id = " \ 8 | file://tegra-mender-client-set-systemd-machine-id.sh \ 9 | file://efi_systemd_machine_id.sh \ 10 | " 11 | 12 | do_install:prepend:class-target:mender-persist-systemd-machine-id() { 13 | install -d -m 755 ${D}${bindir} 14 | install -m 755 ${WORKDIR}/efi_systemd_machine_id.sh ${D}${bindir}/ 15 | cp ${WORKDIR}/tegra-mender-client-set-systemd-machine-id.sh ${WORKDIR}/mender-set-systemd-machine-id.sh 16 | } 17 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-mender/mender-client/mender_%.bbappend: -------------------------------------------------------------------------------- 1 | require mender-tegra.inc 2 | 3 | RDEPENDS:mender-update += "${EXTRADEPS}" 4 | 5 | FILES:mender-update:append:mender-persist-systemd-machine-id = " \ 6 | ${bindir}/efi_systemd_machine_id.sh \ 7 | " -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-mender/mender-update-verifier/files/mender-update-verifier.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Mender update verifier 3 | Requires=nv_update_verifier.service 4 | Before=mender-client.service mender-updated.service nv_update_verifier.service 5 | 6 | [Service] 7 | Type=oneshot 8 | ExecStart=mender-update-verifier.sh 9 | 10 | [Install] 11 | WantedBy=multi-user.target 12 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-mender/mender-update-verifier/files/mender-update-verifier.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | 4 | function read_efivar() { 5 | local AB="AB" 6 | local slot="Slot${AB:$1:1}" 7 | local varname="/sys/firmware/efi/efivars/RootfsStatus${slot}-781e084c-a330-417c-b678-38e696380cb9" 8 | local var=$(cat $varname | tail -c +5 | tr -d '[\000]') 9 | 10 | echo -n "$var" 11 | } 12 | 13 | 14 | 15 | function get_bootable_status() { 16 | local status="$(read_efivar "${1}")" 17 | local size="${#status}" 18 | return $size 19 | } 20 | 21 | 22 | function set_update_status() { 23 | get_bootable_status 0 24 | local slot0=$? 25 | get_bootable_status 1 26 | local slot1=$? 27 | if [[ "$slot0" -ne 0 || "$slot1" -ne 0 ]]; then 28 | fw_setenv -s <<< upgrade_available=0 29 | fi 30 | } 31 | 32 | set_update_status 33 | 34 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-mender/mender-update-verifier/mender-update-verifier.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "Mender update verifier" 2 | LICENSE = "Apache-2.0" 3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" 4 | 5 | SRC_URI = "\ 6 | file://mender-update-verifier.service \ 7 | file://mender-update-verifier.sh \ 8 | " 9 | 10 | S = "${WORKDIR}" 11 | 12 | do_install() { 13 | install -d ${D}${systemd_system_unitdir} 14 | install -m 0644 ${S}/mender-update-verifier.service ${D}${systemd_system_unitdir} 15 | install -d -m 755 ${D}${bindir} 16 | install -m 755 ${WORKDIR}/mender-update-verifier.sh ${D}${bindir}/ 17 | } 18 | 19 | inherit systemd 20 | 21 | SYSTEMD_SERVICE:${PN} = "mender-update-verifier.service" 22 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-mender/tegra-state-scripts/files/abort-blupdate: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CAPTARGET="/boot/efi/EFI/UpdateCapsule/TEGRA_BL.Cap" 4 | 5 | if [ -f "$CAPTARGET" ]; then 6 | rm "$CAPTARGET" 7 | fi 8 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-mender/tegra-state-scripts/files/switch-rootfs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | echo "$(mender-update show-artifact): $(basename "$0") was called!" >&2 4 | 5 | get_bootpart() { 6 | local current_slot=`nvbootctrl get-current-slot 2>/dev/null` 7 | if [ -z "$current_slot" ]; then 8 | echo "ERR: could not identify current boot slot" >&2 9 | echo "UNKNOWN" 10 | return 11 | fi 12 | echo "$current_slot" 13 | } 14 | 15 | reset_unbootable_status() { 16 | source /usr/bin/uefi_common.func 17 | 18 | local AB="AB" 19 | local slot="Slot${AB:$1:1}" 20 | local value="\x00\x00\x00\x00" 21 | set_efi_var "RootfsStatus${slot}" "781e084c-a330-417c-b678-38e696380cb9" "$value" 22 | } 23 | 24 | current_slot=`get_bootpart` 25 | echo "current_slot=$current_slot" >&2 26 | 27 | next_slot= 28 | next_rootfs_dev= 29 | if [ $current_slot = "0" ]; then 30 | next_slot="1" 31 | next_rootfs_dev="/dev/disk/by-partlabel/APP_b" 32 | else 33 | next_slot="0" 34 | next_rootfs_dev="/dev/disk/by-partlabel/APP" 35 | fi 36 | 37 | tmp_mount=`mktemp -d` 38 | 39 | reset_unbootable_status $next_slot 40 | mkdir -p /boot/efi/EFI/UpdateCapsule 41 | mount -o ro $next_rootfs_dev $tmp_mount 42 | cp ${tmp_mount}/opt/nvidia/UpdateCapsule/tegra-bl.cap /boot/efi/EFI/UpdateCapsule/TEGRA_BL.Cap 43 | umount $tmp_mount 44 | oe4t-set-uefi-OSIndications 45 | 46 | exit 0 47 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-mender/tegra-state-scripts/files/verify-slot: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | boot_flag="/var/lib/mender/boot_attempted" 4 | 5 | /usr/sbin/nvbootctrl verify 6 | rm $boot_flag || true -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-common/recipes-mender/tegra-state-scripts/tegra-state-scripts_1.0.bb: -------------------------------------------------------------------------------- 1 | SRC_URI = " \ 2 | file://switch-rootfs \ 3 | file://verify-slot \ 4 | file://abort-blupdate \ 5 | " 6 | 7 | LICENSE = "Apache-2.0" 8 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" 9 | 10 | S = "${WORKDIR}" 11 | 12 | inherit mender-state-scripts 13 | 14 | PERSIST_MACHINE_ID="" 15 | PERSIST_MACHINE_ID:mender-persist-systemd-machine-id = "yes" 16 | 17 | do_compile() { 18 | cp ${S}/switch-rootfs ${MENDER_STATE_SCRIPTS_DIR}/ArtifactInstall_Leave_50_switch-rootfs 19 | cp ${S}/verify-slot ${MENDER_STATE_SCRIPTS_DIR}/ArtifactCommit_Leave_50_verify-slot 20 | cp ${S}/abort-blupdate ${MENDER_STATE_SCRIPTS_DIR}/ArtifactRollback_Leave_50_abort-blupdate 21 | } 22 | 23 | # Make sure scripts aren't left around from old builds 24 | do_deploy:prepend() { 25 | rm -rf ${DEPLOYDIR}/mender-state-scripts 26 | } 27 | 28 | PACKAGE_ARCH = "${MACHINE_ARCH}" 29 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-jetpack5/README.md: -------------------------------------------------------------------------------- 1 | This layer holds Jetpack 5 parts of the Mender integration for Tegra. 2 | 3 | See ../README.md for more details and other layers. 4 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-jetpack5/conf/layer.conf: -------------------------------------------------------------------------------- 1 | # We have a conf and classes directory, add to BBPATH 2 | BBPATH .= ":${LAYERDIR}" 3 | # We have recipes-* directories, add to BBFILES 4 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ 5 | ${LAYERDIR}/recipes-*/*/*.bbappend" 6 | 7 | BBFILE_COLLECTIONS += "meta-mender-tegra-jetpack5" 8 | BBFILE_PATTERN_meta-mender-tegra-jetpack5 = "^${LAYERDIR}/" 9 | BBFILE_PRIORITY_meta-mender-tegra-jetpack5 = "10" 10 | LAYERVERSION_meta-mender-tegra-jetpack5 = "1" 11 | LAYERSERIES_COMPAT_meta-mender-tegra-jetpack5 = "scarthgap" 12 | LAYERDEPENDS_meta-mender-tegra-jetpack5 = "tegra meta-mender-tegra-common" 13 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/uefi/edk2-firmware-tegra_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/uefi/files/L4TConfiguration-RootfsRedundancyLevelABEnable.dtsi: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | overlay-name = "L4T Configuration Settings"; 5 | 6 | fragment@0 { 7 | target-path = "/"; 8 | 9 | board_config { 10 | sw-modules = "uefi"; 11 | }; 12 | 13 | __overlay__ { 14 | 15 | firmware { 16 | 17 | uefi { 18 | 19 | variables { 20 | 21 | gNVIDIAPublicVariableGuid { 22 | 23 | RootfsRedundancyLevel { 24 | data = [01 00 00 00]; 25 | runtime; 26 | locked; 27 | }; 28 | 29 | RootfsRetryCountMax { 30 | data = [ 01 00 00 00 ]; 31 | runtime; 32 | }; 33 | 34 | }; 35 | 36 | }; 37 | }; 38 | }; 39 | }; 40 | }; 41 | }; -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-kernel/linux/linux-tegra_%.bbappend: -------------------------------------------------------------------------------- 1 | # Rather ugly hack to ensure that meta-mender-core's files directory 2 | # is also removed from consideration, since linux-yocto.bbclass adds 3 | # all directories that contain config fragments into its file-cksums 4 | # list, which needlessly (for us) changes the task hash. 5 | python() { 6 | extrapaths = d.getVar('FILESEXTRAPATHS').split(':') 7 | newpaths = ':'.join([path for path in extrapaths if not path.endswith('meta-mender-core/recipes-kernel/linux/files')]) 8 | d.setVar('FILESEXTRAPATHS', newpaths) 9 | } 10 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-jetpack6/README.md: -------------------------------------------------------------------------------- 1 | This layer holds Jetpack 6 parts of the Mender integration for Tegra. 2 | 3 | See ../README.md for more details and other layers. 4 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-jetpack6/conf/layer.conf: -------------------------------------------------------------------------------- 1 | # We have a conf and classes directory, add to BBPATH 2 | BBPATH .= ":${LAYERDIR}" 3 | # We have recipes-* directories, add to BBFILES 4 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ 5 | ${LAYERDIR}/recipes-*/*/*.bbappend" 6 | 7 | BBFILE_COLLECTIONS += "meta-mender-tegra-jetpack6" 8 | BBFILE_PATTERN_meta-mender-tegra-jetpack6 = "^${LAYERDIR}/" 9 | BBFILE_PRIORITY_meta-mender-tegra-jetpack6 = "10" 10 | LAYERVERSION_meta-mender-tegra-jetpack6 = "1" 11 | LAYERSERIES_COMPAT_meta-mender-tegra-jetpack6 = "scarthgap" 12 | LAYERDEPENDS_meta-mender-tegra-jetpack6 = "tegra meta-mender-tegra-common" 13 | -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-jetpack6/recipes-bsp/uefi/files/L4TConfiguration-RootfsRedundancyLevelABEnable.dtsi: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | 3 | / { 4 | overlay-name = "L4T Configuration Settings"; 5 | 6 | fragment@0 { 7 | target-path = "/"; 8 | 9 | board_config { 10 | sw-modules = "uefi"; 11 | }; 12 | 13 | __overlay__ { 14 | 15 | firmware { 16 | 17 | uefi { 18 | 19 | variables { 20 | 21 | gNVIDIAPublicVariableGuid { 22 | 23 | RootfsRedundancyLevel { 24 | data = [01 00 00 00]; 25 | runtime; 26 | locked; 27 | }; 28 | 29 | RootfsRetryCountMax { 30 | data = [ 01 00 00 00 ]; 31 | runtime; 32 | }; 33 | 34 | }; 35 | 36 | }; 37 | }; 38 | }; 39 | }; 40 | }; 41 | }; -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-jetpack6/recipes-bsp/uefi/l4t-launcher-rootfs-ab-config_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" -------------------------------------------------------------------------------- /meta-mender-tegra/meta-mender-tegra-jetpack6/recipes-kernel/linux/linux-jammy-nvidia-tegra_5.15%.bbappend: -------------------------------------------------------------------------------- 1 | # Rather ugly hack to ensure that meta-mender-core's files directory 2 | # is also removed from consideration, since linux-yocto.bbclass adds 3 | # all directories that contain config fragments into its file-cksums 4 | # list, which needlessly (for us) changes the task hash. 5 | python() { 6 | extrapaths = d.getVar('FILESEXTRAPATHS').split(':') 7 | newpaths = ':'.join([path for path in extrapaths if not path.endswith('meta-mender-core/recipes-kernel/linux/files')]) 8 | d.setVar('FILESEXTRAPATHS', newpaths) 9 | } 10 | -------------------------------------------------------------------------------- /meta-mender-update-modules/README.md: -------------------------------------------------------------------------------- 1 | meta-mender-update-modules 2 | ========================== 3 | 4 | Mender is an open source over-the-air (OTA) software updater for embedded Linux devices. Mender comprises a client running at the embedded device, as well as a server that manages deployments across many devices. 5 | 6 | This repository contains Yocto recipes for community supported Update Modules. An Update Module is an extension to the Mender client for supporting a new type of software update, such as a package manager, container, bootloader or even updates of nearby microcontrollers. An Update Module can be tailored to a specific device or environment (e.g. update a proprietary bootloader), or be more general-purpose (e.g. install a set of .deb packages.). 7 | 8 | There are a couple of general-purpose Update Modules bundled together with the [Mender client source code](https://github.com/mendersoftware/mender/tree/master/support/modules), these can be installed using [meta-mender](https://github.com/mendersoftware/meta-mender). 9 | 10 | ![Mender logo](https://github.com/mendersoftware/mender/raw/master/mender_logo.png) 11 | 12 | ## Getting started 13 | 14 | To start using Mender, we recommend that you begin with the Getting started 15 | section in [the Mender documentation](https://docs.mender.io/). 16 | 17 | To start using Mender Update Modules, we recommend that you begin with the Update Modules - Introduction 18 | section in [the Mender documentation](https://docs.mender.io/devices/update-modules). 19 | 20 | You can find detailed information about available Update Modules on [Mender Hub](https://hub.mender.io/c/update-modules). 21 | 22 | ## Contributing 23 | 24 | We welcome and ask for your contribution. If you would like to contribute to Mender, please read our guide on how to best get started [contributing code or 25 | documentation](https://github.com/mendersoftware/mender/blob/master/CONTRIBUTING.md). 26 | 27 | ## Connect with us 28 | 29 | * Join the [Mender Hub discussion forum](https://hub.mender.io) 30 | * Follow us on [Twitter](https://twitter.com/mender_io). Please 31 | feel free to tweet us questions. 32 | * Fork us on [Github](https://github.com/mendersoftware) 33 | * Create an issue in the [bugtracker](https://tracker.mender.io/projects/MEN) 34 | * Email us at [contact@mender.io](mailto:contact@mender.io) 35 | * Connect to the [#mender IRC channel on Libera](https://web.libera.chat/?#mender) 36 | 37 | 38 | ## Authors 39 | 40 | Mender was created by the team at [Northern.tech AS](https://northern.tech), with many contributions from 41 | the community. Thanks [everyone](https://github.com/mendersoftware/meta-mender-community/graphs/contributors)! 42 | 43 | [Mender](https://mender.io) is sponsored by [Northern.tech AS](https://northern.tech). 44 | -------------------------------------------------------------------------------- /meta-mender-update-modules/conf/layer.conf: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Northern.tech AS 2 | 3 | # We have a conf and classes directory, add to BBPATH 4 | BBPATH .= ":${LAYERDIR}" 5 | 6 | # We have recipes-* directories, add to BBFILES 7 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ 8 | ${LAYERDIR}/recipes-*/*/*.bbappend" 9 | 10 | BBFILE_COLLECTIONS += "mender-update-modules" 11 | BBFILE_PATTERN_mender-update-modules = "^${LAYERDIR}/" 12 | BBFILE_PRIORITY_mender-update-modules = "15" 13 | 14 | LAYERSERIES_COMPAT_mender-update-modules = "scarthgap" 15 | 16 | BBFILES_DYNAMIC += " \ 17 | virtualization-layer:${LAYERDIR}/dynamic-layers/virtualization/*/*/*.bb \ 18 | virtualization-layer:${LAYERDIR}/dynamic-layers/virtualization/*/*/*.bbappend \ 19 | " 20 | -------------------------------------------------------------------------------- /meta-mender-update-modules/dynamic-layers/virtualization/recipes-mender/mender-update-modules/mender-app-update_git.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "Mender Application Update Module for supporting containerized application updates on devices including related tools ." 2 | 3 | HOMEPAGE = "https://mender.io" 4 | LICENSE = "Apache-2.0" 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=b4b4cfdaea6d61aa5793b92efd42e081" 6 | 7 | SRC_URI = "git://github.com/mendersoftware/app-update-module;branch=master;protocol=https" 8 | 9 | SRCREV = "c9f28c6c6a8c4cfb5297520c0da832177be87002" 10 | 11 | S = "${WORKDIR}/git" 12 | 13 | RDEPENDS:${PN} = "docker-compose jq mender-update xdelta3" 14 | 15 | inherit allarch 16 | 17 | do_configure[noexec] = "1" 18 | do_compile[noexec] = "1" 19 | 20 | do_install:class-target() { 21 | # install Application Update Module 22 | install -d ${D}/${datadir}/mender/modules/v3 23 | install -m 755 ${S}/src/app ${D}/${datadir}/mender/modules/v3/app 24 | 25 | # install Docker Compose Module 26 | install -d ${D}/${datadir}/mender/app-modules/v1 27 | install -m 755 ${S}/src/app-modules/docker-compose ${D}/${datadir}/mender/app-modules/v1/docker-compose 28 | 29 | # install configuration files 30 | install -d ${D}/${sysconfdir}/mender 31 | install -m 755 ${S}/conf/mender-app.conf ${D}/${sysconfdir}/mender/mender-app.conf 32 | install -m 755 ${S}/conf/mender-app-docker-compose.conf ${D}/${sysconfdir}/mender/mender-app-docker-compose.conf 33 | } 34 | 35 | do_install:class-native() { 36 | install -d ${D}/${bindir} 37 | install -m 755 ${S}/gen/app-gen ${D}/${bindir}/app-gen 38 | } 39 | 40 | FILES:${PN} += "${datadir}/mender/modules/v3/app" 41 | FILES:${PN} += "${datadir}/mender/app-modules/v1/docker-compose" 42 | 43 | FILES:${PN}-class-native += "${bindir}/dir-overlay-artifact-gen" 44 | 45 | BBCLASSEXTEND = "native" 46 | -------------------------------------------------------------------------------- /meta-mender-update-modules/recipes-mender/mender-update-modules/mender-dir-overlay_git.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "The Directory Overlay Update Module installs a user defined file tree structure into a given destination directory in the target." 2 | 3 | require mender-update-modules.inc 4 | 5 | inherit allarch 6 | 7 | do_install:class-target() { 8 | install -d ${D}/${datadir}/mender/modules/v3 9 | install -m 755 ${S}/dir-overlay/module/dir-overlay ${D}/${datadir}/mender/modules/v3/dir-overlay 10 | } 11 | 12 | do_install:class-native() { 13 | install -d ${D}/${bindir} 14 | install -m 755 ${S}/dir-overlay/module-artifact-gen/dir-overlay-artifact-gen ${D}/${bindir}/dir-overlay-artifact-gen 15 | } 16 | 17 | FILES:${PN} += "${datadir}/mender/modules/v3/dir-overlay" 18 | FILES:${PN}-class-native += "${bindir}/dir-overlay-artifact-gen" 19 | 20 | BBCLASSEXTEND = "native" 21 | -------------------------------------------------------------------------------- /meta-mender-update-modules/recipes-mender/mender-update-modules/mender-ipk_git.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "The IPK Update Module installs opkg-based package in the target." 2 | 3 | require mender-update-modules.inc 4 | 5 | inherit allarch 6 | 7 | python do_configure() { 8 | if not bb.utils.contains('PACKAGE_CLASSES', 'package_ipk', True, False, d) or \ 9 | not bb.utils.contains('IMAGE_FEATURES', 'package-management', True, False, d): 10 | bb.error("Installing ipk update module without on-target IPK package management.") 11 | bb.error("Install package management by adding the following to your local.conf:") 12 | bb.error(" IMAGE_FEATURES:append = \" package-management \"") 13 | bb.error("Select IPK style packaging using the following:") 14 | bb.error(" PACKAGE_CLASSES = \"package_ipk\"") 15 | } 16 | 17 | do_install:class-target() { 18 | install -d ${D}/${datadir}/mender/modules/v3 19 | install -m 755 ${S}/ipk/module/ipk ${D}/${datadir}/mender/modules/v3/ipk 20 | } 21 | 22 | FILES:${PN} += "${datadir}/mender/modules/v3/ipk" 23 | -------------------------------------------------------------------------------- /meta-mender-update-modules/recipes-mender/mender-update-modules/mender-rootfs-version-check_git.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "The rootfs-version-check Update Module implements a full image update with additional checks to protect against replay attacks." 2 | 3 | require mender-update-modules.inc 4 | 5 | inherit allarch 6 | 7 | do_install:class-target() { 8 | install -d ${D}/${datadir}/mender/modules/v3 9 | install -m 755 ${S}/rootfs-version-check/module/rootfs-version-check ${D}/${datadir}/mender/modules/v3/rootfs-version-check 10 | 11 | install -d ${D}/${sysconfdir}/mender/ 12 | cat >${D}${sysconfdir}/mender/rootfs-version-check.conf < 3 | Date: Tue, 5 Mar 2024 13:04:36 +0100 4 | Subject: [PATCH 1/2] u-boot-variscite: configuration adjustments for Mender 5 | 6 | Enable redundant environment and bootcount limit 7 | 8 | Signed-off-by: Josef Holzmayr 9 | --- 10 | configs/imx93_var_som_defconfig | 7 +++++-- 11 | 1 file changed, 5 insertions(+), 2 deletions(-) 12 | 13 | diff --git a/configs/imx93_var_som_defconfig b/configs/imx93_var_som_defconfig 14 | index 30ce591851..5b93255564 100644 15 | --- a/configs/imx93_var_som_defconfig 16 | +++ b/configs/imx93_var_som_defconfig 17 | @@ -6,7 +6,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x18000 18 | CONFIG_SPL_LIBCOMMON_SUPPORT=y 19 | CONFIG_SPL_LIBGENERIC_SUPPORT=y 20 | CONFIG_NR_DRAM_BANKS=2 21 | -CONFIG_ENV_SIZE=0x4000 22 | +CONFIG_ENV_SIZE=0x20000 23 | CONFIG_ENV_OFFSET=0x700000 24 | CONFIG_IMX_CONFIG="" 25 | CONFIG_DM_GPIO=y 26 | @@ -20,6 +20,7 @@ CONFIG_SPL_SERIAL=y 27 | CONFIG_SPL_DRIVERS_MISC=y 28 | CONFIG_SPL_STACK=0x20519dd0 29 | CONFIG_SPL=y 30 | +CONFIG_ENV_OFFSET_REDUND=0x740000 31 | CONFIG_CMD_DEKBLOB=y 32 | CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x88000000 33 | CONFIG_SPL_LOAD_IMX_CONTAINER=y 34 | @@ -89,8 +90,8 @@ CONFIG_CMD_EXT4_WRITE=y 35 | CONFIG_OF_CONTROL=y 36 | CONFIG_SPL_OF_CONTROL=y 37 | CONFIG_ENV_OVERWRITE=y 38 | -CONFIG_ENV_IS_NOWHERE=y 39 | CONFIG_ENV_IS_IN_MMC=y 40 | +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y 41 | CONFIG_SYS_RELOC_GD_ENV_ADDR=y 42 | CONFIG_SYS_MMC_ENV_DEV=1 43 | CONFIG_USE_ETHPRIME=y 44 | @@ -98,6 +99,8 @@ CONFIG_ETHPRIME="eth0" 45 | CONFIG_NET_RANDOM_ETHADDR=y 46 | CONFIG_SPL_DM=y 47 | CONFIG_SYSCON=y 48 | +CONFIG_BOOTCOUNT_LIMIT=y 49 | +CONFIG_BOOTCOUNT_ENV=y 50 | CONFIG_SPL_CLK_IMX93=y 51 | CONFIG_CLK_IMX93=y 52 | CONFIG_DFU_MMC=y 53 | -- 54 | 2.39.2 55 | 56 | -------------------------------------------------------------------------------- /meta-mender-variscite/recipes-bsp/u-boot/patches/0002-u-boot-variscite-Mender-integration-to-bootcmd.patch: -------------------------------------------------------------------------------- 1 | From 4c9af572a970ac725cc81cc034ced32b1f236788 Mon Sep 17 00:00:00 2001 2 | From: Josef Holzmayr 3 | Date: Tue, 5 Mar 2024 13:11:15 +0100 4 | Subject: [PATCH 2/2] u-boot-variscite: Mender integration to bootcmd 5 | 6 | Call the mender_setup script and pass the root partition to 7 | the kernel cmdline. 8 | 9 | Signed-off-by: Josef Holzmayr 10 | --- 11 | include/configs/imx93_var_som.h | 3 ++- 12 | 1 file changed, 2 insertions(+), 1 deletion(-) 13 | 14 | diff --git a/include/configs/imx93_var_som.h b/include/configs/imx93_var_som.h 15 | index 20ab6b6f61..ae1c059f26 100644 16 | --- a/include/configs/imx93_var_som.h 17 | +++ b/include/configs/imx93_var_som.h 18 | @@ -78,7 +78,7 @@ 19 | "optargs=setenv bootargs ${bootargs} ${kernelargs};\0" \ 20 | "mmcargs=setenv bootargs ${jh_clk} console=${console} \ 21 | ${cma_size} cma_name=linux,cma \ 22 | - root=/dev/mmcblk${mmcblk}p${mmcpart} rootwait rw\0 " \ 23 | + root=${mender_boot_part_name} rootwait rw\0 " \ 24 | "bootenv=uEnv.txt\0" \ 25 | "loadbootscript=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bootdir}/${script};\0" \ 26 | "bootscript=echo Running bootscript from mmc ...; " \ 27 | @@ -163,6 +163,7 @@ 28 | "setenv cma_size cma=128M; " \ 29 | "fi;\0" \ 30 | "bsp_bootcmd=echo Running BSP bootcmd ...; " \ 31 | + "run mender_setup; " \ 32 | "run ramsize_check; " \ 33 | "mmc dev ${mmcdev}; if mmc rescan; then " \ 34 | "if test ${use_m33} = yes && run loadm33bin; then " \ 35 | -- 36 | 2.39.2 37 | 38 | -------------------------------------------------------------------------------- /meta-mender-variscite/recipes-bsp/u-boot/u-boot-variscite-mender-common.inc: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/patches:" 2 | 3 | SRC_URI:append:imx93-var-som = " \ 4 | file://0001-u-boot-variscite-configuration-adjustments-for-Mende.patch \ 5 | file://0002-u-boot-variscite-Mender-integration-to-bootcmd.patch \ 6 | " 7 | 8 | MENDER_UBOOT_STORAGE_DEVICE:imx93-var-som = "1" 9 | MENDER_UBOOT_CONFIG_SYS_MMC_ENV_PART:imx93-var-som = "0" 10 | MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET:imx93-var-som = "0x700000" 11 | MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET_2:imx93-var-som = "0x740000" -------------------------------------------------------------------------------- /meta-mender-variscite/recipes-bsp/u-boot/u-boot-variscite.bbappend: -------------------------------------------------------------------------------- 1 | require recipes-bsp/u-boot/u-boot-variscite-mender-common.inc 2 | require recipes-bsp/u-boot/u-boot-mender.inc 3 | 4 | DEPENDS:append = " bc-native " 5 | 6 | MENDER_UBOOT_AUTO_CONFIGURE:imx93-var-som = "0" 7 | 8 | B = "${WORKDIR}/build" 9 | do_configure[cleandirs] = "${B}" --------------------------------------------------------------------------------