Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
Signed-off-by: Wesley Gimenes <wehagy@proton.me>
  • Loading branch information
wehagy committed Sep 14, 2024
1 parent 88a22ad commit 6b32817
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 72 deletions.
66 changes: 0 additions & 66 deletions custom-feed/netbird/Makefile.orig

This file was deleted.

10 changes: 10 additions & 0 deletions custom-feed/netbird/patches/010-main_code_fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
module github.com/netbirdio/netbird

-go 1.23.0
+go 1.22.0

require (
cunicu.li/go-rosenpass v0.4.0
27 changes: 21 additions & 6 deletions openwrt-builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ PACKAGES_IMAGE+=(
luci
luci-ssl
luci-app-attendedsysupgrade
luci-app-watchcat
"${TMP[@]}"
)
unset TMP
Expand All @@ -45,10 +44,13 @@ build () {
CONTAINER_IMAGEBUILDER_IMAGE="${CONTAINER_PREFIX}/imagebuilder:${CONTAINER_TAG}"

CONTAINER_COMMON_ARGS=(
--transient-store
run
--rm
--user 0:0
--pull always
--uidmap "${UID}":0:1
--gidmap "${UID}":0:1
--image-volume tmpfs
--volume "${PWD}"/bin/:/builder/bin/
"$([[ -d custom-feed ]] && printf -- '--volume %s/custom-feed/:/builder/custom-feed/:ro' "${PWD}" || true)"
)
Expand All @@ -58,15 +60,24 @@ build () {
"${CONTAINER_SDK_IMAGE}"
bash -c "
# Update feeds and build packages
sed --regexp-extended --in-place 's,git\.openwrt\.org\/(openwrt|feed|project),github\.com\/openwrt,' feeds.conf.default
sed --in-place '1i src-link custom /builder/custom-feed' feeds.conf.default
sed \
--in-place \
--regexp-extended \
's,git\.openwrt\.org\/(openwrt|feed|project),github\.com\/openwrt,' \
feeds.conf.default
sed \
--in-place \
'1i src-link custom /builder/custom-feed' \
feeds.conf.default
./scripts/feeds update -a
make defconfig
# Logic to build additional packages
for PACKAGE in custom-feed/*; do
./scripts/feeds install \"\${PACKAGE##*/}\"
make package/\"\${PACKAGE##*/}\"/{clean,compile} -j \"\$( nproc )\"
make package/\"\${PACKAGE##*/}\"/{clean,compile} \
V=s \
-j \"\$( nproc )\"
done
# Clean
Expand All @@ -88,7 +99,11 @@ build () {
ln -sr \"\${IPK}\" packages/
done
shopt -u globstar nullglob
make image PROFILE=${PROFILE_IMAGE} PACKAGES=\"${PACKAGES_IMAGE[*]}\"
make image \
V=s \
-j \"\$( nproc )\" \
PROFILE=${PROFILE_IMAGE} PACKAGES=\"${PACKAGES_IMAGE[*]}\"
"
)

Expand Down

0 comments on commit 6b32817

Please sign in to comment.