diff --git a/build-armbian/README.cn.md b/build-armbian/README.cn.md
index 9835a73f3d..f1e84d8666 100644
--- a/build-armbian/README.cn.md
+++ b/build-armbian/README.cn.md
@@ -16,4 +16,4 @@
## u-boot
-系统启动引导文件,根据不同版本的内核,在需要使用时将由安装/更新等相关脚本自动化完成。
+系统启动引导文件,根据不同版本的内核,在需要使用时将由安装/更新等相关脚本自动化完成。需要的 u-boot 将从 [ophub/u-boot](https://github.com/ophub/u-boot) 仓库自动下载至 `u-boot` 目录。
diff --git a/build-armbian/README.md b/build-armbian/README.md
index 96ce1c8897..cc4435f296 100644
--- a/build-armbian/README.md
+++ b/build-armbian/README.md
@@ -16,4 +16,4 @@ Create a folder corresponding to the version number under the `kernel` directory
## u-boot
-System boot files, according to different versions of the kernel, will be automated by installation/update and other related scripts when needed.
\ No newline at end of file
+System boot files, according to different versions of the kernel, will be automated by installation/update and other related scripts when needed. The necessary u-boot will be automatically downloaded from the [ophub/u-boot](https://github.com/ophub/u-boot) repository to the `u-boot` directory.
\ No newline at end of file
diff --git a/documents/README.cn.md b/documents/README.cn.md
index e76ff18e74..a39d66c7a6 100644
--- a/documents/README.cn.md
+++ b/documents/README.cn.md
@@ -232,7 +232,7 @@ armbian-install
#### 8.2.1 Radxa-Rock5B 的安装方法
-Radxa-Rock5B 有 microSD/eMMC/NVMe 等多种存储介质可以选择,相应的安装方法也不同。下载 [rk3588_spl_loader_v1.08.111.bin 和 spi_image.img](../u-boot/rockchip/rock5b) 文件备用。下载 [RKDevTool](https://github.com/ophub/kernel/releases/download/tools/Radxa_rock5b_RKDevTool_Release_v2.96__DriverAssitant_v5.1.1.tar.gz) 工具及驱动备用。下载 [Rufus](https://rufus.ie/) 或者 [balenaEtcher](https://www.balena.io/etcher/) 写盘工具备用。
+Radxa-Rock5B 有 microSD/eMMC/NVMe 等多种存储介质可以选择,相应的安装方法也不同。下载 [rk3588_spl_loader_v1.08.111.bin 和 spi_image.img](https://github.com/ophub/u-boot/tree/main/u-boot/rockchip/rock5b) 文件备用。下载 [RKDevTool](https://github.com/ophub/kernel/releases/download/tools/Radxa_rock5b_RKDevTool_Release_v2.96__DriverAssitant_v5.1.1.tar.gz) 工具及驱动备用。下载 [Rufus](https://rufus.ie/) 或者 [balenaEtcher](https://www.balena.io/etcher/) 写盘工具备用。
##### 8.2.1.1 安装系统至 microSD
@@ -312,7 +312,7 @@ dd if=armbian.img of=/dev/nvme0n1 bs=1M status=progress
打开 RKDevTool 刷机工具,右键添加项。
-- 地址 `0xCCCCCCCC`, 名字 `Boot`, 路径[选择](../u-boot/rockchip/beikeyun) `rk3328_loader_v1.14.249.bin`。
+- 地址 `0xCCCCCCCC`, 名字 `Boot`, 路径[选择](https://github.com/ophub/u-boot/tree/main/u-boot/rockchip/beikeyun) `rk3328_loader_v1.14.249.bin`。
- 地址 `0x00000000`, 名字 `system`, 路径选择要刷的 `Armbian.img` 系统。
点击执行写入即可。
@@ -321,7 +321,7 @@ dd if=armbian.img of=/dev/nvme0n1 bs=1M status=progress
方法转载自 [cc747](https://post.smzdm.com/p/a4wkdo7l/) 的教程。刷机需要进入 Maskrom 模式。使我家云处于断电状态,拔掉所有线。用 USB 双公头线,一头插入我家云的 USB2.0 接口,一头插入电脑。用回形针插进 Reset 孔,并按压住不松开。插入电源线。等待几秒钟,直到 RKDevTool 框的下方出现`发现一个LOADER设备`后才松开回形针。将 RKDevTool 切换到`高级功能`点击`进入Maskrom`按钮,提示`发现一个MASKROM设备`。右键添加项。
-- 地址 `0xCCCCCCCC`, 名字 `Boot`, 路径[选择](../u-boot/rockchip/l1pro) `rk3328_loader.bin`。
+- 地址 `0xCCCCCCCC`, 名字 `Boot`, 路径[选择](https://github.com/ophub/u-boot/tree/main/u-boot/rockchip/l1pro) `rk3328_loader.bin`。
- 地址 `0x00000000`, 名字 `system`, 路径选择要刷的 `Armbian.img` 系统。
点击执行写入即可。
@@ -1102,7 +1102,7 @@ adb pull /data/local/mybox_gpio.txt C:\mybox
- 下载 [u-boot](https://github.com/unifreq/u-boot) 源码。制作对应的 [x96max-plus_defconfig](https://github.com/unifreq/u-boot/blob/master/configs/x96max-plus_defconfig) 文件放入 [configs](https://github.com/unifreq/u-boot/tree/master/configs) 目录。制作对应的 [meson-sm1-x96-max-plus-u-boot.dtsi](https://github.com/unifreq/u-boot/blob/master/arch/arm/dts/meson-sm1-x96-max-plus-u-boot.dtsi) 和 [meson-sm1-x96-max-plus.dts](https://github.com/unifreq/u-boot/blob/master/arch/arm/dts/meson-sm1-x96-max-plus.dts) 文件放入 [arch/arm/dts](https://github.com/unifreq/u-boot/tree/master/arch/arm/dts) 目录,并编辑此目录中的 [Makefile](https://github.com/unifreq/u-boot/blob/master/arch/arm/dts/Makefile) 文件,添加 `meson-sm1-x96-max-plus.dtb` 文件的索引。
- 进入 u-boot 源码目录根目录下,根据文档 https://github.com/unifreq/u-boot/blob/master/doc/board/amlogic/x96max-plus.rst 中的步骤操作。
-最终生成的文件有两类:在 u-boot 根目录下的 `u-boot.bin` 文件是 `/boot` 目录下使用的不完整版 u-boot(对应仓库中的 [overload](../amlogic-u-boot/overload) 目录);在 `fip` 目录下的 `u-boot.bin` 和 `u-boot.bin.sd.bin` 是 `/usr/lib/u-boot/` 目录下使用的完整版 u-boot 文件(对应仓库中的 [bootloader](../amlogic-u-boot/bootloader/) 目录),完整版的两个文件相差 512 字节,大的那个是填充了 512 字节的 0 在前面。
+最终生成的文件有两类:在 u-boot 根目录下的 `u-boot.bin` 文件是 `/boot` 目录下使用的不完整版 u-boot(对应仓库中的 [overload](https://github.com/ophub/u-boot/tree/main/u-boot/amlogic/overload) 目录);在 `fip` 目录下的 `u-boot.bin` 和 `u-boot.bin.sd.bin` 是 `/usr/lib/u-boot/` 目录下使用的完整版 u-boot 文件(对应仓库中的 [bootloader](https://github.com/ophub/u-boot/tree/main/u-boot/amlogic/bootloader) 目录),完整版的两个文件相差 512 字节,大的那个是填充了 512 字节的 0 在前面。
@@ -1221,9 +1221,9 @@ dtc -I dts -O dtb -o xxx.dtb xxx.dts
#### 12.15.3 添加 u-boot 文件
-`Amlogic` 系列的设备,共用 [bootloader](../u-boot/amlogic/bootloader/) 文件和 [u-boot](../u-boot/amlogic/overload) 文件,如果有新增的文件,分别放入对应的目录。其中的 `bootloader` 文件在系统构建时会自动添加至 Armbian 系统的 `/usr/lib/u-boot` 目录,`u-boot` 文件会自动添加至 `/boot` 目录。
+`Amlogic` 系列的设备,共用 [bootloader](https://github.com/ophub/u-boot/tree/main/u-boot/amlogic/bootloader) 文件和 [u-boot](https://github.com/ophub/u-boot/tree/main/u-boot/amlogic/overload) 文件,如果有新增的文件,分别放入对应的目录。其中的 `bootloader` 文件在系统构建时会自动添加至 Armbian 系统的 `/usr/lib/u-boot` 目录,`u-boot` 文件会自动添加至 `/boot` 目录。
-`Rockchip` 和 `Allwinner` 系列的设备,为每个设备添加以 `BOARD` 命名的独立 [u-boot](../u-boot) 文件目录,对应的系列文件放在此目录中。
+`Rockchip` 和 `Allwinner` 系列的设备,为每个设备添加以 `BOARD` 命名的独立 [u-boot](https://github.com/ophub/u-boot/tree/main/u-boot) 文件目录,对应的系列文件放在此目录中。
构建 Armbian 镜像时,这些 u-boot 文件将根据 [/etc/model_database.conf](../armbian-files/common-files/etc/model_database.conf) 中的配置,由 rebuild 脚本写入对应的 Armbian 镜像文件中。
diff --git a/documents/README.md b/documents/README.md
index 64a612ff00..48822fa9be 100644
--- a/documents/README.md
+++ b/documents/README.md
@@ -232,7 +232,7 @@ The installation method for each device is different, introduced separately as f
#### 8.2.1 Installation Method for Radxa-Rock5B
-Radxa-Rock5B has multiple storage mediums such as microSD/eMMC/NVMe to choose from, and the corresponding installation methods are also different. Download [rk3588_spl_loader_v1.08.111.bin and spi_image.img](../u-boot/rockchip/rock5b) files for later use. Download [RKDevTool](https://github.com/ophub/kernel/releases/download/tools/Radxa_rock5b_RKDevTool_Release_v2.96__DriverAssitant_v5.1.1.tar.gz) tool and driver for later use. Download [Rufus](https://rufus.ie/) or [balenaEtcher](https://www.balena.io/etcher/) disc writing tools for later use.
+Radxa-Rock5B has multiple storage mediums such as microSD/eMMC/NVMe to choose from, and the corresponding installation methods are also different. Download [rk3588_spl_loader_v1.08.111.bin and spi_image.img](https://github.com/ophub/u-boot/tree/main/u-boot/rockchip/rock5b) files for later use. Download [RKDevTool](https://github.com/ophub/kernel/releases/download/tools/Radxa_rock5b_RKDevTool_Release_v2.96__DriverAssitant_v5.1.1.tar.gz) tool and driver for later use. Download [Rufus](https://rufus.ie/) or [balenaEtcher](https://www.balena.io/etcher/) disc writing tools for later use.
##### 8.2.1.1 Install the System to MicroSD
@@ -312,7 +312,7 @@ The method is reproduced from [milton](https://www.cnblogs.com/milton/p/15391525
Open the RKDevTool flashing tool, right-click to add an item.
-- Address `0xCCCCCCCC`, name `Boot`, path [select](../u-boot/rockchip/beikeyun) `rk3328_loader_v1.14.249.bin`.
+- Address `0xCCCCCCCC`, name `Boot`, path [select](https://github.com/ophub/u-boot/tree/main/u-boot/rockchip/beikeyun) `rk3328_loader_v1.14.249.bin`.
- Address `0x00000000`, name `system`, path select the `Armbian.img` system to be flashed.
Click execute to write.
@@ -321,7 +321,7 @@ Click execute to write.
The method is reproduced from [cc747](https://post.smzdm.com/p/a4wkdo7l/)'s tutorial. Flashing requires entering the Maskrom mode. Make Chainedbox-L1-Pro in a power-off state, unplug all cables. With a USB male-to-male cable, one end is inserted into the USB2.0 interface of Chainedbox-L1-Pro, and the other end is inserted into the computer. Insert a paperclip into the Reset hole and press and hold it. Insert the power cord. Wait a few seconds until the `discovered a LOADER device` appears at the bottom of the RKDevTool box before releasing the paperclip. Switch RKDevTool to `Advanced Features` and click the `Enter Maskrom` button, prompting `Found a MASKROM device`. Right-click to add an item.
-- Address `0xCCCCCCCC`, name `Boot`, path [select](../u-boot/rockchip/l1pro) `rk3328_loader.bin`.
+- Address `0xCCCCCCCC`, name `Boot`, path [select](https://github.com/ophub/u-boot/tree/main/u-boot/rockchip/l1pro) `rk3328_loader.bin`.
- Address `0x00000000`, name `system`, path select the `Armbian.img` system to be flashed.
Click execute to write.
@@ -1105,7 +1105,7 @@ For example, creating a u-boot for X96Max Plus:
- Download the [u-boot](https://github.com/unifreq/u-boot) source code. Create a corresponding [x96max-plus_defconfig](https://github.com/unifreq/u-boot/blob/master/configs/x96max-plus_defconfig) file and put it into the [configs](https://github.com/unifreq/u-boot/tree/master/configs) directory. Create the corresponding [meson-sm1-x96-max-plus-u-boot.dtsi](https://github.com/unifreq/u-boot/blob/master/arch/arm/dts/meson-sm1-x96-max-plus-u-boot.dtsi) and [meson-sm1-x96-max-plus.dts](https://github.com/unifreq/u-boot/blob/master/arch/arm/dts/meson-sm1-x96-max-plus.dts) files and put them in the [arch/arm/dts](https://github.com/unifreq/u-boot/tree/master/arch/arm/dts) directory, then edit the [Makefile](https://github.com/unifreq/u-boot/blob/master/arch/arm/dts/Makefile) in this directory to add the `meson-sm1-x96-max-plus.dtb` file index.
- In the root directory of the u-boot source code, follow the steps in the document https://github.com/unifreq/u-boot/blob/master/doc/board/amlogic/x96max-plus.rst.
-Two types of files are ultimately generated: the `u-boot.bin` file in the u-boot root directory is an incomplete version of u-boot used in the `/boot` directory (corresponds to the [overload](../amlogic-u-boot/overload) directory in the repository); the `u-boot.bin` and `u-boot.bin.sd.bin` in the `fip` directory are complete versions of u-boot files used in the `/usr/lib/u-boot/` directory (corresponds to the [bootloader](../amlogic-u-boot/bootloader/) directory in the repository). The complete versions of the two files differ by 512 bytes, the larger one has 512 bytes of 0 filled in front.
+Two types of files are ultimately generated: the `u-boot.bin` file in the u-boot root directory is an incomplete version of u-boot used in the `/boot` directory (corresponds to the [overload](https://github.com/ophub/u-boot/tree/main/u-boot/amlogic/overload) directory in the repository); the `u-boot.bin` and `u-boot.bin.sd.bin` in the `fip` directory are complete versions of u-boot files used in the `/usr/lib/u-boot/` directory (corresponds to the [bootloader](https://github.com/ophub/u-boot/tree/main/u-boot/amlogic/bootloader) directory in the repository). The complete versions of the two files differ by 512 bytes, the larger one has 512 bytes of 0 filled in front.
@@ -1226,9 +1226,9 @@ If individual devices have special differential setting requirements, add an ind
#### 12.15.3 Add u-boot Files
-`Amlogic` series devices, share [bootloader](../u-boot/amlogic/bootloader/) files and [u-boot](../u-boot/amlogic/overload) files. If there are new files, put them in the corresponding directory. The `bootloader` files will automatically be added to the Armbian system's `/usr/lib/u-boot` directory during system construction, and `u-boot` files will be automatically added to the `/boot` directory.
+`Amlogic` series devices, share [bootloader](https://github.com/ophub/u-boot/tree/main/u-boot/amlogic/bootloader) files and [u-boot](https://github.com/ophub/u-boot/tree/main/u-boot/amlogic/overload) files. If there are new files, put them in the corresponding directory. The `bootloader` files will automatically be added to the Armbian system's `/usr/lib/u-boot` directory during system construction, and `u-boot` files will be automatically added to the `/boot` directory.
-`Rockchip` and `Allwinner` series devices, add an independent [u-boot](../u-boot) file directory named after `BOARD` for each device, and the corresponding series files are placed in this directory.
+`Rockchip` and `Allwinner` series devices, add an independent [u-boot](https://github.com/ophub/u-boot/tree/main/u-boot) file directory named after `BOARD` for each device, and the corresponding series files are placed in this directory.
During the Armbian image construction, these u-boot files will be written into the corresponding Armbian image files by the rebuild script according to the configuration in [/etc/model_database.conf](../armbian-files/common-files/etc/model_database.conf).
diff --git a/rebuild b/rebuild
index 6248cc9dd2..278f936403 100755
--- a/rebuild
+++ b/rebuild
@@ -73,6 +73,11 @@ armbian_release_file="etc/armbian-release"
# Add custom armbian information
ophub_release_file="etc/ophub-release"
+# U-BOOT files download repository
+uboot_repo="https://github.com/ophub/u-boot/tree/main/u-boot"
+# Convert firmware repository address to svn format
+uboot_repo="${uboot_repo//tree\/main/trunk}"
+
# Firmware files download repository
firmware_repo="https://github.com/ophub/firmware/tree/main/firmware"
# Convert firmware repository address to svn format
@@ -332,9 +337,13 @@ download_depends() {
cd ${current_path}
echo -e "${STEPS} Start downloading dependency files..."
+ # Download Armbian u-boot files
+ svn co ${uboot_repo} ${uboot_path} --force --quiet
+ [[ "${?}" -eq "0" ]] && echo -e "${INFO} u-boot download completed." || error_msg "u-boot download failed."
+
# Download Armbian firmware files
svn co ${firmware_repo} ${firmware_path} --force --quiet
- [[ "${?}" -ne "0" ]] && error_msg "Failed to download the Armbian firmware files."
+ [[ "${?}" -eq "0" ]] && echo -e "${INFO} firmware download completed." || error_msg "firmware download failed."
}
query_kernel() {