Skip to content

Allow multi kernel image builds#3893

Open
alexgg wants to merge 4 commits into
masterfrom
alexgg/multi-kernel
Open

Allow multi kernel image builds#3893
alexgg wants to merge 4 commits into
masterfrom
alexgg/multi-kernel

Conversation

@alexgg

@alexgg alexgg commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Contributor checklist

Reviewer Guidelines

  • When submitting a review, please pick:
    • 'Approve' if this change would be acceptable in the codebase (even if there are minor or cosmetic tweaks that could be improved).
    • 'Request Changes' if this change would not be acceptable in our codebase (e.g. bugs, changes that will make development harder in future, security/performance issues, etc).
    • 'Comment' if you don't feel you have enough information to decide either way (e.g. if you have major questions, or you don't understand the context of the change sufficiently to fully review yourself, but want to make a comment)

alexgg added 4 commits June 19, 2026 14:13
Different kernel recipes might declare different deploy directories
not to clash between them.

Change-type: patch
Signed-off-by: Alex Gonzalez <alexg@balena.io>
Auto-merge kconfig fragments found in FILESEXTRAPATHS.

Yocto's stock kernel-yocto.bbclass already merges *.cfg fragments listed in
SRC_URI through do_kernel_configme. This step complements discovering
every *.cfg file reachable via FILESEXTRAPATHS and merging them into
${B}/.config, then runs olddefconfig to resolve dependencies.

- It lets recipes ship fragments by dropping them in ${THISDIR}/files/ (or any
  FILESEXTRAPATHS-reachable dir) without touching SRC_URI.
- Allows sharing of kernel fragments across kernel siblings
- Allow fragments to override BALENA_CONFIGS-injected values when needed.

Change-type: patch
Signed-off-by: Alex Gonzalez <alexg@balena.io>
The upstream RRECOMMENDS that drags in via kernel-base overwrites
/boot/<type> with the no-initramfs binary.

Change-type: patch
Signed-off-by: Alex Gonzalez <alexg@balena.io>
Generalize the recipe so it can be re-used on different kernel builds.

Change-type: patch
Signed-off-by: Alex Gonzalez <alexg@balena.io>
@alexgg alexgg requested a review from a team June 19, 2026 12:24
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:26 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 12:27 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-production.us-east-1 June 19, 2026 12:27 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to sign.balena-cloud.com June 19, 2026 12:27 — with GitHub Actions Inactive
@flowzone-app

flowzone-app Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Website deployed to CF Pages, 👀 preview link https://35dc041f.balena-os.pages.dev

@flowzone-app flowzone-app Bot enabled auto-merge June 19, 2026 12:29
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 13:52 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 13:52 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 13:52 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 13:52 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 13:52 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 13:52 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 14:21 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 14:21 — with GitHub Actions Inactive
@alexgg alexgg temporarily deployed to balena-cloud.com June 19, 2026 14:21 — with GitHub Actions Inactive
do_kernel_resin_checkconfig[deptask] += "do_kernel_resin_reconfigure"
do_kernel_resin_checkconfig[dirs] += "${WORKDIR} ${B}"

python do_kernel_balena_merge_fragments() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @alexgg,

As you said this is only a part of the overall kernel and kernel module hostapp extension.

I see that there's a telling comment in meta-balena-raspberrypi that explain why we do this.

At first I thought that this was a re-edit of the config fragment mechanism of poky, so perhaps we should precise that poky's mechanism uses on SRC_URI and yours uses in FILESEXTRAPATHS. We could also explain why we do that. I suppose that it is so that we can have a kernel vendor not base on kernel-yocto and still have our own fragment added?

Also I'm wondering if we should merge this mechanism on its own or if we should wait for the rest of the feature? Is this whole change useful on its own?

@alexgg alexgg Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ycardaillac

I see that there's a telling comment in meta-balena-raspberrypi that explain why we do this.

It's also explained in the commit log.

At first I thought that this was a re-edit of the config fragment mechanism of poky, so perhaps we should precise that poky's mechanism uses on SRC_URI and yours uses in FILESEXTRAPATHS.

It is explained in the commit log.

We could also explain why we do that. I suppose that it is so that we can have a kernel vendor not base on kernel-yocto and still have our own fragment added?

The reasoning for the change is also in the commit log:

  • It lets recipes ship fragments by dropping them in ${THISDIR}/files/ (or any
    FILESEXTRAPATHS-reachable dir) without touching SRC_URI.
  • Allows sharing of kernel fragments across kernel siblings
  • Allow fragments to override BALENA_CONFIGS-injected values when needed.

Basically, it adds a mechanism that extensions can use to customize a kernel. Neither Yocto's default or the balenaOS kernel class allow this.

And indeed it's generic so it works independently of the kernel-yocto class.

Also I'm wondering if we should merge this mechanism on its own or if we should wait for the rest of the feature? Is this whole change useful on its own?

It's an independent mechanism to add kernel configuration so it stands on its own. There is no roadmap for extensions yet so there is no rest of the feature to wait for. Without it, extensions would just work, but they will have no clean interface to overriding kernel and modules. But extensions that won't need this would just work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants