1. 文件解压
[xt@xt-QiTianM450-N000:~/Desktop/firefly/Linux_SDK]$ md5sum rk3308_linux_release_v1.5.0a_20221212_split_dir/*firefly_split*
[xt@xt-QiTianM450-N000:~/Desktop/firefly/Linux_SDK]$ mkdir ~/Desktop/proj/
[xt@xt-QiTianM450-N000:~/Desktop/firefly/Linux_SDK]$ cd ~/Desktop/proj/
[xt@xt-QiTianM450-N000:~/Desktop/proj]$ cat /home/xt/Desktop/firefly/Linux_SDK/rk3308_linux_release_v1.5.0a_20221212_split_dir/*firefly_split* | tar -xzv
[xt@xt-QiTianM450-N000:~/Desktop/proj]$ cd rk3308_linux_release_v1.5.0a_20221212
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ .repo/repo/repo sync -l
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ .repo/repo/repo sync -c --no-tags
warning: project 'repo' branch 'stable' is not signed
warning: Skipped upgrade to unverified version
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ .repo/repo/repo start firefly --all
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ sudo ./build.sh roc-rk3308b-cc-plus-ubuntu.mk
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ export RK_ARCH=arm64
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ export RK_UBOOT_DEFCONFIG=firefly-rk3308-debug-uart4
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ export RK_KERNEL_DEFCONFIG=firefly-rk3308b_linux_defconfig
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ export RK_KERNEL_DTS=rk3308b-roc-cc-plus-amic_emmc
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ export RK_PARAMETER=parameter-64bit-ubuntu.txt
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ export RK_ROOTFS_IMG=ubuntu_rootfs/rk3308-ubuntu_rootfs.img
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/ubuntu18.04]$ mv ihc3308gw-ubuntu18.04-minimal-rootfs-20220523.img /home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/ubuntu_rootfs/rk3308-ubuntu_rootfs.img
2. SDK__分开编译
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ ./build.sh kernel
ERROR: exit code 1 from line 730:
ln -sf $TOP_DIR/kernel/$RK_BOOT_IMG $TOP_DIR/rockdev/boot.img
(1)ERROR: 软链接时权限不够
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ sudo chmod 777 rockdev
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ ./build.sh kernel
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ ./build.sh recovery
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ ./mkfirmware.sh
Linking rootfs.img from /home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/rootfs/rk3308-ubuntu_rootfs.img...
warning: /home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/rootfs/rk3308-ubuntu_rootfs.img not found!
stat: 无法获取'/home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/rootfs/rk3308-ubuntu_rootfs.img' 的文件状态(stat): 没有那个文件或目录
./mkfirmware.sh: 行 98: / 1024 :语法错误: 需要操作数 (错误符号是 "/ 1024 ")
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/rockdev]$ ll
总用量 14404
drwxrwxrwx 3 root root 4096 2月 9 12:06 ./ 直接给root权限做
drwxrwxr-x 16 xt xt 4096 2月 9 11:58 ../
lrwxrwxrwx 1 xt xt 19 2月 9 12:06 boot.img -> ../kernel/zboot.img
lrwxrwxrwx 1 xt xt 37 2月 9 12:06 MiniLoaderAll.bin -> ../u-boot/rk3308_loader_v2.06.133.bin
lrwxrwxrwx 1 xt xt 44 2月 9 12:06 misc.img -> ../device/rockchip/rockimg/wipe_all-misc.img*
drwxr-xr-x 2 root root 4096 2月 9 11:53 pack/
lrwxrwxrwx 1 xt xt 52 2月 9 12:06 parameter.txt -> ../device/rockchip/rk3308/parameter-64bit-ubuntu.txt
-rw-rw-r-- 1 xt xt 14737408 2月 9 12:05 recovery.img
--> 这一行有问题lrwxrwxrwx 1 xt xt 34 2月 9 12:06 rootfs.img -> ../rootfs/rk3308-ubuntu_rootfs.img
lrwxrwxrwx 1 xt xt 19 2月 9 12:06 trust.img -> ../u-boot/trust.img
lrwxrwxrwx 1 xt xt 19 2月 9 12:06 uboot.img -> ../u-boot/uboot.img
解决方案
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ mv ubuntu_rootfs rootfs
(2)ERROR: mv权限不够
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ ./build.sh updateimg
mv: cannot move '/home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/rockdev/update.img' to '/home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/rockdev/pack/ROC-RK3308B-CC-PLUS_Rk3308_v1.5.0a_230209.img': Permission denied
ERROR: Running build_updateimg failed!
ERROR: exit code 1 from line 1649:
mv $IMAGE_PATH/update.img $IMAGE_PATH/pack/$IMGNAME
解决方案
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ sudo ./build.sh updateimg
3. buildroot__分开编译
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ ./build.sh roc-rk3308b-cc-plus-buildroot.mk
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ export RK_ARCH=arm64
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ export RK_UBOOT_DEFCONFIG=firefly-rk3308-debug-uart4
[xt@xt-QiTianM450-N000:~/Des[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ ./build.sh buildroot
ktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ export RK_KERNEL_DEFCONFIG=firefly-rk3308b_linux_defconfig
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ export RK_KERNEL_DTS=rk3308b-roc-cc-plus-amic_emmc
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ export RK_CFG_BUILDROOT=firefly_rk3308_release
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ export RK_CFG_RECOVERY=firefly_rk3308_recovery
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ export RK_PARAMETER=parameter-64bit-emmc.txt
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ export RK_ROOTFS_IMG=rockdev/rootfs.${RK_ROOTFS_TYPE}
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ ./build.sh uboot
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ ./build.sh kernel
(1)ERROR: ?(未解决)
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ ./build.sh recovery
2023-02-09T12:14:36 >>> host-m4 1.4.18 Building
Done in 1min 31s (error code: 2)
Command exited with non-zero status 2
you take 1:32.29 to build recovery
ERROR: Running build_recovery failed!
ERROR: exit code 2 from line 1080:
/usr/bin/time -f "you take %E to build recovery" $COMMON_DIR/mk-ramdisk.sh recovery.img $RK_CFG_RECOVERY
解决方案
code 2 (ENOENT):No such file or directory文章来源地址https://www.toymoban.com/news/detail-707373.html
(2)ERROR: Please port gnulib freadahead.c to your platform!
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ ./build.sh buildroot
2023-02-09T12:21:47 freadahead.c: In function 'freadahead':
2023-02-09T12:21:47 freadahead.c:92:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
2023-02-09T12:21:47 92 | #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
2023-02-09T12:21:47 | ^~~~~
2023-02-09T12:21:47 make[5]: *** [Makefile:1915: freadahead.o] Error 1
2023-02-09T12:21:47 make[5]: *** Waiting for unfinished jobs....
2023-02-09T12:21:47 CC printf-args.o
2023-02-09T12:21:47 fseeko.c: In function 'rpl_fseeko':
2023-02-09T12:21:47 fseeko.c:110:4: error: #error "Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib."
2023-02-09T12:21:47 110 | #error "Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib."
2023-02-09T12:21:47 | ^~~~~
2023-02-09T12:21:47 make[5]: *** [Makefile:1915: fseeko.o] Error 1
2023-02-09T12:21:47 make[4]: *** [Makefile:1674: all] Error 2
2023-02-09T12:21:47 make[3]: *** [Makefile:1572: all-recursive] Error 1
2023-02-09T12:21:47 make[2]: *** [Makefile:1528: all] Error 2
2023-02-09T12:21:47 make[1]: *** [package/pkg-generic.mk:250: /home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/buildroot/output/firefly_rk3308_release/build/host-m4-1.4.18/.stamp_built] Error 2
2023-02-09T12:21:47 make: *** [/home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/buildroot/output/firefly_rk3308_release/Makefile:16: _all] Error 2
Command exited with non-zero status 1
you take 1:23.57 to build builroot
ERROR: Running build_buildroot failed!
ERROR: exit code 1 from line 888:
/usr/bin/time -f "you take %E to build builroot" $COMMON_DIR/mk-buildroot.sh $BOARD_CONFIG
解决方案
在该目录下使用命令行:/home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/buildroot/output/firefly_rk3308_release/build/host-m4-1.4.18/
sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ cd /home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/buildroot/output/firefly_rk3308_release/build/host-m4-1.4.18/
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/buildroot/output/firefly_rk3308_release/build/host-m4-1.4.18]$ sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/buildroot/output/firefly_rk3308_release/build/host-m4-1.4.18]$ echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h
(3)ERROR: Please port gnulib fseterr.c
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ ./build.sh buildroot
2023-02-09T12:53:17 77 | #error "Please port gnulib fseterr.c to your platform! Look at the definitions of ferror and clearerr on your system, then report this to bug-gnulib."
2023-02-09T12:53:17 | ^~~~~
2023-02-09T12:53:17 CC lib/isnanl.o
2023-02-09T12:53:17 make[4]: *** [Makefile:3466: lib/fseterr.o] Error 1
2023-02-09T12:53:17 make[4]: *** Waiting for unfinished jobs....
2023-02-09T12:53:17 CC lib/obstack.o
2023-02-09T12:53:17 make[3]: *** [Makefile:4522: all-recursive] Error 1
2023-02-09T12:53:17 make[2]: *** [Makefile:2625: all] Error 2
2023-02-09T12:53:17 make[1]: *** [package/pkg-generic.mk:250: /home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/buildroot/output/firefly_rk3308_release/build/host-bison-3.0.4/.stamp_built] Error 2
2023-02-09T12:53:17 make: *** [/home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/buildroot/output/firefly_rk3308_release/Makefile:16: _all] Error 2
Command exited with non-zero status 1
you take 27:17.56 to build builroot
ERROR: Running build_buildroot failed!
解决方案
在该目录下使用命令行:/home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/buildroot/output/firefly_rk3308_release/build/host-bison-3.0.4
sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ cd /home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/buildroot/output/firefly_rk3308_release/build/host-bison-3.0.4
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/buildroot/output/firefly_rk3308_release/build/host-bison-3.0.4]$ sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/buildroot/output/firefly_rk3308_release/build/host-bison-3.0.4]$ echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h
(4)ERROR: error: ‘%s’ directive argument is null
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ ./build.sh buildroot
2023-02-09T13:39:30 gdbusauth.c:1305:11: error: '%s' directive argument is null [-Werror=format-overflow=]
2023-02-09T13:39:30 1305 | debug_print ("SERVER: WaitingForBegin, read '%s'", line);
2023-02-09T13:39:30 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-02-09T13:39:30 gdbusmessage.c:2700:30: error: '%s' directive argument is null [-Werror=format-overflow=]
2023-02-09T13:39:30 2700 | tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
2023-02-09T13:39:30 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
解决方案
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ sudo find / -name gdbusauth.c
[sudo] xt 的密码:
/home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/buildroot/output/firefly_rk3308_release/build/host-libglib2-2.54.2/gio/gdbusauth.c
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ vim /home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/buildroot/output/firefly_rk3308_release/build/host-libglib2-2.54.2/gio/gdbusauth.c
if (line != NULL)
debug_print ("SERVER: WaitingForBegin, read '%s'", line);
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ sudo find / -name gdbusmessage.c
/home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/buildroot/output/firefly_rk3308_release/build/host-libglib2-2.54.2/gio/gdbusmessage.c
if(signature_str != NULL)
tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
(5)ERROR: undefined reference to `major’
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ ./build.sh buildroot
2023-02-09T14:14:29 /usr/bin/ld: /home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/buildroot/output/firefly_rk3308_release/build/host-vboot-utils-bbdd62f9b030db7ad8eef789aaf58a7ff9a25656/build/cgpt/cgpt_wrapper.o: in function `main':
2023-02-09T14:14:29 cgpt_wrapper.c:(.text.startup+0x199): undefined reference to `major'
2023-02-09T14:14:29 collect2: error: ld returned 1 exit status
解决方案
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ sudo find / -name cgpt_wrapper.c
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ vim /home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/buildroot/output/firefly_rk3308_release/build/host-vboot-utils-bbdd62f9b030db7ad8eef789aaf58a7ff9a25656/cgpt/cgpt_wrapper.c
增加#include <sys/sysmacros.h>
(6)ERROR: object ‘major’ is not a function or function pointer
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ ./build.sh buildroot
23-02-09T14:20:38 mksquashfs.c:991:24: error: called object 'major' is not a function or function pointer
2023-02-09T14:20:38 991 | unsigned int major = major(buf->st_rdev);
2023-02-09T14:20:38 | ^~~~~
2023-02-09T14:20:38 mksquashfs.c:991:16: note: declared here
2023-02-09T14:20:38 991 | unsigned int major = major(buf->st_rdev);
2023-02-09T14:20:38 | ^~~~~
2023-02-09T14:20:38 mksquashfs.c:992:24: error: called object 'minor' is not a function or function pointer
2023-02-09T14:20:38 992 | unsigned int minor = minor(buf->st_rdev);
2023-02-09T14:20:38 | ^~~~~
2023-02-09T14:20:38 mksquashfs.c:992:16: note: declared here
2023-02-09T14:20:38 992 | unsigned int minor = minor(buf->st_rdev);
2023-02-09T14:20:38 | ^~~~~
2023-02-09T14:20:38 mksquashfs.c:1015:24: error: called object 'major' is not a function or function pointer
2023-02-09T14:20:38 1015 | unsigned int major = major(buf->st_rdev);
2023-02-09T14:20:38 | ^~~~~
2023-02-09T14:20:38 mksquashfs.c:1015:16: note: declared here
2023-02-09T14:20:38 1015 | unsigned int major = major(buf->st_rdev);
2023-02-09T14:20:38 | ^~~~~
2023-02-09T14:20:38 mksquashfs.c:1016:24: error: called object 'minor' is not a function or function pointer
2023-02-09T14:20:38 1016 | unsigned int minor = minor(buf->st_rdev);
2023-02-09T14:20:38 | ^~~~~
2023-02-09T14:20:38 mksquashfs.c:1016:16: note: declared here
2023-02-09T14:20:38 1016 | unsigned int minor = minor(buf->st_rdev);
2023-02-09T14:20:38 | ^~~~~
解决方案
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ sudo find / -name mksquashfs.c
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ vim /home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/buildroot/output/firefly_rk3308_release/build/host-squashfs-3de1687d7432ea9b302c2db9521996f506c140a3/squashfs-tools/mksquashfs.c
增加#include <sys/sysmacros.h>
(7)ERROR: undefined reference to `makedev’
2023-02-09T14:22:32 unsquashfs.c:(.text+0x1f45): undefined reference to `makedev'
2023-02-09T14:22:32 collect2: error: ld returned 1 exit status
解决方案
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ sudo find / -name unsquashfs.c
/home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/buildroot/output/firefly_rk3308_release/build/host-squashfs-3de1687d7432ea9b302c2db9521996f506c140a3/squashfs-tools/unsquashfs.c
[xt@xt-QiTianM450-N000:~/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212]$ vim /home/xt/Desktop/proj/rk3308_linux_release_v1.5.0a_20221212/buildroot/output/firefly_rk3308_release/build/host-squashfs-3de1687d7432ea9b302c2db9521996f506c140a3/squashfs-tools/unsquashfs.c
增加#include <sys/sysmacros.h>
文章来源:https://www.toymoban.com/news/detail-707373.html
到了这里,关于rk3308b-cc-plus编译过程、遇到的所有问题及解决方案的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!