35 lines
1.1 KiB
Bash
Executable File
35 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
. ./scripts/colors.sh
|
|
. ./scripts/funcs.sh
|
|
. ./scripts/config.sh
|
|
|
|
uboot_version=2025.07
|
|
|
|
#--- uboot ---
|
|
uboot() {
|
|
printf "$UGREEN** Building uboot\n$RESET"
|
|
mkdir -p $build/uboot
|
|
cd $build/uboot
|
|
tar -xvf $root/downloads/v$uboot_version.tar.gz
|
|
check $? "Extract uboot"
|
|
cd u-boot-$uboot_version
|
|
make ARCH=arm CROSS_COMPILE=$CROSS_COMPILE- $UBOOT_DEFCONFIG
|
|
check $? "Configure uboot"
|
|
if [ "$BOARD_NAME" = "orangepi_pc" ]; then
|
|
make ARCH=arm CROSS_COMPILE=$CROSS_COMPILE- $makeflags
|
|
elif [ "$BOARD_NAME" = "orangepi_zero_2w" ]; then
|
|
make ARCH=arm CROSS_COMPILE=$CROSS_COMPILE- BL31=$root/board/$BOARD_NAME/bl31.bin $makeflags
|
|
fi
|
|
check $? "Build uboot"
|
|
cp -v u-boot-sunxi-with-spl.bin $out
|
|
if [ "$ARCH" = "arm" ]; then
|
|
cp -v arch/arm/dts/sun8i-h3-orangepi-pc.dtb $sdroot/boot/dtbs
|
|
elif [ "$ARCH" = "arm64" ]; then
|
|
cp -v dts/upstream/src/arm64/allwinner/sun50i-h618-orangepi-zero2w.dtb $sdroot/boot/dtbs
|
|
fi
|
|
check $? "Install uboot to out directory"
|
|
check $? "Build and install uboot to out directory"
|
|
}
|
|
#-------------
|