1、安装交叉编译工具
1.1 cd toolchain/arm-hisiv300-linux/
1.2 tar -xvf arm-hisiv300-linux.tar.bz2
1.3 修改cross.install:使用bash
1.4 sudo ./cross.instal
1.5 执行source /etc/profile, 安装交叉编译器的脚本配置的环境变量就可以生效了
2、osdrv编译
make OSDRV_CROSS=arm-hisiv300-linuxCPU_TYPE=single PCI_MODE=none all
2.1报错
pushd/home/lisa/nvr/Hi3536_SDK_V2.0.4.0/osdrv/opensource/uboot/u-boot-2010.06;makeARCH=arm CROSS_COMPILE=arm-hisiv300-linux- -j 20 >/dev/null;popd
/bin/sh: 1: pushd: not found
make[2]: warning: jobserver unavailable:using -j1. Add `+' to parent make rule.
make[2]: warning: jobserver unavailable:using -j1. Add `+' to parent make rule.
make[2]: warning: jobserver unavailable:using -j1. Add `+' to parent make rule.
make[2]: warning: jobserver unavailable:using -j1. Add `+' to parent make rule.
make[2]: warning: jobserver unavailable:using -j1. Add `+' to parent make rule.
make[2]: warning: jobserver unavailable:using -j1. Add `+' to parent make rule.
chmod: 无法访问"/home/lisa/nvr/Hi3536_SDK_V2.0.4.0/osdrv/pub/bin/board_uclibc_single/*":没有那个文件或目录
make[1]: *** [hirootfs_notools_build] 错误 1
make[1]: *** 正在等待未完成的任务....
make[2]: warning: jobserver unavailable:using -j1. Add `+' to parent make rule.
/bin/sh: 1: popd: not found
make: ***[hiboot] 错误 127
解决方法:http://blog.csdn.net/ojinxi/article/details/12186839
进入/bin目录,查看sh的链接文件,显示如下:表示sh命令链接到的是dash,而pushd命令需要在bash的环境中执行。
解决方法:
执行sudo dpkg-reconfigure dash 命令,将dash设置为No。
root@ubuntu:/home/lisa/nvr/Hi3536_SDK_V2.0.4.0/osdrv#dpkg-reconfigure dash
正在删除 dash 导致 /bin/sh 本地修改至 /bin/sh.distrib
正在添加 bash 导致 /bin/sh 本地修改至 /bin/sh.distrib
正在删除 dash 导致 /usr/share/man/man1/sh.1.gz 本地修改至/usr/share/man/man1/sh.distrib.1.gz
正在添加 bash 导致 /usr/share/man/man1/sh.1.gz 本地修改至/usr/share/man/man1/sh.distrib.1.gz
root@ubuntu:/home/lisa/nvr/Hi3536_SDK_V2.0.4.0/osdrv#
2.2 报错
make[2]: 正在进入目录`/home/lisa/nvr/Hi3536_SDK_V2.0.4.0/osdrv/tools/pc/jffs2_tool/tmp/mtd-utils-1.5.0'
CHK include/version.h
CC compr_zlib.o
compr_zlib.c:39:18: 致命错误: zlib.h:没有那个文件或目录
编译中断。
make[2]: ***[/home/lisa/nvr/Hi3536_SDK_V2.0.4.0/osdrv/tools/pc/jffs2_tool/tmp/mtd-utils-1.5.0/compr_zlib.o]错误 1
make[2]:正在离开目录 `/home/lisa/nvr/Hi3536_SDK_V2.0.4.0/osdrv/tools/pc/jffs2_tool/tmp/mtd-utils-1.5.0'
make[1]: ***[/home/lisa/nvr/Hi3536_SDK_V2.0.4.0/osdrv/tools/pc/jffs2_tool/tmp/sbin/mkfs.jffs2]错误 2
make[1]:正在离开目录 `/home/lisa/nvr/Hi3536_SDK_V2.0.4.0/osdrv/tools/pc/jffs2_tool'
make: ***[hipctools] 错误 2
解决办法:http://blog.sina.com.cn/s/blog_714dacd10102v6et.html
zlib.h,发现是属于zlib的。
去下个zlib。
zlib地址:http://www.zlib.net/
然后
zlib标准安装指导:
zlib library files are placed into/usr/local/lib and zlib header files are placed into /usr/local/include, bydefault.
build static libraries
.../zlib-1.2.1]# ./configure
.../zlib-1.2.1]# make test
.../zlib-1.2.1]# make install
build shared libraries
.../zlib-1.2.1]# make clean
.../zlib-1.2.1]# ./configure --shared
.../zlib-1.2.1]# make test
.../zlib-1.2.1]# make install
.../zlib-1.2.1]# cp zutil.h /usr/local/include
.../zlib-1.2.1]# cp zutil.c/usr/local/include
/usr/local/lib should now contain...
libz.a
libz.so -> libz.so.1.2.1
libz.so.1 -> libz.so.1.2.1
libz.so.1.2.1
/usr/local/include should now contain...
zconf.h
zlib.h
Zutil.h
2.3 编译成功
---------finish osdrv work