Creating Yocto Mender for Raspberrypi 3 - yocto

I need help creating Mender for Raspberry Pi3. I can create the image, but when using Win32Image to burn the Disk Image it doesn't boot.
Here is my additional conf.log
MENDER_ARTIFACT_NAME = "release-1"
INHERIT += "mender-full"
MACHINE ?= "raspberrypi3"
RPI_USE_U_BOOT = "1"
MENDER_PARTITION_ALIGNMENT_KB = "4096"
MENDER_BOOT_PART_SIZE_MB = "40"
IMAGE_INSTALL_append = " kernel-image kernel-devicetree"
IMAGE_FSTYPES_remove += " rpi-sdimg"
DISTRO_FEATURES_append = " systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""
IMAGE_FSTYPES = "ext4"
and bblayers
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
/home/ubuntu/pyro/poky/meta \
/home/ubuntu/pyro/poky/meta-poky \
/home/ubuntu/pyro/poky/meta-yocto-bsp \
/home/ubuntu/pyro/openembedded-core/meta \
/home/ubuntu/pyro/meta-openembedded/meta-oe \
/home/ubuntu/pyro/meta-openembedded/meta-python \
/home/ubuntu/pyro/meta-openembedded/meta-networking \
/home/ubuntu/pyro/meta-raspberrypi \
/home/ubuntu/pyro/meta-mender/meta-mender-core \
/home/ubuntu/pyro/meta-mender/meta-mender-demo \
/home/ubuntu/pyro/meta-mender/meta-mender-raspberrypi \
"
I can create the rpi-basic image as follows:
ubuntu#ip-172-31-6-3:~/pyro/build$ bitbake rpi-basic-image
Parsing recipes: 100% |######################################################################################| Time: 0:00:54
Parsing of 870 .bb files complete (0 cached, 870 parsed). 1347 targets, 71 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Build Configuration:
BB_VERSION = "1.34.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "universal"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "raspberrypi3"
DISTRO = "poky"
DISTRO_VERSION = "2.3.2"
TUNE_FEATURES = "arm armv7ve vfp thumb neon vfpv4 callconvention-hard cortexa7"
TARGET_FPU = "hard"
meta
meta-poky
meta-yocto-bsp = "pyro:2021e95bcd986e5bcfe457da5c3e16d60241d050"
meta-raspberrypi = "pyro:40447de4782d76f1e23e67ba05e272c27f6ec250"
meta-mender-core
meta-mender-raspberrypi = "pyro:b40f05c82ebc97c18ddf8ac426af4657ddba9425"
Initialising tasks: 100% |###################################################################################| Time: 0:00:04
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 2976 tasks of which 2953 didn't need to be rerun and all succeeded.
ubuntu#ip-172-31-6-3:~/pyro/build$
Maybe I am missing some steps?

The pyro branch of meta-raspberrypi does not support the RPI_USE_U_BOOT setting. For that (and older) branches you need to use 'KERNEL_IMAGETYPE_rpi = "uImage"' instead.

Related

Activating distro layer in Yocto

What are the required steps to use a distro layer in Yocto?
Currently, I have the following setup:
meta-my-distro-layer/conf/distro/mydistro.conf:
DISTROOVERRIDES =. "poky:"
require conf/distro/poky.conf
DISTRO = "mydistro"
DISTRO_NAME = "MyDistro"
DISTRO_VERSION = "1.0"
DISTRO_CODENAME = "one"
INIT_MANAGER = "systemd"
meta-my-distro-layer/conf/layer.conf
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "meta-my-distro-layer"
BBFILE_PATTERN_meta-my-distro-layer = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-my-distro-layer = "6"
LAYERDEPENDS_meta-my-distro-layer = "core"
LAYERSERIES_COMPAT_meta-my-distro-layer = "kirkstone"
meta-my-distro-layer/recipes-core/images/console-image.bb
DESCRIPTION = "A console-only image"
IMAGE_FEATURES += "ssh-server-openssh"
IMAGE_INSTALL = "\
packagegroup-core-boot \
packagegroup-core-full-cmdline \
${CORE_IMAGE_EXTRA_INSTALL} \
"
inherit core-image
IMAGE_INSTALL += "curl"
build/conf/bblayers.conf:
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
/my-work-dir/poky/meta \
/my-work-dir/poky/meta-poky \
/my-work-dir/poky/meta-yocto-bsp \
/my-work-dir/poky/meta-my-distro-layer \
"
I can build the console image defined in that layer, but nothing set in mydistro.conf seems to have any effect on bitbake. According to bitbake -e, DISTRO and INIT_MANAGER never get set to my values and (consequently) trying to set INIT_MANAGER to systemd never takes effect. I can set INIT_MANAGER in conf/local.conf and it takes effect then, but I'd like to do that in a distro layer.
You need to set DISTRO to mydistro in local.conf

