Here are Yocto recipies that build a working system image for the Intel Edison based on Yocto Scarthgap. Yocto, of course, is a build system, that downloads sources for a build environment, builds these, then downloads sources of a complete linux distribution, builds, packages (in this case as DEB’s) and installs them to the system image. It also builds a crosscompile environment (SDK) so you can develop locally and deploy to the remote Edison. Using for instance Qt Creator, you can develop locally for your host machine and debug, or build for the remote Edison and remote debug. Qt Creator will upload the executable and start gdbserver for you. When your application works well, you can create a recipy and add it automatically to your system image.
The Edison comes of course with a system image preloaded that we refer to as the factory image. It is based on Yocto Dizzy (Dizzy is the name of the Yocto version). Some of the recipies no longer build as the sources have disappeared. The branches starting with dizzy- have been updated by me, with either the broken recipies pointing to new sources, new versions of the sources, or otherwise removed. I haven’t build these recently, so more stuff might have broke. So, have fun with those if you like.
The system image consists of a few distinct image files that you can find under out/linux64/build/tmp/deploy/images/edison/:
U-Boot (the boot loader)
For the Morty branches this needed to be generated outside Yocto as the recipe was not working well. It is a one time task to update U-Boot so you only need to build that once. Nevertheless, after Pyro U-Boot builds just fine as part of the image.
Linux kernel with initramsfs
We need an initramfs because some kernel modules need to be loaded late. To do this they can not be built-in. Unfortunately some of these modules are needed to access the sd card, and we would like to be able to boot the root file system from there. To solve the chicken-egg problems, the initramsfs holds a copy of the necessary modules, loads these, then mounts the sd card. It then performs a switch_root, continuing the boot from the sd card as if nothing happened. However, in the simplest case everything is booted from the eMMC.
Some people call initramfs initrd. Although they appear the same, they are different. Initramfs is a file system, Initrd a ram disk. Initramfs gets loaded into the kernel earlier.
Of course if the init script in the initramfs cannot find the rootfs, or the rootfs won’t boot, the initramfs can provide a busybox shell from which you can try to fix things.
Rootfs
The btrfs formatted file system, containing the remaining kernel modules, systemd for maintaining services and other well known linux user space tools.
During boot firmware in ROM loads certain stuff (ifwi) that we unfortunately can’t touch. After this it loads U-Boot. U-Boot then normally loads and boots the kernel that if finds on /dev/mmcblk0p8.
To boot from sd card you will need to interrupt U-Boot while booting from a terminal by pressing ESC and enter the command run edsboot to boot from /dev/mmcblk1 (the SDHC card).
After boot you can login, connect to ethernet (if you have a supported USB ethernet adapter) or connect to wifi (or both at the same time) and start securing your device. You need to use a terminal program to connect via USB to the Edison for this, at least until you have wifi or ethernet working. I have used screen as well as Gnome Terminal (which works a bit better as you have a line buffer that you can scroll up).
© 2018 Ferry Toth