openSUSE / open-build-service

Build and distribute Linux packages from sources in an automatic, consistent and reproducible way #obs
https://openbuildservice.org
GNU General Public License v2.0
924 stars 436 forks source link

Add support for OpenWRT builds #10228

Open mark-stopka opened 4 years ago

mark-stopka commented 4 years ago

Is your feature request related to a problem? Please describe. I think the process for building OpenWRT packages is terrible,

Describe the solution you'd like I would like Open Build Service which I use often to support OpenWRT packages also.

Describe alternatives you've considered Building custom CD workflow for 3rd party software out of their repo, which breaks traditional distribution release workflow.

Additional context I would be willing to financially contribute and I think CZ.NIC who makes Turris Omnia would also appreciate better OpenWRT system, correct @miska?

adrianschroeter commented 3 years ago

Most of the needed work is described here:

https://github.com/openSUSE/obs-build/blob/master/HOWTO.add_another_format

you can run local builds easily via the build script. Ask on IRC or mailing list if you need help.

miska commented 3 years ago

I was looking nto that, tricky part is that it is hard to make something like -devel packages out of OpenWrt build and SDK :-(

mark-stopka commented 3 years ago

Could we perhaps brainstorm about it for 30 minutes via a web conference? And see if we can get somewhere of we join forces?

-- Sent from mobile Best regards / S pozdravem, BSc. Mark Stopka, BBA Managing Partner @ PERLUR Group

mobile: +420 704 373 561 website: www.perlur.cloud

On Tue, Oct 13, 2020, 08:00 Michal Hrušecký notifications@github.com wrote:

I was looking nto that, tricky part is that it is hard to make something like -devel packages out of OpenWrt build and SDK :-(

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/openSUSE/open-build-service/issues/10228#issuecomment-707508880, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEKMP3ETDFONNYYKKVMVKULSKPUJPANCNFSM4R6UX33Q .

miska commented 3 years ago

Sure, I might have some contact information how to reach you, just us two is ok, or does somebody else want to join the discussion?

mark-stopka commented 3 years ago

Hi, you can reach me at mark.stopka@perlur.cloud e-mail... or we are still friends on Facebook IMO... 😂

Best regards / S pozdravem, BSc. Mark Stopka, BBA

On Sat, Oct 17, 2020 at 8:49 AM Michal Hrušecký notifications@github.com wrote:

Sure, I might have some contact information how to reach you, just us two is ok, or does somebody else want to join the discussion?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/openSUSE/open-build-service/issues/10228#issuecomment-710762528, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEKMP3FG4HZBRSPOXAKC3P3SLE47DANCNFSM4R6UX33Q .

mark-stopka commented 3 years ago

@adrianschroeter I think OpenWRT by default uses cross-compilation so we may avoid using Qemu for cross-platform builds and this implement in a way that is secribed as SAFE here, without the many risks of executing arbitrary code, @miska do I remember correctly from our last conversation about this?

adrianschroeter commented 3 years ago

the cross build would most likely still happen inside of any VM mode, so using KVM would make it secure.

The only problem which may appear is that you may need to track dependency for host and target independend. But you could try first without (and having always the superset of dependencies). You may need to package the openwrt packages in addition into a rpm/deb/arch in first step. So you would just need to implement the build-receipe-openwrt.

We could do native binary package format parsing and/or cross dependency resolutions in later steps.

mark-stopka commented 3 years ago

@pavlix, would you be able to assist?

mark-stopka commented 3 years ago

@vyskocilm could perhaps have the right balance of bandwidth and skill, as discussed with @miska today...

mark-stopka commented 3 years ago

@nijel aren't you building OpenWRT images / packages for Braiins OS+ and Braiins OS?

nijel commented 3 years ago

@mark-stopka I'm not involved in Braiins OS builds at all, sorry. The build system used there is at https://github.com/braiins/braiins/tree/bos-devel/braiins-os

adrianschroeter commented 3 years ago

@miska regarding OpenWRT build and SDK: I would suggest for the start that you put it into an opkg package manually.

We can also think about to change the preinstallimage mechanic into something what is able to install the system without the need to have it some package before (atm it is only cache mechanic). I can help with that if needed.

mark-stopka commented 3 years ago

@nijel, thanks for the link, it looks like almost a reasonable build system for OpenWRT :-) what do you think @pavlix, @miska?

pavlix commented 3 years ago

As far as I know the dependency system in OpenWRT builds (SDK would work the same I guess) just calls into the build of the dependencies before building the requested package. The results are freely kept in directories that are used in subsequent build. A build service based approach might be much more reliable than the current way.

@miska Why don't we just cache the newly added files to staging_dir as -devel packages. OpenWRT already supports host and target packages, right? We could just hook into the build process and pick up everything we need to create a new type of host packages? Correct me if I'm wrong. I didn't check all the details.

zoobab commented 2 years ago

I am looking to add support OpenWRT support to OBS in the context of GSOC 2022 under the Freifunk umbrella, right now I wrapped the SDK in a docker image, and I am using Docker build args to pass some variables, like the git location of the Makefiles:

https://github.com/zoobab/openwrtsdkbuild

Will try to check OBS but the docker-compose.yml to start hacking does not work here, it seems it wants to "build" something which fails here.

adrianschroeter commented 2 years ago

the docker file makes only sense for webui development.

Please check out this instead:

https://github.com/openSUSE/obs-build/blob/master/HOWTO.add_another_format

if you add support in build (and/or pbuild) we can take care of the OBS parts easily. feel free to reach out via mailing list or IRC for further support though.

zoobab commented 2 years ago

"Internet access is not available during the build."

If you use the OpenWRT SDK, you could build your package without internet access, if you have the tarball on localhost.

I am new to OBS, but I can see the tarballs are cached/stored on OBS.

ndren commented 1 year ago

Hi!

I've been recently approved for GSoC 2023 to work on adding support for OpenWRT under the Freifunk project. I'd love to talk and learn more about how this could work! I've just set up a local build system as per https://github.com/openSUSE/open-build-service/blob/master/CONTRIBUTING.md#how-to-setup-an-obs-development-environment.

How could I set up a package for a different build recipe (for example build-recipe-arch) so I could get useful logs and keep track of what is happening at each build stage to slowly port towards build-recipe-openwrt? I could not figure out what calls build-recipe-* exactly. (In short, what is a good, simple example package I can use to verify the changes I make to the build system "work"?)

hennevogel commented 1 year ago

@ndren https://github.com/openSUSE/obs-build/blob/master/HOWTO.add_another_format

and you will probably get attention of more people if you discuss large changes in advance on the developer mailing list.

ndren commented 1 year ago

@hennevogel Thanks, I've already posted to the mailing list. I'm reading through the flatpak support PR to see how that was implemented.

antermin commented 10 months ago

It seems that https://github.com/openSUSE/obs-build/pull/934 is about building OpenWrt packages, and not about building OpenWrt images?

Can we request OpenWrt images too? Or are building firmware images out-of-scope for OBS?

(Currently GitHub CI can be used for building OpenWrt images, but it is rather slow.)