-
-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patching Coreboot before compiling? #1221
Comments
@natterangell you would have adapt that patch and apply it from patches/coreboot-4.13/wwan-smbus.patch or similar, which is applied on top of validated coreboot 4.13 tarball sha256sum hash. Note that patches are applied only when the module's build dir doesn't exist, so you have to remove coreboot directory under build/x86/coreboot for that patch to be applied on clean extracted tarball. You can test application of your patch on top of coreboot tarball extraction in another directory first. Package is under packages/arch/ This patch doesn't seem complete and implementation was questioned seeing upstream comments. Tag me if you need more info on testing this. Upon successful PR, regression tests on other boards would be needed, since most xx20/xx30 boards are affected by this patch. |
@natterangell 2dad98d just adds the upstream patch to be applied against coreboot 4.13 without further modification. Doing so in a branch on your github, followed under your CircleCI account would result in a build starting to build all roms and see if things break at a build level. This is happening with a blunt addition of upstream patch in a branch over my github for Heads project at: If the commit goes green, it means the build passed without breaking anything. Otherwise, the build having failed will show where the error happened under "Making Board" last lines of such board. Basically, in this first step, failing will probably be the result of a patch not being directly applicable, showing what lines of the patch needs to be reworked for it to be successfully applied. |
@natterangell : we see it failing in the first coreboot 4.13 built board at https://app.circleci.com/pipelines/github/tlaurion/heads/1209/workflows/f7310d77-131b-440c-96ac-df2903c3f11a/jobs/10751?invite=true#step-103-55 (Idea of CircleCI and its caching system is that once a module patch changes, CircleCI will build on a clean checkout. This means that its the proper way to expose build issue and seek help if needed, since just as exposed here, we can then relate to what failed, including build logs, to make sure we are talking about the right and same things, on a clean checkout of a specific commit, trying to accomplish a limited change without having to disregard all other possible causes of failing). So here, the patch in question is applied after having downloaded and verified that coreboot 4.13 tarball is valid, extracting it and then applying the patch that is verified per commit (implying trust into me not having modified it.) On my side I just downloaded the patch from https://review.coreboot.org/changes/coreboot~39043/revisions/7/patch?zip, extracted it and moved it into a proper named patch file as you can see under tlaurion@2dad98d. I then added that patch into a new branch (git checkout osresearch/master, git reset --hard, git checkout -b name_of_branch, git add patches/directory_of_module/name_of_added_patch, git commit -m "description of commit", git push tlaurion-github --force). Then since CircleCI is watching all my github Heads branches, it started a build for that commit with CircleCI already defined boards under CircleCI config in tree and failed as expected :
So the patch needs to be reworked to be applicable on top of 4.13 at tlaurion@2dad98d#diff-082d6300fec0627b1230169d1c34c89f7695e060591ba95bad304a2daaf6084cR175 Where a local inspection confirms that there is no existing build/x86/coreboot-4.13/src/mainboard/lenovo/x230/early_init.c file to be patched, explaining why patching fails and needs the patch to be reworked and retested iteratively. |
Wow, thank you for that! 😊 yes, I’m aware the patch has issues, but it might be useful for my machine still. It seems to fail for the x220, and succeed patching early_init.c for the t420. I’m not even sure this issue applies to the x220, it certainly doesn’t for the x230. I can do a manual test as outlined in your first reply. |
@natterangell On coreboot matters, its always the same thing. When things are worked on downstream, it doesn't make things merged upstream. Collaboration should happen upstream here. Unfortunately, Heads is still based on 4.13, so there are patches that will fail to apply against 4.17+ (coreboot 4.18 to be released being master on coreboot as of now). Whatever your outcome here, adding that as It seems that coreboot 4.13's x230 codebase doesn't have early_init file (which could be removed in patch) while resolving issue with t420. It also shows some discrepancies across boards under 4.13 (different codepaths on that level for 4.13). After being successful in your tests, you could then report success upstream for your board, which would ping the developers and make this patch merged upstream faster. That would result into that wwan SMBus patch being merged under 4.18 or sooner then later, and have Heads not need any patch when we do a version bump to coreboot 4.18, hopefully sooner than later :) |
Massively edited #1221 (comment) so people can replicate and test CircleCI builds fast against OP's future related questions related to : "Patching Coreboot before compiling". Outside of commenting this ticket, doing the process to actually create a discussable outcome took me literally 30 seconds with everything already being setuped on my side. (local git branch, remote branches setuped, CircleCI account and watching github repos from there). And for everybody to be able to see the result of a failed applied patch to entice collaboration for people having the same feature goal to be able to work locally on a fix and discuss on possible solutions, experiement and propose a working solution that don't break anything (on a build level). The next step of this is to check from the commit what platform could break with actual proposed changes, and be able to to some regression testing prior of the change to land in master after a pull request is poroposed, reviewed and finally merged after proper regression testing per board owners for changes that could affect them. |
Thanks again! I’ll be sure to report back upstream once I’ve tested. If I can find the time I’ll prepare a branch for it. It’s a learning curve for me. |
@natterangell cloning/branching Heads deserves a new wiki entree/bonifying under https://osresearch.net/Development Command line is always better for that.... Agreed there is a learning curve associated to that though. This could be used as a draft to be added there.
On step 16 above, when it is asked of you to modify your pull request, you might have to dig a little bit more the internals of git.
Otherwise, there is plenty of GUI frontends to git out there that you might want to investigate if command line git is giving you nausea. Unfortunetaly, I do not use them so I cannot really recommend any of them. I would go against using the web based VisualStudio frontend proposed by github, since even though it might seem attractive since proposed by Github, amending/rebasing and pushing changes results in a lot of back and forth and many pull requests being opened/closed in the past. Doing changes locally and pusshing them is definitely more interesting, both for your learning and collaborating to other projects and for maintainership of this perticular project. CircleCI:
Will edit this post later on following feedback, and will use that entree here to open another issue in wiki documentation. |
@natterangell can this be closed? |
Yes! Thanks! |
@natterangell maybe you want to rename the issue? Or give some more input on if the patch was merged upstream? In which version, etc? |
I haven't gotten around to suggesting a patch upstream yet, I'm a little short on time these days. I hope to get to it before the end of February. |
Documentation issue opened on heads-wiki. Closing here, feel free to reopen if again relevant. |
Hi,
I apologize as this is not technically an issue with Heads, but I'm requesting guidance here as it might be relevant for other T420 users too.
There is an unmerged patch on Coreboot Gerrit that fixes an issue with wwan cards on the T420. In short, the patch enables power on wwan if slot has SMBus connected. Without this, the card will pull the lines low, causing DRAM init to fail.
This patch allows me to use a Sierra Wireless MC7304 LTE capable card, instead of my ancient Ericsson F3507g, which is rather nice since older 2G/3G cards are more or less irrelevant these days.
I suppose the current Makefile verifies hashes for coreboot(?). So, how should I manually edit the coreboot source files when building Heads?
The text was updated successfully, but these errors were encountered: