Skip to content

Commit

Permalink
add global patch function
Browse files Browse the repository at this point in the history
  • Loading branch information
pexcn committed Mar 3, 2024
1 parent 39959bf commit 53ed359
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
path = configs
url = https://github.com/openwrt-ipq60xx/configs.git
branch = main
[submodule "patches"]
path = patches
url = https://github.com/openwrt-ipq60xx/patches.git
branch = main
16 changes: 15 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# shellcheck disable=SC3043,SC2086,SC2164,SC2103,SC2046
# shellcheck disable=SC2086,SC3043,SC2164,SC2103,SC2046,SC3011,SC2155

get_sources() {
git clone $BUILD_REPO --single-branch -b $GITHUB_REF_NAME openwrt
Expand All @@ -13,6 +13,19 @@ echo_version() {
cd configs && git log -1 && cd -
}

apply_patches() {
[ -d patches ] || return 0

dirname $(find patches -type f -name "*.patch") | sort -u | while read -r dir; do
local patch_dir="$(realpath $dir)"
cd "$(sed 's|^patches/|openwrt/|' <<<$dir)"
find $patch_dir -type f -name "*.patch" | while read -r patch; do
git am $patch
done
cd -
done
}

build_firmware() {
cd openwrt

Expand Down Expand Up @@ -42,6 +55,7 @@ package_dl_src() {

get_sources
echo_version
apply_patches
build_firmware
package_binaries
package_dl_src
1 change: 1 addition & 0 deletions patches
Submodule patches added at 273236

0 comments on commit 53ed359

Please sign in to comment.