Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

dev-guides: fix order of kernel package compilation #261

Merged
merged 2 commits into from
May 22, 2023

Conversation

jepio
Copy link
Contributor

@jepio jepio commented Oct 14, 2022

coreos-modules needs to be rebuilt before coreos-kernel, because the kernel ebuild builds the initramfs and this bundles some of the built kernel modules.

The previous steps in the guide, also need an update because they have the same issue but I haven't fully understood how to correct them yet.

coreos-modules needs to be rebuilt before coreos-kernel, because the kernel ebuild builds the initramfs
and this bundles some of the built kernel modules.
@jepio jepio requested a review from t-lo October 14, 2022 08:29
@jepio
Copy link
Contributor Author

jepio commented Oct 14, 2022

@t-lo do you have an idea how to fix the steps that use ebuild-amd64-usr directly and operate on the tmp directory. A user has had difficulties following the steps: flatcar/Flatcar#871 (comment)

@t-lo
Copy link
Contributor

t-lo commented Oct 14, 2022

Great catch! I believe your proposed solution is worth a shot. I'm not sure at which point exactly the kernel config is re-generated but emerging the kernel first might use an outdated config and outdated modules (and also affect the initrd as you stated) .
Since we've built (or downloaded) all packages in the preparation step, emerge thinks the kernel modules binpkg available on the system is up to date and will use it (kernel depends on modules). But since we changed the kernel configuration - which is in the modules ebuild - and did not bump the modules ebuild version, the modules binpkg is in fact out of date. Pulling the emerge modules step before emerge kernel might address this.

@t-lo
Copy link
Contributor

t-lo commented Oct 18, 2022

@jepio I think this looks good and I feel tempted to approve even though the PR is in Draft state 😸

@jepio
Copy link
Contributor Author

jepio commented Oct 18, 2022

i will still need to look and fix the other portion.

We have constraints on the ordering so that the changes are fully
present in the image: pkg_setup phase of coreos-kernel needs to run
after coreos-modules has been merged, because config is fetched from
there and bootengine runs in pkg_setup.

This means: we should be experimenting on coreos-modules and need a full
rebuild of coreos-kernel at the end anyway.
@jepio jepio marked this pull request as ready for review November 11, 2022 11:33
@jepio
Copy link
Contributor Author

jepio commented Nov 11, 2022

@t-lo have another look, I think the updated steps should work.

Copy link
Contributor

@t-lo t-lo left a comment

Choose a reason for hiding this comment

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

LGTM, thank you Jeremi, and pardon the delay.

@jepio jepio merged commit ba327d8 into main May 22, 2023
@jepio jepio deleted the jepio/kernel-dev-guide-update branch May 22, 2023 09:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants