Ubuntu 16.04展开海思平台Hi3536的SDK包错误解决

来源:互联网 发布:百度大数据分析工具 编辑:程序博客网 时间:2024/05/18 13:46

最近学习Hi3536的开发平台,首先就遇到了无法展开SDK包的问题,按照官方的方法展开SDK包内容:“运行./sdk.unpack(请用root或sudo权限执行)将会展开SDK包打包压缩存放的内容,请按照提示完成操作。如果您需要通过WINDOWS操作系统中转拷贝SDK包,请先运行./sdk.cleanup,收起SDK包的内容,拷贝到新的目录后再展开。”
总是提示错误信息:
./sdk.unpack: 2: ./sdk.unpack: source: not found
./sdk.unpack: 4: ./sdk.unpack: ECHO: not found
./sdk.unpack: 6: ./sdk.unpack: WARN: not found
。。。。。。
后来查看sdk.unpack脚本原来是bash和dash惹的祸。先看一下他们的介绍(原文网址:http://blog.csdn.net/hemmingway/article/details/49301873):
什么是bash?
Bash(GNU Bourne-Again Shell)是许多Linux平台的内定Shell,事实上,还有许多传统UNIX上用的Shell,像tcsh、csh、ash、bsh、ksh等等,Shell Script大致都类同,当您学会一种Shell以后,其它的Shell会很快就上手,大多数的时候,一个Shell Script通常可以在很多种Shell上使用
什么是dash ?
dash is the standard command interpreter for the system.  The current
version of dash is in the process of being changed to conform with the
POSIX 1003.2 and 1003.2a specifications for the shell.
而sdk.unpack脚本使用的是#!/bin/sh,可以查看一下它指向了哪里?: 
查看与使用
先用命令ls -l /bin/sh 看看
结果是: /bin/sh -> dash
我们会发现Ubuntu默认采用的是 dash
所以会出现上面的错误,如何修改呢?也就是让/bin/sh指向bash
如果要修改默认的sh,可以采用命令
sudo dpkg-reconfigure dash
然后选择【否】
成功后再执行ls -l /bin/sh 看看
结果是: /bin/sh -> bash
修改成功!

接下来运行./sdk.unpack就可以执行成功了。

阅读全文
0 0
原创粉丝点击