专栏首页程序手艺人[ 物联网篇 ] 14 - 联发科MTK8516 Yocto技巧

[ 物联网篇 ] 14 - 联发科MTK8516 Yocto技巧

MTK8516 提供的SDK通过Yocto来进行构建, 由于Yocto入门门槛较高,刚开始也才过不少坑,这里记录下.

Yocto中相关.bb文件中如何添加打印

在recipes中加入打印信息,有两种方式

  1. 第一是Python形式,该形式可在console上打印出来: bb.plain, bb.note, bb.warn, bb.error, bb.fatal, bb.debug
  2. 另一种是bash形式,该形式会在temp目录下的log中包含,需要inherit logging(base.bbclass会包含,通常不需要特意添加): bbplain, bbnote, bbwarn, bberror, bbfatal, bbdebug

直接一点通过第一种方式添加打印, 如:

bbplain "#### debug D path : :\n${D}"
/build/tmp/work/aarch64-poky-linux/avs-demo/1.0-r0/image

其他一些相关变量的含义

//${S}指出source code存放的位置
S:
build/tmp/work/aarch64-poky-linux/avs-demo/1.0-r0/git

//{D}指存放编译后生成binary的地址
D:
/build/tmp/work/aarch64-poky-linux/avs-demo/1.0-r0/image

//${bindir}指文件系统的 /usr/bin

 SB:
/build/tmp/work/aarch64-poky-linux/avs-demo/1.0-r0/build

 STAGING_LIBDIR:
/build/tmp/work/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/avs-demo/1.0-r0/recipe-sysroot/

 WORKDIR:
 64bit对应的目录
/build/tmp/work/aarch64-poky-linux/avs-demo/1.0-r0
32bit 对应的目录
/build/tmp/work/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/avs-demo/1.0-r0

install -d 指建立一个folder
install -m 指把文件收集到指定目录下,并修改权限

主要参考Yocto 一些细节

Yocto 打包rootfs报错
#### 打包rootfs报错

NOTE: scatter: compiling from external source tree /mtk8516/build/../src/bsp/scatter
NOTE: lib64-lk: compiling from external source tree/mtk8516/build/../src/bsp/lk
ERROR: mtk-image-aud-8516-1.0-r0 do_rootfs: Could not invoke dnf. Command '/mtk8516/build/tmp/work/aud8516p1v2_consys_slc-poky-linux-gnueabi/mtk-image-aud-8516/1.0-r0/recipe-sysroot-native/usr/bin/dnf -y -c mtk8516/build/tmp/work/aud8516p1v2_consys_slc-poky-linux-gnueabi/mtk-image-aud-8516/1.0-r0/rootfs/etc/dnf/dnf.conf --setopt=reposdir=mtk8516/build/tmp/work/aud8516p1v2_consys_slc-poky-linux-gnueabi/mtk-image-aud-8516/1.0-r0/rootfs/etc/yum.repos.d --repofrompath=oe-repo,mtk8516/build/tmp/work/aud8516p1v2_consys_slc-poky-linux-gnueabi/mtk-image-aud-8516/1.0-r0/oe-rootfs-repo --installroot=mtk8516/build/tmp/work/aud8516p1v2_consys_slc-poky-linux-gnueabi/mtk-image-aud-8516/1.0-r0/rootfs --setopt=logdir=mtk8516/build/tmp/work/aud8516p1v2_consys_slc-poky-linux-gnueabi/mtk-image-aud-8516/1.0-r0/temp --nogpgcheck install shadow avs-demo run-postinsts android-tools-adbd base-passwd tzapp iperf3 utf-gbk bluetooth-vendor mtkwlan packagegroup-mtk-upgrade-kit-native wpa-supplicant-passphrase wpa-supplicant mtk-audio-service dhcp-server-config upgrade_app dhcpcd dibbler custom glibc-gconv-gbk appmainprog glibc-gconv-libgb libasound thermal-manager nvram wlanmon wireless-tools ppc mtd-utils ipcd mtkcombotool wifi-mw coreutils libfuse2 bluetooth mtk-alsa-plugins sntp mtd-utils-ubifs openssl data-ubi-mnt assistantcenter prog glibc-gconv-gbgbk libnvramcustom glibc-gconv-gb18030 hostapd wpa-ctrl ppccli alsa-utils mtkwifitesttool app-prebuilt curl libcjson1 iptables tcpdump ntpdate mdnsresponder packagegroup-core-boot-aud mtkcombo glibc-gconv-euc-cn smtcn-mw smartaudioplayer ntp buildinfo' returned 1:
Added oe-repo repo from mtk8516/build/tmp/work/aud8516p1v2_consys_slc-poky-linux-gnueabi/mtk-image-aud-8516/1.0-r0/oe-rootfs-repo
Last metadata expiration check: 0:00:00 ago on Sat 14 Dec 2019 05:43:29 AM UTC.
Error: 
 Problem: conflicting requests
  - nothing provides liburiparser.so needed by avs-demo-1.0-r0.cortexa7hf_neon_vfpv4