Yocto:How to use meta-intel to generate iso images that can be started in vmware?

I want to use the meta intel layer to generate an ISO image of core image minimal.Although the image is generated normally, I cannot use vmware to start it. The picture is as follows:
enter image description here
This is my local.conf.
MACHINE ?= "intel-corei7-64"
#
# This sets the default machine to be qemux86-64 if no other machine is selected:
MACHINE ??= "qemux86-64"
DISTRO ?= "poky"
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
USER_CLASSES ?= "buildstats"
IMAGE_FSTYPES += "live"
NOISO = "0"
PREFERRED_PROVIDER_virtual/kernel = "linux-intel"
DEPENDS:append:${MACHINE} = " cdrtools-native"
IMAGE_FSTYPES:append = " ext4"
IMAGE_TYPEDEP_wic = "ext4"
do_image_wic[depends] += "${INITRD_IMAGE_LIVE}:do_image_complete"
do_rootfs[depends] += "virtual/kernel:do_deploy"
IMAGE_BOOT_FILES:append = "\
${KERNEL_IMAGETYPE} \
microcode.cpio \
${IMGDEPLOYDIR}/${IMAGE_BASENAME}-${MACHINE}.ext4;rootfs.img \
${#bb.utils.contains('EFI_PROVIDER', 'grub-efi', 'grub-efi- bootx64.efi;EFI/BOOT/bootx64.efi', '', d)} \
${#bb.utils.contains('EFI_PROVIDER', 'grub-efi', '${IMAGE_ROOTFS}/boot/EFI/BOOT/grub.cfg;EFI/BOOT/grub.cfg', '', d)} \
${#bb.utils.contains('EFI_PROVIDER', 'systemd-boot', 'systemd-bootx64.efi;EFI/BOOT/bootx64.efi', '', d)} \
${#bb.utils.contains('EFI_PROVIDER', 'systemd-boot', '${IMAGE_ROOTFS}/boot/loader/loader.conf;loader/loader.conf ', '', d)} \
${#bb.utils.contains('EFI_PROVIDER', 'systemd-boot', '${IMAGE_ROOTFS}/boot/loader/entries/boot.conf;loader/entries/boot.conf', '', d)} "
This is my bblayer.conf.
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
/home/brain/poky/meta \
/home/brain/poky/meta-poky \
/home/brain/poky/meta-yocto-bsp \
/home/brain/poky/meta-intel\
"
Now how can I generate an iso image that can be started normally?
This one should work with VMWare:
IMAGE_FSTYPES = wic.vmdk

How to only output branch versions and do not really start the build

When run:
green#green13:~/green/build$bitbake core-image-minimal
I can see the branch versions as below and it will start the build but I only need these info outputs and do not really need to start the build, how can I do it?
Build Configuration:
BB_VERSION = "1.46.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "universal"
TARGET_SYS = "aarch64-poky-linux"
MACHINE = "qemuarm64"
DISTRO = "poky"
DISTRO_VERSION = "3.1.14"
TUNE_FEATURES = "aarch64 armv8a crc"
TARGET_FPU = ""
meta
meta-poky
meta-yocto-bsp = "HEAD:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
meta-oe
meta-python
meta-filesystems
meta-networking = "HEAD:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
meta-virtualization = "HEAD:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
You can do:
bitbake core-image-minimal -n
-n arguments performs a dry run, technically it starts the build but it wont do much and it'll finish in a few seconds.
For example:
$ bitbake core-image-minimal -n
Loading cache: 100% |#############################################################| Time: 0:00:00
Loaded 1522 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies
Build Configuration:
BB_VERSION = "1.53.1"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "universal"
TARGET_SYS = "aarch64-poky-linux-musl"
MACHINE = "qemuarm64"
DISTRO = "poky-tiny"
DISTRO_VERSION = "3.4+snapshot-37b9d6ee2faa5aacb5324d083ba4a7ba8560b5cd"
TUNE_FEATURES = "aarch64 armv8a crc cortexa57"
TARGET_FPU = ""
meta
meta-poky
meta-yocto-bsp = "master-next:37b9d6ee2faa5aacb5324d083ba4a7ba8560b5cd"
Initialising tasks: 100% |########################################################| Time: 0:00:01
Sstate summary: Wanted 559 Local 0 Mirrors 0 Missed 559 Current 151 (0% match, 21% complete)
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 2036 tasks of which 634 didn't need to be rerun and all succeeded.
See usage and syntax in the bitbake manual for more info.

Yocto 2.4.2 cannot do_rootfs because of dependent package

