AsteroidOS / meta-asteroid

OpenEmbedded layer that provides the basis of AsteroidOS
GNU General Public License v2.0
78 stars 45 forks source link

Split hybris stuff out into a separate layer #183

Closed casept closed 2 months ago

casept commented 9 months ago

I'm currently trying to port the Gear 2, based on my mainline kernel fork.

With the current project structure, I have to manually remove all the hybris-related patches in my device layer that don't make sense for my watch (e.g. the mesa dependency removal in qtbase, OpenGL removal in SDL2, the addition of pulseaudio-modules-droid to pulseaudio etc. Finding all these spots is a lot of effort and would have to be repeated if any new mainline-based devices were to be introduced in future.

I think the following split might make sense:

meta-asteroid: Recipes for shared components; HAL-neutral meta-mainline: Recipes and patches for watches running mainline; inert on hybris-based watches meta-hybris: Recipes and patches for watches running libhybris; inert on mainline-based watches

I'd be willing to the work if this looks OK to you.

FlorentRevest commented 8 months ago

Thank you for opening this and sorry it took me so long to get to it

I'm currently trying to port the Gear 2, based on my mainline kernel fork.

Nice!

With the current project structure, I have to manually remove all the hybris-related patches in my device layer that don't make sense for my watch (e.g. the mesa dependency removal in qtbase, OpenGL removal in SDL2, the addition of pulseaudio-modules-droid to pulseaudio etc. Finding all these spots is a lot of effort and would have to be repeated if any new mainline-based devices were to be introduced in future.

You cite three precise examples, let's have a look:

I think the following split might make sense:

meta-asteroid: Recipes for shared components; HAL-neutral

This is indeed what it is supposed to be. The layer might contain recipes which are useful for HAL stuff, (like pulseaudio-modules-droid, it's perfectly fine to have it there) but it should not build anything hybris by default. All layers for hybris ports should have bbappends to enable hybris things conditionally.

meta-mainline: Recipes and patches for watches running mainline; inert on hybris-based watches meta-hybris: Recipes and patches for watches running libhybris; inert on mainline-based watches

We have meta-smartwatch and it contains a directory per watch. But there can be two MACHINEs for a given watch. For example meta-sparrow defines sparrow and sparrow-mainline. The hybris stuff are only built when building the sparrow (hybris port) MACHINE. When building sparrow-mainline almost nothing changes. https://github.com/AsteroidOS/meta-smartwatch/commit/dff36f61cba7c292055f24d3d71c36463a6ea58a Notice also the last paragraph of that commit description which points out that pulseaudio shouldn't have had dependencies to pulseaudio-modules-droid by default, but fixing this was left as an exercise for the reader. ;)

casept commented 8 months ago

Thank you for the feedback!

This was posted before we had our discussion on how to approach this properly, I just forgot to close the issue afterwards.

Making the remaining accidental hybris dependencies in the manner we discussed in the Matrix channel is nearly finished now, with the changes living in https://github.com/casept/meta-asteroid/tree/optional-hybris. I need to track down why asteroid-launcher segfaults with them applied on my catfish, then I'll submit a PR.

casept commented 2 months ago

Merged a long time ago, forgot to close this.