Project

General

Profile

Support #618

Updated by Daniel Curtis over 9 years ago

{{>toc}} 

 This is a guide for creating a Yocto linux image on Ubuntu 12.04. 

 h2. Prepare the Environment 

 * Make sure the system is up to date: 
 <pre> 
 sudo apt-get update && sudo apt-get upgade 
 </pre> 

 * Install a few prerequisite packages: 
 <pre> 
 sudo apt-get install apt-get install gawk wget git bitbake diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev xterm 
 </pre> 

 h2. Prepare the Source Code 

 * Create a directory for the source code: 
 <pre> 
 mkdir ~/git && cd ~/git 
 </pre> 

 * Get the latest IoT Yocto Development Kit: version: 
 <pre> 
 git clone -b daisy git://git.yoctoproject.org/poky.git 
 cd poky 
 </pre> 

 h3. Configure Intel BSP 

 * Get the latest daisy branch Intel Board Support Packages into the Yocto directory: 
 <pre> 
 git clone -b daisy git://git.openembedded.org/openembedded-core 
 git clone -b devkit-daisy git://git.yoctoproject.org/meta-intel-iot-devkit iotdk 
 cd iotdk git clone -b daisy http://git.yoctoproject.org/meta-intel-iot-middleware 
 git clone -b daisy git://git.yoctoproject.org/meta-intel-quark 
 git clone -b daisy git://git.yoctoproject.org/meta-intel-galileo 

 </pre> 

 * Source the @iot-devkit-init-build-env@ @oe-init-build-env@ script: 
 <pre> 
 source iot-devkit-init-build-env oe-init-build-env 
 </pre> 

 * Edit @build/conf/local.conf@ 
 <pre> 
 nano ~/git/poky/build/conf/local.conf 
 </pre> 
 #* And modify the config to match the *quark* machine: 
 <pre> 
 MACHINE ?= "quark" 
 </pre> 

 * Add the meta-intel layer to the bblayers.conf file: 
 <pre> 
 nano ~/git/poky/build/conf/bblayers.conf 
 </pre> 
 #* And modify the BBLAYERS definition: 
 <pre> 
 BBLAYERS ?= " \ 
   /home/user/git/poky/meta \ 
   /home/user/git/poky/meta-yocto \ 
   /home/user/git/poky/meta-yocto-bsp \ 
   /home/user/git/poky/openembedded-core/meta \ 
   /home/user/git/poky/openembedded-core/meta-skeleton \ 
   /home/user/git/poky/openembedded-core/meta-selftest \ 
   /home/user/git/poky/meta-intel-iot-middleware \ 
   /home/user/git/poky/meta-intel-iot-devkit/meta \ 
   /home/user/git/poky/meta-intel-iot-devkit/meta-galileo \ 
   /home/user/git/poky/meta-intel-iot-devkit/meta-iot-devkit \ 
   /home/user/git/poky/meta-intel-iot-devkit/meta-oe \ 
   /home/user/git/poky/meta-intel-iot-devkit/meta-oe/meta-filesystems \ 
   /home/user/git/poky/meta-intel-iot-devkit/meta-yocto \ 
   /home/user/git/poky/meta-intel-iot-devkit/meta-quark-bsp \ 
   /home/user/git/poky/meta-intel-quark \ 
   /home/user/git/poky/meta-intel-galileo \ 
   " 
 </pre> 

 h2. Build the Yocto Image 

 * Run bitbake to build iot-devkit-image: core-image-base: 
 <pre> 
 bitbake iot-devkit-image core-image-base 
 </pre> 
 #* *NOTE*: There are many types of image targets for bitbake to use, such as: 
 <pre> 
 core-image-base 
 core-image-clutter 
 core-image-full-cmdline 
 core-image-minimal 
 core-image-minimal-dev 
 core-image-minimal-initramfs 
 core-image-multilib-example 
 core-image-rt 
 core-image-rt-dev 
 core-image-sato 
 core-image-sato-dev 
 core-image-testmaster 
 core-image-testmaster-initramfs 
 core-image-weston 
 core-image-x11 
 iot-devkit-image 
 iot-devkit-prof-dev-image 
 iot-devkit-prof-image 
 iot-devkit-spi-image 
 </pre> 

 * (Optional) To use the Hob GUI to assist in building, run: 
 <pre> 
 bitbake -u hob 
 </pre> 

 h3. Deploy the Yocto Image 

 The original files in the +Yocto image provided by Intel+ are: 
 * boot/grub/grub.cfg 
 * bzImage 
 * core-image-minimal-initramfs-clanton.cpio.gz 
 * grub.efi 
 * image-full-galileo-clanton.ext3 

 After the bitbake build process there will be lots of files in the @~/git/poky/build/tmp/deploy/images/genericx86@ including the files needed to copy over to the microSD Card, however there are many files that are unnecessary. 

 * Mount the microSD card: 
 <pre> 
 sudo mkdir /media/microsd 
 sudo mount /dev/mmcblk0p1 /media/microsd 
 </pre> 

 * Copy the required files to the microSD card: 
 <pre> 
 sudo cp -L ~/git/poky/build/tmp/deploy/images/genericx86/bzImage /media/microsd/bzImage 
 sudo cp -L ~/git/poky/build/tmp/deploy/images/genericx86/core-image-minimal-initramfs-genericx86.cpio.gz /media/microsd/core-image-minimal-initramfs-genericx86.cpio.gz 
 sudo cp -L ~/git/poky/build/tmp/deploy/images/genericx86/bootia32.efi /media/microsd/bootia32.efi 
 sudo cp -L ~/git/poky/build/tmp/deploy/images/genericx86/core-image-minimal-genericx86.ext3 /media/microsd/core-image-minimal-genericx86.ext3 
 </pre> 

 * Now create a grub configuration file: 
 <pre> 
 sudo mkdir -p /media/microsd/boot/grub 
 sudo nano /media/microsd/boot/grub/grub.conf 
 </pre> 
 #* And add the following: 
 <pre> 
 default 1 
 timeout 1 

 color white/blue white/cyan 

 title Clanton SVP kernel-SPI initrd-SPI IMR-On IO-APIC/HPET NoEMU 
     kernel --spi root=/dev/ram0 console=ttyS1,115200n8 earlycon=uart8250,mmio32,$EARLY_CON_ADDR_REPLACE,115200n8 reboot=efi,warm apic=debug rw 
     initrd --spi 

 title Clanton SVP kernel-MassStorage initrd-MassStorage image-full IMR-On IO-APIC/HPET NoEMU debug 
     root (hd0,0) 
     kernel /bzImage root=/dev/ram0 console=ttyS1,115200n8 earlycon=uart8250,mmio32,$EARLY_CON_ADDR_REPLACE,115200n8 reboot=efi,warm apic=debug rw LABEL=boot debugshell=5 rootimage=core-image-minimal-genericx86.ext3 
     initrd /core-image-minimal-initramfs-genericx86.cpio.gz 
 </pre> 

 * Sync and unmount the microSD card: 
 <pre> 
 sudo sync 
 sudo umount /media/microsd 
 </pre> 

 h2. Resources 

 * https://software.intel.com/en-us/blogs/2015/03/04/creating-a-yocto-image-for-the-intel-galileo-board-using-split-layers 
 * http://www.yoctoproject.org/docs/1.7.1/mega-manual/mega-manual.html 
 * http://www.yoctoproject.org/docs/1.7.1/bsp-guide/bsp-guide.html 
 * http://www.yoctoproject.org/docs/1.7.1/bitbake-user-manual/bitbake-user-manual.html 
 * http://wiki.ros.org/IntelGalileo/HydroGalileoInitialInstall 
 * http://www.malinov.com/Home/sergey-s-blog/intelgalileo-buildinglinuximage  
 * https://www.yoctoproject.org/downloads

Back