summaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
authorScott Rifenbark <scott.m.rifenbark@intel.com>2011-07-01 13:35:10 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-21 10:59:19 +0100
commitfe438753ba4eef5511d9a1aad71469a5f8da277e (patch)
tree51bada4c40209479eaf04867958b32313f4703d9 /documentation
parent1316648ae68ca19cfea758bab5170a7a85ebd572 (diff)
downloadpoky-fe438753ba4eef5511d9a1aad71469a5f8da277e.tar.gz
documentation/kernel-manual/kernel-how-to.xml: Partial - Re-write of BSP creation
This is a partial edit of re-writing the BSP creation section so that it is clearer for the naive user. It is not quite done yet. (From yocto-docs rev: 7a552e72a1d2d1b6ffa93f4fe3074f318ff35715) Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation')
-rw-r--r--documentation/kernel-manual/kernel-how-to.xml100
1 files changed, 60 insertions, 40 deletions
diff --git a/documentation/kernel-manual/kernel-how-to.xml b/documentation/kernel-manual/kernel-how-to.xml
index c4f6474ac8..7afbb1cb25 100644
--- a/documentation/kernel-manual/kernel-how-to.xml
+++ b/documentation/kernel-manual/kernel-how-to.xml
@@ -1021,62 +1021,76 @@ That's it. Configure and build.
1021 </para> 1021 </para>
1022 1022
1023 <para> 1023 <para>
1024 You can start with something in <filename>meta/conf/machine</filename> - <filename> 1024 You can start with a machine configuration file in the Yocto Project source tree
1025 meta/conf/machine/atom-pc.conf</filename> for example. Or, you can start with a machine 1025 such as the <filename>atom-pc.conf</filename> in <filename>meta-yocto/conf/machine</filename>.
1026 configuration from any of the BSP layers in the meta-intel repository at 1026 Or, you can start with a machine configuration file from a BSP layer
1027 <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel/'></ulink>, such as 1027 such as <filename>emenlow.conf</filename> in <filename>meta-emenlow/conf/machine</filename>.
1028 <filename>meta-intel/meta-emenlow/conf/machine/emenlow.conf</filename>.
1029 </para> 1028 </para>
1030 1029
1031 <para> 1030 <para>
1032 The main difference between the two is that "emenlow" is in its own layer. 1031 The main difference between these two BSP machine configuration files is that "emenlow" is
1033 It is in its own layer because it needs extra machine-specific packages such as its 1032 in its own isolated BSP layer, while "atom-pc" is in a more encompassing layer
1034 own video driver and other supporting packages. 1033 named <filename>meta-yocto</filename> that is part of the Yocto Project source tree.
1035 The "atom-pc" is simpler and does not need any special packages - everything it needs can 1034 The "emenlow" configuration is in its own BSP layer because the target hardware
1036 be specified in the configuration file. 1035 needs extra machine-specific packages to support graphics and other features.
1036 The "atom-pc" configuration file supports more basic hardware that does not need any
1037 special packages - everything the hardware needs can be specified in the configuration file.
1037 The "atom-pc" machine also supports all of Asus eee901, Acer Aspire One, Toshiba NB305, 1038 The "atom-pc" machine also supports all of Asus eee901, Acer Aspire One, Toshiba NB305,
1038 and the Intel&reg; Embedded Development Board 1-N450 with no changes. 1039 and the Intel&reg; Embedded Development Board 1-N450 with no changes.
1039 </para> 1040 </para>
1040 1041
1041 <para> 1042 <para>
1042 If you want to make minor changes to support a slightly different machine, you can 1043 If you want to make minor changes to support a slightly different machine, you can
1043 create a new configuration file for it and add it alongside the others. 1044 create a new configuration file for the new machine and add it alongside the
1044 You might consider keeping the common information separate and including it. 1045 configuration files.
1046 You might consider keeping common configurations for several machines in a separate file
1047 and then including the other configuration files that have more specific configurations.
1045 </para> 1048 </para>
1046 1049
1047 <para> 1050 <para>
1048 Similarly, you can also use multiple configuration files for different machines even 1051 Similarly, you can also use multiple configuration files for different machines even
1049 if you do it as a separate layer like meta-emenlow. 1052 when the configuration files come from a separate and different layer.
1050 </para> 1053 </para>
1051 1054
1052 <para> 1055 <para>
1053 As an example consider this: 1056 As an example consider this:
1054 <itemizedlist> 1057 <orderedlist>
1055 <listitem><para>Copy meta-emenlow to meta-mymachine</para></listitem> 1058 <listitem><para>Copy the "emenlow" BSP layer to a new BSP layer named
1056 <listitem><para>Fix or remove anything you do not need. 1059 <filename>meta-mymachine</filename>.
1057 For this example the only thing left was the kernel directory with a 1060 Now you have two identical BSP layers &dash; but with different names.</para></listitem>
1058 <filename>linux-yocto_git.bbappend</filename> 1061 <listitem><para>This example assumes you only need to change some machine
1059 file 1062 configurations and inform the Yocto Project build process of the new layer.
1060 and <filename>meta-mymachine/conf/machine/mymachine.conf</filename> 1063 Consequently, modify the new layer's structure so that all it contains
1061 (linux-yocto is the kernel listed in 1064 is the <filename>linux-yocto_git.bbappend</filename> file in the
1062 <filename>meta-emenlow/conf/machine/emenlow.conf</filename>)</para></listitem>. 1065 <filename>meta-mymachine/recipes-kernel/linux</filename> directory
1063 <listitem><para>Add a new entry in the <filename>build/conf/bblayers.conf</filename> 1066 and the <filename>emenlow.conf</filename> configuration file in the
1064 so the new layer can be found by BitBake.</para></listitem> 1067 <filename>meta-mymachine/conf/machine</filename> directory.
1065 </itemizedlist> 1068 Note that "linux-yocto" is the kernel specified in the <filename>mymachine.conf</filename>
1069 configuration file.</para></listitem>.
1070 <listitem><para>Rename the <filename>emenlow.conf</filename> file to <filename>mymachine.conf</filename>
1071 and fix or remove any configurations.</para></listitem>
1072 <listitem><para>Make sure the Yocto Project build process knows about the new BSP
1073 layer by adding the layer to the <filename>bblayers.conf</filename> configuration
1074 file located in the Yocto Project build tree at <filename>build/conf/bblayers.conf</filename>.
1075 Adding the layer allows Bitbake to find the new layer.
1076 You also need to edit the <filename>layer.conf</filename> file located in the
1077 <filename>meta-mymachine/conf</filename> directory such that "mymachine" replaces
1078 "emenlow".</para></listitem>
1079 </orderedlist>
1066 </para></listitem> 1080 </para></listitem>
1067 1081
1068 <listitem><para> 1082 <listitem><para>
1069 Create a machine branch for your machine. 1083 Create a machine branch for your machine in a the Yocto Project git repository.
1070 </para> 1084 </para>
1071 1085
1072 <para> 1086 <para>
1073 For the kernel to compile successfully, you need to create a branch in the git repository 1087 For the kernel to compile successfully, you need to create a branch in the
1074 specifically named for your machine. 1088 Yocto Project git repository that is specifically named for your machine.
1075 To create this branch first create a bare clone of the Yocto Project git repository. 1089 To create this branch, first create a bare clone of the Yocto Project git repository.
1076 Next, create a local clone of that: 1090 Then, create a local clone of that bare clone.
1091 Here are the commands:
1077 <literallayout class='monospaced'> 1092 <literallayout class='monospaced'>
1078 $ git clone --bare git://git.yoctoproject.org/linux-yocto-2.6.37.git 1093 $ git clone --bare git://git.yoctoproject.org/linux-yocto-2.6.37.git linux-yocto-2.6.37.git
1079 linux-yocto-2.6.37.git
1080 $ git clone linux-yocto-2.6.37.git linux-yocto-2.6.37 1094 $ git clone linux-yocto-2.6.37.git linux-yocto-2.6.37
1081 </literallayout> 1095 </literallayout>
1082 </para> 1096 </para>
@@ -1090,8 +1104,12 @@ That's it. Configure and build.
1090 </para></listitem> 1104 </para></listitem>
1091 1105
1092 <listitem><para> 1106 <listitem><para>
1093 In a layer, create a <filename>linux-yocto_git.bbappend</filename> 1107 In your new layer you need to edit the <filename>linux-yocto_git.bbappend</filename>
1094 file with the following: 1108 file so that the compatible machine is "mymachine".
1109 It is also convenient point to a cloned Yocto Project git repository that is local
1110 to your system for development purposes.
1111 Thus, change the <filename>linux-yocto_git.bbappend</filename> file in your
1112 <filename>meta-mymachine</filename> layer to the following:
1095 </para> 1113 </para>
1096 1114
1097 <para> 1115 <para>
@@ -1099,11 +1117,11 @@ That's it. Configure and build.
1099 FILESEXTRAPATHS := "${THISDIR}/${PN}" 1117 FILESEXTRAPATHS := "${THISDIR}/${PN}"
1100 COMPATIBLE_MACHINE_mymachine = "mymachine" 1118 COMPATIBLE_MACHINE_mymachine = "mymachine"
1101 1119
1102 # It is often nice to have a local clone of the kernel repository, to 1120 # It is often nice to have a clone of the kernel repository, to
1103 # allow patches to be staged, branches created, and so forth. Modify 1121 # allow patches to be staged, branches created, and so forth. Modify
1104 # KSRC to point to your local clone as appropriate. 1122 # KSRC to point to your bare clone as appropriate.
1105 1123
1106 KSRC ?= /path/to/your/bare/clone/for/example/linux-yocto-2.6.37.git 1124 KSRC ?= $MYWORK/linux-yocto-2.6.37.git
1107 1125
1108 # KMACHINE is the branch to be built, or alternatively 1126 # KMACHINE is the branch to be built, or alternatively
1109 # KBRANCH can be directly set. 1127 # KBRANCH can be directly set.
@@ -1117,7 +1135,9 @@ That's it. Configure and build.
1117 </para> 1135 </para>
1118 1136
1119 <para> 1137 <para>
1120 After doing that, select the machine in <filename>build/conf/local.conf</filename>: 1138 After updating the <filename>linux-yocto_git.bbappend</filename> file,
1139 edit the <filename>build/conf/local.conf</filename> found
1140 in the Yocto Project build tree so that it selects your machine:
1121 <literallayout class='monospaced'> 1141 <literallayout class='monospaced'>
1122 # 1142 #
1123 MACHINE ?= "mymachine" 1143 MACHINE ?= "mymachine"
@@ -1137,7 +1157,7 @@ That's it. Configure and build.
1137 </para> 1157 </para>
1138 1158
1139 <para> 1159 <para>
1140 Of course, that will give you a kernel with the default configuration file, which is probably 1160 At this point you will build a kernel with the default configuration file, which is probably
1141 not what you want. 1161 not what you want.
1142 If you just want to set some kernel configuration options, you can do that by 1162 If you just want to set some kernel configuration options, you can do that by
1143 putting them in a file. 1163 putting them in a file.
@@ -1155,7 +1175,7 @@ That's it. Configure and build.
1155 </literallayout> 1175 </literallayout>
1156 1176
1157 <para> 1177 <para>
1158 These config fragments could then be picked up and 1178 These configuration fragments could then be picked up and
1159 applied to the kernel .config by appending them to the kernel SRC_URI: 1179 applied to the kernel .config by appending them to the kernel SRC_URI:
1160 </para> 1180 </para>
1161 1181