Skip to content

Commit cc571f6

Browse files
committed
build: skip MTK overlay patches by default
1 parent 5bbe26a commit cc571f6

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

SCRIPTS/02_prepare_package.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ mtk_feed_version_dir="${MTK_FEED_VERSION_DIR:-24.10}"
118118
mtk_feed_official_url="${MTK_FEED_OFFICIAL_URL:-https://git01.mediatek.com/openwrt/feeds/mtk-openwrt-feeds.git}"
119119
mtk_feed_mirror_url="${MTK_FEED_MIRROR_URL:-https://tea.saymi-labs.top/Learning/mtk-openwrt-feeds}"
120120
mtk_feed_mapping_url="${MTK_FEED_MAPPING_URL:-https://raw.githubusercontent.com/GainStrongService/mtk-openwrt-feeds/master/mtk-openwrt-feeds-commit-sha-mapping-table.md}"
121-
mtk_feed_skip_patches="${MTK_FEED_SKIP_PATCHES:-1000-arch-arm64-dts-add-fitblk-support-for-MediaTek-RFB.patch}"
121+
mtk_feed_apply_patches="${MTK_FEED_APPLY_PATCHES:-0}"
122122

123123
configure_mtk_feed_link() {
124124
local abs_source_dir
@@ -233,7 +233,7 @@ prepare_mtk_feed_source() {
233233

234234
apply_mtk_feed_overlay() {
235235
local overlay_dir="./feeds/mtk/$mtk_feed_version_dir"
236-
local patch_dir patch_file patch_name
236+
local patch_dir patch_file
237237

238238
if [ ! -d "$overlay_dir" ]; then
239239
echo "[MTK] Overlay directory $overlay_dir not found" >&2
@@ -245,18 +245,18 @@ apply_mtk_feed_overlay() {
245245
cp -af "$overlay_dir/files/." .
246246
fi
247247

248+
if [ "$mtk_feed_apply_patches" != "1" ]; then
249+
echo "[MTK] Skipping overlay patches from $overlay_dir (set MTK_FEED_APPLY_PATCHES=1 to enable)"
250+
return 0
251+
fi
252+
248253
for patch_dir in patches-base patches-feeds; do
249254
if [ ! -d "$overlay_dir/$patch_dir" ]; then
250255
continue
251256
fi
252257

253258
while IFS= read -r patch_file; do
254259
[ -n "$patch_file" ] || continue
255-
patch_name="${patch_file##*/}"
256-
if printf '%s\n' "$mtk_feed_skip_patches" | tr ', ' '\n\n' | grep -Fxq "$patch_name"; then
257-
echo "[MTK] Skipping patch $patch_file"
258-
continue
259-
fi
260260
echo "[MTK] Applying patch $patch_file"
261261
patch -f -p1 -i "$patch_file"
262262
done <<EOF

SCRIPTS/02_prepare_package_minimal.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ mtk_feed_version_dir="${MTK_FEED_VERSION_DIR:-24.10}"
101101
mtk_feed_official_url="${MTK_FEED_OFFICIAL_URL:-https://git01.mediatek.com/openwrt/feeds/mtk-openwrt-feeds.git}"
102102
mtk_feed_mirror_url="${MTK_FEED_MIRROR_URL:-https://tea.saymi-labs.top/Learning/mtk-openwrt-feeds}"
103103
mtk_feed_mapping_url="${MTK_FEED_MAPPING_URL:-https://raw.githubusercontent.com/GainStrongService/mtk-openwrt-feeds/master/mtk-openwrt-feeds-commit-sha-mapping-table.md}"
104-
mtk_feed_skip_patches="${MTK_FEED_SKIP_PATCHES:-1000-arch-arm64-dts-add-fitblk-support-for-MediaTek-RFB.patch}"
104+
mtk_feed_apply_patches="${MTK_FEED_APPLY_PATCHES:-0}"
105105

106106
configure_mtk_feed_link() {
107107
local abs_source_dir
@@ -216,7 +216,7 @@ prepare_mtk_feed_source() {
216216

217217
apply_mtk_feed_overlay() {
218218
local overlay_dir="./feeds/mtk/$mtk_feed_version_dir"
219-
local patch_dir patch_file patch_name
219+
local patch_dir patch_file
220220

221221
if [ ! -d "$overlay_dir" ]; then
222222
echo "[MTK] Overlay directory $overlay_dir not found" >&2
@@ -228,18 +228,18 @@ apply_mtk_feed_overlay() {
228228
cp -af "$overlay_dir/files/." .
229229
fi
230230

231+
if [ "$mtk_feed_apply_patches" != "1" ]; then
232+
echo "[MTK] Skipping overlay patches from $overlay_dir (set MTK_FEED_APPLY_PATCHES=1 to enable)"
233+
return 0
234+
fi
235+
231236
for patch_dir in patches-base patches-feeds; do
232237
if [ ! -d "$overlay_dir/$patch_dir" ]; then
233238
continue
234239
fi
235240

236241
while IFS= read -r patch_file; do
237242
[ -n "$patch_file" ] || continue
238-
patch_name="${patch_file##*/}"
239-
if printf '%s\n' "$mtk_feed_skip_patches" | tr ', ' '\n\n' | grep -Fxq "$patch_name"; then
240-
echo "[MTK] Skipping patch $patch_file"
241-
continue
242-
fi
243243
echo "[MTK] Applying patch $patch_file"
244244
patch -f -p1 -i "$patch_file"
245245
done <<EOF

0 commit comments

Comments
 (0)