yocto-project-kernel-manual.xml 94 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175
  1. <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  2. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
  3. <article id='intro'>
  4. <imagedata fileref="figures/yocto-project-transp.png" width="6in" depth="1in" align="right" scale="25" />
  5. <section id='fake-title'>
  6. <title>Yocto Project Kernel Architecture and Use Manual</title>
  7. </section>
  8. <section id='introduction'>
  9. <title>Introduction</title>
  10. <para>
  11. Yocto Project presents the kernel as a fully patched, history-clean git
  12. repository.
  13. The git tree represents the selected features, board support,
  14. and configurations extensively tested by Yocto Project.
  15. The Yocto Project kernel allows the end user to leverage community
  16. best practices to seamlessly manage the development, build and debug cycles.
  17. </para>
  18. <para>
  19. This manual describes the Yocto Project kernel by providing information
  20. on its history, organization, benefits, and use.
  21. The manual consists of two sections:
  22. <itemizedlist>
  23. <listitem><para>Concepts - Describes concepts behind the kernel.
  24. You will understand how the kernel is organized and why it is organized in
  25. the way it is. You will understand the benefits of the kernel's organization
  26. and the mechanisms used to work with the kernel and how to apply it in your
  27. design process.</para></listitem>
  28. <listitem><para>Using the Kernel - Describes best practices and "how-to" information
  29. that lets you put the kernel to practical use. Some examples are "How to Build a
  30. Project Specific Tree", "How to Examine Changes in a Branch", and "Saving Kernel
  31. Modifications."</para></listitem>
  32. </itemizedlist>
  33. </para>
  34. <para>
  35. For more information on the kernel, see the following links:
  36. <itemizedlist>
  37. <listitem><para><ulink url='http://ldn.linuxfoundation.org/book/1-a-guide-kernel-development-process'></ulink></para></listitem>
  38. <listitem><para><ulink url='http://userweb.kernel.org/~akpm/stuff/tpp.txt'></ulink></para></listitem>
  39. <listitem><para><ulink url='http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=Documentation/HOWTO;hb=HEAD'></ulink></para></listitem>
  40. </itemizedlist>
  41. <para>
  42. You can find more information on Yocto Project by visiting the website at
  43. <ulink url='http://www.yoctoproject.org'></ulink>.
  44. </para>
  45. </para>
  46. </section>
  47. <section id='concepts'>
  48. <title>Concepts</title>
  49. <para>
  50. This section provides conceptual information about the Yocto Project kernel:
  51. <itemizedlist>
  52. <listitem><para>Kernel Goals</para></listitem>
  53. <listitem><para>Yocto Project Kernel Development and Maintenance Overview</para></listitem>
  54. <listitem><para>Kernel Architecture</para></listitem>
  55. <listitem><para>Kernel Tools</para></listitem>
  56. </itemizedlist>
  57. </para>
  58. <section id='kernel-goals'>
  59. <title>Kernel Goals</title>
  60. <para>
  61. The complexity of embedded kernel design has increased dramatically.
  62. Whether it is managing multiple implementations of a particular feature or tuning and
  63. optimizing board specific features, flexibility and maintainability are key concerns.
  64. The Yocto Project Linux kernel is presented with the embedded
  65. developer's needs in mind and has evolved to assist in these key concerns.
  66. For example, prior methods such as applying hundreds of patches to an extracted
  67. tarball have been replaced with proven techniques that allow easy inspection,
  68. bisection and analysis of changes.
  69. Application of these techniques also creates a platform for performing integration and
  70. collaboration with the thousands of upstream development projects.
  71. </para>
  72. <para>
  73. With all these considerations in mind, the Yocto Project kernel and development team
  74. strives to attain these goals:
  75. <itemizedlist>
  76. <listitem><para>Allow the end user to leverage community best practices to seamlessly
  77. manage the development, build and debug cycles.</para></listitem>
  78. <listitem><para>Create a platform for performing integration and collaboration with the
  79. thousands of upstream development projects that exist.</para></listitem>
  80. <listitem><para>Provide mechanisms that support many different work flows, front-ends and
  81. management techniques.</para></listitem>
  82. <listitem><para>Deliver the most up-to-date kernel possible while still ensuring that
  83. the baseline kernel is the the most stable official release.</para></listitem>
  84. <listitem><para>Include major technological features as part of Yocto Project's up-rev
  85. strategy.</para></listitem>
  86. <listitem><para>Present a git tree, that just like the upstream kernel.org tree, has a
  87. clear and continuous history.</para></listitem>
  88. <listitem><para>Deliver a key set of supported kernel types, where each type is tailored
  89. to a specific use case (i.g. networking, consumer, devices, and so forth).</para></listitem>
  90. <listitem><para>Employ a git branching strategy that from a customer's point of view
  91. results in a linear path from the baseline kernel.org, through a select group of features and
  92. ends with their BSP-specific commits.</para></listitem>
  93. </itemizedlist>
  94. </para>
  95. </section>
  96. <section id='kernel-big-picture'>
  97. <title>Yocto Project Kernel Development and Maintenance Overview</title>
  98. <para>
  99. Yocto Project kernel, like other kernels, is based off the Linux kernel release
  100. from <ulink url='http://www.kernel.org'></ulink>.
  101. At the beginning of our major development cycle, we choose our Yocto Project kernel
  102. based on factors like release timing, the anticipated release timing of "final" (i.e. non "rc")
  103. upstream kernel.org versions, and Yocto Project feature requirements.
  104. Typically this will be a kernel that is in the
  105. final stages of development by the community (i.e. still in the release
  106. candidate or "rc" phase) and not yet a final release.
  107. But by being in the final stages of external development, we know that the
  108. kernel.org final release will clearly land within the early stages of
  109. the Yocto Project development window.
  110. </para>
  111. <para>
  112. This balance allows us to deliver the most up-to-date kernel
  113. as possible, while still ensuring that we have a stable official release as
  114. our baseline kernel version.
  115. </para>
  116. <para>
  117. The following figure represents the overall place the Yocto Project kernel fills.
  118. </para>
  119. <para>
  120. <imagedata fileref="figures/kernel-big-picture.png" width="6in" depth="4in" align="center" scale="100" />
  121. </para>
  122. <para>
  123. In the figure the ultimate source for the Yocto Project kernel is a released kernel
  124. from kernel.org.
  125. In addition to a foundational kernel from kernel.org the commercially released
  126. Yocto Project kernel contains a mix of important new mainline
  127. developments, non-mainline developments, Board Support Package (BSP) developments,
  128. and custom features.
  129. These additions result in a commercially released Yocto Project kernel that caters
  130. to specific embedded designer needs for targeted hardware.
  131. </para>
  132. <para>
  133. Once a Yocto Project kernel is officially released the Yocto Project team goes into
  134. their next development cycle, or "uprev" cycle.
  135. It is important to note that the most sustainable and stable way
  136. to include feature development upstream is through a kernel uprev process.
  137. Back-porting of hundreds of individual fixes and minor features from various
  138. kernel versions is not sustainable and can easily compromise quality.
  139. During the uprev cycle, the Yocto Project team uses an ongoing analysis of
  140. kernel development, BSP support, and release timing to select the best
  141. possible kernel.org version.
  142. The team continually monitors community kernel
  143. development to look for significant features of interest.
  144. The illustration depicts this by showing the team looking back to kernel.org for new features,
  145. BSP features, and significant bug fixes.
  146. The team does consider back-porting large features if they have a significant advantage.
  147. User or community demand can also trigger a back-port or creation of new
  148. functionality in the Yocto Project baseline kernel during the uprev cycle.
  149. </para>
  150. <para>
  151. Generally speaking, every new kernel both adds features and introduces new bugs.
  152. These consequences are the basic properties of upstream kernel development and are
  153. managed by the Yocto Project team's kernel strategy.
  154. It is the Yocto Project team's policy to not back-port minor features to the released kernel.
  155. They only consider back-porting significant technological jumps - and, that is done
  156. after a complete gap analysis.
  157. The reason for this policy is that simply back-porting any small to medium sized change
  158. from an evolving kernel can easily create mismatches, incompatibilities and very
  159. subtle errors.
  160. </para>
  161. <para>
  162. These policies result in both a stable and a cutting
  163. edge kernel that mixes forward ports of existing features and significant and critical
  164. new functionality.
  165. Forward porting functionality in the Yocto Project kernel can be thought of as a
  166. "micro uprev."
  167. The many “micro uprevs” produce a kernel version with a mix of
  168. important new mainline, non-mainline, BSP developments and feature integrations.
  169. This kernel gives insight into new features and allows focused
  170. amounts of testing to be done on the kernel, which prevents
  171. surprises when selecting the next major uprev.
  172. The quality of these cutting edge kernels is evolving and the kernels are used in very special
  173. cases for BSP and feature development.
  174. </para>
  175. </section>
  176. <section id='kernel-architecture'>
  177. <title>Kernel Architecture</title>
  178. <para>
  179. This section describes the architecture of the Yocto Project kernel and provides information
  180. on the mechanisms used to achieve that architecture.
  181. </para>
  182. <section id='architecture-overview'>
  183. <title>Overview</title>
  184. <para>
  185. As mentioned earlier, a key goal of Yocto Project is to present the developer with
  186. a kernel that has a clear and continuous history that is visible to the user.
  187. The architecture and mechanisms used achieve that goal in a manner similar to the
  188. upstream kernel.org.
  189. </para>
  190. <para>
  191. You can think of the Yocto Project kernel as consisting of a baseline kernel with
  192. added features logically structured on top of the baseline.
  193. The features are tagged and organized by way of a branching strategy implemented by the
  194. source code manager (SCM) git.
  195. The result is that the user has the ability to see the added features and
  196. the commits that make up those features.
  197. In addition to being able to see added features, the user can also view the history of what
  198. made up the baseline kernel as well.
  199. </para>
  200. <para>
  201. The following illustration shows the conceptual Yocto Project kernel.
  202. </para>
  203. <para>
  204. <imagedata fileref="figures/kernel-architecture-overview.png" width="6in" depth="4in" align="center" scale="100" />
  205. </para>
  206. <para>
  207. In the illustration, the "kernel.org Branch Point" marks the specific spot (or release) from
  208. which the Yocto Project kernel is created. From this point "up" in the tree features and
  209. differences are organized and tagged.
  210. </para>
  211. <para>
  212. The "Yocto Project Baseline Kernel" contains functionality that is common to every kernel
  213. type and BSP that is organized further up the tree. Placing these common features in the
  214. tree this way means features don't have to be duplicated along individual branches of the
  215. structure.
  216. </para>
  217. <para>
  218. From the Yocto Project Baseline Kernel branch points represent specific functionality
  219. for individual BSPs as well as real-time kernels.
  220. The illustration represents this through three BSP-specific branches and a real-time
  221. kernel branch.
  222. Each branch represents some unique functionality for the BSP or a real-time kernel.
  223. </para>
  224. <para>
  225. The real-time kernel branch has common features for all real-time kernels and contains
  226. more branches for individual BSP-specific real-time kernels.
  227. The illustration shows three branches as an example.
  228. Each branch points the way to specific, unique features for a respective real-time
  229. kernel as they apply to a given BSP.
  230. </para>
  231. <para>
  232. The resulting tree structure presents a clear path of markers (or branches) to the user
  233. that for all practical purposes is the kernel needed for any given set of requirements.
  234. </para>
  235. </section>
  236. <section id='branching-and-workflow'>
  237. <title>Branching Strategy and Workflow</title>
  238. <para>
  239. The Yocto Project team creates kernel branches at points where functionality is
  240. no longer shared and thus, needs to be isolated.
  241. For example, board-specific incompatibilities would require different functionality
  242. and would require a branch to separate the features.
  243. Likewise, for specific kernel features the same branching strategy is used.
  244. This branching strategy results in a tree that has features organized to be specific
  245. for particular functionality, single kernel types, or a subset of kernel types.
  246. This strategy results in not having to store the same feature twice internally in the
  247. tree.
  248. Rather we store the unique differences required to apply the feature onto the kernel type
  249. in question.
  250. </para>
  251. <para>
  252. BSP-specific code additions are handled in a similar manner to kernel-specific additions.
  253. Some BSPs only make sense given certain kernel types.
  254. So, for these types, we create branches off the end of that kernel type for all
  255. of the BSPs that are supported on that kernel type.
  256. From the perspective of the tools that create the BSP branch, the BSP is really no
  257. different than a feature.
  258. Consequently, the same branching strategy applies to BSPs as it does to features.
  259. So again, rather than store the BSP twice, only the unique differences for the BSP across
  260. the supported multiple kernels are uniquely stored.
  261. </para>
  262. <para>
  263. While this strategy results in a tree with a significant number of branches, it is
  264. important to realize that from the customer's point of view, there is a linear
  265. path that travels from the baseline kernel.org, through a select group of features and
  266. ends with their BSP-specific commits.
  267. In other words, the divisions of the kernel are transparent and are not relevant
  268. to the developer on a day-to-day basis.
  269. From the customer's perspective, this is the "master" branch.
  270. They do not need not be aware of the existence of any other branches at all.
  271. Of course there is value in the existence of these branches
  272. in the tree, should a person decide to explore them.
  273. For example, a comparison between two BSPs at either the commit level or at the line-by-line
  274. code diff level is now a trivial operation.
  275. </para>
  276. <para>
  277. Working with the kernel as a structured tree follows recognized community best practices.
  278. In particular, the kernel as shipped with the product should be
  279. considered an 'upstream source' and viewed as a series of
  280. historical and documented modifications (commits).
  281. These modifications represent the development and stabilization done
  282. by the Yocto Project kernel development team.
  283. </para>
  284. <para>
  285. Because commits only change at significant release points in the product life cycle,
  286. developers can work on a branch created
  287. from the last relevant commit in the shipped Yocto Project kernel.
  288. As mentioned previously, the structure is transparent to the user
  289. because the kernel tree is left in this state after cloning and building the kernel.
  290. </para>
  291. </section>
  292. <section id='source-code-manager-git'>
  293. <title>Source Code Manager - git</title>
  294. <para>
  295. The Source Code Manager (SCM) is git and it is the obvious mechanism for meeting the
  296. previously mentioned goals.
  297. Not only is it the SCM for kernel.org but git continues to grow in popularity and
  298. supports many different work flows, front-ends and management techniques.
  299. </para>
  300. <note><para>
  301. It should be noted that you can use as much, or as little, of what git has to offer
  302. as is appropriate to your project.
  303. </para></note>
  304. </section>
  305. </section>
  306. <section id='kernel-tools'>
  307. <title>Kernel Tools</title>
  308. <para>
  309. Since most standard workflows involve moving forward with an existing tree by
  310. continuing to add and alter the underlying baseline, the tools that manage
  311. Yocto Project's kernel construction are largely hidden from the developer to
  312. present a simplified view of the kernel for ease of use.
  313. </para>
  314. <para>
  315. The fundamental properties of the tools that manage and construct the
  316. kernel are:
  317. <itemizedlist>
  318. <listitem><para>the ability to group patches into named, reusable features</para></listitem>
  319. <listitem><para>to allow top down control of included features</para></listitem>
  320. <listitem><para>the binding of kernel configuration to kernel patches/features</para></listitem>
  321. <listitem><para>the presentation of a seamless git repository that blends Yocto Project value with the kernel.org history and development</para></listitem>
  322. </itemizedlist>
  323. </para>
  324. <para>
  325. The tools that construct a kernel tree will be discussed later in this
  326. document. The following tools form the foundation of the Yocto Project
  327. kernel toolkit:
  328. <itemizedlist>
  329. <listitem><para>git : distributed revision control system created by Linus Torvalds</para></listitem>
  330. <listitem><para>guilt: quilt on top of git</para></listitem>
  331. <listitem><para>*cfg : kernel configuration management and classification</para></listitem>
  332. <listitem><para>kgit*: Yocto Project kernel tree creation and management tools</para></listitem>
  333. <listitem><para>scc : series &amp; configuration compiler</para></listitem>
  334. </itemizedlist>
  335. </para>
  336. </section>
  337. </section>
  338. <!-- <section id='concepts2'>
  339. <title>Kernel Concepts</title>
  340. <itemizedlist>
  341. <listitem><para>What tools and commands are used with the kernel.</para></listitem>
  342. <listitem><para>Source Control Manager (SCM).</para></listitem>
  343. <listitem><para>What are some workflows that you can apply using the kernel.</para></listitem>
  344. </itemizedlist>
  345. </section> -->
  346. <section id='actions'>
  347. <title>How to get things accomplished with the kernel</title>
  348. <para>
  349. This section describes how to accomplish tasks involving the kernel's tree structure.
  350. The information covers the following:
  351. <itemizedlist>
  352. <listitem><para>Tree construction</para></listitem>
  353. <listitem><para>Build strategies</para></listitem>
  354. <listitem><para>Series &amp; Configuration Compiler</para></listitem>
  355. <listitem><para>kgit</para></listitem>
  356. <listitem><para>Workflow examples</para></listitem>
  357. <listitem><para>Source Code Manager (SCM)</para></listitem>
  358. <listitem><para>Board Support Package (BSP) template migration</para></listitem>
  359. <listitem><para>BSP creation</para></listitem>
  360. <listitem><para>Patching</para></listitem>
  361. <listitem><para>Updating BSP patches and configuration</para></listitem>
  362. <listitem><para>guilt</para></listitem>
  363. <listitem><para>scc file example</para></listitem>
  364. <listitem><para>"dirty" string</para></listitem>
  365. <listitem><para>Transition kernel layer</para></listitem>
  366. </itemizedlist>
  367. </para>
  368. <section id='tree-construction'>
  369. <title>Tree Construction</title>
  370. <para>
  371. The Yocto Project kernel repository, as shipped with the product, is created by
  372. compiling and executing the set of feature descriptions for every BSP/feature
  373. in the product. Those feature descriptions list all necessary patches,
  374. configuration, branching, tagging and feature divisions found in the kernel.
  375. </para>
  376. <para>
  377. The files used to describe all the valid features and BSPs in the Yocto Project
  378. kernel can be found in any clone of the kernel git tree. The directory
  379. wrs/cfg/kernel-cache/ is a snapshot of all the kernel configuration and
  380. feature descriptions (.scc) that were used to build the kernel repository.
  381. It should however be noted, that browsing the snapshot of feature
  382. descriptions and patches is not an effective way to determine what is in a
  383. particular kernel branch. Using git directly to get insight into the changes
  384. in a branch is more efficient and a more flexible way to inspect changes to
  385. the kernel. Examples of using git to inspect kernel commits are in the
  386. following sections.
  387. </para>
  388. <para>
  389. As a reminder, it is envisioned that a ground up reconstruction of the
  390. complete kernel tree is an action only taken by Yocto Project staff during an
  391. active development cycle. When an end user creates a project, it takes
  392. advantage of this complete tree in order to efficiently place a git tree
  393. within their project.
  394. </para>
  395. <para>
  396. The general flow of the project specific kernel tree construction is as follows:
  397. <orderedlist>
  398. <listitem><para>a top level kernel feature is passed to the kernel build subsystem,
  399. normally this is a BSP for a particular kernel type.</para></listitem>
  400. <listitem><para>the file that describes the top level feature is located by searching
  401. system directories:</para>
  402. <itemizedlist>
  403. <listitem><para>the kernel-cache under linux/wrs/cfg/kernel-cache</para></listitem>
  404. <listitem><para>kernel-*-cache directories in layers</para></listitem>
  405. <listitem><para>configured and default templates</para></listitem>
  406. </itemizedlist>
  407. <para>In a typical build a feature description of the format:
  408. &lt;bsp name&gt;-&lt;kernel type&gt;.scc is the target of the search.
  409. </para></listitem>
  410. <listitem><para>once located, the feature description is compiled into a simple script
  411. of actions, or an existing equivalent script which was part of the
  412. shipped kernel is located.</para></listitem>
  413. <listitem><para>extra features are appended to the top level feature description. Extra
  414. features can come from the command line, the configure script or
  415. templates.</para></listitem>
  416. <listitem><para>each extra feature is located, compiled and appended to the script from
  417. step #3</para></listitem>
  418. <listitem><para>the script is executed, and a meta-series is produced. The meta-series
  419. is a description of all the branches, tags, patches and configuration that
  420. need to be applied to the base git repository to completely create the
  421. "bsp_name-kernel_type".</para></listitem>
  422. <listitem><para>the base repository (normally kernel.org) is cloned, and the actions
  423. listed in the meta-series are applied to the tree.</para></listitem>
  424. <listitem><para>the git repository is left with the desired branch checked out and any
  425. required branching, patching and tagging has been performed.</para></listitem>
  426. </orderedlist>
  427. </para>
  428. <para>
  429. The tree is now ready for configuration and compilation. Those two topics will
  430. be covered below.
  431. </para>
  432. <note><para>The end user generated meta-series adds to the kernel as shipped with
  433. the Yocto Project release. Any add-ons and configuration data are applied
  434. to the end of an existing branch. The full repository generation that
  435. is found in the linux-2.6-windriver.git is the combination of all
  436. supported boards and configurations.
  437. </para></note>
  438. <para>
  439. This technique is flexible and allows the seamless blending of an immutable
  440. history with additional deployment specific patches. Any additions to the
  441. kernel become an integrated part of the branches.
  442. </para>
  443. <note><para>It is key that feature descriptions indicate if any branches are
  444. required, since the build system cannot automatically decide where a
  445. BSP should branch or if that branch point needs a name with
  446. significance. There is a single restriction enforced by the compilation
  447. phase:
  448. </para>
  449. <para>A BSP must create a branch of the format &lt;bsp name&gt;-&lt;kernel type&gt;.</para>
  450. <para>This means that all merged/support BSPs must indicate where to start
  451. its branch from, with the right name, in its .scc files. The scc
  452. section describes the available branching commands in more detail.
  453. </para>
  454. </note>
  455. <para>
  456. A summary of end user tree construction activities follow:
  457. <itemizedlist>
  458. <listitem><para>compile and link a full top-down kernel description from feature descriptions</para></listitem>
  459. <listitem><para>execute the complete description to generate a meta-series</para></listitem>
  460. <listitem><para>interpret the meta-series to create a customized git repository for the
  461. board</para></listitem>
  462. <listitem><para>migrate configuration fragments and configure the kernel</para></listitem>
  463. <listitem><para>checkout the BSP branch and build</para></listitem>
  464. </itemizedlist>
  465. </para>
  466. </section>
  467. <section id='build-strategy'>
  468. <title>Build Strategy</title>
  469. <para>
  470. There are some prerequisites that must be met before starting the compilation
  471. phase of the kernel build system:
  472. </para>
  473. <itemizedlist>
  474. <listitem><para>There must be a kernel git repository indicated in the SRC_URI.</para></listitem>
  475. <listitem><para>There must be a branch &lt;bsp name&gt;-&lt;kernel type&gt;.</para></listitem>
  476. </itemizedlist>
  477. <para>
  478. These are typically met by running tree construction/patching phase of the
  479. build system, but can be achieved by other means. Examples of alternate work
  480. flows such as bootstrapping a BSP are provided below.
  481. </para>
  482. <para>
  483. Before building a kernel it is configured by processing all of the
  484. configuration "fragments" specified by the scc feature descriptions. As the
  485. features are compiled, associated kernel configuration fragments are noted
  486. and recorded in the meta-series in their compilation order. The
  487. fragments are migrated, pre-processed and passed to the Linux Kernel
  488. Configuration subsystem (lkc) as raw input in the form of a .config file.
  489. The lkc uses its own internal dependency constraints to do the final
  490. processing of that information and generates the final .config that will
  491. be used during compilation.
  492. </para>
  493. <para>
  494. Kernel compilation is started, using the board's architecture and other
  495. relevant values from the board template, and a kernel image is produced.
  496. </para>
  497. <para>
  498. The other thing that you will first see once you configure a kernel is that
  499. it will generate a build tree that is separate from your git source tree.
  500. This build dir will be called "linux-&lt;BSPname&gt;-&lt;kerntype&gt;-build" where
  501. kerntype is one of standard, cg``
  502. e, etc. This functionality is done by making
  503. use of the existing support that is within the kernel.org tree by default.
  504. </para>
  505. <para>
  506. What this means, is that all the generated files (that includes the final
  507. ".config" itself, all ".o" and ".a" etc) are now in this directory. Since
  508. the git source tree can contain any number of BSPs, all on their own branch,
  509. you now can easily switch between builds of BSPs as well, since each one also
  510. has their own separate build directory.
  511. </para>
  512. </section>
  513. <section id='scc'>
  514. <title>Series &amp; Configuration Compiler (SCC)</title>
  515. <para>
  516. In early versions of the product, kernel patches were simply listed in a flat
  517. file called "patches.list", and then quilt was added as a tool to help
  518. traverse this list, which in quilt terms was called a "series" file.
  519. </para>
  520. <para>
  521. Before the 2.0 release, it was already apparent that a static series file was
  522. too inflexible, and that the series file had to become more dynamic and rely
  523. on certain state (like kernel type) in order to determine whether a patch was
  524. to be used or not. The 2.0 release already made use of some stateful
  525. construction of series files, but since the delivery mechanism was unchanged
  526. (tar + patches + series files), most people were not aware of anything really
  527. different. The 3.0 release continues with this stateful construction of
  528. series files, but since the delivery mechanism is changed (git + branches) it
  529. now is more apparent to people.
  530. </para>
  531. <para>
  532. As was previously mentioned, scc is a "series and configuration
  533. compiler". Its role is to combine feature descriptions into a format that can
  534. be used to generate a meta-series. A meta series contains all the required
  535. information to construct a complete set of branches that are required to
  536. build a desired board and feature set. The meta series is interpreted by the
  537. kgit tools to create a git repository that could be built.
  538. </para>
  539. <para>
  540. To illustrate how scc works, a feature description must first be understood.
  541. A feature description is simply a small bash shell script that is executed by
  542. scc in a controlled environment. Each feature description describes a set of
  543. operations that add patches, modify existing patches or configure the
  544. kernel. It is key that feature descriptions can include other features, and
  545. hence allow the division of patches and configuration into named, reusable
  546. containers.
  547. </para>
  548. <para>
  549. Each feature description can use any of the following valid scc commands:
  550. <itemizedlist>
  551. <listitem><para>shell constructs: bash conditionals and other utilities can be used in a feature
  552. description. During compilation, the working directory is the feature
  553. description itself, so any command that is "raw shell" and not from the
  554. list of supported commands, can not directly modify a git repository.</para></listitem>
  555. <listitem><para>patch &lt;relative path&gt;/&lt;patch name&gt;: outputs a patch to be included in a feature's patch set. Only the name of
  556. the patch is supplied, the path is calculated from the currently set
  557. patch directory, which is normally the feature directory itself.</para></listitem>
  558. <listitem><para>patch_trigger &gt;condition&lt; &gt;action&lt; &lt;tgt&gt;: indicate that a trigger should be set to perform an action on a
  559. patch.</para>
  560. <para>The conditions can be:
  561. <itemizedlist>
  562. <listitem><para>arch:&lt;comma separated arch list or "all"&gt;</para></listitem>
  563. <listitem><para>plat:&lt;comma separated platform list or "all"&gt;</para></listitem>
  564. </itemizedlist></para>
  565. <para>The action can be:
  566. <itemizedlist>
  567. <listitem><para>exclude: This is used in exceptional situations where a patch
  568. cannot be applied for certain reasons (arch or platform).
  569. When the trigger is satisfied the patch will be removed from
  570. the patch list.</para></listitem>
  571. <listitem><para>include: This is used to include a patch only for a specific trigger.
  572. Like exclude, this should only be used when necessary.
  573. It takes 1 argument, the patch to include.</para></listitem>
  574. </itemizedlist></para></listitem>
  575. <listitem><para>include &lt;feature name&gt; [after &lt;feature&gt;]: includes a feature for processing. The feature is "expanded" at the
  576. position of the include directive. This means that any patches,
  577. configuration or sub-includes of the feature will appear in the final
  578. series before the commands that follow the include.</para>
  579. <para>
  580. include searches the include directories for a matching feature name,
  581. include directories are passed to scc by the caller using -I &lt;path&gt; and
  582. is transparent to the feature script. This means that &lt;feature name&gt; must
  583. be relative to one of the search paths. For example, if
  584. /opt/kernel-cache/feat/sched.scc is to be included and scc is invoked
  585. with -I /opt/kernel-cache, then a feature would issue "include
  586. feat/sched.scc" to include the feature.
  587. </para>
  588. <para>
  589. The optional "after" directive allows a feature to modify the existing
  590. order of includes and insert a feature after the named feature is
  591. processed. Note: the "include foo after bar" must be issued before "bar"
  592. is processed, so is normally only used by a new top level feature to
  593. modify the order of features in something it is including.</para></listitem>
  594. <listitem><para>exclude &lt;feature name&gt;: Indicates that a particular feature should *not* be included even if an
  595. 'include' directive is found. The exclude must be issued before the
  596. include is processed, so is normally only used by a new top level feature
  597. to modify the order of features in something it is including.</para></listitem>
  598. <listitem><para>git &lt;command&gt;: Issues any git command during tree construction. Note: this command is
  599. not validated/sanitized so care must be taken to not damage the
  600. tree. This can be used to script branching, tagging, pulls or other git
  601. operations.</para></listitem>
  602. <listitem><para>dir &lt;directory&gt;: changes the working directory for "patch" directives. This can be used to
  603. shorten a long sequence of patches by not requiring a common relative
  604. directory to be issued each time.</para></listitem>
  605. <listitem><para>kconf &lt;type&gt; &lt;fragment name&gt;: associates a kernel config frag with the feature.
  606. &lt;type&gt; can be
  607. "hardware" or "non-hardware" and is used by the kernel configuration
  608. subsystem to audit configuration. &lt;fragment name&gt; is the name of a file
  609. in the current feature directory that contains a series of kernel
  610. configuration options. There is no restriction on the chosen fragment
  611. name, although a suffix of ".cfg" is recommended. Multiple fragment
  612. specifications are supported.</para></listitem>
  613. <listitem><para>branch &lt;branch name&gt;: creates a branch in the tree. All subsequent patch commands will be
  614. applied to the new branch and changes isolated from the rest of the
  615. repository.</para></listitem>
  616. <listitem><para>scc_leaf &lt;base feature&gt; &lt;branch name&gt;: Performs a combination feature include and branch. This is mainly a
  617. convenience directive, but has significance to some build system bindings
  618. as a sentinel to indicate that this intends to create a branch that is
  619. valid for kernel compilation.</para></listitem>
  620. <listitem><para>tag &lt;tag name&gt;: Tags the tree. The tag will be applied in processing order, so will
  621. be after already applied patches and precede patches yet to be applied.</para></listitem>
  622. <listitem><para>define &lt;var&gt; &lt;value&gt;: Creates a variable with a particular value that can be used in subsequent
  623. feature descriptions.</para></listitem>
  624. </itemizedlist>
  625. </para>
  626. </section>
  627. <section id='kgit-tools'>
  628. <title>kgit Tools</title>
  629. <para>
  630. The kgit tools are responsible for constructing and maintaining the Wind
  631. River kernel repository. These activities include importing, exporting, and
  632. applying patches as well as sanity checking and branch management. From the
  633. developers perspective, the kgit tools are hidden and rarely require
  634. interactive use. But one tool in particular that warrants further description
  635. is "kgit-meta".
  636. </para>
  637. <para>
  638. kgit-meta is the actual application of feature description(s) to a kernel repo.
  639. In other words, it is responsible for interpreting the meta series generated
  640. from a scc compiled script. As a result, kgit-meta is coupled to the set of
  641. commands permitted in a .scc feature description (listed in the scc section).
  642. kgit-meta understands both the meta series format and how to use git and
  643. guilt to modify a base git repository. It processes a meta-series line by
  644. line, branching, tagging, patching and tracking changes that are made to the
  645. base git repository.
  646. </para>
  647. <para>
  648. Once kgit-meta has processed a meta-series, it leaves the repository with the
  649. last branch checked out, and creates the necessary guilt infrastructure to
  650. inspect the tree, or add to it via using guilt. As was previously mentioned,
  651. guilt is not required, but is provided as a convenience. Other utilities such
  652. as quilt, stgit, git or others can also be used to manipulate the git
  653. repository.
  654. </para>
  655. </section>
  656. <section id='workflow-examples'>
  657. <title>Workflow Examples</title>
  658. <para>
  659. As previously noted, the Yocto Project kernel has built in git/guilt
  660. integration, but these utilities are not the only way to work with the kernel
  661. repository. Yocto Project has not made changes to git, or other tools that
  662. invalidate alternate workflows. Additionally, the way the kernel repository
  663. is constructed uses only core git functionality allowing any number of tools
  664. or front ends to use the resulting tree.</para>
  665. <para>
  666. This section contains several workflow examples.
  667. </para>
  668. <section id='change-inspection-kernel-changes-commits'>
  669. <title>Change Inspection: Kernel Changes/Commits</title>
  670. <para>
  671. A common question when working with a BSP/kernel is: "What changes have been applied to this tree?"
  672. </para>
  673. <para>
  674. In previous Yocto Project releases, there were a collection of directories that
  675. contained patches to the kernel, those patches could be inspected, grep'd or
  676. otherwise used to get a general feeling for changes. This sort of patch
  677. inspection is not an efficient way to determine what has been done to the
  678. kernel, since there are many optional patches that are selected based on the
  679. kernel type and feature description, not to mention patches that are actually
  680. in directories that are not being searched.
  681. </para>
  682. <para>
  683. A more effective way to determine what has changed in the kernel is to use
  684. git and inspect / search the kernel tree. This is a full view of not only the
  685. source code modifications, but the reasoning behind the changes.
  686. </para>
  687. <section id='what-changed-in-a-bsp'>
  688. <title>What Changed in a BSP?</title>
  689. <para>
  690. These examples could continue for some time, since the Yocto Project git
  691. repository doesn't break existing git functionality and there are nearly
  692. endless permutations of those commands. Also note that unless a commit range
  693. is given (&lt;kernel type&gt;..&lt;bsp&gt;-&lt;kernel type&gt;), kernel.org history is blended
  694. with Yocto Project changes
  695. </para>
  696. <literallayout class='monospaced'>
  697. # full description of the changes
  698. &gt; git whatchanged &lt;kernel type&gt;..&lt;bsp&gt;-&lt;kernel type&gt;
  699. &gt; eg: git whatchanged standard..common_pc-standard
  700. # summary of the changes
  701. &gt; git log &dash;&dash;pretty=oneline &dash;&dash;abbrev-commit &lt;kernel type&gt;..&lt;bsp&gt;-&lt;kernel type&gt;
  702. # source code changes (one combined diff)
  703. &gt; git diff &lt;kernel type&gt;..&lt;bsp&gt;-&lt;kernel type&gt;
  704. &gt; git show &lt;kernel type&gt;..&lt;bsp&gt;-&lt;kernel type&gt;
  705. # dump individual patches per commit
  706. &gt; git format-patch -o &lt;dir&gt; &lt;kernel type&gt;..&lt;bsp&gt;-&lt;kernel type&gt;
  707. # determine the change history of a particular file
  708. &gt; git whatchanged &lt;path to file&gt;
  709. # determine the commits which touch each line in a file
  710. &gt; git blame &lt;path to file&gt;
  711. </literallayout>
  712. </section>
  713. <section id='show-a-particular-feature-or-branch-change'>
  714. <title>Show a Particular Feature or Branch Change</title>
  715. <para>
  716. Significant features or branches are tagged in the Yocto Project tree to divide
  717. changes. Remember to first determine (or add) the tag of interest. Note:
  718. there will be many tags, since each BSP branch is tagged, kernel.org tags and
  719. feature tags are all present.
  720. </para>
  721. <literallayout class='monospaced'>
  722. # show the changes tagged by a feature
  723. &gt; git show &lt;tag&gt;
  724. &gt; eg: git show yaffs2
  725. # determine which branches contain a feature
  726. &gt; git branch &dash;&dash;contains &lt;tag&gt;
  727. # show the changes in a kernel type
  728. &gt; git whatchanged wrs_base..&lt;kernel type&gt;
  729. &gt; eg: git whatchanged wrs_base..standard
  730. </literallayout>
  731. <para>
  732. Many other comparisons can be done to isolate BSP changes, such as comparing
  733. to kernel.org tags (v2.6.27.18, etc), per subsystem comparisons (git
  734. whatchanged mm) or many other types of checks.
  735. </para>
  736. </section>
  737. </section>
  738. <section id='development-saving-kernel-modifications'>
  739. <title>Development: Saving Kernel Modifications</title>
  740. <para>
  741. Another common operation is to build a Yocto Project supplied BSP, make some
  742. changes, rebuild and test. Those local changes often need to be exported,
  743. shared or otherwise maintained.
  744. </para>
  745. <para>
  746. Since the Yocto Project kernel source tree is backed by git, this activity is
  747. greatly simplified and is much easier than in previous releases. git tracks
  748. file modifications, additions and deletions, which allows the developer to
  749. modify the code and later realize that the changes should be saved, and
  750. easily determine what was changed. It also provides many tools to commit,
  751. undo and export those modifications.
  752. </para>
  753. <para>
  754. There are many ways to perform this action, and the technique employed
  755. depends on the destination for the patches, which could be any of:
  756. <itemizedlist>
  757. <listitem><para>bulk storage</para></listitem>
  758. <listitem><para>internal sharing either through patches or using git</para></listitem>
  759. <listitem><para>external submission</para></listitem>
  760. <listitem><para>export for integration into another SCM</para></listitem>
  761. </itemizedlist>
  762. </para>
  763. <para>
  764. The destination of the patches also incluences the method of gathering them
  765. due to issues such as:
  766. <itemizedlist>
  767. <listitem><para>bisectability</para></listitem>
  768. <listitem><para>commit headers</para></listitem>
  769. <listitem><para>division of subsystems for separate submission / review</para></listitem>
  770. </itemizedlist>
  771. </para>
  772. <section id='bulk-export'>
  773. <title>Bulk Export</title>
  774. <para>
  775. If patches are simply being stored outside of the kernel source repository,
  776. either permanently or temporarily, then there are several methods that can be
  777. used.
  778. </para>
  779. <para>
  780. Note the "bulk" in this discussion, these techniques are not appropriate for
  781. full integration of upstream submission, since they do not properly divide
  782. changes or provide an avenue for per-change commit messages. This example
  783. assumes that changes have not been committed incrementally during development
  784. and simply must be gathered and exported.
  785. <literallayout class='monospaced'>
  786. # bulk export of ALL modifications without separation or division
  787. # of the changes
  788. &gt; git add .
  789. &gt; git commit -s -a -m &gt;commit message&lt;
  790. or
  791. &gt; git commit -s -a # and interact with $EDITOR
  792. </literallayout>
  793. </para>
  794. <para>
  795. These operations have captured all the local changes in the project source
  796. tree in a single git commit, and that commit is also stored in the project's
  797. source tree.
  798. </para>
  799. <para>
  800. Once exported, those changes can then be restored manually, via a template or
  801. through integration with the default_kernel. Those topics are covered in
  802. future sections.
  803. </para>
  804. </section>
  805. <section id='incremental-planned-sharing'>
  806. <title>Incremental/Planned Sharing</title>
  807. <para>
  808. Note: unlike the previous "bulk" section, the following examples assume that
  809. changes have been incrementally committed to the tree during development and
  810. now are being exported.
  811. </para>
  812. <para>
  813. During development the following commands will be of interest, but for full
  814. git documentation refer to the git man pages or an online resource such as
  815. http://github.com
  816. <literallayout class='monospaced'>
  817. # edit a file
  818. &gt; vi &gt;path&lt;/file
  819. # stage the change
  820. &gt; git add &gt;path&lt;/file
  821. # commit the change
  822. &gt; git commit -s
  823. # remove a file
  824. &gt; git rm &gt;path&lt;/file
  825. # commit the change
  826. &gt; git commit -s
  827. ... etc.
  828. </literallayout>
  829. </para>
  830. <para>
  831. Distributed development with git is possible by having a universally agreed
  832. upon unique commit identifier (set by the creator of the commit) mapping to a
  833. specific changeset with a specific parent. This ID is created for you when
  834. you create a commit, and will be re-created when you amend/alter or re-apply
  835. a commit. As an individual in isolation, this is of no interest, but if you
  836. intend to share your tree with normal git push/pull operations for
  837. distributed development, you should consider the ramifications of changing a
  838. commit that you've already shared with others.
  839. </para>
  840. <para>
  841. Assuming that the changes have *not* been pushed upstream, or pulled into
  842. another repository, both the commit content and commit messages associated
  843. with development can be update via:
  844. <literallayout class='monospaced'>
  845. &gt; git add &gt;path&lt;/file
  846. &gt; git commit &dash;&dash;amend
  847. &gt; git rebase or git rebase -i
  848. </literallayout>
  849. </para>
  850. <para>
  851. Again, assuming that the changes have *not* been pushed upstream, and that
  852. there are no pending works in progress (use "git status" to check) then
  853. commits can be reverted (undone) via:
  854. <literallayout class='monospaced'>
  855. # remove the commit, update working tree and remove all
  856. # traces of the change
  857. &gt; git reset &dash;&dash;hard HEAD^
  858. # remove the commit, but leave the files changed and staged for re-commit
  859. &gt; git reset &dash;&dash;soft HEAD^
  860. # remove the commit, leave file change, but not staged for commit
  861. &gt; git reset &dash;&dash;mixed HEAD^
  862. </literallayout>
  863. </para>
  864. <para>
  865. Branches can be created, changes cherry-picked or any number of git
  866. operations performed until the commits are in good order for pushing upstream
  867. or pull requests. After a push or pull, commits are normally considered
  868. 'permanent' and should not be modified, only incrementally changed in new
  869. commits. This is standard "git" workflow and Yocto Project recommends the
  870. kernel.org best practices.
  871. </para>
  872. <note><para>It is recommend to tag or branch before adding changes to a Yocto Project
  873. BSP (or creating a new one), since the branch or tag provides a
  874. reference point to facilitate locating and exporting local changes.
  875. </para></note>
  876. <section id='export-internally-via-patches'>
  877. <title>Export Internally Via Patches</title>
  878. <para>
  879. Committed changes can be extracted from a working directory by exporting them
  880. as patches. Those patches can be used for upstream submission, placed in a
  881. Yocto Project template for automatic kernel patching or many other common uses.
  882. <literallayout class='monospaced'>
  883. # &gt;first commit&gt; can be a tag if one was created before development
  884. # began. It can also be the parent branch if a branch was created
  885. # before development began.
  886. &gt; git format-patch -o &lt;dir&gt; &lt;first commit&gt;..&lt;last commit&gt;
  887. </literallayout>
  888. </para>
  889. <para>
  890. In other words:
  891. <literallayout class='monospaced'>
  892. # identify commits of interest.
  893. # if the tree was tagged before development
  894. &gt; git format-patch -o &lt;save dir&gt; &lt;tag&gt;
  895. # if no tags are available
  896. &gt; git format-patch -o &lt;save dir&gt; HEAD^ # last commit
  897. &gt; git format-patch -o &lt;save dir&gt; HEAD^^ # last 2 commits
  898. &gt; git whatchanged # identify last commit
  899. &gt; git format-patch -o &lt;save dir&gt; &lt;commit id&gt;
  900. &gt; git format-patch -o &lt;save dir&gt; &lt;rev-list&gt;
  901. </literallayout>
  902. </para>
  903. <para>
  904. The result is a directory with sequentially numbered patches, that when
  905. applied to a repository using "git am", will reproduce the original commit
  906. and all related information (author, date, commit log, etc) will be
  907. preserved. Note that new commit IDs will be generated upon reapplication,
  908. reflecting that the commit is now applied to an underlying commit with a
  909. different ID.
  910. </para>
  911. <para>
  912. See the "template patching" example for how to use the patches to
  913. automatically apply to a new kernel build.
  914. </para>
  915. </section>
  916. <section id='export-internally-via-git'>
  917. <title>Export Internally Via git</title>
  918. <para>
  919. Committed changes can also be exported from a working directory by pushing
  920. (or by making a pull request) the changes into a master repository. Those
  921. same change can then be pulled into a new kernel build at a later time using this command form:
  922. <literallayout class='monospaced'>
  923. git push ssh://&lt;master server&gt;/&lt;path to repo&gt; &lt;local branch&gt;:&lt;remote branch&gt;
  924. </literallayout>
  925. For example:
  926. <literallayout class='monospaced'>
  927. &gt; push ssh://openlinux.windriver.com/pub/git/kernel-2.6.27 common_pc-standard:common_pc-standard
  928. </literallayout>
  929. A pull request entails using "git request-pull" to compose an email to the
  930. maintainer requesting that a branch be pulled into the master repository, see
  931. http://github.com/guides/pull-requests for an example.
  932. </para>
  933. <para>
  934. Other commands such as 'git stash' or branching can also be used to save
  935. changes, but are not covered in this document.
  936. </para>
  937. <para>
  938. See the section "importing from another SCM" for how a git push to the
  939. default_kernel, can be used to automatically update the builds of all users
  940. of a central git repository.
  941. </para>
  942. </section>
  943. </section>
  944. <section id='export-for-external-upstream-submission'>
  945. <title>Export for External (Upstream) Submission</title>
  946. <para>
  947. If patches are to be sent for external submission, they can be done via a
  948. pull request if the patch series is large or the maintainer prefers to pull
  949. changes. But commonly, patches are sent as email series for easy review and
  950. integration.
  951. </para>
  952. <note><para>
  953. Before sending patches for review ensure that you understand the
  954. standard of the community in question and follow their best practices. For
  955. example, kernel patches should follow standards such as:
  956. <itemizedlist>
  957. <listitem><para><ulink url='http://userweb.kernel.org/~akpm/stuff/tpp.txt'></ulink></para></listitem>
  958. <listitem><para><ulink url='http://linux.yyz.us/patch-format.html'></ulink></para></listitem>
  959. <listitem><para>Documentation/SubmittingPatches (in any linux kernel source tree)</para></listitem>
  960. </itemizedlist>
  961. </para></note>
  962. <para>
  963. The messages used to commit changes are a large part of these standards, so
  964. ensure that the headers for each commit have the required information. If the
  965. initial commits were not properly documented or don't meet those standards
  966. rebasing via git rebase -i offer an opportunity to manipulate the commits and
  967. get them into the required format. Other techniques such as branching and
  968. cherry picking commits are also viable options.
  969. </para>
  970. <para>
  971. Once complete, patches are sent via email to the maintainer(s) or lists that
  972. review and integrate changes. "git send-email" is commonly used to ensure
  973. that patches are properly formatted for easy application and avoid mailer
  974. induced patch damage.
  975. </para>
  976. <para>
  977. An example of dumping patches for external submission follows:
  978. <literallayout class='monospaced'>
  979. # dump the last 4 commits
  980. &gt; git format-patch &dash;&dash;thread -n -o ~/rr/ HEAD^^^^
  981. &gt; git send-email &dash;&dash;compose &dash;&dash;subject '[RFC 0/N] &lt;patch series summary&gt;' \
  982. &dash;&dash;to foo@yoctoproject.org &dash;&dash;to bar@yoctoproject.org \
  983. &dash;&dash;cc list@yoctoproject.org ~/rr
  984. # the editor is invoked for the 0/N patch, and when complete the entire
  985. # series is sent via email for review
  986. </literallayout>
  987. </para>
  988. </section>
  989. <section id='export-for-import-into-other-scm'>
  990. <title>Export for Import into Other SCM</title>
  991. <para>
  992. Using any one of the previously discussed techniques, commits can be exported
  993. as patches for import into another SCM. Note however, that if those patches
  994. are manually applied to a secondary tree and then that secondary tree is
  995. checked into the SCM, then it often results in lost information (like commit
  996. logs) and so it is not recommended.
  997. </para>
  998. <para>
  999. Many SCMs can directly import git commits, or can translate git patches to
  1000. not lose information. Those facilities are SCM dependent and should be used
  1001. whenever possible.
  1002. </para>
  1003. </section>
  1004. </section>
  1005. <section id='scm-working-with-the-yocto-project-kernel-in-another-scm'>
  1006. <title>SCM: Working with the Yocto Project Kernel in Another SCM</title>
  1007. <para>
  1008. This is not the same as the exporting of patches to another SCM, but instead
  1009. is concerned with kernel development that is done completely in another
  1010. environment, but built with the Yocto Project build system. In this scenario two
  1011. things must happen:
  1012. <itemizedlist>
  1013. <listitem><para>The delivered Yocto Project kernel must be exported into the second
  1014. SCM.</para></listitem>
  1015. <listitem><para>Development must be exported from that secondary SCM into a
  1016. format that can be used by the Yocto Project build system.</para></listitem>
  1017. </itemizedlist>
  1018. </para>
  1019. <section id='exporting-delivered-kernel-to-scm'>
  1020. <title>Exporting Delivered Kernel to SCM</title>
  1021. <para>
  1022. Depending on the SCM it may be possible to export the entire Yocto Project
  1023. kernel git repository, branches and all, into a new environment. This is the
  1024. preferred method, since it has the most flexibility and potential to maintain
  1025. the meta data associated with each commit.
  1026. </para>
  1027. <para>
  1028. When a direct import mechanism is not available, it is still possible to
  1029. export a branch (or series of branches) and check them into a new
  1030. repository.
  1031. </para>
  1032. <para>
  1033. The following commands illustrate some of the steps that could be used to
  1034. import the common_pc-standard kernel into a secondary SCM
  1035. <literallayout class='monospaced'>
  1036. &gt; git checkout common_pc-standard
  1037. &gt; cd .. ; echo linux/.git &gt; .cvsignore
  1038. &gt; cvs import -m "initial import" linux MY_COMPANY start
  1039. </literallayout>
  1040. The CVS repo could now be relocated and used in a centralized manner.
  1041. </para>
  1042. <para>
  1043. The following commands illustrate how two BSPs could be condensed and merged
  1044. into a second SCM:
  1045. <literallayout class='monospaced'>
  1046. &gt; git checkout common_pc-standard
  1047. &gt; git merge cav_ebt5800-standard
  1048. # resolve any conflicts and commit them
  1049. &gt; cd .. ; echo linux/.git &gt; .cvsignore
  1050. &gt; cvs import -m "initial import" linux MY_COMPANY start
  1051. </literallayout>
  1052. </para>
  1053. </section>
  1054. <section id='importing-changes-for-build'>
  1055. <title>Importing Changes for Build</title>
  1056. <para>
  1057. Once development has reached a suitable point in the second development
  1058. environment, changes can either be exported as patches or imported into git
  1059. directly (if a conversion/import mechanism is available for the SCM).
  1060. </para>
  1061. If changes are exported as patches, they can be placed in a template and
  1062. automatically applied to the kernel during patching. See the template patch
  1063. example for details.
  1064. <para>
  1065. </para>
  1066. If changes are imported directly into git, they must be propagated to the
  1067. wrll-linux-2.6.27/git/default_kernel bare clone of each individual build
  1068. to be present when the kernel is checked out.
  1069. <para>
  1070. The following example illustrates one variant of this workflow:
  1071. <literallayout class='monospaced'>
  1072. # on master git repository
  1073. &gt; cd linux-2.6.27
  1074. &gt; git tag -d common_pc-standard-mark
  1075. &gt; git pull ssh://&lt;foo&gt;@&lt;bar&gt;/pub/git/kernel-2.6.27 common_pc-standard:common_pc-standard
  1076. &gt; git tag common_pc-standard-mark
  1077. # on each build machine (or NFS share, etc)
  1078. &gt; cd wrll-linux-2.6.27/git/default_kernel
  1079. &gt; git fetch ssh://&lt;foo&gt;@&lt;master server&gt;/pub/git/kernel-2.6.27
  1080. # in the build, perform a from-scratch build of Linux and the new changes
  1081. # will be checked out and built.
  1082. &gt; make linux
  1083. </literallayout>
  1084. </para>
  1085. </section>
  1086. </section>
  1087. <section id='bsp-template-migration-from-2'>
  1088. <title>BSP: Template Migration from 2.0</title>
  1089. <para>
  1090. The move to a git-backed kernel build system in 3.0 introduced a small new
  1091. requirement for any BSP that is not integrated into the GA release of the
  1092. product: branching information.
  1093. </para>
  1094. <para>
  1095. As was previously mentioned in the background sections, branching information
  1096. is always required, since the kernel build system cannot make intelligent
  1097. branching decisions and must rely on the developer. This branching
  1098. information is provided via a .scc file.
  1099. </para>
  1100. <para>
  1101. A BSP template in 2.0 contained build system information (config.sh, etc) and
  1102. kernel patching information in the 'linux' subdirectory. The same holds true
  1103. in 3.0, with only minor changes in the kernel patching directory.
  1104. The ".smudge" files are now ".scc" files and now contain a full description
  1105. of the kernel branching, patching and configuration for the BSP. Where in
  1106. 2.0, they only contained kernel patching information.
  1107. </para>
  1108. <para>
  1109. The following illustrates the migration of a simple 2.0 BSP template to the
  1110. new 3.0 kernel build system.
  1111. </para>
  1112. <note><para>
  1113. Note: all operations are from the root of a customer layer.
  1114. </para></note>
  1115. <literallayout class='monospaced'>
  1116. templates/
  1117. `&dash;&dash; board
  1118. `&dash;&dash; my_board
  1119. |&dash;&dash; config.sh
  1120. |&dash;&dash; include
  1121. `&dash;&dash; linux
  1122. `&dash;&dash; 2.6.x
  1123. |&dash;&dash; knl-base.cfg
  1124. |&dash;&dash; bsp.patch
  1125. `&dash;&dash; my_bsp.smudge
  1126. &gt; mv templates/board/my_board/linux/2.6.x/* templates/board/my_board/linux
  1127. &gt; rm -rf templates/board/my_board/linux/2.6.x/
  1128. &gt; mv templates/board/my_board/linux/my_bsp.smudge \
  1129. templates/board/my_board/linux/my_bsp-standard.scc
  1130. &gt; echo "kconf hardware knl-base.cfg" &gt;&gt; \
  1131. templates/board/my_board/linux/my_bsp-standard.scc
  1132. &gt; vi templates/board/my_board/linux/my_bsp-standard.scc
  1133. # add the following at the top of the file
  1134. scc_leaf ktypes/standard my_bsp-standard
  1135. templates/
  1136. `&dash;&dash; board
  1137. `&dash;&dash; my_board
  1138. |&dash;&dash; config.sh
  1139. |&dash;&dash; include
  1140. `&dash;&dash; linux
  1141. |&dash;&dash; knl-base.cfg
  1142. |&dash;&dash; bsp.patch
  1143. `&dash;&dash; my_bsp-standard.scc
  1144. </literallayout>
  1145. <para>
  1146. That's it. Configure and build.
  1147. </para>
  1148. <note><para>There is a naming convention for the .scc file, which allows the build
  1149. system to locate suitable feature descriptions for a board:
  1150. </para></note>
  1151. <literallayout class='monospaced'>
  1152. &lt;bsp name&gt;-&lt;kernel type&gt;.scc
  1153. </literallayout>
  1154. <para>
  1155. if this naming convention isn't followed your feature description will
  1156. not be located and a build error thrown.
  1157. </para>
  1158. </section>
  1159. <section id='bsp-creating-a-new-bsp'>
  1160. <title>BSP: Creating a New BSP</title>
  1161. <para>
  1162. Although it is obvious that the structure of a new BSP uses the migrated
  1163. directory structure from the previous example,the first question is whether
  1164. or not the BSP is started from scratch.
  1165. </para>
  1166. <para>
  1167. If Yocto Project has a similar BSP, it is often easier to clone and update,
  1168. rather than start from scratch. If the mainline kernel has support, it is
  1169. easier to branch from the -standard kernel and begin development (and not be
  1170. concerned with undoing existing changes). This section covers both options.
  1171. </para>
  1172. <para>
  1173. In almost every scenario, the LDAT build system bindings must be completed
  1174. before either cloning or starting a new BSP from scratch. This is simply
  1175. because the board template files are required to configure a project/build
  1176. and create the necessary environment to begin working directly with the
  1177. kernel. If it is desired to start immediately with kernel development and
  1178. then add LDAT bindings, see the "bootstrapping a BSP" section.
  1179. </para>
  1180. <section id='creating-from-scratch'>
  1181. <title>Creating the BSP from Scratch</title>
  1182. <para>
  1183. To create the BSP from scratch you need to do the following:
  1184. <orderedlist>
  1185. <listitem><para>Create a board template for the new BSP in a layer.</para></listitem>
  1186. <listitem><para>Configure a build with the board.</para></listitem>
  1187. <listitem><para>Configure a kernel.</para></listitem>
  1188. </orderedlist>
  1189. </para>
  1190. <para>
  1191. Following is an example showing all three steps. You start by creating a board template for the new BSP in a layer.
  1192. <literallayout class='monospaced'>
  1193. templates/
  1194. `&dash;&dash; board
  1195. `&dash;&dash; my_bsp
  1196. |&dash;&dash; include
  1197. |&dash;&dash; config.sh
  1198. `&dash;&dash; linux
  1199. |&dash;&dash; my_bsp.cfg
  1200. `&dash;&dash; my_bsp-standard.scc
  1201. &gt; cat config.sh
  1202. TARGET_BOARD="my_bsp"
  1203. TARGET_LINUX_LINKS="bzImage"
  1204. TARGET_SUPPORTED_KERNEL="standard"
  1205. TARGET_SUPPORTED_ROOTFS="glibc_std"
  1206. BANNER="This BSP is *NOT* supported"
  1207. TARGET_PROCFAM="pentium4"
  1208. TARGET_PLATFORMS="GPP"
  1209. &gt; cat include
  1210. cpu/x86_32_i686
  1211. karch/i386
  1212. &gt; cat linux/my_bsp-standard.scc
  1213. scc_leaf ktypes/standard/standard.scc my_bsp-standard
  1214. &gt; cat linux/my_bsp.cfg
  1215. CONFIG_X86=y
  1216. CONFIG_SMP=y
  1217. CONFIG_VT=y
  1218. # etc, etc, etc
  1219. </literallayout>
  1220. </para>
  1221. <para>
  1222. Something like the following can now be added to a board build, and
  1223. a project can be started:
  1224. <literallayout class='monospaced'>
  1225. &dash;&dash;enable-board=my_bsp \
  1226. &dash;&dash;with-layer=custom_bsp
  1227. </literallayout>
  1228. </para>
  1229. <para>
  1230. Now you can configure a kernel:
  1231. <literallayout class='monospaced'>
  1232. &gt; make -C build linux.config
  1233. </literallayout>
  1234. </para>
  1235. <para>
  1236. You now have a kernel tree, which is branched and has no patches, ready for
  1237. development.
  1238. </para>
  1239. </section>
  1240. <section id='cloning-an-existing-bsp'>
  1241. <title>Cloning an Existing BSP</title>
  1242. <para>
  1243. Cloning an existing BSP from the shipped product is similar to the "from
  1244. scratch" option and there are two distinct ways to achieve this goal:
  1245. <itemizedlist>
  1246. <listitem><para>Create a board template for the new BSP in a layer.</para></listitem>
  1247. <listitem><para>Clone the .scc and board config.</para></listitem>
  1248. </itemizedlist>
  1249. </para>
  1250. <para>
  1251. The first method is similar to the from scratch BSP where you create a board template for the new
  1252. BSP. Although in this case, copying an existing board template from
  1253. wrll-wrlinux/templates/board would be appropriate, since we are cloning an
  1254. existing BSP. Edit the config.sh, include and other board options for the new
  1255. BSP.
  1256. </para>
  1257. <para>
  1258. The second method is to clone the .scc and board config.
  1259. To do this, in the newly created board template, create a linux subdirectory and export
  1260. the .scc and configuration from the source BSP in the published Yocto Project
  1261. kernel. During construction, all of the configuration and patches were
  1262. captured, so it is simply a matter of extracting them.
  1263. </para>
  1264. <para>
  1265. Extraction can be accomplished using four different techniques:
  1266. <itemizedlist>
  1267. <listitem><para>Config and patches from the bare default_kernel.</para></listitem>
  1268. <listitem><para>Clone default_kernel and checkout wrs_base.</para></listitem>
  1269. <listitem><para>Clone default_kernel and checkout BSP branch.</para></listitem>
  1270. <listitem><para>Branch from the Yocto Project BSP.</para></listitem>
  1271. </itemizedlist>
  1272. </para>
  1273. <para>
  1274. Technique 1: config and patches from the bare default_kernel
  1275. <literallayout class='monospaced'>
  1276. &gt; cd layers/wrll-linux-2.6.27/git/default_kernel
  1277. &gt; git show checkpoint_end | filterdiff -i '*common_pc*' | patch -s -p2 -d /tmp
  1278. # This will create two directories: cfg and patches.
  1279. &gt; cd /tmp/cfg/kernel-cache/bsp/common_pc/
  1280. # This directory contains all the patches and .scc files used to construct
  1281. # the BSP in the shipped tree. Copy the patches to the new BSP template,
  1282. # and add them to the .scc file created above. See "template patching" if
  1283. # more details are required.
  1284. </literallayout>
  1285. </para>
  1286. <para>
  1287. Technique 2: clone default_kernel and checkout wrs_base
  1288. <literallayout class='monospaced'>
  1289. &gt; git clone layers/wrll-linux-2.6.27/git/default_kernel windriver-2.6.27
  1290. &gt; cd windriver-2.6.27
  1291. &gt; git checkout wrs_base
  1292. &gt; cd wrs/cfg/kernel-cache/bsp/common_pc
  1293. # again, this directory has all the patches and .scc files used to construct
  1294. # the BSP
  1295. </literallayout>
  1296. </para>
  1297. <para>
  1298. Technique 3: clone default_kernel and checkout BSP branch
  1299. <literallayout class='monospaced'>
  1300. &gt; git clone layers/wrll-linux-2.6.27/git/default_kernel windriver-2.6.27
  1301. &gt; cd windriver-2.6.27
  1302. &gt; git checkout common_pc-standard
  1303. &gt; git whatchanged
  1304. # browse patches and determine which ones are of interest, say there are
  1305. # 3 patches of interest
  1306. &gt; git format-patch -o &lt;path to BSP template&gt;/linux HEAD^^^
  1307. # update the .scc file to add the patches, see "template patches" if
  1308. # more details are required
  1309. </literallayout>
  1310. </para>
  1311. <para>
  1312. Technique #4: branch from the Yocto Project BSP
  1313. <note><para>This is potentially the most "different" technique, but is actually
  1314. the easiest to support and leverages the infrastructure. rtcore BSPs
  1315. are created in a similar manner to this.
  1316. </para></note>
  1317. </para>
  1318. <para>
  1319. In this technique the .scc file in the board template is slightly different
  1320. and indicates that the BSP should branch after the base Yocto Project BSP
  1321. of the correct kernel type, so to start a new BSP that inherits the
  1322. kernel patches of the common_pc-standard, the following would be done:
  1323. <literallayout class='monospaced'>
  1324. &gt; cat linux/my_bsp-standard.scc
  1325. scc_leaf bsp/common_pc/common_pc-standard.scc my_bsp-standard
  1326. </literallayout>
  1327. </para>
  1328. <para>
  1329. And only kernel configuration (not patches) need be contained in the
  1330. board template.
  1331. </para>
  1332. <para>
  1333. This has the advantage of automatically picking up updates to the BSP
  1334. and not duplicating any patches for a similar board.
  1335. </para>
  1336. </section>
  1337. <section id='bsp-bootstrapping'>
  1338. <title>BSP: Bootstrapping</title>
  1339. <para>
  1340. The previous examples created the board templates and configured a build
  1341. before beginning work on a new BSP. It is also possible for advanced users to
  1342. simply treat the Yocto Project git repository as an upstream source and begin
  1343. BSP development directly on the repository. This is the closest match to how
  1344. the kernel community at large would operate.
  1345. </para>
  1346. <para>
  1347. Two techniques exist to accomplish this:
  1348. </para>
  1349. <para>
  1350. Technique 1: upstream workflow
  1351. <literallayout class='monospaced'>
  1352. &gt; git clone layers/wrll-linux-2.6.27/git/default_kernel windriver-2.6.27
  1353. &gt; cd windriver-2.6.27
  1354. &gt; git checkout -b my_bsp-standard common_pc-standard
  1355. # edit files, import patches, generally do BSP development
  1356. # at this point we can create the BSP template, and export the kernel
  1357. # changes using one of the techniques discussed in that section. For
  1358. # example, It is possible to push these changes, directly into the
  1359. # default_kernel and never directly manipulate or export patch files
  1360. </literallayout>
  1361. </para>
  1362. <para>
  1363. Technique 2: Yocto Project kernel build workflow
  1364. </para>
  1365. <para>
  1366. Create the BSP branch from the appropriate kernel type
  1367. <literallayout class='monospaced'>
  1368. &gt; cd linux
  1369. # the naming convention for auto-build is &lt;bsp&gt;-&lt;kernel type&gt;
  1370. &gt; git checkout -b my_bsp-standard standard
  1371. </literallayout>
  1372. </para>
  1373. <para>
  1374. Make changes, import patches, etc.
  1375. <literallayout class='monospaced'>
  1376. &gt; ../../host-cross/bin/guilt init
  1377. # 'wrs/patches/my_bsp-standard' has now been created to
  1378. # manage the branches patches
  1379. # option 1: edit files, guilt import
  1380. &gt; ../../host-cross/bin/guilt new extra-version.patch
  1381. &gt; vi Makefile
  1382. &gt; ../../host-cross/bin/guilt refresh
  1383. # add a header
  1384. &gt; ../../host-cross/bin/guilt header -e
  1385. # describe the patch using best practices, like the example below:
  1386. &dash;&dash;&dash;&gt;&dash;&dash;&dash;&gt;&dash;&dash;&dash;&gt; cut here
  1387. From: Bruce Ashfield &lt;bruce.ashfield@windriver.com&gt;
  1388. Adds an extra version to the kernel
  1389. Modify the main EXTRAVERSION to show our bsp name
  1390. Signed-off-by: Bruce Ashfield &lt;bruce.ashfield@windriver.com&gt;
  1391. &dash;&dash;&dash;&gt;&dash;&dash;&dash;&gt;&dash;&dash;&dash;&gt; cut here
  1392. # option 2: import patches
  1393. &gt; git am &lt;patch&gt;
  1394. or
  1395. &gt; git apply &lt;patch&gt;
  1396. &gt; git add &lt;files&gt;
  1397. &gt; git commit -s
  1398. # configure the board, save relevant options
  1399. &gt; make ARCH=&lt;arch&gt; menuconfig
  1400. # save the cfg changes for reconfiguration
  1401. &gt; mkdir wrs/cfg/&lt;cache&gt;/my_bsp
  1402. &gt; vi wrs/cfg/&lt;cache&gt;/my_bsp/my_bsp.cfg
  1403. # classify the patches
  1404. &gt; ../../host-cross/bin/kgit classify create &lt;kernel-foo-cache&gt;/my_bsp/my_bsp
  1405. # test build
  1406. &gt; cd ..
  1407. &gt; make linux TARGET_BOARD=my_bsp kprofile=my_bsp use_current_branch=1
  1408. </literallayout>
  1409. </para>
  1410. <para>
  1411. Assuming the patches have been exported to the correct location, Future
  1412. builds will now find the board, apply the patches to the base tree and make
  1413. the relevant branches and structures and the special build options are no
  1414. longer required.
  1415. </para>
  1416. </section>
  1417. </section>
  1418. <section id='patching'>
  1419. <title>Patching</title>
  1420. <para>
  1421. The most common way to apply patches to the kernel is via a template.
  1422. However, for more advanced applications (such as the sharing of patches between
  1423. multiple sub-features) it is possible to patch the kernel-cache.
  1424. This section covers both scenarios.
  1425. </para>
  1426. <section id='patching-template'>
  1427. <title>Patching: Template</title>
  1428. <para>
  1429. kernel
  1430. templates follow the same rules as any LDAT template. A directory should be
  1431. created in a recognized template location, with a 'linux' subdirectory. The
  1432. 'linux' directory triggers LDAT to pass the dir as a potential patch location
  1433. to the kernel build system. Any .scc files found in that directory, will be
  1434. automatically appended to the end of the BSP branch (for the configured
  1435. board).
  1436. </para>
  1437. <para>
  1438. This behavior is essentially the same since previous product
  1439. releases. The only exception is the use of ".scc", which allows kernel
  1440. configuration AND patches to be applied in a template.
  1441. </para>
  1442. <note><para>
  1443. If creating a full template is not required, a .scc file can be placed at
  1444. the top of the build, along with configuration and patches. The build
  1445. system will pickup the .scc and add it onto the patch list automatically
  1446. </para></note>
  1447. <para>
  1448. As an example, consider a simple template to update a BP:
  1449. <literallayout class='monospaced'>
  1450. &gt; cat templates/feature/extra_version/linux/extra_version.scc
  1451. patch 0001-extraversion-add-Wind-River-identifier.patch
  1452. </literallayout>
  1453. </para>
  1454. <para>
  1455. To illustrate how the previous template patch was created, the following
  1456. steps were performed:
  1457. <literallayout class='monospaced'>
  1458. &gt; cd &lt;board build&gt;/build/linux
  1459. &gt; vi Makefile
  1460. # modify EXTRAVERSION to have a unique string
  1461. &gt; git commit -s -m "extraversion: add Yocto Project identifier" Makefile
  1462. &gt; git format-patch -o &lt;path to layer&gt;/templates/feature/extra_version/linux/
  1463. &gt; echo "patch 0001-extraversion-add-Wind-River-identifier.patch" &gt; \
  1464. &lt;path to layer&gt;/templates/feature/extra_version/linux/extra_version.scc
  1465. </literallayout>
  1466. </para>
  1467. <para>
  1468. This next example creates a template with a linux subdirectory, just as we
  1469. always have for previous releases.
  1470. <literallayout class='monospaced'>
  1471. &gt; mkdir templates/features/my_feature/linux
  1472. </literallayout>
  1473. </para>
  1474. <para>
  1475. In that directory place your feature description, your
  1476. patch and configuration (if required).
  1477. <literallayout class='monospaced'>
  1478. &gt; ls templates/features/my_feature/linux
  1479. version.patch
  1480. my_feature.scc
  1481. my_feature.cfg
  1482. </literallayout>
  1483. </para>
  1484. <para>
  1485. The .scc file describes the patches, configuration and
  1486. where in the patch order the feature should be inserted.
  1487. <literallayout class='monospaced'>
  1488. patch version.patch
  1489. kconf non-hardware my_feature.cfg
  1490. </literallayout>
  1491. </para>
  1492. <para>
  1493. Configure your build with the new template
  1494. <literallayout class='monospaced'>
  1495. &dash;&dash;with-template=features/my_feature
  1496. </literallayout>
  1497. </para>
  1498. <para>
  1499. Build the kernel
  1500. <literallayout class='monospaced'>
  1501. &gt; make linux
  1502. </literallayout>
  1503. </para>
  1504. </section>
  1505. <section id='patching-kernel-cache'>
  1506. <title>Patching: Kernel Cache</title>
  1507. <para>
  1508. As previously mentioned, this example is included for completeness, and is for more advanced
  1509. applications (such as the sharing of patches between multiple sub-features).
  1510. Most patching should be done via templates, since that interface is
  1511. guaranteed not to change and the kernel-cache interface carries no such
  1512. guarantee.
  1513. </para>
  1514. <para>
  1515. At the top of a layer, create a kernel cache. The build system will recognize
  1516. any directory of the name 'kernel-*-cache' as a kernel cache.
  1517. <literallayout class='monospaced'>
  1518. &gt; cd &lt;my layer&gt;
  1519. &gt;mkdir kernel-temp-cache
  1520. </literallayout>
  1521. </para>
  1522. <para>
  1523. Make a directory with the BSP
  1524. <literallayout class='monospaced'>
  1525. &gt; mkdir kernel-temp-cache
  1526. &gt; mkdir kernel-temp-cache/my_feat
  1527. </literallayout>
  1528. </para>
  1529. <para>
  1530. Create the feature files as they were in technique #1
  1531. <literallayout class='monospaced'>
  1532. &gt; echo "patch my_patch.path" &gt; kernel-temp-cache/my_feat/my_feature.scc
  1533. </literallayout>
  1534. </para>
  1535. <para>
  1536. Configure the build with the feature added to the kernel type
  1537. <literallayout class='monospaced'>
  1538. &dash;&dash;with-kernel=standard+my_feat/my_feature.scc
  1539. </literallayout>
  1540. </para>
  1541. <para>
  1542. Build the kernel
  1543. <literallayout class='monospaced'>
  1544. &gt; make linux
  1545. </literallayout>
  1546. </para>
  1547. </section>
  1548. </section>
  1549. <section id='bsp-updating-patches-and-configuration'>
  1550. <title>BSP: Updating Patches and Configuration</title>
  1551. <para>
  1552. As was described in the "template patching" example, it is simple
  1553. to add patches to a BSP via a template, but often, it is desirable
  1554. to experiment and test patches before committing them to a template.
  1555. You can do this by modifying the BSP source.
  1556. </para>
  1557. <para>
  1558. Start as follows:
  1559. <literallayout class='monospaced'>
  1560. &gt; cd linux
  1561. &gt; git checkout &lt;bspname&gt;-&lt;kernel name&gt;
  1562. &gt; git am &lt;patch&gt;
  1563. </literallayout>
  1564. </para>
  1565. <para>
  1566. Or you can do this:
  1567. <literallayout class='monospaced'>
  1568. &gt; kgit-import -t patch &lt;patch&gt;
  1569. &gt; cd ..
  1570. &gt; make linux
  1571. </literallayout>
  1572. </para>
  1573. <para>
  1574. For details on conflict resolution and patch application, see the
  1575. git manual, or other suitable online references.
  1576. <literallayout class='monospaced'>
  1577. &gt; git am &lt;mbox&gt;
  1578. # conflict
  1579. &gt; git apply &dash;&dash;reject .git/rebase-apply/0001
  1580. # resolve conflict
  1581. &gt; git am &dash;&dash;resolved (or git am &dash;&dash;skip, git am &dash;&dash;abort)
  1582. # continue until complete
  1583. </literallayout>
  1584. </para>
  1585. <para>
  1586. Here is another example:
  1587. <literallayout class='monospaced'>
  1588. # merge the patches
  1589. # 1) single patch
  1590. &gt; git am &lt;mbox&gt;
  1591. &gt; git apply &lt;patch&lt;
  1592. &gt; kgit import -t patch &lt;patch&gt;
  1593. # 2) multiple patches
  1594. &gt; git am &lt;mbox&gt;
  1595. &gt; kgit import -t dir &lt;dir&gt;
  1596. # if kgit -t dir is used, a patch resolution cycle such
  1597. # as this can be used:
  1598. &gt; kgit import -t dir &lt;dir&gt;
  1599. # locate rejects and resolve
  1600. # options:
  1601. &gt; wiggle &dash;&dash;replace &lt;path to file&gt; &lt;path to reject&gt;
  1602. &gt; guilt refresh
  1603. or
  1604. &gt; # manual resolution
  1605. &gt; git add &lt;files&gt;
  1606. &gt; git commit -s
  1607. or
  1608. &gt; git apply &dash;&dash;reject .git/rebase-apply/0001
  1609. &gt; git add &lt;files&gt;
  1610. &gt; git am &dash;&dash;resolved
  1611. or
  1612. &gt; # merge tool of choice
  1613. # continue series:
  1614. &gt; kgit import -t dir &lt;dir&gt;
  1615. or
  1616. &gt; git am &dash;&dash;continue
  1617. </literallayout>
  1618. </para>
  1619. <para>
  1620. Once all the patches have been tested and are satisfactory, they
  1621. should be exported via the techniques described in "saving kernel
  1622. modifications."
  1623. </para>
  1624. <para>
  1625. Once the kernel has been patched and configured for a BSP, it's
  1626. configuration commonly needs to be modified. This can be done by
  1627. running [menu|x]config on the kernel tree, or working with
  1628. configuration fragments.
  1629. </para>
  1630. <para>
  1631. Using menuconfig, the operation is as follows:
  1632. <literallayout class='monospaced'>
  1633. &gt; make linux.menuconfig
  1634. &gt; make linux.rebuild
  1635. </literallayout>
  1636. </para>
  1637. <para>
  1638. Once complete, the changes are in linux-&lt;bsp&gt;-&lt;kernel type&gt;-build/.config.
  1639. To permanently save these changes, compare the .config before and after the
  1640. menuconfig, and place those changes in a configuration fragment in the
  1641. template of your choice.
  1642. </para>
  1643. <para>
  1644. Using configuration fragments, the operation is as follows (using the
  1645. si_is8620 as an example BSP):
  1646. <literallayout class='monospaced'>
  1647. &gt; vi linux/wrs/cfg/kernel-cache/bsp/si_is8620/si_is8620.cfg
  1648. &gt; make linux.reconfig
  1649. &gt; make linux.rebuild
  1650. </literallayout>
  1651. </para>
  1652. <para>
  1653. The modified configuration fragment can simply be copied out of the
  1654. linux/wrs/.. directory and placed in the appropriate template for future
  1655. application.
  1656. </para>
  1657. </section>
  1658. <section id='tools-guilt'>
  1659. <title>Tools: guilt</title>
  1660. <para>
  1661. Yocto Project has guilt integrated as a kernel tool; therefore users that are
  1662. familiar with quilt may wish to use this tool to pop, push and refresh
  1663. their patches. Note: guilt should only be used for local operations, once
  1664. a set of changes has been pushed or pulled, they should no longer be popped
  1665. or refresh by guilt, since popping, refreshing and re-pushing patches
  1666. changes their commit IDs and creating non-fast forward branches.
  1667. </para>
  1668. <para>
  1669. The following example illustrates how to add patches a Yocto Project
  1670. BSP branch via guilt:
  1671. <literallayout class='monospaced'>
  1672. &gt; cd build/linux
  1673. &gt; git checkout common_pc-standard
  1674. &gt; guilt new extra.patch
  1675. # edit files, make changes, etc
  1676. &gt; guilt refresh
  1677. &gt; guilt top
  1678. extra.patch
  1679. # export that patch to an external location
  1680. &gt; kgit export -p top /tmp
  1681. </literallayout>
  1682. </para>
  1683. <para>
  1684. Other guilt operations of interest are:
  1685. <literallayout class='monospaced'>
  1686. > guilt push, guilt push -a
  1687. > guilt pop
  1688. > guilt applied, guilt unapplied
  1689. > guilt top
  1690. > guilt refresh
  1691. > guilt header -e
  1692. > guilt next
  1693. </literallayout>
  1694. </para>
  1695. <note><para>
  1696. Guilt only uses git commands and git plumbing to perform its operations,
  1697. anything that guilt does can also be done using git directly. It is provided
  1698. as a convenience utility, but is not required and the developer can use whatever
  1699. tools or workflow they wish.
  1700. </para></note>
  1701. <para>
  1702. The following builds from the above instructions to show how guilt can be
  1703. used to assist in getting your BSP kernel patches ready. You should follow
  1704. the above instructions up to and including 'make linux.config'. In this
  1705. example I will create a new commit (patch) from scratch and import another
  1706. fictitious patch from some external public git tree (ie, a commit with full
  1707. message, signoff etc.). Please ensure you have host-cross/bin in your path.
  1708. <literallayout class='monospaced'>
  1709. %> cd linux
  1710. %> guilt-init
  1711. %> guilt-new -m fill_me_in_please first_one.patch
  1712. %> touch somefile.txt
  1713. %> guilt-add somefile.txt
  1714. %> guilt-header -e
  1715. %> guilt-refresh
  1716. %> guilt-import path_to_some_patch/patch_filename
  1717. %> guilt-push
  1718. </literallayout>
  1719. </para>
  1720. <para>
  1721. Here are a few notes about the above:
  1722. <itemizedlist>
  1723. <listitem><para>guilt-header -e &dash;&dash; this will open editing of the patch header in
  1724. EDITOR. As with a git commit the first line is the short log and
  1725. should be just that short and concise message about the commit. Follow
  1726. the short log with lines of text that will be the long description but
  1727. note Do not put a blank line after the short log. As usual you will
  1728. want to follow this with a blank line and then a signoff line.</para></listitem>
  1729. <listitem><para>The last line in the example above has 2 dots on the end. If you
  1730. don't add the 2 periods on the end guilt will think you are sending
  1731. just one patch. The wrong one!</para></listitem>
  1732. <listitem><para>The advantage to using guilt over not using guilt is that if you have a
  1733. review comment in the first patch (first_one.patch in the case of this
  1734. example) it is very easy to use guilt to pop the other patches off
  1735. allowing you to make the necessary changes without having to use more
  1736. inventive git type strategies.</para></listitem>
  1737. </itemizedlist>
  1738. </para>
  1739. </section>
  1740. <section id='tools-scc-file-example'>
  1741. <title>Tools: scc File Example</title>
  1742. <para>
  1743. This section provides some scc file examples: leaf node, 'normal' mode, and transforms.
  1744. </para>
  1745. <section id='leaf-node'>
  1746. <title>Leaf Node</title>
  1747. <para>
  1748. The following example is a BSP branch with no child branches - a leaf on the tree.
  1749. <literallayout class='monospaced'>
  1750. # these are optional, but allow standalone tree construction
  1751. define WRS_BOARD &lt;name&gt;
  1752. define WRS_KERNEL &lt;kern type&gt;
  1753. define WRS_ARCH &lt;arch&gt;
  1754. scc_leaf ktypes/standard common_pc-standard
  1755. # ^ ^
  1756. # +&dash;&dash; parent + branch name
  1757. include common_pc.scc
  1758. # ^
  1759. # +&dash;&dash;&dash; include another feature
  1760. </literallayout>
  1761. </para>
  1762. </section>
  1763. <section id='normal-mode'>
  1764. <title>'Normal' Mode</title>
  1765. <para>
  1766. Here is an example of 'normal' mode:
  1767. <literallayout class='monospaced'>
  1768. # +&dash;&dash;&dash;&dash; name of file to read
  1769. # v
  1770. kconf hardware common_pc.cfg
  1771. # ^ ^
  1772. # | +&dash;&dash; 'type: hardware or non-hardware
  1773. # |
  1774. # +&dash;&dash;&dash; kernel config
  1775. # patches
  1776. patch 0002-atl2-add-atl2-driver.patch
  1777. patch 0003-net-remove-LLTX-in-atl2-driver.patch
  1778. patch 0004-net-add-net-poll-support-for-atl2-driver.patch
  1779. </literallayout>
  1780. </para>
  1781. </section>
  1782. <section id='transforms'>
  1783. <title>Transforms</title>
  1784. <para>
  1785. This section shows an example of transforms:
  1786. <literallayout class='monospaced'>
  1787. # either of the next two options will trigger an 'auto'
  1788. # branch from existing ones, since they change the commit
  1789. # order and hence must construct their own branch
  1790. # this changes the order of future includes, if the
  1791. # passed feature is detected, the first feature is
  1792. # included AFTER it
  1793. include features/rt/rt.scc after features/kgdb/kgdb
  1794. # this also changes the order of existing branches
  1795. # this prevents the named feature from ever being
  1796. # included
  1797. exclude features/dynamic_ftrace/dynamic_ftrace.scc
  1798. # inherit the standard kernel
  1799. include ktypes/standard/standard
  1800. # LTT supplies this, so we don't want the sub-chunk from RT.
  1801. patch_trigger arch:all exclude ftrace-upstream-tracepoints.patch
  1802. # ...but we still want the one unique tracepoint it added.
  1803. patch tracepoint-add-for-sched_resched_task.patch
  1804. # these will change the named patches in the series into
  1805. # &lt;patch name&gt;.patch.&lt;feature name&gt;
  1806. # where the substituted patch is in this directory
  1807. patch_trigger arch:all ctx_mod dynamic_printk.patch
  1808. patch_trigger arch:all ctx_mod 0001-Implement-futex-macros-for-ARM.patch
  1809. # unconditionally exclude a patch
  1810. patch_trigger arch:all exclude ftrace-fix-ARM-crash.patch
  1811. </literallayout>
  1812. </para>
  1813. </section>
  1814. </section>
  1815. <section id='tip-dirty-string'>
  1816. <title>"-dirty" String</title>
  1817. <para>
  1818. If kernel images are being built with -dirty on the end of the version
  1819. string, this simply means that there are modification in the source
  1820. directory that haven't been committed.
  1821. <literallayout class='monospaced'>
  1822. &gt; git status
  1823. </literallayout>
  1824. </para>
  1825. <para>
  1826. The above git command will indicate modified, removed or added files. Those changes should
  1827. be committed to the tree (even if they will never be saved, or exported
  1828. for future use) and the kernel rebuilt.
  1829. </para>
  1830. <para>
  1831. To brute force pickup and commit all such pending changes enter the following:
  1832. <literallayout class='monospaced'>
  1833. &gt; git add .
  1834. &gt; git commit -s -a -m "getting rid of -dirty"
  1835. </literallayout>
  1836. </para>
  1837. <para>
  1838. And then rebuild the kernel
  1839. </para>
  1840. </section>
  1841. <section id='kernel-transition-kernel-layer'>
  1842. <title>Kernel: Transition Kernel Layer</title>
  1843. <para>
  1844. In order to temporarily use a different base kernel in Yocto Project
  1845. Linux 3.0 you need to do the following:
  1846. <orderedlist>
  1847. <listitem><para>Create a custom kernel layer.</para></listitem>
  1848. <listitem><para>Create a git repository of the transition kernel.</para></listitem>
  1849. </orderedlist>
  1850. </para>
  1851. <para>
  1852. Once those requirements are met multiple boards and kernels can
  1853. be built. The cost of setup is only paid once and then additional
  1854. BSPs and options can be added.
  1855. </para>
  1856. <para>
  1857. This creates a transition kernel layer to evaluate functionality
  1858. of some other kernel with the goal of easing transition to an
  1859. integrated and validated Yocto Project kernel.
  1860. </para>
  1861. <para>
  1862. The next few sections describe the process:
  1863. </para>
  1864. <section id='creating-a-custom-kernel-layer'>
  1865. <title>Creating a Custom Kernel Layer</title>
  1866. <para>
  1867. The custom kernel layer must have the following minimum
  1868. elements:
  1869. <itemizedlist>
  1870. <listitem><para>An include of the shipped Yocto Project kernel layer.</para></listitem>
  1871. <listitem><para>A kernel-cache with an override of the standard kernel type.</para></listitem>
  1872. </itemizedlist>
  1873. </para>
  1874. <para>
  1875. This allows the inheritance of the kernel build infrastructure,
  1876. while overriding the list of patches that should be applied to
  1877. the base kernel.
  1878. </para>
  1879. <para>
  1880. The kernel layer can optionally include an override to the base
  1881. Yocto Project Linux BSP to inhibit the application of BSP specific
  1882. patches. If a custom BSP is being used, this is not required.
  1883. </para>
  1884. </section>
  1885. <section id='git-repo-of-the-transition-kernel'>
  1886. <title>git Repo of the Transition Kernel</title>
  1887. <para>
  1888. The kernel build system requires a base kernel repository to
  1889. seed the build process. This repository must be found in the
  1890. same layer as the build infrastructure (i.e wrll-linux-2.6.27)
  1891. in the 'git' subdir, with the name 'default_kernel'
  1892. </para>
  1893. <para>Since Yocto Project Linux ships with a default_kernel
  1894. (the validated Yocto Project kernel) in the wrll-linux-2.6.27
  1895. kernel layer, that must be removed and replaced with the
  1896. transition kernel.
  1897. </para>
  1898. <para>If the Yocto Project install cannot be directly modified
  1899. with the new default kernel, then the path to the transition
  1900. kernel layer's 'git' subdir must be passed to the build
  1901. process via:
  1902. <programlisting>
  1903. linux_GIT_BASE=&lt;absolute path to layer&gt;/git
  1904. </programlisting>
  1905. </para>
  1906. <para>
  1907. If the transition kernel has not been delivered via git,
  1908. then a git repo should be created, and bare cloned into
  1909. place. Creating this repository is as simple as:
  1910. <literallayout class='monospaced'>
  1911. &gt; tar zxvf temp_kernel.tgz
  1912. &gt; cd temp_kernel
  1913. &gt; git init
  1914. &gt; git add .
  1915. &gt; git commit -a -m "Transition kernel baseline"
  1916. 'temp_kernel' can now be cloned into place via:
  1917. &gt; cd &lt;path to git base&gt;/git
  1918. &gt; git clone &dash;&dash;bare &lt;path to temp_kernel/temp_kernel default_kernel
  1919. </literallayout>
  1920. </para>
  1921. </section>
  1922. <section id='building-the-kernel'>
  1923. <title>Building the Kernel</title>
  1924. <para>
  1925. Once these prerequisites have been met, the kernel can be
  1926. built with:
  1927. <literallayout class='monospaced'>
  1928. &gt; make linux
  1929. </literallayout>
  1930. </para>
  1931. <para>
  1932. The new base kernel will be cloned into place and have any patches
  1933. indicated in the transition kernel's cache (or templates) applied.
  1934. The kernel build will detect the non-Yocto Project base repo and
  1935. use the HEAD of the tree for the build.
  1936. </para>
  1937. </section>
  1938. <section id='example'>
  1939. <title>Example</title>
  1940. <para>
  1941. This example creates a kernel layer to build the latest
  1942. kernel.org tree as the 'common_pc' BSP.
  1943. <literallayout class='monospaced'>
  1944. &gt; cd &lt;path to layers&gt;
  1945. &gt; mkdir wrll-linux-my_version
  1946. &gt; cd wrll-linux-my_version
  1947. &gt; echo "wrll-linux-2.6.27" &gt; include
  1948. &gt; mkdir -p kernel-cache/ktypes/standard
  1949. &gt; mkdir -p kernel-cache/bsp/common_pc
  1950. &gt; echo "v2.6.29" &gt; kernel-cache/kver
  1951. &gt; echo "branch common_pc-standard" &gt; kernel-cache/bsp/common_pc/common_pc.scc
  1952. &gt; echo "kconf hardware common_pc.cfg" &gt;&gt; kernel-cache/bsp/common_pc/common_pc.scc
  1953. &gt; echo "CONFIG_FOO=y" &gt; kernel-cache/bsp/common_pc/common_pc.cfg
  1954. &gt; mkdir git
  1955. &gt; cd git
  1956. &gt; git clone &dash;&dash;bare git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git default_kernel
  1957. </literallayout>
  1958. </para>
  1959. <para>
  1960. Configure a build to use the new layer. This means that:
  1961. <literallayout class='monospaced'>
  1962. &dash;&dash;enable-kernel-version=my_version
  1963. </literallayout>
  1964. </para>
  1965. <para>
  1966. Should be used to override the shipped default.
  1967. </para>
  1968. <para>
  1969. To build the kernel:
  1970. <literallayout class='monospaced'>
  1971. &gt; cd build
  1972. &gt; make linux_GIT_BASE=&lt;layer path&gt;/wrll-linux-my_version/git linux
  1973. </literallayout>
  1974. </para>
  1975. <para>
  1976. If this is to build without some user intervention (passing of the
  1977. GIT_BASE), you must do the clone into the wrll-linux-2.6.27/git directory.
  1978. </para>
  1979. <note><para>Unless you define valid "hardware.kcf" and "non-hardware.kcf" some
  1980. non fatal warnings will be seen. They can be fixed by populating these
  1981. files in the kernel-cache with valid hardware and non hardware config
  1982. options.
  1983. </para></note>
  1984. </section>
  1985. </section>
  1986. </section>
  1987. <!-- <itemizedlist>
  1988. <listitem><para>Introduction to this section.</para></listitem>
  1989. <listitem><para>Constructing a project-specific kernel tree.</para></listitem>
  1990. <listitem><para>Building the kernel.</para></listitem>
  1991. <listitem><para>Seeing what has changed.</para></listitem>
  1992. <listitem><para>Seeing what has changed in a particular branch.</para></listitem>
  1993. <listitem><para>Modifying the kernel.</para></listitem>
  1994. <listitem><para>Saving modifications.</para></listitem>
  1995. <listitem><para>Storing patches outside of the kernel source repository (bulk export).</para></listitem>
  1996. <listitem><para>Working with incremental changes.</para></listitem>
  1997. <listitem><para>Extracting commited changes from a working directory (exporting internally through
  1998. patches.</para></listitem>
  1999. <listitem><para>Pushing commited changes.</para></listitem>
  2000. <listitem><para>Exporting for external (upstream) submission.</para></listitem>
  2001. <listitem><para>Exporting for import into another Source Control Manager (SCM).</para></listitem>
  2002. <listitem><para>Working with the Yocto Project kernel in another SCM.</para>
  2003. <itemizedlist>
  2004. <listitem><para>Exporting the delivered kernel to an SCM.</para></listitem>
  2005. <listitem><para>Importing changed for the build.</para></listitem>
  2006. </itemizedlist></listitem>
  2007. <listitem><para>Migrating templates from version 2.0.</para></listitem>
  2008. <listitem><para>Creating a new Board Support Package (BSP).</para>
  2009. <itemizedlist>
  2010. <listitem><para>Creating from scratch.</para></listitem>
  2011. <listitem><para>Cloning.</para></listitem>
  2012. </itemizedlist></listitem>
  2013. <listitem><para>BSP bootstrapping.</para></listitem>
  2014. <listitem><para>Applying patches to the kernel through a template.</para></listitem>
  2015. <listitem><para>Applying patches to the kernel without using a template.</para></listitem>
  2016. <listitem><para>Updating patches and configurations for a BSP.</para></listitem>
  2017. <listitem><para>Using guilt to add and export patches.</para></listitem>
  2018. <listitem><para>Using scc.</para></listitem>
  2019. <listitem><para>Building a 'dirty' image.</para></listitem>
  2020. <listitem><para>Temporarily using a different base kernel.</para></listitem>
  2021. <listitem><para>Creating a custom kernel layer.</para></listitem>
  2022. <listitem><para>Creating the git repository of the transition kernel.</para></listitem>
  2023. </itemizedlist> -->
  2024. </section>
  2025. </article>
  2026. <!--
  2027. vim: expandtab tw=80 ts=4
  2028. -->