ERROR: mtk-image-aud-8516-1.0-r0 do_rootfs: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /mtk8516/build/tmp/work/aud8516p1v2_consys_slc-poky-linux-gnueabi/mtk-image-aud-8516/1.0-r0/temp/log.do_rootfs.181418
ERROR: Task (meta/poky/../meta-mediatek-mt8516/recipes-audio/images/mtk-image-aud-8516.bb:do_rootfs) failed with exit code '1'

这个打印看的一头雾水,完全不知道从哪里下手,有点大海捞针的感觉,整整排查了一天,才有方向, 最终比较坑的问题是, 根本不是rootfs打包的问题, 而是其中一个.bb 文件写错导致的, 比如源码是app_demo , 而app-demo.bb 这种类型的错误导致的.

Yocto demo install 报错
WARNING: avs-demo-1.0-r0 do_package: avs-sdk-1.0 was registered as shlib provider for libAudioPlayer.so, changing it to avs-demo-1.0 because it was built later
WARNING: avs-demo-1.0-r0 do_package: avs-sdk-1.0 was registered as shlib provider for libAlerts.so, changing it to avs-demo-1.0 because it was built later
WARNING: avs-demo-1.0-r0 do_package: avs-sdk-1.0 was registered as shlib provider for libEqualizer.so, changing it to avs-demo-1.0 because it was built later
WARNING: avs-demo-1.0-r0 do_package: avs-sdk-1.0 was registered as shlib provider for libSettings.so, changing it to avs-demo-1.0 because it was built later
WARNING: avs-demo-1.0-r0 do_package: avs-sdk-1.0 was registered as shlib provider for libBluetooth.so, changing it to avs-demo-1.0 because it was built later
WARNING: avs-demo-1.0-r0 do_package: avs-sdk-1.0 was registered as shlib provider for libDoNotDisturbCA.so, changing it to avs-demo-1.0 because it was built later
WARNING: avs-demo-1.0-r0 do_package: avs-sdk-1.0 was registered as shlib provider for libPlaybackController.so, changing it to avs-demo-1.0 because it was built later
WARNING: avs-demo-1.0-r0 do_package: avs-sdk-1.0 was registered as shlib provider for libAVSSystem.so, changing it to avs-demo-1.0 because it was built later
WARNING: avs-demo-1.0-r0 do_package: avs-sdk-1.0 was registered as shlib provider for libInteractionModel.so, changing it to avs-demo-1.0 because it was built later
WARNING: avs-demo-1.0-r0 do_package: avs-sdk-1.0 was registered as shlib provider for libAIP.so, changing it to avs-demo-1.0 because it was built later
WARNING: avs-demo-1.0-r0 do_package: avs-sdk-1.0 was registered as shlib provider for libTemplateRuntime.so, changing it to avs-demo-1.0 because it was built later
WARNING: avs-demo-1.0-r0 do_package: avs-sdk-1.0 was registered as shlib provider for libNotifications.so, changing it to avs-demo-1.0 because it was built later
WARNING: avs-demo-1.0-r0 do_package: avs-sdk-1.0 was registered as shlib provider for libExternalMediaPlayer.so, changing it to avs-demo-1.0 because it was built later
WARNING: avs-demo-1.0-r0 do_package: avs-sdk-1.0 was registered as shlib provider for libESP.so, changing it to avs-demo-1.0 because it was built later
WARNING: avs-demo-1.0-r0 do_package: avs-sdk-1.0 was registered as shlib provider for libADSL.so, changing it to avs-demo-1.0 because it was built later
WARNING: avs-demo-1.0-r0 do_package: avs-sdk-1.0 was registered as shlib provider for libSpeechEncoder.so, changing it to avs-demo-1.0 because it was built later
WARNING: avs-demo-1.0-r0 do_package: avs-sdk-1.0 was registered as shlib provider for libContextManager.so, changing it to avs-demo-1.0 because it was built later
ERROR: avs-demo-1.0-r0 do_package: Fatal QA errors found, failing task.
ERROR: avs-demo-1.0-r0 do_package: Function failed: do_package
ERROR: Logfile of failure stored in:/mtk8516/build/tmp/work/aarch64-poky-linux/avs-demo/1.0-r0/temp/log.do_package.86147
ERROR: Task (/mtk8516/meta/poky/../meta-mediatek-mt8516/recipes-apps/avs-demo/avs-demo.bb:do_package) failed with exit code '1'

