{"id":147,"date":"2010-02-17T17:37:41","date_gmt":"2010-02-17T23:37:41","guid":{"rendered":"http:\/\/dmartenson.dc.multitech.prv\/developer\/?page_id=147"},"modified":"2018-03-22T12:41:22","modified_gmt":"2018-03-22T17:41:22","slug":"customizing-bitbake-recipes","status":"publish","type":"page","link":"https:\/\/www.multitech.net\/developer\/software\/corecdp\/development\/customizing-bitbake-recipes\/","title":{"rendered":"Customizing Bitbake Recipes"},"content":{"rendered":"<p>To customize a bitbake recipe, such as lighttpd, you can create a <code>bbappend<\/code> file in <code>${OETREE}\/user-layer<\/code>.  Bbappend files may be used to make changes\/additions to an existing recipe without having to modify the original or having to duplicate it.  Look at the bbappend files in the multitech layer for examples.  Bbappend files located in <code>user-layer<\/code> will be parsed after the <code>openembedded<\/code> and <code>multitech<\/code> layers.<\/p>\n<p>The following example shows how to use a <code>bbappend<\/code> file to provide a custom config file for lighttpd that overrides the OpenEmbedded and CoreCDP versions.  <\/p>\n<p>You can use the CoreCDP bbappend and config for lighttpd as a starting point.<\/p>\n<pre class=\"brush:shell\">\r\ncd ${OETREE}\r\n\r\n# make a spot for your bbappend and custom files\r\nmkdir user-layer\/recipes\/lighttpd\r\nmkdir user-layer\/recipes\/lighttpd\/lighttpd-1.4.28\r\n\r\n# copy over the multitech lighttpd bbappend\r\ncp multitech\/recipes\/lighttpd\/lighttpd_1.4.28.bbappend user-layer\/recipes\/lighttpd\/\r\n\r\n# copy over the config\r\ncp multitech\/recipes\/lighttpd\/lighttpd-1.4.28\/corecdp\/lighttpd.conf \\\r\n   user-layer\/recipes\/lighttpd\/lighttpd-1.4.28\/\r\n\r\n(edit user-layer\/recipes\/lighttpd\/lighttpd-1.4.28\/lighttpd.conf)\r\n\r\n# rebuild lighttpd\r\nbitbake lighttpd -c clean\r\nbitbake lighttpd\r\n<\/pre>\n<p>Contents of <code>lighttpd_1.4.28.bbappend<\/code>:<\/p>\n<pre class=\"brush:shell\">\r\nFILESEXTRA := \"${THISDIR}\"\r\nFILESPATHBASE =. \"${FILESEXTRA}:\"\r\n<\/pre>\n<p><code>FILESPATHBASE<\/code> is a &#8216;:&#8217; separated list of paths from which to search for non-source-code files needed by a recipe, such as config files, patches, etc.  The above bbappend adds the directory that the bbappend file is in to <code>FILESPATHBASE<\/code>.<\/p>\n<p>The <code>THISDIR<\/code> variable is provided by the CoreCDP layer in <code>multitech\/classes\/thisdir.bbclass<\/code>.  Setting <code>FILESEXTRA<\/code> using the &#8216;:=&#8217; operator is required because the expression must be evaluated and expanded at the time of parsing the file or the wrong path will end up in <code>FILESEXTRA<\/code> and hence <code>FILESPATHBASE<\/code>.<\/p>\n<div class=\"note\">If you add a new bbappend file to your layer and it seems as though it isn&#8217;t being parsed, try forcing a Bitbake cache rebuild by updating the time stamp on the config for your layer. Run <code>touch user-layer\/conf\/layer.conf<\/code> and then build again.<\/div>\n<p>Explanation of the Bitbake syntax in the above example can be found in the <a title=\"Bitbake User Manual\" href=\"https:\/\/www.yoctoproject.org\/docs\/current\/bitbake-user-manual\/bitbake-user-manual.html\" target=\"_blank\">Bitbake User Manual<\/a><\/p>\n<p>For more information, please see the <a title=\"OpenEmbedded User Manual\" href=\"https:\/\/www.openembedded.org\/wiki\/Documentation#OpenEmbedded_Manual\" target=\"_blank\">OpenEmbedded User Manual<\/a><br \/>\nThe section regarding how bitbake searches for local files is <a https:\/\/www.openembedded.org\/wiki\/BitBake_(user)\" target=\"_blank\">here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To customize a bitbake recipe, such as lighttpd, you can create a bbappend file in ${OETREE}\/user-layer. Bbappend files may be used to make changes\/additions to an existing recipe without having to modify the original or having to duplicate it. Look at the bbappend files in the multitech layer for examples. Bbappend files located in user-layer [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"parent":314,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-147","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/comments?post=147"}],"version-history":[{"count":30,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/147\/revisions"}],"predecessor-version":[{"id":22895,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/147\/revisions\/22895"}],"up":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/314"}],"wp:attachment":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/media?parent=147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}