From 96859c1ce6e413fb427a1e716750168144882b36 Mon Sep 17 00:00:00 2001 From: zhao Date: Mon, 24 Mar 2025 20:36:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20toolchain/build.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhao --- toolchain/build.sh | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/toolchain/build.sh b/toolchain/build.sh index 8902a0e..7e088fe 100644 --- a/toolchain/build.sh +++ b/toolchain/build.sh @@ -1,7 +1,24 @@ #!/bin/bash -e -# Clone source code -git clone -b openwrt-24.10 --single-branch --filter=blob:none https://github.com/openwrt/openwrt +# 定义一个函数,用来克隆指定的仓库和分支 +clone_repo() { + # 参数1是仓库地址,参数2是分支名,参数3是目标目录 + repo_url=$1 + branch_name=$2 + target_dir=$3 + # 克隆仓库到目标目录,并指定分支名和深度为1 + git clone -b $branch_name --depth 1 $repo_url $target_dir +} + +# 定义一些变量,存储仓库地址和分支名 +immortalwrt_repo="https://github.com/immortalwrt/immortalwrt" +openwrt_repo="https://github.com/openwrt/openwrt.git" + +# 开始克隆仓库,并行执行 +clone_repo $immortalwrt_repo openwrt-24.10 immortalwrt & +clone_repo $openwrt_repo openwrt-24.10 openwrt & +# 等待所有后台任务完成 +wait # Enter source code cd openwrt @@ -10,6 +27,19 @@ cd openwrt ./scripts/feeds update -a ./scripts/feeds install -a +# make olddefconfig +wget -qO - https://raw.githubusercontent.com/oppen321/ZeroWrt-Action/refs/heads/master/patch/linux/0003-include-kernel-defaults.mk.patch | patch -p1 + +# 更换为 ImmortalWrt Uboot 以及 Target +rm -rf ./target/linux/rockchip +cp -rf ../immortalwrt/target/linux/rockchip ./target/linux/rockchip +rm -rf package/boot/{rkbin,uboot-rockchip,arm-trusted-firmware-rockchip} +cp -rf ../immortalwrt/package/boot/uboot-rockchip ./package/boot/uboot-rockchip +cp -rf ../immortalwrt/package/boot/arm-trusted-firmware-rockchip ./package/boot/arm-trusted-firmware-rockchip +sed -i '/REQUIRE_IMAGE_METADATA/d' target/linux/rockchip/armv8/base-files/lib/upgrade/platform.sh + +curl -L -o include/kernel-6.6 https://raw.githubusercontent.com/immortalwrt/immortalwrt/refs/heads/openwrt-24.10/include/kernel-6.6 + # Load devices Config if [ "$model" = "OpenWrt_Rockchip_v24.10" ]; then curl -s https://git.kejizero.online/zhao/files/raw/branch/main/toolchain/Configs/immortalwrt_rockchip.config > .config