参考yocto-qa-issue解决

添加如下到demo.bb解决

INSANE_SKIP_${PN} = "ldflags"
INSANE_SKIP_${PN}-dev = "ldflags"
FILES_${PN}-dev = "${includedir}"
Yocto LICENSE_FLAGS_WHITELIST问题
  1. LICENSE_FLAGS_WHITELIST=“commercial(商业的)” 参考见 Yocto tips (17): Yocto License问题:restricted license not whitelisted in LICENSE_FLAGS_WHITELIST
ERROR: Nothing PROVIDES 'gstreamer1.0-plugins-ugly' (but/mtk8516/meta/poky/../meta-mediatek-mt8516/recipes-apps/avs-sdk/avs-sdk.bb DEPENDS on or otherwise requires it)
gstreamer1.0-plugins-ugly was skipped: because it has a restricted license not whitelisted in LICENSE_FLAGS_WHITELIST

解决办法:

因此如果我们需要添加一些commercial Lincense的软件包,就需要添加对commercial的支持,只需要在local.conf中添加一行即可:LICENSE_FLAGS_WHITELIST=“commercial”

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • [ 物联网篇 ] 12 - 联发科MTK8516 开发环境搭建

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

    程序手艺人
  • 面向物联网的几大开源操作系统

    在过去的十年间,大多数新型开源操作系统已从移动市场转向物联网市场。本文介绍了面向物联网的许多新型开源操作系统。我们之前的文章介绍了开源物联网框架,以及面向物...

    小小科
  • IoT固/软件更新及开源选项

    物联网的迅速发展涌现了数十亿与互联网连接的无线嵌入式设备。 从医疗设备到坦克传感器, 智能恒温器, 智能路灯, 水监视器等等, 物联网比以往任何时候都应用广泛。

    半吊子全栈工匠
  • 了解物联网生态系统

    用户1737318
  • IoT中的Linux选择

    在物联网的设备设计中,从低成本和低功耗的角度看,Android肯定比不过嵌入式Linux。但在选择用于部署Linux的发行版本时,却一直饱受困扰。

    半吊子全栈工匠
  • 构建嵌入式 Linux 系统的4种有效工具

    Linux 被部署到比 Linus Torvalds 在他的宿舍里开发时所预期的更广泛的设备。令人震惊的支持了各种芯片,使得Linux 可以应用于大大小小的设备...

    全栈程序员站长
  • 使用Buildroot为I.MX6制作根文件系统

    接触Freescale/NXP的I.MX6处理器大概有了两年多的时间,对于一个最初玩MCU的我来说,真是面临了很多的挑战。最让我感到郁闷和崩溃的是那个官方的基于...

    用户2366192
  • 行业边缘丨中国电科发布“海雀”处理器;中科海微获千万融资;联想发布边缘服务器;风河加入CNCF云原生计算基金会成为银牌会员;

    「行业边缘」会由多篇边缘计算相关新闻构成,每一篇不长,但都是精挑细选的,是其他媒体没有报道过,或者未被正确报道过,而我们认为对读者有价值、有意义的新闻。

    边缘计算
  • 香蕉派BPI-F2S工业级开发板, 支持PoE,一路RS232,一路RS584接口

    香蕉派 BPI-F2P 是采用[https://www.sunplus.com/ '''Sunplus'''] 工业级芯片方案设计, 是完全按照工业级应用标准设...

    Banana Pi 开源硬件
  • 用于物联网设备的Linux发行版

    11.06.18-Lunix-Distributions-1068x656-1.jpg

    用户4122690
  • 日韩三巨头联手推出 AI 语音助手平台;蓝牙、WiFi 版树莓派发布 | 开发者头条

    树莓派也有蓝牙和 Wifi 啦! 日韩三巨头联手,推出 AI 语音助手 Clova 微软发布 Azure Stack 第三技术预览版本 每日推荐阅读 14 ...

    AI研习社
  • 看雪2018安全开发者峰会,议题干货、安全大咖、头脑风暴!

    2018年7月21日,拥有18年悠久历史的老牌安全技术社区——看雪学院联手国内最大开发者社区CSDN,倾力打造一场技术干货的饕餮盛宴——2018 安全开发者峰会...

    华章科技
  • 95后“石墨烯驾驭者”王者归来!一天内喜提两篇Nature!

    5月7日,被誉为“天才少年”、“石墨烯驾驭者”的95后博士曹原分别以第一作者兼共同通讯作者、以及共同第一作者的身份,在Nature上连发2篇论文。这也是在继20...

    百味科研芝士
  • 关键术语总结:117个数据科学关键术语的解释

    这篇文章展示了一组数据科学相关的关键术语,这些关键术语简明而实用,由12个不同的主题组成。 20个大数据的关键术语的解释 链接地址为http://www.kdn...

    AiTechYun
  • 资源 | CNN入门材料:《解析卷积神经网络——深度学习实践手册》

    机器之心
  • 构建一个适合stm32mp157系列开发板的嵌入式Linux系统

    Linux平台上有许多开源的嵌入式linux系统构建框架(框架的意思就是工具),这些框架极大的方便了开发者进行嵌入式系统的定制化构建,目前比较常见的有OpenW...

    韦东山
  • 量子计算中国突破!中科大李传峰团队结合AI与量子计算,助力研发快10亿倍超级计算机

    人工智能将极大提高处理速度,彻底改变量子研究,并最终可能为研发比现有技术快10亿倍、甚至1万亿倍的超级计算机铺平道路。

    新智元
  • [直播] KDD & OGB 图神经网络竞赛:赛题解读,新手包,榜一经验

    KDD联合OGB等一众大佬(见下图)组织了KDD Cup 2021, 这是一场关于大规模图机器学习的竞赛。

    Houye
  • 21个国外受欢迎的学习编程的网站:总有一个理由会让你爱上它们

    世界每天都在变化,不断有新技术和知识涌现,渗透在各个领域。人类对知识的渴求,探索和学习也从来没有停止过。我们得感谢科技的进步,例如互联网的出现,令我们了解新事物...

    LiveEdu

扫码关注云+社区

领取腾讯云代金券