1.厂家会提供NT9832x_SDK_release_v1.02.014_ns_uclib.rar,NT9832x_SDK_release_v1.02.014_ns_glib.rar和交叉编译链arm-ca9-linux-gnueabihf-6.5.tar.bz2,arm-ca9-linux-uclibcgnueabihf-6.5.tar.bz2
tar -jxvf NT9832x_SDK_release_v1.02.014_ns_glib.rar
tar -jxvf arm-ca9-linux-gnueabihf-6.5.tar.bz2
2.参考文档NT9832x_SDK_Pure_Linux_Programming_Guide_en.pdf 搭建开发环境
3.source build/envsetup.sh; make clean;lunch 依次选择 1(Linux) 4(根据实际硬件存储配置) 1
3.make all整体全部编译
报错:
--------------------------------------------------
You will probably need to make your busybox binary
setuid root to ensure all configured applets will
work properly.
--------------------------------------------------
make[1]: Leaving directory '/home/simon/NT9832x_SDK/NT9832x_SDK_release_v1.02.014_ns_glib/NT9832x_SDK/software/board/na51068_linux_sdk/BSP/busybox'
busybox: Build finish
applets/usage.c: In function 鈥榤ain鈥
applets/usage.c:52:3: warning: ignoring return value of 鈥榳rite鈥 declared with attribute warn_unused_result [-Wunused-result]
write(STDOUT_FILENO, usage_array[i].usage, strlen(usage_array[i].usage) + 1);
^
applets/applet_tables.c: In function 鈥榤ain鈥
applets/applet_tables.c:161:4: warning: ignoring return value of 鈥榝gets鈥 declared with attribute warn_unused_result [-Wunused-result]
fgets(line_old, sizeof(line_old), fp);
^
applets/usage_pod.c: In function 鈥榤ain鈥
applets/usage_pod.c:74:3: warning: format not a string literal and no format arguments [-Wformat-security]
printf(usage_array[i].aname);
^
cp: preserving times for '/home/simon/NT9832x_SDK/NT9832x_SDK_release_v1.02.014_ns_glib/NT9832x_SDK/software/board/na51068_linux_sdk/BSP/root-fs/rootfs/bin/busybox': Operation not permitted
cp: preserving times for '/home/simon/NT9832x_SDK/NT9832x_SDK_release_v1.02.014_ns_glib/NT9832x_SDK/software/board/na51068_linux_sdk/BSP/root-fs/rootfs/bin': Operation not permitted
cp: preserving times for '/home/simon/NT9832x_SDK/NT9832x_SDK_release_v1.02.014_ns_glib/NT9832x_SDK/software/board/na51068_linux_sdk/BSP/root-fs/rootfs/sbin': Operation not permitted
cp: preserving times for '/home/simon/NT9832x_SDK/NT9832x_SDK_release_v1.02.014_ns_glib/NT9832x_SDK/software/board/na51068_linux_sdk/BSP/root-fs/rootfs/usr/bin': Operation not permitted
cp: preserving times for '/home/simon/NT9832x_SDK/NT9832x_SDK_release_v1.02.014_ns_glib/NT9832x_SDK/software/board/na51068_linux_sdk/BSP/root-fs/rootfs/usr/sbin': Operation not permitted
cp: preserving times for '/home/simon/NT9832x_SDK/NT9832x_SDK_release_v1.02.014_ns_glib/NT9832x_SDK/software/board/na51068_linux_sdk/BSP/root-fs/rootfs/usr': Operation not permitted
Makefile:389: recipe for target 'busybox' failed
make: *** [busybox] Error 1
解决方法:切换到root用户再次编译,
再次报错:
applets/usage.c:52:3: warning: ignoring return value of 鈥榳rite鈥 declared with attribute warn_unused_result [-Wunused-result]
write(STDOUT_FILENO, usage_array[i].usage, strlen(usage_array[i].usage) + 1);
^
applets/applet_tables.c: In function 鈥榤ain鈥
applets/applet_tables.c:161:4: warning: ignoring return value of 鈥榝gets鈥 declared with attribute warn_unused_result [-Wunused-result]
fgets(line_old, sizeof(line_old), fp);
^
GEN include/usage_compressed.h
GEN include/applet_tables.h
HOSTCC applets/usage_pod
applets/usage_pod.c: In function 鈥榤ain鈥
applets/usage_pod.c:74:3: warning: format not a string literal and no format arguments [-Wformat-security]
printf(usage_array[i].aname);
^
CC applets/applets.o
/opt/arm-ca9-linux-gnueabihf-6.5/bin/../libexec/gcc/arm-ca9-linux-gnueabihf/6.5.0/cc1: error while loading shared libraries: libmpfr.so.6: cannot open shared object file: No such file or directory
scripts/Makefile.build:197: recipe for target 'applets/applets.o' failed
make[2]: *** [applets/applets.o] Error 1
make[2]: *** Waiting for unfinished jobs....
Makefile:372: recipe for target 'applets_dir' failed
make[1]: Leaving directory '/home/simon/NT9832x_SDK/NT9832x_SDK_release_v1.02.014_ns_glib/NT9832x_SDK/software/board/na51068_linux_sdk/BSP/busybox'
make[1]: *** [applets_dir] Error 2
busybox: Build finish
/opt/arm-ca9-linux-gnueabihf-6.5/bin/../libexec/gcc/arm-ca9-linux-gnueabihf/6.5.0/cc1: error while loading shared libraries: libmpfr.so.6: cannot open shared object file: No such file or directory
/opt/arm-ca9-linux-gnueabihf-6.5/bin/../libexec/gcc/arm-ca9-linux-gnueabihf/6.5.0/cc1: error while loading shared libraries: libmpfr.so.6: cannot open shared object file: No such file or directory
applets/usage.c: In function 鈥榤ain鈥
applets/usage.c:52:3: warning: ignoring return value of 鈥榳rite鈥 declared with attribute warn_unused_result [-Wunused-result]
write(STDOUT_FILENO, usage_array[i].usage, strlen(usage_array[i].usage) + 1);
^
applets/applet_tables.c: In function 鈥榤ain鈥
applets/applet_tables.c:161:4: warning: ignoring return value of 鈥榝gets鈥 declared with attribute warn_unused_result [-Wunused-result]
fgets(line_old, sizeof(line_old), fp);
^
applets/usage_pod.c: In function 鈥榤ain鈥
applets/usage_pod.c:74:3: warning: format not a string literal and no format arguments [-Wformat-security]
printf(usage_array[i].aname);
^
/opt/arm-ca9-linux-gnueabihf-6.5/bin/../libexec/gcc/arm-ca9-linux-gnueabihf/6.5.0/cc1: error while loading shared libraries: libmpfr.so.6: cannot open shared object file: No such file or directory
make[2]: *** [applets/applets.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [applets_dir] Error 2
Makefile:389: recipe for target 'busybox' failed
make: *** [busybox] Error 2
解决方法:重新source build/envsetup.sh;lunch 1 4 1 ,make all
编译完成;
To do rootfs/etc/profile_prjcfg is generating .....
NVT_ROOTFS_TYPE_RAMDISK.....
9419 blocks
Image Name: NVT initramfs
Created: Sat Feb 20 10:34:38 2021
Image Type: ARM Linux RAMDisk Image (uncompressed)
Data Size: 3052889 Bytes = 2981.34 kB = 2.91 MB
Load Address: 0x00000000
Entry Point: 0x00000000
leb verify ok, leb:260 on rootfs1 partition size: 0x2500000
make[1]: Leaving directory '/home/simon/NT9832x_SDK/NT9832x_SDK_release_v1.02.014_ns_glib/NT9832x_SDK/software/board/na51068_linux_sdk/BSP/root-fs'
rootfs: Build finish
9419 blocks
rootfs: Build start
make[1]: Entering directory '/home/simon/NT9832x_SDK/NT9832x_SDK_release_v1.02.014_ns_glib/NT9832x_SDK/software/board/na51068_linux_sdk/BSP/root-fs'
Rootfs are installing.....
make[1]: Leaving directory '/home/simon/NT9832x_SDK/NT9832x_SDK_release_v1.02.014_ns_glib/NT9832x_SDK/software/board/na51068_linux_sdk/BSP/root-fs'
rootfs: Build finish
9419 blocks
nvt pack config generation...
nvtpack Aug 6 2020 09:58:10
nvt pack image is generated...
nvtpack Aug 6 2020 09:58:10
all-in-one path: packed/FW98321A.bin
Preparing partition[1] Path: nvt-na51068-evb.bin
Preparing partition[3] Path: u-boot.bin
Preparing partition[5] Path: uImage.bin
Preparing partition[6] Path: rootfs.ramdisk.bin
Preparing partition[7] Path: rootfs_1.rw.ubifs.bin
Preparing partition[8] Path: NVR_4CH.nand.ubifs.bin
Writing all-in-one: packed/FW98321A.bin
Finish.
Finish generating images at 鍏 20 2鏈2021 10:34:39 +0800