编译LinkIt Smart 7688原始固件

(想省时间可以直接看最后的总结) 

由于设备的固件过于古老,官方已经停止更新,设备的官方网站也已经下线,所以我只能按照官方提供的github仓库的说明以及各种issue下面的回答进行摸索。到现在位置,还没成功。

LinkIt Smart 7688可以使用openwrt22.03 (https://github.com/openwrt/openwrt/tree/v22.03.2) 版本固件,我已经尝试成功,按照openwrt官方给的步骤选择设备编译就行。我这里是尝试构建官方给的最初始的openwrt15固件。

LinkIt Smart 7688的官方原厂固件好像已经找不到官方的下载链接了。幸好我当时有备份一份在我的网盘里 https://github.com/cyberfoxmeow/LinkIt_Smart_7688-SeeedDocument/blob/master/firmware.md ,我还顺便fork了一个官方文档仓库 (官方文档仓库是https://github.com/SeeedDocument/LinkIt_Smart_7688.git ,我fork了一份到我自己的github上)。


官方给的feed仓库是:https://github.com/MediaTek-Labs/linkit-smart-7688-feed

首先我是使用官方指向的openwrt15.05仓库 https://git.archive.openwrt.org/15.05/openwrt.git (注意url前面加一个.archive.),但是在编译过程中,发现问题"mt_wifi.ko_3.18.** No such file or directory",例如这个issue:https://github.com/MediaTek-Labs/linkit-smart-7688-feed/issues/17 。应该是官方给的最终的openwrt15.05存档的版本大于设备出场固件所使用的openwrt版本,导致设备供应商所给的mt_wifi的版本过低,不能用于较新的openwrt15.05存档。所以我尝试回滚到设备厂商所使用的openwrt15.05版本。





从启动shell给的信息来看,官方使用的应该是r49203。我复制了一份官方的仓库到我的个人github仓库,然后找到了r49203对应的commit (我的个人仓库https://github.com/cyberfoxmeow/openwrt15.05/tree/r49203



我最开始是使用Ubuntu最新版Ubuntu22进行编译的,发现错误"c-stack.c:55:26: error: missing binary operator before token "(""  (https://bugs.busybox.net/show_bug.cgi?id=13721)。我google了一下,看到有人说,建议用老版本的Ubuntu试试。


然后我尝试使用官方仓库提到的Ubuntu14进行编译构建

首先发现问题svn: E230001: Server SSL certificate verification failed: certificate has expired(https://github.com/MediaTek-Labs/linkit-smart-7688-feed/issues/63)。我的解决方法是:
svn ls https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer-experimental
then press 'p' to make svn ignore cert


然后还有一个问题:“Unable to checkout '9cc90b7976252b2d14b7956230c5870097e1f008' in submodule path 'doxygen2jsdoc'”(https://github.com/MediaTek-Labs/linkit-smart-7688-feed/issues/64)。

 这里https://github.com/MediaTek-Labs/linkit-smart-7688-feed/issues/33#issuecomment-259282736 有人提到,使用Ubuntu16能够构建成功,所以我决定试试Ubuntu16行不行。


------------

试了一下,用Ubuntu16的话,上面的那个svn错误没了,但是还有这个unable to checkout 9cc90b7错误:


找一下错误原因:












mraa0.8.0(https://github.com/eclipse/mraa/tree/v0.8.0)引用的commit值为"9cc90b7976252b2d14b7956230c5870097e1f008" 的doxygen2jsdoc是来自https://github.com/arfoll/doxygen2jsdoc ,但是由于0.8.0版本过于古老,现在的master分支所用到的submodule(https://github.com/eclipse/mraa/blob/master/.gitmodules)是来自https://github.com/intel-iot-devkit的,而在https://github.com/intel-iot-devkit中git找不到9cc90b7这个来自于https://github.com/arfoll的分支。

我的解决办法是:用我自己的github仓库fork一个mraa0.8.0,然后从v0.8.0这个tag直接创建一个分支出来,然后把其他所有的分支删除,把这个新创建的分支设为默认,然后修改 feeds/packages/libs/libmraa/Makefile:把PKG_SOURCE_URL改成我自己fork的仓库。我fork的地址是:https://github.com/cyberfoxmeow/mraa.git 



然后这个问题暂时解决了。。。

还有其他问题:

Cloning into 'odhcpd-2015-11-19'...
fatal: unable to connect to github.com:
github.com[0: 140.82.114.4]: errno=Connection refused



解决方法:package/network/services/odhcpd/Makefile,把PKG_SOURCE_URL的git改成http








最后终于编译构建成功了:









总结

最后总结一下:

使用Ubuntu16,使用openwrt15.05 r49203 (我自己复制到仓库: https://github.com/cyberfoxmeow/openwrt15.05/tree/r49203)

修改两个文件:







后记

我在github上面找到有人上传了固件编译环境的virtualbox虚拟机:https://github.com/pawisoon/LinkitSmart7688Duo ,这个我没用过,有兴趣的话可以参考看看


我自己也打包了我使用的虚拟机镜像,上传到我都个人网盘:ubuntu16_for_openwrt15.05_virtual_environment 


相关issue

https://github.com/MediaTek-Labs/linkit-smart-7688-feed/issues/62

https://github.com/MediaTek-Labs/linkit-smart-7688-feed/issues/48

https://github.com/MediaTek-Labs/linkit-smart-7688-feed/issues/33

https://github.com/MediaTek-Labs/linkit-smart-7688-feed/issues/64

https://github.com/MediaTek-Labs/linkit-smart-7688-feed/issues/63

https://github.com/MediaTek-Labs/linkit-smart-7688-feed/issues/54

https://github.com/MediaTek-Labs/linkit-smart-7688-feed/issues/32

https://github.com/intel-iot-devkit/doxygen2jsdoc/issues/2

https://github.com/MediaTek-Labs/linkit-smart-7688-feed/issues/17

https://github.com/MediaTek-Labs/linkit-smart-7688-feed/issues/25













Comments