Mender Yocto-opstelling
Ons gebruik die Yocto Kirkstone-tak vir ontwikkeling. Ons neem aan dat u reeds 'n werksontwikkelingsomgewing geïnstalleer het en u omgewing opstel soos beskryf in VisionFive - Mender - Yocto - Deel 1.
Mender bediener opstel
Die installering van die Mender-bediener is nie deel van hierdie artikelreeks nie. Vir ons toetsomgewing het ons die Mender-bediener geïnstalleer met behulp van die installasie-tutoriaal met docker-compose soos beskryf in Installation with Docker Compose.
Nota
Afwykend van die tutoriaal, gebruik ons ons pasgemaakte wildcard CA-sertifikaat. As u dit wil doen, moet u u openbare en private sleutel na '/ mender-server / production / keys-generated / cert' kopieer voordat u die opdrag './run up -d' uitvoer.
Kloon meta-mender
Gaan na u poky-gids - in my geval poky-kirkstone - en kloon die meta-mender-bewaarplek. Aangesien daar nog nie 'n Kirkstone-tak is nie, moet jy die 'meester-volgende' tak kloon.
cd poky-kirkstone
git clone -b master-next https://github.com/mendersoftware/meta-mender.git
local.conf en bblayers.conf
Kopieer bblayers.conf.sample-mender en local.conf.sample-mender van meta-interelectronix-visionfive gids in die conf-gids en hernoem dit na bblayers.conf en 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
In die bblayers.conf-lêer moet u die pad aanpas by u poky-kirkstone-gids. Verwyder ook die reël '/workdir/poky-kirkstone/meta-interelectronix ' - dit is slegs nodig vir ons psplash-aanpassing.
Die belangrike instellings in local.conf is:
# 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"
Pas meta-starfive-bsp aan
U moet 'n tak van meta-starfive-bsp skep om die instellings by te voeg wat nodig is vir die opstel van Mender.
Aanpassings is nodig in:
- conf/machine/starfive-visionfive-jh7100.conf: Verwyder of lewer kommentaar op hierdie twee reëls
UBOOT_ENV ?= "uEnv"
UBOOT_ENV_SUFFIX = "txt"
- resepte-bsp/bootfiles/files/uEnv.txt: Vervang die volgende reël om Mender-veranderlikes in te sluit tydens die opstart
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}
- resepte-bsp/u-boot/u-boot-visionfive_v2022.03.bb: Voeg die volgende reëls by om meta-mender te vertel, dat 'n pasgemaakte u-boot gebruik word
require recipes-bsp/u-boot/u-boot-mender.inc
PROVIDES += "u-boot"
RPROVIDES_${PN} += "u-boot"
BOOT_FILES:append = " uEnv.txt"
Resepte in meta-interelectronix-visionfive
Sommige instellings en veranderlikes moet in pasgemaakte metalaag gestel word, soos ons doen in meta-interelectronix-visionfive.
- resepte-mender/mender-client/mender-client_%.bbappend: Voeg die URL van die Mender-bediener by
MENDER_SERVER_URL = "https://mender.interelectronix.com"
- resepte-bsp/u-boot/u-boot-visionfive_%.bbappend: Voeg die volgende reëls by
MENDER_UBOOT_AUTO_CONFIGURE = "1"
BOOTENV_SIZE = "0x20000"
resepte-bsp/u-boot-env/*: Voeg hierdie resep by uit die afgelaaide zip-lêer. Dit bevat twee uEnv-lêers wat in die wortellêerstelsel gebruik word. uEnv_visionfive.txt word in rootfs gebruik, wanneer opstart vanaf partisie A en uEnv_visionfive3.txt gebruik word wanneer u vanaf partisie B begin.
resepte-kern/beelde/visie-vyf-beeld-mender.bb: Neem hierdie prentresep of voeg 'u-boot-env' by jou beeldresep
IMAGE_INSTALL:append = " v4l-utils u-boot-env"
Belangrik
Voordat u u prent kan bitbak, moet u u-boot aanpas soos beskryf in die volgende deel van die artikelreeks.
Kopiereg lisensie
Kopiereg © 2022 Interelectronix e.K.
Hierdie projekbronkode is gelisensieer onder die GPL-3.0 lisensie.
Deel 1 van 'n reeks artikels, hoe om 'n Yocto-omgewing op te stel om 'n Yocto Linux te skep met die integrasie van 'n Mender-kliënt.
Deel 4 van 'n reeks artikels, hoe om 'n Yocto-omgewing op te stel om 'n Yocto Linux te skep met die integrasie van 'n Mender-kliënt.
Deel 3 van 'n reeks artikels, hoe om 'n Yocto-omgewing op te stel om 'n Yocto Linux te skep met die integrasie van 'n Mender-kliënt.