openwrt / gh-action-sdk

GitHub CI action to build packages via SDK
29 stars 47 forks source link

Add EXTRA_INIT_SCRIPT and EXTRA_SCRIPT_AFTER_UPDATE support #19

Closed EkkoG closed 1 year ago

EkkoG commented 1 year ago

This PR adds two hook scripts to the entrypoint script, one gives the user an opportunity to add some system package like upx when package dependent host/upx, and another one make use can modify the feeds like golang pkg in packages

aparcar commented 1 year ago

Sorry could you describe further when you modify the feeds?

EkkoG commented 1 year ago

Sorry could you describe further when you modify the feeds?

Since some golang projects, like quic-go, require newer golang compiler versions, and in old version sdk, it's build-in golang version is old because golang version cannot be changed after OpenWrt is tagged, so when build with OpenWrt versions prior to 22.03.3 it will fail, so I need to replace the sdk's build-in golang to compile some project, like this https://github.com/EkkoG/openwrt-dist/blob/19a7451441b4caf07576fa6689d610aa142ce5dc/.github/workflows/main.yml#L106

jefferyto commented 1 year ago

Could you just add the Go package into a custom feed? It should override the one in the packages feed.

jefferyto commented 1 year ago

Regarding upx, see https://github.com/openwrt/packages/pull/8000 - OpenWrt uses compressed file systems and extra compression is unlikely to help (will more likely increase disk usage rather than decrease).

EkkoG commented 1 year ago

Could you just add the Go package into a custom feed? It should override the one in the packages feed.

It's ok to use golang in a custom feed, but with this solution, usually need to modify the path of golang-package.mk in Makefile

Like https://github.com/openwrt/packages/blob/1f5bc3f0f143536892302da6a1436e235e860a54/net/tailscale/Makefile#L34

I have switched to this solution. https://github.com/EkkoG/openwrt-dist/blob/b850faa665fcdbeaf915c1f7d5f3d65b4eb1fe21/fetch.sh#L28-L32

@jefferyto