1、安装软件包时报错

sudo apt-get install make libc6:i386 lib32z1 lib32stdc++6 zlib1g-dev libncurses5-dev ncurses-term libncursesw5-dev g++ u-boot-tools:i386 texinfo texlive gawk libssl-dev openssl bc

报错:

E:u-boot-tools:i386无法定位软件包

解决:软件和更新 中添加两个源,如图:

deb http://archive.ubuntu.com/ubuntu/ trusty main universe restricted multiverse
deb http://packages.microsoft.com/repos/code stable main

接着更新软件源,如图,提示没有公钥:

根据提示添加公钥,再更新软件源,再安装,如图:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys sudo apt-get updatesudo apt install u-boot-tools:i386

2、创建/etc/ld.so.preload 文件 报错

echo "" > /etc/ld.so.preload

报错:

bash: /etc/ld.so.preload: 权限不够

原因:echo指令属于root用户权限,加个sudo并不能获得root全部权限,只能获得部分
解决:直接使用root用户,具体指令为:

sudo sh -c 'echo "" > /etc/ld.so.preload'

注意:echo整条指令在单引号里面

3、mtd-utils2.0.2 依赖于 automake1.15.1,安装 automake1.15.1报错

sudo apt-get autoremove automake

提示:

Autoconf 2.65 or better is required.

解决:下载Autoconf 2.65或更高版本安装(手动安装):

tar xzf autoconf-2.69.tar.gzcd autoconf-2.69./configure --prefix=/usr/localmakesudo make installexport PATH=/usr/local/bin

又报错:

解决:先安装 M4,再安装autoconf ,然后安装automake

###安装m4wget http://mirrors.kernel.org/gnu/m4/m4-1.4.13.tar.gztar -xzvf m4-1.4.13.tar.gzcd m4-1.4.13./configure --prefix=/usr/localmake sudo make installcd ..###安装autoconfwget http://mirrors.kernel.org/gnu/autoconf/autoconf-2.65.tar.gztar -xzvf autoconf-2.65.tar.gzcd autoconf-2.65./configure --prefix=/usr/localmake sudo make installcd ..###安装automakewget http://mirrors.kernel.org/gnu/automake/automake-1.11.tar.gztar xzvf automake-1.11.tar.gzcd automake-1.11./configure --prefix=/usr/localmake sudo make installcd ..

4、编译SDK 报错

cd osdrvmake OSDRV_CROSS=arm-himix100-linux cleanmake OSDRV_CROSS=arm-himix100-linux all

报错

bison:未找到命令

解决:下载bison — http://ftp.gnu.org/gnu/bison/ 手动安装

###安装bisontar zxvf bison-3.3.1.tar.gz cd bison-3.3.1/./configure --prefix=/usr/localmake sudo make installcd ..

安装 Bison

准备编译 Bison:./configure --prefix=/usr --docdir=/usr/share/doc/bison-3.0.4编译软件包:make用以下命令测试结果(大约 0.5 SBU):make check安装软件包:make install

5、编译SDK报错

fseterr.c:78:3: error #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."

解决:下载gzip-1.10.tar.gz并存放到osdrv/tools/pc/hi_gzip目录中,然后修改名称为gzip-1.10.tgz,最后将Makefile中所有“gzip-1.8”修改为“gzip-1.10”

6、编译SDK报错
示例一:

mksquashfs.c: In function ‘create_inode’:``mksquashfs.c:987:24: error: called object ‘major’ is not a function or function pointer` `987 |  unsigned int major = major(buf->st_rdev);`   `|            ^~~~~``mksquashfs.c:987:16: note: declared here` `987 |  unsigned int major = major(buf->st_rdev);`   `|        ^~~~~``mksquashfs.c:988:24: error: called object ‘minor’ is not a function or function pointer` `988 |  unsigned int minor = minor(buf->st_rdev);`   `|            ^~~~~``mksquashfs.c:988:16: note: declared here` `988 |  unsigned int minor = minor(buf->st_rdev);`   `|        ^~~~~``mksquashfs.c:1011:24: error: called object ‘major’ is not a function or function pointer` `1011 |  unsigned int major = major(buf->st_rdev);`x   `|            ^~~~~``mksquashfs.c:1011:16: note: declared here` `1011 |  unsigned int major = major(buf->st_rdev);`   `|        ^~~~~``mksquashfs.c:1012:24: error: called object ‘minor’ is not a function or function pointer` `1012 |  unsigned int minor = minor(buf->st_rdev);`   `|            ^~~~~``mksquashfs.c:1012:16: note: declared here` `1012 |  unsigned int minor = minor(buf->st_rdev);

解决:
修改: osdrv/tools/pc/squashfs4.3/Makefile
SQUASHFS := squashfs4.3
改为:
SQUASHFS := squashfs4.4
这里就是脚本补丁和readme中有差异的地方,为了解决这个错误,我们使用了squashfs4.4而不是squashfs4.3

示例二:

mksquashfs.c:987:24: error: called object ‘major’ is not a function or function pointer   987 |   unsigned int major = major(buf->st_rdev);

解决:下载 squashfs4.4.tar.gz — https://sourceforge.net/projects/squashfs/files/squashfs/
并存放到 osdrv/tools/pc/squashfs4.3 目录中,然后修改 Makefile 中 “squashfs4.3” 为 “squashfs4.4”

7、编译SDK报错

arm-himix200-linux-gcc: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.

解决:首先 vi ~/.bashrc 然后在最后一行输入:export LC_CTYPE=C.UTF-8

8、编译Uboot报错
报错:

"mkimage" command not found - U-Boot images will not be built

解决办法:

sudo apt-get install u-boot-tools