How can I manually install a Yocto image?

I’m having difficulties installing an image I’ve built with Yocto. In the past I’ve always used u-boot, MBR, and legacy boot. Installing Yocto meant creating boot and rootfs partitions, installing the first stage u-boot boot loader, and copying the files in /boot to the boot partition (a FAT32 partition).

Now I’m trying to do something very different for an Intel machine that doesn’t seem to support legacy boot. I’m using systemd-boot, GPT, and UEFI.

If I directly write my .wic image that’s produced by Yocto, it correctly boots. But if I instead try and follow a process as above where I manually partition and copy files over, it will run systemd-boot, but once it tries to load my boot entry, nothing happens.

One thing I did notice is that the /boot directory that’s in the rootfs.tar.gz produced by Yocto is different from the /boot directory that’s on the .wic file. The kernels are different (different sizes) and the .wic file includes a microcode.cpio file.

I tried copying the boot files from the .wic file and installing them manually when installing, but that got me to a point where it says EFI stub: Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path, but then nothing happens after that.

Is there any guide to installing Yocto images by manually partitioning on UEFI systems?

I’m not doing anything unusual other than maybe the installation method. I’m building nanbield, core-image-base, and have added the meta-intel layer.

This is my local.conf:

MACHINE ?= "intel-corei7-64"
MACHINE ??= "qemux86-64"
DISTRO ?= "poky"
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
USER_CLASSES ?= "buildstats"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "
    STOPTASKS,${TMPDIR},1G,100K 
    STOPTASKS,${DL_DIR},1G,100K 
    STOPTASKS,${SSTATE_DIR},1G,100K 
    STOPTASKS,/tmp,100M,100K 
    HALT,${TMPDIR},100M,1K 
    HALT,${DL_DIR},100M,1K 
    HALT,${SSTATE_DIR},100M,1K 
    HALT,/tmp,10M,1K"
PACKAGECONFIG:append:pn-qemu-system-native = " sdl"

IMAGE_FEATURES += "read-only-rootfs"
IMAGE_FSTYPES = "tar.xz"

CORE_IMAGE_EXTRA_INSTALL += "kernel-modules"

# OS packages
CORE_IMAGE_EXTRA_INSTALL += "openssh"
CORE_IMAGE_EXTRA_INSTALL += "nginx"
CORE_IMAGE_EXTRA_INSTALL += "openssl"
CORE_IMAGE_EXTRA_INSTALL += "gnupg"
CORE_IMAGE_EXTRA_INSTALL += "iptables"
CORE_IMAGE_EXTRA_INSTALL += "logrotate"
CORE_IMAGE_EXTRA_INSTALL += "mongodb"
CORE_IMAGE_EXTRA_INSTALL += "sudo"
CORE_IMAGE_EXTRA_INSTALL += "rsync"
CORE_IMAGE_EXTRA_INSTALL += "procps"

# Python packages
CORE_IMAGE_EXTRA_INSTALL += "python3"
CORE_IMAGE_EXTRA_INSTALL += "python3-flask"
CORE_IMAGE_EXTRA_INSTALL += "python3-setuptools"
CORE_IMAGE_EXTRA_INSTALL += "python3-pymongo"
CORE_IMAGE_EXTRA_INSTALL += "python3-cryptography"
CORE_IMAGE_EXTRA_INSTALL += "python3-scrypt"
CORE_IMAGE_EXTRA_INSTALL += "python3-pip"
CORE_IMAGE_EXTRA_INSTALL += "python3-pyserial"
CORE_IMAGE_EXTRA_INSTALL += "python3-pyudev"

# Feature services
CORE_IMAGE_EXTRA_INSTALL += "dnsmasq"
CORE_IMAGE_EXTRA_INSTALL += "rsyslog"
CORE_IMAGE_EXTRA_INSTALL += "ntp"
CORE_IMAGE_EXTRA_INSTALL += "ntpq"
CORE_IMAGE_EXTRA_INSTALL += "ntp-utils"
CORE_IMAGE_EXTRA_INSTALL += "freeradius"
CORE_IMAGE_EXTRA_INSTALL += "net-snmp"

# Remove the following packages before 1.0 release
CORE_IMAGE_EXTRA_INSTALL += "coreutils"
CORE_IMAGE_EXTRA_INSTALL += "vim"

This is my 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 ?= " 
  /data/opis-current/meta 
  /data/opis-current/meta-poky 
  /data/opis-current/meta-yocto-bsp 
  /data/opis-current/meta-openembedded/meta-oe 
  /data/opis-current/meta-openembedded/meta-python 
  /data/opis-current/meta-openembedded/meta-webserver 
  /data/opis-current/meta-openembedded/meta-networking 
  /data/opis-current/meta-intel 
  "
Asked By: Dave

||

The problem ended up being an obscure BIOS setting, which I found looking through the documentation of the machine I’m using. I saw that they noted, in order to make Ubuntu boot on that machine, you had to turn on "PinCntrl Driver GPIO Scheme" in the BIOS. I made that change and my Yocto build started working as well.

So if others have this problem, I recommending looking in to various BIOS issues.

Answered By: Dave
Categories: Answers Tags: , , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.