Joshua-Riek / ubuntu-rockchip

Ubuntu for Rockchip RK35XX Devices
https://joshua-riek.github.io/ubuntu-rockchip-download/
GNU General Public License v3.0
2.38k stars 257 forks source link

Building issue for OrangePi5 #583

Closed ahsan-kaukab closed 9 months ago

ahsan-kaukab commented 9 months ago

Hello all , I was trying to build this ubuntu-rockchip for orangepi5 using following command sudo ./build.sh --board=orangpi5 and I am getting following error :

find: ‘build/u-boot-orangepi-5_*.deb’: No such file or directory
dpkg-source: info: using options from u-boot-orangepi-rk3588/debian/source/options: --compression=xz --tar-ignore=.git --diff-ignore --tar-ignore
dpkg-buildpackage: info: source package u-boot-orangepi-rk3588
dpkg-buildpackage: info: source version 2017.09+20230704.git1f70ac3a-7
dpkg-buildpackage: info: source distribution jammy
dpkg-buildpackage: info: source changed by Joshua Riek <jjriek@verizon.net>
dpkg-architecture: warning: specified GNU system type aarch64-linux-gnu does not match CC system type x86_64-linux-gnu, try setting a correct CC environment variable
debian/rules orangepi_5_sata
dpkg-buildpackage: info: host architecture arm64
make O=debian/build/orangepi_5_sata \
CROSS_COMPILE=aarch64-linux-gnu- \
ARCH=arm \
-j 8 \
orangepi_5_sata_defconfig
make[1]: Entering directory '/home/lotus/Downloads/ubuntu-rockchip-main/build/u-boot-orangepi-rk3588'
make[2]: Entering directory '/home/lotus/Downloads/ubuntu-rockchip-main/build/u-boot-orangepi-rk3588/debian/build/orangepi_5_sata'
GEN ./Makefile
arch/../configs/orangepi_5_sata_defconfig:245⚠ override: reassigning to symbol CMD_SETEXPR
#
# configuration written to .config
#
make[2]: Leaving directory '/home/lotus/Downloads/ubuntu-rockchip-main/build/u-boot-orangepi-rk3588/debian/build/orangepi_5_sata'
make[1]: Leaving directory '/home/lotus/Downloads/ubuntu-rockchip-main/build/u-boot-orangepi-rk3588'
make O=debian/build/orangepi_5_sata \
CROSS_COMPILE=aarch64-linux-gnu- \
SOURCE_DATE_EPOCH=1706289309 \
ARCH=arm \
-j 8 \
BL31=../../../debian/rkbin/rk3588_bl31_v1.38.elf \
spl/u-boot-spl.bin u-boot.dtb u-boot.itb
make[1]: Entering directory '/home/lotus/Downloads/ubuntu-rockchip-main/build/u-boot-orangepi-rk3588'
make[2]: Entering directory '/home/lotus/Downloads/ubuntu-rockchip-main/build/u-boot-orangepi-rk3588/debian/build/orangepi_5_sata'
GEN ./Makefile
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config.h
CFG u-boot.cfg
GEN include/autoconf.mk.dep
CFG spl/u-boot.cfg
CFG tpl/u-boot.cfg
GEN tpl/include/autoconf.mk
GEN include/autoconf.mk
GEN spl/include/autoconf.mk
CHK include/config/uboot.release
CHK include/generated/timestamp_autogenerated.h
/home/lotus/Downloads/ubuntu-rockchip-main/build/u-boot-orangepi-rk3588/"arch/arm/mach-rockchip/make_fit_atf.sh" \
arch/arm/dts/rk3588s-orangepi-5-sata.dtb > u-boot.its
GEN ./Makefile
UPD include/generated/timestamp_autogenerated.h
Using /home/lotus/Downloads/ubuntu-rockchip-main/build/u-boot-orangepi-rk3588 as source for U-Boot
CHK include/generated/version_autogenerated.h
/usr/bin/env: ‘python2’: No such file or directory
ls: cannot access 'bl31_0x*.bin': No such file or directory
CHK include/generated/generic-asm-offsets.h
CHK include/generated/asm-offsets.h
HOSTCC tools/mkenvimage.o
HOSTCC tools/fit_image.o
HOSTCC tools/image-host.o
HOSTCC tools/dumpimage.o
HOSTCC tools/mkimage.o
HOSTCC tools/rockchip/boot_merger.o
HOSTCC tools/rockchip/loaderimage.o
HOSTLD tools/mkenvimage
HOSTLD tools/loaderimage
HOSTLD tools/dumpimage
HOSTLD tools/mkimage
/home/lotus/Downloads/ubuntu-rockchip-main/build/u-boot-orangepi-rk3588/tools/rockchip/boot_merger.c: In function ‘mergeBoot’:
/home/lotus/Downloads/ubuntu-rockchip-main/build/u-boot-orangepi-rk3588/tools/rockchip/boot_merger.c:700:43: warning: ‘%s’ directive output may be truncated writing up to 813 bytes into a region of size 5 [-Wformat-truncation=]
700 | snprintf(buffer, sizeof(buffer), "%s", chip);
| ^~
......
742 | chipType = convertChipType(chip + 2);
| ~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:894,
from /home/lotus/Downloads/ubuntu-rockchip-main/build/u-boot-orangepi-rk3588/include/compiler.h:25,
from <command-line>:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:71:10: note: ‘__builtin_snprintf’ output between 1 and 814 bytes into a destination of size 5
71 | return builtin_snprintf_chk (__s, n, USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73 | __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~
/home/lotus/Downloads/ubuntu-rockchip-main/build/u-boot-orangepi-rk3588/tools/rockchip/boot_merger.c: In function ‘main’:
/home/lotus/Downloads/ubuntu-rockchip-main/build/u-boot-orangepi-rk3588/tools/rockchip/boot_merger.c:895:18: warning: array subscript 20 is outside array bounds of ‘char[20]’ [-Warray-bounds]
895 | str[len] = 0;
| ~~~~~~~~~^~~
/home/lotus/Downloads/ubuntu-rockchip-main/build/u-boot-orangepi-rk3588/tools/rockchip/boot_merger.c:933:14: note: while referencing ‘name’
933 | char name[MAX_NAME_LEN];
| ^~~~
HOSTLD tools/boot_merger
CC arch/arm/cpu/armv8/fwcall.o
LD arch/arm/cpu/armv8/built-in.o
CC cmd/version.o
CC common/main.o
LD cmd/built-in.o
LD common/built-in.o
CC drivers/usb/gadget/f_fastboot.o
CC lib/display_options.o
LD lib/built-in.o
LD drivers/usb/gadget/built-in.o
LD u-boot
OBJCOPY u-boot-nodtb.bin
make[4]: 'arch/arm/dts/rk3588s-orangepi-5-sata.dtb' is up to date.
start=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_start | cut -f 1 -d ' '); end=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_end | cut -f 1 -d ' '); tools/relocate-rela u-boot-nodtb.bin 0x00200000 $start $end
COPY u-boot.dtb
MKIMAGE u-boot.itb
sh: 1: dtc: not found
./tools/mkimage: Can't read u-boot.itb.tmp: Invalid argument
make[2]: *** [/home/lotus/Downloads/ubuntu-rockchip-main/build/u-boot-orangepi-rk3588/Makefile:1053: u-boot.itb] Error 255
make[2]: *** Waiting for unfinished jobs....
CC spl/common/spl/spl.o
CC spl/arch/arm/cpu/armv8/fwcall.o
LD spl/arch/arm/cpu/armv8/built-in.o
CC spl/lib/display_options.o
LD spl/common/spl/built-in.o
LD spl/lib/built-in.o
LD spl/u-boot-spl
OBJCOPY spl/u-boot-spl-nodtb.bin
CAT spl/u-boot-spl-dtb.bin
COPY spl/u-boot-spl.bin
make[2]: Leaving directory '/home/lotus/Downloads/ubuntu-rockchip-main/build/u-boot-orangepi-rk3588/debian/build/orangepi_5_sata'
make[1]: *** [Makefile:150: sub-make] Error 2
make[1]: Leaving directory '/home/lotus/Downloads/ubuntu-rockchip-main/build/u-boot-orangepi-rk3588'
make: *** [debian/rules:28: orangepi_5_sata] Error 2
dpkg-buildpackage: error: debian/rules orangepi_5_sata subprocess returned exit status 2
Error: in ./scripts/build-u-boot.sh on line 36
Error: in ./build.sh on line 164
Joshua-Riek commented 9 months ago

You need to install the build dependencies, specifically device-tree-compiler, but below is the entire list.

sudo apt-get install -y build-essential gcc-aarch64-linux-gnu bison \
qemu-user-static qemu-system-arm qemu-efi u-boot-tools binfmt-support \
debootstrap flex libssl-dev bc rsync kmod cpio xz-utils fakeroot parted \
udev dosfstools uuid-runtime git-lfs device-tree-compiler python2 python3 \
python-is-python3 fdisk bc debhelper python3-pyelftools python3-setuptools \
python3-distutils python3-pkg-resources swig libfdt-dev libpython3-dev