Freitag, 24. April 2015

Yocto: INHERIT, inherit, include, require

For me it was a little bit confusing which directive I have to include in which file to include other files and which includes are valid. This is a little table I've made which shows the valid combinations. I give no promise though that this table is correct or complete but so far it worked for me:
Target: .bb .bbclass .conf .inc
.bb
.bbclass inherit inherit INHERIT
.conf
.inc
include
require
include
require
include
require
include
require

So for example if you are working on a .bb file you can use the inherit statement to include a .bbclass file.

inherit, INHERIT and include won't produce an error if the file does not exist, only the require statement will cause the build to file if the file does not exist!

More informations about the statements can be found on the following website: Locating Include and Class Files

Donnerstag, 23. April 2015

Yocto: Switching to Systemd

If you want to use Systemd to replace the default init-system you can create your own distribution file like this:
 require conf/distro/poky.conf  
 DISTRO = "systemd-distribution"  
 DISTRO_NAME = "Based on Poky which uses Systemd as init system "  
 DISTRO_VERSION = "1.0"  
 DISTRO_FEATURES_append = " systemd"  
 # uncomment the following two line two use directfb  
 #DISTRO_FEATURES_append = " directfb"  
 #DISTRO_FEATURES_remove = " x11 wayland"  
 DISTRO_EXTRA_RDEPENDS += "\  
   initscripts \  
   systemd \  
   systemd-analyze \  
   "   
 # Switch init-system to systemd  
 VIRTUAL-RUNTIME_init_manager = "systemd"  
 DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"  
 VIRTUAL-RUNTIME_initscripts = ""  

Then you need to change the distribution name in your local.conf:
 DISTRO ?= "systemd-distribution"  

If you build your system it should now use Systemd as init-service.

This is the original site I've found this information: Yocto part I – baseline boot time

Donnerstag, 16. April 2015

VMware: Switching to paravirtual SCSI adapter for a CentOS vmware virtual machine

If you want to switch to the paravirtual SCSI adapter in your virtual machine because of performance reasons you can do it like this (this guide assumes you have configured your virtual hard drives as SCSI devices):
The first step is to make sure the paravirtual SCSI driver is included in your initial ramdisk. For this you have to edit /etc/dracut.conf and add the following line:
add_drivers+=" vmw_pvscsi "
and then you have to regenerate your initial ramdisk:
# mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak
# dracut -f
After you have shutdown your virtual machine you have to change the virtual SCSI adapter like this in your .vmx file:
scsi0.virtualDev = "pvscsi"
This has to be done for every adapter which should be converted to a paravirtual adapter.

This was tested on CentoOS 6 and 7.