Skip to content

Commit

Permalink
Adjust u-boot download repository
Browse files Browse the repository at this point in the history
  • Loading branch information
ophub committed Aug 20, 2023
1 parent 0977b6c commit 27077de
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build-armbian/README.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

## u-boot

系统启动引导文件,根据不同版本的内核,在需要使用时将由安装/更新等相关脚本自动化完成。
系统启动引导文件,根据不同版本的内核,在需要使用时将由安装/更新等相关脚本自动化完成。需要的 u-boot 将从 [ophub/u-boot](https://github.com/ophub/u-boot) 仓库自动下载至 `u-boot` 目录。
2 changes: 1 addition & 1 deletion build-armbian/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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.
12 changes: 6 additions & 6 deletions documents/README.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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` 系统。

点击执行写入即可。
Expand All @@ -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` 系统。

点击执行写入即可。
Expand Down Expand Up @@ -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 在前面。

<div style="width:100%;margin-top:40px;margin:5px;">
<img width="400" alt="image" src="https://user-images.githubusercontent.com/68696949/189039426-c127631f-77ca-4fcb-9fb6-4220045d712b.png">
Expand Down Expand Up @@ -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 镜像文件中。

Expand Down
12 changes: 6 additions & 6 deletions documents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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.

<div style="width:100%;margin-top:40px;margin:5px;">
<img width="400" alt="image" src="https://user-images.githubusercontent.com/68696949/189039426-c127631f-77ca-4fcb-9fb6-4220045d712b.png">
Expand Down Expand Up @@ -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).

Expand Down
11 changes: 10 additions & 1 deletion rebuild
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 27077de

Please sign in to comment.