Chapt 4. Linux SDK - orangepi-build instruction
4.3. Compile u-boot
1) Run the build.sh script, remember to add sudo permission
test@test:~/orangepi-build$ sudo ./build.sh
2) Select U-bootpackage, then press Enter
Img
4.3
3) Then select the model of the development board
Img
4.4
4) Then select the branch type of u-boot
a. The current branch will compile the u-boot v2018.05 code that needs to be used in the linux5.4 image
b. The next branch will compile the u-boot v2021.07 version code that needs to be used in the linux6.1 image
Img
4.5
5) Then it will start to compile u-boot, and part of the information prompted when compiling the next branch is as follows:
[ o.k. ] Compiling u-boot [ v2021.07 ]
b. The version of the cross-compilation toolchain
[ o.k. ] Compiler version [ aarch64-linux-gnu-gcc 11 ]
c. Path to the generated u-boot deb package
[ o.k. ] Target directory [ orangepi-build/output/debs/u-boot ]
d. The package name of the generated u-boot deb package
[ o.k. ] File name [ linux-u-boot-next-orangepizero3_x.x.x_arm64.deb ]
e. Compilation time
[ o.k. ] Runtime [ 1 min ]
f. Repeat the command to compile u-boot, use the following command to start compiling u-boot directly without selecting through the graphical interface
[ o.k. ] Repeat Build Options [ sudo ./build.sh BOARD=orangepizero3 BRANCH=next BUILD_OPT=u-boot ]
6) View the u-boot deb package generated by compilation
test@test:~/orangepi-build$ ls output/debs/u-boot/
linux-u-boot-next-orangepizero3_x.x.x_arm64.deb
7) When the orangepi-bulid compilation system compiles the u-boot source code, it will first synchronize the u-boot source code with the u-boot source code of the github server, so if you want to modify the u-boot source code, you first need to turn off the download and update function of the source code.
This function needs to be fully compiled once u-boot, otherwise it will prompt that the source code of u-boot cannot be found. Otherwise the changes made will be restored, the method is as follows:
Set the IGNORE_UPDATES variable in userpatches/config-default.conf to "yes"
test@test:~/orangepi-build$ vim userpatches/config-default.conf
......
IGNORE_UPDATES="yes"
......
8) When debugging u-boot code, you can use the following method to update u-boot in the linux image for testing
test@test:~/orangepi-build$ cd output/debs/u-boot
test@test:~/orangepi_build/output/debs/u-boot$ scp \
linux-u-boot-next-orangepizero3_x.x.x_arm64.deb root@192.168.1.xxx:/root
b. Install the new u-boot deb package just uploaded
orangepi@orangepi:~$ sudo dpkg -i linux-u-boot-next-orangepizero3_x.x.x_arm64.deb
c. Then run the nand-sata-install script
orangepi@orangepi:~$ sudo nand-sata-install
d. Then select 5 Install/Update the bootloader onSD/eMMC
Img
4.6
e. After pressing the Enter key, a Warning will pop up first
Img
4.7
f. Press the Enter key again to start updating u-boot, and the following information will be displayed after the update
Img
4.8
g. Then you can restart the development board to test whether the modification of u-boot takes effect