Postavljanje Mender Yocto
Koristimo ogranak Yocto Kirkstone za razvoj. Pretpostavljamo da već imate instalirano radno razvojno okruženje i postavite svoje okruženje kako je opisano u VisionFive - Mender - Yocto - 1. dio.
Postavljanje mender poslužitelja
Instalacija Mender poslužitelja nije dio ove serije članaka. Za naše testno okruženje instalirali smo Mender poslužitelj pomoću instalacijskog vodiča s docker-composeom kako je opisano u Instalaciji s Docker Composeom.
Bilješka
Odstupajući od vodiča, koristimo naš prilagođeni zamjenski CA certifikat. Ako to želite učiniti, morate kopirati javni i privatni ključ u '/mender-server/production/keys-generated/cert' prije nego što pokrenete naredbu './run up -d'.
Klon meta-mender
Idi u svoj poky direktorij - u mom slučaju poky-kirkstone - i kloniraj meta-mender repozitorij. Budući da još ne postoji podružnica Kirkstone, morate klonirati granu 'gospodar-sljedeći'.
cd poky-kirkstone
git clone -b master-next https://github.com/mendersoftware/meta-mender.git
local.conf i bblayers.conf
Kopirajte bblayers.conf.sample-mender i local.conf.sample-mender iz meta-interelectronix-visionfive direktorija u direktorij conf i preimenujte ga u bblayers.conf i 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
U datoteci bblayers.conf morate prilagoditi put do svog direktorija poky-kirkstone. Također izbrišite liniju '/workdir/poky-kirkstone/meta-interelectronix ' - potrebna je samo za našu prilagodbu psplasha.
Važne postavke u datoteci local.conf su:
# 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"
Prilagodi meta-starfive-bsp
Trebali biste stvoriti granu meta-starfive-bsp-a kako biste dodali postavke potrebne za postavljanje Mendera.
Prilagodbe su potrebne u:
- conf/machine/starfive-visionfive-jh7100.conf: Uklonite ili komentirajte ova dva retka
UBOOT_ENV ?= "uEnv"
UBOOT_ENV_SUFFIX = "txt"
- recipes-bsp/bootfiles/files/uEnv.txt: Zamijenite sljedeći redak tako da uključuje Mender varijable tijekom pokretanja
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}
- recipes-bsp/u-boot/u-boot-visionfive_v2022.03.bb: Dodajte sljedeće retke kako biste meta-menderu rekli da se koristi prilagođeni u-boot
require recipes-bsp/u-boot/u-boot-mender.inc
PROVIDES += "u-boot"
RPROVIDES_${PN} += "u-boot"
BOOT_FILES:append = " uEnv.txt"
Recepti u meta-interelectronix-visionfive
Neke postavke i varijable potrebno je postaviti u prilagođeni meta-sloj, kao što to činimo u meta-interelectronix-visionfive.
- recepti-mender/mender-client/mender-client_%.bbappend: Dodajte URL Mender poslužitelja
MENDER_SERVER_URL = "https://mender.interelectronix.com"
- recipes-bsp/u-boot/u-boot-visionfive_%.bbappend: Dodajte sljedeće retke
MENDER_UBOOT_AUTO_CONFIGURE = "1"
BOOTENV_SIZE = "0x20000"
recepti-bsp/u-boot-env/*: Dodajte ovaj recept iz preuzete zip datoteke. Sadrži dvije uEnv-datoteke, koje se koriste u korijenskom datotečnom sustavu. uEnv_visionfive.txt se koristi u rootfovima, pri pokretanju s particije A i uEnv_visionfive3.txt se koristi pri pokretanju s particije B.
recepti-core/images/vision-five-image-mender.bb: Uzmite ovaj recept za sliku ili dodajte 'u-boot-env' u svoj recept za sliku
IMAGE_INSTALL:append = " v4l-utils u-boot-env"
Važan
Prije nego što možete bitbake svoju sliku, morate prilagoditi u-boot kao što je opisano u sljedećem dijelu serije članaka.
Licenca za autorska prava
Autorska prava © 2022. Interelectronix e.K.
Ovaj izvorni kod projekta licenciran je pod licencom GPL-3.0.
- dio niza članaka, kako postaviti Yocto okruženje za stvaranje Yocto Linuxa uz integraciju Mender klijenta.
- dio niza članaka, kako postaviti Yocto okruženje za stvaranje Yocto Linuxa uz integraciju Mender klijenta.
- dio niza članaka, kako postaviti Yocto okruženje za stvaranje Yocto Linuxa uz integraciju Mender klijenta.