Programu Iliyopachikwa - VisionFive - Mender - Yocto - Sehemu ya 2 picha ya skrini ya kompyuta

Maono ya Tano - Mender - Yocto

Sehemu ya 2 - Usanidi wa msingi wa kujumuisha Mender

Usanidi wa Mender Yocto

Usanidi wa Msingi wa Mender kwa bodi ya VisionFive

Tunatumia tawi la Yocto Kirkstone kwa maendeleo. Tunadhani kuwa tayari una mazingira ya maendeleo ya kazi yaliyowekwa na kuanzisha mazingira yako kama ilivyoelezwa katika VisionFive - Mender - Yocto - Sehemu ya 1.

Usanidi wa seva ya Mender

Ufungaji wa seva ya Mender sio sehemu ya safu hii ya nakala. Kwa mazingira yetu ya majaribio, tulisakinisha seva ya Mender kwa kutumia mafunzo ya usakinishaji na docker-compose kama ilivyoelezwa katika Ufungaji na Docker Compose.

Kumbuka

Kukataa mafunzo, tunatumia cheti chetu cha kawaida cha kadi ya mwitu CA. Ikiwa unataka kufanya hivyo, lazima unakili ufunguo wako wa umma na wa kibinafsi kwa '/mender-server/production/keys-generated/cert' kabla ya kuendesha amri './run up -d'.

Kabla ya kuendelea, unapaswa kuwa na uwezo wa kuingia kwenye seva ya Mender bila kupata ujumbe wowote wa makosa.

Clone meta-mender

Nenda kwenye saraka yako ya poky - kwa upande wangu poky-kirkstone - na utengeneze hazina ya meta-mender. Kwa kuwa bado hakuna tawi la Kirkstone, lazima uige tawi la 'bwana-karibu'.

cd poky-kirkstone
git clone -b master-next https://github.com/mendersoftware/meta-mender.git

local.conf na bblayers.conf

Nakili bblayers.conf.sample-mender na local.conf.sample-mender kutoka kwa saraka ya meta-interelectronix-visionfive kwenye saraka ya conf na uipe jina jipya kwa bblayers.conf na local.conf:

cp ../poky-kirkstone/meta-interelectronix-visionfive/conf/bblayers.conf.sample-mender conf/bblayers.conf
cp ../poky-kirkstone/meta-interelectronix-visionfive/conf/local.conf.sample-mender conf/local.conf

Katika faili ya bblayers.conf lazima urekebishe njia ya saraka yako ya poky-kirkstone. Pia futa mstari '/workdir/poky-kirkstone/meta-interelectronix ' - inahitajika tu kwa ubinafsishaji wetu wa psplash.

Mipangilio muhimu katika local.conf ni:

# mender settings
# The name of the disk image and Artifact that will be built.
# This is what the device will report that it is running, and different updates must have different names
# because Mender will skip installation of an Artifact if it is already installed.
MENDER_ARTIFACT_NAME = "release-1"

INHERIT += "mender-full"

# The version of Mender to build. This needs to match an existing recipe in the meta-mender repository.
#
# Given your Yocto Project version, see which versions of Mender you can currently build here:
# https://docs.mender.io/overview/compatibility#mender-client-and-yocto-project-version
#
# Given a Mender client version, see the corresponding version of the mender-artifact utility:
# https://docs.mender.io/overview/compatibility#mender-clientserver-and-artifact-format
#
# By default this will select the latest version of the tools that is backwards compatible with the
# given Yocto branch.
# If you need an earlier version, or a later version even though it may not be backwards compatible,
# please uncomment the following and set to the required version. If you want to use the bleeding
# edge version, specify "master-git%", but keep in mind that these versions may not be stable:
#
# PREFERRED_VERSION_mender-client = "3.3.0"
# PREFERRED_VERSION_mender-artifact = "3.8.0"
# PREFERRED_VERSION_mender-artifact-native = "3.8.0"
# PREFERRED_VERSION_mender-connect = "2.0.1"

# The following settings to enable systemd are needed for all Yocto
# releases sumo and older.  Newer releases have these settings conditionally
# based on the MENDER_FEATURES settings and the inherit of mender-full above.
DISTRO_FEATURES:append = " systemd"
VIRTUAL-RUNTIME:init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""

ARTIFACTIMG_FSTYPE = "ext4"

# Example: Memory card storage
MENDER_STORAGE_DEVICE = "/dev/mmcblk0"
# Example: Memory card with 2GiB of storage.
#MENDER_STORAGE_TOTAL_SIZE_MB = "29476"
#MENDER_STORAGE_TOTAL_SIZE_MB = "14738"
MENDER_STORAGE_TOTAL_SIZE_MB = "7369"

MENDER_UBOOT_STORAGE_INTERFACE = "mmc"
MENDER_UBOOT_STORAGE_DEVICE = "0"

