MTK8516 提供的SDK通过Yocto来进行构建, 由于Yocto入门门槛较高,刚开始也才过不少坑,这里记录下.
在recipes中加入打印信息,有两种方式
直接一点通过第一种方式添加打印, 如:
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 一些细节
#### 打包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 这种类型的错误导致的.
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}"
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”