如何在基于Yocto项目的l​​k-bootloader中整合修补程序

时间:2018-12-24 07:05:11

标签: yocto ota

我是yocto的新手,现在我使用MTK-demo-board在Yocto的基础上构建linux-distro。我想按照本教程https://docs.mender.io/1.0/Devices/Integrating-with-U-Boot的要求通过修补程序来实现OTA。

但是Mender在默认情况下支持u-boot作为引导程序,MTK使用lk引导程序,那么如何实现此功能?

我使用的AP是MT8183,我完成的步骤如下: 1. /meta/meta-mediatek/recipes-bsp/lk/lk_2.0.0.0.bb。添加关注代码:

require recipes-bsp/u-boot/u-boot-mender.inc
PROVIDES += "u-boot"
RPROVIDES_{PN} += "u-boot"

2.cp lk_2.0.0.0 lk-fw-utils_2.0.0.0,并将文件更改如下:

 a. delete do_genkey{} function;
 b. add EXTRA_OEMAKE_class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1' 
 c. add "oe_runmake env" in function do_compile()
 d. add PROVIDES_${PN} = "lk-fw-utils"
        RPROVIDES_${PN} = "lk-fw-utils"
        DEPENDS += "mtd-utils"

3./build/local.conf,添加这些代码

  MENDER_ARTIFACT_NAME = "release-1"
  INHERIT += "mender-full"
  MACHINE = "aiv8183m1v2"
  PREFERRED_VERSION_pn-mender = "1.0.%"
  PREFERRED_VERSION_pn-mender-artifact = "1.0.%"
  PREFERRED_VERSION_pn-mender-artifact-native = "1.0.%"

  DISTRO_FEATURES_append = "systemd"
  VIRTUAL-RUNTIME_init_manager = "systemed"
  DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
  VIRTUAL-RUNTIME_initscripts = ""
  IMAGE_FSTYPES = "ext4"

4。执行bitbake层添加层/ meta / meta-mender / meta-mender-core

5.bitbake-layers创建层meta-mylayer,在这一层中,我mkdir -p / recipes-mender / mender / files,在mender目录中,我触摸mender _%。bbappend文件如下:

FILESEXTARPATHS_prepend := "${THISDIR}/file:"
SRC_URI_append = "file://server.crt"
and put servert.crt in the the file directory.

6。在mancine.conf(aiv8183m1v2.conf)中,我已添加

PREFERRED_PROVIDER_u-boot-fw-utils = "lk-fw-utils"
  PREFERRED_PROVIDER_u-boot = "lk"
  IMAGE_INSTALL_append = "kernel-modules"
  MENDER_STORAGE_DEVICE = "/dev/mmcblk0"

7./meta-mender/meta-mender-core/classes/mender-full.bbclass

 MENDER_FEATURES_ENABLE_append_arm = ""
  MENDER_FEATURES_ENABLE_append_aarch64 = ""

我期望的结果是Linux可以在Mender上实现OTA。 但是,实际结果是该项目无法交叉构建。日志显示:

DEBUG: Executing shell function soft_link_to_rootfs 
| ln: target ‘mender.bmap’ is not a directory 
| WARNING: /home/yewkui/yocto-linux/build/tmp/work/aiv8183m1v2-poky-linux/mtk-image-openmm-aiv/1.0-r0/temp/run.soft_link_to_rootfs.1347217:1 exit 1 from 'ln -nfs mtk-image-openmm-aiv-aiv8183m1v2-20181224064735.rootfs.ext4 mender mender.bmap /home/yewkui/yocto-linux/build/tmp/deploy/images/aiv8183m1v2/rootfs.ext4 mender mender.bmap' 
| DEBUG: Python function do_rootfs finished 
| ERROR: Function failed: soft_link_to_rootfs (log file is located at /home/yewkui/yocto-linux/build/tmp/work/aiv8183m1v2-poky-linux/mtk-image-openmm-aiv/1.0-r0/temp/log.do_rootfs.1347217) 
ERROR: Task (/home/yewkui/yocto-linux/meta/poky/../meta-mediatek-mt8183/recipes-aiv/images/mtk-image-openmm-aiv.bb:do_rootfs) failed with exit code '1' 
NOTE: Tasks Summary: Attempted 2392 tasks of which 2391 didn't need to be rerun and 1 failed. 
NOTE: Writing buildhistory


也许我第一步是错的,但是如何通过yocto在MTK lk-bootloader上实现OTA,请帮忙!非常感谢!

0 个答案:

没有答案