MENDER_BOOT_PART = "${MENDER_STORAGE_DEVICE_BASE}1"
MENDER_DATA_PART = "${MENDER_STORAGE_DEVICE_BASE}4"
MENDER_ROOTFS_PART_A = "${MENDER_STORAGE_DEVICE_BASE}2"
MENDER_ROOTFS_PART_B = "${MENDER_STORAGE_DEVICE_BASE}3"

MENDER_FEATURES_ENABLE:append = " mender-uboot mender-image-sd"
MENDER_FEATURES_DISABLE:append = " mender-grub mender-image-uefi"

MACHINE_ESSENTIAL_EXTRA_RDEPENDS:append = " kernel-image kernel-devicetree"

PREFERRED_VERSION:mender-client = "3.3.0"

Customize meta-starfive-bsp

Unapaswa kuunda tawi la meta-starfive-bsp ili kuongeza mipangilio inayohitajika kwa usanidi wa Mender.

Customizations zinahitajika katika:

  • conf/machine/starfive-visionfive-jh7100.conf: Ondoa au kutoa maoni mistari hii miwili
UBOOT_ENV ?= "uEnv"
UBOOT_ENV_SUFFIX = "txt"
  • mapishi-bsp/bootfiles/files/uEnv.txt: Badilisha mstari ufuatao ili kujumuisha vigezo vya Mender wakati wa kuwasha
bootcmd=load mmc 0:1 ${kernel_addr_r} @IMAGETYPE@; load mmc 0:1 ${fdt_addr_r} jh7100-starfive-visionfive-v1.dtb; setenv bootargs 'root=${mender_kernel_root} rw rootfstype=ext4 rootwait earlycon console=ttyS0,115200n8'; booti ${kernel_addr_r} - ${fdt_addr_r}
  • mapishi-bsp/u-boot/u-boot-visionfive_v2022.03.bb: Ongeza mistari ifuatayo ili kuwaambia meta-mender, kwamba u-boot maalum hutumiwa
require recipes-bsp/u-boot/u-boot-mender.inc

PROVIDES += "u-boot"
RPROVIDES_${PN} += "u-boot"

BOOT_FILES:append = " uEnv.txt"

Mapishi katika meta-interelectronix-visionfive

Baadhi ya mipangilio na vigezo vinahitajika kuwekwa katika safu maalum ya meta, kama tunavyofanya katika meta-interelectronix-visionfive.

  • mapishi-mender/mender-client/mender-client_%.bbappend: Ongeza URL ya seva ya Mender
MENDER_SERVER_URL = "https://mender.interelectronix.com"
  • mapishi-bsp/u-boot/u-boot-visionfive_%.bbappend: Ongeza mistari ifuatayo
MENDER_UBOOT_AUTO_CONFIGURE = "1"
BOOTENV_SIZE = "0x20000"
  • mapishi-bsp/u-boot-env/*: Ongeza kichocheo hiki kutoka kwa faili ya zip iliyopakuliwa. Ina faili mbili za uEnv, ambazo hutumiwa katika mfumo wa faili ya mizizi. uEnv_visionfive.txt hutumiwa katika mizizi, wakati wa kuwasha kutoka kwa kizigeu A na uEnv_visionfive3.txt hutumiwa wakati wa kuwasha kutoka kwa kizigeu B.

  • mapishi-msingi/picha/vision-5-picha-mender.bb: Chukua kichocheo hiki cha picha au ongeza 'u-boot-env' kwenye mapishi yako ya picha

    IMAGE_INSTALL:append = " v4l-utils u-boot-env"

Muhimu

Kabla ya kupiga picha yako, lazima ubadilishe u-boot kama ilivyoelezwa katika sehemu inayofuata ya safu ya makala.

Tazama jinsi ya kuanzisha u-boot kwa Mender katika VisionFive - Mender - Yocto - Sehemu ya 3.

Leseni ya Hakimiliki

Copyright © 2022 Interelectronix e.K.
Msimbo huu wa chanzo cha Mradi una leseni chini ya leseni ya GPL-3.0.

Programu Iliyopachikwa - VisionFive - Mender - Yocto picha ya skrini ya kompyuta
Sehemu ya 1 - Usanidi wa msingi wa mazingira ya Yocto

Sehemu ya 1 ya mfululizo wa makala, jinsi ya kusanidi mazingira ya Yocto kuunda Yocto Linux na ujumuishaji wa mteja wa Mender.

Programu Iliyopachikwa - VisionFive - Mender - Yocto picha ya skrini ya kompyuta
Sehemu ya 4 - Unda artifact kwa mender

Sehemu ya 4 ya mfululizo wa makala, jinsi ya kusanidi mazingira ya Yocto kuunda Yocto Linux na ujumuishaji wa mteja wa Mender.

Programu Iliyopachikwa - VisionFive - Mender - Yocto picha ya skrini ya kompyuta
Sehemu ya 3 - usanidi wa u-boot kwa Mender

Sehemu ya 3 ya mfululizo wa makala, jinsi ya kuanzisha mazingira ya Yocto ili kuunda Yocto Linux na ujumuishaji wa mteja wa Mender.