Skip to content
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

better blobby kernel support #249

Merged
merged 4 commits into from
Dec 23, 2020
Merged

Conversation

austin987
Copy link
Contributor

@SolidHal this is my WIP support for better blobby kernel support. The idea being that a user can then swap 'make kernel' for 'make blobby_kernel' (or similar) and get a PrawnOS image with a blobby instead of libre kernel.

The blobby_kernel target doesn't work yet, need help with that part. As a hack, I forcefully enable blobby builds in the last commit. To test libre, revert/comment that.

I've added '-libre' and '-blobby' to the kernel description to make it clear which is which.

Additionally, verifying the signature doesn't work yet. I wanted to sync before doing more. In my opinion, some of that logic (in particular, signature verification, maybe more) should move into buildKernel.sh rather than kernel/makefile, what do you think?

Note: I've only tested armhf, as that's all I have access to.

@ghost
Copy link

ghost commented Dec 1, 2020

Thanks so much for working on this. I use a c100pa on the couch that i would love to run without a wifi dongle.

Depthcharge would allow for 2 kernel partitions and switching between them by modifying the priority via cgpt - can you mod this pull request so we get 2 kernel partitions?

Thanks again, R

@austin987
Copy link
Contributor Author

That's not really related to this PR at all. There's an open ticket (#243) for that topic.

In any event I don't have a c100, so can't help there.

@SolidHal
Copy link
Owner

SolidHal commented Dec 2, 2020

Thanks so much for working on this. I use a c100pa on the couch that i would love to run without a wifi dongle.

Depthcharge would allow for 2 kernel partitions and switching between them by modifying the priority via cgpt - can you mod this pull request so we get 2 kernel partitions?

Thanks again, R

Linking to #243 to shift further conversation there

@SolidHal
Copy link
Owner

SolidHal commented Dec 2, 2020

Going to try and review this tonight. Curious why the armhf build fails...

@austin987
Copy link
Contributor Author

I think you mean arm64? armhf works locally (and for CI). I didn't hook up the arm64 bits, so not surprising. I could, but:
A) I don't have any arm64 hardware that PrawnOS supports
B) Didn't want to spend more time on it until we had agreed on the path forward :).

kernel/makefile Outdated Show resolved Hide resolved
kernel/makefile Outdated Show resolved Hide resolved
@austin987
Copy link
Contributor Author

Okay, updated.

This successfully builds for me with 'make kernel' and 'make blobby_kernel'.

arm64 is unimplemented (I can do the groundwork, but won't be able to test it). In any event, holding off until the rest of the PR/approach is settled.

The remaining problem is the kernel signatures. The blobby kernel signs the .tar file, but you download .tar.xz and extract that to get the .tar. Libre kernel signs the .tar.xz (same file you download), so extra logic will be needed to handle that. For now I've hacked it out; it should be doable (though maybe a bit ugly) in the makefile. Before I do, wanted to see if it's worth exploring moving it to buildKernel.sh?

kernel/makefile Outdated Show resolved Hide resolved
@SolidHal
Copy link
Owner

Okay, updated.

This successfully builds for me with 'make kernel' and 'make blobby_kernel'.

arm64 is unimplemented (I can do the groundwork, but won't be able to test it). In any event, holding off until the rest of the PR/approach is settled.

The remaining problem is the kernel signatures. The blobby kernel signs the .tar file, but you download .tar.xz and extract that to get the .tar. Libre kernel signs the .tar.xz (same file you download), so extra logic will be needed to handle that. For now I've hacked it out; it should be doable (though maybe a bit ugly) in the makefile. Before I do, wanted to see if it's worth exploring moving it to buildKernel.sh?

I don't think moving it to buildKernel.sh would be the best choice. I think it would make the most sense to move the signature check to the $(KERNEL_EXTRACTED) rule, which would then either 1) check sig, 2) extract and untar for the libre kernel
or 1) un-xz 2) check sig 3) untar for blobby kernel

@SolidHal
Copy link
Owner

regarding arm64, you can likely just copy what you did for armhf and get 99% there. I'll test the image if you do add arm64 support.

@austin987
Copy link
Contributor Author

FYI, I did arm64 a few days ago, I tested that it builds on my machine, but that's it.

Haven't looked at signature verification yet, will this week, thanks for the suggestions on that.

@austin987 austin987 changed the title WIP: better blobby kernel support better blobby kernel support Dec 15, 2020
@austin987
Copy link
Contributor Author

Okay, @SolidHal I've pushed updates. With that, I'm able to build armhf/arm64 libre/blobby kernels, with gpg verification.

I'm working on github actions to test the build, will push that when it's ready (here, or another branch, IMO this doesn't need to wait on that if it's good otherwise.)

@SolidHal
Copy link
Owner

Rerunning CI since they failed due to an issue in master.

I think the last thing that it would be good to figure out is how to automatically get the blobby config from the libre config, since there are a known set of differences.
Right now, when I bump the kernel version I have to bump both the armhf and arm64 configs which results in duplicated work.

The best thought I have is to store the "blobby" config as a minimal patch. Then when we want the blobby config, we first copy the libre one and apply the blobby config patch.

This is not a requirement for merging this PR, theres already a great amount of work here :)

@austin987
Copy link
Contributor Author

Now fails on lsusb (unrelated, obviously). I'd prefer merging before addressing the config issue (if you really want to automate it, I'd suggest adding a makefile target for blobbyconfig, which unpacks the tarball, applies patch, runs make oldconfi, then rediffs when done).

I've tested locally for armhf/arm64, works on my machine (TM).

There's now a conflict (I can fix later today, or you can, if you don't mind on merging).

@austin987
Copy link
Contributor Author

Conflicts resolved and tests are passing. Can this me merged please?

@SolidHal SolidHal merged commit b35d8c7 into SolidHal:master Dec 23, 2020
SolidHal added a commit that referenced this pull request Dec 23, 2020
@austin987 austin987 deleted the blobby-kernel-wip branch December 24, 2020 10:01
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