From 21134f855141fe54cd11dfbc330a8aa2f23f3bbd Mon Sep 17 00:00:00 2001 From: OPPEN321 Date: Wed, 5 Nov 2025 10:25:55 +0800 Subject: [PATCH] Update 00-prepare_base.sh --- scripts/00-prepare_base.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/scripts/00-prepare_base.sh b/scripts/00-prepare_base.sh index 75dcae0..b0d40df 100644 --- a/scripts/00-prepare_base.sh +++ b/scripts/00-prepare_base.sh @@ -44,6 +44,33 @@ sed -i 's/+uhttpd +uhttpd-mod-ubus /+luci-nginx /g' feeds/packages/net/wg-instal sed -i '/uhttpd-mod-ubus/d' feeds/luci/collections/luci-light/Makefile sed -i 's/+luci-nginx \\$/+luci-nginx/' feeds/luci/collections/luci-light/Makefile +# Use specific optimizations +if [ "$platform" = "x86_64" ]; then + sed -i 's/O2/O2 -march=x86-64-v2/g' include/target.mk + sed -i 's,no-mips16 no-lto,no-mips16,g' feeds/packages/libs/libsodium/Makefile + echo '#!/bin/sh + # Put your custom commands here that should be executed once + # the system init finished. By default this file does nothing. + + if ! grep "Default string" /tmp/sysinfo/model > /dev/null; then + echo should be fine + else + echo "Generic PC" > /tmp/sysinfo/model + fi + + status=$(cat /sys/devices/system/cpu/intel_pstate/status) + + if [ "$status" = "passive" ]; then + echo "active" | tee /sys/devices/system/cpu/intel_pstate/status + fi + + exit 0 + '> ./package/base-files/files/etc/rc.local +elif [ "$platform" = "rockchip" ]; then + sed -i 's,-mcpu=generic,-march=armv8-a+crc+crypto,g' include/target.mk + sed -i 's,kmod-r8168,kmod-r8169,g' target/linux/rockchip/image/armv8.mk +fi + # Libubox sed -i '/TARGET_CFLAGS/ s/$/ -Os/' package/libs/libubox/Makefile