File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,6 +103,15 @@ ensure_file_has_line() {
103103 echo " $label Ensured $( basename " $file_path " ) contains: $line "
104104}
105105
106+ fix_tfa_ldflags_compat () {
107+ local tfa_include=./include/trusted-firmware-a.mk
108+
109+ [ -f " $tfa_include " ] || return 1
110+
111+ perl -0pi -e ' s/LDFLAGS="-no-warn-rwx-segments"/LDFLAGS="-Wl,--no-warn-rwx-segments"/g' " $tfa_include "
112+ echo " [BOOT] Patched trusted-firmware-a LDFLAGS compatibility in $( basename " $tfa_include " ) "
113+ }
114+
106115# ## feeds 优化 ###
107116# 先尝试 GitHub 镜像,失败后回退到 git.openwrt.org
108117rewrite_feeds () {
@@ -313,6 +322,8 @@ ensure_file_has_line \
313322 " # CONFIG_USB_XHCI_MTK_DEBUGFS is not set" \
314323 " [KERNEL]"
315324
325+ fix_tfa_ldflags_compat
326+
316327if ! ./scripts/feeds install -a; then
317328 echo " Feeds 安装部分失败,请检查上游仓库状态。" >&2
318329fi
Original file line number Diff line number Diff line change @@ -103,6 +103,15 @@ ensure_file_has_line() {
103103 echo " $label Ensured $( basename " $file_path " ) contains: $line "
104104}
105105
106+ fix_tfa_ldflags_compat () {
107+ local tfa_include=./include/trusted-firmware-a.mk
108+
109+ [ -f " $tfa_include " ] || return 1
110+
111+ perl -0pi -e ' s/LDFLAGS="-no-warn-rwx-segments"/LDFLAGS="-Wl,--no-warn-rwx-segments"/g' " $tfa_include "
112+ echo " [BOOT] Patched trusted-firmware-a LDFLAGS compatibility in $( basename " $tfa_include " ) "
113+ }
114+
106115disable_mtk_feed () {
107116 for feed_file in feeds.conf feeds.conf.default; do
108117 if [ -f " $feed_file " ]; then
@@ -310,6 +319,8 @@ ensure_file_has_line \
310319 " # CONFIG_USB_XHCI_MTK_DEBUGFS is not set" \
311320 " [KERNEL]"
312321
322+ fix_tfa_ldflags_compat
323+
313324./scripts/feeds install -a
314325
315326restore_openwrt_boot_package arm-trusted-firmware-mediatek || true
You can’t perform that action at this time.
0 commit comments