Professional Documents
Culture Documents
YoctoProjectQuickStart
Copyright20102016LinuxFoundation
Permissionisgrantedtocopy,distributeand/ormodifythisdocumentunderthetermsoftheCreativeCommons
AttributionShareAlike2.0UK:England&WalesaspublishedbyCreativeCommons.
Note
ForthelatestversionofthismanualassociatedwiththisYoctoProjectrelease,seetheYocto
ProjectQuickStartfromtheYoctoProjectwebsite.
Welcome!
WelcometotheYoctoProject!TheYoctoProjectisanopensourcecollaborationprojectwhosefocusisdevelopersof
embeddedLinuxsystems.Amongotherthings,theYoctoProjectusesabuildhostbasedontheOpenEmbedded(OE)
project,whichusestheBitBaketool,toconstructcompleteLinuximages.TheBitBakeandOEcomponentsare
combinedtogethertoformareferencebuildhost,historicallyknownasPoky.
IfyoudonothaveasystemthatrunsLinuxandyouwanttogivetheYoctoProjectatestrun,youmightconsider
usingtheYoctoProjectBuildAppliance.TheBuildApplianceallowsyoutobuildandbootacustomembeddedLinux
imagewiththeYoctoProjectusinganonLinuxdevelopmentsystem.SeetheYoctoProjectBuildApplianceformore
information.
ThisquickstartiswrittensothatyoucanquicklygetahostbuildhostsetuptousetheYoctoProjectandthenbuild
someLinuximages.RatherthangointogreatdetailabouttheYoctoProjectanditsmanycapabilities,thisquickstart
providestheminimalinformationyouneedtotryouttheYoctoProjectusingasupportedLinuxbuildhost.Reading
andusingthequickstartshouldresultinyouhavingabasicunderstandingofwhattheYoctoProjectisandhowto
usesomeofitscorecomponents.Youwillalsohaveworkedthroughstepstoproducetwoimages:onesuitablefor
emulationandonethatcanbeusedonactualhardware.Theexampleshighlighttheeasewithwhichyoucanusethe
YoctoProjecttocreateimagesformultipletypesofhardware.
FormoredetailedinformationontheYoctoProject,youcanreferencetheseresources:
Website:TheYoctoProjectWebsiteprovidesthelatestbuilds,breakingnews,fulldevelopmentdocumentation,
andaccesstoarichYoctoProjectDevelopmentCommunityintowhichyoucantap.
FAQs:ListscommonlyaskedYoctoProjectquestionsandanswers.YoucanfindtwoFAQs:YoctoProjectFAQona
wiki,andthe"FAQ"chapterintheYoctoProjectReferenceManual.
DeveloperScreencast:TheGettingStartedwiththeYoctoProjectNewDeveloperScreencastTutorialprovides
a30minutevideocreatedforusersunfamiliarwiththeYoctoProjectbutfamiliarwithLinuxbuildhosts.While
thisscreencastissomewhatdated,theintroductoryandfundamentalconceptsareusefulforthebeginner.
IntroducingtheYoctoProjectDevelopmentEnvironment
TheYoctoProjectthroughtheOpenEmbeddedbuildsystemprovidesanopensourcedevelopmentenvironment
targetingtheARM,MIPS,PowerPC,andx86architecturesforavarietyofplatformsincludingx8664andemulated
ones.YoucanusecomponentsfromtheYoctoProjecttodesign,develop,build,debug,simulate,andtestthe
completesoftwarestackusingLinux,theXWindowSystem,GTK+frameworks,andQtframeworks.
https://www.yoctoproject.org/docs/current/yoctoprojectqs/yoctoprojectqs.html 1/8
4/5/2016 YoctoProjectQuickStart
TheYoctoProjectDevelopmentEnvironment
HerearesomehighlightsfortheYoctoProject:
ProvidesarecentLinuxkernelalongwithasetofsystemcommandsandlibrariessuitablefortheembedded
environment.
MakesavailablesystemcomponentssuchasX11,GTK+,Qt,Clutter,andSDL(amongothers)soyoucancreatea
richuserexperienceondevicesthathavedisplayhardware.Fordevicesthatdonothaveadisplayorwhereyou
wishtousealternativeUIframeworks,thesecomponentsneednotbeinstalled.
CreatesafocusedandstablecorecompatiblewiththeOpenEmbeddedprojectwithwhichyoucaneasilyand
reliablybuildanddevelop.
FullysupportsawiderangeofhardwareanddeviceemulationthroughtheQuickEMUlator(QEMU).
Providesalayermechanismthatallowsyoutoeasilyextendthesystem,makecustomizations,andkeepthem
organized.
YoucanusetheYoctoProjecttogenerateimagesformanykindsofdevices.Asmentionedearlier,theYoctoProject
supportscreationofreferenceimagesthatyoucanbootwithinandemulateusingQEMU.Thestandardexample
machinestargetQEMUfullsystememulationfor32bitand64bitvariantsofx86,ARM,MIPS,andPowerPC
architectures.Beyondemulation,youcanusethelayermechanismtoextendsupporttojustaboutanyplatformthat
Linuxcanrunonandthatatoolchaincantarget.
AnotherYoctoProjectfeatureistheSatoreferenceUserInterface.ThisoptionalUIthatisbasedonGTK+isintended
fordeviceswithrestrictedscreensizesandisincludedaspartoftheOpenEmbeddedCorelayersothatdevelopers
cantestpartsofthesoftwarestack.
SettingUptoUsetheYoctoProject
ThefollowinglistshowswhatyouneedinordertouseaLinuxbasedbuildhosttousetheYoctoProjecttobuild
images:
BuildHostAbuildhostwithaminimumof50GbytesoffreediskspacethatisrunningasupportedLinux
distribution(i.e.recentreleasesofFedora,openSUSE,CentOS,Debian,orUbuntu).
BuildHostPackagesAppropriatepackagesinstalledonthebuildhost.
TheYoctoProjectAreleaseoftheYoctoProject.
TheLinuxDistribution
https://www.yoctoproject.org/docs/current/yoctoprojectqs/yoctoprojectqs.html 2/8
4/5/2016 YoctoProjectQuickStart
TheYoctoProjectteamverifieseachreleaseagainstrecentversionsofthemostpopularLinuxdistributionsthat
providestablereleases.Ingeneral,ifyouhavethecurrentreleaseminusoneofthefollowingdistributions,you
shouldhavenoproblems.
Ubuntu
Fedora
openSUSE
CentOS
Debian
ForamoredetailedlistofdistributionsthatsupporttheYoctoProject,seethe"SupportedLinuxDistributions"
sectionintheYoctoProjectReferenceManual.
TheOpenEmbeddedbuildsystemshouldbeabletorunonanymoderndistributionthathasthefollowingversions
forGit,tar,andPython.
Git1.7.8orgreater
tar1.24orgreater
Python2.7.3orgreaterexcludingPython3.x,whichisnotsupported.
Ifyourbuildhostdoesnotmeetanyofthesethreelistedversionrequirements,youcantakestepstopreparethe
systemsothatyoucanstillusetheYoctoProject.Seethe"RequiredGit,tar,andPythonVersions"sectioninthe
YoctoProjectReferenceManualforinformation.
TheBuildHostPackages
RequiredbuildhostpackagesvarydependingonyourbuildmachineandwhatyouwanttodowiththeYoctoProject.
Forexample,ifyouwanttobuildanimagethatcanrunonQEMUingraphicalmode(aminimal,basicbuild
requirement),thenthebuildhostpackagerequirementsaredifferentthanifyouwanttobuildanimageona
headlesssystemorbuildouttheYoctoProjectdocumentationset.
Collectively,thenumberofrequiredpackagesislargeifyouwanttobeabletocoverallcases.
Note
Ingeneral,youneedtohaverootaccessandtheninstalltherequiredpackages.Thus,the
commandsinthefollowingsectionmayormaynotworkdependingonwhetherornotyour
Linuxdistributionhassudoinstalled.
ThefollowinglistshowstherequiredpackagesneededtobuildanimagethatrunsonQEMUingraphicalmode(e.g.
essentialplusgraphicssupport).Forlistsofrequiredpackagesforotherscenarios,seethe"RequiredPackagesfor
theHostDevelopmentSystem"sectionintheYoctoProjectReferenceManual.
UbuntuandDebian
$sudoaptgetinstallgawkwgetgitcorediffstatunziptexinfogccmultilib\
buildessentialchrpathsocatlibsdl1.2devxterm
Fedora
$sudodnfinstallgawkmakewgettarbzip2gzippythonunzipperlpatch\
diffutilsdiffstatgitcppgccgccc++glibcdeveltexinfochrpath\
ccacheperlDataDumperperlTextParseWordsperlThreadQueuesocat\
findutilswhichSDLdevelxterm
OpenSUSE
$sudozypperinstallpythongccgccc++gitchrpathmakewgetpythonxml\
diffstatmakeinfopythoncursespatchsocatlibSDLdevelxterm
https://www.yoctoproject.org/docs/current/yoctoprojectqs/yoctoprojectqs.html 3/8
4/5/2016 YoctoProjectQuickStart
CentOS
$sudoyuminstallgawkmakewgettarbzip2gzippythonunzipperlpatch\
diffutilsdiffstatgitcppgccgccc++glibcdeveltexinfochrpathsocat\
perlDataDumperperlTextParseWordsperlThreadQueueSDLdevelxterm
Note
CentOS6.xusersneedtoensurethattherequiredversionsofGit,tarandPythonare
available.Fordetails,Seethe"RequiredGit,tar,andPythonVersions"sectioninthe
YoctoProjectReferenceManualforinformation.
YoctoProjectRelease
ThelastrequirementyouneedtomeetbeforeusingtheYoctoProjectisgettingaYoctoProjectrelease.Itis
recommendedthatyougetthelatestYoctoProjectreleasebysettingup(cloninginGitterms)alocalcopyofthe
pokyGitrepositoryonyourbuildhostandthencheckingoutthelatestrelease.Doingsoallowsyoutoeasily
updatetonewerYoctoProjectreleasesaswellascontributebacktotheYoctoProject.
HereisanexamplefromanUbuntubuildhostthatclonesthepokyrepositoryandthenchecksoutthelatestYocto
ProjectRelease(i.e.2.0.1):
$gitclonegit://git.yoctoproject.org/poky
Cloninginto'poky'...
remote:Countingobjects:226790,done.
remote:Compressingobjects:100%(57465/57465),done.
remote:Total226790(delta165212),reused225887(delta164327)
Receivingobjects:100%(226790/226790),100.98MiB|263KiB/s,done.
Resolvingdeltas:100%(165212/165212),done.
$gitcheckoutjethro
YoucanalsogettheYoctoProjectFilesbydownloadingYoctoProjectreleasesfromtheYoctoProjectwebsite.
FormoreinformationongettingsetupwiththeYoctoProjectrelease,seethe"YoctoProjectRelease"iteminthe
YoctoProjectDevelopmentManual.
BuildingImages
Nowthatyouhaveyoursystemrequirementsinorder,youcangivetheYoctoProjectatry.Thissectionpresents
stepsthatletyoudothefollowing:
Buildaqemux86referenceimageandrunitintheQEMUemulator.
Easilychangeconfigurationssothatyoucanquicklycreateasecondimage,whichwouldbeforMinnowBoard
MAXcompatibleboards.
Note
Thestepsinthissectiondonotprovidedetail,butratherprovideminimal,working
commandsandexamplesdesignedtojustgetyoustarted.Formoredetails,seethe
appropriatemanualsintheYoctoProjectmanualset.
Usethefollowingcommandstobuildyourimage.TheOpenEmbeddedbuildsystemcreatesanentireLinux
distribution,includingthetoolchain,fromsource.
https://www.yoctoproject.org/docs/current/yoctoprojectqs/yoctoprojectqs.html 4/8
4/5/2016 YoctoProjectQuickStart
NoteaboutNetworkProxies
Bydefault,thebuildprocesssearchesforsourcecodeusingapredeterminedorder
throughasetoflocations.Ifyouareworkingbehindafirewallandyourbuildhostisnot
setupforproxies,youcouldencounterproblemswiththebuildprocesswhenfetching
sourcecode(e.g.fetcherfailuresorGitfailures).
Ifyoudonotknowyourproxysettings,consultyourlocalnetworkinfrastructure
resourcesandgetthatinformation.Agoodstartingpointcouldalsobetocheckyourweb
browsersettings.Finally,youcanfindmoreinformationonusingtheYoctoProjectbehind
afirewallintheYoctoProjectReferenceManualFAQandonthe"WorkingBehinda
NetworkProxy"wikipage.
1.BeSureYourBuildHostisSetUp:Thestepstobuildanimageinthissectiondependonyourbuildhost
beingproperlysetup.Besureyouhaveworkedthroughtherequirementsdescribedinthe"SettingUpto
UsetheYoctoProject"section.
2.CheckOutYourBranch:BesureyouareintheSourceDirectory(e.g.poky)andthencheckoutthe
branchassociatedwiththelatestYoctoProjectRelease:
$cd~/poky
$gitcheckoutbjethroorigin/jethro
Git'scheckoutcommandchecksoutthecurrentYoctoProjectreleaseintoalocalbranchwhosename
matchestherelease(i.e.jethro).Thelocalbranchtrackstheupstreambranchofthesamename.
Creatingyourownbranchbasedonthereleasedbranchensuresyouareusingthelatestfilesforthat
release.
3.InitializetheBuildEnvironment:Runtheoeinitbuildenvenvironmentsetupscriptto
definetheOpenEmbeddedbuildenvironmentonyourbuildhost.
$sourceoeinitbuildenv
Amongotherthings,thescriptcreatestheBuildDirectory,whichisbuildinthiscaseandislocatedinthe
SourceDirectory.Afterthescriptruns,yourcurrentworkingdirectoryissettotheBuildDirectory.Later,
whenthebuildcompletes,theBuildDirectorycontainsallthefilescreatedduringthebuild.
Note
ForinformationonrunningamemoryresidentBitBake,seetheoeinit
buildenvmemressetupscript.
4.ExamineYourLocalConfigurationFile:Whenyousetupthebuildenvironment,alocalconfigurationfile
namedlocal.confbecomesavailableinaconfsubdirectoryoftheBuildDirectory.Beforeusing
BitBaketostartthebuild,youcanlookatthisfileandbesureyourgeneralconfigurationsarehowyouwant
them:
Tohelpconservediskspaceduringbuilds,youcanaddthefollowingstatementtoyourproject's
configurationfile,whichforthisexampleispoky/build/conf/local.conf.Addingthis
statementdeletestheworkdirectoryusedforbuildingarecipeoncetherecipeisbuilt.
INHERIT+="rm_work"
Bydefault,thetargetmachineforthebuildisqemux86,whichproducesanimagethatcanbeusedin
theQEMUemulatorandistargetedatanIntel32bitbasedarchitecture.Furtheroninthisexample,this
defaultiseasilychangedthroughtheMACHINEvariablesothatyoucanquicklybuildanimagefora
differentmachine.
https://www.yoctoproject.org/docs/current/yoctoprojectqs/yoctoprojectqs.html 5/8
4/5/2016 YoctoProjectQuickStart
Anotherconsiderationbeforeyoubuildisthepackagemanagerusedwhencreatingtheimage.Thedefault
local.conffileselectstheRPMpackagemanager.Youcancontrolthisconfigurationbyusingthe
PACKAGE_CLASSESvariable.
Selectionofthepackagemanagerisseparatefromwhetherpackagemanagementisusedatruntimeinthe
targetimage.
Foradditionalpackagemanagerselectioninformation,seethe"package*.bbclass"sectioninthe
YoctoProjectReferenceManual.
5.StarttheBuild:ContinuewiththefollowingcommandtobuildanOSimageforthetarget,whichiscore
imagesatointhisexample:
Note
Dependingonthenumberofprocessorsandcores,theamountofRAM,thespeedof
yourInternetconnectionandotherfactors,thebuildprocesscouldtakeseveral
hoursthefirsttimeyourunit.Subsequentbuildsrunmuchfastersincepartsofthe
buildarecached.
$bitbakecoreimagesato
Forinformationonusingthebitbakecommand,seethe"BitBake"sectionintheYoctoProjectReference
Manual,orseethe"BitBakeCommand"sectionintheBitBakeUserManual.Forinformationonothertargets,
seethe"Images"chapterintheYoctoProjectReferenceManual.
6.SimulateYourImageUsingQEMU:Oncethisparticularimageisbuilt,youcanstartQEMUandrunthe
image:
$runqemuqemux86
IfyouwanttolearnmoreaboutrunningQEMU,seethe"UsingtheQuickEMUlator(QEMU)"chapterinthe
YoctoProjectDevelopmentManual.
7.ExitQEMU:ExitQEMUbyeitherclickingontheshutdowniconorbyopeningaterminal,typing
poweroff,andthenpressing"Enter".
Thefollowingstepsshowhoweasyitistosetuptobuildanimageforanewmachine.Thesestepsbuildanimage
fortheMinnowBoardMAX,whichissupportedbytheYoctoProjectandthemetaintelintelcorei7
64andintelcore232BoardSupportPackages(BSPs).
Note
TheMinnowBoardMAXshipswith64bitfirmware.Ifyouwanttousetheboardin32bit
mode,youmustdownloadthe32bitfirmware.
1.CreateaLocalCopyofthe metaintelRepository:BuildinganimagefortheMinnowBoardMAX
requiresthemetaintellayer.Usethegitclonecommandtocreatealocalcopyofthe
repository:
$gitclonegit://git.yoctoproject.org/metaintel
Cloninginto'metaintel'...
remote:Countingobjects:10824,done.
remote:Compressingobjects:100%(3508/3508),done.
remote:Total10824(delta6219),reused10580(delta5975)
Receivingobjects:100%(10824/10824),2.72MiB|482.00KiB/s,done.
Resolvingdeltas:100%(6219/6219),done.
Checkingconnectivity...done.
2.ConfiguretheBuild:Toconfigurethebuild,youeditthebblayers.confandlocal.conffiles,
bothofwhicharelocatedinthebuild/confdirectory.
Hereisaquickwaytomaketheedits.Thefirstcommandusesthebitbakelayersaddlayer
https://www.yoctoproject.org/docs/current/yoctoprojectqs/yoctoprojectqs.html 6/8
4/5/2016 YoctoProjectQuickStart
Hereisaquickwaytomaketheedits.Thefirstcommandusesthebitbakelayersaddlayer
commandtoaddthemetaintellayer,whichcontainstheintelcore*BSPstothebuild.The
secondcommandselectstheBSPbysettingtheMACHINEvariable.
$bitbakelayersaddlayer"$HOME/source/poky/metaintel"
$echo'MACHINE="intelcorei764"'>>conf/local.conf
Notes
Ifyouwanta64bitbuild,usethefollowing:
$echo'MACHINE="intelcorei764"'>>conf/local.conf
Ifyouwant32bitimages,usethefollowing:
$echo'MACHINE="intelcore232"'>>conf/local.conf
3.BuildaMinimalImageforMinnowBoardMAX:Usethefollowingcommandtobuildtheminimalimagefor
MinnowBoardMAX.Becauseconfigurationchangesareminimaltosetupforthissecondbuild,the
OpenEmbeddedbuildsystemcanreusefilesfrompreviousbuildsasmuchaspossible.Reusingfilesmeans
thissecondbuildwillbemuchfasterthananinitialbuild.
$bitbakecoreimageminimal
Oncethebuildcompletes,theresultingbasicconsoleimageislocatedintheBuildDirectoryhere:
tmp/deploy/images/intelcorei764/coreimageminimalintelcorei764.hddimg
4.WritetheImage:YoucanwritetheimagetoaUSBkey,SATAdrive,orSDcardbyusingthe
mkefidisk.shscript,whichisincludedinthepokyrepositoryat
scripts/contrib/mkefidisk.sh:
$sudo$HOME/source/poky/scripts/contrib/mkefidisk.shHOST_DEVICE\
tmp/deploy/images/intelcorei764/coreimageminimalintelcorei764.hddimgTARGET_DEVICE
Inthepreviouscommand,HOST_DEVICEisthedevicenodeonthebuildhost(e.g./dev/sdcor
/dev/mmcblk0).TARGET_DEVICEisthenameofthedeviceastheMinnowBoardMAXseesit(e.g.
/dev/sdaor/dev/mmcblk0).
5.BoottheHardware:Withthebootdeviceprovisioned,youcaninsertthemediaintotheMinnowBoardMAX
andbootthehardware.Theboardshouldautomaticallydetectthemediaandboottothebootloaderand
subsequentlytheoperatingsystem.
Iftheboarddoesnotbootautomatically,youcanbootitmanuallyfromtheEFIshellasfollows:
Shell>connectr
Shell>mapr
Shell>fs0:
Shell>bootx64
Note
Fora32bitimageusethefollowing:
Shell>bootia32
https://www.yoctoproject.org/docs/current/yoctoprojectqs/yoctoprojectqs.html 7/8
4/5/2016 YoctoProjectQuickStart
NextSteps
Ifyoucompletedallthestepsintheprevioussectionthencongratulationstoyou!Whatnow?
DependingonwhatyouprimaryinterestsarewiththeYoctoProject,youcouldconsideranyofthefollowing:
VisittheYoctoProjectWebSite:TheofficialYoctoProjectwebsitecontainsinformationontheentireproject.
Visitingthissiteisagoodwaytofamiliarizeyourselfwiththeoverallproject.
ExploreDevelopmentModels:Youcanseethe"CommonDevelopmentModels"sectionintheYoctoProject
DevelopmentManualtogetanoverviewofthevariouswaysbywhichyoucanusetheYoctoProjecttodevelop
projects.
LearnSomeOpenSourceBasics:Ifyouarenewtotheopensourceenvironment,youmightreadthe"The
YoctoProjectOpenSourceDevelopmentEnvironment"chapteroftheYoctoProjectDevelopmentManual.This
chapterpresentsoverviewmaterialforopensourcedevelopmentinthecontextoftheYoctoProject.
LearnAboutApplicationDevelopment:Ifyourprimaryinterestslieindevelopingapplications,youcan
referencetheYoctoProjectApplicationDeveloper'sGuide.
LearnAboutBoardSupportPackages(BSPs):IfyouwanttolearnaboutBSPs,seetheYoctoProjectBoard
SupportPackages(BSP)Developer'sGuide.
LearnAboutUsingEclipseWiththeYoctoProject:IfyouareanEclipseuser,youcanlearnaboutusingthe
YoctoProjectinthatdevelopmentenvironmentbyreadingthe"WorkflowUsingtheADTandEclipse"sectionin
theYoctoProjectDevelopmentManual.
LearnAboutToaster:ToasterisawebinterfacetotheYoctoProject'sOpenEmbeddedbuildsystem.Ifyouare
interestedinusingthistypeofinterfacetocreateimages,seetheToasterUserManual.
ExploreYoctoProjectCommonTasksandTechnicalDetails:Ifyouareinterestedinamixofcommontasks
thathavetodowithprojectdevelopusingtheYoctoProject,seethe"CommonTasks"sectionoftheYoctoProject
DevelopmentManual.Ifyouwantmoredetail,seetheYoctoProjectReferenceManual.
https://www.yoctoproject.org/docs/current/yoctoprojectqs/yoctoprojectqs.html 8/8