I am working with Yocto 2.4.2 (rocko), Ubuntu 14.04 LTS, Linux kernel LTSI 4.4, arm cortexA15. There are many issues while building core-image-weston. One of them is:
ERROR: core-image-weston-1.0-r0 do_rootfs: Unable to install packages. Command '/home/server-build/RZG_YoctoProject/build/tmp/work/iwg20m-poky-linux-gnueabi/core-image-weston/1.0-r0/recipe-sysroot-native/usr/bin/opkg --volatile-cache -f /home/server-build/RZG_YoctoProject/build/tmp/work/iwg20m-poky-linux-gnueabi/core-image-weston/1.0-r0/opkg.conf -t /home/server-build/RZG_YoctoProject/build/tmp/work/iwg20m-poky-linux-gnueabi/core-image-weston/1.0-r0/temp/ipktemp/ -o /home/server-build/RZG_YoctoProject/build/tmp/work/iwg20m-poky-linux-gnueabi/core-image-weston/1.0-r0/rootfs --force_postinstall --prefer-arch-to-version install
libkms1
run-postinsts
gstreamer1.0-plugins-good-video4linux2
weston
opkg
psplash
libclutter-1.0-examples
alsa-tools
gtk+3-demo
gles-user-module
packagegroup-core-boot
libdrm-tests
kernel-module-gles
alsa-utils
weston-init
packagegroup-base-extended
bash
packagegroup-core-ssh-dropbear'
returned 2:
Collected errors:
* Solver encountered 2 problem(s):
* Problem 1/2:
- nothing provides libgbm >= 1.0 needed by weston-2.0.0-r0.cortexa15hf-neon
* Solution 1:
- do not ask to install a package providing weston
* Problem 2/2:
- nothing provides libgbm >= 1.0 needed by weston-2.0.0-r0.cortexa15hf-neon
* Solution 1:
- do not ask to install a package providing weston-init
ERROR: core-image-weston-1.0-r0 do_rootfs: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /home/server-build/RZG_YoctoProject/build/tmp/work/iwg20m-poky-linux-gnueabi/core-image-weston/1.0-r0/temp/log.do_rootfs.20697
ERROR: Task (/home/server-build/RZG_YoctoProject/build/../poky/meta/recipes-graphics/images/core-image-weston.bb:do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3411 tasks of which 3410 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/home/server-build/RZG_YoctoProject/build/../poky/meta/recipes-graphics/images/core-image-weston.bb:do_rootfs
The packages weston and weston-init require libgbm >= 1.0. In our current system, libgbm.bb was already existent. And, I can build libgbm succesfully.
SUMMARY = "gbm library"
LICENSE = "MIT"
SECTION = "libs"
LIC_FILES_CHKSUM = "file://gbm.c;beginline=4;endline=22;md5=5cdaac262c876e98e47771f11c7036b5"
SRCREV = "84984e873a134ee67b4c99859f052bb42834245c"
SRC_URI = "git://github.com/thayama/libgbm;protocol=git;branch=master"
PV = "1.0"
S = "${WORKDIR}/git"
DEPENDS = "wayland-kms udev"
inherit autotools pkgconfig
PACKAGES = " \
${PN} \
${PN}-dev \
${PN}-dbg \
${PN}-staticdev \
"
FILES_${PN} = " \
${libdir}/libgbm.so.* \
${libdir}/gbm/libgbm_kms.so.* \
${libdir}/gbm/*.so \
${libdir}/*.so \
"
PROVIDES += "gbm"
FILES_${PN}-dev += "${libdir}/gbm/*.la"
FILES_${PN}-dbg += "${libdir}/gbm/.debug/*"
FILES_${PN}-staticdev += "${libdir}/gbm/*.a"
INSANE_SKIP_${PN} += "dev-so"
But the error happened. Could you help ? Thanks!

How to resolve make: *** [sdram] Error 1 at Eclipse

I'm trying to make a new project at Eclipse to my AT91sam9260 board.
This project is based on two atmel examples: basic-ssc-i2s and basic-emac-uip-telnet.
But when I'm working with these examples together, appear the error below:
make: * [sdram] Error 1
I don't know why, I've been thinking about and I think that is because has some error at Makefile file!
Anyone could help me?
Thank
The makefile:
CHIP = at91sam9260
BOARD = at91sam9260-ek
# Trace level used for compilation
# (can be overriden by adding TRACE_LEVEL=#number to the command-line)
TRACE_LEVEL = 4
# Optimization level, put in comment for debugging
#OPTIMIZATION = -Os
# AT91 library directory
AT91LIB = ../at91lib
# Output file basename
OUTPUT = basic-ssc-i2s-at73c213-project-$(BOARD)-$(CHIP)
# Compile for all memories available on the board (this sets $(MEMORIES))
include $(AT91LIB)/boards/$(BOARD)/board.mak
# Output directories
BIN = bin
OBJ = obj
#-------------------------------------------------------------------------------
# Tools
#-------------------------------------------------------------------------------
# Tool suffix when cross-compiling
CROSS_COMPILE = arm-none-eabi-
# Compilation tools
CC = $(CROSS_COMPILE)gcc
SIZE = $(CROSS_COMPILE)size
STRIP = $(CROSS_COMPILE)strip
OBJCOPY = $(CROSS_COMPILE)objcopy
# Flags
INCLUDES = -I$(AT91LIB)/boards/$(BOARD) -I$(AT91LIB)/peripherals
INCLUDES += -I$(AT91LIB)/components -I$(AT91LIB) -I.
CFLAGS = -Wall -mlong-calls -mstructure-size-boundary=8 -ffunction-sections
CFLAGS += -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -DTRACE_LEVEL=$(TRACE_LEVEL)
ASFLAGS = -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -D__ASSEMBLY__
LDFLAGS = -g $(OPTIMIZATION) -nostartfiles -Wl,--gc-sections
#-------------------------------------------------------------------------------
# Files
#-------------------------------------------------------------------------------
# Directories where source files can be found
PERIPH = $(AT91LIB)/peripherals
BOARDS = $(AT91LIB)/boards
UTILITY = $(AT91LIB)/utility
COMP = $(AT91LIB)/components
# uIP library directory
UIPLIB = ../external_libs/ethernet/uip
VPATH += $(COMP)/dac-at73c213
VPATH += $(COMP)/ethernet/dm9161
VPATH += $(UTILITY)
VPATH += $(PERIPH)/dbgu $(PERIPH)/pio $(PERIPH)/aic $(PERIPH)/ssc $(PERIPH)/spi $(PERIPH)/pmc
VPATH += $(PERIPH)/cp15 $(PERIPH)/emac $(PERIPH)/rstc $(PERIPH)/usart $(PERIPH)/tc
VPATH += $(BOARDS)/$(BOARD) $(BOARDS)/$(BOARD)/$(CHIP)
VPATH += $(UIPLIB)/uip
VPATH += $(UIPLIB)/lib
VPATH += $(UIPLIB)/apps/dhcpc
#VPATH += $(UIPLIB)/apps/telnetd
INCLUDES += -I$(UTILITY)
INCLUDES += -I$(UIPLIB)/uip
INCLUDES += -I$(UIPLIB)/lib
INCLUDES += -I$(UIPLIB)/apps/dhcpc
#INCLUDES += -I$(UIPLIB)/apps/telnetd
# Objects built from C source files
C_OBJECTS = main.o
C_OBJECTS += at73c213.o dm9161.o protocol.o
C_OBJECTS += wav.o stdio.o math.o emac.o rstc.o tc.o usart.o
C_OBJECTS += dbgu.o pio.o ssc.o aic.o spi.o pmc.o cp15.o
C_OBJECTS += board_memories.o board_lowlevel.o
#UIP:
#lib
C_OBJECTS += memb.o
#uip
C_OBJECTS += psock.o timer.o uip.o uip_arp.o
#main
C_OBJECTS += clock-arch.o tapdev.o
#dhcp
C_OBJECTS += dhcpc.o
#telnetd
#C_OBJECTS += shell.o telnetd.o
# Objects built from Assembly source files
ASM_OBJECTS = board_cstartup.o
ASM_OBJECTS += cp15_asm.o
# Append OBJ and BIN directories to output filename
OUTPUT := $(BIN)/$(OUTPUT)
#-------------------------------------------------------------------------------
# Rules
#-------------------------------------------------------------------------------
all: $(BIN) $(OBJ) $(MEMORIES)
$(BIN) $(OBJ):
mkdir $#
define RULES
C_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(C_OBJECTS))
ASM_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(ASM_OBJECTS))
$(1): $$(ASM_OBJECTS_$(1)) $$(C_OBJECTS_$(1))
$(CC) $(LDFLAGS) -T"$(AT91LIB)/boards/$(BOARD)/$(CHIP)/$$#.lds" -o $(OUTPUT)-$$#.elf $$^
$(OBJCOPY) -O binary $(OUTPUT)-$$#.elf $(OUTPUT)-$$#.bin
$(SIZE) $$^ $(OUTPUT)-$$#.elf
$$(C_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.c Makefile $(OBJ) $(BIN)
$(CC) $(CFLAGS) -D$(1) -c -o $$# $$<
$$(ASM_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.S Makefile $(OBJ) $(BIN)
$(CC) $(ASFLAGS) -D$(1) -c -o $$# $$<
debug_$(1): $(1)
perl ../resources/gdb/debug.pl $(OUTPUT)-$(1).elf
endef
$(foreach MEMORY, $(MEMORIES), $(eval $(call RULES,$(MEMORY))))
clean:
-rm -f $(OBJ)/*.o $(BIN)/*.bin $(BIN)/*.elf