Compare commits
445 Commits
edison-6.0
...
edison
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8886aee5b9 | ||
|
|
2e99dcc03a | ||
|
|
1f53e5a96a | ||
|
|
bf46fa7d50 | ||
|
|
35d25f853c | ||
|
|
ccc2918ef7 | ||
|
|
c47f892526 | ||
|
|
3635f0ce53 | ||
|
|
678f6ee437 | ||
|
|
7ce46066a5 | ||
|
|
d3e51cea0f | ||
|
|
fb2d503992 | ||
|
|
ad050e2912 | ||
|
|
ec385088c4 | ||
|
|
aee274f5fa | ||
|
|
74b0cafd65 | ||
|
|
9622701c00 | ||
|
|
7e3332c3cc | ||
|
|
99e39f6c12 | ||
|
|
c0433b3b94 | ||
|
|
28989f2d04 | ||
|
|
d088fac872 | ||
|
|
9f915d46be | ||
|
|
a6f25334ec | ||
|
|
ed26c02ac6 | ||
|
|
860acfbdaa | ||
|
|
470fd8de07 | ||
|
|
7082a56c95 | ||
|
|
4919821572 | ||
|
|
a8289a9943 | ||
|
|
8b72a3c863 | ||
|
|
7315ac6e8f | ||
|
|
522b5864e9 | ||
|
|
c11f65a290 | ||
|
|
b2ec918b67 | ||
|
|
4cd83a91fb | ||
|
|
953ad50a27 | ||
|
|
fcf7db01c0 | ||
|
|
c8fc8aa4ae | ||
|
|
e50f5673e2 | ||
|
|
0cb1be9fae | ||
|
|
565d5abd87 | ||
|
|
fee19b3dda | ||
|
|
eb1ed1f02a | ||
|
|
664c12885b | ||
|
|
22fa92fa14 | ||
|
|
a717c33e5d | ||
|
|
d39f8db69e | ||
|
|
efd4cb0ddf | ||
|
|
61e550b462 | ||
|
|
4b72728755 | ||
|
|
1cc3056b3a | ||
|
|
27e5be1709 | ||
|
|
6c9c0f1f45 | ||
|
|
8650364e50 | ||
|
|
450913f388 | ||
|
|
de01c5c217 | ||
|
|
d5a5f63867 | ||
|
|
06072024be | ||
|
|
107ec95659 | ||
|
|
af3e5039e8 | ||
|
|
08d70734d5 | ||
|
|
164a4d1bac | ||
|
|
7e0dd59e30 | ||
|
|
aca161f8a0 | ||
|
|
94c8d01eba | ||
|
|
e1e0dd932b | ||
|
|
6c335846d9 | ||
|
|
774f93e8d3 | ||
|
|
535cfa538b | ||
|
|
ac63b3f8ef | ||
|
|
4039b5b97c | ||
|
|
67334bfb26 | ||
|
|
36e13dd42f | ||
|
|
de485f4973 | ||
|
|
56310cbc4c | ||
|
|
68cd8deadc | ||
|
|
b2a0243f05 | ||
|
|
a99b7d39dc | ||
|
|
755508c423 | ||
|
|
adbf38414e | ||
|
|
c3be61e204 | ||
|
|
490753f440 | ||
|
|
f3fc5e1e3f | ||
|
|
e2c5e5a513 | ||
|
|
c5a9efca96 | ||
|
|
15905aec48 | ||
|
|
2b92d9f6d3 | ||
|
|
bfa48c3c09 | ||
|
|
ef6062981b | ||
|
|
f57eca6f28 | ||
|
|
885ebdae10 | ||
|
|
33561a5417 | ||
|
|
bb31c819be | ||
|
|
d1c5de9ccb | ||
|
|
4274ebdd00 | ||
|
|
0fbd6a1615 | ||
|
|
bda8a084f5 | ||
|
|
939ec1ca1e | ||
|
|
69b307523c | ||
|
|
6482c0e20d | ||
|
|
ac9c62c907 | ||
|
|
806c23ef2e | ||
|
|
4c496a970f | ||
|
|
fa6eb32a5a | ||
|
|
eaec7e9624 | ||
|
|
e6ea83fece | ||
|
|
613e985811 | ||
|
|
b900d54f57 | ||
|
|
83e5279d62 | ||
|
|
b36cde2308 | ||
|
|
c1a2249c96 | ||
|
|
e3afb1ebc8 | ||
|
|
686345f1d0 | ||
|
|
7b15a9372c | ||
|
|
b52792d84d | ||
|
|
a684aa1df4 | ||
|
|
69a3fba2aa | ||
|
|
c6ec5a0d9e | ||
|
|
de68393270 | ||
|
|
12e5797e51 | ||
|
|
6c65263f8d | ||
|
|
32f0a45c33 | ||
|
|
726f3bce5a | ||
|
|
75f253d7d2 | ||
|
|
a5c04850e6 | ||
|
|
cef4500611 | ||
|
|
df2da07184 | ||
|
|
77912d65c7 | ||
|
|
878425f147 | ||
|
|
fa9ad15e41 | ||
|
|
961f75d11b | ||
|
|
60c5ef3508 | ||
|
|
e5e7a913c2 | ||
|
|
165e39a0bb | ||
|
|
09d5966e46 | ||
|
|
0bd433ebf5 | ||
|
|
c2e003ecd5 | ||
|
|
9f51e226dc | ||
|
|
681499ebfe | ||
|
|
5d96094939 | ||
|
|
10d9e0805e | ||
|
|
c1c6613ddd | ||
|
|
5db4eaac2d | ||
|
|
f99f36f637 | ||
|
|
7705d9a8cc | ||
|
|
bcec98bf1c | ||
|
|
0d9809c4ec | ||
|
|
dcf64630f8 | ||
|
|
fa610f7f20 | ||
|
|
d97ad36d90 | ||
|
|
de7377a170 | ||
|
|
c471ec56b4 | ||
|
|
9d55534cc7 | ||
|
|
54f4e9b66c | ||
|
|
3e783002b3 | ||
|
|
935678cbe1 | ||
|
|
ee75b5020b | ||
|
|
5f21a24580 | ||
|
|
100002e4c6 | ||
|
|
71824019fb | ||
|
|
3400b3d2df | ||
|
|
745d83f968 | ||
|
|
340a680de2 | ||
|
|
3048bd79b3 | ||
|
|
ef37926f31 | ||
|
|
4c30bcfbfe | ||
|
|
709ad80662 | ||
|
|
08a834a08a | ||
|
|
6c3dd24e59 | ||
|
|
66d6c031b0 | ||
|
|
957882caef | ||
|
|
8781450256 | ||
|
|
9d23f215a0 | ||
|
|
2c1a0b7d32 | ||
|
|
9e52c53a5d | ||
|
|
f812a2c912 | ||
|
|
d3c848094f | ||
|
|
37d694ae80 | ||
|
|
e391e1a200 | ||
|
|
199f985754 | ||
|
|
395ffa8930 | ||
|
|
90920546e4 | ||
|
|
1d9ec42166 | ||
|
|
57481984c9 | ||
|
|
05051d864d | ||
|
|
48ee7e9b3a | ||
|
|
1278cee687 | ||
|
|
b5195d2739 | ||
|
|
7561770d43 | ||
|
|
03fbfe7cf1 | ||
|
|
9faa58ecdc | ||
|
|
cc19812fb4 | ||
|
|
110d499544 | ||
|
|
7fe64f43f4 | ||
|
|
47007075d4 | ||
|
|
9dc2193d31 | ||
|
|
403d5e0b7d | ||
|
|
5d9dfed5c4 | ||
|
|
9924a6c72d | ||
|
|
ccf6077d4e | ||
|
|
38978dc0b8 | ||
|
|
9152ef8b1d | ||
|
|
4e4521b5bf | ||
|
|
501211d4d5 | ||
|
|
155aad308c | ||
|
|
11e383d24c | ||
|
|
aff0c68b0f | ||
|
|
3b75e27536 | ||
|
|
5f3b7a7616 | ||
|
|
fb8d219960 | ||
|
|
ae88920dec | ||
|
|
57c6f14828 | ||
|
|
bd9a5e1b88 | ||
|
|
8614fcf709 | ||
|
|
2202d845ab | ||
|
|
a55d8c6aa4 | ||
|
|
b6312e2d51 | ||
|
|
5a41a612c9 | ||
|
|
aaea770f1f | ||
|
|
6e4607f23a | ||
|
|
5a192f85d9 | ||
|
|
9ce56ec4ca | ||
|
|
e47cfd447c | ||
|
|
fc2433de1d | ||
|
|
8cf7c76ce1 | ||
|
|
5d8269d28a | ||
|
|
9f542cf856 | ||
|
|
398a0159a6 | ||
|
|
8ce627f9b1 | ||
|
|
a7e5ad1268 | ||
|
|
8223a46ca0 | ||
|
|
1890a0f3b2 | ||
|
|
2dbcd4154c | ||
|
|
0524f419cf | ||
|
|
a90c197e94 | ||
|
|
21458bd419 | ||
|
|
7e96247751 | ||
|
|
07e2aa9b80 | ||
|
|
5c37b7ea47 | ||
|
|
79081f46ec | ||
|
|
4f9e333b05 | ||
|
|
dc09c258f0 | ||
|
|
5de0f305f9 | ||
|
|
52dc5edde3 | ||
|
|
9d086cd151 | ||
|
|
2edde1021f | ||
|
|
afc60481c7 | ||
|
|
eb94ba9052 | ||
|
|
6fa445d50e | ||
|
|
795843df09 | ||
|
|
8a20492e8a | ||
|
|
70ff3b6d98 | ||
|
|
ba79e6f631 | ||
|
|
071d5de3f3 | ||
|
|
1fa324c533 | ||
|
|
958c7f773f | ||
|
|
141240c409 | ||
|
|
89e945be6a | ||
|
|
7d30c2df87 | ||
|
|
90a4f95d3d | ||
|
|
53db004d24 | ||
|
|
f7d5b31d6c | ||
|
|
35d3782099 | ||
|
|
1080ef1105 | ||
|
|
7bd151a4f3 | ||
|
|
e1f53370ed | ||
|
|
e708d0ab68 | ||
|
|
e6e867558b | ||
|
|
ab81049f37 | ||
|
|
0b2f036a81 | ||
|
|
6ed9f0763b | ||
|
|
1e225af16e | ||
|
|
385365f689 | ||
|
|
dec4fb1bee | ||
|
|
ef1a8f21e0 | ||
|
|
0c1b16db4c | ||
|
|
02c530f442 | ||
|
|
df2fddf9cb | ||
|
|
6f0c0167c6 | ||
|
|
47c5f1c3bc | ||
|
|
29a5cc693c | ||
|
|
c3a1b97511 | ||
|
|
f1369ae9fe | ||
|
|
8620d997d4 | ||
|
|
7d06a71c02 | ||
|
|
7c5028614b | ||
|
|
6844fac9d5 | ||
|
|
41b5ca8582 | ||
|
|
7a1504dfe8 | ||
|
|
062623f6ef | ||
|
|
62ad5b81cb | ||
|
|
ada8ebb116 | ||
|
|
f1f2cbbc0d | ||
|
|
c434795edf | ||
|
|
25330d9f38 | ||
|
|
c1c5eb6866 | ||
|
|
51e089403a | ||
|
|
058ef489a0 | ||
|
|
3eb7e626d0 | ||
|
|
386e75b7f0 | ||
|
|
f72a801d51 | ||
|
|
4ffc32566a | ||
|
|
3f692305dc | ||
|
|
4ff17dc89d | ||
|
|
1a506c5dfd | ||
|
|
84865e45ea | ||
|
|
ae97dbe1db | ||
|
|
edb2641243 | ||
|
|
c8635bab0b | ||
|
|
cd50451812 | ||
|
|
877979c8b5 | ||
|
|
f69eca96d1 | ||
|
|
c0a8c9b985 | ||
|
|
09ab224a2f | ||
|
|
0e9001afd5 | ||
|
|
d63678cdfa | ||
|
|
1af2581f0b | ||
|
|
9dcb176dc8 | ||
|
|
64ba74deff | ||
|
|
ff047d3a77 | ||
|
|
b137421cfc | ||
|
|
3a8590f105 | ||
|
|
3571525ab8 | ||
|
|
204762c531 | ||
|
|
394d340ab1 | ||
|
|
4bf5435d95 | ||
|
|
05dba88379 | ||
|
|
1ab5a6851d | ||
|
|
781866f64e | ||
|
|
702c428804 | ||
|
|
5882121a94 | ||
|
|
6c2f754a0a | ||
|
|
acd0bedbce | ||
|
|
90f8d53800 | ||
|
|
23c6b49566 | ||
|
|
f204d16012 | ||
|
|
3796541746 | ||
|
|
0e676f74c5 | ||
|
|
26666187e3 | ||
|
|
c270f92b08 | ||
|
|
1670051a79 | ||
|
|
c61f04c34e | ||
|
|
2b26745c70 | ||
|
|
28ca6cc34b | ||
|
|
ada59bde67 | ||
|
|
9a68fb1364 | ||
|
|
f87c92143e | ||
|
|
f38e44bbb2 | ||
|
|
4d7f50382e | ||
|
|
6803d97bdb | ||
|
|
81ed10442b | ||
|
|
1a46002fad | ||
|
|
2747b2003e | ||
|
|
375297ea28 | ||
|
|
c2662a5095 | ||
|
|
da56e3df88 | ||
|
|
388dbe4928 | ||
|
|
dbcce81f66 | ||
|
|
46ac868403 | ||
|
|
6e1105e1e8 | ||
|
|
4494f59a26 | ||
|
|
13590b23c6 | ||
|
|
2c3861ee68 | ||
|
|
9cf7aabecf | ||
|
|
81d1a4aadf | ||
|
|
6578845f69 | ||
|
|
b5a4e78df5 | ||
|
|
68b55c1e85 | ||
|
|
4234beb034 | ||
|
|
ddb5143d9d | ||
|
|
25dcd673f5 | ||
|
|
1ad7977742 | ||
|
|
fe40f117c1 | ||
|
|
0550d8c73e | ||
|
|
bc821a2ab5 | ||
|
|
aa72ed0b23 | ||
|
|
e0a2bbd2a4 | ||
|
|
1a2454fcba | ||
|
|
92675a93ba | ||
|
|
1bafc89431 | ||
|
|
dc785b64c1 | ||
|
|
257dbe8d39 | ||
|
|
c81c4cb0c7 | ||
|
|
da3edbd85b | ||
|
|
44aa4f320a | ||
|
|
38dbccd997 | ||
|
|
6c27a7b50e | ||
|
|
7ef3bc97b7 | ||
|
|
807b96f882 | ||
|
|
2add98ffc8 | ||
|
|
ed7fe93178 | ||
|
|
397081ef41 | ||
|
|
570eeea297 | ||
|
|
b9232eb2b4 | ||
|
|
405578286d | ||
|
|
1c937b6359 | ||
|
|
567200dcf2 | ||
|
|
b4f5708c05 | ||
|
|
b8cb28fc2f | ||
|
|
495d37ab0b | ||
|
|
9d60cb9450 | ||
|
|
5592e80877 | ||
|
|
979ecf3eea | ||
|
|
770f5bb229 | ||
|
|
44211ed500 | ||
|
|
ac715efc14 | ||
|
|
b256ae8f80 | ||
|
|
fa969ffb59 | ||
|
|
e67311606e | ||
|
|
b17aecd70a | ||
|
|
1cb265f575 | ||
|
|
31b7cac818 | ||
|
|
05738313c3 | ||
|
|
25cf1a65ec | ||
|
|
442730168e | ||
|
|
2ca5c8c03e | ||
|
|
fa056279ea | ||
|
|
7ec098bedc | ||
|
|
68d048abfd | ||
|
|
d5848aa719 | ||
|
|
9edf601d2d | ||
|
|
155d0deae8 | ||
|
|
85408dfd36 | ||
|
|
43fb63af31 | ||
|
|
8add7fccde | ||
|
|
01f5e6778c | ||
|
|
1ff81200ac | ||
|
|
d2f1ca8cba | ||
|
|
caab52f6cc | ||
|
|
b4eb195b34 | ||
|
|
3dbabb693d | ||
|
|
5dd34a717e | ||
|
|
e7cfb3b469 | ||
|
|
c2494d3014 | ||
|
|
9d87cd9952 | ||
|
|
1851a96b47 | ||
|
|
efd2d7ee05 | ||
|
|
b16bc3d277 | ||
|
|
adcf8bf7b5 | ||
|
|
fda17235fd | ||
|
|
c5bdef5617 | ||
|
|
77640e96dd | ||
|
|
98d9b82759 | ||
|
|
1aac5c310f |
8
.gitignore
vendored
@@ -9,11 +9,9 @@ build*/pyshtables.py
|
||||
pstage/
|
||||
scripts/oe-git-proxy-socks
|
||||
sources/
|
||||
meta-darwin
|
||||
meta-maemo
|
||||
meta-extras
|
||||
meta-m2
|
||||
meta-prvt*
|
||||
meta-*
|
||||
!meta-skeleton
|
||||
!meta-demoapps
|
||||
*.swp
|
||||
*.orig
|
||||
*.rej
|
||||
|
||||
@@ -68,12 +68,12 @@ Intel Atom based PCs and devices (atom-pc)
|
||||
|
||||
The atom-pc MACHINE is tested on the following platforms:
|
||||
|
||||
o Asus eee901
|
||||
o Asus EeePC 901
|
||||
o Acer Aspire One
|
||||
o Toshiba NB305
|
||||
o Intel Embedded Development Board 1-N450 (Black Sand)
|
||||
|
||||
and is likely to work on many unlisted atom based devices. The MACHINE type
|
||||
and is likely to work on many unlisted Atom based devices. The MACHINE type
|
||||
supports ethernet, wifi, sound, and i915 graphics by default in addition to
|
||||
common PC input devices, busses, and so on.
|
||||
|
||||
@@ -83,26 +83,18 @@ straightforward with a caveat for USB devices. The following examples assume the
|
||||
target boot device is /dev/sdb, be sure to verify this and use the correct
|
||||
device as the following commands are run as root and are not reversable.
|
||||
|
||||
Hard Disk:
|
||||
1. Build a directdisk image format. This will generate proper partition tables
|
||||
that will in turn be written to the physical media. For example:
|
||||
|
||||
$ bitbake core-image-minimal-directdisk
|
||||
|
||||
2. Use the "dd" utility to write the image to the raw block device. For example:
|
||||
|
||||
# dd if=core-image-minimal-directdisk-atom-pc.hdddirect of=/dev/sdb
|
||||
|
||||
USB Device:
|
||||
1. Build an hddimg image format. This is a simple filesystem without partition
|
||||
tables and is suitable for USB keys. For example:
|
||||
1. Build a live image. This image type consists of a simple filesystem
|
||||
without a partition table, which is suitable for USB keys, and with the
|
||||
default setup for the atom-pc machine, this image type is built
|
||||
automatically for any image you build. For example:
|
||||
|
||||
$ bitbake core-image-minimal-live
|
||||
$ bitbake core-image-minimal
|
||||
|
||||
2. Use the "dd" utility to write the image to the raw block device. For
|
||||
example:
|
||||
|
||||
# dd if=core-image-minimal-live-atom-pc.hddimg of=/dev/sdb
|
||||
# dd if=core-image-minimal-atom-pc.hddimg of=/dev/sdb
|
||||
|
||||
If the device fails to boot with "Boot error" displayed, it is likely the BIOS
|
||||
cannot understand the physical layout of the disk (or rather it expects a
|
||||
@@ -126,7 +118,7 @@ USB Device:
|
||||
|
||||
b. Copy the contents of the poky image to the USB-ZIP mode device:
|
||||
|
||||
# mount -o loop core-image-minimal-live-atom-pc.hddimg /tmp/image
|
||||
# mount -o loop core-image-minimal-atom-pc.hddimg /tmp/image
|
||||
# mount /dev/sdb4 /tmp/usbkey
|
||||
# cp -rf /tmp/image/* /tmp/usbkey
|
||||
|
||||
@@ -150,7 +142,7 @@ faster CPU, more RAM, an ethernet port, more USB ports, microSD, and removes
|
||||
the NAND flash. The beagleboard MACHINE is tested on the following platforms:
|
||||
|
||||
o Beagleboard C4
|
||||
o Beagleboard xM Rev A
|
||||
o Beagleboard xM rev A & B
|
||||
|
||||
The Beagleboard C4 has NAND, while the xM does not. For the sake of simplicity,
|
||||
these instructions assume you have erased the NAND on the C4 so its boot
|
||||
|
||||
@@ -4,6 +4,10 @@ import os
|
||||
import sys
|
||||
import warnings
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
|
||||
from bb import fetch2
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger("BitBake")
|
||||
|
||||
try:
|
||||
import cPickle as pickle
|
||||
@@ -16,13 +20,20 @@ class BBConfiguration(object):
|
||||
Manages build options and configurations for one run
|
||||
"""
|
||||
|
||||
def __init__(self, debug, debug_domains):
|
||||
setattr(self, "data", {})
|
||||
setattr(self, "file", [])
|
||||
setattr(self, "cmd", None)
|
||||
setattr(self, "dump_signatures", True)
|
||||
setattr(self, "debug", debug)
|
||||
setattr(self, "debug_domains", debug_domains)
|
||||
def __init__(self, **options):
|
||||
self.data = {}
|
||||
self.file = []
|
||||
self.cmd = None
|
||||
self.dump_signatures = True
|
||||
self.prefile = []
|
||||
self.postfile = []
|
||||
self.parse_only = True
|
||||
|
||||
def __getattr__(self, attribute):
|
||||
try:
|
||||
return super(BBConfiguration, self).__getattribute__(attribute)
|
||||
except AttributeError:
|
||||
return None
|
||||
|
||||
_warnings_showwarning = warnings.showwarning
|
||||
def _showwarning(message, category, filename, lineno, file=None, line=None):
|
||||
@@ -39,82 +50,70 @@ warnings.showwarning = _showwarning
|
||||
warnings.simplefilter("ignore", DeprecationWarning)
|
||||
|
||||
import bb.event
|
||||
|
||||
# Need to map our I/O correctly. stdout is a pipe to the server expecting
|
||||
# events. We save this and then map stdout to stderr.
|
||||
|
||||
eventfd = os.dup(sys.stdout.fileno())
|
||||
bb.event.worker_pipe = os.fdopen(eventfd, 'w', 0)
|
||||
|
||||
# map stdout to stderr
|
||||
os.dup2(sys.stderr.fileno(), sys.stdout.fileno())
|
||||
|
||||
# Replace those fds with our own
|
||||
#logout = data.expand("${TMPDIR}/log/stdout.%s" % os.getpid(), self.cfgData, True)
|
||||
#mkdirhier(os.path.dirname(logout))
|
||||
#newso = open("/tmp/stdout.%s" % os.getpid(), 'w')
|
||||
#os.dup2(newso.fileno(), sys.stdout.fileno())
|
||||
#os.dup2(newso.fileno(), sys.stderr.fileno())
|
||||
|
||||
# Don't read from stdin from the parent
|
||||
si = file("/dev/null", 'r')
|
||||
os.dup2(si.fileno( ), sys.stdin.fileno( ))
|
||||
|
||||
# We don't want to see signals to our parent, e.g. Ctrl+C
|
||||
os.setpgrp()
|
||||
|
||||
# Save out the PID so that the event can include it the
|
||||
# events
|
||||
bb.event.worker_pid = os.getpid()
|
||||
bb.event.useStdout = False
|
||||
|
||||
hashfile = sys.argv[1]
|
||||
buildfile = sys.argv[2]
|
||||
taskname = sys.argv[3]
|
||||
|
||||
import bb.cooker
|
||||
|
||||
p = pickle.Unpickler(file(hashfile, "rb"))
|
||||
hashdata = p.load()
|
||||
buildfile = sys.argv[1]
|
||||
taskname = sys.argv[2]
|
||||
if len(sys.argv) >= 4:
|
||||
dryrun = sys.argv[3]
|
||||
else:
|
||||
dryrun = False
|
||||
if len(sys.argv) >= 5:
|
||||
hashfile = sys.argv[4]
|
||||
p = pickle.Unpickler(file(hashfile, "rb"))
|
||||
hashdata = p.load()
|
||||
else:
|
||||
hashdata = None
|
||||
|
||||
debug = hashdata["msg-debug"]
|
||||
debug_domains = hashdata["msg-debug-domains"]
|
||||
verbose = hashdata["verbose"]
|
||||
handler = bb.event.LogHandler()
|
||||
logger.addHandler(handler)
|
||||
|
||||
bb.utils.init_logger(bb.msg, verbose, debug, debug_domains)
|
||||
#An example to make debug log messages show up
|
||||
#bb.msg.init_msgconfig(True, 3, [])
|
||||
|
||||
cooker = bb.cooker.BBCooker(BBConfiguration(debug, debug_domains), None)
|
||||
cooker.parseConfiguration()
|
||||
console = logging.StreamHandler(sys.stdout)
|
||||
format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
|
||||
bb.msg.addDefaultlogFilter(console)
|
||||
console.setFormatter(format)
|
||||
|
||||
cooker.bb_cache = bb.cache.init(cooker)
|
||||
cooker.status = bb.cache.CacheData()
|
||||
def worker_fire(event, d):
|
||||
if isinstance(event, logging.LogRecord):
|
||||
console.handle(event)
|
||||
bb.event.worker_fire = worker_fire
|
||||
bb.event.worker_pid = os.getpid()
|
||||
|
||||
(fn, cls) = cooker.bb_cache.virtualfn2realfn(buildfile)
|
||||
initialenv = os.environ.copy()
|
||||
config = BBConfiguration()
|
||||
|
||||
def register_idle_function(self, function, data):
|
||||
pass
|
||||
|
||||
cooker = bb.cooker.BBCooker(config, register_idle_function, initialenv)
|
||||
config_data = cooker.configuration.data
|
||||
cooker.status = config_data
|
||||
cooker.handleCollections(bb.data.getVar("BBFILE_COLLECTIONS", config_data, 1))
|
||||
|
||||
fn, cls = bb.cache.Cache.virtualfn2realfn(buildfile)
|
||||
buildfile = cooker.matchFile(fn)
|
||||
fn = cooker.bb_cache.realfn2virtual(buildfile, cls)
|
||||
fn = bb.cache.Cache.realfn2virtual(buildfile, cls)
|
||||
|
||||
cooker.buildSetVars()
|
||||
|
||||
# Load data into the cache for fn and parse the loaded cache data
|
||||
the_data = cooker.bb_cache.loadDataFull(fn, cooker.get_file_appends(fn), cooker.configuration.data)
|
||||
cooker.bb_cache.setData(fn, buildfile, the_data)
|
||||
cooker.bb_cache.handle_data(fn, cooker.status)
|
||||
|
||||
#exportlist = bb.utils.preserved_envvars_export_list()
|
||||
#bb.utils.filter_environment(exportlist)
|
||||
the_data = bb.cache.Cache.loadDataFull(fn, cooker.get_file_appends(fn), cooker.configuration.data)
|
||||
|
||||
if taskname.endswith("_setscene"):
|
||||
the_data.setVarFlag(taskname, "quieterrors", "1")
|
||||
|
||||
bb.parse.siggen.set_taskdata(hashdata["hashes"], hashdata["deps"])
|
||||
|
||||
for h in hashdata["hashes"]:
|
||||
bb.data.setVar("BBHASH_%s" % h, hashdata["hashes"][h], the_data)
|
||||
for h in hashdata["deps"]:
|
||||
bb.data.setVar("BBHASHDEPS_%s" % h, hashdata["deps"][h], the_data)
|
||||
if hashdata:
|
||||
bb.parse.siggen.set_taskdata(hashdata["hashes"], hashdata["deps"])
|
||||
for h in hashdata["hashes"]:
|
||||
bb.data.setVar("BBHASH_%s" % h, hashdata["hashes"][h], the_data)
|
||||
for h in hashdata["deps"]:
|
||||
bb.data.setVar("BBHASHDEPS_%s" % h, hashdata["deps"][h], the_data)
|
||||
|
||||
ret = 0
|
||||
if sys.argv[4] != "True":
|
||||
if dryrun != "True":
|
||||
ret = bb.build.exec_task(fn, taskname, the_data)
|
||||
sys.exit(ret)
|
||||
|
||||
|
||||
@@ -149,8 +149,7 @@ def exec_func(func, d, dirs = None):
|
||||
adir = dirs[-1]
|
||||
else:
|
||||
adir = data.getVar('B', d, 1)
|
||||
if not os.path.exists(adir):
|
||||
adir = None
|
||||
bb.utils.mkdirhier(adir)
|
||||
|
||||
ispython = flags.get('python')
|
||||
if flags.get('fakeroot') and not flags.get('task'):
|
||||
|
||||
@@ -150,117 +150,79 @@ def parser_cache_savemerge(d):
|
||||
bb.utils.unlockfile(glf)
|
||||
|
||||
|
||||
Logger = logging.getLoggerClass()
|
||||
class BufferedLogger(Logger):
|
||||
def __init__(self, name, level=0, target=None):
|
||||
Logger.__init__(self, name)
|
||||
self.setLevel(level)
|
||||
self.buffer = []
|
||||
self.target = target
|
||||
|
||||
def handle(self, record):
|
||||
self.buffer.append(record)
|
||||
|
||||
def flush(self):
|
||||
for record in self.buffer:
|
||||
self.target.handle(record)
|
||||
self.buffer = []
|
||||
|
||||
class PythonParser():
|
||||
class ValueVisitor():
|
||||
"""Visitor to traverse a python abstract syntax tree and obtain
|
||||
the variables referenced via bitbake metadata APIs, and the external
|
||||
functions called.
|
||||
getvars = ("d.getVar", "bb.data.getVar", "data.getVar")
|
||||
execfuncs = ("bb.build.exec_func", "bb.build.exec_task")
|
||||
|
||||
def warn(self, func, arg):
|
||||
"""Warn about calls of bitbake APIs which pass a non-literal
|
||||
argument for the variable name, as we're not able to track such
|
||||
a reference.
|
||||
"""
|
||||
|
||||
getvars = ("d.getVar", "bb.data.getVar", "data.getVar")
|
||||
expands = ("d.expand", "bb.data.expand", "data.expand")
|
||||
execs = ("bb.build.exec_func", "bb.build.exec_task")
|
||||
try:
|
||||
funcstr = codegen.to_source(func)
|
||||
argstr = codegen.to_source(arg)
|
||||
except TypeError:
|
||||
self.log.debug(2, 'Failed to convert function and argument to source form')
|
||||
else:
|
||||
self.log.debug(1, self.unhandled_message % (funcstr, argstr))
|
||||
|
||||
@classmethod
|
||||
def _compare_name(cls, strparts, node):
|
||||
"""Given a sequence of strings representing a python name,
|
||||
where the last component is the actual Name and the prior
|
||||
elements are Attribute nodes, determine if the supplied node
|
||||
matches.
|
||||
"""
|
||||
def visit_Call(self, node):
|
||||
name = self.called_node_name(node.func)
|
||||
if name in self.getvars:
|
||||
if isinstance(node.args[0], ast.Str):
|
||||
self.var_references.add(node.args[0].s)
|
||||
else:
|
||||
self.warn(node.func, node.args[0])
|
||||
elif name in self.execfuncs:
|
||||
if isinstance(node.args[0], ast.Str):
|
||||
self.var_execs.add(node.args[0].s)
|
||||
else:
|
||||
self.warn(node.func, node.args[0])
|
||||
elif name and isinstance(node.func, (ast.Name, ast.Attribute)):
|
||||
self.execs.add(name)
|
||||
|
||||
if not strparts:
|
||||
return True
|
||||
|
||||
current, rest = strparts[0], strparts[1:]
|
||||
def called_node_name(self, node):
|
||||
"""Given a called node, return its original string form"""
|
||||
components = []
|
||||
while node:
|
||||
if isinstance(node, ast.Attribute):
|
||||
if current == node.attr:
|
||||
return cls._compare_name(rest, node.value)
|
||||
components.append(node.attr)
|
||||
node = node.value
|
||||
elif isinstance(node, ast.Name):
|
||||
if current == node.id:
|
||||
return True
|
||||
return False
|
||||
|
||||
@classmethod
|
||||
def compare_name(cls, value, node):
|
||||
"""Convenience function for the _compare_node method, which
|
||||
can accept a string (which is split by '.' for you), or an
|
||||
iterable of strings, in which case it checks to see if any of
|
||||
them match, similar to isinstance.
|
||||
"""
|
||||
|
||||
if isinstance(value, basestring):
|
||||
return cls._compare_name(tuple(reversed(value.split("."))),
|
||||
node)
|
||||
components.append(node.id)
|
||||
return '.'.join(reversed(components))
|
||||
else:
|
||||
return any(cls.compare_name(item, node) for item in value)
|
||||
break
|
||||
|
||||
def __init__(self, value):
|
||||
self.var_references = set()
|
||||
self.var_execs = set()
|
||||
self.direct_func_calls = set()
|
||||
self.var_expands = set()
|
||||
self.value = value
|
||||
|
||||
@classmethod
|
||||
def warn(cls, func, arg):
|
||||
"""Warn about calls of bitbake APIs which pass a non-literal
|
||||
argument for the variable name, as we're not able to track such
|
||||
a reference.
|
||||
"""
|
||||
|
||||
try:
|
||||
funcstr = codegen.to_source(func)
|
||||
argstr = codegen.to_source(arg)
|
||||
except TypeError:
|
||||
logger.debug(2, 'Failed to convert function and argument to source form')
|
||||
else:
|
||||
logger.debug(1, "Warning: in call to '%s', argument '%s' is "
|
||||
"not a literal", funcstr, argstr)
|
||||
|
||||
def visit_Call(self, node):
|
||||
if self.compare_name(self.getvars, node.func):
|
||||
if isinstance(node.args[0], ast.Str):
|
||||
self.var_references.add(node.args[0].s)
|
||||
else:
|
||||
self.warn(node.func, node.args[0])
|
||||
elif self.compare_name(self.expands, node.func):
|
||||
if isinstance(node.args[0], ast.Str):
|
||||
self.warn(node.func, node.args[0])
|
||||
self.var_expands.update(node.args[0].s)
|
||||
elif isinstance(node.args[0], ast.Call) and \
|
||||
self.compare_name(self.getvars, node.args[0].func):
|
||||
pass
|
||||
else:
|
||||
self.warn(node.func, node.args[0])
|
||||
elif self.compare_name(self.execs, node.func):
|
||||
if isinstance(node.args[0], ast.Str):
|
||||
self.var_execs.add(node.args[0].s)
|
||||
else:
|
||||
self.warn(node.func, node.args[0])
|
||||
elif isinstance(node.func, ast.Name):
|
||||
self.direct_func_calls.add(node.func.id)
|
||||
elif isinstance(node.func, ast.Attribute):
|
||||
# We must have a qualified name. Therefore we need
|
||||
# to walk the chain of 'Attribute' nodes to determine
|
||||
# the qualification.
|
||||
attr_node = node.func.value
|
||||
identifier = node.func.attr
|
||||
while isinstance(attr_node, ast.Attribute):
|
||||
identifier = attr_node.attr + "." + identifier
|
||||
attr_node = attr_node.value
|
||||
if isinstance(attr_node, ast.Name):
|
||||
identifier = attr_node.id + "." + identifier
|
||||
self.direct_func_calls.add(identifier)
|
||||
|
||||
def __init__(self):
|
||||
#self.funcdefs = set()
|
||||
def __init__(self, name, log):
|
||||
self.var_references = set()
|
||||
self.var_execs = set()
|
||||
self.execs = set()
|
||||
#self.external_cmds = set()
|
||||
self.references = set()
|
||||
self.log = BufferedLogger('BitBake.Data.%s' % name, logging.DEBUG, log)
|
||||
|
||||
self.unhandled_message = "in call of %s, argument '%s' is not a string literal"
|
||||
self.unhandled_message = "while parsing %s, %s" % (name, self.unhandled_message)
|
||||
|
||||
def parse_python(self, node):
|
||||
|
||||
h = hash(str(node))
|
||||
|
||||
if h in pythonparsecache:
|
||||
@@ -271,24 +233,25 @@ class PythonParser():
|
||||
code = compile(check_indent(str(node)), "<string>", "exec",
|
||||
ast.PyCF_ONLY_AST)
|
||||
|
||||
visitor = self.ValueVisitor(code)
|
||||
for n in ast.walk(code):
|
||||
if n.__class__.__name__ == "Call":
|
||||
visitor.visit_Call(n)
|
||||
self.visit_Call(n)
|
||||
|
||||
self.references.update(visitor.var_references)
|
||||
self.references.update(visitor.var_execs)
|
||||
self.execs = visitor.direct_func_calls
|
||||
self.references.update(self.var_references)
|
||||
self.references.update(self.var_execs)
|
||||
|
||||
pythonparsecache[h] = {}
|
||||
pythonparsecache[h]["refs"] = self.references
|
||||
pythonparsecache[h]["execs"] = self.execs
|
||||
|
||||
class ShellParser():
|
||||
def __init__(self):
|
||||
def __init__(self, name, log):
|
||||
self.funcdefs = set()
|
||||
self.allexecs = set()
|
||||
self.execs = set()
|
||||
self.log = BufferedLogger('BitBake.Data.%s' % name, logging.DEBUG, log)
|
||||
self.unhandled_template = "unable to handle non-literal command '%s'"
|
||||
self.unhandled_template = "while parsing %s, %s" % (name, self.unhandled_template)
|
||||
|
||||
def parse_shell(self, value):
|
||||
"""Parse the supplied shell code in a string, returning the external
|
||||
@@ -403,8 +366,7 @@ class ShellParser():
|
||||
|
||||
cmd = word[1]
|
||||
if cmd.startswith("$"):
|
||||
logger.debug(1, "Warning: execution of non-literal "
|
||||
"command '%s'", cmd)
|
||||
self.log.debug(1, self.unhandled_template % cmd)
|
||||
elif cmd == "eval":
|
||||
command = " ".join(word for _, word in words[1:])
|
||||
self.parse_shell(command)
|
||||
|
||||
@@ -288,7 +288,9 @@ class BBCooker:
|
||||
self.status = bb.cache.CacheData(self.caches_array)
|
||||
self.handleCollections( bb.data.getVar("BBFILE_COLLECTIONS", self.configuration.data, 1) )
|
||||
|
||||
fn = self.matchFile(buildfile)
|
||||
fn, cls = bb.cache.Cache.virtualfn2realfn(buildfile)
|
||||
fn = self.matchFile(fn)
|
||||
fn = bb.cache.Cache.realfn2virtual(fn, cls)
|
||||
elif len(pkgs_to_build) == 1:
|
||||
self.updateCache()
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ from bb import data_smart
|
||||
from bb import codeparser
|
||||
import bb
|
||||
|
||||
logger = data_smart.logger
|
||||
_dict_type = data_smart.DataSmart
|
||||
|
||||
def init():
|
||||
@@ -258,7 +259,7 @@ def emit_func(func, o=sys.__stdout__, d = init()):
|
||||
emit_var(key, o, d, False) and o.write('\n')
|
||||
|
||||
emit_var(func, o, d, False) and o.write('\n')
|
||||
newdeps = bb.codeparser.ShellParser().parse_shell(d.getVar(func, True))
|
||||
newdeps = bb.codeparser.ShellParser(func, logger).parse_shell(d.getVar(func, True))
|
||||
seen = set()
|
||||
while newdeps:
|
||||
deps = newdeps
|
||||
@@ -267,39 +268,45 @@ def emit_func(func, o=sys.__stdout__, d = init()):
|
||||
for dep in deps:
|
||||
if bb.data.getVarFlag(dep, "func", d):
|
||||
emit_var(dep, o, d, False) and o.write('\n')
|
||||
newdeps |= bb.codeparser.ShellParser().parse_shell(d.getVar(dep, True))
|
||||
newdeps |= bb.codeparser.ShellParser(dep, logger).parse_shell(d.getVar(dep, True))
|
||||
newdeps -= seen
|
||||
|
||||
def update_data(d):
|
||||
"""Performs final steps upon the datastore, including application of overrides"""
|
||||
d.finalize()
|
||||
|
||||
def build_dependencies(key, keys, shelldeps, d):
|
||||
def build_dependencies(key, keys, shelldeps, vardepvals, d):
|
||||
deps = set()
|
||||
vardeps = d.getVarFlag(key, "vardeps", True)
|
||||
try:
|
||||
if d.getVarFlag(key, "func"):
|
||||
value = d.getVar(key, False)
|
||||
if key in vardepvals:
|
||||
value = d.getVarFlag(key, "vardepvalue", True)
|
||||
elif d.getVarFlag(key, "func"):
|
||||
if d.getVarFlag(key, "python"):
|
||||
parsedvar = d.expandWithRefs(d.getVar(key, False), key)
|
||||
parser = bb.codeparser.PythonParser()
|
||||
parsedvar = d.expandWithRefs(value, key)
|
||||
parser = bb.codeparser.PythonParser(key, logger)
|
||||
parser.parse_python(parsedvar.value)
|
||||
deps = deps | parser.references
|
||||
else:
|
||||
parsedvar = d.expandWithRefs(d.getVar(key, False), key)
|
||||
parser = bb.codeparser.ShellParser()
|
||||
parsedvar = d.expandWithRefs(value, key)
|
||||
parser = bb.codeparser.ShellParser(key, logger)
|
||||
parser.parse_shell(parsedvar.value)
|
||||
deps = deps | shelldeps
|
||||
if vardeps is None:
|
||||
parser.log.flush()
|
||||
deps = deps | parsedvar.references
|
||||
deps = deps | (keys & parser.execs) | (keys & parsedvar.execs)
|
||||
else:
|
||||
parser = d.expandWithRefs(d.getVar(key, False), key)
|
||||
parser = d.expandWithRefs(value, key)
|
||||
deps |= parser.references
|
||||
deps = deps | (keys & parser.execs)
|
||||
deps |= set((d.getVarFlag(key, "vardeps", True) or "").split())
|
||||
deps |= set((vardeps or "").split())
|
||||
deps -= set((d.getVarFlag(key, "vardepsexclude", True) or "").split())
|
||||
except:
|
||||
bb.note("Error expanding variable %s" % key)
|
||||
raise
|
||||
return deps
|
||||
return deps, value
|
||||
#bb.note("Variable %s references %s and calls %s" % (key, str(deps), str(execs)))
|
||||
#d.setVarFlag(key, "vardeps", deps)
|
||||
|
||||
@@ -307,12 +314,14 @@ def generate_dependencies(d):
|
||||
|
||||
keys = set(key for key in d.keys() if not key.startswith("__"))
|
||||
shelldeps = set(key for key in keys if d.getVarFlag(key, "export") and not d.getVarFlag(key, "unexport"))
|
||||
vardepvals = set(key for key in keys if d.getVarFlag(key, "vardepvalue"))
|
||||
|
||||
deps = {}
|
||||
values = {}
|
||||
|
||||
tasklist = bb.data.getVar('__BBTASKS', d) or []
|
||||
for task in tasklist:
|
||||
deps[task] = build_dependencies(task, keys, shelldeps, d)
|
||||
deps[task], values[task] = build_dependencies(task, keys, shelldeps, vardepvals, d)
|
||||
newdeps = deps[task]
|
||||
seen = set()
|
||||
while newdeps:
|
||||
@@ -321,11 +330,11 @@ def generate_dependencies(d):
|
||||
newdeps = set()
|
||||
for dep in nextdeps:
|
||||
if dep not in deps:
|
||||
deps[dep] = build_dependencies(dep, keys, shelldeps, d)
|
||||
deps[dep], values[dep] = build_dependencies(dep, keys, shelldeps, vardepvals, d)
|
||||
newdeps |= deps[dep]
|
||||
newdeps -= seen
|
||||
#print "For %s: %s" % (task, str(taskdeps[task]))
|
||||
return tasklist, deps
|
||||
return tasklist, deps, values
|
||||
|
||||
def inherits_class(klass, d):
|
||||
val = getVar('__inherit_cache', d) or []
|
||||
|
||||
@@ -68,8 +68,14 @@ class VariableParse:
|
||||
code = match.group()[3:-1]
|
||||
codeobj = compile(code.strip(), self.varname or "<expansion>", "eval")
|
||||
|
||||
parser = bb.codeparser.PythonParser()
|
||||
parser = bb.codeparser.PythonParser(self.varname, logger)
|
||||
parser.parse_python(code)
|
||||
if self.varname:
|
||||
vardeps = self.d.getVarFlag(self.varname, "vardeps", True)
|
||||
if vardeps is None:
|
||||
parser.log.flush()
|
||||
else:
|
||||
parser.log.flush()
|
||||
self.references |= parser.references
|
||||
self.execs |= parser.execs
|
||||
|
||||
|
||||
@@ -197,6 +197,7 @@ def uri_replace(ud, uri_find, uri_replace, d):
|
||||
uri_decoded = list(decodeurl(ud.url))
|
||||
uri_find_decoded = list(decodeurl(uri_find))
|
||||
uri_replace_decoded = list(decodeurl(uri_replace))
|
||||
logger.debug(2, "For url %s comparing %s to %s" % (uri_decoded, uri_find_decoded, uri_replace_decoded))
|
||||
result_decoded = ['', '', '', '', '', {}]
|
||||
for i in uri_find_decoded:
|
||||
loc = uri_find_decoded.index(i)
|
||||
@@ -209,12 +210,18 @@ def uri_replace(ud, uri_find, uri_replace, d):
|
||||
result_decoded[loc] = re.sub(i, uri_replace_decoded[loc], uri_decoded[loc])
|
||||
if uri_find_decoded.index(i) == 2:
|
||||
if ud.mirrortarball:
|
||||
result_decoded[loc] = os.path.join(os.path.dirname(result_decoded[loc]), os.path.basename(ud.mirrortarball))
|
||||
if result_decoded[loc].endswith("/"):
|
||||
result_decoded[loc] = os.path.dirname(result_decoded[loc])
|
||||
result_decoded[loc] = os.path.join(result_decoded[loc], os.path.basename(ud.mirrortarball))
|
||||
elif ud.localpath:
|
||||
result_decoded[loc] = os.path.join(os.path.dirname(result_decoded[loc]), os.path.basename(ud.localpath))
|
||||
if result_decoded[loc].endswith("/"):
|
||||
result_decoded[loc] = os.path.dirname(result_decoded[loc])
|
||||
result_decoded[loc] = os.path.join(result_decoded[loc], os.path.basename(ud.localpath))
|
||||
else:
|
||||
return ud.url
|
||||
return encodeurl(result_decoded)
|
||||
result = encodeurl(result_decoded)
|
||||
logger.debug(2, "For url %s returning %s" % (ud.url, result))
|
||||
return result
|
||||
|
||||
methods = []
|
||||
urldata_cache = {}
|
||||
@@ -385,7 +392,8 @@ def runfetchcmd(cmd, d, quiet = False, cleanup = []):
|
||||
exportvars = ['PATH', 'GIT_PROXY_COMMAND', 'GIT_PROXY_HOST',
|
||||
'GIT_PROXY_PORT', 'GIT_CONFIG', 'http_proxy', 'ftp_proxy',
|
||||
'https_proxy', 'no_proxy', 'ALL_PROXY', 'all_proxy',
|
||||
'SSH_AUTH_SOCK', 'SSH_AGENT_PID', 'HOME']
|
||||
'SSH_AUTH_SOCK', 'SSH_AGENT_PID', 'HOME',
|
||||
'GIT_PROXY_IGNORE', 'SOCKS5_USER', 'SOCKS5_PASSWD']
|
||||
|
||||
for var in exportvars:
|
||||
val = bb.data.getVar(var, d, True)
|
||||
|
||||
@@ -190,7 +190,7 @@ class Git(FetchMethod):
|
||||
logger.debug(1, "No Origin")
|
||||
|
||||
runfetchcmd("%s remote add --mirror=fetch origin %s" % (ud.basecmd, repourl), d)
|
||||
fetch_cmd = "%s fetch --prune %s refs/*:refs/*" % (ud.basecmd, repourl)
|
||||
fetch_cmd = "%s fetch -f --prune %s refs/*:refs/*" % (ud.basecmd, repourl)
|
||||
bb.fetch2.check_network_access(d, fetch_cmd, ud.url)
|
||||
runfetchcmd(fetch_cmd, d)
|
||||
runfetchcmd("%s prune-packed" % ud.basecmd, d)
|
||||
@@ -220,7 +220,7 @@ class Git(FetchMethod):
|
||||
if os.path.exists(destdir):
|
||||
bb.utils.prunedir(destdir)
|
||||
|
||||
runfetchcmd("git clone -s -n %s %s" % (ud.clonedir, destdir), d)
|
||||
runfetchcmd("git clone -s -n %s/ %s" % (ud.clonedir, destdir), d)
|
||||
if not ud.nocheckout:
|
||||
os.chdir(destdir)
|
||||
if subdir != "":
|
||||
|
||||
@@ -50,9 +50,6 @@ class Local(FetchMethod):
|
||||
path = url.split("://")[1]
|
||||
path = path.split(";")[0]
|
||||
newpath = path
|
||||
dldirfile = os.path.join(data.getVar("DL_DIR", d, True), os.path.basename(path))
|
||||
if os.path.exists(dldirfile):
|
||||
return dldirfile
|
||||
if path[0] != "/":
|
||||
filespath = data.getVar('FILESPATH', d, True)
|
||||
if filespath:
|
||||
@@ -62,6 +59,7 @@ class Local(FetchMethod):
|
||||
if filesdir:
|
||||
newpath = os.path.join(filesdir, path)
|
||||
if not os.path.exists(newpath) and path.find("*") == -1:
|
||||
dldirfile = os.path.join(data.getVar("DL_DIR", d, True), os.path.basename(path))
|
||||
return dldirfile
|
||||
return newpath
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ def handle(fn, d, include):
|
||||
|
||||
# DONE WITH PARSING... time to evaluate
|
||||
if ext != ".bbclass":
|
||||
data.setVar('FILE', fn, d)
|
||||
data.setVar('FILE', abs_fn, d)
|
||||
|
||||
statements.eval(d)
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ def handle(fn, data, include):
|
||||
feeder(lineno, s, fn, statements)
|
||||
|
||||
# DONE WITH PARSING... time to evaluate
|
||||
bb.data.setVar('FILE', fn, data)
|
||||
bb.data.setVar('FILE', abs_fn, data)
|
||||
statements.eval(data)
|
||||
if oldfile:
|
||||
bb.data.setVar('FILE', oldfile, data)
|
||||
|
||||
@@ -47,9 +47,10 @@ if hasattr(sqlite3, 'enable_shared_cache'):
|
||||
@total_ordering
|
||||
class SQLTable(collections.MutableMapping):
|
||||
"""Object representing a table/domain in the database"""
|
||||
def __init__(self, cursor, table):
|
||||
self.cursor = cursor
|
||||
def __init__(self, cachefile, table):
|
||||
self.cachefile = cachefile
|
||||
self.table = table
|
||||
self.cursor = connect(self.cachefile)
|
||||
|
||||
self._execute("CREATE TABLE IF NOT EXISTS %s(key TEXT, value TEXT);"
|
||||
% table)
|
||||
@@ -63,6 +64,8 @@ class SQLTable(collections.MutableMapping):
|
||||
except sqlite3.OperationalError as exc:
|
||||
if 'database is locked' in str(exc) and count < 500:
|
||||
count = count + 1
|
||||
self.cursor.close()
|
||||
self.cursor = connect(self.cachefile)
|
||||
continue
|
||||
raise
|
||||
|
||||
@@ -188,7 +191,7 @@ class PersistData(object):
|
||||
del self.data[domain][key]
|
||||
|
||||
def connect(database):
|
||||
return sqlite3.connect(database, timeout=30, isolation_level=None)
|
||||
return sqlite3.connect(database, timeout=5, isolation_level=None)
|
||||
|
||||
def persist(domain, d):
|
||||
"""Convenience factory for SQLTable objects based upon metadata"""
|
||||
@@ -201,5 +204,4 @@ def persist(domain, d):
|
||||
|
||||
bb.utils.mkdirhier(cachedir)
|
||||
cachefile = os.path.join(cachedir, "bb_persist_data.sqlite3")
|
||||
connection = connect(cachefile)
|
||||
return SQLTable(connection, domain)
|
||||
return SQLTable(cachefile, domain)
|
||||
|
||||
@@ -1203,8 +1203,14 @@ class RunQueueExecuteTasks(RunQueueExecute):
|
||||
if task in self.rq.scenequeue_covered:
|
||||
continue
|
||||
if len(self.rqdata.runq_revdeps[task]) > 0 and self.rqdata.runq_revdeps[task].issubset(self.rq.scenequeue_covered):
|
||||
self.rq.scenequeue_covered.add(task)
|
||||
found = True
|
||||
ok = True
|
||||
for revdep in self.rqdata.runq_revdeps[task]:
|
||||
if self.rqdata.runq_fnid[task] != self.rqdata.runq_fnid[revdep]:
|
||||
ok = False
|
||||
break
|
||||
if ok:
|
||||
found = True
|
||||
self.rq.scenequeue_covered.add(task)
|
||||
|
||||
# Detect when the real task needs to be run anyway by looking to see
|
||||
# if any of its dependencies within the same package are scheduled
|
||||
@@ -1227,9 +1233,6 @@ class RunQueueExecuteTasks(RunQueueExecute):
|
||||
|
||||
logger.debug(1, 'Full skip list %s', self.rq.scenequeue_covered)
|
||||
|
||||
for task in self.rq.scenequeue_covered:
|
||||
self.task_skip(task)
|
||||
|
||||
event.fire(bb.event.StampUpdate(self.rqdata.target_pairs, self.rqdata.dataCache.stamp), self.cfgData)
|
||||
|
||||
schedulers = self.get_schedulers()
|
||||
@@ -1323,8 +1326,14 @@ class RunQueueExecuteTasks(RunQueueExecute):
|
||||
task = self.sched.next()
|
||||
if task is not None:
|
||||
fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]]
|
||||
|
||||
taskname = self.rqdata.runq_task[task]
|
||||
|
||||
if task in self.rq.scenequeue_covered:
|
||||
logger.debug(2, "Setscene covered task %s (%s)", task,
|
||||
self.rqdata.get_user_idstring(task))
|
||||
self.task_skip(task)
|
||||
return True
|
||||
|
||||
if self.rq.check_stamp_task(task, taskname):
|
||||
logger.debug(2, "Stamp current task %s (%s)", task,
|
||||
self.rqdata.get_user_idstring(task))
|
||||
@@ -1412,18 +1421,20 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
|
||||
sq_revdeps.append(copy.copy(self.rqdata.runq_revdeps[task]))
|
||||
sq_revdeps_new.append(set())
|
||||
if (len(self.rqdata.runq_revdeps[task]) == 0) and task not in self.rqdata.runq_setscene:
|
||||
endpoints[task] = None
|
||||
endpoints[task] = set()
|
||||
|
||||
for task in self.rqdata.runq_setscene:
|
||||
for dep in self.rqdata.runq_depends[task]:
|
||||
endpoints[dep] = task
|
||||
if dep not in endpoints:
|
||||
endpoints[dep] = set()
|
||||
endpoints[dep].add(task)
|
||||
|
||||
def process_endpoints(endpoints):
|
||||
newendpoints = {}
|
||||
for point, task in endpoints.items():
|
||||
tasks = set()
|
||||
if task:
|
||||
tasks.add(task)
|
||||
tasks |= task
|
||||
if sq_revdeps_new[point]:
|
||||
tasks |= sq_revdeps_new[point]
|
||||
sq_revdeps_new[point] = set()
|
||||
@@ -1448,6 +1459,28 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
|
||||
elif len(sq_revdeps_new[task]) != 0:
|
||||
bb.msg.fatal("RunQueue", "Something went badly wrong during scenequeue generation, aborting. Please report this problem.")
|
||||
|
||||
# Resolve setscene inter-task dependencies
|
||||
# e.g. do_sometask_setscene[depends] = "targetname:do_someothertask_setscene"
|
||||
# Note that anything explicitly depended upon will have its reverse dependencies removed to avoid circular dependencies
|
||||
for task in self.rqdata.runq_setscene:
|
||||
realid = self.rqdata.taskData.gettask_id(self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]], self.rqdata.runq_task[task] + "_setscene", False)
|
||||
idepends = self.rqdata.taskData.tasks_idepends[realid]
|
||||
for (depid, idependtask) in idepends:
|
||||
if depid not in self.rqdata.taskData.build_targets:
|
||||
continue
|
||||
|
||||
depdata = self.rqdata.taskData.build_targets[depid][0]
|
||||
if depdata is None:
|
||||
continue
|
||||
dep = self.rqdata.taskData.fn_index[depdata]
|
||||
taskid = self.rqdata.get_task_id(self.rqdata.taskData.getfn_id(dep), idependtask.replace("_setscene", ""))
|
||||
if taskid is None:
|
||||
bb.msg.fatal("RunQueue", "Task %s depends upon nonexistant task %s:%s" % (self.rqdata.taskData.tasks_name[realid], dep, idependtask))
|
||||
|
||||
sq_revdeps_squash[self.rqdata.runq_setscene.index(task)].add(self.rqdata.runq_setscene.index(taskid))
|
||||
# Have to zero this to avoid circular dependencies
|
||||
sq_revdeps_squash[self.rqdata.runq_setscene.index(taskid)] = set()
|
||||
|
||||
#for task in xrange(len(sq_revdeps_squash)):
|
||||
# print "Task %s: %s.%s is %s " % (task, self.taskData.fn_index[self.runq_fnid[self.runq_setscene[task]]], self.runq_task[self.runq_setscene[task]] + "_setscene", sq_revdeps_squash[task])
|
||||
|
||||
@@ -1506,8 +1539,9 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
|
||||
|
||||
for task in xrange(len(self.sq_revdeps)):
|
||||
if task not in valid_new and task not in noexec:
|
||||
realtask = self.rqdata.runq_setscene[task]
|
||||
logger.debug(2, 'No package found, so skipping setscene task %s',
|
||||
self.rqdata.get_user_idstring(task))
|
||||
self.rqdata.get_user_idstring(realtask))
|
||||
self.task_failoutright(task)
|
||||
|
||||
logger.info('Executing SetScene Tasks')
|
||||
@@ -1580,7 +1614,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
|
||||
taskname = self.rqdata.runq_task[realtask] + "_setscene"
|
||||
if self.rq.check_stamp_task(realtask, self.rqdata.runq_task[realtask]):
|
||||
logger.debug(2, 'Stamp for underlying task %s(%s) is current, so skipping setscene variant',
|
||||
task, self.rqdata.get_user_idstring(task))
|
||||
task, self.rqdata.get_user_idstring(realtask))
|
||||
self.task_failoutright(task)
|
||||
return True
|
||||
|
||||
@@ -1622,7 +1656,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
|
||||
for task in oldcovered:
|
||||
self.rq.scenequeue_covered.add(self.rqdata.runq_setscene[task])
|
||||
|
||||
logger.debug(1, 'We can skip tasks %s', self.rq.scenequeue_covered)
|
||||
logger.debug(1, 'We can skip tasks %s', sorted(self.rq.scenequeue_covered))
|
||||
|
||||
self.rq.state = runQueueRunInit
|
||||
return True
|
||||
|
||||
@@ -72,11 +72,10 @@ class SignatureGeneratorBasic(SignatureGenerator):
|
||||
|
||||
def _build_data(self, fn, d):
|
||||
|
||||
tasklist, gendeps = bb.data.generate_dependencies(d)
|
||||
tasklist, gendeps, lookupcache = bb.data.generate_dependencies(d)
|
||||
|
||||
taskdeps = {}
|
||||
basehash = {}
|
||||
lookupcache = {}
|
||||
|
||||
for task in tasklist:
|
||||
data = d.getVar(task, False)
|
||||
@@ -101,6 +100,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
|
||||
alldeps = seen - self.basewhitelist
|
||||
|
||||
for dep in sorted(alldeps):
|
||||
data = data + dep
|
||||
if dep in lookupcache:
|
||||
var = lookupcache[dep]
|
||||
else:
|
||||
@@ -135,7 +135,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
|
||||
k = fn + "." + task
|
||||
data = dataCache.basetaskhash[k]
|
||||
self.runtaskdeps[k] = []
|
||||
for dep in sorted(deps):
|
||||
for dep in sorted(deps, key=clean_basepath):
|
||||
# We only manipulate the dependencies for packages not in the whitelist
|
||||
if self.twl and not self.twl.search(dataCache.pkg_fn[fn]):
|
||||
# then process the actual dependencies
|
||||
@@ -159,7 +159,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
|
||||
k = fn + "." + task
|
||||
if runtime == "customfile":
|
||||
sigfile = stampbase
|
||||
elif runtime:
|
||||
elif runtime and k in self.taskhash:
|
||||
sigfile = stampbase + "." + task + ".sigdata" + "." + self.taskhash[k]
|
||||
else:
|
||||
sigfile = stampbase + "." + task + ".sigbasedata" + "." + self.basehash[k]
|
||||
@@ -180,7 +180,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
|
||||
data['gendeps'][dep] = self.gendeps[fn][dep]
|
||||
data['varvals'][dep] = self.lookupcache[fn][dep]
|
||||
|
||||
if runtime:
|
||||
if runtime and k in self.taskhash:
|
||||
data['runtaskdeps'] = self.runtaskdeps[k]
|
||||
data['runtaskhashes'] = {}
|
||||
for dep in data['runtaskdeps']:
|
||||
@@ -217,19 +217,32 @@ def dump_this_task(outfile, d):
|
||||
task = "do_" + d.getVar("BB_CURRENTTASK", True)
|
||||
bb.parse.siggen.dump_sigtask(fn, task, outfile, "customfile")
|
||||
|
||||
def clean_basepath(a):
|
||||
if a.startswith("virtual:"):
|
||||
b = a.rsplit(":", 1)[0] + a.rsplit("/", 1)[1]
|
||||
else:
|
||||
b = a.rsplit("/", 1)[1]
|
||||
return b
|
||||
|
||||
def clean_basepaths(a):
|
||||
b = {}
|
||||
for x in a:
|
||||
b[clean_basepath(x)] = a[x]
|
||||
return b
|
||||
|
||||
def compare_sigfiles(a, b):
|
||||
p1 = pickle.Unpickler(file(a, "rb"))
|
||||
a_data = p1.load()
|
||||
p2 = pickle.Unpickler(file(b, "rb"))
|
||||
b_data = p2.load()
|
||||
|
||||
def dict_diff(a, b):
|
||||
def dict_diff(a, b, whitelist=set()):
|
||||
sa = set(a.keys())
|
||||
sb = set(b.keys())
|
||||
common = sa & sb
|
||||
changed = set()
|
||||
for i in common:
|
||||
if a[i] != b[i]:
|
||||
if a[i] != b[i] and i not in whitelist:
|
||||
changed.add(i)
|
||||
added = sa - sb
|
||||
removed = sb - sa
|
||||
@@ -237,20 +250,23 @@ def compare_sigfiles(a, b):
|
||||
|
||||
if 'basewhitelist' in a_data and a_data['basewhitelist'] != b_data['basewhitelist']:
|
||||
print "basewhitelist changed from %s to %s" % (a_data['basewhitelist'], b_data['basewhitelist'])
|
||||
print "changed items: %s" % a_data['basewhitelist'].symmetric_difference(b_data['basewhitelist'])
|
||||
|
||||
if 'taskwhitelist' in a_data and a_data['taskwhitelist'] != b_data['taskwhitelist']:
|
||||
print "taskwhitelist changed from %s to %s" % (a_data['taskwhitelist'], b_data['taskwhitelist'])
|
||||
print "changed items: %s" % a_data['taskwhitelist'].symmetric_difference(b_data['taskwhitelist'])
|
||||
|
||||
if a_data['taskdeps'] != b_data['taskdeps']:
|
||||
print "Task dependencies changed from %s to %s" % (sorted(a_data['taskdeps']), sorted(b_data['taskdeps']))
|
||||
print "Task dependencies changed from:\n%s\nto:\n%s" % (sorted(a_data['taskdeps']), sorted(b_data['taskdeps']))
|
||||
|
||||
if a_data['basehash'] != b_data['basehash']:
|
||||
print "basehash changed from %s to %s" % (a_data['basehash'], b_data['basehash'])
|
||||
|
||||
changed, added, removed = dict_diff(a_data['gendeps'], b_data['gendeps'])
|
||||
changed, added, removed = dict_diff(a_data['gendeps'], b_data['gendeps'], a_data['basewhitelist'] & b_data['basewhitelist'])
|
||||
if changed:
|
||||
for dep in changed:
|
||||
print "List of dependencies for variable %s changed from %s to %s" % (dep, a_data['gendeps'][dep], b_data['gendeps'][dep])
|
||||
print "changed items: %s" % a_data['gendeps'][dep].symmetric_difference(b_data['gendeps'][dep])
|
||||
if added:
|
||||
for dep in added:
|
||||
print "Dependency on variable %s was added" % (dep)
|
||||
@@ -265,7 +281,9 @@ def compare_sigfiles(a, b):
|
||||
print "Variable %s value changed from %s to %s" % (dep, a_data['varvals'][dep], b_data['varvals'][dep])
|
||||
|
||||
if 'runtaskhashes' in a_data and 'runtaskhashes' in b_data:
|
||||
changed, added, removed = dict_diff(a_data['runtaskhashes'], b_data['runtaskhashes'])
|
||||
a = clean_basepaths(a_data['runtaskhashes'])
|
||||
b = clean_basepaths(b_data['runtaskhashes'])
|
||||
changed, added, removed = dict_diff(a, b)
|
||||
if added:
|
||||
for dep in added:
|
||||
print "Dependency on task %s was added" % (dep)
|
||||
@@ -274,9 +292,10 @@ def compare_sigfiles(a, b):
|
||||
print "Dependency on task %s was removed" % (dep)
|
||||
if changed:
|
||||
for dep in changed:
|
||||
print "Hash for dependent task %s changed from %s to %s" % (dep, a_data['runtaskhashes'][dep], b_data['runtaskhashes'][dep])
|
||||
print "Hash for dependent task %s changed from %s to %s" % (dep, a[dep], b[dep])
|
||||
elif 'runtaskdeps' in a_data and 'runtaskdeps' in b_data and sorted(a_data['runtaskdeps']) != sorted(b_data['runtaskdeps']):
|
||||
print "Tasks this task depends on changed from %s to %s" % (sorted(a_data['runtaskdeps']), sorted(b_data['runtaskdeps']))
|
||||
print "changed items: %s" % a_data['runtaskdeps'].symmetric_difference(b_data['runtaskdeps'])
|
||||
|
||||
def dump_sigfile(a):
|
||||
p1 = pickle.Unpickler(file(a, "rb"))
|
||||
|
||||
@@ -39,6 +39,7 @@ class HobPrefs(gtk.Dialog):
|
||||
self.selected_image_types = handler.remove_image_output_type(ot)
|
||||
|
||||
self.configurator.setConfVar('IMAGE_FSTYPES', "%s" % " ".join(self.selected_image_types).lstrip(" "))
|
||||
self.reload_required = True
|
||||
|
||||
def sdk_machine_combo_changed_cb(self, combo, handler):
|
||||
sdk_mach = combo.get_active_text()
|
||||
|
||||
@@ -179,6 +179,10 @@ class RunningBuild (gobject.GObject):
|
||||
# that we need to attach to a task.
|
||||
self.tasks_to_iter[(package, task)] = i
|
||||
|
||||
# If we don't handle these the GUI does not proceed
|
||||
elif isinstance(event, bb.build.TaskInvalid):
|
||||
return
|
||||
|
||||
elif isinstance(event, bb.build.TaskBase):
|
||||
current = self.tasks_to_iter[(package, task)]
|
||||
parent = self.tasks_to_iter[(package, None)]
|
||||
|
||||
@@ -400,9 +400,9 @@ class MainWindow (gtk.Window):
|
||||
if response == gtk.RESPONSE_OK:
|
||||
rep.loadRecipe(recipe)
|
||||
self.save_path = recipe
|
||||
self.model.load_image_rep(rep)
|
||||
self.dirty = False
|
||||
chooser.destroy()
|
||||
self.model.load_image_rep(rep)
|
||||
self.dirty = False
|
||||
|
||||
def bake_clicked_cb(self, button):
|
||||
build_image = True
|
||||
|
||||
@@ -443,7 +443,7 @@ def lockfile(name, shared=False, retry=True):
|
||||
return lf
|
||||
lf.close()
|
||||
except Exception:
|
||||
continue
|
||||
pass
|
||||
if not retry:
|
||||
return None
|
||||
|
||||
@@ -505,7 +505,6 @@ def preserved_envvars_exported():
|
||||
'SHELL',
|
||||
'TERM',
|
||||
'USER',
|
||||
'USERNAME',
|
||||
]
|
||||
|
||||
def preserved_envvars_exported_interactive():
|
||||
|
||||
@@ -1,48 +1,61 @@
|
||||
# This is a single Makefile to handle all generated Yocto Project documents.
|
||||
# The Makefile needs to live in the documents directory and all figures used
|
||||
# in any manuals must be PNG files and live in the individual book's figures
|
||||
# directory.
|
||||
# in any manuals must be .PNG files and live in the individual book's figures
|
||||
# directory. Note that the figures for the Yocto Project Development Manual
|
||||
# differ between the 'master' and 'edison' branches.
|
||||
#
|
||||
# The Makefile has these targets:
|
||||
#
|
||||
# pdf: generates a PDF version of a manual. Not valid for the Quick Start
|
||||
# html: generates an HTML version of a manual.
|
||||
# tarball: creates a tarball for the doc files.
|
||||
# pdf: generates a PDF version of a manual. Not valid for the Quick Start
|
||||
# html: generates an HTML version of a manual.
|
||||
# tarball: creates a tarball for the doc files.
|
||||
# validate: validates
|
||||
# publish: pushes generated files to the Yocto Project website
|
||||
# clean: removes files
|
||||
# publish: pushes generated files to the Yocto Project website
|
||||
# clean: removes files
|
||||
#
|
||||
# The Makefile generates an HTML and PDF version of every document except the
|
||||
# Yocto Project Quick Start. The Quick Start is in HTML form only. The variable
|
||||
# The command-line argument DOC represents the folder name in which a particular
|
||||
# document is stored. The command-line argument VER represents the distro
|
||||
# version of the Yocto Release for which the manuals are being generated.
|
||||
# DOC is used to indicate the folder name for a given manual. The variable
|
||||
# VER represents the distro version of the Yocto Release for which the manuals
|
||||
# are being generated. The variable BRANCH is used to indicate the 'edison'
|
||||
# branch and is used only when DOC=dev-manual (making the YP Development
|
||||
# Manual).
|
||||
#
|
||||
# To build the HTML and PDF versions of the manual you must invoke the Makefile
|
||||
# with the DOC argument. If you are going to publish the manual then you
|
||||
# you must invoke the Makefile with both the DOC and the VER argument.
|
||||
# If you are building the 'edison' version of the YP DEvelopment Manual then
|
||||
# you must use the DOC and BRANCH arguments.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# make DOC=bsp-guide
|
||||
# make DOC=yocto-project-qs
|
||||
# make pdf DOC=poky-ref-manual
|
||||
# make DOC=dev-manual BRANCH=edison
|
||||
#
|
||||
# The first example generates the HTML and PDF versions of the BSP Guide.
|
||||
# The second example generates the HTML version only of the Quick Start. Note that
|
||||
# the Quick Start only has an HTML version available. The third example generates
|
||||
# both the PDF and HTML versions of the Yocto Project Reference Manual.
|
||||
# both the PDF and HTML versions of the Yocto Project Reference Manual. The
|
||||
# last example generates both the PDF and HTML 'edison' versions of the YP
|
||||
# Development Manual.
|
||||
#
|
||||
# Use the publish target to push the generated manuals to the Yocto Project
|
||||
# website. All files needed for the manual's HTML form are pushed as well as the
|
||||
# PDF version (if applicable).
|
||||
# Examples:
|
||||
#
|
||||
# make publish DOC=bsp-guide VER=1.1
|
||||
# make publish DOC=adt-manual VER=1.1
|
||||
# make publish DOC=bsp-guide VER=1.2
|
||||
# make publish DOC=adt-manual VER=1.2
|
||||
# make publish DOC=dev-manual VER=1.1.1 BRANCH=edison
|
||||
# make publish DOC=dev-manual VER=1.2
|
||||
#
|
||||
# The first example publishes the 1.1 version of both the PDF and HTML versions of
|
||||
# the BSP Guide. The second example publishes the 1.1 version of both the PDF and
|
||||
# HTML versions of the ADT Manual.
|
||||
# The first example publishes the 1.2 version of both the PDF and HTML versions of
|
||||
# the BSP Guide. The second example publishes the 1.2 version of both the PDF and
|
||||
# HTML versions of the ADT Manual. The third example publishes the PDF and HTML
|
||||
# 'edison' versions of the YP Development Manual. Finally, the last example publishes
|
||||
# the PDF and HTML 'master' versions of the YP Development Manual.
|
||||
#
|
||||
|
||||
ifeq ($(DOC),bsp-guide)
|
||||
@@ -66,11 +79,32 @@ XSLTOPTS = --stringparam html.stylesheet style.css \
|
||||
--stringparam section.label.includes.component.label 1 \
|
||||
--xinclude
|
||||
ALLPREQ = html pdf tarball
|
||||
TARFILES = style.css dev-manual.html dev-manual.pdf figures/bsp-dev-flow.png figures/dev-title.png \
|
||||
#
|
||||
# Note that the tarfile might produce the "Cannot stat: No such file or directory" error
|
||||
# message for .PNG files that are not present when building a particular branch. The
|
||||
# list of files is all-inclusive for all branches.
|
||||
#
|
||||
|
||||
ifeq ($(BRANCH),edison)
|
||||
TARFILES = style.css dev-manual.html dev-manual.pdf \
|
||||
figures/app-dev-flow.png figures/bsp-dev-flow.png figures/dev-title.png \
|
||||
figures/git-workflow.png figures/index-downloads.png figures/kernel-dev-flow.png \
|
||||
figures/kernel-example-repos.png figures/kernel-overview-1.png figures/kernel-overview-2.png \
|
||||
figures/kernel-overview-3.png figures/source-repos.png figures/yp-download.png \
|
||||
figures/kernel-example-repos-edison.png \
|
||||
figures/kernel-overview-1.png figures/kernel-overview-2.png \
|
||||
figures/kernel-overview-3-edison.png \
|
||||
figures/source-repos.png figures/yp-download.png \
|
||||
figures/wip.png
|
||||
else
|
||||
TARFILES = style.css dev-manual.html dev-manual.pdf \
|
||||
figures/app-dev-flow.png figures/bsp-dev-flow.png figures/dev-title.png \
|
||||
figures/git-workflow.png figures/index-downloads.png figures/kernel-dev-flow.png \
|
||||
figures/kernel-example-repos.png \
|
||||
figures/kernel-overview-1.png figures/kernel-overview-2.png \
|
||||
figures/kernel-overview-3.png \
|
||||
figures/source-repos.png figures/yp-download.png \
|
||||
figures/wip.png
|
||||
endif
|
||||
|
||||
MANUALS = $(DOC)/$(DOC).html $(DOC)/$(DOC).pdf
|
||||
FIGURES = figures
|
||||
STYLESHEET = $(DOC)/*.css
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<chapter id='using-the-command-line'>
|
||||
<title>Using the Command Line</title>
|
||||
@@ -12,9 +13,9 @@
|
||||
Toolchain Tarball)</link>".
|
||||
And, that sourcing your architecture-specific environment setup script
|
||||
initializes a suitable cross-toolchain development environment.
|
||||
This setup occurs by adding the compiler, QEMU scripts, QEMU binary,
|
||||
During the setup, locations for the compiler, QEMU scripts, QEMU binary,
|
||||
a special version of <filename>pkgconfig</filename> and other useful
|
||||
utilities to the <filename>PATH</filename> variable.
|
||||
utilities are added to the <filename>PATH</filename> variable.
|
||||
Variables to assist <filename>pkgconfig</filename> and <filename>autotools</filename>
|
||||
are also defined so that,
|
||||
for example, <filename>configure.sh</filename> can find pre-generated
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<chapter id='adt-eclipse'>
|
||||
<title>Working Within Eclipse</title>
|
||||
@@ -34,6 +35,11 @@
|
||||
<listitem><para>Install the Eclipse Yocto Plug-in.</para></listitem>
|
||||
<listitem><para>Configure the Eclipse Yocto Plug-in.</para></listitem>
|
||||
</orderedlist>
|
||||
<note>
|
||||
Do not install Eclipse from your distribution's package repository.
|
||||
Be sure to install Eclipse from the official Eclipse download site as directed
|
||||
in the next section.
|
||||
</note>
|
||||
</para>
|
||||
|
||||
<section id='installing-eclipse-ide'>
|
||||
@@ -43,7 +49,7 @@
|
||||
It is recommended that you have the Indigo 3.7 version of the
|
||||
Eclipse IDE installed on your development system.
|
||||
If you don’t have this version, you can find it at
|
||||
<ulink url='http://www.eclipse.org/downloads'></ulink>.
|
||||
<ulink url='&ECLIPSE_MAIN_URL;'></ulink>.
|
||||
From that site, choose the Eclipse Classic version particular to your development
|
||||
host.
|
||||
This version contains the Eclipse Platform, the Java Development
|
||||
@@ -53,10 +59,12 @@
|
||||
<para>
|
||||
Once you have downloaded the tarball, extract it into a clean
|
||||
directory.
|
||||
For example, the following command unpacks and installs the Eclipse IDE
|
||||
For example, the following commands unpack and install the Eclipse IDE
|
||||
tarball found in the <filename>Downloads</filename> area
|
||||
into a clean directory using the default name <filename>eclipse</filename>:
|
||||
<literallayout class='monospaced'>
|
||||
$ tar -xzvf ~/Downloads/Eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz
|
||||
$ cd ~
|
||||
$ tar -xzvf ~/Downloads/eclipse-SDK-3.7.1-linux-gtk-x86_64.tar.gz
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
@@ -98,20 +106,22 @@
|
||||
<listitem><para>Make sure you are in your Workbench and select
|
||||
"Install New Software" from the "Help" pull-down menu.
|
||||
</para></listitem>
|
||||
<listitem><para>Select <filename>indigo - http://download.eclipse.org/releases/indigo</filename>
|
||||
<listitem><para>Select <filename>indigo - &ECLIPSE_INDIGO_URL;</filename>
|
||||
from the "Work with:" pull-down menu.</para></listitem>
|
||||
<listitem><para>Expand the box next to <filename>Programming Languages</filename>
|
||||
and select the <filename>Autotools Support for CDT (incubation)</filename>
|
||||
and <filename>C/C++ Development Tools</filename> boxes.</para></listitem>
|
||||
<listitem><para>Expand the box next to "Linux Tools" and select the
|
||||
"LTTng - Linux Tracing Toolkit(incubation)" boxes.</para></listitem>
|
||||
<listitem><para>Complete the installation and restart the Eclipse IDE.</para></listitem>
|
||||
<listitem><para>After the Eclipse IDE restarts and from the Workbench, select
|
||||
"Install New Software" from the "Help" pull-down menu.</para></listitem>
|
||||
<listitem><para>Click the
|
||||
"Available Software Sites" link.</para></listitem>
|
||||
<listitem><para>Check the box next to
|
||||
<filename>http://download.eclipse.org/tm/updates/3.3</filename>
|
||||
<filename>&ECLIPSE_UPDATES_URL;</filename>
|
||||
and click "OK".</para></listitem>
|
||||
<listitem><para>Select <filename>http://download.eclipse.org/tm/updates/3.3</filename>
|
||||
<listitem><para>Select <filename>&ECLIPSE_UPDATES_URL;</filename>
|
||||
from the "Work with:" pull-down menu.</para></listitem>
|
||||
<listitem><para>Check the box next to <filename>TM and RSE Main Features</filename>.
|
||||
</para></listitem>
|
||||
@@ -125,7 +135,7 @@
|
||||
<listitem><para>After clicking "Available Software Sites", check the box next to
|
||||
<filename>http://download.eclipse.org/tools/cdt/releases/indigo</filename>
|
||||
and click "OK".</para></listitem>
|
||||
<listitem><para>Select <filename>http://download.eclipse.org/tools/cdt/releases/indigo</filename>
|
||||
<listitem><para>Select <filename>&ECLIPSE_INDIGO_CDT_URL;</filename>
|
||||
from the "Work with:" pull-down menu.</para></listitem>
|
||||
<listitem><para>Check the box next to <filename>CDT Main Features</filename>.
|
||||
</para></listitem>
|
||||
@@ -138,30 +148,36 @@
|
||||
</section>
|
||||
|
||||
<section id='installing-the-eclipse-yocto-plug-in'>
|
||||
<title>Installing the Eclipse Yocto Plug-in</title>
|
||||
<title>Installing or Accessing the Eclipse Yocto Plug-in</title>
|
||||
|
||||
<para>
|
||||
You can install the Eclipse Yocto Plug-in one of three methods: as new software
|
||||
from within the Eclipse IDE, from the Yocto Project source repositories, or as a built zip file.
|
||||
You can install the Eclipse Yocto Plug-in into the Eclipse application
|
||||
one of two ways: using the Eclipse IDE and installing the plug-in as new software, or
|
||||
using a built zip file.
|
||||
If you don't want to permanently install the plug-in but just want to try it out
|
||||
within the Eclipse environment, you can import the plug-in project from the
|
||||
Yocto Project source repositories.
|
||||
</para>
|
||||
|
||||
<section id='new-software'>
|
||||
<title>New Software</title>
|
||||
<title>Installing the Plug-in as New Software</title>
|
||||
|
||||
<para>
|
||||
To install the Eclipse Yocto Plug-in directly into the Eclipse IDE,
|
||||
To install the Eclipse Yocto Plug-in as new software directly into the Eclipse IDE,
|
||||
follow these steps:
|
||||
<orderedlist>
|
||||
<listitem><para>Start up the Eclipse IDE.</para></listitem>
|
||||
<listitem><para>In Eclipse, select "Install New Software" from the "Help" menu.</para></listitem>
|
||||
<listitem><para>Click "Add..." in the "Work with:" area.</para></listitem>
|
||||
<listitem><para>Enter
|
||||
<filename>http://www.yoctoproject.org/downloads/eclipse-plugin/1.1</filename>
|
||||
<filename>&ECLIPSE_DL_PLUGIN_URL;</filename>
|
||||
in the URL field and provide a meaningful name in the "Name" field.</para></listitem>
|
||||
<listitem><para>Click "OK" to have the entry added to the "Work with:"
|
||||
drop-down list.</para></listitem>
|
||||
<listitem><para>Select the entry for the plug-in from the "Work with:" drop-down
|
||||
list.</para></listitem>
|
||||
<listitem><para>Check the box next to <filename>Development tools and SDKs for Yocto Linux</filename>.
|
||||
</para></listitem>
|
||||
<listitem><para>Complete the remaining software installation steps and
|
||||
then restart the Eclipse IDE to finish the installation of the plug-in.
|
||||
</para></listitem>
|
||||
@@ -169,46 +185,8 @@
|
||||
</para>
|
||||
</section>
|
||||
|
||||
|
||||
<section id='yocto-project-source'>
|
||||
<title>Yocto Project Source</title>
|
||||
|
||||
<para>
|
||||
To install the Eclipse Yocto Plug-in from the Yocto Project source repositories,
|
||||
follow these steps:
|
||||
<orderedlist>
|
||||
<listitem><para>Open a shell and create a Git repository with:
|
||||
<literallayout class='monospaced'>
|
||||
$ git clone git://git.yoctoproject.org/eclipse-poky yocto-eclipse
|
||||
</literallayout>
|
||||
For this example, the repository is named
|
||||
<filename>~/yocto-eclipse</filename>.</para></listitem>
|
||||
<listitem><para>In Eclipse, select "Import" from the "File" menu.</para></listitem>
|
||||
<listitem><para>Expand the "General" box and pick "existing projects into workspace".
|
||||
</para></listitem>
|
||||
<listitem><para>Select the root directory and browse to "~/yocto-eclipse/plugins".
|
||||
</para></listitem>
|
||||
<listitem><para>There will be three things there.
|
||||
Select each one and install one at a time.
|
||||
Do all three.</para></listitem>
|
||||
<listitem><para>Restart everything.</para></listitem>
|
||||
</orderedlist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
At this point you should be able to invoke Eclipse from the shell using the following:
|
||||
<literallayout class='monospaced'>
|
||||
$ cd ~/eclipse
|
||||
$ ./eclipse -vmargs -XX:PermSize=256M
|
||||
</literallayout>
|
||||
The left navigation pane shows the default projects.
|
||||
Right-click on one of these projects and run it as an Eclipse application.
|
||||
This brings up a second instance of Eclipse IDE that has the Yocto Plug-in.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='zip-file-method'>
|
||||
<title>Zip File Method</title>
|
||||
<title>Installing the Plug-in from a Zip File</title>
|
||||
<para>
|
||||
To install the Eclipse Yocto Plug-in by building and installing a plug-in
|
||||
zip file, follow these steps:
|
||||
@@ -234,9 +212,9 @@
|
||||
name of the Git branch along with the Yocto Project release you are
|
||||
using.
|
||||
Here is an example that uses the <filename>master</filename> Git repository
|
||||
and the <filename>1.1M4</filename> release:
|
||||
and the <filename>&DISTRO;</filename> release:
|
||||
<literallayout class='monospaced'>
|
||||
$ scripts/build.sh master 1.1M4
|
||||
$ scripts/build.sh master &DISTRO;
|
||||
</literallayout>
|
||||
After running the script, the file
|
||||
<filename>org.yocto.sdk-<release>-<date>-archive.zip</filename>
|
||||
@@ -247,22 +225,57 @@
|
||||
</para></listitem>
|
||||
<listitem><para>Click "Add".</para></listitem>
|
||||
<listitem><para>Provide anything you want in the "Name" field.</para></listitem>
|
||||
<listitem><para>For the "Archive" field, select the ZIP file you built in step
|
||||
4.
|
||||
<listitem><para>Click "Archive" and browse to the ZIP file you built
|
||||
in step four.
|
||||
This ZIP file should not be "unzipped", and must be the
|
||||
<filename>*archive.zip</filename> file created by running the
|
||||
<filename>build.sh</filename> script.</para></listitem>
|
||||
<listitem><para>Select the new entry in the installation window and complete
|
||||
<listitem><para>Check the box next to the new entry in the installation window and complete
|
||||
the installation.</para></listitem>
|
||||
<listitem><para>Restart the Eclipse IDE if necessary.</para></listitem>
|
||||
</orderedlist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
At this point you should be able to configure the Eclipse Yocto Plug-in as described in
|
||||
the next section.
|
||||
At this point you should be able to configure the Eclipse Yocto Plug-in as described in the
|
||||
"<link linkend='configuring-the-eclipse-yocto-plug-in'>Configuring the Eclipse Yocto Plug-in</link>"
|
||||
section.</para>
|
||||
</section>
|
||||
|
||||
<section id='yocto-project-source'>
|
||||
<title>Importing the Plug-in Project into the Eclipse Environment</title>
|
||||
<para>
|
||||
Importing the Eclipse Yocto Plug-in project from the Yocto Project source repositories
|
||||
is useful when you want to try out the latest plug-in from the tip of plug-in's
|
||||
development tree.
|
||||
It is important to understand when you import the plug-in you are not installing
|
||||
it into the Eclipse application.
|
||||
Rather, you are importing the project and just using it.
|
||||
To import the plug-in project, follow these steps:
|
||||
<orderedlist>
|
||||
<listitem><para>Open a shell and create a Git repository with:
|
||||
<literallayout class='monospaced'>
|
||||
$ git clone git://git.yoctoproject.org/eclipse-poky yocto-eclipse
|
||||
</literallayout>
|
||||
For this example, the repository is named
|
||||
<filename>~/yocto-eclipse</filename>.</para></listitem>
|
||||
<listitem><para>In Eclipse, select "Import" from the "File" menu.</para></listitem>
|
||||
<listitem><para>Expand the "General" box and select "existing projects into workspace"
|
||||
and then click "Next".</para></listitem>
|
||||
<listitem><para>Select the root directory and browse to "~/yocto-eclipse/plugins".
|
||||
</para></listitem>
|
||||
<listitem><para>There will be three things there.
|
||||
Select each one and install one at a time.
|
||||
Do all three.</para></listitem>
|
||||
</orderedlist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The left navigation pane in the Eclipse application shows the default projects.
|
||||
Right-click on one of these projects and run it as an Eclipse application.
|
||||
This brings up a second instance of Eclipse IDE that has the Yocto Plug-in.
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id='configuring-the-eclipse-yocto-plug-in'>
|
||||
@@ -317,7 +330,7 @@
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis>Point to the Toolchain:</emphasis>
|
||||
If you are using a stand-alone pre-built toolchain, you should be pointing to the
|
||||
<filename>/opt/poky/1.1</filename> directory.
|
||||
<filename>&YOCTO_ADTPATH_DIR;</filename> directory.
|
||||
This is the location for toolchains installed by the ADT Installer or by hand.
|
||||
Sections "<link linkend='configuring-and-running-the-adt-installer-script'>Configuring
|
||||
and Running the ADT Installer Script</link>" and
|
||||
@@ -349,9 +362,8 @@
|
||||
The pull-down menu should have the supported architectures.
|
||||
If the architecture you need is not listed in the menu, you
|
||||
will need to build the image.
|
||||
See the "<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html#building-image'>Building an Image</ulink>" section of the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html'>
|
||||
The Yocto Project Quick Start</ulink> for more information.</para></listitem>
|
||||
See the "<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>" section
|
||||
of The Yocto Project Quick Start for more information.</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</section>
|
||||
@@ -467,7 +479,9 @@
|
||||
The script also runs <filename>libtoolize</filename>, <filename>aclocal</filename>,
|
||||
<filename>autoconf</filename>, <filename>autoheader</filename>,
|
||||
<filename>automake --a</filename>, and
|
||||
<filename>./configure</filename>.</para></listitem>
|
||||
<filename>./configure</filename>.
|
||||
Click on the <filename>Console</filename> tab beneath your source code to
|
||||
see the results of reconfiguring your project.</para></listitem>
|
||||
</orderedlist>
|
||||
</para>
|
||||
</section>
|
||||
@@ -490,7 +504,7 @@
|
||||
<listitem><para>Expose the <filename>Run -> External Tools</filename> menu.
|
||||
Your image should appear as a selectable menu item.
|
||||
</para></listitem>
|
||||
<listitem><para>Select your image in the navigation pane to launch the
|
||||
<listitem><para>Select your image from the menu to launch the
|
||||
emulator in a new window.</para></listitem>
|
||||
<listitem><para>If needed, enter your host root password in the shell window at the prompt.
|
||||
This sets up a <filename>Tap 0</filename> connection needed for running in user-space
|
||||
@@ -509,8 +523,8 @@
|
||||
<title>Deploying and Debugging the Application</title>
|
||||
|
||||
<para>
|
||||
Once the QEMU emulator is running the image, you can deploy your application and use the emulator
|
||||
to perform debugging.
|
||||
Once the QEMU emulator is running the image, using the Eclipse IDE
|
||||
you can deploy your application and use the emulator to perform debugging.
|
||||
Follow these steps to deploy the application.
|
||||
<orderedlist>
|
||||
<listitem><para>Select <filename>Run -> Debug Configurations...</filename></para></listitem>
|
||||
@@ -550,7 +564,7 @@
|
||||
your development experience.
|
||||
These tools are aids in developing and debugging applications and images.
|
||||
You can run these user-space tools from within the Eclipse IDE through the
|
||||
<filename>Window -> YoctoTools</filename> menu.
|
||||
<filename>YoctoTools</filename> menu.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -575,14 +589,14 @@
|
||||
host can use, you must have <filename>oprofile</filename> version 0.9.4 or
|
||||
greater installed on the host.</para>
|
||||
<para>You can locate both the viewer and server from
|
||||
<ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/oprofileui/'></ulink>.
|
||||
<ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/oprofileui/'></ulink>.
|
||||
<note>The <filename>oprofile-server</filename> is installed by default on
|
||||
the <filename>core-image-sato-sdk</filename> image.</note></para></listitem>
|
||||
<listitem><para><emphasis><filename>Lttng-ust</filename>:</emphasis> Selecting this tool runs
|
||||
<filename>usttrace</filename> on the remote target, transfers the output data back to the
|
||||
local host machine, and uses <filename>lttv-gui</filename> to graphically display the output.
|
||||
The <filename>lttv-gui</filename> must be installed on the local host machine to use this tool.
|
||||
For information on how to use <filename>lttng</filename> to trace an application, see
|
||||
<listitem><para><emphasis><filename>Lttng-ust</filename>:</emphasis> Selecting this tool runs
|
||||
<filename>usttrace</filename> on the remote target, transfers the output data back
|
||||
to the local host machine, and uses the <filename>lttng</filename> Eclipse plug-in to
|
||||
graphically display the output.
|
||||
For information on how to use <filename>lttng</filename> to trace an application, see
|
||||
<ulink url='http://lttng.org/files/ust/manual/ust.html'></ulink>.</para>
|
||||
<para>For <filename>Application</filename>, you must supply the absolute path name of the
|
||||
application to be traced by user mode <filename>lttng</filename>.
|
||||
@@ -590,7 +604,32 @@
|
||||
<filename>usttrace /path/to/foo</filename> on the remote target to trace the
|
||||
program <filename>/path/to/foo</filename>.</para>
|
||||
<para><filename>Argument</filename> is passed to <filename>usttrace</filename>
|
||||
running on the remote target.</para></listitem>
|
||||
running on the remote target.</para>
|
||||
<para>Before you use the <filename>lttng-ust</filename> tool, you need to setup
|
||||
the <filename>lttng</filename> Eclipse plug-in and create a <filename>lttng</filename>
|
||||
project.
|
||||
Do the following:
|
||||
<orderedlist>
|
||||
<listitem><para>Follow these
|
||||
<ulink url='http://wiki.eclipse.org/Linux_Tools_Project/LTTng#Downloading_and_installing_the_LTTng_parser_library'>instructions</ulink>
|
||||
to download and install the <filename>lttng</filename> parser library.
|
||||
</para></listitem>
|
||||
<listitem><para>Select <filename>Window -> Open Perspective -> Other</filename>
|
||||
and then select <filename>LTTng</filename>.</para></listitem>
|
||||
<listitem><para>Click <filename>OK</filename> to change the Eclipse perspective
|
||||
into the <filename>LTTng</filename> perspective.</para></listitem>
|
||||
<listitem><para>Create a new <filename>LTTng</filename> project by selecting
|
||||
<filename>File -> New -> Project</filename>.</para></listitem>
|
||||
<listitem><para>Choose <filename>LTTng -> LTTng Project</filename>.</para></listitem>
|
||||
<listitem><para>Click <filename>YoctoTools -> lttng-ust</filename> to start user mode
|
||||
<filename>lttng</filename> on the remote target.</para></listitem>
|
||||
</orderedlist></para>
|
||||
<para>After the output data has been transferred from the remote target back to the local
|
||||
host machine, new traces will be imported into the selected <filename>LTTng</filename> project.
|
||||
Then you can go to the <filename>LTTng</filename> project, right click the imported
|
||||
trace, and set the trace type as the <filename>LTTng</filename> kernel trace.
|
||||
Finally, right click the imported trace and select <filename>Open</filename>
|
||||
to display the data graphically.</para></listitem>
|
||||
<listitem><para><emphasis><filename>PowerTOP</filename>:</emphasis> Selecting this tool runs
|
||||
<filename>powertop</filename> on the remote target machine and displays the results in a
|
||||
new view called <filename>powertop</filename>.</para>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<chapter id='adt-intro'>
|
||||
|
||||
@@ -106,7 +107,7 @@
|
||||
<listitem><para><emphasis>PowerTOP:</emphasis> Helps you determine what
|
||||
software is using the most power.
|
||||
You can find out more about PowerTOP at
|
||||
<ulink url='http://www.linuxpowertop.org/'></ulink>.</para></listitem>
|
||||
<ulink url='https://01.org/powertop/'></ulink>.</para></listitem>
|
||||
<listitem><para><emphasis>OProfile:</emphasis> A system-wide profiler for Linux
|
||||
systems that is capable of profiling all running code at low overhead.
|
||||
You can find out more about OProfile at
|
||||
@@ -114,7 +115,7 @@
|
||||
<listitem><para><emphasis>Perf:</emphasis> Performance counters for Linux used
|
||||
to keep track of certain types of hardware and software events.
|
||||
For more information on these types of counters see
|
||||
<ulink url='https://perf.wiki.kernel.org/index.php'></ulink> and click
|
||||
<ulink url='https://perf.wiki.kernel.org/'></ulink> and click
|
||||
on “Perf tools.”</para></listitem>
|
||||
<listitem><para><emphasis>SystemTap:</emphasis> A free software infrastructure
|
||||
that simplifies information gathering about a running Linux system.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<book id='adt-manual' lang='en'
|
||||
xmlns:xi="http://www.w3.org/2003/XInclude"
|
||||
@@ -43,10 +44,20 @@
|
||||
<date>6 October 2011</date>
|
||||
<revremark>Released with the Yocto Project 1.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>1.1.1</revnumber>
|
||||
<date>15 March 2012</date>
|
||||
<revremark>Released with the Yocto Project 1.1.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>1.1.2</revnumber>
|
||||
<date>July 2012</date>
|
||||
<revremark>Released with the Yocto Project 1.1.2 Release.</revremark>
|
||||
</revision>
|
||||
</revhistory>
|
||||
|
||||
<copyright>
|
||||
<year>2010-2011</year>
|
||||
<year>©RIGHT_YEAR;</year>
|
||||
<holder>Linux Foundation</holder>
|
||||
</copyright>
|
||||
|
||||
@@ -58,9 +69,9 @@
|
||||
<note>
|
||||
Due to production processes, there could be differences between the Yocto Project
|
||||
documentation bundled in the release tarball and the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/adt-manual/adt-manual.html'>
|
||||
<ulink url='&YOCTO_DOCS_ADT_URL;'>
|
||||
Application Developer's Toolkit (ADT) User's Guide</ulink> on
|
||||
the <ulink url='http://www.yoctoproject.org'>Yocto Project</ulink> website.
|
||||
the <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink> website.
|
||||
For the latest version of this manual, see the manual on the website.
|
||||
</note>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<chapter id='adt-package'>
|
||||
<title>Optionally Customizing the Development Packages Installation</title>
|
||||
@@ -54,9 +55,7 @@
|
||||
|
||||
<note>
|
||||
For build performance information related to the PMS, see
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html#ref-classes-package'>Packaging - <filename>package*.bbclass</filename></ulink>
|
||||
in <ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html'>
|
||||
The Yocto Project Reference Manual</ulink>.
|
||||
<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-package'>Packaging - <filename>package*.bbclass</filename></ulink> in The Yocto Project Reference Manual.
|
||||
</note>
|
||||
|
||||
<para>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<chapter id='adt-prepare'>
|
||||
|
||||
@@ -55,8 +56,10 @@
|
||||
|
||||
<para>
|
||||
The ADT Installer is contained in the ADT Installer tarball.
|
||||
You can download the tarball into any directory from
|
||||
<ulink url='http://www.yoctoproject.org/downloads/yocto-1.1/adt-installer/'></ulink>.
|
||||
You can download the tarball into any directory from the
|
||||
<ulink url='&YOCTO_DL_URL;/releases'>Index of Releases</ulink>, specifically
|
||||
at
|
||||
<ulink url='&YOCTO_ADTINSTALLER_DL_URL;'></ulink>.
|
||||
Or, you can use BitBake to generate the tarball inside the existing Yocto Project
|
||||
build tree.
|
||||
</para>
|
||||
@@ -79,9 +82,9 @@
|
||||
$ cd ~
|
||||
$ mkdir yocto-project
|
||||
$ cd yocto-project
|
||||
$ wget http://www.yoctoproject.org/downloads/poky/poky-edison-6.0.tar.bz2
|
||||
$ tar xjf poky-edison-6.0.tar.bz2
|
||||
$ source poky-edison-6.0/oe-init-build-env
|
||||
$ wget &YOCTO_RELEASE_DL_URL;/&YOCTO_POKY_TARBALL;
|
||||
$ tar xjf &YOCTO_POKY_TARBALL;
|
||||
$ source &OE_INIT_PATH;
|
||||
$ bitbake adt-installer
|
||||
</literallayout>
|
||||
</para>
|
||||
@@ -93,6 +96,14 @@
|
||||
<para>
|
||||
Before running the ADT Installer script, you need to unpack the tarball.
|
||||
You can unpack the tarball in any directory you wish.
|
||||
For example, this command copies the ADT Installer tarball from where
|
||||
it was built into the home directory and then unpacks the tarball into
|
||||
a top-level directory named <filename>adt-installer</filename>:
|
||||
<literallayout class='monospaced'>
|
||||
$ cd ~
|
||||
$ cp ~/poky/build/tmp/deploy/sdk/adt_installer.tar.bz2 $HOME
|
||||
$ tar -xjf adt_installer.tar.bz2
|
||||
</literallayout>
|
||||
Unpacking it creates the directory <filename>adt-installer</filename>,
|
||||
which contains the ADT Installer script (<filename>adt_installer</filename>)
|
||||
and its configuration file (<filename>adt_installer.conf</filename>).
|
||||
@@ -155,19 +166,20 @@
|
||||
|
||||
<para>
|
||||
After you have configured the <filename>adt_installer.conf</filename> file,
|
||||
run the installer using the following command:
|
||||
run the installer using the following command.
|
||||
Be sure that you are not trying to use cross-compilation tools.
|
||||
When you run the installer, the environment must use a
|
||||
host <filename>gcc</filename>:
|
||||
<literallayout class='monospaced'>
|
||||
$ adt_installer
|
||||
$ ./adt_installer
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<note>
|
||||
The ADT Installer requires the <filename>libtool</filename> package to complete.
|
||||
If you install the recommended packages as described in the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html#packages'>Packages</ulink>"
|
||||
section of
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html'>
|
||||
The Yocto Project Quick Start</ulink>, then you will have libtool installed.
|
||||
If you install the recommended packages as described in
|
||||
"<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Packages</ulink>"
|
||||
section of The Yocto Project Quick Start, then you will have libtool installed.
|
||||
</note>
|
||||
|
||||
<para>
|
||||
@@ -181,7 +193,7 @@
|
||||
<para>
|
||||
Once the installation completes, the ADT, which includes the cross-toolchain, is installed.
|
||||
You will notice environment setup files for the cross-toolchain in
|
||||
<filename>/opt/poky/1.1</filename>,
|
||||
<filename>&YOCTO_ADTPATH_DIR;</filename>,
|
||||
and image tarballs in the <filename>adt-installer</filename>
|
||||
directory according to your installer configurations, and the target sysroot located
|
||||
according to the <filename>YOCTOADT_TARGET_SYSROOT_LOC_<arch></filename> variable
|
||||
@@ -204,17 +216,17 @@
|
||||
Follow these steps:
|
||||
<orderedlist>
|
||||
<listitem><para>Go to
|
||||
<ulink url='http://www.yoctoproject.org/downloads/yocto-1.1/toolchain'></ulink>
|
||||
<ulink url='&YOCTO_TOOLCHAIN_DL_URL;'></ulink>
|
||||
and find the folder that matches your host development system
|
||||
(i.e. <filename>i586</filename> for 32-bit machines or
|
||||
<filename>x86_64</filename> for 64-bit machines).</para></listitem>
|
||||
(i.e. <filename>i686</filename> for 32-bit machines or
|
||||
<filename>x86-64</filename> for 64-bit machines).</para></listitem>
|
||||
<listitem><para>Go into that folder and download the toolchain tarball whose name
|
||||
includes the appropriate target architecture.
|
||||
For example, if your host development system is an Intel-based 64-bit system and
|
||||
you are going to use your cross-toolchain for an Intel-based 32-bit target, go into the
|
||||
<filename>x86_64</filename> folder and download the following tarball:
|
||||
<literallayout class='monospaced'>
|
||||
yocto-eglibc-x86_64-i586-toolchain-1.1.tar.bz2
|
||||
poky-eglibc-x86_64-i586-toolchain-gmae-&DISTRO;.tar.bz2
|
||||
</literallayout>
|
||||
<note><para>As an alternative to steps one and two, you can build the toolchain tarball
|
||||
if you have a Yocto Project build tree.
|
||||
@@ -231,7 +243,7 @@
|
||||
</para></note></para></listitem>
|
||||
<listitem><para>Make sure you are in the root directory with root privileges and then expand
|
||||
the tarball.
|
||||
The tarball expands into <filename>/opt/poky/1.1</filename>.
|
||||
The tarball expands into <filename>&YOCTO_ADTPATH_DIR;</filename>.
|
||||
Once the tarball is expanded, the cross-toolchain is installed.
|
||||
You will notice environment setup files for the cross-toolchain in the directory.
|
||||
</para></listitem>
|
||||
@@ -294,7 +306,7 @@
|
||||
Before you can develop using the cross-toolchain, you need to set up the
|
||||
cross-development environment by sourcing the toolchain's environment setup script.
|
||||
If you used the ADT Installer or used an existing ADT tarball to install the ADT,
|
||||
then you can find this script in the <filename>/opt/poky/1.1</filename>
|
||||
then you can find this script in the <filename>&YOCTO_ADTPATH_DIR;</filename>
|
||||
directory.
|
||||
If you installed the toolchain in the build tree, you can find the environment setup
|
||||
script for the toolchain in the Yocto Project build tree's <filename>tmp</filename> directory.
|
||||
@@ -308,7 +320,7 @@
|
||||
For example, the toolchain environment setup script for a 64-bit IA-based architecture would
|
||||
be the following:
|
||||
<literallayout class='monospaced'>
|
||||
/opt/poky/1.1/environment-setup-x86_64-poky-linux
|
||||
&YOCTO_ADTPATH_DIR;/environment-setup-x86_64-poky-linux
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
@@ -330,10 +342,8 @@
|
||||
To get the kernel and filesystem images, you either have to build them or download
|
||||
pre-built versions.
|
||||
You can find examples for both these situations in the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html#test-run'>A
|
||||
Quick Test Run</ulink>" section of
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html'>
|
||||
The Yocto Project Quick Start</ulink>.
|
||||
"<ulink url='&YOCTO_DOCS_QS_URL;#test-run'>A Quick Test Run</ulink>" section of
|
||||
The Yocto Project Quick Start.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -342,12 +352,11 @@
|
||||
<filename>mips</filename>, <filename>powerpc</filename>, and <filename>arm</filename>)
|
||||
that you can use unaltered in the QEMU emulator.
|
||||
These kernel images reside in the Yocto Project release
|
||||
area - <ulink url='http://www.yoctoproject.org/downloads/yocto-1.1/machines/'></ulink>
|
||||
area - <ulink url='&YOCTO_MACHINES_DL_URL;'></ulink>
|
||||
and are ideal for experimentation within Yocto Project.
|
||||
For information on the image types you can build using the Yocto Project, see the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html#ref-images'>Reference: Images</ulink>" appendix in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html'>
|
||||
The Yocto Project Reference Manual</ulink>.
|
||||
"<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Reference: Images</ulink>" appendix in
|
||||
The Yocto Project Reference Manual.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -363,7 +372,7 @@
|
||||
If you want to use a different image type that contains the <filename>tcf-agent</filename>,
|
||||
you can do so one of two ways:
|
||||
<itemizedlist>
|
||||
<listitem><para>Modify the <filename>conf/local.conf</filename> configuration in
|
||||
<listitem><para>Modify the <filename>conf/local.conf</filename> configuration file in
|
||||
the Yocto Project build directory and then rebuild the image.
|
||||
With this method, you need to modify the <filename>EXTRA_IMAGE_FEATURES</filename>
|
||||
variable to have the value of "tools-debug" before rebuilding the image.
|
||||
@@ -378,11 +387,11 @@
|
||||
<listitem><para>Set up the cross-development environment as described in the
|
||||
"<link linkend='setting-up-the-cross-development-environment'>Setting
|
||||
Up the Cross-Development Environment</link>" section.</para></listitem>
|
||||
<listitem><para>Get the <filename>tcf-agent</filename> source code, which is
|
||||
stored using the Subversion SCM, using the following command:
|
||||
<listitem><para>Get the <filename>tcf-agent</filename> source code using
|
||||
the following commands:
|
||||
<literallayout class='monospaced'>
|
||||
$ svn checkout svn://dev.eclipse.org/svnroot/dsdp/org.eclipse.tm.tcf/trunk/agent \
|
||||
<-r #rev_number>
|
||||
$ git clone http://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git
|
||||
$ cd agent
|
||||
</literallayout></para></listitem>
|
||||
<listitem><para>Modify the <filename>Makefile.inc</filename> file
|
||||
for the cross-compilation environment by setting the
|
||||
@@ -422,13 +431,13 @@
|
||||
filesystem image.
|
||||
For example, the following commands set up the environment and then extract
|
||||
the root filesystem from a previously built filesystem image tarball named
|
||||
<filename>core-image-sato-sdk-qemux86-2011091411831.rootfs.tar.bz2</filename>.
|
||||
<filename>core-image-sato-sdk-qemux86.tar.bz2</filename>.
|
||||
The example extracts the root filesystem into the <filename>$HOME/qemux86-sato</filename>
|
||||
directory:
|
||||
<literallayout class='monospaced'>
|
||||
$ source $HOME/poky/build/tmp/environment-setup-i586-poky-linux
|
||||
$ runqemu-extract-sdk \
|
||||
tmp/deploy/images/core-image-sato-sdk-qemux86-2011091411831.rootfs.tar.bz2 \
|
||||
tmp/deploy/images/core-image-sato-sdk-qemux86.tar.bz2 \
|
||||
$HOME/qemux86-sato
|
||||
</literallayout>
|
||||
In this case, you could now point to the target sysroot at
|
||||
|
||||
@@ -654,7 +654,7 @@ hr {
|
||||
|
||||
|
||||
.tip, .warning, .caution, .note {
|
||||
border-color: #aaa;
|
||||
border-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
@@ -662,24 +662,24 @@ hr {
|
||||
.warning table th,
|
||||
.caution table th,
|
||||
.note table th {
|
||||
border-bottom-color: #aaa;
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
.warning {
|
||||
background-color: #fea;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.caution {
|
||||
background-color: #fea;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.tip {
|
||||
background-color: #eff;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.note {
|
||||
background-color: #dfc;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.glossary dl dt,
|
||||
@@ -946,8 +946,8 @@ table {
|
||||
|
||||
.tip,
|
||||
.note {
|
||||
background: #666666;
|
||||
color: #fff;
|
||||
background: #f0f0f2;
|
||||
color: #333;
|
||||
padding: 20px;
|
||||
margin: 20px;
|
||||
}
|
||||
@@ -958,11 +958,26 @@ table {
|
||||
margin: 0em;
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.tip a,
|
||||
.note a {
|
||||
color: #fff;
|
||||
color: #333;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.footnote {
|
||||
font-size: small;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
/* Changes the announcement text */
|
||||
.tip h3,
|
||||
.warning h3,
|
||||
.caution h3,
|
||||
.note h3 {
|
||||
font-size:large;
|
||||
color: #00557D;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<book id='bsp-guide' lang='en'
|
||||
xmlns:xi="http://www.w3.org/2003/XInclude"
|
||||
@@ -55,10 +56,20 @@
|
||||
<date>6 October 2011</date>
|
||||
<revremark>Released with the Yocto Project 1.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>1.1.1</revnumber>
|
||||
<date>15 March 2012</date>
|
||||
<revremark>Released with the Yocto Project 1.1.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>1.1.2</revnumber>
|
||||
<date>July 2012</date>
|
||||
<revremark>Released with the Yocto Project 1.1.2 Release.</revremark>
|
||||
</revision>
|
||||
</revhistory>
|
||||
|
||||
<copyright>
|
||||
<year>2010-2011</year>
|
||||
<year>©RIGHT_YEAR;</year>
|
||||
<holder>Linux Foundation</holder>
|
||||
</copyright>
|
||||
|
||||
@@ -70,9 +81,9 @@
|
||||
<note>
|
||||
Due to production processes, there could be differences between the Yocto Project
|
||||
documentation bundled in the release tarball and the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/bsp-guide/bsp-guide.html'>
|
||||
<ulink url='&YOCTO_DOCS_BSP_URL;'>
|
||||
Board Support Package (BSP) Developer's Guide</ulink> on
|
||||
the <ulink url='http://www.yoctoproject.org'>Yocto Project</ulink> website.
|
||||
the <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink> website.
|
||||
For the latest version of this manual, see the manual on the website.
|
||||
</note>
|
||||
</legalnotice>
|
||||
|
||||
@@ -654,7 +654,7 @@ hr {
|
||||
|
||||
|
||||
.tip, .warning, .caution, .note {
|
||||
border-color: #aaa;
|
||||
border-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
@@ -662,24 +662,24 @@ hr {
|
||||
.warning table th,
|
||||
.caution table th,
|
||||
.note table th {
|
||||
border-bottom-color: #aaa;
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
.warning {
|
||||
background-color: #fea;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.caution {
|
||||
background-color: #fea;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.tip {
|
||||
background-color: #eff;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.note {
|
||||
background-color: #dfc;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.glossary dl dt,
|
||||
@@ -771,6 +771,17 @@ h6,
|
||||
h7{
|
||||
}
|
||||
|
||||
/*
|
||||
Example of how to stick an image as part of the title.
|
||||
|
||||
div.article .titlepage .title
|
||||
{
|
||||
background-image: url("figures/white-on-black.png");
|
||||
background-position: center;
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
*/
|
||||
|
||||
div.preface .titlepage .title,
|
||||
div.colophon .title,
|
||||
div.chapter .titlepage .title {
|
||||
@@ -936,8 +947,8 @@ table {
|
||||
|
||||
.tip,
|
||||
.note {
|
||||
background: #666666;
|
||||
color: #fff;
|
||||
background: #f0f0f2;
|
||||
color: #333;
|
||||
padding: 20px;
|
||||
margin: 20px;
|
||||
}
|
||||
@@ -948,11 +959,26 @@ table {
|
||||
margin: 0em;
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.tip a,
|
||||
.note a {
|
||||
color: #fff;
|
||||
color: #333;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.footnote {
|
||||
font-size: small;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
/* Changes the announcement text */
|
||||
.tip h3,
|
||||
.warning h3,
|
||||
.caution h3,
|
||||
.note h3 {
|
||||
font-size:large;
|
||||
color: #00557D;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<appendix id='dev-manual-bsp-appendix'>
|
||||
|
||||
<title>BSP Development Example</title>
|
||||
|
||||
<para>
|
||||
This appendix provides a complete BSP example.
|
||||
This appendix provides a complete BSP development example.
|
||||
The example assumes the following:
|
||||
<itemizedlist>
|
||||
<listitem><para>No previous preparation or use of the Yocto Project.</para></listitem>
|
||||
<listitem><para>Use of the Crown Bay Board Support Package (BSP) as a base BSP from
|
||||
which to work from.</para></listitem>
|
||||
<listitem><para>Use of the Crown Bay Board Support Package (BSP) as a "base" BSP from
|
||||
which to work.
|
||||
The example begins with the Crown Bay BSP as the starting point
|
||||
but ends by building a new 'atom-pc' BSP, which was based on the Crown Bay BSP.
|
||||
</para></listitem>
|
||||
<listitem><para>Shell commands assume <filename>bash</filename></para></listitem>
|
||||
<listitem><para>Example was developed on an Intel-based Core i7 platform running
|
||||
Ubuntu 10.04 LTS released in April of 2010.</para></listitem>
|
||||
@@ -24,32 +28,81 @@
|
||||
<para>
|
||||
You need to have the Yocto Project files available on your host system.
|
||||
You can get files through tarball extraction or by cloning the <filename>poky</filename>
|
||||
Git repository.
|
||||
The following paragraphs describe both methods.
|
||||
For additional information, see the bulleted item
|
||||
"<link linkend='local-yp-release'>Yocto Project Release</link>".
|
||||
</para>
|
||||
|
||||
<para>
|
||||
As mentioned, one way to get the Yocto Project files is to use Git to clone the
|
||||
<filename>poky</filename> repository.
|
||||
These commands create a local copy of the Git repository.
|
||||
By default, the top-level directory of the repository is named <filename>poky</filename>:
|
||||
<literallayout class='monospaced'>
|
||||
$ git clone git://git.yoctoproject.org/poky
|
||||
$ cd poky
|
||||
</literallayout>
|
||||
Alternatively, you can start with the downloaded Poky "&DISTRO_NAME;" tarball.
|
||||
These commands unpack the tarball into a Yocto Project File directory structure.
|
||||
By default, the top-level directory of the file structure is named
|
||||
<filename>&YOCTO_POKY;</filename>:
|
||||
<literallayout class='monospaced'>
|
||||
$ tar xfj &YOCTO_POKY_TARBALL;
|
||||
$ cd &YOCTO_POKY;
|
||||
</literallayout>
|
||||
<note><para>If you're using the tarball method, you can ignore all the following steps that
|
||||
ask you to carry out Git operations.
|
||||
You already have the results of those operations
|
||||
in the form of the &DISTRO_NAME; release tarballs.
|
||||
Consequently, there is nothing left to do other than extract those tarballs into the
|
||||
proper locations.</para>
|
||||
|
||||
<para>Once you expand the released tarball, you have a snapshot of the Git repository
|
||||
that represents a specific release.
|
||||
Fundamentally, this is different than having a local copy of the Yocto Project
|
||||
Git repository.
|
||||
See the bulleted item
|
||||
"<link linkend='local-yp-release'>Yocto Project Release</link>"
|
||||
for information on how to get these files.
|
||||
Given the tarball method, changes you make are building on top of a release.
|
||||
With the Git repository method you have the ability to track development
|
||||
and keep changes in revision control.</para></note>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Once you have the local <filename>poky</filename> Git repository set up,
|
||||
you have many development branches from which you can work.
|
||||
From inside the repository you can see the branch names and the tag names used
|
||||
in the Git repository using either of the following two commands:
|
||||
With the local <filename>poky</filename> Git repository set up,
|
||||
you have all the development branches available to you from which you can work.
|
||||
Next, you need to be sure that your local repository reflects the exact
|
||||
release in which you are interested.
|
||||
From inside the repository you can see the development branches that represent
|
||||
areas of development that have diverged from the main (master) branch
|
||||
at some point, such as a branch to track a maintenance release's development.
|
||||
You can also see the tag names used to mark snapshots of stable releases or
|
||||
points in the repository.
|
||||
Use the following commands to list out the branches and the tags in the repository,
|
||||
respectively.
|
||||
<literallayout class='monospaced'>
|
||||
$ git branch -a
|
||||
$ git tag -l
|
||||
</literallayout>
|
||||
For this example we are going to use the Yocto Project 1.1 Release, which is code
|
||||
named "edison".
|
||||
These commands create a local branch named <filename>edison</filename>
|
||||
that tracks the remote branch of the same name.
|
||||
For this example, we are going to use the Yocto Project &DISTRO; Release, which is code
|
||||
named "&DISTRO_NAME;".
|
||||
To make sure we have a local area (branch in Git terms) on our machine that
|
||||
reflects the &DISTRO; release, we can use the following commands:
|
||||
<literallayout class='monospaced'>
|
||||
$ cd poky
|
||||
$ git checkout -b edison origin/edison
|
||||
Switched to a new branch 'edison'
|
||||
$ cd ~/poky
|
||||
$ git fetch --tags
|
||||
$ git checkout &DISTRO_NAME;-&POKYVERSION; -b &DISTRO_NAME;
|
||||
Switched to a new branch '&DISTRO_NAME;'
|
||||
</literallayout>
|
||||
The <filename>git fetch --tags</filename> is somewhat redundant since you just set
|
||||
up the repository and should have all the tags.
|
||||
The <filename>fetch</filename> command makes sure all the tags are available in your
|
||||
local repository.
|
||||
The Git <filename>checkout</filename> command with the <filename>-b</filename> option
|
||||
creates a local branch for you named <filename>&DISTRO_NAME;</filename>.
|
||||
Your local branch begins in the same state as the Yocto Project &DISTRO; released tarball
|
||||
marked with the <filename>&DISTRO_NAME;-&POKYVERSION;</filename> tag in the source repositories.
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id='choosing-a-base-bsp-app'>
|
||||
<title>Choosing a Base BSP</title>
|
||||
@@ -58,7 +111,12 @@
|
||||
For this example, the base BSP is the <trademark class='registered'>Intel</trademark>
|
||||
<trademark class='trade'>Atom</trademark> Processor E660 with Intel Platform
|
||||
Controller Hub EG20T Development Kit, which is otherwise referred to as "Crown Bay."
|
||||
The BSP layer is <filename>meta-crownbay</filename>.
|
||||
The BSP layer is <filename>meta-crownbay</filename>.
|
||||
The base BSP is simply the BSP
|
||||
we will be using as a starting point, so don't worry if you don't actually have Crown Bay
|
||||
hardware.
|
||||
The remainder of the example transforms the base BSP into a BSP that should be
|
||||
able to boot on generic atom-pc (netbook) hardware.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -73,29 +131,59 @@
|
||||
<para>
|
||||
You need to have the base BSP layer on your development system.
|
||||
Similar to the local Yocto Project files, you can get the BSP
|
||||
layer one of two ways:
|
||||
layer in couple of different ways:
|
||||
download the BSP tarball and extract it, or set up a local Git repository that
|
||||
has the Yocto Project BSP layers.
|
||||
You should use the same method that you used to get the local Yocto Project files earlier.
|
||||
See "<link linkend='getting-setup'>Getting Setup</link>" for information on how to get
|
||||
the BSP files.
|
||||
</para>
|
||||
|
||||
|
||||
<para>
|
||||
This example assumes the local <filename>meta-intel</filename> Git repository is
|
||||
inside the local <filename>poky</filename> Git repository.
|
||||
The <filename>meta-intel</filename> Git repository contains all the metadata
|
||||
that supports BSP creation.
|
||||
This example assumes the BSP layer will be located within a directory named
|
||||
<filename>meta-intel</filename> contained within the <filename>poky</filename>
|
||||
parent directory.
|
||||
The following steps will automatically create the
|
||||
<filename>meta-intel</filename> directory and the contained
|
||||
<filename>meta-crownbay</filename> starting point in both the Git and the tarball cases.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If you're using the Git method, you could do the following to create
|
||||
the starting layout after you have made sure you are in the <filename>poky</filename>
|
||||
directory created in the previous steps:
|
||||
<literallayout class='monospaced'>
|
||||
$ git clone git://git.yoctoproject.org/meta-intel.git
|
||||
$ cd meta-intel
|
||||
</literallayout>
|
||||
Alternatively, you can start with the downloaded Crown Bay tarball.
|
||||
You can download the &DISTRO_NAME; version of the BSP tarball from the
|
||||
<ulink url='&YOCTO_HOME_URL;/download'>Download</ulink> page of the
|
||||
Yocto Project website.
|
||||
Here is the specific link for the tarball needed for this example:
|
||||
<ulink url='&YOCTO_DL_URL;/releases/yocto/yocto-1.1/machines/crownbay-noemgd/crownbay-noemgd-edison-6.0.0.tar.bz2'></ulink>.
|
||||
Again, be sure that you are already in the <filename>poky</filename> directory
|
||||
as described previously before installing the tarball:
|
||||
<literallayout class='monospaced'>
|
||||
$ tar xfj crownbay-noemgd-&DISTRO_NAME;-6.0.0.tar.bz2
|
||||
$ cd meta-intel
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The <filename>meta-intel</filename> directory contains all the metadata
|
||||
that supports BSP creation.
|
||||
If you're using the Git method, the following
|
||||
step will switch to the &DISTRO_NAME; metadata.
|
||||
If you're using the tarball method, you already have the correct metadata and can
|
||||
skip to the next step.
|
||||
Because <filename>meta-intel</filename> is its own Git repository, you will want
|
||||
to be sure you are in the appropriate branch for your work.
|
||||
For this example we are going to use the <filename>edison</filename> branch.
|
||||
For this example we are going to use the <filename>&DISTRO_NAME;</filename> branch.
|
||||
<literallayout class='monospaced'>
|
||||
$ cd meta-intel
|
||||
$ git checkout -b edison origin/edison
|
||||
Switched to a new branch 'edison'
|
||||
$ git checkout -b &DISTRO_NAME; origin/&DISTRO_NAME;
|
||||
Branch &DISTRO_NAME; set up to track remote branch &DISTRO_NAME; from origin.
|
||||
Switched to a new branch '&DISTRO_NAME;'
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
@@ -112,15 +200,12 @@
|
||||
|
||||
<para>
|
||||
For this example, the new layer will be named <filename>meta-mymachine</filename>.
|
||||
The name must follow the BSP layer naming convention, which is
|
||||
The name should follow the BSP layer naming convention, which is
|
||||
<filename>meta-<name></filename>.
|
||||
The following example assumes your working directory is <filename>meta-intel</filename>
|
||||
The following assumes your working directory is <filename>meta-intel</filename>
|
||||
inside the local Yocto Project files.
|
||||
If you downloaded and expanded a Crown Bay tarball then you simply copy the resulting
|
||||
<filename>meta-crownbay</filename> directory structure to a location of your choice.
|
||||
Good practice for a Git repository, however, is to just copy the new layer alongside
|
||||
the existing
|
||||
BSP layers in the <filename>meta-intel</filename> Git repository:
|
||||
To start your new layer, just copy the new layer alongside the existing
|
||||
BSP layers in the <filename>meta-intel</filename> directory:
|
||||
<literallayout class='monospaced'>
|
||||
$ cp -a meta-crownbay/ meta-mymachine
|
||||
</literallayout>
|
||||
@@ -162,9 +247,14 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The next step makes changes to <filename>mymachine.conf</filename> itself.
|
||||
The only changes needed for this example are changes to the comment lines.
|
||||
Here we simply substitute the Crown Bay name with an appropriate name.
|
||||
Next, we need to make changes to the <filename>mymachine.conf</filename> itself.
|
||||
The only changes we want to make for this example are to the comment lines.
|
||||
Changing comments, of course, is never strictly necessary, but it's alway good form to make
|
||||
them reflect reality as much as possible.
|
||||
|
||||
Here, simply substitute the Crown Bay name with an appropriate name for the BSP
|
||||
(<filename>mymachine</filename> in this case) and change the description to
|
||||
something that describes your hardware.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -176,13 +266,12 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The next configuration file in the new BSP layer we need to edit is <filename>layer.conf</filename>.
|
||||
The next configuration file in the new BSP layer we need to edit is
|
||||
<filename>meta-mymachine/conf/layer.conf</filename>.
|
||||
This file identifies build information needed for the new layer.
|
||||
You can see the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/bsp-guide/bsp-guide.html#bsp-filelayout-layer'>Layer Configuration File</ulink>" section in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/bsp-guide/bsp-guide.html'>The Board
|
||||
Support Packages (BSP) Development Guide</ulink>
|
||||
for more information on this configuration file.
|
||||
"<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-filelayout-layer'>Layer Configuration File</ulink>" section
|
||||
in The Board Support Packages (BSP) Development Guide for more information on this configuration file.
|
||||
Basically, we are changing the existing statements to work with our BSP.
|
||||
</para>
|
||||
|
||||
@@ -213,7 +302,8 @@
|
||||
Now we will take a look at the recipes in your new layer.
|
||||
The standard BSP structure has areas for BSP, graphics, core, and kernel recipes.
|
||||
When you create a BSP, you use these areas for appropriate recipes and append files.
|
||||
Recipes take the form of <filename>.bb</filename> files.
|
||||
Recipes take the form of <filename>.bb</filename> files, while append files take
|
||||
the form of <filename>.bbappend</filename> files.
|
||||
If you want to leverage the existing recipes the Yocto Project build system uses
|
||||
but change those recipes, you can use <filename>.bbappend</filename> files.
|
||||
All new recipes and append files for your layer must go in the layer’s
|
||||
@@ -223,7 +313,7 @@
|
||||
</para>
|
||||
|
||||
<section id='changing-recipes-bsp'>
|
||||
<title>Changing <filename>recipes-bsp</filename></title>
|
||||
<title>Changing <filename>recipes-bsp</filename></title>
|
||||
|
||||
<para>
|
||||
First, let's look at <filename>recipes-bsp</filename>.
|
||||
@@ -232,7 +322,7 @@
|
||||
the remaining one that doesn't support EMGD.
|
||||
These commands take care of the <filename>recipes-bsp</filename> recipes:
|
||||
<literallayout class='monospaced'>
|
||||
$ rm -rf meta-mymachine/recipes-graphics/xorg-xserver/*emgd*
|
||||
$ rm -rf meta-mymachine/recipes-bsp/formfactor/formfactor/crownbay
|
||||
$ mv meta-mymachine/recipes-bsp/formfactor/formfactor/crownbay-noemgd/ \
|
||||
meta-mymachine/recipes-bsp/formfactor/formfactor/mymachine
|
||||
</literallayout>
|
||||
@@ -240,7 +330,7 @@
|
||||
</section>
|
||||
|
||||
<section id='changing-recipes-graphics'>
|
||||
<title>Changing <filename>recipes-graphics</filename></title>
|
||||
<title>Changing <filename>recipes-graphics</filename></title>
|
||||
|
||||
<para>
|
||||
Now let's look at <filename>recipes-graphics</filename>.
|
||||
@@ -248,7 +338,6 @@
|
||||
be sure to rename remaining directories appropriately.
|
||||
The following commands clean up the <filename>recipes-graphics</filename> directory:
|
||||
<literallayout class='monospaced'>
|
||||
$ rm -rf meta-mymachine/recipes-graphics/xorg-xserver/xserver-xf86-emgd*
|
||||
$ rm -rf meta-mymachine/recipes-graphics/xorg-xserver/xserver-xf86-config/crownbay
|
||||
$ mv meta-mymachine/recipes-graphics/xorg-xserver/xserver-xf86-config/crownbay-noemgd \
|
||||
meta-mymachine/recipes-graphics/xorg-xserver/xserver-xf86-config/mymachine
|
||||
@@ -262,7 +351,7 @@
|
||||
</section>
|
||||
|
||||
<section id='changing-recipes-core'>
|
||||
<title>Changing <filename>recipes-core</filename></title>
|
||||
<title>Changing <filename>recipes-core</filename></title>
|
||||
|
||||
<para>
|
||||
Now let's look at changes in <filename>recipes-core</filename>.
|
||||
@@ -270,7 +359,7 @@
|
||||
<filename>recipes-core/tasks</filename> appends the similarly named recipe
|
||||
located in the local Yocto Project files at
|
||||
<filename>meta/recipes-core/tasks</filename>.
|
||||
The "append" file in our layer right now is Crown Bay-specific and supports
|
||||
The append file in our layer right now is Crown Bay-specific and supports
|
||||
EMGD and non-EMGD.
|
||||
Here are the contents of the file:
|
||||
<literallayout class='monospaced'>
|
||||
@@ -291,7 +380,7 @@
|
||||
</section>
|
||||
|
||||
<section id='changing-recipes-kernel'>
|
||||
<title>Changing <filename>recipes-kernel</filename></title>
|
||||
<title>Changing <filename>recipes-kernel</filename></title>
|
||||
|
||||
<para>
|
||||
Finally, let's look at <filename>recipes-kernel</filename> changes.
|
||||
@@ -304,31 +393,38 @@
|
||||
The <filename>SRCREV_machine</filename> and <filename>SRCREV_meta</filename>
|
||||
statements point to the exact commits used by the Yocto Project development team
|
||||
in their source repositories that identify the right kernel for our hardware.
|
||||
In other words, the <filename>SRCREV</filename> values are simply Git commit
|
||||
IDs that identify which commit on each
|
||||
of the kernel branches (machine and meta) will be checked out and used to build
|
||||
the kernel.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
However, in the <filename>meta-mymachine</filename> layer in
|
||||
<filename>recipes-kernel/linux</filename> resides a <filename>.bbappend</filename>
|
||||
file named <filename>linux-yocto_3.0.bbappend</filename> that
|
||||
is appended to the recipe of the same name in <filename>meta/recipes-kernel/linux</filename>.
|
||||
Thus, the <filename>SRCREV</filename> statements in the "append" file override
|
||||
appends information to the recipe of the same name in <filename>meta/recipes-kernel/linux</filename>.
|
||||
Thus, the <filename>SRCREV</filename> statements in the append file override
|
||||
the more general statements found in <filename>meta</filename>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The <filename>SRCREV</filename> statements in the "append" file currently identify
|
||||
The <filename>SRCREV</filename> statements in the append file currently identify
|
||||
the kernel that supports the Crown Bay BSP with and without EMGD support.
|
||||
Here are the statements:
|
||||
Here are the statements:
|
||||
<note>The commit ID strings used in this manual might not match the actual commit
|
||||
ID strings found in the <filename>linux-yocto_3.0.bbappend</filename> file.
|
||||
For the example, this difference does not matter.</note>
|
||||
<literallayout class='monospaced'>
|
||||
SRCREV_machine_pn-linux-yocto_crownbay ?= \
|
||||
"2247da9131ea7e46ed4766a69bb1353dba22f873"
|
||||
SRCREV_meta_pn-linux-yocto_crownbay ?= \
|
||||
"67a46a608f47c19f16995be7de7b272025864b1b"
|
||||
"d05450e4aef02c1b7137398ab3a9f8f96da74f52"
|
||||
|
||||
SRCREV_machine_pn-linux-yocto_crownbay-noemgd ?= \
|
||||
"2247da9131ea7e46ed4766a69bb1353dba22f873"
|
||||
SRCREV_meta_pn-linux-yocto_crownbay-noemgd ?= \
|
||||
"67a46a608f47c19f16995be7de7b272025864b1b"
|
||||
"d05450e4aef02c1b7137398ab3a9f8f96da74f52"
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
@@ -343,29 +439,52 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To fix this situation in <filename>linux-yocto_3.0.bbappend</filename>
|
||||
To fix this situation in <filename>linux-yocto_3.0.bbappend</filename>,
|
||||
we delete the two <filename>SRCREV</filename> statements that support
|
||||
EMGD (the top pair).
|
||||
We also change the remaining pair to specify <filename>mymachine</filename>
|
||||
and insert the commit identifiers to identify the kernel in which we
|
||||
are interested, which will be based on the <filename>atom-pc-standard</filename>
|
||||
kernel.
|
||||
In this case, because we're working with the &DISTRO_NAME; branch of everything, we
|
||||
need to use the <filename>SRCREV</filename> values for the atom-pc branch
|
||||
that are associated with the &DISTRO_NAME; release.
|
||||
To find those values, we need to find the <filename>SRCREV</filename>
|
||||
values that &DISTRO_NAME; uses for the atom-pc branch, which we find in the
|
||||
<filename>poky/meta-yocto/recipes-kernel/linux/linux-yocto_3.0.bbappend</filename>
|
||||
file.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The machine <filename>SRCREV</filename> we want is in the
|
||||
<filename>SRCREV_machine_atom-pc</filename> variable.
|
||||
The meta <filename>SRCREV</filename> isn't specified in this file, so it must be
|
||||
specified in the base kernel recipe in the
|
||||
<filename>poky/meta/recipes-kernel/linux/linux-yocto_3.0.bb</filename>
|
||||
file, in the <filename>SRCREV_meta</filename> variable found there.
|
||||
Here are the final <filename>SRCREV</filename> statements:
|
||||
<literallayout class='monospaced'>
|
||||
SRCREV_machine_pn-linux-yocto_mymachine ?= \
|
||||
"06c798f25a19281d7fa944b14366dd75820ba009"
|
||||
"1e18e44adbe79b846e382370eb29bc4b8cd5a1a0"
|
||||
SRCREV_meta_pn-linux-yocto_mymachine ?= \
|
||||
"67a46a608f47c19f16995be7de7b272025864b1b"
|
||||
"d05450e4aef02c1b7137398ab3a9f8f96da74f52"
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If you are familiar with Git repositories you probably won’t have trouble locating the
|
||||
In this example, we're using the <filename>SRCREV</filename> values we
|
||||
found already captured in the &DISTRO_NAME; release because we're creating a BSP based on
|
||||
&DISTRO_NAME;.
|
||||
If, instead, we had based our BSP on the master branches, we would want to use
|
||||
the most recent <filename>SRCREV</filename> values taken directly from the kernel repo.
|
||||
We will not be doing that for this example.
|
||||
However, if you do base a future BSP on master and
|
||||
if you are familiar with Git repositories, you probably won’t have trouble locating the
|
||||
exact commit strings in the Yocto Project source repositories you need to change
|
||||
the <filename>SRCREV</filename> statements.
|
||||
You can find all the <filename>machine</filename> and <filename>meta</filename>
|
||||
branch points (commits) for the <filename>linux-yocto-3.0</filename> kernel at
|
||||
<ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-3.0'></ulink>.
|
||||
branch points (commits) for the <filename>linux-yocto-3.0-1.1.x</filename> kernel at
|
||||
<ulink url='&YOCTO_GIT_URL;/cgit.cgi/linux-yocto-3.0-1.1.x/'></ulink>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -394,19 +513,25 @@
|
||||
Because we are not interested in supporting EMGD those three can be deleted.
|
||||
The remaining three must be changed so that <filename>mymachine</filename> replaces
|
||||
<filename>crownbay-noemgd</filename> and <filename>crownbay</filename>.
|
||||
Because we are using the <filename>atom-pc</filename> branch for this new BSP, we can also find
|
||||
the exact branch we need for the <filename>KMACHINE</filename> variable in our new BSP from the value
|
||||
we find in the
|
||||
<filename>poky/meta-yocto/recipes-kernel/linux/linux-yocto_3.0.bbappend</filename>
|
||||
file we looked at in a previous step.
|
||||
In this case, the value we want is in the <filename>KMACHINE_atom-pc</filename> variable in that file.
|
||||
Here is the final <filename>linux-yocto_3.0.bbappend</filename> file after all
|
||||
the edits:
|
||||
<literallayout class='monospaced'>
|
||||
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
|
||||
|
||||
COMPATIBLE_MACHINE_mymachine = "mymachine"
|
||||
KMACHINE_mymachine = "yocto/standard/mymachine"
|
||||
KMACHINE_mymachine = "yocto/standard/common-pc/atom-pc"
|
||||
KERNEL_FEATURES_append_mymachine += " cfg/smp.scc"
|
||||
|
||||
SRCREV_machine_pn-linux-yocto_mymachine ?= \
|
||||
"06c798f25a19281d7fa944b14366dd75820ba009"
|
||||
"1e18e44adbe79b846e382370eb29bc4b8cd5a1a0"
|
||||
SRCREV_meta_pn-linux-yocto_mymachine ?= \
|
||||
"67a46a608f47c19f16995be7de7b272025864b1b"
|
||||
"d05450e4aef02c1b7137398ab3a9f8f96da74f52"
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
@@ -420,7 +545,7 @@
|
||||
statements that do not support your targeted hardware in addition to the inclusion
|
||||
of any new recipes you might need.
|
||||
In this example, it was simply a matter of ridding the new layer
|
||||
<filename>meta-machine</filename> of any code that supported the EMGD features
|
||||
<filename>meta-mymachine</filename> of any code that supported the EMGD features
|
||||
and making sure we were identifying the kernel that supports our example, which
|
||||
is the <filename>atom-pc-standard</filename> kernel.
|
||||
We did not introduce any new recipes to the layer.
|
||||
@@ -455,7 +580,7 @@
|
||||
Thus, entering the previous command created the <filename>yocto-build</filename> directory.
|
||||
If you do not provide a name for the build directory it defaults to
|
||||
<filename>build</filename>.
|
||||
The <filename>yocot-build</filename> directory contains a
|
||||
The <filename>yocto-build</filename> directory contains a
|
||||
<filename>conf</filename> directory that has
|
||||
two configuration files you will need to check: <filename>bblayers.conf</filename>
|
||||
and <filename>local.conf</filename>.</para></listitem>
|
||||
@@ -469,14 +594,14 @@
|
||||
You should also be sure any other variables in which you are interested are set.
|
||||
Some variables to consider are <filename>BB_NUMBER_THREADS</filename>
|
||||
and <filename>PARALLEL_MAKE</filename>, both of which can greatly reduce your build time
|
||||
if you are using a multi-threaded development system (e.g. values of
|
||||
<filename>8</filename> and <filename>j 6</filename>, respectively are optimal
|
||||
for a development machine that has four available cores).</para></listitem>
|
||||
if your development system supports multiple cores.
|
||||
For development systems that support multiple cores, a good rule of thumb is to set
|
||||
both the <filename>BB_NUMBER_THREADS</filename> and <filename>PARALLEL_MAKE</filename>
|
||||
variables to twice the number of cores your system supports.</para></listitem>
|
||||
<listitem><para>Update the <filename>bblayers.conf</filename> file so that it includes
|
||||
the path to your new BSP layer.
|
||||
In this example you need to include the pathname to <filename>meta-mymachine</filename>.
|
||||
For this example the
|
||||
<filename>BBLAYERS</filename> variable in the file would need to include the following path:
|
||||
In this example, you need to include this path as part of the
|
||||
<filename>BBLAYERS</filename> variable:
|
||||
<literallayout class='monospaced'>
|
||||
$HOME/poky/meta-intel/meta-mymachine
|
||||
</literallayout></para></listitem>
|
||||
@@ -485,14 +610,14 @@
|
||||
|
||||
<para>
|
||||
The appendix
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html#ref-variables-glos'>
|
||||
<ulink url='&YOCTO_DOCS_REF_URL;#ref-variables-glos'>
|
||||
Reference: Variables Glossary</ulink> in the Yocto Project Reference Manual has more information
|
||||
on configuration variables.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='building-the-image-app'>
|
||||
<title>Building the Image</title>
|
||||
<title>Building and Booting the Image</title>
|
||||
|
||||
<para>
|
||||
To build the image for our <filename>meta-mymachine</filename> BSP enter the following command
|
||||
@@ -513,6 +638,63 @@
|
||||
If the build results in any type of error you should check for misspellings in the
|
||||
files you changed or problems with your host development environment such as missing packages.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Finally, once you have an image, you can try booting it from a device
|
||||
(e.g. a USB device).
|
||||
To prepare a bootable USB device, insert a USB flash drive into your build system and
|
||||
copy the <filename>.hddimg</filename> file, located in the
|
||||
<filename>poky/build/tmp/deploy/images</filename>
|
||||
directory after a successful build to the flash drive.
|
||||
Assuming the USB flash drive takes device <filename>/dev/sdc</filename>,
|
||||
use <filename>dd</filename> to copy the live image to it.
|
||||
For example:
|
||||
<literallayout class='monospaced'>
|
||||
# dd if=core-image-sato-mymachine-20120111232235.hddimg of=/dev/sdc
|
||||
# sync
|
||||
# eject /dev/sdc
|
||||
</literallayout>
|
||||
You should now have a bootable USB flash device.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Insert the device
|
||||
into a bootable USB socket on the target, and power it on.
|
||||
The system should boot to the Sato graphical desktop.
|
||||
<footnote><para>Because
|
||||
this new image is not in any way tailored to the system you're
|
||||
booting it on, which is assumed to be some sort of atom-pc (netbook) system for this
|
||||
example, it might not be completely functional though it should at least boot to a text
|
||||
prompt.
|
||||
Specifically, it might fail to boot into graphics without some tweaking.
|
||||
If this ends up being the case, a possible next step would be to replace the
|
||||
<filename>mymachine.conf</filename>
|
||||
contents with the contents of <filename>atom-pc.conf</filename> and replace
|
||||
<filename>xorg.conf</filename> with <filename>atom-pc xorg.conf</filename>
|
||||
in <filename>meta-yocto</filename> and see if it fares any better.
|
||||
In any case, following the previous steps will give you a buildable image that
|
||||
will probably boot on most systems.
|
||||
Getting things working like you want
|
||||
them to for your hardware will normally require some amount of experimentation with
|
||||
configuration settings.</para></footnote>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For reference, the sato image produced by the previous steps for &DISTRO_NAME;
|
||||
should look like the following in terms of size.
|
||||
If your sato image is much different from this,
|
||||
you probably made a mistake in one of the above steps:
|
||||
<literallayout class='monospaced'>
|
||||
358709248 2012-01-11 20:43 core-image-sato-mymachine-20120111232235.hddimg
|
||||
</literallayout>
|
||||
<note>The previous instructions are also present in the README that was copied
|
||||
from meta-crownbay, which should also be updated to reflect the specifics of your
|
||||
new BSP.
|
||||
That file and the <filename>README.hardware</filename> file in the top-level
|
||||
<filename>poky</filename> directory
|
||||
also provides some suggestions for things to try if booting fails and produces
|
||||
strange error messages.</note>
|
||||
</para>
|
||||
</section>
|
||||
</appendix>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<chapter id='dev-manual-intro'>
|
||||
|
||||
@@ -15,9 +16,10 @@
|
||||
using the Yocto Project.
|
||||
Because much of the information in this manual is general, it contains many references to other
|
||||
sources where you can find more detail.
|
||||
For example, detailed information on Git, repositories and open-source in general
|
||||
For example, detailed information on Git, repositories and open source in general
|
||||
can be found in many places.
|
||||
Another example is how to get set up to use the Yocto Project, which our Yocto Project Quick Start covers.
|
||||
Another example is how to get set up to use the Yocto Project, which our
|
||||
<ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink> covers.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -35,10 +37,10 @@
|
||||
<itemizedlist>
|
||||
<listitem><para>Information that lets you get set
|
||||
up to develop using the Yocto Project.</para></listitem>
|
||||
<listitem><para>Information to help developers that are new to the open source environment
|
||||
<listitem><para>Information to help developers who are new to the open source environment
|
||||
and to the distributed revision control system Git, which the Yocto Project
|
||||
uses.</para></listitem>
|
||||
<listitem><para>An understanding of common end-to-end development models.</para></listitem>
|
||||
<listitem><para>An understanding of common end-to-end development models and tasks.</para></listitem>
|
||||
<listitem><para>Development case overviews for both system development and user-space
|
||||
applications.</para></listitem>
|
||||
<listitem><para>An overview and understanding of the emulation environment used with
|
||||
@@ -63,13 +65,15 @@
|
||||
<itemizedlist>
|
||||
<listitem><para>Step-by-step instructions if those instructions exist in other Yocto
|
||||
Project documentation.
|
||||
For example, The Application Development Toolkit (ADT) User’s Guide contains detailed
|
||||
For example, the
|
||||
<ulink url='&YOCTO_DOCS_ADT_URL;'>Yocto Project Application Development Toolkit (ADT)
|
||||
User's Guide</ulink> contains detailed
|
||||
instruction on how to obtain and configure the
|
||||
<trademark class='trade'>Eclipse</trademark> Yocto Plug-in.</para></listitem>
|
||||
<listitem><para>Reference material.
|
||||
This type of material resides in an appropriate reference manual.
|
||||
For example, system variables are documented in the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html'>
|
||||
<ulink url='&YOCTO_DOCS_REF_URL;'>
|
||||
Yocto Project Reference Manual</ulink>.</para></listitem>
|
||||
<listitem><para>Detailed public information that is not specific to the Yocto Project.
|
||||
For example, exhaustive information on how to use Git is covered better through the
|
||||
@@ -86,31 +90,31 @@
|
||||
need to supplement it with other information.
|
||||
The following list presents other sources of information you might find helpful:
|
||||
<itemizedlist>
|
||||
<listitem><para><emphasis>The <ulink url='http://www.yoctoproject.org'>Yocto Project Website</ulink>:
|
||||
<listitem><para><emphasis>The <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>:
|
||||
</emphasis> The home page for the Yocto Project provides lots of information on the project
|
||||
as well as links to software and documentation.</para></listitem>
|
||||
<listitem><para><emphasis>
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html'>
|
||||
<ulink url='&YOCTO_DOCS_QS_URL;'>
|
||||
The Yocto Project Quick Start</ulink>:</emphasis> This short document lets you get started
|
||||
with the Yocto Project quickly and start building an image.</para></listitem>
|
||||
<listitem><para><emphasis>
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html'>
|
||||
<ulink url='&YOCTO_DOCS_REF_URL;'>
|
||||
The Yocto Project Reference Manual</ulink>:</emphasis> This manual is a reference
|
||||
guide to the Yocto Project build component known as "Poky."
|
||||
The manual also contains a reference chapter on Board Support Package (BSP)
|
||||
layout.</para></listitem>
|
||||
<listitem><para><emphasis>
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/adt-manual/adt-manual.html'>
|
||||
<ulink url='&YOCTO_DOCS_ADT_URL;'>
|
||||
The Yocto Project Application Development Toolkit (ADT) User's Guide</ulink>:</emphasis>
|
||||
This guide provides information that lets you get going with the ADT to
|
||||
develop projects using the Yocto Project.</para></listitem>
|
||||
<listitem><para><emphasis>
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/bsp-guide/bsp-guide.html'>
|
||||
<ulink url='&YOCTO_DOCS_BSP_URL;'>
|
||||
The Yocto Project Board Support Package (BSP) Developer's Guide</ulink>:</emphasis>
|
||||
This guide defines the structure for BSP components.
|
||||
Having a commonly understood structure encourages standardization.</para></listitem>
|
||||
<listitem><para><emphasis>
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/kernel-manual/kernel-manual.html'>
|
||||
<ulink url='&YOCTO_DOCS_KERNEL_URL;'>
|
||||
The Yocto Project Kernel Architecture and Use Manual</ulink>:</emphasis>
|
||||
This manual describes the architecture of the Yocto Project kernel and provides
|
||||
some work flow examples.</para></listitem>
|
||||
@@ -120,14 +124,14 @@
|
||||
demonstrates how an application developer uses Yocto Plug-in features within
|
||||
the Eclipse IDE.</para></listitem>
|
||||
<listitem><para><emphasis>
|
||||
<ulink url='http://wiki.yoctoproject.org/wiki/FAQ'>FAQ</ulink>:</emphasis>
|
||||
<ulink url='&YOCTO_WIKI_URL;/wiki/FAQ'>FAQ</ulink>:</emphasis>
|
||||
A list of commonly asked questions and their answers.</para></listitem>
|
||||
<listitem><para><emphasis>
|
||||
<ulink url='http://www.yoctoproject.org/download/yocto/yocto-project-1.0-release-notes-poky-5.0'>
|
||||
<ulink url='&YOCTO_HOME_URL;/download/yocto/yocto-project-1.1.2-release-notes-poky-&POKYVERSION;'>
|
||||
Release Notes</ulink>:</emphasis> Features, updates and known issues for the current
|
||||
release of the Yocto Project.</para></listitem>
|
||||
<listitem><para><emphasis>
|
||||
<ulink url='http://bugzilla.yoctoproject.org/'>Bugzilla</ulink>:</emphasis>
|
||||
<ulink url='&YOCTO_BUGZILLA_URL;'>Bugzilla</ulink>:</emphasis>
|
||||
The bug tracking application the Yocto Project uses.
|
||||
If you find problems with the Yocto Project, you should report them using this
|
||||
application.</para></listitem>
|
||||
@@ -135,11 +139,11 @@
|
||||
Yocto Project Mailing Lists:</emphasis> To subscribe to the Yocto Project mailing
|
||||
lists, click on the following URLs and follow the instructions:
|
||||
<itemizedlist>
|
||||
<listitem><para><ulink url='http://lists.yoctoproject.org/listinfo/yocto'></ulink> for a
|
||||
<listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo/yocto'></ulink> for a
|
||||
Yocto Project Discussions mailing list.</para></listitem>
|
||||
<listitem><para><ulink url='http://lists.yoctoproject.org/listinfo/poky'></ulink> for a
|
||||
<listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo/poky'></ulink> for a
|
||||
Yocto Project Discussions mailing list about the Poky build system.</para></listitem>
|
||||
<listitem><para><ulink url='http://lists.yoctoproject.org/listinfo/yocto-announce'></ulink>
|
||||
<listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo/yocto-announce'></ulink>
|
||||
for a mailing list to receive offical Yocto Project announcements for developments and
|
||||
as well as Yocto Project milestones.</para></listitem>
|
||||
</itemizedlist></para></listitem>
|
||||
@@ -148,20 +152,20 @@
|
||||
for Yocto Project and Poky discussions: <filename>#yocto</filename> and
|
||||
<filename>#poky</filename>.</para></listitem>
|
||||
<listitem><para><emphasis>
|
||||
<ulink url='http://www.openedhand.com/'>OpenedHand</ulink>:</emphasis>
|
||||
<ulink url='&OH_HOME_URL;'>OpenedHand</ulink>:</emphasis>
|
||||
The company where the Yocto Project build system Poky was first developed.
|
||||
OpenedHand has since been acquired by Intel Corporation.</para></listitem>
|
||||
<listitem><para><emphasis>
|
||||
<ulink url='http://www.intel.com/'>Intel Corporation</ulink>:</emphasis>
|
||||
The company who acquired OpenedHand in 2008 and continues development on the
|
||||
The company that acquired OpenedHand in 2008 and continues development on the
|
||||
Yocto Project.</para></listitem>
|
||||
<listitem><para><emphasis>
|
||||
<ulink url='http://www.openembedded.org/'>OpenEmbedded</ulink>:</emphasis>
|
||||
<ulink url='&OE_HOME_URL;'>OpenEmbedded</ulink>:</emphasis>
|
||||
The upstream, generic, embedded distribution the Yocto Project build system (Poky) derives
|
||||
from and to which it contributes.</para></listitem>
|
||||
<listitem><para><emphasis>
|
||||
<ulink url='http://developer.berlios.de/projects/bitbake/'>
|
||||
Bitbake</ulink>:</emphasis> The tool used to process Yocto Project metadata.</para></listitem>
|
||||
BitBake</ulink>:</emphasis> The tool used to process Yocto Project metadata.</para></listitem>
|
||||
<listitem><para><emphasis>
|
||||
<ulink url='http://bitbake.berlios.de/manual/'>
|
||||
BitBake User Manual</ulink>:</emphasis> A comprehensive guide to the BitBake tool.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<appendix id='dev-manual-kernel-appendix'>
|
||||
|
||||
@@ -65,7 +66,7 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<imagedata fileref="figures/kernel-example-repos.png" width="7in" depth="5in"
|
||||
<imagedata fileref="figures/kernel-example-repos-edison.png" width="7in" depth="5in"
|
||||
align="center" scale="100" />
|
||||
</para>
|
||||
|
||||
@@ -75,9 +76,10 @@
|
||||
<listitem><para><emphasis>Local Yocto Project Files Git Repository:</emphasis>
|
||||
This area contains all the metadata that supports building images in the
|
||||
Yocto Project build environment - the local Yocto Project files.
|
||||
The local Yocto Project files Git repository also contains the build directory
|
||||
and a configuration directory that let you control the build.
|
||||
Note also that in this example, the repository also contains the
|
||||
In this example, the local Yocto Project files Git repository also
|
||||
contains the build directory, which contains the configuration directory
|
||||
that lets you control the build.
|
||||
In this example, the repository also contains the
|
||||
<filename>poky-extras</filename> Git repository.</para>
|
||||
<para>See the bulleted item
|
||||
"<link linkend='local-yp-release'>Yocto Project Release</link>"
|
||||
@@ -148,14 +150,14 @@
|
||||
$ git branch -a
|
||||
$ git tag -l
|
||||
</literallayout>
|
||||
This example uses the Yocto Project 1.1 Release code named "edison",
|
||||
which maps to the <filename>edison</filename> branch in the repository.
|
||||
The following commands create and checkout the local <filename>edison</filename>
|
||||
This example uses the Yocto Project &DISTRO; Release code named "&DISTRO_NAME;",
|
||||
which maps to the <filename>&DISTRO_NAME;</filename> branch in the repository.
|
||||
The following commands create and checkout the local <filename>&DISTRO_NAME;</filename>
|
||||
branch:
|
||||
<literallayout class='monospaced'>
|
||||
$ git checkout -b edison origin/edison
|
||||
Branch edison set up to track remote branch edison from origin.
|
||||
Switched to a new branch 'edison'
|
||||
$ git checkout -b &DISTRO_NAME; origin/&DISTRO_NAME;
|
||||
Branch &DISTRO_NAME; set up to track remote branch &DISTRO_NAME; from origin.
|
||||
Switched to a new branch '&DISTRO_NAME;'
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
@@ -171,13 +173,34 @@
|
||||
<filename>poky-extras</filename> Git Repository</link>"
|
||||
for information on how to get the <filename>poky-extras</filename> repository.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Once you have the repository set up,
|
||||
you have many development branches from which you can work.
|
||||
From inside the repository you can see the branch names and the tag names used
|
||||
in the Git repository using either of the following two commands:
|
||||
<literallayout class='monospaced'>
|
||||
$ cd poky/poky-extras
|
||||
$ git branch -a
|
||||
$ git tag -l
|
||||
</literallayout>
|
||||
This example uses the Yocto Project &DISTRO; Release code named "&DISTRO_NAME;",
|
||||
which maps to the <filename>&DISTRO_NAME;</filename> branch in the repository.
|
||||
The following commands create and checkout the local <filename>&DISTRO_NAME;</filename>
|
||||
branch:
|
||||
<literallayout class='monospaced'>
|
||||
$ git checkout -b &DISTRO_NAME; origin/&DISTRO_NAME;
|
||||
Branch &DISTRO_NAME; set up to track remote branch &DISTRO_NAME; from origin.
|
||||
Switched to a new branch '&DISTRO_NAME;'
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='setting-up-the-bare-clone-and-its-copy'>
|
||||
<title>Setting Up the Bare Clone and its Copy</title>
|
||||
|
||||
<para>
|
||||
This example modifies the <filename>linux-yocto-3.0</filename> kernel.
|
||||
This example modifies the <filename>linux-yocto-3.0-1.1.x</filename> kernel.
|
||||
Thus, you need to create a bare clone of that kernel and then make a copy of the
|
||||
bare clone.
|
||||
See the bulleted item
|
||||
@@ -189,13 +212,14 @@
|
||||
The bare clone exists for the kernel build tools and simply as the receiving end
|
||||
of <filename>git push</filename>
|
||||
commands after you make edits and commits inside the copy of the clone.
|
||||
The copy (<filename>linux-yocto-3.0</filename> in this example) has to have
|
||||
The copy (<filename>my-linux-yocto-3.0-1.1.x-work</filename> in this example) has to have
|
||||
a local branch created and checked out for your work.
|
||||
This example uses <filename>common-pc-base</filename> as the local branch.
|
||||
The following commands create and checkout the branch:
|
||||
<literallayout class='monospaced'>
|
||||
$ cd ~/linux-yocto-3.0
|
||||
$ cd ~/my-linux-yocto-3.0-1.1.x-work
|
||||
$ git checkout -b common-pc-base origin/yocto/standard/common-pc/base
|
||||
Checking out files: 100% (7289/7289), done.
|
||||
Branch common-pc-base set up to track remote branch
|
||||
yocto/standard/common-pc/base from origin.
|
||||
Switched to a new branch 'common-pc-base'
|
||||
@@ -221,12 +245,12 @@
|
||||
If your host development system supports multi-core and multi-thread capabilities,
|
||||
you can uncomment these statements and set the variables to significantly shorten
|
||||
the full build time.
|
||||
As a guideline, set <filename>BB_NUMBER_THREADS</filename> to twice the number
|
||||
of cores your machine supports and set <filename>PARALLEL_MAKE</filename> to one and
|
||||
a half times the number of cores your machine supports.
|
||||
As a guideline, set both <filename>BB_NUMBER_THREADS</filename> and
|
||||
<filename>PARALLEL_MAKE</filename> to twice the number
|
||||
of cores your machine supports.
|
||||
</note>
|
||||
The following two commands build the default <filename>qemux86</filename> image and
|
||||
<filename>source</filename> build environment setup script.
|
||||
The following two commands <filename>source</filename> the build environment setup script
|
||||
and build the default <filename>qemux86</filename> image.
|
||||
If necessary, the script creates the build directory:
|
||||
<literallayout class='monospaced'>
|
||||
$ cd ~/poky
|
||||
@@ -289,7 +313,7 @@
|
||||
|
||||
<para>
|
||||
The file you change in this example is named <filename>calibrate.c</filename>
|
||||
and is located in the <filename>linux-yocto-3.0</filename> Git repository
|
||||
and is located in the <filename>my-linux-yocto-3.0-1.1.x-work</filename> Git repository
|
||||
(the copy of the bare clone) in <filename>init</filename>.
|
||||
This example simply inserts several <filename>printk</filename> statements
|
||||
at the beginning of the <filename>calibrate_delay</filename> function.
|
||||
@@ -388,9 +412,8 @@
|
||||
build time if your host supports multi-core and multi-thread capabilities:
|
||||
<filename>BB_NUMBER_THREADS</filename> and <filename>PARALLEL_MAKE</filename>.
|
||||
If the host system has multiple cores then you can optimize build time
|
||||
by setting <filename>BB_NUMBER_THREADS</filename> to twice the number of
|
||||
cores and setting <filename>PARALLEL_MAKE</filename> to one and a half times the
|
||||
number of cores.</para></listitem>
|
||||
by setting both these variables to twice the number of
|
||||
cores.</para></listitem>
|
||||
<listitem><para><emphasis>Identify Your <filename>meta-kernel-dev</filename>
|
||||
Layer:</emphasis> The <filename>BBLAYERS</filename> variable in the
|
||||
<filename>bblayers.conf</filename> file found in the
|
||||
@@ -414,13 +437,13 @@
|
||||
<filename>poky-extras/meta-kernel-dev/recipes-kernel/linux</filename>
|
||||
directory, you need to identify the location of the
|
||||
local source code, which in this example is the bare clone named
|
||||
<filename>linux-yocto-3.0.git</filename>.
|
||||
<filename>linux-yocto-3.0-1.1.x.git</filename>.
|
||||
To do this, set the <filename>KSRC_linux_yocto</filename> variable to point to your
|
||||
local <filename>linux-yocto-3.0.git</filename> Git repository by adding the
|
||||
local <filename>linux-yocto-3.0-1.1.x.git</filename> Git repository by adding the
|
||||
following statement.
|
||||
Be sure to substitute your user information in the statement:
|
||||
<literallayout class='monospaced'>
|
||||
KSRC_linux_yocto ?= /home/scottrif/linux-yocto-3.0.git
|
||||
KSRC_linux_yocto ?= /home/scottrif/linux-yocto-3.0-1.1.x.git
|
||||
</literallayout></para></listitem>
|
||||
<listitem><para><emphasis>Specify the Kernel Machine:</emphasis> Also in the
|
||||
<filename>linux-yocto_3.0.bbappend</filename> file, you need to specify
|
||||
@@ -432,14 +455,19 @@
|
||||
</para>
|
||||
|
||||
<note>
|
||||
Before attempting to build the modified kernel, there is one more set of changes you
|
||||
<para>Before attempting to build the modified kernel, there is one more set of changes you
|
||||
need to make in the <filename>meta-kernel-dev</filename> layer.
|
||||
Because all the kernel <filename>.bbappend</filename> files are parsed during the
|
||||
build process regardless of whether you are using them or not, you should either
|
||||
comment out the <filename>COMPATIBLE_MACHINE</filename> statements in all
|
||||
<filename>.bbappend</filename> files, or you should simply remove all the files
|
||||
unused <filename>.bbappend</filename> files, or simply remove (or rename) all the files
|
||||
except the one your are using for the build
|
||||
(i.e. <filename>linux-yocto_3.0.bbappend</filename> in this example).
|
||||
(i.e. <filename>linux-yocto_3.0.bbappend</filename> in this example).</para>
|
||||
<para>If you do not make one of these two adjustments, your machine will be compatible
|
||||
with all the kernel recipes in the <filename>meta-kernel-dev</filename> layer.
|
||||
When your machine is comapatible with all the kernel recipes, the build attempts
|
||||
to build all kernels in the layer.
|
||||
You could end up with build errors blocking your work.</para>
|
||||
</note>
|
||||
</section>
|
||||
|
||||
@@ -453,18 +481,21 @@
|
||||
<listitem><para>Your environment should be set up since you previously sourced
|
||||
the <filename>oe-init-build-env</filename> script.
|
||||
If it isn't, source the script again from <filename>poky</filename>.
|
||||
</para></listitem>
|
||||
<listitem><para>Be sure old images are cleaned out by running the
|
||||
<filename>cleanall</filename> BitBake task as follows:
|
||||
<literallayout class='monospaced'>
|
||||
$ cd ~/poky
|
||||
$ source oe-init-build-env
|
||||
</literallayout>
|
||||
</para></listitem>
|
||||
<listitem><para>Be sure old images are cleaned out by running the
|
||||
<filename>cleanall</filename> BitBake task as follows from your build directory:
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake -c cleanall linux-yocto
|
||||
</literallayout></para>
|
||||
<para><note>Never remove any files by hand from the <filename>tmp/deploy</filename>
|
||||
directory insided the local Yocto Project files build directory.
|
||||
Always use the BitBake <filename>cleanall</filename> task to clear
|
||||
out previous builds.</note></para></listitem>
|
||||
<listitem><para>Build the kernel image using this command:
|
||||
<listitem><para>Next, build the kernel image using this command:
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake -k core-image-minimal
|
||||
</literallayout></para></listitem>
|
||||
@@ -508,50 +539,98 @@
|
||||
in "<link linkend='modifying-the-kernel-source-code'>Modifying the Kernel Source
|
||||
Code</link>" you should already have the Yocto Project files set up on your
|
||||
host machine.
|
||||
If this is the case, go to the next section, which is titled
|
||||
"<link linkend='examining-the-default-config-smp-behavior'>Examining the Default
|
||||
<filename>CONFIG_SMP</filename> Behavior</link>", and continue with the
|
||||
example.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If you don't have the Yocto Project files established on your system,
|
||||
See "<link linkend='setting-up-the-local-yocto-project-files-git-repository'>Setting
|
||||
Up the Local Yocto Project Files Git Repository</link>" for
|
||||
information.
|
||||
To reconfigure the kernel, this is the only Git repository you need to have set up.
|
||||
you can get them through tarball extraction or by
|
||||
cloning the <filename>poky</filename> Git repository.
|
||||
This example uses <filename>poky</filename> as the root directory of the
|
||||
local Yocto Project files Git repository.
|
||||
See the bulleted item
|
||||
"<link linkend='local-yp-release'>Yocto Project Release</link>"
|
||||
for information on how to get these files.
|
||||
</para>
|
||||
|
||||
<!--
|
||||
<para>
|
||||
Once you have the repository set up,
|
||||
you have many development branches from which you can work.
|
||||
From inside the repository you can see the branch names and the tag names used
|
||||
in the Git repository using either of the following two commands:
|
||||
<literallayout class='monospaced'>
|
||||
$ cd poky
|
||||
$ git branch -a
|
||||
$ git tag -l
|
||||
</literallayout>
|
||||
This example uses the Yocto Project &DISTRO; Release code named "&DISTRO_NAME;",
|
||||
which maps to the <filename>&DISTRO_NAME;</filename> branch in the repository.
|
||||
The following commands create and checkout the local <filename>&DISTRO_NAME;</filename>
|
||||
branch:
|
||||
<literallayout class='monospaced'>
|
||||
$ git checkout -b &DISTRO_NAME; origin/&DISTRO_NAME;
|
||||
Branch &DISTRO_NAME; set up to track remote branch &DISTRO_NAME; from origin.
|
||||
Switched to a new branch '&DISTRO_NAME;'
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If you took the time to work through the example that modifies the kernel source code
|
||||
in "<link linkend='modifying-the-kernel-source-code'>Modifying the Kernel Source
|
||||
Code</link>" you are already set up to quickly work through this example.
|
||||
If not, then work through the following list to prepare:
|
||||
<itemizedlist>
|
||||
<listitem><para><emphasis>Understand the development environment:</emphasis>
|
||||
See "<link linkend='understanding-the-files-you-need'>Understanding
|
||||
the Files You Need</link>" for information.</para></listitem>
|
||||
<listitem><para><emphasis>Set up the local Yocto Project files Git
|
||||
repository:</emphasis>
|
||||
See "<link linkend='setting-up-the-local-yocto-project-files-git-repository'>Setting
|
||||
Up the Local Yocto Project Files Git Repository</link>" for
|
||||
information.</para></listitem>
|
||||
<listitem><para><emphasis>Set up the <filename>poky-extras</filename> Git
|
||||
repository:</emphasis>
|
||||
See "<link linkend='setting-up-the-poky-extras-git-repository'>Setting
|
||||
Up <filename>poky-extras</filename> Git repository</link>" for
|
||||
information.</para></listitem>
|
||||
<listitem><para><emphasis>Set up the the bare clone and its copy:</emphasis>
|
||||
See "<link linkend='setting-up-the-bare-clone-and-its-copy'>Setting Up the
|
||||
Bare Clone and its Copy</link>" for information.</para></listitem>
|
||||
<listitem><para><emphasis>Build the default QEMU kernel image:</emphasis>
|
||||
See "<link linkend='building-and-booting-the-default-qemu-kernel-image'>Building
|
||||
and Booting the Default QEMU Kernel image</link>" for information.
|
||||
Do not boot the image in the QEMU emulator at this point.</para></listitem>
|
||||
</itemizedlist>
|
||||
</para> -->
|
||||
Next, you need to build the default <filename>qemux86</filename> image that you
|
||||
can boot using QEMU.
|
||||
<note>
|
||||
Because a full build can take hours, you should check two variables in the
|
||||
<filename>build</filename> directory that is created after you source the
|
||||
<filename>oe-init-build-env</filename> script.
|
||||
You can find these variables
|
||||
<filename>BB_NUMBER_THREADS</filename> and <filename>PARALLEL_MAKE</filename>
|
||||
in the <filename>build/conf</filename> directory in the
|
||||
<filename>local.conf</filename> configuration file.
|
||||
By default, these variables are commented out.
|
||||
If your host development system supports multi-core and multi-thread capabilities,
|
||||
you can uncomment these statements and set the variables to significantly shorten
|
||||
the full build time.
|
||||
As a guideline, set <filename>BB_NUMBER_THREADS</filename> to twice the number
|
||||
of cores your machine supports and set <filename>PARALLEL_MAKE</filename> to one and
|
||||
a half times the number of cores your machine supports.
|
||||
</note>
|
||||
The following two commands <filename>source</filename> the build environment setup script
|
||||
and build the default <filename>qemux86</filename> image.
|
||||
If necessary, the script creates the build directory:
|
||||
<literallayout class='monospaced'>
|
||||
$ cd ~/poky
|
||||
$ source oe-init-build-env
|
||||
|
||||
### Shell environment set up for builds. ###
|
||||
|
||||
You can now run 'bitbake <target>'
|
||||
|
||||
Common targets are:
|
||||
core-image-minimal
|
||||
core-image-sato
|
||||
meta-toolchain
|
||||
meta-toolchain-sdk
|
||||
adt-installer
|
||||
meta-ide-support
|
||||
|
||||
You can also run generated qemu images with a command like 'runqemu qemux86'
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The following <filename>bitbake</filename> command starts the build:
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake -k core-image-minimal
|
||||
</literallayout>
|
||||
<note>Be sure to check the settings in the <filename>local.conf</filename>
|
||||
before starting the build.</note>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='examining-the-default-config-smp-behavior'>
|
||||
<title>Examining the Default <filename>CONFIG_SMP</filename> Behavior</title>
|
||||
<title>Examining the Default <filename>CONFIG_SMP</filename> Behavior</title>
|
||||
|
||||
<para>
|
||||
By default, <filename>CONFIG_SMP</filename> supports single processor machines.
|
||||
@@ -577,8 +656,10 @@
|
||||
</para>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section id='changing-the-config-smp-configuration-using-menuconfig'>
|
||||
<title>Changing the <filename>CONFIG_SMP</filename> Configuration Using <filename>menuconfig</filename></title>
|
||||
<title>Changing the <filename>CONFIG_SMP</filename> Configuration Using <filename>menuconfig</filename></title>
|
||||
|
||||
<para>
|
||||
The <filename>menuconfig</filename> tool provides an interactive method with which
|
||||
@@ -596,15 +677,24 @@
|
||||
<para>
|
||||
After setting up the environment to run <filename>menuconfig</filename>, you are ready
|
||||
to use the tool to interactively change the kernel configuration.
|
||||
In this example, we are basing our changes on the <filename>linux-yocto-3.0</filename>
|
||||
In this example, we are basing our changes on the <filename>linux-yocto-3.0-1.1.x</filename>
|
||||
kernel.
|
||||
The Yocto Project build environment recognizes this kernel as
|
||||
<filename>linux-yocto</filename>.
|
||||
Thus, the following command from the shell in which you previously sourced the
|
||||
environment initialization script launches <filename>menuconfig</filename>:
|
||||
Thus, the following commands from the shell in which you previously sourced the
|
||||
environment initialization script cleans the shared state memory and
|
||||
the <filename>WORKDIR</filename> direcotry and then builds and
|
||||
launches <filename>menuconfig</filename>:
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake linux-yocto -c cleansstate
|
||||
$ bitbake linux-yocto -c menuconfig
|
||||
</literallayout>
|
||||
<note>Due to a bug in the release, it is necessary to clean the shared state
|
||||
memory in order for configurations made using <filename>menuconfig</filename>
|
||||
to take effect.
|
||||
For information on the bug, see
|
||||
<ulink url='&YOCTO_BUGZILLA_URL;/show_bug.cgi?id=2256'></ulink>.
|
||||
</note>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -622,16 +712,19 @@
|
||||
is updated.
|
||||
This is the file that the build system uses to configure the Linux Yocto kernel
|
||||
when it is built.
|
||||
You can find and examine this file in the Yocto Project files Git repository in
|
||||
You can find and examine this file in the Yocto Project Files Git repository in
|
||||
the build directory.
|
||||
This example uses the following.
|
||||
Note that this example directory is artificially split and many of the characters
|
||||
in the actually filename are omitted in order to make it more
|
||||
readable:
|
||||
This example uses the following:
|
||||
<literallayout class='monospaced'>
|
||||
~/poky/build/tmp/work/qemux86-poky-linux/linux-yocto-2.6.37+git1+84f...
|
||||
...r20/linux-qemux86-standard-build
|
||||
~/poky/build/tmp/work/qemux86-poky-linux/linux-yocto-3.0.10+git1+d38...
|
||||
...3a9ac596f7a-r3/linux-qemux86-standard-build
|
||||
</literallayout>
|
||||
<note>
|
||||
The previous example directory is artificially split and many of the characters
|
||||
in the actual filename are omitted in order to make it more readable.
|
||||
Also, depending on the kernel you are using, the exact pathname might differ
|
||||
slightly.
|
||||
</note>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<chapter id='dev-manual-model'>
|
||||
|
||||
@@ -23,9 +24,8 @@
|
||||
"<link linkend='dev-manual-kernel-appendix'>Kernel Modification Example</link>" appendix.
|
||||
For a user-space application development example that uses the
|
||||
<trademark class='trade'>Eclipse</trademark> IDE,
|
||||
see the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/adt-manual/adt-manual.html'>
|
||||
The Yocto Project Application Development Toolkit (ADT) User's Guide</ulink>.
|
||||
see <ulink url='&YOCTO_DOCS_ADT_URL;'>The Yocto Project Application Development
|
||||
Toolkit (ADT) User's Guide</ulink>.
|
||||
</para>
|
||||
|
||||
<section id='system-development-model'>
|
||||
@@ -35,8 +35,8 @@
|
||||
System development involves modification or creation of an image that you want to run on
|
||||
a specific hardware target.
|
||||
Usually, when you want to create an image that runs on embedded hardware, the image does
|
||||
not require the same amount of features that a full-fledged Linux distribution provides.
|
||||
Thus, you can create a much smaller image that is designed to just use the hardware
|
||||
not require the same number of features that a full-fledged Linux distribution provides.
|
||||
Thus, you can create a much smaller image that is designed to use only the hardware
|
||||
features for your particular hardware.
|
||||
</para>
|
||||
|
||||
@@ -50,8 +50,8 @@
|
||||
<title>Developing a Board Support Package (BSP)</title>
|
||||
|
||||
<para>
|
||||
A BSP is a package of recipes that, when applied, during a build results in
|
||||
an image you can run on a particular board.
|
||||
A BSP is a packageof recipes that, when applied, during a build results in
|
||||
an image that you can run on a particular board.
|
||||
Thus, the package, when compiled into the new image, supports the operation of the board.
|
||||
</para>
|
||||
|
||||
@@ -61,8 +61,8 @@
|
||||
</note>
|
||||
|
||||
<para>
|
||||
The remainder of this section presents the basic steps to create a BSP basing it on an
|
||||
existing BSP that ships with the Yocto Project.
|
||||
The remainder of this section presents the basic steps used to create a BSP
|
||||
based on an existing BSP that ships with the Yocto Project.
|
||||
You can reference the "<link linkend='dev-manual-bsp-appendix'>BSP Development Example</link>"
|
||||
appendix for a detailed example that uses the Crown Bay BSP as a base BSP from which to start.
|
||||
</para>
|
||||
@@ -79,18 +79,19 @@
|
||||
<orderedlist>
|
||||
<listitem><para><emphasis>Set up your host development system to support
|
||||
development using the Yocto Project</emphasis>: See the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html#the-linux-distro'>The Linux Distributions</ulink>" and the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html#packages'>The Packages</ulink>" sections both
|
||||
"<ulink url='&YOCTO_DOCS_QS_URL;#the-linux-distro'>The Linux Distributions</ulink>"
|
||||
and the
|
||||
"<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Packages</ulink>" sections both
|
||||
in the Yocto Project Quick Start for requirements.</para></listitem>
|
||||
<listitem><para><emphasis>Establish a local copy of the Yocto Project files on your
|
||||
system</emphasis>: You need to have the Yocto Project files available on your host system.
|
||||
Having the Yocto Project files on your system gives you access to the build
|
||||
process and tools you need.
|
||||
process and to the tools you need.
|
||||
For information on how to get these files, see the
|
||||
"<link linkend='getting-setup'>Getting Setup</link>" section.</para></listitem>
|
||||
<listitem><para><emphasis>Establish a local copy of the base BSP files</emphasis>: Having
|
||||
the BSP files on your system gives you access to the build
|
||||
process and tools you need for creating a BSP.
|
||||
process and to the tools you need for creating a BSP.
|
||||
For information on how to get these files, see the
|
||||
"<link linkend='getting-setup'>Getting Setup</link>" section.</para></listitem>
|
||||
<listitem><para><emphasis>Choose a Yocto Project-supported BSP as your base BSP</emphasis>:
|
||||
@@ -111,13 +112,15 @@
|
||||
Crown Bay that does not support the <trademark class='registered'>Intel</trademark>
|
||||
Embedded Media Graphics Driver (EMGD).
|
||||
The remainder of this example uses that base BSP.</para>
|
||||
<para>To see the supported BSPs, go to the Yocto Project
|
||||
<ulink url='http://www.yoctoproject.org/download'>download page</ulink> and click
|
||||
on “BSP Downloads.”</para></listitem>
|
||||
<para>To see the supported BSPs, go to the
|
||||
<ulink url='&YOCTO_HOME_URL;/download'>Download</ulink> page on the Yocto Project
|
||||
website and click on “BSP Downloads.”</para></listitem>
|
||||
<listitem><para><emphasis>Create your own BSP layer</emphasis>: Layers are ideal for
|
||||
isolating and storing work for a given piece of hardware.
|
||||
A layer is really just a location or area in which you place the recipes for your BSP.
|
||||
A layer is really just a location or area in which you place the recipes for your BSP.
|
||||
In fact, a BSP is, in itself, a special type of layer.
|
||||
</para>
|
||||
<para>
|
||||
Another example that illustrates a layer is an application.
|
||||
Suppose you are creating an application that has library or other dependencies in
|
||||
order for it to compile and run.
|
||||
@@ -137,16 +140,17 @@
|
||||
N450, and Sugar Bay are isolated.</note>
|
||||
<para>When you set up a layer for a new BSP, you should follow a standard layout.
|
||||
This layout is described in the section
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/bsp-guide/bsp-guide.html#bsp-filelayout'>Example Filesystem Layout</ulink>" section of the Board Support Package (BSP) Development Guide.
|
||||
"<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-filelayout'>Example Filesystem Layout</ulink>"
|
||||
section of the Board Support Package (BSP) Development Guide.
|
||||
In the standard layout, you will notice a suggested structure for recipes and
|
||||
configuration information.
|
||||
You can see the standard layout for the Crown Bay BSP in this example by examining the
|
||||
directory structure of the <filename>meta-crownbay</filename> layer inside the
|
||||
local Yocto Project files.</para></listitem>
|
||||
<listitem><para><emphasis>Make configuration changes to your new BSP
|
||||
layer</emphasis>: The standard BSP layer structure organizes the files you need to edit in
|
||||
<filename>conf</filename> and several <filename>recipes-*</filename> directories within the
|
||||
BSP layer.
|
||||
layer</emphasis>: The standard BSP layer structure organizes the files you need
|
||||
to edit in <filename>conf</filename> and several <filename>recipes-*</filename>
|
||||
directories within the BSP layer.
|
||||
Configuration changes identify where your new layer is on the local system
|
||||
and identify which kernel you are going to use.
|
||||
</para></listitem>
|
||||
@@ -160,7 +164,8 @@
|
||||
You need to get the build environment ready by sourcing an environment setup script
|
||||
and you need to be sure two key configuration files are configured appropriately.</para>
|
||||
<para>The entire process for building an image is overviewed in the section
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html#building-image'>Building an Image</ulink>" section of the Yocto Project Quick Start.
|
||||
"<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>" section
|
||||
of the Yocto Project Quick Start.
|
||||
You might want to reference this information.</para></listitem>
|
||||
<listitem><para><emphasis>Build the image</emphasis>: The Yocto Project uses the BitBake
|
||||
tool to build images based on the type of image you want to create.
|
||||
@@ -168,9 +173,9 @@
|
||||
<ulink url='http://bitbake.berlios.de/manual/'>here</ulink>.</para>
|
||||
<para>The build process supports several types of images to satisfy different needs.
|
||||
See the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html#ref-images'>Reference: Images</ulink>" appendix in the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html'>
|
||||
Yocto Project Reference Manual</ulink>for information on supported images.</para></listitem>
|
||||
"<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Reference: Images</ulink>" appendix
|
||||
in The Yocto Project Reference Manual for information on
|
||||
supported images.</para></listitem>
|
||||
</orderedlist>
|
||||
</para>
|
||||
|
||||
@@ -178,10 +183,10 @@
|
||||
You can view a video presentation on "Building Custom Embedded Images with Yocto"
|
||||
at <ulink url='http://free-electrons.com/blog/elc-2011-videos'>Free Electrons</ulink>.
|
||||
You can also find supplemental information in
|
||||
<ulink url='http://yoctoproject.org/docs/1.1/bsp-guide/bsp-guide.html'>
|
||||
<ulink url='&YOCTO_DOCS_BSP_URL;'>
|
||||
The Board Support Package (BSP) Development Guide</ulink>.
|
||||
Finally, there is wiki page write up of the example also located
|
||||
<ulink url='https://wiki.yoctoproject.org/wiki/Transcript:_creating_one_generic_Atom_BSP_from_another'>
|
||||
<ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_creating_one_generic_Atom_BSP_from_another'>
|
||||
here</ulink> that you might find helpful.
|
||||
</para>
|
||||
</section>
|
||||
@@ -191,7 +196,7 @@
|
||||
|
||||
<para>
|
||||
Kernel modification involves changing the Linux Yocto kernel, which could involve changing
|
||||
configuration variables as well as adding new kernel recipes.
|
||||
configuration options as well as adding new kernel recipes.
|
||||
Configuration changes can be added in the form of configuration fragments, while recipe
|
||||
modification comes through the kernel's <filename>recipes-kernel</filename> area
|
||||
in a kernel layer you create.
|
||||
@@ -201,7 +206,7 @@
|
||||
The remainder of this section presents a high-level overview of the Linux Yocto
|
||||
kernel architecture and the steps to modify the Linux Yocto kernel.
|
||||
For a complete discussion of the kernel, see
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/kernel-manual/kernel-manual.html'>
|
||||
<ulink url='&YOCTO_DOCS_KERNEL_URL;'>
|
||||
The Yocto Project Kernel Architecture and Use Manual</ulink>.
|
||||
You can reference the appendix
|
||||
"<link linkend='dev-manual-kernel-appendix'>Kernel Modification Example</link>"
|
||||
@@ -212,35 +217,41 @@
|
||||
<title>Kernel Overview</title>
|
||||
|
||||
<para>
|
||||
When one thinks of the source files for a kernel they usually think of a fixed structure
|
||||
of files that contain kernel patches.
|
||||
The Yocto Project, however, employs mechanisims, that in a sense, result in a kernel source
|
||||
Traditionally, when one thinks of a patched kernel, they think of a base kernel
|
||||
source tree and a fixed structure that contains kernel patches.
|
||||
The Yocto Project, however, employs mechanisms, that in a sense, result in a kernel source
|
||||
generator.
|
||||
By the end of this section, this analogy will become clearer.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
You can find a web interface to the Linux Yocto kernel source repositories at
|
||||
<ulink url='http://git.yoctoproject.org/'></ulink>.
|
||||
<ulink url='&YOCTO_GIT_URL;'></ulink>.
|
||||
If you look at the interface, you will see to the left a grouping of
|
||||
Git repositories titled "Yocto Linux Kernel."
|
||||
Within this group, you will find the four different kernels supported by
|
||||
Within this group, you will find several kernels supported by
|
||||
the Yocto Project:
|
||||
<itemizedlist>
|
||||
<listitem><para><emphasis><filename>linux-yocto-2.6.34</filename></emphasis> - The
|
||||
stable Linux Yocto kernel that is based on the Linux 2.6.34 release.</para></listitem>
|
||||
<listitem><para><emphasis><filename>linux-yocto-2.6.37</filename></emphasis> - The
|
||||
stable Linux Yocto kernel that is based on the Linux 2.6.37 release.</para></listitem>
|
||||
<listitem><para><emphasis><filename>linux-yocto-3.0</filename></emphasis> - The current
|
||||
<listitem><para><emphasis><filename>linux-yocto-3.0</filename></emphasis> - The stable
|
||||
Linux Yocto kernel that is based on the Linux 3.0 release.</para></listitem>
|
||||
<listitem><para><emphasis><filename>linux-yocto-3.0-1.1.x</filename></emphasis> - The
|
||||
stable Linux Yocto kernel to use with the Yocto Project Release 1.1.x. This kernel
|
||||
is based on the Linux 3.0 release</para></listitem>
|
||||
<listitem><para><emphasis><filename>linux-yocto-3.2</filename></emphasis> - The
|
||||
stable Linux Yocto kernel to use with the Yocto Project Release 1.2. This kernel
|
||||
is based on the Linux 3.2 release</para></listitem>
|
||||
<listitem><para><emphasis><filename>linux-yocto-dev</filename></emphasis> - A development
|
||||
kernel based on the latest upstream release candidate available.</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The kernels are maintained using the Git application that, in a sense, structures
|
||||
them in a "tree" complete with branches and leaves.
|
||||
The kernels are maintained using the Git revision control system
|
||||
that structures them using the familiar "tree", "branch", and "leaf" scheme.
|
||||
Branches represent diversions from general code to more specific code, while leaves
|
||||
represent the end-points for a complete and unique kernel whose source files
|
||||
when gathered from the root of the tree to the leaf accumulate to create the files
|
||||
@@ -253,7 +264,7 @@
|
||||
|
||||
<para>
|
||||
Within the figure, the "Kernel.org Branch Point" represents the point in the tree
|
||||
where a supported base kernel diverges from the Linux kernel.
|
||||
where a supported base kernel is modified from the Linux kernel.
|
||||
For example, this could be the branch point for the <filename>linux-yocto-3.0</filename>
|
||||
kernel.
|
||||
Thus, everything further to the right in the structure is based on the
|
||||
@@ -267,14 +278,14 @@
|
||||
|
||||
<para>
|
||||
The overall result is a Git-maintained repository from which all the supported
|
||||
Yocto Project kernels can be derived for all the supported Yocto Project devices.
|
||||
Yocto Project kernel types can be derived for all the supported Yocto Project devices.
|
||||
A big advantage to this scheme is the sharing of common features by keeping them in
|
||||
"larger" branches within the tree.
|
||||
This practice eliminates redundant storage of similar features shared among kernels.
|
||||
</para>
|
||||
|
||||
<note>
|
||||
Keep in mind the figure does not take into account all four supported Linux Yocto
|
||||
Keep in mind the figure does not take into account all the supported Linux Yocto
|
||||
kernel types, but rather shows a single generic kernel just for conceptual purposes.
|
||||
Also keep in mind that this structure represents the Yocto Project source repositories
|
||||
that are either pulled from during the build or established on the host development system
|
||||
@@ -311,7 +322,7 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<imagedata fileref="figures/kernel-overview-3.png"
|
||||
<imagedata fileref="figures/kernel-overview-3-edison.png"
|
||||
width="6in" depth="4in" align="center" scale="100" />
|
||||
</para>
|
||||
|
||||
@@ -349,11 +360,11 @@
|
||||
<para>
|
||||
Again, for a complete discussion of the Yocto Project kernel's architcture and its
|
||||
branching strategy,
|
||||
see the <ulink url='http://www.yoctoproject.org/docs/1.1/kernel-manual/kernel-manual.html'>
|
||||
see <ulink url='&YOCTO_DOCS_KERNEL_URL;'>
|
||||
The Yocto Project Kernel Architecture and Use Manual</ulink>.
|
||||
Also, you can reference
|
||||
<xref linkend='modifying-the-kernel-source-code'>Modifying the Kernel Source Code</xref>
|
||||
for a detailed example that modifies the kernel.
|
||||
You can also reference the
|
||||
"<link linkend='modifying-the-kernel-source-code'>Modifying the Kernel Source Code</link>"
|
||||
section for a detailed example that modifies the kernel.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -373,8 +384,8 @@
|
||||
<orderedlist>
|
||||
<listitem><para><emphasis>Set up your host development system to support
|
||||
development using the Yocto Project</emphasis>: See
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html#the-linux-distro'>The Linux Distributions</ulink>" and
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html#packages'>The Packages</ulink>" sections both
|
||||
"<ulink url='&YOCTO_DOCS_QS_URL;#the-linux-distro'>The Linux Distributions</ulink>" and
|
||||
"<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Packages</ulink>" sections both
|
||||
in the Yocto Project Quick Start for requirements.</para></listitem>
|
||||
<listitem><para><emphasis>Establish a local copy of the Yocto Project files on your
|
||||
system</emphasis>: Having the Yocto Project files on your system gives you access to
|
||||
@@ -390,7 +401,10 @@
|
||||
Project files Git repository.
|
||||
For information on how to get these files, see the bulleted item
|
||||
"<link linkend='poky-extras-repo'>The <filename>poky-extras</filename> Git Repository</link>"
|
||||
earlier in this manual.</para></listitem>
|
||||
earlier in this manual.
|
||||
<note>While it is certainly possible to modify the kernel without involving
|
||||
a local Git repository, the suggested workflow for kernel modification
|
||||
using the Yocto Project does use a Git repository.</note></para></listitem>
|
||||
<listitem><para><emphasis>Establish a local copy of the Linux Yocto kernel files on your
|
||||
system</emphasis>: In order to make modifications to the kernel you need two things:
|
||||
a bare clone of the Linux Yocto kernel you are modifying and
|
||||
@@ -412,7 +426,7 @@
|
||||
Once the changes are made, you need to use Git commands to commit the changes
|
||||
and then push them to the bare clone.</para></listitem>
|
||||
<listitem><para><emphasis>Make kernel configuration changes
|
||||
to your local kernel layer if applicable</emphasis>:
|
||||
if applicable</emphasis>:
|
||||
If your situation calls for changing the kernel's configuration, you can
|
||||
use <filename>menuconfig</filename>
|
||||
to enable and disable kernel configurations.
|
||||
@@ -420,11 +434,18 @@
|
||||
configuration changes you are making to the kernel.
|
||||
When saved, changes using <filename>menuconfig</filename> update the kernel's
|
||||
<filename>.config</filename>.
|
||||
As an alternative method to changing the kernel's configuration, you can simply
|
||||
edit the <filename>.config</filename> found in the Yocto Project build
|
||||
directory at <filename>tmp/sysroots/<machine-name>/kernel</filename>
|
||||
directly.</para></listitem>
|
||||
<listitem><para><emphasis>Add new kernel recipes if applicable</emphasis>: The standard
|
||||
Try to resist the temptation of directly editing the <filename>.config</filename>
|
||||
file found in the Yocto Project build directory at
|
||||
<filename>tmp/sysroots/<machine-name>/kernel</filename>.
|
||||
Doing so, can produce unexpected results when the Yocto Project build system
|
||||
regenerates the configuration file.</para>
|
||||
<para>Once you are satisfied with the configuration changes made using
|
||||
<filename>menuconfig</filename>, you can directly examine the
|
||||
<filename>.config</filename> file against a saved original and gather those
|
||||
changes into a config fragment to be referenced from within the kernel's
|
||||
<filename>.bbappend</filename> file.</para></listitem>
|
||||
<listitem><para><emphasis>Add or extend kernel recipes if applicable</emphasis>:
|
||||
The standard
|
||||
layer structure organizes recipe files inside the
|
||||
<filename>meta-kernel-dev</filename> layer that is within the
|
||||
<filename>poky-extras</filename> Git repository.
|
||||
@@ -436,14 +457,15 @@
|
||||
<listitem><para><emphasis>Prepare for the build</emphasis>: Once you have made all the
|
||||
changes to your kernel (configurations, source code changes, recipe additions,
|
||||
or recipe changes), there remains a few things
|
||||
you need to do in order for the Yocto Project build system to create your image.
|
||||
you need to do in order for the Yocto Project build system (BitBake) to create your image.
|
||||
If you have not done so, you need to get the build environment ready by sourcing
|
||||
the environment setup script described earlier.
|
||||
You also need to be sure two key configuration files
|
||||
(<filename>local.conf</filename> and <filename>bblayers.conf</filename>)
|
||||
are configured appropriately.</para>
|
||||
<para>The entire process for building an image is overviewed in the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html#building-image'>Building an Image</ulink>" section of the Yocto Project Quick Start.
|
||||
"<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>"
|
||||
section of the Yocto Project Quick Start.
|
||||
You might want to reference this information.
|
||||
Also, you should look at the detailed examples found in the appendices at
|
||||
at the end of this manual.</para></listitem>
|
||||
@@ -454,10 +476,8 @@
|
||||
<ulink url='http://bitbake.berlios.de/manual/'>here</ulink>.</para>
|
||||
<para>The build process supports several types of images to satisfy different needs.
|
||||
See the appendix
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html#ref-images'>Reference: Images</ulink>" in the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html'>
|
||||
Yocto Project Reference Manual</ulink> for information on supported
|
||||
images.</para></listitem>
|
||||
"<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Reference: Images</ulink>" in
|
||||
The Yocto Project Reference Manual for information on supported images.</para></listitem>
|
||||
<listitem><para><emphasis>Make your configuration changes available
|
||||
in the kernel layer</emphasis>: Up to this point, all the configuration changes to the
|
||||
kernel have been done and tested iteratively.
|
||||
@@ -465,10 +485,10 @@
|
||||
which allows you to distribute the layer.</para></listitem>
|
||||
<listitem><para><emphasis>If applicable, share your in-tree changes</emphasis>:
|
||||
If the changes you made
|
||||
are suited for all Linux Yocto users, you might want to push the changes to a
|
||||
contribution area for the Linux Yocto Git repository.
|
||||
Once the changes are pushed, you can request that they
|
||||
be pulled into the master branch of the kernel tree.
|
||||
are suited for all Linux Yocto users, you might want to send them on for inclusion
|
||||
into the Linux Yocto Git repository.
|
||||
If the changes are accepted, the Yocto Project Maintainer pulls them into
|
||||
the master branch of the kernel tree.
|
||||
Doing so makes them available to everyone using the kernel.</para></listitem>
|
||||
</orderedlist>
|
||||
</para>
|
||||
@@ -507,7 +527,7 @@
|
||||
provides an overview of the general development process.
|
||||
If you want to see a detailed example of the process as it is used from within the Eclipse
|
||||
IDE, see
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/adt-manual/adt-manual.html'>
|
||||
<ulink url='&YOCTO_DOCS_ADT_URL;'>
|
||||
The Application Development Toolkit (ADT) User's Manual</ulink>.
|
||||
</para>
|
||||
|
||||
@@ -524,8 +544,8 @@
|
||||
<orderedlist>
|
||||
<listitem><para><emphasis>Prepare the Host System for the Yocto Project</emphasis>:
|
||||
See
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html#the-linux-distro'>The Linux Distributions</ulink>" and
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html#packages'>The Packages</ulink>" sections both
|
||||
"<ulink url='&YOCTO_DOCS_QS_URL;#the-linux-distro'>The Linux Distributions</ulink>" and
|
||||
"<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Packages</ulink>" sections both
|
||||
in the Yocto Project Quick Start for requirements.</para></listitem>
|
||||
|
||||
<!--
|
||||
@@ -550,15 +570,15 @@ WRITER NOTE: The areas to get the kernel and root filesystem are located in the
|
||||
You must have a target kernel image that has been built using the Yocto Project.</para>
|
||||
<para>Depending on whether the Yocto Project has a pre-built image that matches your target
|
||||
architecture and where you are going to run the image while you develop your application
|
||||
(QEMU or real hardware), the area you get the image from differs.
|
||||
(QEMU or real hardware), the area from which you get the image differs.
|
||||
<itemizedlist>
|
||||
<listitem><para>Download the image from
|
||||
<ulink url='http://www.yoctoproject.org/downloads/yocto-1.1/machines/'>
|
||||
<ulink url='&YOCTO_MACHINES_DL_URL;'>
|
||||
<filename>machines</filename></ulink> if your target architecture is supported
|
||||
and you are going to develop and test your application on actual hardware.
|
||||
</para></listitem>
|
||||
<listitem><para>Download the image from the
|
||||
<ulink url='http://www.yoctoproject.org/downloads/yocto-1.1/machines/qemu/'>
|
||||
<ulink url='&YOCTO_QEMU_DL_URL;'>
|
||||
<filename>machines/qemu</filename></ulink> if your target architecture is supported
|
||||
and you are going to develop and test your application using the QEMU
|
||||
emulator.</para></listitem>
|
||||
@@ -573,10 +593,8 @@ WRITER NOTE: The areas to get the kernel and root filesystem are located in the
|
||||
</itemizedlist></para>
|
||||
<para>For information on pre-built kernel image naming schemes for images
|
||||
that can run on the QEMU emulator, see the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html#using-pre-built'>Using Pre-Built Binaries and QEMU</ulink>"
|
||||
section in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html'>
|
||||
The Yocto Project Quick Start</ulink>.</para></listitem>
|
||||
"<ulink url='&YOCTO_DOCS_QS_URL;#using-pre-built'>Using Pre-Built Binaries and QEMU</ulink>"
|
||||
section in the Yocto Project Quick Start.</para></listitem>
|
||||
<listitem><para><emphasis>Install the ADT</emphasis>:
|
||||
The ADT provides a target-specific cross-development toolchain, the root filesystem,
|
||||
the QEMU emulator, and other tools that can help you develop your application.
|
||||
@@ -584,9 +602,9 @@ WRITER NOTE: The areas to get the kernel and root filesystem are located in the
|
||||
easy method.
|
||||
You can get these pieces by running an ADT installer script, which is configurable.
|
||||
For information on how to install the ADT, see the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/adt-manual/adt-manual.html#using-the-adt-installer'>Using the ADT Installer</ulink>" section in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/adt-manual/adt-manual.html'>The Yocto Project
|
||||
Application Development (ADT) User's Manual</ulink>.</para></listitem>
|
||||
"<ulink url='&YOCTO_DOCS_ADT_URL;#using-the-adt-installer'>Using the ADT Installer</ulink>"
|
||||
section
|
||||
in the Yocto Project Application Development (ADT) User's Manual.</para></listitem>
|
||||
<listitem><para><emphasis>If Applicable, Secure the Target Root Filesystem</emphasis>:
|
||||
If you choose not to install the ADT using the ADT Installer,
|
||||
you need to find and download the
|
||||
@@ -630,14 +648,14 @@ WRITER NOTE: The areas to get the kernel and root filesystem are located in the
|
||||
<orderedlist>
|
||||
<listitem><para><emphasis>Install the cross-development toolchain for your target hardware:</emphasis>
|
||||
For information on how to install the toolchain, see the
|
||||
"<ulink url='http://www.yoctoproject/docs/1.1/adt-manual/adt-manual.html#using-an-existing-toolchain-tarball'>Using a Cross-Toolchain Tarball</ulink>" section in
|
||||
<ulink url='http://www.yoctoproject/docs/1.1/adt-manual/adt-manual.html'>The Yocto Project
|
||||
Application Development (ADT) User's Manual</ulink>.</para></listitem>
|
||||
"<ulink url='&YOCTO_DOCS_ADT_URL;#using-an-existing-toolchain-tarball'>Using a Cross-Toolchain Tarball</ulink>"
|
||||
section
|
||||
in the Yocto Project Application Development (ADT) User's Manual.</para></listitem>
|
||||
<listitem><para><emphasis>Download the Target Image:</emphasis> The Yocto Project supports
|
||||
several target architectures and has many pre-built kernel images and root filesystem
|
||||
images.</para>
|
||||
<para>If you are going to develop your application on hardware, go to the
|
||||
<ulink url='http://www.yoctoproject.org/downloads/yocto-1.1/machines/'>
|
||||
<ulink url='&YOCTO_MACHINES_DL_URL;'>
|
||||
<filename>machines</filename></ulink> download area and choose a target machine area
|
||||
from which to download the kernel image and root filesystem.
|
||||
This download area could have several files in it that support development using
|
||||
@@ -647,7 +665,7 @@ WRITER NOTE: The areas to get the kernel and root filesystem are located in the
|
||||
Be sure to get the files you need for your particular development process.</para>
|
||||
<para>If you are going to develop your application and then run and test it using the QEMU
|
||||
emulator, go to the
|
||||
<ulink url='http://www.yoctoproject.org/downloads/yocto-1.1/machines/qemu/'>
|
||||
<ulink url='&YOCTO_QEMU_DL_URL;'>
|
||||
<filename>machines/qemu</filename></ulink> download area.
|
||||
From this area, go down into the directory for your target architecture
|
||||
(e.g. <filename>qemux86_64</filename> for an
|
||||
@@ -655,7 +673,7 @@ WRITER NOTE: The areas to get the kernel and root filesystem are located in the
|
||||
Download kernel, root filesystem, and any other files you need for your process.
|
||||
<note>In order to use the root filesystem in QEMU, you need to extract it.
|
||||
See the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/adt-manual/adt-manual.html#extracting-the-root-filesystem'>Extracting the Root Filesystem</ulink>" section for information on how to extract the
|
||||
"<ulink url='&YOCTO_DOCS_ADT_URL;#extracting-the-root-filesystem'>Extracting the Root Filesystem</ulink>" section for information on how to extract the
|
||||
root filesystem.</note></para></listitem>
|
||||
<listitem><para><emphasis>Develop and Test your Application:</emphasis> At this point,
|
||||
you have the tools to develop your application.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<chapter id='dev-manual-newbie'>
|
||||
|
||||
@@ -7,11 +8,11 @@
|
||||
|
||||
<para>
|
||||
This chapter helps you understand the Yocto Project as an open source development project.
|
||||
In general, working in an open source environment is very different as compared to working in a
|
||||
proprietary environment.
|
||||
In general, working in an open source environment is very different from working in a
|
||||
closed, proprietary environment.
|
||||
Additionally, the Yocto Project uses specific tools and constructs as part of its development
|
||||
environment.
|
||||
The chapter specifically addresses open source philosophy, licensing issues, code repositories,
|
||||
This chapter specifically addresses open source philosophy, licensing issues, code repositories,
|
||||
the open source distributed version control system Git, and best practices using the Yocto Project.
|
||||
</para>
|
||||
|
||||
@@ -20,10 +21,10 @@
|
||||
|
||||
<para>
|
||||
Open source philosophy is characterized by software development directed by peer production
|
||||
and collaboration through a concerned community of developers.
|
||||
and collaboration through an active community of developers.
|
||||
Contrast this to the more standard centralized development models used by commercial software
|
||||
companies where a finite set of developers produce a product for sale using a defined set
|
||||
of procedures that ultimately result in an end-product whose architecture and source material
|
||||
of procedures that ultimately result in an end product whose architecture and source material
|
||||
are closed to the public.
|
||||
</para>
|
||||
|
||||
@@ -33,7 +34,7 @@
|
||||
stake in the software project.
|
||||
The open source environment contains new copyright, licensing, domain, and consumer issues
|
||||
that differ from the more traditional development environment.
|
||||
In an open source environment, the end-product, source material, and documentation are
|
||||
In an open source environment, the end product, source material, and documentation are
|
||||
all available to the public at no cost.
|
||||
</para>
|
||||
|
||||
@@ -58,7 +59,7 @@
|
||||
|
||||
<para>
|
||||
The Yocto Project team maintains complete source repositories for all Yocto Project files
|
||||
<ulink url='http://git.yoctoproject.org/cgit/cgit.cgi'>here</ulink>.
|
||||
at <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi'></ulink>.
|
||||
This web-based source code browser is organized into categories by function such as
|
||||
IDE Plugins, Matchbox, Poky, Yocto Linux Kernel, and so forth.
|
||||
From the interface, you can click on any particular item in the "Name" column and
|
||||
@@ -73,13 +74,13 @@
|
||||
Conversely, if you are a developer that is not interested in contributing back to the
|
||||
Yocto Project, you have the ability to simply download and extract release tarballs
|
||||
and use them within the Yocto Project environment.
|
||||
All that is required is a particular release of Yocto Project, a kernel, and
|
||||
All that is required is a particular release of the Yocto Project and
|
||||
your application source code.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For any supported release of Yocto Project, you can go to the Yocto Project website’s
|
||||
<ulink url='http://www.yoctoproject.org/download'>download page</ulink> and get a
|
||||
<ulink url='&YOCTO_HOME_URL;/download'>download page</ulink> and get a
|
||||
tarball of the release.
|
||||
You can also go to this site to download any supported BSP tarballs.
|
||||
Unpacking the tarball gives you a hierarchical directory structure of Yocto Project
|
||||
@@ -94,15 +95,15 @@
|
||||
<para>
|
||||
In summary, here is where you can get the Yocto Project files needed for development:
|
||||
<itemizedlist>
|
||||
<listitem><para><emphasis><ulink url='http://git.yoctoproject.org/cgit/cgit.cgi'>Source Repositories:</ulink></emphasis>
|
||||
<listitem><para><emphasis><ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi'>Source Repositories:</ulink></emphasis>
|
||||
This area contains IDE Plugins, Matchbox, Poky, Poky Support, Tools, Yocto Linux Kernel, and Yocto
|
||||
Metadata Layers.
|
||||
You can create Git repositories for each of these areas.</para>
|
||||
<para>
|
||||
<imagedata fileref="figures/source-repos.png" align="center" width="6in" depth="4in" />
|
||||
</para></listitem>
|
||||
<listitem><para><anchor id='index-downloads' /><emphasis><ulink url='http://www.yoctoproject.org/downloads/'>Index of /downloads:</ulink></emphasis>
|
||||
This area contains an index of downloads such as
|
||||
<listitem><para><anchor id='index-downloads' /><emphasis><ulink url='&YOCTO_DL_URL;/releases/'>Index of /releases:</ulink></emphasis>
|
||||
This area contains index releases such as
|
||||
the <trademark class='trade'>Eclipse</trademark>
|
||||
Yocto Plug-in, miscellaneous support, Poky, pseudo, cross-development toolchains,
|
||||
and all released versions of Yocto Project in the form of images or tarballs.
|
||||
@@ -111,11 +112,11 @@
|
||||
<para>
|
||||
<imagedata fileref="figures/index-downloads.png" align="center" width="6in" depth="4in" />
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis><ulink url='http://www.yoctoproject.org/download'>Yocto Project Download Page</ulink></emphasis>
|
||||
<listitem><para><emphasis><ulink url='&YOCTO_HOME_URL;/download'>Yocto Project Download Page</ulink></emphasis>
|
||||
This page on the Yocto Project website allows you to download any Yocto Project
|
||||
release or Board Support Package (BSP) in tarball form.
|
||||
The tarballs are similar to those found in the
|
||||
<ulink url='http://www.yoctoproject.org/downloads/'>Index of /downloads:</ulink> area.</para>
|
||||
<ulink url='&YOCTO_DL_URL;/releases/'>Index of /releases:</ulink> area.</para>
|
||||
<para>
|
||||
<imagedata fileref="figures/yp-download.png" align="center" width="6in" depth="4in" />
|
||||
</para></listitem>
|
||||
@@ -170,10 +171,8 @@
|
||||
Images are the binary output that runs on specific hardware and for specific
|
||||
use cases.
|
||||
For a list of the supported image types that the Yocto Project provides, see the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html#ref-images'>Reference: Images</ulink>"
|
||||
appendix in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html'>
|
||||
The Yocto Project Reference Manual</ulink>.</para></listitem>
|
||||
"<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Reference: Images</ulink>"
|
||||
appendix in the Yocto Project Reference Manual.</para></listitem>
|
||||
<listitem><para><emphasis>Layer:</emphasis> A collection of recipes representing the core,
|
||||
a BSP, or an application stack.</para></listitem>
|
||||
<listitem><para><emphasis>Metadata:</emphasis> The files that BitBake parses when building an image.
|
||||
@@ -216,14 +215,14 @@
|
||||
system in order to do any development using the Yocto Project.</para>
|
||||
<para>The name of the top-level directory of the Yocto Project file structure
|
||||
is derived from the Yocto Project release tarball.
|
||||
For example, downloading and unpacking <filename>poky-edison-6.0.tar.bz2</filename>
|
||||
For example, downloading and unpacking <filename>&YOCTO_POKY_TARBALL;</filename>
|
||||
results in a Yocto Project file structure whose Yocto Project source directory is named
|
||||
<filename>poky-edison-6.0</filename>.
|
||||
<filename>&YOCTO_POKY;</filename>.
|
||||
If you create a Git repository, then you can name the repository anything you like.</para>
|
||||
<para>You can find instruction on how to set up the Yocto Project files on your
|
||||
host development system by reading
|
||||
the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html#getting-setup'>Getting
|
||||
"<ulink url='&YOCTO_DOCS_DEV_URL;#getting-setup'>Getting
|
||||
Setup</ulink>" section.</para></listitem>
|
||||
<listitem><para><emphasis>Yocto Project Build Directory:</emphasis>
|
||||
This term refers to the area used by the Yocto Project for builds.
|
||||
@@ -233,9 +232,9 @@
|
||||
You can create the Yocto Project build directory anywhere you want on your
|
||||
development system.
|
||||
Here is an example that creates the directory in <filename>mybuilds</filename>
|
||||
and names the Yocto Project build directory <filename>YP-6.0</filename>:
|
||||
and names the Yocto Project build directory <filename>YP-&POKYVERSION;</filename>:
|
||||
<literallayout class='monospaced'>
|
||||
$ source poky-edison-6.0/oe-init-build-env $HOME/mybuilds/YP-6.0
|
||||
$ source &OE_INIT_PATH; $HOME/mybuilds/YP-&POKYVERSION;
|
||||
</literallayout>
|
||||
If you don't specifically name the directory, BitBake creates it
|
||||
in the current directory and uses the name <filename>build</filename>.
|
||||
@@ -305,7 +304,7 @@
|
||||
|
||||
<para>
|
||||
You can find a list of the combined SPDX and OSI licenses that the Yocto Project uses
|
||||
<ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/files/common-licenses'>here</ulink>.
|
||||
<ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta/files/common-licenses'>here</ulink>.
|
||||
This wiki page discusses the license infrastructure used by the Yocto Project.
|
||||
</para>
|
||||
</section>
|
||||
@@ -316,7 +315,10 @@
|
||||
<para>
|
||||
The Yocto Project uses Git, which is a free, open source distributed version control system.
|
||||
Git supports distributed development, non-linear development, and can handle large projects.
|
||||
It is best that you know how to work with Git if you are going to use Yocto Project for development.
|
||||
It is best that you have some fundamental understanding of how Git tracks projects and
|
||||
how to work with Git if you are going to use Yocto Project for development.
|
||||
This section provides a quick overview of how Git works and provides you with a summary
|
||||
of some essential Git commands.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -423,7 +425,7 @@
|
||||
In particular, the information covers basic practices that describe roles and actions in a
|
||||
collaborative development environment.
|
||||
Again, if you are familiar with this type of development environment, you might want to just
|
||||
skip the section.
|
||||
skip this section.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -436,7 +438,7 @@
|
||||
The maintainer is responsible for allowing changes in from other developers and for
|
||||
organizing the underlying branch structure to reflect release strategies and so forth.
|
||||
<note>You can see who is the maintainer for Yocto Project files by examining the
|
||||
<filename>distro_tracking_fields</filename> file in the Yocto Project
|
||||
<filename>distro_tracking_fields.inc</filename> file in the Yocto Project
|
||||
<filename>meta/conf/distro/include</filename> directory.</note>
|
||||
</para>
|
||||
|
||||
@@ -475,7 +477,7 @@
|
||||
"master" branch of the Git repository, which is controlled by the project’s maintainer.
|
||||
And, we have a set of developers who independently develop, test, and submit changes
|
||||
to "contrib" areas for the maintainer to examine.
|
||||
The maintainer then chooses which changes are going to become permanently a part of the project.
|
||||
The maintainer then chooses which changes are going to become a permanent part of the project.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -486,15 +488,18 @@
|
||||
While each development environment is unique, there are some best practices or methods
|
||||
that help development run smoothly.
|
||||
The following list describes some of these practices.
|
||||
For more detailed information about these strategies see
|
||||
<ulink url='http://www.kernel.org/pub/software/scm/git/docs/gitworkflows.html'>Git Workflows</ulink>.
|
||||
For more information about Git workflows, see the workflow topics in the
|
||||
<ulink url='http://book.git-scm.com'>Git Community Book</ulink>.
|
||||
<itemizedlist>
|
||||
<listitem><para><emphasis>Make Small Changes:</emphasis> It is best to keep your changes you commit
|
||||
<listitem><para><emphasis>Make Small Changes:</emphasis> It is best to keep the changes you commit
|
||||
small as compared to bundling many disparate changes into a single commit.
|
||||
This practice not only keeps things manageable but also allows the maintainer
|
||||
to more easily include or refuse changes.</para>
|
||||
<para>It is also good practice to leave the repository in a state that allows you to
|
||||
still successfully build your project.</para></listitem>
|
||||
still successfully build your project. In other words, do not commit half of a feature,
|
||||
then add the other half in a separate, later commit.
|
||||
Each commit should take you from one buildable project state to another
|
||||
buildable state.</para></listitem>
|
||||
<listitem><para><emphasis>Use Branches Liberally:</emphasis> It is very easy to create, use, and
|
||||
delete local branches in your working Git repository.
|
||||
You can name these branches anything you like.
|
||||
@@ -527,7 +532,7 @@
|
||||
<filename>send-pull-request</filename> that ship with the release to facilitate this
|
||||
workflow.
|
||||
You can find these scripts in the local Yocto Project files Git repository in
|
||||
<filename>scripts</filename>.</para></listitem>
|
||||
the <filename>scripts</filename> directory.</para></listitem>
|
||||
<listitem><para><emphasis>Patch Workflow:</emphasis> This workflow allows you to notify the
|
||||
maintainer through an email that you have a change (or patch) you would like considered
|
||||
for the "master" branch of the Git repository.
|
||||
@@ -542,44 +547,59 @@
|
||||
<title>Tracking Bugs</title>
|
||||
|
||||
<para>
|
||||
The Yocto Project uses <ulink url='http://www.bugzilla.org/about/'>Bugzilla</ulink> to track bugs.
|
||||
This bug-tracking application works well for group development because it tracks bugs and code
|
||||
The Yocto Project uses its own implementation of
|
||||
<ulink url='http://www.bugzilla.org/about/'>Bugzilla</ulink> to track bugs.
|
||||
Implementations of Bugzilla work well for group development because they track bugs and code
|
||||
changes, can be used to communicate changes and problems with developers, can be used to
|
||||
submit and review patches, and can be used to manage quality assurance.
|
||||
You can find a good overview of Bugzilla <ulink url='http://www.bugzilla.org/about/'>here</ulink>.
|
||||
submit and review patches, and can be used to manage quality assurance.
|
||||
The home page for the Yocto Project implementation of Bugzilla is
|
||||
<ulink url='&YOCTO_BUGZILLA_URL;'>&YOCTO_BUGZILLA_URL;</ulink>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Sometimes it is helpful to submit, investigate, or track a bug against the Yocto Project itself
|
||||
such as when discovering an issue with some component of the build system that acts contrary
|
||||
to the documentation or your expectations.
|
||||
You can find information
|
||||
for Bugzilla configuration and bug tracking procedures specific to the Yocto Project
|
||||
<ulink url='https://wiki.yoctoproject.org/wiki/Bugzilla_Configuration_and_Bug_Tracking'>here</ulink>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The Yocto Project uses its own version of the Bugzilla application.
|
||||
You can find the home page <ulink url='http://bugzilla.yoctoproject.org'>here</ulink>.
|
||||
You need to use this implementation of Bugzilla when logging a defect against anything released
|
||||
by the Yocto Project team.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Here are some things to remember when dealing with bugs against the Yocto Project:
|
||||
<itemizedlist>
|
||||
<listitem><para>The Yocto Project follows a bug-naming convention:
|
||||
<filename>[YOCTO #<number>]</filename>, where <filename><number></filename> is the
|
||||
assigned defect ID used in Bugzilla.
|
||||
So, for example, a valid way to refer to a defect when creating a commit comment
|
||||
would be <filename>[YOCTO #1011]</filename>.
|
||||
This convention becomes important if you are submitting patches against the Yocto Project
|
||||
code itself.
|
||||
See the following section for more information.</para></listitem>
|
||||
<listitem><para>Defects for Yocto Project fall into one of four classifications: Yocto Projects,
|
||||
Infrastructure, Poky, and Yocto Metadata Layers.</para></listitem>
|
||||
</itemizedlist>
|
||||
Following is the general procedure for submitting a new bug using the Yocto Project
|
||||
Bugzilla.
|
||||
You can find more information on defect management, bug tracking, and feature request
|
||||
processes all accomplished through the Yocto Project Bugzilla on the wiki page
|
||||
<ulink url='&YOCTO_WIKI_URL;/wiki/Bugzilla_Configuration_and_Bug_Tracking'>here</ulink>.
|
||||
<orderedlist>
|
||||
<listitem><para>Always use the Yocto Project implementation of Bugzilla to submit
|
||||
a bug.</para></listitem>
|
||||
<listitem><para>When submitting a new bug, be sure to choose the appropriate
|
||||
Classification, Product, and Component for which the issue was found.
|
||||
Defects for Yocto Project fall into one of four classifications: Yocto Projects,
|
||||
Infrastructure, Poky, and Yocto Metadata Layers.
|
||||
Each of these Classifications break down into multiple Products and, in some
|
||||
cases, multiple Components.</para></listitem>
|
||||
<listitem><para>Use the bug form to choose the correct Hardware and Architecture
|
||||
for which the bug applies.</para></listitem>
|
||||
<listitem><para>Indicate the Yocto Project version you were using when the issue
|
||||
occurred.</para></listitem>
|
||||
<listitem><para>Be sure to indicate the Severity of the bug.
|
||||
Severity communicates how the bug impacted your work.</para></listitem>
|
||||
<listitem><para>Provide a brief summary of the issue.
|
||||
Try to limit your summary to just a line or two and be sure to capture the
|
||||
essence of the issue.</para></listitem>
|
||||
<listitem><para>Provide a detailed description of the issue.
|
||||
You should provide as much detail as you can about the context, behavior, output,
|
||||
and so forth that surround the issue.
|
||||
You can even attach supporting files for output or log by using the "Add an attachment"
|
||||
button.</para></listitem>
|
||||
<listitem><para>Submit the bug by clicking the "Submit Bug" button.</para></listitem>
|
||||
</orderedlist>
|
||||
</para>
|
||||
|
||||
<note>
|
||||
Bugs in the Yocto Project Bugzilla follow naming convention:
|
||||
<filename>[YOCTO #<number>]</filename>, where <filename><number></filename> is the
|
||||
assigned defect ID used in Bugzilla.
|
||||
So, for example, a valid way to refer to a defect would be <filename>[YOCTO #1011]</filename>.
|
||||
This convention becomes important if you are submitting patches against the Yocto Project
|
||||
code itself.
|
||||
</note>
|
||||
</section>
|
||||
|
||||
<section id='how-to-submit-a-change'>
|
||||
@@ -587,27 +607,28 @@
|
||||
|
||||
<para>
|
||||
Contributions to the Yocto Project are very welcome.
|
||||
Because the Yocto Project is extremely configurable and flexible, we recognize that developers
|
||||
will want to extend, configure or optimize it for their specific uses.
|
||||
You should send patches to the appropriate Yocto Project mailing list to get them
|
||||
in front of the Yocto Project Maintainer.
|
||||
For a list of the Yocto Project mailing lists, see the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html#resources-mailinglist'>Mailing lists</ulink>" section in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html'> The
|
||||
Yocto Project Reference Manual</ulink>.
|
||||
"<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing lists</ulink>" section in
|
||||
The Yocto Project Reference Manual.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Following is some guidance on which mailing list to use for what type of defect:
|
||||
The following is some guidance on which mailing list to use for what type of defect:
|
||||
<itemizedlist>
|
||||
<listitem><para>For defects against the Yocto Project build system Poky, send
|
||||
your patch to the
|
||||
<ulink url='http://lists.yoctoproject.org/listinfo/poky'></ulink> mailing list.
|
||||
<ulink url='&YOCTO_LISTS_URL;/listinfo/poky'></ulink> mailing list.
|
||||
This mailing list corresponds to issues that are not specific to the Yocto Project but
|
||||
are part of the OE-core.
|
||||
For example, a defect against anything in the <filename>meta</filename> layer
|
||||
or the BitBake Manual could be sent to this mailing list.</para></listitem>
|
||||
<listitem><para>For defects against Yocto-specific layers, tools, and Yocto Project
|
||||
documentation use the
|
||||
<ulink url='http://lists.yoctoproject.org/listinfo/yocto'></ulink> mailing list.
|
||||
<ulink url='&YOCTO_LISTS_URL;/listinfo/yocto'></ulink> mailing list.
|
||||
This mailing list corresponds to Yocto-specific areas such as
|
||||
<filename>meta-yocto</filename>, <filename>meta-intel</filename>,
|
||||
<filename>linux-yocto</filename>, and <filename>documentation</filename>.</para></listitem>
|
||||
@@ -615,7 +636,7 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
When you send a patch, be sure to include a "signed-off-by:"
|
||||
When you send a patch, be sure to include a "Signed-off-by:"
|
||||
line in the same style as required by the Linux kernel.
|
||||
Adding this line signifies the developer has agreed to the Developer's Certificate of Origin 1.1
|
||||
as follows:
|
||||
@@ -657,11 +678,14 @@
|
||||
<para>
|
||||
In a collaborative environment, it is necessary to have some sort of standard
|
||||
or method through which you submit changes.
|
||||
Otherwise, things could get quite chaotic.
|
||||
Otherwise, things could get quite chaotic.
|
||||
One general practice to follow is to make small, controlled changes to the
|
||||
Yocto Project.
|
||||
Keeping changes small and isolated lets you best keep pace with future Yocto Project changes.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
When you form a commit, you must follow certain standards established by the
|
||||
When you create a commit, you must follow certain standards established by the
|
||||
Yocto Project development team.
|
||||
For each commit, you must provide a single-line summary of the change and you
|
||||
almost always provide a more detailed description of what you did (i.e. the body
|
||||
@@ -695,7 +719,7 @@
|
||||
<para>
|
||||
You can find more guidance on creating well-formed commit messages at this OpenEmbedded
|
||||
wiki page:
|
||||
<ulink url='http://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines'></ulink>.
|
||||
<ulink url='&OE_HOME_URL;/wiki/Commit_Patch_Message_Guidelines'></ulink>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -733,9 +757,8 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
You can find general Git information on how to push a change upstream
|
||||
<ulink url='http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#Developing-With-git'>
|
||||
here</ulink>.
|
||||
You can find general Git information on how to push a change upstream in the
|
||||
<ulink url='http://book.git-scm.com/3_distributed_workflows.html'>Git Community Book</ulink>.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -760,7 +783,7 @@
|
||||
See the earlier section
|
||||
"<link linkend='how-to-submit-a-change'>How to Submit a Change</link>"
|
||||
for Yocto Project commit message standards.</para></listitem>
|
||||
<listitem><para>Format the commit into an email messsage.
|
||||
<listitem><para>Format the commit into an email message.
|
||||
To format commits, use the <filename>git format-patch</filename> command.
|
||||
When you provide the command, you must include a revision list or a number of patches
|
||||
as part of the command.
|
||||
@@ -775,6 +798,11 @@
|
||||
<para>If you provide several commits as part of the command,
|
||||
the <filename>git format-patch</filename> command produces a numbered
|
||||
series of files in the current directory – one for each commit.
|
||||
If you have more than one patch, you should also use the
|
||||
<filename>--cover</filename> option with the command, which generates a
|
||||
cover letter as the first "patch" in the series.
|
||||
You can then edit the cover letter to provide a description for
|
||||
the series of patches.
|
||||
For information on the <filename>git format-patch</filename> command,
|
||||
see <filename>GIT_FORMAT_PATCH(1)</filename> displayed using the
|
||||
<filename>man git-format-patch</filename> command.</para></listitem>
|
||||
@@ -787,7 +815,15 @@
|
||||
or remote Mail Transport Agent (MTA) such as
|
||||
<filename>msmtp</filename>, <filename>sendmail</filename>, or through a direct
|
||||
<filename>smtp</filename> configuration in your Git <filename>config</filename>
|
||||
file.</para>
|
||||
file.
|
||||
If you are submitting patches through email only, it is very important
|
||||
that you submit them without any whitespace or HTML formatting that
|
||||
either you or your mailer introduces.
|
||||
The maintainer that receives your patches needs to be able to save and
|
||||
apply them directly from your emails.
|
||||
A good way to verify that what you are sending will be applicable by the
|
||||
maintainer is to do a dry run and send them to yourself and then
|
||||
save and apply them as the maintainer would.</para>
|
||||
<para>The <filename>git send-email</filename> command is the preferred method
|
||||
for sending your patches since there is no risk of compromising whitespace
|
||||
in the body of the message, which can occur when you use your own mail client.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<chapter id='dev-manual-start'>
|
||||
|
||||
@@ -9,7 +10,7 @@
|
||||
This chapter introduces the Yocto Project and gives you an idea of what you need to get started.
|
||||
You can find enough information to set up your development host and build or use images for
|
||||
hardware supported by the Yocto Project by reading
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html'>
|
||||
<ulink url='&YOCTO_DOCS_QS_URL;'>
|
||||
The Yocto Project Quick Start</ulink>.
|
||||
</para>
|
||||
|
||||
@@ -30,20 +31,21 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
You can use the Yocto Project, which uses the BitBake build tool, to develop complete Linux
|
||||
You can use the Yocto Project build system, which uses
|
||||
<ulink url='http://bitbake.berlios.de/manual/'>BitBake</ulink>, to develop complete Linux
|
||||
images and associated user-space applications for architectures based on ARM, MIPS, PowerPC,
|
||||
x86 and x86-64.
|
||||
While the Yocto Project does not provide a strict testing framework,
|
||||
it does provide or generate for you artifacts that let you perform target-level and
|
||||
emulated testing and debugging.
|
||||
And, if you are an <trademark class='trade'>Eclipse</trademark>
|
||||
Additionally, if you are an <trademark class='trade'>Eclipse</trademark>
|
||||
IDE user, you can install an Eclipse Yocto Plug-in to allow you to
|
||||
develop within that familiar environment.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='getting-setup'>
|
||||
<title>Getting Setup</title>
|
||||
<title>Getting Set Up</title>
|
||||
|
||||
<para>
|
||||
Here is what you need to get set up to use the Yocto Project:
|
||||
@@ -57,7 +59,7 @@
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis>Packages:</emphasis> The Yocto Project requires certain packages
|
||||
exist on your development system (e.g. Python 2.6 or 2.7).
|
||||
See "<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html#packages'>The Packages</ulink>"
|
||||
See "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Packages</ulink>"
|
||||
section in the Yocto Project Quick start for the exact package
|
||||
requirements and the installation commands to install them
|
||||
for the supported distributions.</para></listitem>
|
||||
@@ -73,29 +75,37 @@
|
||||
<itemizedlist>
|
||||
<listitem><para><emphasis>Tarball Extraction:</emphasis> If you are not going to contribute
|
||||
back into the Yocto Project, you can simply download the Yocto Project release you want
|
||||
from the website’s <ulink url='http://yoctoproject.org/download'>download page</ulink>.
|
||||
from the website’s <ulink url='&YOCTO_HOME_URL;/download'>download page</ulink>.
|
||||
Once you have the tarball, just extract it into a directory of your choice.</para>
|
||||
<para>For example, the following command extracts the Yocto Project 1.1 release tarball
|
||||
<para>For example, the following command extracts the Yocto Project &DISTRO;
|
||||
release tarball
|
||||
into the current working directory and sets up the Yocto Project file structure
|
||||
with a top-level directory named <filename>poky-1.1</filename>:
|
||||
with a top-level directory named <filename>&YOCTO_POKY;</filename>:
|
||||
<literallayout class='monospaced'>
|
||||
$ tar xfj poky-edison-6.0.tar.bz2
|
||||
$ tar xfj &YOCTO_POKY_TARBALL;
|
||||
</literallayout></para>
|
||||
<para>This method does not produce a Git repository.
|
||||
Instead, you simply end up with a local snapshot of the
|
||||
Yocto Project files that are based on the particular release in the
|
||||
tarball.</para></listitem>
|
||||
<listitem><para><emphasis>Git Repository Method:</emphasis> If you are going to be contributing
|
||||
back into the Yocto Project, you should use Git commands to set up a local
|
||||
Git repository of the Yocto Project files.
|
||||
back into the Yocto Project or you simply want to keep up
|
||||
with the latest developments, you should use Git commands to set up a local
|
||||
Git repository of the Yocto Project files.
|
||||
Doing so creates a Git repository with a complete history of changes and allows
|
||||
you to easily submit your changes upstream to the project.</para>
|
||||
<para>The following transcript shows how to clone the Yocto Project files'
|
||||
Git repository into the current working directory.
|
||||
The command creates the repository in a directory named <filename>poky</filename>.
|
||||
For information on the Yocto Project and Git, see the
|
||||
"<link linkend='git'>Git</link>" section.
|
||||
<literallayout class='monospaced'>
|
||||
you to easily submit your changes upstream to the project.
|
||||
Because you cloned the repository, you have access to all the Yocto Project development
|
||||
branches and tag names used in the upstream repository.</para>
|
||||
<para>The following transcript shows how to clone the Yocto Project Files'
|
||||
Git repository into the current working directory.
|
||||
<note>The name of the Yocto Project Files Git repository in the Yocto Project Files
|
||||
Source Repositories is <filename>poky</filename>.
|
||||
You can view the Yocto Project Source Repositories at
|
||||
<ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink></note>
|
||||
The command creates the local repository in a directory named <filename>poky</filename>.
|
||||
For information on Git used within the Yocto Project, see the
|
||||
"<link linkend='git'>Git</link>" section.
|
||||
<literallayout class='monospaced'>
|
||||
$ git clone git://git.yoctoproject.org/poky
|
||||
Initialized empty Git repository in /home/scottrif/poky/.git/
|
||||
remote: Counting objects: 116882, done.
|
||||
@@ -104,68 +114,78 @@
|
||||
Receiving objects: 100% (116882/116882), 72.13 MiB | 2.68 MiB/s, done.
|
||||
Resolving deltas: 100% (80651/80651), done. </literallayout></para>
|
||||
<para>For another example of how to set up your own local Git repositories, see this
|
||||
<ulink url='https://wiki.yoctoproject.org/wiki/Transcript:_from_git_checkout_to_meta-intel_BSP'>
|
||||
<ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_from_git_checkout_to_meta-intel_BSP'>
|
||||
wiki page</ulink>, which describes how to create both <filename>poky</filename>
|
||||
and <filename>meta-intel</filename> Git repositories.</para></listitem>
|
||||
</itemizedlist></para></listitem>
|
||||
<listitem id='local-kernel-files'><para><emphasis>Linux Yocto Kernel:</emphasis>
|
||||
If you are going to be making modifications to a supported Linux Yocto kernel, you
|
||||
need to establish local copies of the source.
|
||||
This setup involves creating a bare clone of the Linux Yocto kernel and then cloning
|
||||
that repository.
|
||||
You can find Git repositories of supported Linux Yocto Kernels organized under
|
||||
"Yocto Linux Kernel" in the Yocto Project Source Repositories at
|
||||
<ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.</para>
|
||||
<para>This setup involves creating a bare clone of the Linux Yocto kernel and then
|
||||
copying that cloned repository.
|
||||
You can create the bare clone and the copy of the bare clone anywhere you like.
|
||||
For simplicity, it is recommended that you create these structures outside of the
|
||||
Yocto Project files' Git repository.</para>
|
||||
<para>As an example, the following transcript shows how to create the bare clone
|
||||
of the <filename>linux-yocto-3.0</filename> kernel and then create a copy of
|
||||
of the <filename>linux-yocto-3.0-1.1.x</filename> kernel and then create a copy of
|
||||
that clone.
|
||||
<note>When you have a local Linux Yocto kernel Git repository, you can
|
||||
reference that repository rather than the upstream Git repository as
|
||||
part of the <filename>clone</filename> command.
|
||||
Doing so can speed up the process.</note>
|
||||
In the following example, the bare clone is named
|
||||
<filename>linux-yocto-3.0.git</filename>, while the
|
||||
copy is named <filename>linux-yocto-3.0</filename>:
|
||||
Doing so can speed up the process.</note></para>
|
||||
<para>In the following example, the bare clone is named
|
||||
<filename>linux-yocto-3.0-1.1.x.git</filename>, while the
|
||||
copy is named <filename>my-linux-yocto-3.0-1.1.x-work</filename>:
|
||||
<literallayout class='monospaced'>
|
||||
$ git clone --bare git://git.yoctoproject.org/linux-yocto-3.0 linux-yocto-3.0.git
|
||||
Initialized empty Git repository in /home/scottrif/linux-yocto-3.0.git/
|
||||
remote: Counting objects: 2123870, done.
|
||||
remote: Compressing objects: 100% (341338/341338), done.
|
||||
remote: Total 2123870 (delta 1778780), reused 2107534 (delta 1762583)
|
||||
Receiving objects: 100% (2123870/2123870), 445.72 MiB | 2.06 MiB/s, done.
|
||||
Resolving deltas: 100% (1778780/1778780), done. </literallayout></para>
|
||||
$ git clone --bare git://git.yoctoproject.org/linux-yocto-3.0-1.1.x linux-yocto-3.0-1.1.x.git
|
||||
Initialized empty Git repository in /home/scottrif/linux-yocto-3.0-1.1.x.git/
|
||||
remote: Counting objects: 2259181, done.
|
||||
remote: Compressing objects: 100% (373259/373259), done.
|
||||
remote: Total 2259181 (delta 1892638), reused 2231556 (delta 1865300)
|
||||
Receiving objects: 100% (2259181/2259181), 482.44 MiB | 580 KiB/s, done.
|
||||
Resolving deltas: 100% (1892638/1892638), done.
|
||||
</literallayout></para>
|
||||
<para>Now create a clone of the bare clone just created:
|
||||
<literallayout class='monospaced'>
|
||||
$ git clone linux-yocto-3.0.git linux-yocto-3.0
|
||||
Initialized empty Git repository in /home/scottrif/linux-yocto-3.0/.git/
|
||||
Checking out files: 100% (36898/36898), done. </literallayout></para></listitem>
|
||||
$ git clone linux-yocto-3.0-1.1.x.git my-linux-yocto-3.0-1.1.x-work
|
||||
Initialized empty Git repository in /home/scottrif/my-linux-yocto-3.0-1.1.x/.git/
|
||||
Checking out files: 100% (36898/36898), done.
|
||||
</literallayout></para></listitem>
|
||||
<listitem id='poky-extras-repo'><para><emphasis>
|
||||
The <filename>poky-extras</filename> Git Repository</emphasis>:
|
||||
The <filename>poky-extras</filename> Git repository contains metadata needed to
|
||||
build the kernel image.
|
||||
In particular, it contains the kernel <filename>.bbappend</filename> files that you
|
||||
The <filename>poky-extras</filename> Git repository contains metadata needed
|
||||
only if you are modifying and building the kernel image.
|
||||
In particular, it contains the kernel BitBake append (<filename>.bbappend</filename>)
|
||||
files that you
|
||||
edit to point to your locally modified kernel source files and to build the kernel
|
||||
image.
|
||||
Pointing to these local files is much more efficient than requiring a download of the
|
||||
source files from upstream each time you make changes to the kernel.</para>
|
||||
<para>It is good practice to create this Git repository inside the Yocto Project
|
||||
files Git repository.
|
||||
Following is an example that creates the <filename>poky-extras</filename> Git
|
||||
<para>You can find the <filename>poky-extras</filename> Git Repository in the
|
||||
"Yocto Metadata Layers" area of the Yocto Project Source Repositories at
|
||||
<ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.
|
||||
It is good practice to create this Git repository inside the Yocto Project
|
||||
files Git repository.</para>
|
||||
<para>Following is an example that creates the <filename>poky-extras</filename> Git
|
||||
repository inside the Yocto Project files Git repository, which is named
|
||||
<filename>poky</filename> in this case:
|
||||
<literallayout class='monospaced'>
|
||||
$ cd ~/poky
|
||||
$ git clone git://git.yoctoproject.org/poky-extras poky-extras
|
||||
Initialized empty Git repository in /home/scottrif/poky/poky-extras/.git/
|
||||
remote: Counting objects: 543, done.
|
||||
remote: Compressing objects: 100% (483/483), done.
|
||||
remote: Total 543 (delta 144), reused 307 (delta 39)
|
||||
Receiving objects: 100% (543/543), 520.55 KiB, done.
|
||||
Resolving deltas: 100% (144/144), done. </literallayout></para></listitem>
|
||||
remote: Counting objects: 561, done.
|
||||
remote: Compressing objects: 100% (501/501), done.
|
||||
remote: Total 561 (delta 159), reused 306 (delta 39)
|
||||
Receiving objects: 100% (561/561), 519.96 KiB | 479 KiB/s, done.
|
||||
Resolving deltas: 100% (159/159), done.
|
||||
</literallayout></para></listitem>
|
||||
<listitem><para><emphasis>Supported Board Support Packages (BSPs):</emphasis>
|
||||
Similar considerations exist for BSPs.
|
||||
You can get set up for BSP development one of two ways: tarball extraction or
|
||||
with a local Git repository.
|
||||
It is a good idea to use the same method used to set up the Yocto Project Files.
|
||||
Regardless of the method you use, the Yocto Project uses the following BSP layer
|
||||
naming scheme:
|
||||
<literallayout class='monospaced'>
|
||||
@@ -181,31 +201,33 @@
|
||||
<itemizedlist>
|
||||
<listitem><para><emphasis>Tarball Extraction:</emphasis> You can download any released
|
||||
BSP tarball from the same
|
||||
<ulink url='http://yoctoproject.org/download'>download site</ulink> used
|
||||
<ulink url='&YOCTO_HOME_URL;/download'>download site</ulink> used
|
||||
to get the Yocto Project release.
|
||||
Once you have the tarball, just extract it into a directory of your choice.
|
||||
Again, this method just produces a snapshot of the BSP layer in the form
|
||||
of a hierarchical directory structure.</para></listitem>
|
||||
<listitem><para><emphasis>Git Repository Method:</emphasis> If you are working
|
||||
with a Yocto Project files Git repository, you should also set up a
|
||||
<filename>meta-intel</filename> Git repository.
|
||||
Typically, you set up the <filename>meta-intel</filename> Git repository inside
|
||||
the Yocto Project files Git repository.</para>
|
||||
<para>For example, the following transcript shows the steps to clone the
|
||||
with a Yocto Project Files Git repository, you should also use this method
|
||||
to set up the <filename>meta-intel</filename> Git repository.
|
||||
You can locate the <filename>meta-intel</filename> Git repository in the
|
||||
"Yocto Metadata Layers" area of the Yocto Project Source Repositories at
|
||||
<ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.</para>
|
||||
<para>Typically, you set up the <filename>meta-intel</filename> Git repository inside
|
||||
the Yocto Project Files Git repository.
|
||||
For example, the following transcript shows the steps to clone the
|
||||
<filename>meta-intel</filename>
|
||||
Git repository inside the <filename>poky</filename> Git repository.
|
||||
<literallayout class='monospaced'>
|
||||
$cd poky
|
||||
$ git clone git://git.yoctoproject.org/meta-intel.git
|
||||
Initialized empty Git repository in /home/scottrif/poky/meta-intel/.git/
|
||||
remote: Counting objects: 1325, done.
|
||||
remote: Compressing objects: 100% (1078/1078), done.
|
||||
remote: Total 1325 (delta 546), reused 85 (delta 27)
|
||||
Receiving objects: 100% (1325/1325), 1.56 MiB | 330 KiB/s, done.
|
||||
Resolving deltas: 100% (546/546), done.
|
||||
remote: Counting objects: 3279, done.
|
||||
remote: Compressing objects: 100% (2708/2708), done.
|
||||
remote: Total 3279 (delta 1761), reused 194 (delta 105)
|
||||
Receiving objects: 100% (3279/3279), 1.75 MiB | 377 KiB/s, done.
|
||||
Resolving deltas: 100% (1761/1761), done.
|
||||
</literallayout></para>
|
||||
<para>The same
|
||||
<ulink url='https://wiki.yoctoproject.org/wiki/Transcript:_from_git_checkout_to_meta-intel_BSP'>
|
||||
<ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_from_git_checkout_to_meta-intel_BSP'>
|
||||
wiki page</ulink> referenced earlier covers how to
|
||||
set up the <filename>meta-intel</filename> Git repository.</para></listitem>
|
||||
</itemizedlist></para></listitem>
|
||||
@@ -213,7 +235,7 @@
|
||||
applications using the Eclipse Integrated Development Environment (IDE),
|
||||
you will need this plug-in.
|
||||
See the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/adt-manual/adt-manual.html#setting-up-the-eclipse-ide'>Setting up the Eclipse IDE</ulink>"
|
||||
"<ulink url='&YOCTO_DOCS_ADT_URL;#setting-up-the-eclipse-ide'>Setting up the Eclipse IDE</ulink>"
|
||||
section in the Yocto Application Development Toolkit (ADT)
|
||||
User’s Guide for more information.</para></listitem>
|
||||
</itemizedlist>
|
||||
@@ -226,7 +248,7 @@
|
||||
<para>
|
||||
The build process creates an entire Linux distribution, including the toolchain, from source.
|
||||
For more information on this topic, see the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html#building-image'>Building an Image</ulink>"
|
||||
"<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>"
|
||||
section in the Yocto Project Quick Start.
|
||||
</para>
|
||||
|
||||
@@ -237,12 +259,20 @@
|
||||
previous section.</para></listitem>
|
||||
<listitem><para>Initialize the build environment by sourcing a build environment
|
||||
script.</para></listitem>
|
||||
<listitem><para>Optionally ensure the <filename>conf/local.conf</filename> configuration file is set
|
||||
up how you want it.
|
||||
This file defines the target machine architecture and other build options.</para></listitem>
|
||||
<listitem><para>Build the image using the BitBake command.
|
||||
If you want information on Bitbake, see the user manual at
|
||||
<ulink url='http://docs.openembedded.org/bitbake/html'></ulink>.</para></listitem>
|
||||
<listitem><para>Optionally ensure the <filename>/conf/local.conf</filename> configuration file,
|
||||
which is found in the Yocto Project build directory,
|
||||
is set up how you want it.
|
||||
This file defines many aspects of the build environment including
|
||||
the target machine architecture through the
|
||||
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'>MACHINE</ulink></filename> variable,
|
||||
the development machine's processor use through the
|
||||
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BB_NUMBER_THREADS'>BB_NUMBER_THREADS</ulink></filename> and
|
||||
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKE'>PARALLEL_MAKE</ulink></filename> variables, and
|
||||
a centralized tarball download directory through the
|
||||
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'>DL_DIR</ulink></filename> variable.</para></listitem>
|
||||
<listitem><para>Build the image using the <filename>bitbake</filename> command.
|
||||
If you want information on BitBake, see the user manual at
|
||||
<ulink url='&OE_DOCS_URL;/bitbake/html'></ulink>.</para></listitem>
|
||||
<listitem><para>Run the image either on the actual hardware or using the QEMU
|
||||
emulator.</para></listitem>
|
||||
</orderedlist>
|
||||
@@ -253,18 +283,37 @@
|
||||
<title>Using Pre-Built Binaries and QEMU</title>
|
||||
|
||||
<para>
|
||||
Another option you have to get started is to use pre-built binaries.
|
||||
This scenario is ideal for developing software applications to run on your target hardware.
|
||||
To do this, you need to install the stand-alone Yocto Project cross-toolchain tarball and
|
||||
then download the pre-built kernel that you will boot in the QEMU emulator.
|
||||
Next, you must download and extract the target root filesystem for your target
|
||||
machine’s architecture.
|
||||
Finally, you set up the environment to emulate the hardware and then start the QEMU emulator.
|
||||
Another option you have to get started is to use pre-built binaries.
|
||||
The Yocto Project provides many types of binaries with each release.
|
||||
See the <ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Reference: Images</ulink>
|
||||
section for descriptions of the types of binaries that ship with a Yocto Project
|
||||
release.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Using a pre-built binary is ideal for developing software applications to run on your
|
||||
target hardware.
|
||||
To do this, you need to be able to access the appropriate cross-toolchain tarball for
|
||||
the architecture on which you are developing.
|
||||
If you are using an SDK type image, the image ships with the complete toolchain native to
|
||||
the architecture.
|
||||
If you are not using an SDK type image, you need to separately download and
|
||||
install the stand-alone Yocto Project cross-toolchain tarball.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Regardless of the type of image you are using, you need to download the pre-built kernel
|
||||
that you will boot in the QEMU emulator and then download and extract the target root
|
||||
filesystem for your target machine’s architecture.
|
||||
You can get architecture-specific binaries and filesystem from
|
||||
<ulink url='&YOCTO_MACHINES_DL_URL;'>machines</ulink>.
|
||||
You can get stand-alone toolchains from
|
||||
<ulink url='&YOCTO_TOOLCHAIN_DL_URL;'>toolchains</ulink>.
|
||||
Once you have all your files, you set up the environment to emulate the hardware
|
||||
by sourcing an environment setup script.
|
||||
Finally, you start the QEMU emulator.
|
||||
You can find details on all these steps in the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html#using-pre-built'>Using Pre-Built Binaries and QEMU</ulink>"
|
||||
"<ulink url='&YOCTO_DOCS_QS_URL;#using-pre-built'>Using Pre-Built Binaries and QEMU</ulink>"
|
||||
section of the Yocto Project Quick Start.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<book id='dev-manual' lang='en'
|
||||
xmlns:xi="http://www.w3.org/2003/XInclude"
|
||||
@@ -33,10 +34,20 @@
|
||||
<date>6 October 2011</date>
|
||||
<revremark>The initial document released with the Yocto Project 1.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>1.1.1</revnumber>
|
||||
<date>15 March 2012</date>
|
||||
<revremark>Released with the Yocto Project 1.1.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>1.1.2</revnumber>
|
||||
<date>July 2012</date>
|
||||
<revremark>Released with the Yocto Project 1.1.2 Release.</revremark>
|
||||
</revision>
|
||||
</revhistory>
|
||||
|
||||
<copyright>
|
||||
<year>2010-2011</year>
|
||||
<year>©RIGHT_YEAR;</year>
|
||||
<holder>Linux Foundation</holder>
|
||||
</copyright>
|
||||
|
||||
@@ -51,9 +62,9 @@
|
||||
<note>
|
||||
Due to production processes, there could be differences between the Yocto Project
|
||||
documentation bundled in the release tarball and
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html'>
|
||||
<ulink url='&YOCTO_DOCS_DEV_URL;'>
|
||||
The Yocto Project Development Manual</ulink> on
|
||||
the <ulink url='http://www.yoctoproject.org'>Yocto Project</ulink> website.
|
||||
the <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink> website.
|
||||
For the latest version of this manual, see the manual on the website.
|
||||
</note>
|
||||
</legalnotice>
|
||||
|
||||
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 57 KiB |
BIN
documentation/dev-manual/figures/kernel-example-repos-edison.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 24 KiB |
BIN
documentation/dev-manual/figures/kernel-overview-3-edison.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 28 KiB |
@@ -654,7 +654,7 @@ hr {
|
||||
|
||||
|
||||
.tip, .warning, .caution, .note {
|
||||
border-color: #aaa;
|
||||
border-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
@@ -662,24 +662,24 @@ hr {
|
||||
.warning table th,
|
||||
.caution table th,
|
||||
.note table th {
|
||||
border-bottom-color: #aaa;
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
.warning {
|
||||
background-color: #fea;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.caution {
|
||||
background-color: #fea;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.tip {
|
||||
background-color: #eff;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.note {
|
||||
background-color: #dfc;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.glossary dl dt,
|
||||
@@ -946,8 +946,8 @@ table {
|
||||
|
||||
.tip,
|
||||
.note {
|
||||
background: #666666;
|
||||
color: #fff;
|
||||
background: #f0f0f2;
|
||||
color: #333;
|
||||
padding: 20px;
|
||||
margin: 20px;
|
||||
}
|
||||
@@ -958,11 +958,26 @@ table {
|
||||
margin: 0em;
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.tip a,
|
||||
.note a {
|
||||
color: #fff;
|
||||
color: #333;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.footnote {
|
||||
font-size: small;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
/* Changes the announcement text */
|
||||
.tip h3,
|
||||
.warning h3,
|
||||
.caution h3,
|
||||
.note h3 {
|
||||
font-size:large;
|
||||
color: #00557D;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<chapter id='kernel-concepts'>
|
||||
|
||||
@@ -44,13 +45,13 @@
|
||||
management techniques.</para></listitem>
|
||||
<listitem><para>Deliver the most up-to-date kernel possible while still ensuring that
|
||||
the baseline kernel is the most stable official release.</para></listitem>
|
||||
<listitem><para>Include major technological features as part of Yocto Project's up-rev
|
||||
strategy.</para></listitem>
|
||||
<listitem><para>Include major technological features as part of Yocto Project's
|
||||
upward revision strategy.</para></listitem>
|
||||
<listitem><para>Present a kernel Git repository that, similar to the upstream
|
||||
<filename>kernel.org</filename> tree,
|
||||
has a clear and continuous history.</para></listitem>
|
||||
<listitem><para>Deliver a key set of supported kernel types, where each type is tailored
|
||||
to a specific use case (e.g. networking, consumer, devices, and so forth).</para></listitem>
|
||||
to meet a specific use (e.g. networking, consumer, devices, and so forth).</para></listitem>
|
||||
<listitem><para>Employ a Git branching strategy that, from a developer's point of view,
|
||||
results in a linear path from the baseline <filename>kernel.org</filename>,
|
||||
through a select group of features and
|
||||
@@ -78,7 +79,7 @@
|
||||
</para>
|
||||
<para>
|
||||
This balance allows the team to deliver the most up-to-date kernel
|
||||
as possible, while still ensuring that the team has a stable official release as
|
||||
as possible, while still ensuring that the team has a stable official release for
|
||||
the baseline kernel version.
|
||||
</para>
|
||||
<para>
|
||||
@@ -94,8 +95,8 @@
|
||||
</para>
|
||||
<para>
|
||||
Once a Yocto Project kernel is officially released, the Yocto Project team goes into
|
||||
their next development cycle, or "uprev" cycle, while still continuing maintenance on the
|
||||
released kernel.
|
||||
their next development cycle, or upward revision (uprev) cycle, while still
|
||||
continuing maintenance on the released kernel.
|
||||
It is important to note that the most sustainable and stable way
|
||||
to include feature development upstream is through a kernel uprev process.
|
||||
Back-porting hundreds of individual fixes and minor features from various
|
||||
@@ -148,7 +149,8 @@
|
||||
<section id='architecture-overview'>
|
||||
<title>Overview</title>
|
||||
<para>
|
||||
As mentioned earlier, a key goal of Yocto Project is to present the developer with
|
||||
As mentioned earlier, a key goal of the Yocto Project is to present the
|
||||
developer with
|
||||
a kernel that has a clear and continuous history that is visible to the user.
|
||||
The architecture and mechanisms used achieve that goal in a manner similar to the
|
||||
upstream <filename>kernel.org</filename>.
|
||||
@@ -159,9 +161,8 @@
|
||||
The features are tagged and organized by way of a branching strategy implemented by the
|
||||
source code manager (SCM) Git.
|
||||
For information on Git as applied to the Yocto Project, see the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html#git'>Git</ulink>"
|
||||
section in <ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html'>The
|
||||
Yocto Project Development Manual</ulink>.
|
||||
"<ulink url='&YOCTO_DOCS_DEV_URL;#git'>Git</ulink>" section in the
|
||||
Yocto Project Development Manual.
|
||||
</para>
|
||||
<para>
|
||||
The result is that the user has the ability to see the added features and
|
||||
@@ -176,7 +177,7 @@
|
||||
<imagedata fileref="figures/kernel-architecture-overview.png" width="6in" depth="7in" align="center" scale="100" />
|
||||
</para>
|
||||
<para>
|
||||
In the illustration, the "<filename>kernel.org</filename> Branch Point"
|
||||
In the illustration, the "Kernel.org Branch Point"
|
||||
marks the specific spot (or release) from
|
||||
which the Yocto Project kernel is created.
|
||||
From this point "up" in the tree, features and differences are organized and tagged.
|
||||
@@ -288,11 +289,10 @@
|
||||
<para>
|
||||
You can find documentation on Git at <ulink url='http://git-scm.com/documentation'></ulink>.
|
||||
You can also get an introduction to Git as it applies to the Yocto Project in the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html#git'>Git</ulink>"
|
||||
section in <ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html'>The
|
||||
Yocto Project Development Manual</ulink>.
|
||||
This section overviews Git and describes a minimal set of commands that allow you to be
|
||||
functional using Git.
|
||||
"<ulink url='&YOCTO_DOCS_DEV_URL;#git'>Git</ulink>"
|
||||
section in the Yocto Project Development Manual.
|
||||
These referenced sections overview Git and describe a minimal set of
|
||||
commands that allow you to be functional using Git.
|
||||
<note>
|
||||
You can use as much, or as little, of what Git has to offer to accomplish what
|
||||
you need for your project.
|
||||
@@ -336,11 +336,6 @@ kernel toolkit:
|
||||
</itemizedlist>
|
||||
</para> -->
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</chapter>
|
||||
<!--
|
||||
vim: expandtab tw=80 ts=4
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<chapter id='kernel-doc-intro'>
|
||||
|
||||
@@ -11,7 +12,7 @@
|
||||
The Yocto Project presents the kernel as a fully patched, history-clean Git
|
||||
repository.
|
||||
The Git tree represents the selected features, board support,
|
||||
and configurations extensively tested by Yocto Project.
|
||||
and configurations extensively tested by the Yocto Project.
|
||||
The Yocto Project kernel allows the end user to leverage community
|
||||
best practices to seamlessly manage the development, build and debug cycles.
|
||||
</para>
|
||||
@@ -28,32 +29,39 @@
|
||||
<listitem><para><emphasis>Using the Kernel:</emphasis> Describes best practices
|
||||
and "how-to" information
|
||||
that lets you put the kernel to practical use.
|
||||
Some examples are "How to Build a
|
||||
Project Specific Tree", "How to Examine Changes in a Branch", and "How to
|
||||
Save Kernel Modifications."</para></listitem>
|
||||
Some examples are how to examine changes in a branch and how to
|
||||
save kernel modifications.</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For more information on the kernel, see the following links:
|
||||
For more information on the Linux kernel, see the following links:
|
||||
<itemizedlist>
|
||||
<listitem><para><ulink url='http://ldn.linuxfoundation.org/book/1-a-guide-kernel-development-process'></ulink></para></listitem>
|
||||
<listitem><para><ulink url='http://userweb.kernel.org/~akpm/stuff/tpp.txt'></ulink></para></listitem>
|
||||
<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>
|
||||
<listitem><para>The Linux Foundation's guide for kernel development
|
||||
process - <ulink url='http://ldn.linuxfoundation.org/book/1-a-guide-kernel-development-process'></ulink></para></listitem>
|
||||
<!-- <listitem><para><ulink url='http://userweb.kernel.org/~akpm/stuff/tpp.txt'></ulink></para></listitem> -->
|
||||
<listitem><para>A fairly emcompassing guide on Linux kernel development -
|
||||
<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>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For more discussion on the Yocto Project kernel, you can also see the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html#kernel-overview'>Kernel Overview</ulink>",
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html#kernel-modification-workflow'>Kernel Modification Workflow</ulink>", and
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html#dev-manual-kernel-appendix'>Kernel Modification Example</ulink>" sections all in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html'>The Yocto Project Development Manual</ulink>.
|
||||
For more discussion on the Yocto Project kernel, you can see these sections
|
||||
in <ulink url='&YOCTO_DOCS_DEV_URL;'>The Yocto Project Development Manual</ulink>:
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
"<ulink url='&YOCTO_DOCS_DEV_URL;#kernel-overview'>Kernel Overview</ulink>"</para></listitem>
|
||||
<listitem><para>
|
||||
"<ulink url='&YOCTO_DOCS_DEV_URL;#kernel-modification-workflow'>Kernel Modification Workflow</ulink>"
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
"<ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-kernel-appendix'>Kernel Modification Example</ulink>"</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For general information on the Yocto Project, visit the website at
|
||||
<ulink url='http://www.yoctoproject.org'></ulink>.
|
||||
<ulink url='&YOCTO_HOME_URL;'></ulink>.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<chapter id='kernel-how-to'>
|
||||
|
||||
@@ -10,8 +11,8 @@
|
||||
<title>Introduction</title>
|
||||
<para>
|
||||
This chapter describes how to accomplish tasks involving the kernel's tree structure.
|
||||
This information is designed to help the developer that wants to modify the Yocto Project kernel
|
||||
and contribute changes upstream to the Yocto Project.
|
||||
The information is designed to help the developer that wants to modify the Yocto
|
||||
Project kernel and contribute changes upstream to the Yocto Project.
|
||||
The information covers the following:
|
||||
<itemizedlist>
|
||||
<listitem><para>Tree construction</para></listitem>
|
||||
@@ -24,10 +25,11 @@
|
||||
<section id='tree-construction'>
|
||||
<title>Tree Construction</title>
|
||||
<para>
|
||||
This section describes construction of the Yocto Project kernel repositories as accomplished
|
||||
by the Yocto Project team to create kernel repositories, which are found at
|
||||
<ulink url='http://git.yoctoproject.org/cgit.cgi'>http://git.yoctoproject.org/cgit.cgi</ulink>,
|
||||
that can be shipped as part of a Yocto Project release.
|
||||
This section describes construction of the Yocto Project kernel repositories
|
||||
as accomplished by the Yocto Project team to create kernel repositories.
|
||||
These kernel repositories are found at
|
||||
<ulink url='&YOCTO_GIT_URL;/cgit.cgi'>&YOCTO_GIT_URL;/cgit.cgi</ulink>
|
||||
and can be shipped as part of a Yocto Project release.
|
||||
The team creates these repositories by
|
||||
compiling and executing the set of feature descriptions for every BSP/feature
|
||||
in the product.
|
||||
@@ -50,19 +52,25 @@
|
||||
</literallayout>
|
||||
For another example of how to set up a local Git repository of the Linux Yocto
|
||||
kernel files, see the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html#local-kernel-files'>Linux Yocto Kernel</ulink>" bulleted item in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html'>The Yocto Project Development Manual</ulink>.
|
||||
"<ulink url='&YOCTO_DOCS_DEV_URL;#local-kernel-files'>Linux Yocto Kernel</ulink>" bulleted item in The Yocto Project Development Manual.
|
||||
</para>
|
||||
<para>
|
||||
Once the Git repository is set up on your local machine, you can switch to the
|
||||
<filename>meta</filename> branch within the repository.
|
||||
Here, you can see a snapshot of all the kernel configuration and feature descriptions that are
|
||||
used to build the kernel repository.
|
||||
Once you have cloned the kernel Git repository on your local machine, you can
|
||||
switch to the <filename>meta</filename> branch within the repository.
|
||||
Here is an example that assumes the local Git repository for the kernel is in
|
||||
a top-level directory named <filename>linux-yocto-3.0</filename>:
|
||||
<literallayout class='monospaced'>
|
||||
$ cd ~/linux-yocto-3.0
|
||||
$ git checkout -b meta origin/meta
|
||||
</literallayout>
|
||||
Once you have checked out and switched to the <filename>meta</filename> branch,
|
||||
you can see a snapshot of all the kernel configuration and feature descriptions that are
|
||||
used to build that particular kernel repository.
|
||||
These descriptions are in the form of <filename>.scc</filename> files.
|
||||
</para>
|
||||
<para>
|
||||
You should realize, however, that browsing your local snapshot of feature
|
||||
descriptions and patches is not an effective way to determine what is in a
|
||||
You should realize, however, that browsing your local kernel repository
|
||||
for feature descriptions and patches is not an effective way to determine what is in a
|
||||
particular kernel branch.
|
||||
Instead, you should use Git directly to discover the changes in a branch.
|
||||
Using Git is an efficient and flexible way to inspect changes to the kernel.
|
||||
@@ -76,10 +84,12 @@
|
||||
</note>
|
||||
</para>
|
||||
<para>
|
||||
The following steps describe what happens when the Yocto kernel team constructs
|
||||
the kernel tree given the introduction of a new top-level kernel feature or BSP.
|
||||
These are the actions that effectively create the tree that includes the new feature, patch,
|
||||
or BSP:
|
||||
The following steps describe what happens when the Yocto Project Team constructs
|
||||
the Yocto Linux kernel source Git repository (or tree) found at
|
||||
<ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink> given the
|
||||
introduction of a new top-level kernel feature or BSP.
|
||||
These are the actions that effectively create the tree
|
||||
that includes the new feature, patch or BSP:
|
||||
<orderedlist>
|
||||
<listitem><para>A top-level kernel feature is passed to the kernel build subsystem.
|
||||
Normally, this feature is a BSP for a particular kernel type.</para></listitem>
|
||||
@@ -126,10 +136,11 @@
|
||||
Any add-ons and configuration data are applied to the end of an existing branch.
|
||||
The full repository generation that is found in the
|
||||
official Yocto Project kernel repositories at
|
||||
<ulink url='http://git.yoctoproject.org/cgit.cgi'>http://git.yoctoproject.org/cgit.cgi</ulink>
|
||||
<ulink url='&YOCTO_GIT_URL;/cgit.cgi'>http://git.yoctoproject.org/cgit.cgi</ulink>
|
||||
is the combination of all supported boards and configurations.</para>
|
||||
<para>The technique the Yocto Project team uses is flexible and allows for seamless
|
||||
blending of an immutable history with additional deployment specific patches.
|
||||
blending of an immutable history with additional patches specific to a
|
||||
deployment.
|
||||
Any additions to the kernel become an integrated part of the branches.</para>
|
||||
</note>
|
||||
</para>
|
||||
@@ -226,10 +237,8 @@
|
||||
You can find Git documentation at
|
||||
<ulink url='http://git-scm.com/documentation'></ulink>.
|
||||
You can find a simple overview of using Git with the Yocto Project in the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html#git'>Git</ulink>"
|
||||
section of
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html'>The Yocto
|
||||
Project Development Manual</ulink>.
|
||||
"<ulink url='&YOCTO_DOCS_DEV_URL;#git'>Git</ulink>"
|
||||
section of The Yocto Project Development Manual.
|
||||
</para>
|
||||
|
||||
<section id='change-inspection-kernel-changes-commits'>
|
||||
@@ -244,8 +253,8 @@
|
||||
In projects that have a collection of directories that
|
||||
contain patches to the kernel, it is possible to inspect or "grep" the contents
|
||||
of the directories to get a general feel for the changes.
|
||||
This sort of patch inspection is not an efficient way to determine what has been done to the
|
||||
kernel.
|
||||
This sort of patch inspection is not an efficient way to determine what has been
|
||||
done to the kernel.
|
||||
The reason it is inefficient is because there are many optional patches that are
|
||||
selected based on the kernel type and the feature description.
|
||||
Additionally, patches could exist in directories that are not included in the search.
|
||||
@@ -299,9 +308,11 @@
|
||||
<title>Show a Particular Feature or Branch Change</title>
|
||||
|
||||
<para>
|
||||
Significant features or branches are tagged in the Yocto Project tree to divide
|
||||
changes.
|
||||
Remember to first determine (or add) the tag of interest.
|
||||
Developers use tags in the Yocto Project tree to divide changes for significant
|
||||
features or branches.
|
||||
Once you know a particular tag, you can use Git commands
|
||||
to show changes associated with the tag and find the branches that contain
|
||||
the feature.
|
||||
<note>
|
||||
Because BSP branch, <filename>kernel.org</filename>, and feature tags are all
|
||||
present, there could be many tags.
|
||||
@@ -354,10 +365,10 @@
|
||||
The Yocto Project provides scripts that help you work in a collaborative development
|
||||
environment.
|
||||
For information on these scripts, see the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html#pushing-a-change-upstream'>Pushing a Change Upstream and Requesting a Pull</ulink>" and
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html#submitting-a-patch'>Submitting a Patch Through Email</ulink>" sections in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html'>The
|
||||
Yocto Project Development Manual</ulink>".
|
||||
"<ulink url='&YOCTO_DOCS_DEV_URL;#pushing-a-change-upstream'>Pushing a Change
|
||||
Upstream and Requesting a Pull</ulink>" and
|
||||
"<ulink url='&YOCTO_DOCS_DEV_URL;#submitting-a-patch'>Submitting a Patch Through
|
||||
Email</ulink>" sections in The Yocto Project Development Manual.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -623,8 +634,6 @@
|
||||
community standards for submitting and documenting changes and follow their best practices.
|
||||
For example, kernel patches should follow standards such as:
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
<ulink url='http://userweb.kernel.org/~akpm/stuff/tpp.txt'></ulink></para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url='http://linux.yyz.us/patch-format.html'></ulink></para></listitem>
|
||||
<listitem><para>Documentation/SubmittingPatches (in any linux
|
||||
@@ -637,9 +646,8 @@
|
||||
The messages used to commit changes are a large part of these standards.
|
||||
Consequently, be sure that the headers for each commit have the required information.
|
||||
For information on how to follow the Yocto Project commit message standards, see the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html#how-to-submit-a-change'>How to Submit a Change</ulink>" section in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html'>The
|
||||
Yocto Project Development Manual</ulink>".
|
||||
"<ulink url='&YOCTO_DOCS_DEV_URL;#how-to-submit-a-change'>How to Submit a
|
||||
Change</ulink>" section in The Yocto Project Development Manual.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -741,7 +749,8 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The following commands illustrate how you can condense and merge two BSPs into a second SCM:
|
||||
The following commands illustrate how you can condense and merge two BSPs into a
|
||||
second SCM:
|
||||
<literallayout class='monospaced'>
|
||||
> git checkout yocto/standard/common-pc/base
|
||||
> git merge yocto/standard/common-pc-64/base
|
||||
@@ -772,10 +781,9 @@
|
||||
existing similar BSP.
|
||||
The information is introductory in nature and does not provide step-by-step examples.
|
||||
For detailed information on how to create a BSP given an existing similar BSP, see
|
||||
the "<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html#dev-manual-bsp-appendix'>BSP Development Example</ulink>" appendix in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html'>The
|
||||
Yocto Project Development Manual</ulink>, or see the
|
||||
<ulink url='https://wiki.yoctoproject.org/wiki/Transcript:_creating_one_generic_Atom_BSP_from_another'>Transcript:_creating_one_generic_Atom_BSP_from_another</ulink>
|
||||
the "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-bsp-appendix'>BSP Development
|
||||
Example</ulink>" appendix in the Yocto Project Development Manual, or see the
|
||||
<ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_creating_one_generic_Atom_BSP_from_another'>Transcript:_creating_one_generic_Atom_BSP_from_another</ulink>
|
||||
wiki page.
|
||||
</para>
|
||||
|
||||
@@ -792,7 +800,7 @@
|
||||
your BSP easier.
|
||||
You can find all the BSPs that are supported and ship with the Yocto Project
|
||||
on the Yocto Project's Download page at
|
||||
<ulink url='http://www.yoctoproject.org/download'></ulink>.</para></listitem>
|
||||
<ulink url='&YOCTO_HOME_URL;/download'></ulink>.</para></listitem>
|
||||
<listitem><para><emphasis>Be sure you have the Base BSP:</emphasis>
|
||||
You need to either have the Yocto Project Git repository set up or download
|
||||
the tarball of the base BSP.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<book id='kernel-manual' lang='en'
|
||||
xmlns:xi="http://www.w3.org/2003/XInclude"
|
||||
@@ -48,10 +49,20 @@
|
||||
<date>6 October 2011</date>
|
||||
<revremark>Released with the Yocto Project 1.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>1.1.1</revnumber>
|
||||
<date>15 March 2012</date>
|
||||
<revremark>Released with the Yocto Project 1.1.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>1.1.2</revnumber>
|
||||
<date>July 2012</date>
|
||||
<revremark>Released with the Yocto Project 1.1.2 Release.</revremark>
|
||||
</revision>
|
||||
</revhistory>
|
||||
|
||||
<copyright>
|
||||
<year>2010-2011</year>
|
||||
<year>©RIGHT_YEAR;</year>
|
||||
<holder>Linux Foundation</holder>
|
||||
</copyright>
|
||||
|
||||
@@ -63,9 +74,9 @@
|
||||
<note>
|
||||
Due to production processes, there could be differences between the Yocto Project
|
||||
documentation bundled in the release tarball and
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/kernel-manual/kernel-manual.html'>
|
||||
<ulink url='&YOCTO_DOCS_KERNEL_URL;'>
|
||||
The Yocto Project Kernel Architecture and Use Manual</ulink> on
|
||||
the <ulink url='http://www.yoctoproject.org'>Yocto Project</ulink> website.
|
||||
the <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink> website.
|
||||
For the latest version of this manual, see the manual on the website.
|
||||
</note>
|
||||
</legalnotice>
|
||||
|
||||
@@ -654,7 +654,7 @@ hr {
|
||||
|
||||
|
||||
.tip, .warning, .caution, .note {
|
||||
border-color: #aaa;
|
||||
border-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
@@ -662,24 +662,24 @@ hr {
|
||||
.warning table th,
|
||||
.caution table th,
|
||||
.note table th {
|
||||
border-bottom-color: #aaa;
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
.warning {
|
||||
background-color: #fea;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.caution {
|
||||
background-color: #fea;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.tip {
|
||||
background-color: #eff;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.note {
|
||||
background-color: #dfc;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.glossary dl dt,
|
||||
@@ -946,8 +946,8 @@ table {
|
||||
|
||||
.tip,
|
||||
.note {
|
||||
background: #666666;
|
||||
color: #fff;
|
||||
background: #f0f0f2;
|
||||
color: #333;
|
||||
padding: 20px;
|
||||
margin: 20px;
|
||||
}
|
||||
@@ -958,11 +958,26 @@ table {
|
||||
margin: 0em;
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.tip a,
|
||||
.note a {
|
||||
color: #fff;
|
||||
color: #333;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.footnote {
|
||||
font-size: small;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
/* Changes the announcement text */
|
||||
.tip h3,
|
||||
.warning h3,
|
||||
.caution h3,
|
||||
.note h3 {
|
||||
font-size:large;
|
||||
color: #00557D;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<chapter id="platdev">
|
||||
<title>Platform Development with the Yocto Project</title>
|
||||
@@ -82,7 +83,7 @@
|
||||
The current release of the Yocto Project no longer supports the Anjuta plug-in.
|
||||
However, the Poky Anjuta Plug-in is available to download directly from the Poky
|
||||
Git repository located through the web interface at
|
||||
<ulink url="http://git.yoctoproject.org/"></ulink> under IDE Plugins.
|
||||
<ulink url="&YOCTO_GIT_URL;"></ulink> under IDE Plugins.
|
||||
The community is free to continue supporting it beyond the Yocto Project 0.9
|
||||
Release.
|
||||
</note>
|
||||
@@ -91,10 +92,8 @@
|
||||
with other plug-ins installed into the Eclipse IDE.
|
||||
Once you have your environment setup you need to configure the Eclipse plug-in.
|
||||
For information on how to install and configure the Eclipse plug-in, see the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/adt-manual/adt-manual.html#adt-eclipse'>
|
||||
"Working Within Eclipse"</ulink> chapter in the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/adt-manual/adt-manual.html'>
|
||||
"Application Development Toolkit (ADT) User's Guide."</ulink>
|
||||
"<ulink url='&YOCTO_DOCS_ADT_URL;#adt-eclipse'>Working Within Eclipse</ulink>" chapter in the
|
||||
Yocto Project Application Development Toolkit (ADT) User's Guide.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -102,8 +101,8 @@
|
||||
<title>External Development Using the QEMU Emulator</title>
|
||||
<para>
|
||||
Running Poky QEMU images is covered in the
|
||||
<ulink url="http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html">
|
||||
Yocto Project Quick Start</ulink> in the "A Quick Test Run" section.
|
||||
"<ulink url='&YOCTO_DOCS_ADT_URL;#test-run'>A Quick Test Run</ulink>" section of
|
||||
the Yocto Project Quick Start.
|
||||
</para>
|
||||
<para>
|
||||
The QEMU images shipped with the Yocto Project contain complete toolchains
|
||||
@@ -162,8 +161,8 @@
|
||||
<para>
|
||||
Working directly with the Yocto Project is a fast and effective development technique.
|
||||
The idea is that you can directly edit files in a working directory
|
||||
(<glossterm><link linkend='var-WORKDIR'>WORKDIR</link></glossterm>)
|
||||
or the source directory (<glossterm><link linkend='var-S'>S</link></glossterm>)
|
||||
(<filename><link linkend='var-WORKDIR'>WORKDIR</link></filename>)
|
||||
or the source directory (<filename><link linkend='var-S'>S</link></filename>)
|
||||
and then force specific tasks to rerun in order to test the changes.
|
||||
An example session working on the matchbox-desktop package might
|
||||
look like this:
|
||||
@@ -203,16 +202,16 @@
|
||||
<para>
|
||||
It is useful when making changes directly to the work directory files to do
|
||||
so using the Quilt tool as detailed in the
|
||||
<link linkend='usingpoky-modifying-packages-quilt'>
|
||||
Modifying Package Source Code with Quilt</link> section.
|
||||
"<link linkend='usingpoky-modifying-packages-quilt'>Modifying Package Source Code with Quilt</link>"
|
||||
section.
|
||||
Using Quilt, you can copy patches into the recipe directory and use the patches directly
|
||||
through use of the <glossterm><link linkend='var-SRC_URI'>SRC_URI</link></glossterm> variable.
|
||||
through use of the <filename><link linkend='var-SRC_URI'>SRC_URI</link></filename> variable.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For a review of the skills used in this section, see the
|
||||
<link linkend="usingpoky-components-bitbake">BitBake</link> and
|
||||
<link linkend="usingpoky-debugging-taskrunning">Running Specific Tasks</link> sections
|
||||
"<link linkend="usingpoky-components-bitbake">BitBake</link>" and
|
||||
"<link linkend="usingpoky-debugging-taskrunning">Running Specific Tasks</link>" sections
|
||||
in this manual.
|
||||
</para>
|
||||
</section>
|
||||
@@ -231,7 +230,7 @@
|
||||
still defined so you can use commands such as <filename>configure</filename> and
|
||||
<filename>make</filename>.
|
||||
The commands execute just as if the Yocto Project build system were executing them.
|
||||
Consequently, workng this way can be helpful when debugging a build or preparing
|
||||
Consequently, working this way can be helpful when debugging a build or preparing
|
||||
software to be used with the Yocto Project build system.
|
||||
</para>
|
||||
|
||||
@@ -262,7 +261,7 @@
|
||||
or <filename>compile</filename> commands as if they were being run by
|
||||
the Yocto Project build system itself.
|
||||
As noted earlier, the working directory also automatically changes to the
|
||||
source directory (<glossterm><link linkend='var-S'>S</link></glossterm>).
|
||||
source directory (<filename><link linkend='var-S'>S</link></filename>).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -272,8 +271,8 @@
|
||||
<para>
|
||||
The default shell used by <filename>devshell</filename> is xterm.
|
||||
You can use other terminal forms by setting the
|
||||
<glossterm><link linkend='var-TERMCMD'>TERMCMD</link></glossterm> and
|
||||
<glossterm><link linkend='var-TERMCMDRUN'>TERMCMDRUN</link></glossterm> variables
|
||||
<filename><link linkend='var-TERMCMD'>TERMCMD</link></filename> and
|
||||
<filename><link linkend='var-TERMCMDRUN'>TERMCMDRUN</link></filename> variables
|
||||
in the Yocto Project's <filename>local.conf</filename> file found in the build
|
||||
directory.
|
||||
For examples of the other options available, see the "UI/Interaction Configuration"
|
||||
@@ -284,7 +283,7 @@
|
||||
|
||||
<para>
|
||||
Because an external shell is launched rather than opening directly into the
|
||||
original terminal window, it allows easier interaction with Bitbake's multiple
|
||||
original terminal window, it allows easier interaction with BitBake's multiple
|
||||
threads as well as accomodates a future client/server split.
|
||||
</para>
|
||||
|
||||
@@ -294,7 +293,7 @@
|
||||
instead of just using <filename>gcc</filename>.
|
||||
The same applies to other applications such as <filename>binutils</filename>,
|
||||
<filename>libtool</filename> and so forth.
|
||||
The Yocto Project has setup environment variables such as <filename>CC</filename>
|
||||
BitBake sets up environment variables such as <filename>CC</filename>
|
||||
to assist applications, such as <filename>make</filename> to find the correct tools.</para>
|
||||
<para>It is also worth noting that <filename>devshell</filename> still works over
|
||||
X11 forwarding and similar situations</para>
|
||||
@@ -333,7 +332,7 @@
|
||||
It also allows you to perform post-mortem style analysis of program crashes.
|
||||
GDB is available as a package within the Yocto Project and by default is
|
||||
installed in sdk images.
|
||||
See <xref linkend='ref-images'>Reference: Images</xref> for a description of these
|
||||
See the "<link linkend='ref-images'>Reference: Images</link>" appendix for a description of these
|
||||
images.
|
||||
You can find information on GDB at <ulink url="http://sourceware.org/gdb/"/>.
|
||||
</para>
|
||||
@@ -671,7 +670,7 @@
|
||||
<para>
|
||||
A graphical user interface for OProfile is also available.
|
||||
You can download and build this interface from the Yocto Project at
|
||||
<ulink url="http://git.yoctoproject.org/cgit.cgi/oprofileui/"></ulink>.
|
||||
<ulink url="&YOCTO_GIT_URL;/cgit.cgi/oprofileui/"></ulink>.
|
||||
If the "tools-profile" image feature is selected, all necessary binaries
|
||||
are installed onto the target device for OProfileUI interaction.
|
||||
</para>
|
||||
@@ -679,7 +678,7 @@
|
||||
<para>
|
||||
Even though the Yocto Project usually includes all needed patches on the target device, you
|
||||
might find you need other OProfile patches for recent OProfileUI features.
|
||||
If so, see the <ulink url='http://git.yoctoproject.org/cgit.cgi/oprofileui/tree/README'>
|
||||
If so, see the <ulink url='&YOCTO_GIT_URL;/cgit.cgi/oprofileui/tree/README'>
|
||||
OProfileUI README</ulink> for the most recent information.
|
||||
</para>
|
||||
|
||||
@@ -765,8 +764,8 @@
|
||||
is not always necessary to actually have them on the device for OProfile use.
|
||||
All that is needed is a copy of the filesystem with the debug symbols present
|
||||
on the viewer system.
|
||||
The <link linkend='platdev-gdb-remotedebug-launch-gdb'>Launching GDB
|
||||
on the Host Computer</link> section covers how to create such a directory with
|
||||
The "<link linkend='platdev-gdb-remotedebug-launch-gdb'>Launching GDB on the Host Computer</link>"
|
||||
section covers how to create such a directory with
|
||||
the Yocto Project and how to use the OProfileUI Settings dialog to specify the location.
|
||||
If you specify the directory, it will be used when the file checksums
|
||||
match those on the system you are profiling.
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<chapter id='extendpoky'>
|
||||
|
||||
<title>Extending the Yocto Project</title>
|
||||
<title>Common Tasks</title>
|
||||
<para>
|
||||
This chapter provides information about how to extend the functionality
|
||||
already present in the Yocto Project.
|
||||
The chapter also documents standard tasks such as adding new
|
||||
This chapter describes standard tasks such as adding new
|
||||
software packages, extending or customizing images or porting the Yocto Project to
|
||||
new hardware (adding a new machine).
|
||||
The chapter also describes ways to modify package source code, combine multiple
|
||||
versions of library files into a single image, track license changes, and handle
|
||||
a package name alias.
|
||||
Finally, the chapter contains advice about how to make changes to the
|
||||
Yocto Project to achieve the best results.
|
||||
</para>
|
||||
@@ -23,7 +25,7 @@
|
||||
variables.
|
||||
For information on variables that are useful for recipes and for information about recipe naming
|
||||
issues, see the
|
||||
<link linkend='ref-varlocality-recipe-required'>Required</link> section for recipe variables.
|
||||
"<link linkend='ref-varlocality-recipe-required'>Required</link>" section for recipe variables.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -113,7 +115,7 @@
|
||||
<para>
|
||||
The variable <filename><link linkend='var-LIC_FILES_CHKSUM'>LIC_FILES_CHKSUM</link>
|
||||
</filename> is used to track source license changes as described in the
|
||||
<link linkend='usingpoky-configuring-LIC_FILES_CHKSUM'>Track License Change</link>
|
||||
"<link linkend='usingpoky-configuring-LIC_FILES_CHKSUM'>Track License Change</link>"
|
||||
section.
|
||||
You can quickly create Autotool-based recipes in a manner similar to the previous example.
|
||||
</para>
|
||||
@@ -531,10 +533,9 @@
|
||||
<para>
|
||||
For a complete example that shows how to add a new machine to the Yocto Project,
|
||||
see the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html#dev-manual-bsp-appendix'>
|
||||
<ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-bsp-appendix'>
|
||||
BSP Development Example</ulink> in Appendix A of
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html'>
|
||||
The Yocto Project Development Manual</ulink>.
|
||||
The Yocto Project Development Manual.
|
||||
</para>
|
||||
|
||||
<section id="platdev-newmachine-conffile">
|
||||
@@ -658,6 +659,412 @@
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id="usingpoky-modifing-packages">
|
||||
<title>Modifying Package Source Code</title>
|
||||
<para>
|
||||
Although the Yocto Project is usually used to build software, you can use it to modify software.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
During a build, source is available in the
|
||||
<filename><link linkend='var-WORKDIR'>WORKDIR</link></filename> directory.
|
||||
The actual location depends on the type of package and the architecture of the target device.
|
||||
For a standard recipe not related to
|
||||
<filename><link linkend='var-MACHINE'>MACHINE</link></filename>, the location is
|
||||
<filename>tmp/work/PACKAGE_ARCH-poky-TARGET_OS/PN-PV-PR/</filename>.
|
||||
For target device-dependent packages, you should use the <filename>MACHINE</filename>
|
||||
variable instead of
|
||||
<filename><link linkend='var-PACKAGE_ARCH'>PACKAGE_ARCH</link></filename>
|
||||
in the directory name.
|
||||
</para>
|
||||
|
||||
<tip>
|
||||
Be sure the package recipe sets the
|
||||
<filename><link linkend='var-S'>S</link></filename> variable to something
|
||||
other than the standard <filename>WORKDIR/PN-PV/</filename> value.
|
||||
</tip>
|
||||
|
||||
<para>
|
||||
After building a package, you can modify the package source code without problems.
|
||||
The easiest way to test your changes is by calling the
|
||||
<filename>compile</filename> task as shown in the following example:
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake -c compile -f NAME_OF_PACKAGE
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The <filename>-f</filename> or <filename>--force</filename>
|
||||
option forces re-execution of the specified task.
|
||||
You can call other tasks this way as well.
|
||||
But note that all the modifications in
|
||||
<filename><link linkend='var-WORKDIR'>WORKDIR</link></filename>
|
||||
are gone once you execute <filename>-c clean</filename> for a package.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="usingpoky-modifying-packages-quilt">
|
||||
<title>Modifying Package Source Code with Quilt</title>
|
||||
|
||||
<para>
|
||||
By default Poky uses <ulink url='http://savannah.nongnu.org/projects/quilt'>Quilt</ulink>
|
||||
to manage patches in the <filename>do_patch</filename> task.
|
||||
This is a powerful tool that you can use to track all modifications to package sources.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Before modifying source code, it is important to notify Quilt so it can track the changes
|
||||
into the new patch file:
|
||||
<literallayout class='monospaced'>
|
||||
$ quilt new NAME-OF-PATCH.patch
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
After notifying Quilt, add all modified files into that patch:
|
||||
<literallayout class='monospaced'>
|
||||
$ quilt add file1 file2 file3
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
You can now start editing.
|
||||
Once you are done editing, you need to use Quilt to generate the final patch that
|
||||
will contain all your modifications.
|
||||
<literallayout class='monospaced'>
|
||||
$ quilt refresh
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
You can find the resulting patch file in the
|
||||
<filename>patches/</filename> subdirectory of the source
|
||||
(<filename><link linkend='var-S'>S</link></filename>) directory.
|
||||
For future builds, you should copy the patch into the Yocto Project metadata and add it into the
|
||||
<filename><link linkend='var-SRC_URI'>SRC_URI</link></filename> of a recipe.
|
||||
Here is an example:
|
||||
<literallayout class='monospaced'>
|
||||
SRC_URI += "file://NAME-OF-PATCH.patch"
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Finally, don't forget to 'bump' the
|
||||
<filename><link linkend='var-PR'>PR</link></filename> value in the same recipe since
|
||||
the resulting packages have changed.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="building-multiple-architecture-libraries-into-one-image">
|
||||
<title>Combining Multiple Versions of Library Files into One Image</title>
|
||||
|
||||
<para>
|
||||
The build system offers the ability to build libraries with different
|
||||
target optimizations or architecture formats and combine these together
|
||||
into one system image.
|
||||
You can link different binaries in the image
|
||||
against the different libraries as needed for specific use cases.
|
||||
This feature is called "Multilib."
|
||||
</para>
|
||||
|
||||
<para>
|
||||
An example would be where you have most of a system compiled in 32-bit
|
||||
mode using 32-bit libraries, but you have something large, like a database
|
||||
engine, that needs to be a 64-bit application and use 64-bit libraries.
|
||||
Multilib allows you to get the best of both 32-bit and 64-bit libraries.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
While the Multilib feature is most commonly used for 32 and 64-bit differences,
|
||||
the approach the build system uses facilitates different target optimizations.
|
||||
You could compile some binaries to use one set of libraries and other binaries
|
||||
to use other different sets of libraries.
|
||||
The libraries could differ in architecture, compiler options, or other
|
||||
optimizations.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This section overviews the Multilib process only.
|
||||
For more details on how to implement Multilib, see the
|
||||
<ulink url='&YOCTO_WIKI_URL;/wiki/Multilib'>Multilib</ulink> wiki
|
||||
page.
|
||||
</para>
|
||||
|
||||
<section id='preparing-to-use-multilib'>
|
||||
<title>Preparing to use Multilib</title>
|
||||
|
||||
<para>
|
||||
User-specific requirements drive the Multilib feature,
|
||||
Consequently, there is no one "out-of-the-box" configuration that likely
|
||||
exists to meet your needs.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
In order to enable Multilib, you first need to ensure your recipe is
|
||||
extended to support multiple libraries.
|
||||
Many standard recipes are already extended and support multiple libraries.
|
||||
You can check in the <filename>meta/conf/multilib.conf</filename>
|
||||
configuration file in the Yocto Project files directory to see how this is
|
||||
done using the <filename>BBCLASSEXTEND</filename> variable.
|
||||
Eventually, all recipes will be covered and this list will be unneeded.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For the most part, the Multilib class extension works automatically to
|
||||
extend the package name from <filename>${PN}</filename> to
|
||||
<filename>${MLPREFIX}${PN}</filename>, where <filename>MLPREFIX</filename>
|
||||
is the particular multilib (e.g. "lib32-" or "lib64-").
|
||||
Standard variables such as <filename>DEPENDS</filename>,
|
||||
<filename>RDEPENDS</filename>, <filename>RPROVIDES</filename>,
|
||||
<filename>RRECOMMENDS</filename>, <filename>PACKAGES</filename>, and
|
||||
<filename>PACKAGES_DYNAMIC</filename> are automatically extended by the system.
|
||||
If you are extending any manual code in the recipe, you can use the
|
||||
<filename>${MLPREFIX}</filename> variable to ensure those names are extended
|
||||
correctly.
|
||||
This automatic extension code resides in <filename>multilib.bbclass</filename>.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='using-multilib'>
|
||||
<title>Using Multilib</title>
|
||||
|
||||
<para>
|
||||
After you have set up the recipes, you need to define the actual
|
||||
combination of multiple libraries you want to build.
|
||||
You accomplish this through your <filename>local.conf</filename>
|
||||
configuration file in the Yocto Project build directory.
|
||||
An example configuration would be as follows:
|
||||
<literallayout class='monospaced'>
|
||||
MACHINE = "qemux86-64"
|
||||
require conf/multilib.conf
|
||||
MULTILIBS = "multilib:lib32"
|
||||
DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
|
||||
MULTILIB_IMAGE_INSTALL = "lib32-connman"
|
||||
</literallayout>
|
||||
This example enables an
|
||||
additional library named <filename>lib32</filename> alongside the
|
||||
normal target packages.
|
||||
When combining these "lib32" alternatives, the example uses "x86" for tuning.
|
||||
For information on this particular tuning, see
|
||||
<filename>meta/conf/machine/include/ia32/arch-ia32.inc</filename>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The example then includes <filename>lib32-connman</filename>
|
||||
in all the images, which illustrates one method of including a
|
||||
multiple library dependency.
|
||||
You can use a normal image build to include this dependency,
|
||||
for example:
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake core-image-sato
|
||||
</literallayout>
|
||||
You can also build Multilib packages specifically with a command like this:
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake lib32-connman
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='additional-implementation-details'>
|
||||
<title>Additional Implementation Details</title>
|
||||
|
||||
<para>
|
||||
Different packaging systems have different levels of native Multilib
|
||||
support.
|
||||
For the RPM Package Management System, the following implementation details
|
||||
exist:
|
||||
<itemizedlist>
|
||||
<listitem><para>A unique architecture is defined for the Multilib packages,
|
||||
along with creating a unique deploy folder under
|
||||
<filename>tmp/deploy/rpm</filename> in the Yocto
|
||||
Project build directory.
|
||||
For example, consider <filename>lib32</filename> in a
|
||||
<filename>qemux86-64</filename> image.
|
||||
The possible architectures in the system are "all", "qemux86_64",
|
||||
"lib32_qemux86_64", and "lib32_x86".</para></listitem>
|
||||
<listitem><para>The <filename>${MLPREFIX}</filename> variable is stripped from
|
||||
<filename>${PN}</filename> during RPM packaging.
|
||||
The naming for a normal RPM package and a Multilib RPM package in a
|
||||
<filename>qemux86-64</filename> system resolves to something similar to
|
||||
<filename>bash-4.1-r2.x86_64.rpm</filename> and
|
||||
<filename>bash-4.1.r2.lib32_x86.rpm</filename>, respectively.
|
||||
</para></listitem>
|
||||
<listitem><para>When installing a Multilib image, the RPM backend first
|
||||
installs the base image and then installs the Multilib libraries.
|
||||
</para></listitem>
|
||||
<listitem><para>The build system relies on RPM to resolve the identical files in the
|
||||
two (or more) Multilib packages.</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For the IPK Package Management System, the following implementation details exist:
|
||||
<itemizedlist>
|
||||
<listitem><para>The <filename>${MLPREFIX}</filename> is not stripped from
|
||||
<filename>${PN}</filename> during IPK packaging.
|
||||
The naming for a normal RPM package and a Multilib IPK package in a
|
||||
<filename>qemux86-64</filename> system resolves to something like
|
||||
<filename>bash_4.1-r2.x86_64.ipk</filename> and
|
||||
<filename>lib32-bash_4.1-rw_x86.ipk</filename>, respectively.
|
||||
</para></listitem>
|
||||
<listitem><para>The IPK deploy folder is not modified with
|
||||
<filename>${MLPREFIX}</filename> because packages with and without
|
||||
the Multilib feature can exist in the same folder due to the
|
||||
<filename>${PN}</filename> differences.</para></listitem>
|
||||
<listitem><para>IPK defines a sanity check for Multilib installation
|
||||
using certain rules for file comparison, overridden, etc.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id="usingpoky-configuring-LIC_FILES_CHKSUM">
|
||||
<title>Tracking License Changes</title>
|
||||
|
||||
<para>
|
||||
The license of an upstream project might change in the future. In order to prevent these changes
|
||||
going unnoticed, the Yocto Project provides a
|
||||
<filename><link linkend='var-LIC_FILES_CHKSUM'>LIC_FILES_CHKSUM</link></filename>
|
||||
variable to track changes to the license text. The checksums are validated at the end of the
|
||||
configure step, and if the checksums do not match, the build will fail.
|
||||
</para>
|
||||
|
||||
<section id="usingpoky-specifying-LIC_FILES_CHKSUM">
|
||||
<title>Specifying the <filename>LIC_FILES_CHKSUM</filename> Variable</title>
|
||||
|
||||
<para>
|
||||
The <filename>LIC_FILES_CHKSUM</filename>
|
||||
variable contains checksums of the license text in the source code for the recipe.
|
||||
Following is an example of how to specify <filename>LIC_FILES_CHKSUM</filename>:
|
||||
<literallayout class='monospaced'>
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=xxxx \
|
||||
file://licfile1.txt;beginline=5;endline=29;md5=yyyy \
|
||||
file://licfile2.txt;endline=50;md5=zzzz \
|
||||
..."
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The Yocto Project uses the
|
||||
<filename><link linkend='var-S'>S</link></filename> variable as the
|
||||
default directory used when searching files listed in
|
||||
<filename>LIC_FILES_CHKSUM</filename>.
|
||||
The previous example employs the default directory.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
You can also use relative paths as shown in the following example:
|
||||
<literallayout class='monospaced'>
|
||||
LIC_FILES_CHKSUM = "file://src/ls.c;startline=5;endline=16;\
|
||||
md5=bb14ed3c4cda583abc85401304b5cd4e"
|
||||
LIC_FILES_CHKSUM = "file://../license.html;md5=5c94767cedb5d6987c902ac850ded2c6"
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
In this example, the first line locates a file in
|
||||
<filename><link linkend='var-S'>S</link>/src/ls.c</filename>.
|
||||
The second line refers to a file in
|
||||
<filename><link linkend='var-WORKDIR'>WORKDIR</link></filename>, which is the parent
|
||||
of <filename>S</filename>.
|
||||
</para>
|
||||
<para>
|
||||
Note that this variable is mandatory for all recipes, unless the
|
||||
<filename>LICENSE</filename> variable is set to "CLOSED".
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="usingpoky-LIC_FILES_CHKSUM-explanation-of-syntax">
|
||||
<title>Explanation of Syntax</title>
|
||||
<para>
|
||||
As mentioned in the previous section, the
|
||||
<filename>LIC_FILES_CHKSUM</filename> variable lists all the
|
||||
important files that contain the license text for the source code.
|
||||
It is possible to specify a checksum for an entire file, or a specific section of a
|
||||
file (specified by beginning and ending line numbers with the "beginline" and "endline"
|
||||
parameters, respectively).
|
||||
The latter is useful for source files with a license notice header,
|
||||
README documents, and so forth.
|
||||
If you do not use the "beginline" parameter, then it is assumed that the text begins on the
|
||||
first line of the file.
|
||||
Similarly, if you do not use the "endline" parameter, it is assumed that the license text
|
||||
ends with the last line of the file.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The "md5" parameter stores the md5 checksum of the license text.
|
||||
If the license text changes in any way as compared to this parameter
|
||||
then a mismatch occurs.
|
||||
This mismatch triggers a build failure and notifies the developer.
|
||||
Notification allows the developer to review and address the license text changes.
|
||||
Also note that if a mismatch occurs during the build, the correct md5
|
||||
checksum is placed in the build log and can be easily copied to the recipe.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
There is no limit to how many files you can specify using the
|
||||
<filename>LIC_FILES_CHKSUM</filename> variable.
|
||||
Generally, however, every project requires a few specifications for license tracking.
|
||||
Many projects have a "COPYING" file that stores the license information for all the source
|
||||
code files.
|
||||
This practice allows you to just track the "COPYING" file as long as it is kept up to date.
|
||||
</para>
|
||||
|
||||
<tip>
|
||||
If you specify an empty or invalid "md5" parameter, BitBake returns an md5 mis-match
|
||||
error and displays the correct "md5" parameter value during the build.
|
||||
The correct parameter is also captured in the build log.
|
||||
</tip>
|
||||
|
||||
<tip>
|
||||
If the whole file contains only license text, you do not need to use the "beginline" and
|
||||
"endline" parameters.
|
||||
</tip>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id="usingpoky-configuring-DISTRO_PN_ALIAS">
|
||||
<title>Handling a Package Name Alias</title>
|
||||
<para>
|
||||
Sometimes a package name you are using might exist under an alias or as a similarly named
|
||||
package in a different distribution.
|
||||
The Yocto Project implements a <filename>distro_check</filename>
|
||||
task that automatically connects to major distributions
|
||||
and checks for these situations.
|
||||
If the package exists under a different name in a different distribution, you get a
|
||||
<filename>distro_check</filename> mismatch.
|
||||
You can resolve this problem by defining a per-distro recipe name alias using the
|
||||
<filename><link linkend='var-DISTRO_PN_ALIAS'>DISTRO_PN_ALIAS</link></filename> variable.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Following is an example that shows how you specify the <filename>DISTRO_PN_ALIAS</filename>
|
||||
variable:
|
||||
<literallayout class='monospaced'>
|
||||
DISTRO_PN_ALIAS_pn-PACKAGENAME = "distro1=package_name_alias1 \
|
||||
distro2=package_name_alias2 \
|
||||
distro3=package_name_alias3 \
|
||||
..."
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If you have more than one distribution alias, separate them with a space.
|
||||
Note that the Yocto Project currently automatically checks the
|
||||
Fedora, OpenSuSE, Debian, Ubuntu,
|
||||
and Mandriva distributions for source package recipes without having to specify them
|
||||
using the <filename>DISTRO_PN_ALIAS</filename> variable.
|
||||
For example, the following command generates a report that lists the Linux distributions
|
||||
that include the sources for each of the Yocto Project recipes.
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake world -f -c distro_check
|
||||
</literallayout>
|
||||
The results are stored in the <filename>build/tmp/log/distro_check-${DATETIME}.results</filename>
|
||||
file found in the Yocto Project files area.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="usingpoky-changes">
|
||||
<title>Making and Maintaining Changes</title>
|
||||
<para>
|
||||
@@ -669,7 +1076,7 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The Yocto Project supports a <link linkend='usingpoky-changes-layers'>"layers"</link> concept.
|
||||
The Yocto Project supports a "<link linkend='usingpoky-changes-layers'>layers</link>" concept.
|
||||
If you use layers properly, you can ease future upgrades and allow segregation
|
||||
between the Yocto Project core and a given developer's changes.
|
||||
The following section provides more advice on managing changes to the Yocto Project.
|
||||
@@ -914,7 +1321,7 @@
|
||||
Experience shows that buildbot is a good fit for this role.
|
||||
What works well is to configure buildbot to make two types of builds:
|
||||
incremental and full (from scratch).
|
||||
See <ulink url='http://www.yoctoproject.org:8010'>the buildbot for the
|
||||
See <ulink url='&YOCTO_AB_URL;:8010'>the buildbot for the
|
||||
Yocto Project</ulink> for an example implementation that uses buildbot.
|
||||
</para>
|
||||
|
||||
@@ -976,411 +1383,6 @@
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id="usingpoky-modifing-packages">
|
||||
<title>Modifying Package Source Code</title>
|
||||
<para>
|
||||
Although the Yocto Project is usually used to build software, you can use it to modify software.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
During a build, source is available in the
|
||||
<filename><link linkend='var-WORKDIR'>WORKDIR</link></filename> directory.
|
||||
The actual location depends on the type of package and the architecture of the target device.
|
||||
For a standard recipe not related to
|
||||
<filename><link linkend='var-MACHINE'>MACHINE</link></filename>, the location is
|
||||
<filename>tmp/work/PACKAGE_ARCH-poky-TARGET_OS/PN-PV-PR/</filename>.
|
||||
For target device-dependent packages, you should use the <filename>MACHINE</filename>
|
||||
variable instead of
|
||||
<filename><link linkend='var-PACKAGE_ARCH'>PACKAGE_ARCH</link></filename>
|
||||
in the directory name.
|
||||
</para>
|
||||
|
||||
<tip>
|
||||
Be sure the package recipe sets the
|
||||
<filename><link linkend='var-S'>S</link></filename> variable to something
|
||||
other than the standard <filename>WORKDIR/PN-PV/</filename> value.
|
||||
</tip>
|
||||
|
||||
<para>
|
||||
After building a package, you can modify the package source code without problems.
|
||||
The easiest way to test your changes is by calling the
|
||||
<filename>compile</filename> task as shown in the following example:
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake -c compile -f NAME_OF_PACKAGE
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The <filename>-f</filename> or <filename>--force</filename>
|
||||
option forces re-execution of the specified task.
|
||||
You can call other tasks this way as well.
|
||||
But note that all the modifications in
|
||||
<filename><link linkend='var-WORKDIR'>WORKDIR</link></filename>
|
||||
are gone once you execute <filename>-c clean</filename> for a package.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="usingpoky-modifying-packages-quilt">
|
||||
<title>Modifying Package Source Code with Quilt</title>
|
||||
|
||||
<para>
|
||||
By default Poky uses <ulink url='http://savannah.nongnu.org/projects/quilt'>Quilt</ulink>
|
||||
to manage patches in the <filename>do_patch</filename> task.
|
||||
This is a powerful tool that you can use to track all modifications to package sources.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Before modifying source code, it is important to notify Quilt so it can track the changes
|
||||
into the new patch file:
|
||||
<literallayout class='monospaced'>
|
||||
$ quilt new NAME-OF-PATCH.patch
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
After notifying Quilt, add all modified files into that patch:
|
||||
<literallayout class='monospaced'>
|
||||
$ quilt add file1 file2 file3
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
You can now start editing.
|
||||
Once you are done editing, you need to use Quilt to generate the final patch that
|
||||
will contain all your modifications.
|
||||
<literallayout class='monospaced'>
|
||||
$ quilt refresh
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
You can find the resulting patch file in the
|
||||
<filename>patches/</filename> subdirectory of the source
|
||||
(<filename><link linkend='var-S'>S</link></filename>) directory.
|
||||
For future builds, you should copy the patch into the Yocto Project metadata and add it into the
|
||||
<filename><link linkend='var-SRC_URI'>SRC_URI</link></filename> of a recipe.
|
||||
Here is an example:
|
||||
<literallayout class='monospaced'>
|
||||
SRC_URI += "file://NAME-OF-PATCH.patch"
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Finally, don't forget to 'bump' the
|
||||
<filename><link linkend='var-PR'>PR</link></filename> value in the same recipe since
|
||||
the resulting packages have changed.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="building-multiple-architecture-libraries-into-one-image">
|
||||
<title>Combining Multiple versions of Library Files into One Image</title>
|
||||
|
||||
<para>
|
||||
The build system offers the ability to build libraries with different
|
||||
target optimizations or architecture formats and combine these together
|
||||
into one system image.
|
||||
You can link different binaries in the image
|
||||
against the different libraries as needed for specific use cases.
|
||||
This feature is called "Multilib."
|
||||
</para>
|
||||
|
||||
<para>
|
||||
An example would be where you have most of a system compiled in 32-bit
|
||||
mode using 32-bit libraries, but you have something large, like a database
|
||||
engine, that needs to be a 64-bit application and use 64-bit libraries.
|
||||
Multilib allows you to get the best of both 32-bit and 64-bit libraries.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
While the Multilib feature is most commonly used for 32 and 64-bit differences,
|
||||
the approach the build system uses facilitates different target optimizations.
|
||||
You could compile some binaries to use one set of libraries and other binaries
|
||||
to use other different sets of libraries.
|
||||
The libraries could differ in architecture, compiler options, or other
|
||||
optimizations.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This section overviews the Multilib process only.
|
||||
For more details on how to implement Multilib, see the
|
||||
<ulink url='https://wiki.yoctoproject.org/wiki/Multilib'>Multilib</ulink> wiki
|
||||
page.
|
||||
</para>
|
||||
|
||||
<section id='preparing-to-use-multilib'>
|
||||
<title>Preparing to use Multilib</title>
|
||||
|
||||
<para>
|
||||
User-specific requirements drive the Multilib feature,
|
||||
Consequently, there is no one "out-of-the-box" configuration that likely
|
||||
exists to meet your needs.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
In order to enable Multilib, you first need to ensure your recipe is
|
||||
extended to support multiple libraries.
|
||||
Many standard recipes are already extended and support multiple libraries.
|
||||
You can check in the <filename>meta/conf/multilib.conf</filename>
|
||||
configuration file in the Yocto Project files directory to see how this is
|
||||
done using the <filename>BBCLASSEXTEND</filename> variable.
|
||||
Eventually, all recipes will be covered and this list will be unneeded.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For the most part, the Multilib class extension works automatically to
|
||||
extend the package name from <filename>${PN}</filename> to
|
||||
<filename>${MLPREFIX}${PN}</filename>, where <filename>MLPREFIX</filename>
|
||||
is the particular multilib (e.g. "lib32-" or "lib64-").
|
||||
Standard variables such as <filename>DEPENDS</filename>,
|
||||
<filename>RDEPENDS</filename>, <filename>RPROVIDES</filename>,
|
||||
<filename>RRECOMMENDS</filename>, <filename>PACKAGES</filename>, and
|
||||
<filename>PACKAGES_DYNAMIC</filename> are automatically extended by the system.
|
||||
If you are extending any manual code in the recipe, you can use the
|
||||
<filename>${MLPREFIX}</filename> variable to ensure those names are extended
|
||||
correctly.
|
||||
This automatic extension code resides in <filename>multilib.bbclass</filename>.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='using-multilib'>
|
||||
<title>Using Multilib</title>
|
||||
|
||||
<para>
|
||||
After you have set up the recipes, you need to define the actual
|
||||
combination of multiple libraries you want to build.
|
||||
You accomplish this through your <filename>local.conf</filename>
|
||||
configuration file in the Yocto Project build directory.
|
||||
An example configuration would be as follows:
|
||||
<literallayout class='monospaced'>
|
||||
MACHINE = "qemux86-64"
|
||||
require conf/multilib.conf
|
||||
MULTILIBS = "multilib:lib32"
|
||||
DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
|
||||
MULTILIB_IMAGE_INSTALL = "lib32-connman"
|
||||
</literallayout>
|
||||
This example enables an
|
||||
additional library named <filename>lib32</filename> alongside the
|
||||
normal target packages.
|
||||
When combining these "lib32" alternatives, the example uses "x86" for tuning.
|
||||
For information on this particular tuning, see
|
||||
<filename>meta/conf/machine/include/ia32/arch-ia32.inc</filename>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The example then includes <filename>lib32-connman</filename>
|
||||
in all the images, which illustrates one method of including a
|
||||
multiple library dependency.
|
||||
You can use a normal image build to include this dependency,
|
||||
for example:
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake core-image-sato
|
||||
</literallayout>
|
||||
You can also build Multilib packages specifically with a command like this:
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake lib32-connman
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='additional-implementation-details'>
|
||||
<title>Additional Implementation Details</title>
|
||||
|
||||
<para>
|
||||
Different packaging systems have different levels of native Multilib
|
||||
support.
|
||||
For the RPM Package Management System, the following implementation details
|
||||
exist:
|
||||
<itemizedlist>
|
||||
<listitem><para>A unique architecture is defined for the Multilib packages,
|
||||
along with creating a unique deploy folder under
|
||||
<filename>tmp/deploy/rpm</filename> in the Yocto
|
||||
Project build directory.
|
||||
For example, consider <filename>lib32</filename> in a
|
||||
<filename>qemux86-64</filename> image.
|
||||
The possible architectures in the system are "all", "qemux86_64",
|
||||
"lib32_qemux86_64", and "lib32_x86".</para></listitem>
|
||||
<listitem><para>The <filename>${MLPREFIX}</filename> variable is stripped from
|
||||
<filename>${PN}</filename> during RPM packaging.
|
||||
The naming for a normal RPM package and a Multilib RPM package in a
|
||||
<filename>qemux86-64</filename> system resolves to something similar to
|
||||
<filename>bash-4.1-r2.x86_64.rpm</filename> and
|
||||
<filename>bash-4.1.r2.lib32_x86.rpm</filename>, respectively.
|
||||
</para></listitem>
|
||||
<listitem><para>When installing a Multilib image, the RPM backend first
|
||||
installs the base image and then installs the Multilib libraries.
|
||||
</para></listitem>
|
||||
<listitem><para>The build system relies on RPM to resolve the identical files in the
|
||||
two (or more) Multilib packages.</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For the IPK Package Management System, the following implementation details exist:
|
||||
<itemizedlist>
|
||||
<listitem><para>The <filename>${MLPREFIX}</filename> is not stripped from
|
||||
<filename>${PN}</filename> during IPK packaging.
|
||||
The naming for a normal RPM package and a Multilib IPK package in a
|
||||
<filename>qemux86-64</filename> system resolves to something like
|
||||
<filename>bash_4.1-r2.x86_64.ipk</filename> and
|
||||
<filename>lib32-bash_4.1-rw_x86.ipk</filename>, respectively.
|
||||
</para></listitem>
|
||||
<listitem><para>The IPK deploy folder is not modified with
|
||||
<filename>${MLPREFIX}</filename> because packages with and without
|
||||
the Multilib feature can exist in the same folder due to the
|
||||
<filename>${PN}</filename> differences.</para></listitem>
|
||||
<listitem><para>IPK defines a sanity check for Multilib installation
|
||||
using certain rules for file comparison, overridden, etc.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id="usingpoky-configuring-LIC_FILES_CHKSUM">
|
||||
<title>Tracking License Changes</title>
|
||||
|
||||
<para>
|
||||
The license of an upstream project might change in the future. In order to prevent these changes
|
||||
going unnoticed, the Yocto Project provides a
|
||||
<filename><link linkend='var-LIC_FILES_CHKSUM'>LIC_FILES_CHKSUM</link></filename>
|
||||
variable to track changes to the license text. The checksums are validated at the end of the
|
||||
configure step, and if the checksums do not match, the build will fail.
|
||||
</para>
|
||||
|
||||
<section id="usingpoky-specifying-LIC_FILES_CHKSUM">
|
||||
<title>Specifying the <filename>LIC_FILES_CHKSUM</filename> Variable</title>
|
||||
|
||||
<para>
|
||||
The <filename>LIC_FILES_CHKSUM</filename>
|
||||
variable contains checksums of the license text in the source code for the recipe.
|
||||
Following is an example of how to specify <filename>LIC_FILES_CHKSUM</filename>:
|
||||
<literallayout class='monospaced'>
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=xxxx \
|
||||
file://licfile1.txt;beginline=5;endline=29;md5=yyyy \
|
||||
file://licfile2.txt;endline=50;md5=zzzz \
|
||||
..."
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The Yocto Project uses the
|
||||
<filename><link linkend='var-S'>S</link></filename> variable as the
|
||||
default directory used when searching files listed in
|
||||
<filename>LIC_FILES_CHKSUM</filename>.
|
||||
The previous example employs the default directory.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
You can also use relative paths as shown in the following example:
|
||||
<literallayout class='monospaced'>
|
||||
LIC_FILES_CHKSUM = "file://src/ls.c;startline=5;endline=16;\
|
||||
md5=bb14ed3c4cda583abc85401304b5cd4e"
|
||||
LIC_FILES_CHKSUM = "file://../license.html;md5=5c94767cedb5d6987c902ac850ded2c6"
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
In this example, the first line locates a file in
|
||||
<filename><link linkend='var-S'>S</link>/src/ls.c</filename>.
|
||||
The second line refers to a file in
|
||||
<filename><link linkend='var-WORKDIR'>WORKDIR</link></filename>, which is the parent
|
||||
of <filename>S</filename>.
|
||||
</para>
|
||||
<para>
|
||||
Note that this variable is mandatory for all recipes, unless the
|
||||
<filename>LICENSE</filename> variable is set to "CLOSED".
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="usingpoky-LIC_FILES_CHKSUM-explanation-of-syntax">
|
||||
<title>Explanation of Syntax</title>
|
||||
<para>
|
||||
As mentioned in the previous section, the
|
||||
<filename>LIC_FILES_CHKSUM</filename> variable lists all the
|
||||
important files that contain the license text for the source code.
|
||||
It is possible to specify a checksum for an entire file, or a specific section of a
|
||||
file (specified by beginning and ending line numbers with the "beginline" and "endline"
|
||||
parameters respectively).
|
||||
The latter is useful for source files with a license notice header,
|
||||
README documents, and so forth.
|
||||
If you do not use the "beginline" parameter, then it is assumed that the text begins on the
|
||||
first line of the file.
|
||||
Similarly, if you do not use the "endline" parameter, it is assumed that the license text
|
||||
ends with the last line of the file.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The "md5" parameter stores the md5 checksum of the license text.
|
||||
If the license text changes in any way as compared to this parameter
|
||||
then a mismatch occurs.
|
||||
This mismatch triggers a build failure and notifies the developer.
|
||||
Notification allows the developer to review and address the license text changes.
|
||||
Also note that if a mismatch occurs during the build, the correct md5
|
||||
checksum is placed in the build log and can be easily copied to the recipe.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
There is no limit to how many files you can specify using the
|
||||
<filename>LIC_FILES_CHKSUM</filename> variable.
|
||||
Generally, however, every project requires a few specifications for license tracking.
|
||||
Many projects have a "COPYING" file that stores the license information for all the source
|
||||
code files.
|
||||
This practice allows you to just track the "COPYING" file as long as it is kept up to date.
|
||||
</para>
|
||||
|
||||
<tip>
|
||||
If you specify an empty or invalid "md5" parameter, BitBake returns an md5 mis-match
|
||||
error and displays the correct "md5" parameter value during the build.
|
||||
The correct parameter is also captured in the build log.
|
||||
</tip>
|
||||
|
||||
<tip>
|
||||
If the whole file contains only license text, you do not need to use the "beginline" and
|
||||
"endline" parameters.
|
||||
</tip>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id="usingpoky-configuring-DISTRO_PN_ALIAS">
|
||||
<title>Handling a Package Name Alias</title>
|
||||
<para>
|
||||
Sometimes a package name you are using might exist under an alias or as a similarly named
|
||||
package in a different distribution.
|
||||
The Yocto Project implements a <filename>distro_check</filename>
|
||||
task that automatically connects to major distributions
|
||||
and checks for these situations.
|
||||
If the package exists under a different name in a different distribution, you get a
|
||||
<filename>distro_check</filename> mismatch.
|
||||
You can resolve this problem by defining a per-distro recipe name alias using the
|
||||
<filename><link linkend='var-DISTRO_PN_ALIAS'>DISTRO_PN_ALIAS</link></filename> variable.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Following is an example that shows how you specify the <filename>DISTRO_PN_ALIAS</filename>
|
||||
variable:
|
||||
<literallayout class='monospaced'>
|
||||
DISTRO_PN_ALIAS_pn-PACKAGENAME = "distro1=package_name_alias1 \
|
||||
distro2=package_name_alias2 \
|
||||
distro3=package_name_alias3 \
|
||||
..."
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If you have more than one distribution alias, separate them with a space.
|
||||
Note that the Yocto Project currently automatically checks the
|
||||
Fedora, OpenSuSE, Debian, Ubuntu,
|
||||
and Mandriva distributions for source package recipes without having to specify them
|
||||
using the <filename>DISTRO_PN_ALIAS</filename> variable.
|
||||
For example, the following command generates a report that lists the Linux distributions
|
||||
that include the sources for each of the Yocto Project recipes.
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake world -f -c distro_check
|
||||
</literallayout>
|
||||
The results are stored in the <filename>build/tmp/log/distro_check-${DATETIME}.results</filename>
|
||||
file found in the Yocto Project files area.
|
||||
</para>
|
||||
</section>
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<appendix id='faq'>
|
||||
<title>FAQ</title>
|
||||
@@ -7,13 +8,13 @@
|
||||
<qandaentry>
|
||||
<question>
|
||||
<para>
|
||||
How does Poky differ from <ulink url='http://www.openembedded.org/'>OpenEmbedded</ulink>?
|
||||
How does Poky differ from <ulink url='&OE_HOME_URL;'>OpenEmbedded</ulink>?
|
||||
</para>
|
||||
</question>
|
||||
<answer>
|
||||
<para>
|
||||
Poky is the Yocto Project build system that was derived from <ulink
|
||||
url='http://www.openembedded.org/'>OpenEmbedded</ulink>.
|
||||
url='&OE_HOME_URL;'>OpenEmbedded</ulink>.
|
||||
Poky is a stable, smaller subset focused on the mobile environment.
|
||||
Development in the Yocto Project using Poky is closely tied to OpenEmbedded with
|
||||
features being merged regularly between the two for mutual benefit.
|
||||
@@ -33,8 +34,8 @@
|
||||
You can use a stand-alone tarball to provide Python 2.6.
|
||||
You can find pre-built 32 and 64-bit versions of Python 2.6 at the following locations:
|
||||
<itemizedlist>
|
||||
<listitem><para><ulink url='http://www.yoctoproject.org/downloads/miscsupport/yocto-1.1-python-nativesdk/python-nativesdk-standalone-i686.tar.bz2'>32-bit tarball</ulink></para></listitem>
|
||||
<listitem><para><ulink url='http://www.yoctoproject.org/downloads/miscsupport/yocto-1.1-python-nativesdk/python-nativesdk-standalone-x86_64.tar.bz2'>64-bit tarball</ulink></para></listitem>
|
||||
<listitem><para><ulink url='&YOCTO_PYTHON-i686_DL_URL;'>32-bit tarball</ulink></para></listitem>
|
||||
<listitem><para><ulink url='&YOCTO_PYTHON-x86_64_DL_URL;'>64-bit tarball</ulink></para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
@@ -139,7 +140,7 @@
|
||||
<para>
|
||||
To add a package, you need to create a BitBake recipe.
|
||||
For information on how to add a package, see the
|
||||
<link linkend='usingpoky-extend-addpkg'>Adding a Package</link> section
|
||||
"<link linkend='usingpoky-extend-addpkg'>Adding a Package</link>" section
|
||||
earlier in this manual.
|
||||
</para>
|
||||
</answer>
|
||||
@@ -171,7 +172,7 @@
|
||||
</question>
|
||||
<answer>
|
||||
<para>
|
||||
<ulink url='http://www.gnome.org/mobile/'>GNOME Mobile</ulink> is a subset of the GNOME
|
||||
GNOME Mobile is a subset of the <ulink url='http://www.gnome.org'>GNOME</ulink>
|
||||
platform targeted at mobile and embedded devices.
|
||||
The the main difference between GNOME Mobile and standard GNOME is that
|
||||
desktop-orientated libraries have been removed, along with deprecated libraries,
|
||||
@@ -385,9 +386,9 @@
|
||||
</question>
|
||||
<answer>
|
||||
<para>
|
||||
You need to create a form factor file as described in
|
||||
<xref linkend='bsp-filelayout-misc-recipes'>"Miscellaneous Recipe Files"</xref>
|
||||
and set the <filename>HAVE_TOUCHSCREEN</filename> variable equal to one as follows:
|
||||
You need to create a form factor file as described in the
|
||||
"<link linkend='bsp-filelayout-misc-recipes'>Miscellaneous Recipe Files</link>"
|
||||
section and set the <filename>HAVE_TOUCHSCREEN</filename> variable equal to one as follows:
|
||||
<literallayout class='monospaced'>
|
||||
HAVE_TOUCHSCREEN=1
|
||||
</literallayout>
|
||||
@@ -407,8 +408,8 @@
|
||||
automatically bring up network interfaces.
|
||||
Therefore, you will need to add a BSP-specific netbase that includes an interfaces
|
||||
file.
|
||||
See <xref linkend='bsp-filelayout-misc-recipes'>"Miscellaneous Recipe Files"</xref>
|
||||
for information on creating these types of miscellaneous recipe files.
|
||||
See the "<link linkend='bsp-filelayout-misc-recipes'>Miscellaneous Recipe Files</link>"
|
||||
section for information on creating these types of miscellaneous recipe files.
|
||||
</para>
|
||||
<para>
|
||||
For example, add the following files to your layer:
|
||||
@@ -493,8 +494,8 @@
|
||||
|
||||
<qandaentry>
|
||||
<question>
|
||||
<para>
|
||||
How does the Yocto Project obtain source code and will it work behind my
|
||||
<para id='how-does-the-yocto-project-obtain-source-code-and-will-it-work-behind-my-firewall-or-proxy-server'>
|
||||
How does the Yocto Project build system obtain source code and will it work behind my
|
||||
firewall or proxy server?
|
||||
</para>
|
||||
</question>
|
||||
@@ -573,7 +574,7 @@
|
||||
any network accesses to anything other than the PREMIRROR would fail.
|
||||
</para>
|
||||
<para>
|
||||
Poky also honors the standard environment variables
|
||||
Poky also honors the standard shell environment variables
|
||||
<filename>http_proxy</filename>, <filename>ftp_proxy</filename>,
|
||||
<filename>https_proxy</filename>, and <filename>all_proxy</filename>
|
||||
to redirect requests through proxy servers.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<chapter id='intro'>
|
||||
<title>Introduction</title>
|
||||
@@ -15,10 +16,13 @@
|
||||
construct complete Linux images.
|
||||
You can find complete introductory and getting started information on the Yocto Project
|
||||
by reading the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html'>
|
||||
<ulink url='&YOCTO_DOCS_QS_URL;'>
|
||||
Yocto Project Quick Start</ulink>.
|
||||
For task-based information using the Yocto Project, see
|
||||
<ulink url='&YOCTO_DOCS_DEV_URL;'>
|
||||
The Yocto Project Development Manual</ulink>.
|
||||
You can also find lots of information on the Yocto Project on the
|
||||
<ulink url="http://www.yoctoproject.org">Yocto Project website</ulink>.
|
||||
<ulink url="&YOCTO_HOME_URL;">Yocto Project website</ulink>.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -36,6 +40,11 @@
|
||||
<link linkend='extendpoky'>Extending the Yocto Project</link>:</emphasis> This chapter
|
||||
provides information about how to extend and customize the Yocto Project
|
||||
along with advice on how to manage these changes.</para></listitem>
|
||||
<listitem><para><emphasis>
|
||||
<link linkend='technical-details'>Technical Details</link>:</emphasis>
|
||||
This chapter describes fundamental Yocto Project components as well as an explanation
|
||||
behind how the Yocto Project uses shared state (sstate) cache to speed build time.
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis>
|
||||
<link linkend='bsp'>Board Support Packages (BSP) - Developer's Guide</link>:</emphasis>
|
||||
This chapter describes the example filesystem layout for BSP development and
|
||||
@@ -89,11 +98,9 @@
|
||||
<section id='intro-requirements'>
|
||||
<title>System Requirements</title>
|
||||
<para>
|
||||
For system Yocto Project system requirements, see the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html#resources'>
|
||||
What You Need and How You Get It</ulink> section in the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html'>
|
||||
Yocto Project Quick Start</ulink>.
|
||||
For Yocto Project system requirements, see the
|
||||
<ulink url='&YOCTO_DOCS_QS_URL;#resources'>
|
||||
What You Need and How You Get It</ulink> section in the Yocto Project Quick Start.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -104,14 +111,14 @@
|
||||
of methods:
|
||||
<itemizedlist>
|
||||
<listitem><para><emphasis>Releases:</emphasis> Stable, tested releases are available through
|
||||
<ulink url='http://yoctoproject.org/downloads/poky/'/>.</para></listitem>
|
||||
<ulink url='&YOCTO_DL_URL;/releases/yocto/'/>.</para></listitem>
|
||||
<listitem><para><emphasis>Nightly Builds:</emphasis> These releases are available at
|
||||
<ulink url='http://autobuilder.yoctoproject.org/nightly'/>.
|
||||
These builds include Yocto Project releases, meta-toolchain tarballs, and
|
||||
experimental builds.</para></listitem>
|
||||
<listitem><para><emphasis>Yocto Project Website:</emphasis> You can find releases
|
||||
of the Yocto Project and supported BSPs at the
|
||||
<ulink url='http://www.yoctoproject.org'>Yocto Project website</ulink>.
|
||||
<ulink url='&YOCTO_HOME_URL;'>Yocto Project website</ulink>.
|
||||
Along with these downloads, you can find lots of other information at this site.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
@@ -124,11 +131,9 @@
|
||||
Development using the Yocto Project requires a local copy of the Yocto Project files.
|
||||
You can get these files by downloading a Yocto Project release tarball and unpacking it,
|
||||
or by establishing a Git repository of the files.
|
||||
For information on both these methods, see
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html#getting-setup'>
|
||||
Getting Setup</ulink> section in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html'>
|
||||
The Yocto Project Development Manual</ulink>.
|
||||
For information on both these methods, see the
|
||||
"<ulink url='&YOCTO_DOCS_DEV_URL;#getting-setup'>Getting Setup</ulink>"
|
||||
section in The Yocto Project Development Manual.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<book id='poky-ref-manual' lang='en'
|
||||
xmlns:xi="http://www.w3.org/2003/XInclude"
|
||||
@@ -62,10 +63,20 @@
|
||||
<date>6 October 2011</date>
|
||||
<revremark>Released with the Yocto Project 1.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>1.1.1</revnumber>
|
||||
<date>15 March 2012</date>
|
||||
<revremark>Released with the Yocto Project 1.1.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>1.1.2</revnumber>
|
||||
<date>July 2012</date>
|
||||
<revremark>Released with the Yocto Project 1.1.2 Release.</revremark>
|
||||
</revision>
|
||||
</revhistory>
|
||||
|
||||
<copyright>
|
||||
<year>2007-2011</year>
|
||||
<year>©RIGHT_YEAR;</year>
|
||||
<holder>Linux Foundation</holder>
|
||||
</copyright>
|
||||
|
||||
@@ -77,9 +88,9 @@
|
||||
<note>
|
||||
Due to production processes, there could be differences between the Yocto Project
|
||||
documentation bundled in the release tarball and
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html'>
|
||||
<ulink url='&YOCTO_DOCS_REF_URL;'>
|
||||
The Yocto Project Reference Manual</ulink> on
|
||||
the <ulink url='http://www.yoctoproject.org'>Yocto Project</ulink> website.
|
||||
the <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink> website.
|
||||
For the latest version of this manual, see the manual on the website.
|
||||
</note>
|
||||
</legalnotice>
|
||||
@@ -92,6 +103,8 @@
|
||||
|
||||
<xi:include href="extendpoky.xml"/>
|
||||
|
||||
<xi:include href="technical-details.xml"/>
|
||||
|
||||
<xi:include href="../bsp-guide/bsp.xml"/>
|
||||
|
||||
<xi:include href="development.xml"/>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<appendix id='ref-bitbake'>
|
||||
|
||||
@@ -35,7 +36,7 @@
|
||||
The first thing BitBake does is look for the <filename>bitbake.conf</filename> file.
|
||||
The Yocto Project keeps this file in the Yocto Project file's <filename>meta/conf/</filename>
|
||||
directory.
|
||||
BitBake finds it by examining the <filename>BBPATH</filename> environment
|
||||
BitBake finds it by examining its <filename>BBPATH</filename> environment
|
||||
variable and looking for the <filename>meta/conf/</filename>
|
||||
directory.
|
||||
</para>
|
||||
@@ -53,7 +54,7 @@
|
||||
and the machine configuration file
|
||||
(set by the
|
||||
<filename><link linkend='var-MACHINE'>MACHINE</link></filename> variable).
|
||||
The <filename>DISTRO</filename> and <filename>MACHINE</filename> environment
|
||||
The <filename>DISTRO</filename> and <filename>MACHINE</filename> BitBake environment
|
||||
variables are both usually set in
|
||||
the <filename>local.conf</filename> file.
|
||||
Valid distribution
|
||||
@@ -86,7 +87,7 @@
|
||||
<filename>meta/recipes-*/</filename> directory within Poky.
|
||||
Adding extra content to <filename>BBFILES</filename> is best achieved through the use of
|
||||
BitBake layers as described in the
|
||||
<link linkend='usingpoky-changes-layers'>BitBake Layers</link> section.
|
||||
"<link linkend='usingpoky-changes-layers'>BitBake Layers</link>" section.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -207,17 +208,16 @@
|
||||
It is worth noting that you can greatly speed up the build time by properly setting
|
||||
the <filename>BB_NUMBER_THREADS</filename> variable.
|
||||
See the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html#building-image'>
|
||||
Building an Image</ulink> section in the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html'>
|
||||
Yocto Project Quick Start</ulink> for more information.
|
||||
"<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>"
|
||||
section in the Yocto Project Quick Start for more information.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
As each task completes, a timestamp is written to the directory specified by the
|
||||
<filename><link linkend='var-STAMPS'>STAMPS</link></filename> variable (usually
|
||||
<filename>build/tmp/stamps/*/</filename>).
|
||||
On subsequent runs, BitBake looks at the <filename>STAMPS</filename> directory and does not rerun
|
||||
On subsequent runs, BitBake looks at the <filename>/build/tmp/stamps</filename>
|
||||
directory and does not rerun
|
||||
tasks that are already completed unless a timestamp is found to be invalid.
|
||||
Currently, invalid timestamps are only considered on a per
|
||||
<filename>.bb</filename> file basis.
|
||||
@@ -260,8 +260,50 @@
|
||||
<para>
|
||||
Once all the tasks have been completed BitBake exits.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<para>
|
||||
When running a task, BitBake tightly controls the execution environment
|
||||
of the build tasks to make sure unwanted contamination from the build machine
|
||||
cannot influence the build.
|
||||
Consequently, if you do want something to get passed into the build
|
||||
task's environment, you must take a few steps:
|
||||
<orderedlist>
|
||||
<listitem><para>Tell BitBake to load what you want from the environment
|
||||
into the data store.
|
||||
You can do so through the <filename>BB_ENV_WHITELIST</filename>
|
||||
variable.
|
||||
For example, assume you want to prevent the build system from
|
||||
accessing your <filename>$HOME/.ccache</filename> directory.
|
||||
The following command tells BitBake to load
|
||||
<filename>CCACHE_DIR</filename> from the environment into the data
|
||||
store:
|
||||
<literallayout class='monospaced'>
|
||||
export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE CCACHE_DIR"
|
||||
</literallayout></para></listitem>
|
||||
<listitem><para>Tell BitBake to export what you have loaded into the
|
||||
environment store to the task environment of every running task.
|
||||
Loading something from the environment into the data store
|
||||
(previous step) only makes it available in the datastore.
|
||||
To export it to the task environment of every running task,
|
||||
use a command similar to the following in your
|
||||
<filename>local.conf</filename> or distro configuration file:
|
||||
<literallayout class='monospaced'>
|
||||
export CCACHE_DIR
|
||||
</literallayout></para></listitem>
|
||||
</orderedlist>
|
||||
</para>
|
||||
|
||||
<note>
|
||||
A side effect of the previous steps is that BitBake records the variable
|
||||
as a dependency of the build process in things like the shared state
|
||||
checksums.
|
||||
If doing so results in unnecessary rebuilds of tasks, you can whitelist the
|
||||
variable so that the shared state code ignores the dependency when it creates
|
||||
checksums.
|
||||
For information on this process, see the <filename>BB_HASHBASE_WHITELIST</filename>
|
||||
example in the "<link linkend='checksums'>Checksums (Signatures)</link>" section.
|
||||
</note>
|
||||
</section>
|
||||
|
||||
<section id='ref-bitbake-commandline'>
|
||||
<title>BitBake Command Line</title>
|
||||
@@ -359,8 +401,8 @@ Options:
|
||||
This feature works using the <filename><link linkend='var-SRCREV'>SRCREV</link></filename>
|
||||
variable.
|
||||
See the
|
||||
<link linkend='platdev-appdev-srcrev'>Development Within Yocto Project for a Package that Uses
|
||||
an External SCM</link> section for more information.
|
||||
"<link linkend='platdev-appdev-srcrev'>Development Within Yocto Project for a Package that Uses
|
||||
an External SCM</link>" section for more information.
|
||||
</para>
|
||||
|
||||
</section>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<appendix id='ref-classes'>
|
||||
<title>Reference: Classes</title>
|
||||
@@ -49,7 +50,7 @@
|
||||
This class defines a set of tasks (configure, compile etc.) that
|
||||
work for all Autotooled packages.
|
||||
It should usually be enough to define a few standard variables as documented in the
|
||||
<link linkend='usingpoky-extend-addpkg-autotools'>Autotooled Package</link> section
|
||||
"<link linkend='usingpoky-extend-addpkg-autotools'>Autotooled Package</link>" section
|
||||
and then simply <filename>inherit autotools</filename>.
|
||||
This class can also work with software that emulates Autotools.
|
||||
</para>
|
||||
@@ -139,7 +140,7 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
During staging, Bitbake installs such scripts into the
|
||||
During staging, BitBake installs such scripts into the
|
||||
<filename>sysroots/</filename> directory.
|
||||
BitBake also changes all paths to point into the <filename>sysroots/</filename>
|
||||
directory so all builds that use the script will use the correct
|
||||
@@ -166,7 +167,7 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
During staging, Bitbake installs <filename>pkg-config</filename> data into the
|
||||
During staging, BitBake installs <filename>pkg-config</filename> data into the
|
||||
<filename>sysroots/</filename> directory.
|
||||
By making use of sysroot functionality within <filename>pkg-config</filename>,
|
||||
this class no longer has to manipulate the files.
|
||||
@@ -252,8 +253,8 @@
|
||||
<para>
|
||||
This class adds the <filename>devshell</filename> task.
|
||||
Distribution policy dictates whether to include this class as the Yocto Project does.
|
||||
See the <link
|
||||
linkend='platdev-appdev-devshell'>Development Within a Development Shell</link> section
|
||||
See the
|
||||
"<link linkend='platdev-appdev-devshell'>Development Within a Development Shell</link>" section
|
||||
for more information about using devshell.
|
||||
</para>
|
||||
</section>
|
||||
@@ -313,9 +314,9 @@
|
||||
You can find additional information on the effects of the package class at these
|
||||
two Yocto Project mailing list links:
|
||||
<itemizedlist>
|
||||
<listitem><para><ulink url='https://lists.yoctoproject.org/pipermail/poky/2011-May/006362.html'>
|
||||
<listitem><para><ulink url='&YOCTO_LISTS_URL;/pipermail/poky/2011-May/006362.html'>
|
||||
https://lists.yoctoproject.org/pipermail/poky/2011-May/006362.html</ulink></para></listitem>
|
||||
<listitem><para><ulink url='https://lists.yoctoproject.org/pipermail/poky/2011-May/006363.html'>
|
||||
<listitem><para><ulink url='&YOCTO_LISTS_URL;/pipermail/poky/2011-May/006363.html'>
|
||||
https://lists.yoctoproject.org/pipermail/poky/2011-May/006363.html</ulink></para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
@@ -391,6 +392,87 @@
|
||||
for common problems that show up during runtime.
|
||||
Distribution policy usually dictates whether to include this class as the Yocto Project does.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
You can configure the sanity checks so that specific test failures either raise a warning or
|
||||
an error message.
|
||||
Typically, failures for new tests generate a warning.
|
||||
Subsequent failures for the same test would then generate an error message
|
||||
once the metadata is in a known and good condition.
|
||||
You use the <filename>WARN_QA</filename> variable to specify tests for which you
|
||||
want to generate a warning message on failure.
|
||||
You use the <filename>ERROR_QA</filename> variable to specify tests for which you
|
||||
want to generate an error message on failure.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The following list shows the tests you can list with the <filename>WARN_QA</filename>
|
||||
and <filename>ERROR_QA</filename> variables:
|
||||
<itemizedlist>
|
||||
<listitem><para><emphasis><filename>ldflags:</filename></emphasis>
|
||||
Ensures that the binaries were linked with the
|
||||
<filename>LDFLAGS</filename> options provided by the build system.
|
||||
If this test fails, check that the <filename>LDFLAGS</filename> variable
|
||||
is being passed to the linker command.</para></listitem>
|
||||
<listitem><para><emphasis><filename>useless-rpaths:</filename></emphasis>
|
||||
Checks for dynamic library load paths (rpaths) in the binaries that
|
||||
by default on a standard system are searched by the linker (e.g.
|
||||
<filename>/lib</filename> and <filename>/usr/lib</filename>).
|
||||
While these paths will not cause any breakage, they do waste space and
|
||||
are unnecessary.</para></listitem>
|
||||
<listitem><para><emphasis><filename>rpaths:</filename></emphasis>
|
||||
Checks for rpaths in the binaries that contain build system paths such
|
||||
as <filename>TMPDIR</filename>.
|
||||
If this test fails, bad <filename>-rpath</filename> options are being
|
||||
passed to the linker commands and your binaries have potential security
|
||||
issues.</para></listitem>
|
||||
<listitem><para><emphasis><filename>dev-so:</filename></emphasis>
|
||||
Checks that the <filename>.so</filename> symbolic links are in the
|
||||
<filename>-dev</filename> package and not in any of the other packages.
|
||||
In general, these symlinks are only useful for development purposes.
|
||||
Thus, the <filename>-dev</filename> package is the correct location for
|
||||
them.
|
||||
Some very rare cases do exist for dynamically loaded modules where
|
||||
these symlinks are needed instead in the main package.
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis><filename>debug-files:</filename></emphasis>
|
||||
Checks for <filename>.debug</filename> directories in anything but the
|
||||
<filename>-dbg</filename> package.
|
||||
The debug files should all be in the <filename>-dbg</filename> package.
|
||||
Thus, anything packaged elsewhere is incorrect packaging.</para></listitem>
|
||||
<listitem><para><emphasis><filename>arch:</filename></emphasis>
|
||||
Checks the Executable and Linkable Format (ELF) type, bit size and endianness
|
||||
of any binaries to ensure it matches the target architecture.
|
||||
This test fails if any binaries don't match the type since there would be an
|
||||
incompatibility.
|
||||
Sometimes software, like bootloaders, might need to bypass this check.
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis><filename>debug-deps:</filename></emphasis>
|
||||
Checks that <filename>-dbg</filename> packages only depend on other
|
||||
<filename>-dbg</filename> packages and not on any other types of packages,
|
||||
which would cause a packaging bug.</para></listitem>
|
||||
<listitem><para><emphasis><filename>dev-deps:</filename></emphasis>
|
||||
Checks that <filename>-dev</filename> packages only depend on other
|
||||
<filename>-dev</filename> packages and not on any other types of packages,
|
||||
which would be a packaging bug.</para></listitem>
|
||||
<listitem><para><emphasis><filename>pkgconfig:</filename></emphasis>
|
||||
Checks <filename>.pc</filename> files for any
|
||||
<filename>TMPDIR/WORKDIR</filename> paths.
|
||||
Any <filename>.pc</filename> file containing these paths is incorrect
|
||||
since <filename>pkg-config</filename> itself adds the correct sysroot prefix
|
||||
when the files are accessed.</para></listitem>
|
||||
<listitem><para><emphasis><filename>la:</filename></emphasis>
|
||||
Checks <filename>.la</filename> files for any <filename>TMPDIR</filename>
|
||||
paths.
|
||||
Any <filename>.la</filename> file continaing these paths is incorrect since
|
||||
<filename>libtool</filename> adds the correct sysroot prefix when using the
|
||||
files automatically itself.</para></listitem>
|
||||
<listitem><para><emphasis><filename>desktop:</filename></emphasis>
|
||||
Runs the <filename>desktop-file-validate</filename> program against any
|
||||
<filename>.desktop</filename> files to validate their contents against
|
||||
the specification for <filename>.desktop</filename> files.</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='ref-classes-siteinfo'>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<appendix id='ref-features'>
|
||||
<title>Reference: Features</title>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<appendix id='ref-images'>
|
||||
<title>Reference: Images</title>
|
||||
@@ -45,7 +46,10 @@
|
||||
<listitem><para><emphasis><filename>core-image-minimal</filename>:</emphasis>
|
||||
A small image just capable of allowing a device to boot.</para></listitem>
|
||||
<listitem><para><emphasis><filename>core-image-minimal-dev</filename>:</emphasis>
|
||||
A <filename>core-image-minimal</filename> image suitable for development work.
|
||||
A <filename>core-image-minimal</filename> image suitable for development work
|
||||
using the host.
|
||||
The image includes headers and libraries you can use in a host development
|
||||
environment.
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis><filename>core-image-minimal-initramfs</filename>:</emphasis>
|
||||
A <filename>core-image-minimal</filename> image that has the Minimal RAM-based
|
||||
@@ -64,13 +68,17 @@
|
||||
A <filename>core-image-basic</filename> image suitable for implementations
|
||||
that conform to Linux Standard Base (LSB).</para></listitem>
|
||||
<listitem><para><emphasis><filename>core-image-lsb-dev</filename>:</emphasis>
|
||||
A <filename>core-image-lsb</filename> image that is suitable for development work.
|
||||
A <filename>core-image-lsb</filename> image that is suitable for development work
|
||||
using the host.
|
||||
The image includes headers and libraries you can use in a host development
|
||||
environment.
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis><filename>core-image-lsb-sdk</filename>:</emphasis>
|
||||
A <filename>core-image-lsb</filename> that includes everything in meta-toolchain
|
||||
but also includes development headers and libraries to form a complete standalone SDK.
|
||||
See the <link linkend='platdev-appdev-external-sdk'>
|
||||
External Development Using the Poky SDK</link> section for more information.
|
||||
but also includes development headers and libraries to form a complete standalone SDK.
|
||||
This image is suitable for development using the target.
|
||||
See the "<link linkend='platdev-appdev-external-sdk'>
|
||||
External Development Using the Poky SDK</link>" section for more information.
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis><filename>core-image-clutter</filename>:</emphasis>
|
||||
An image with support for the Open GL-based toolkit Clutter, which enables development of
|
||||
@@ -81,16 +89,17 @@
|
||||
The image supports X11 with a Sato theme and Pimlico applications and also
|
||||
contains terminal, editor, and file manager.</para></listitem>
|
||||
<listitem><para><emphasis><filename>core-image-sato-dev</filename>:</emphasis>
|
||||
A <filename>core-image-sato</filename> image suitable for development
|
||||
that also includes a native toolchain and libraries needed to build applications on
|
||||
the device itself.
|
||||
The image also includes testing and profiling tools as well as debug symbols.
|
||||
A <filename>core-image-sato</filename> image suitable for development
|
||||
using the host.
|
||||
The image includes libraries needed to build applications on the device itself,
|
||||
testing and profiling tools, and debug symbols.
|
||||
This image was formerly <filename>core-image-sdk</filename>.</para></listitem>
|
||||
<listitem><para><emphasis><filename>core-image-sato-sdk</filename>:</emphasis>
|
||||
A <filename>core-image-sato</filename> image that includes everything in meta-toolchain.
|
||||
The image also includes development headers and libraries to form a complete standalone SDK.
|
||||
See the <link linkend='platdev-appdev-external-sdk'>
|
||||
External Development Using the Poky SDK</link> section for more information.
|
||||
The image also includes development headers and libraries to form a complete standalone SDK
|
||||
and is suitable for development using the target.
|
||||
See the "<link linkend='platdev-appdev-external-sdk'>
|
||||
External Development Using the Poky SDK</link>" section for more information.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<appendix id='ref-structure'>
|
||||
|
||||
@@ -14,10 +15,8 @@
|
||||
|
||||
<para>
|
||||
For information on how to establish the Yocto Project files on your local development system, see the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html#getting-started'>
|
||||
Getting Setup</ulink> section in the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html'>
|
||||
The Yocto Project Development Manual</ulink>.
|
||||
"<ulink url='&YOCTO_DOCS_DEV_URL;#getting-setup'>Getting Set Up</ulink>"
|
||||
section in the Yocto Project Development Manual.
|
||||
</para>
|
||||
|
||||
<section id='structure-core'>
|
||||
@@ -35,7 +34,7 @@
|
||||
from BitBake itself.
|
||||
Consequently, most users do not need to worry about BitBake.
|
||||
The <filename>bitbake/bin/</filename> directory is placed
|
||||
into the <filename>PATH</filename> environment variable by the
|
||||
into the shell's <filename>PATH</filename> environment variable by the
|
||||
<link linkend="structure-core-script">oe-init-build-env</link> script.
|
||||
</para>
|
||||
|
||||
@@ -121,7 +120,7 @@
|
||||
This directory contains various integration scripts that implement
|
||||
extra functionality in the Yocto Project environment (e.g. QEMU scripts).
|
||||
The <link linkend="structure-core-script">oe-init-build-env</link> script appends this
|
||||
directory to the <filename>PATH</filename> environment variable.
|
||||
directory to the shell's <filename>PATH</filename> environment variable.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -363,7 +362,7 @@
|
||||
|
||||
<para>
|
||||
This directory contains intermediate packaging data that is used later in the packaging process.
|
||||
For more information, see <link linkend='ref-classes-package'>package.bbclass</link>.
|
||||
For more information, see the "<link linkend='ref-classes-package'>Packaging - package*.bbclass</link>" section.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -388,8 +387,8 @@
|
||||
referred to as <filename><link linkend='var-WORKDIR'>WORKDIR</link></filename>, is created.
|
||||
Within this directory, the source is unpacked to
|
||||
<filename>linux-qemux86-standard-build</filename> and then patched by Quilt
|
||||
(see the <link linkend="usingpoky-modifying-packages-quilt">Modifying Package Source Code
|
||||
With Quilt</link> section).
|
||||
(see the "<link linkend="usingpoky-modifying-packages-quilt">Modifying Package Source Code
|
||||
With Quilt</link>" section).
|
||||
Within the <filename>linux-qemux86-standard-build</filename> directory,
|
||||
standard Quilt directories <filename>linux-3.0/patches</filename>
|
||||
and <filename>linux-3.0/.pc</filename> are created,
|
||||
@@ -480,8 +479,8 @@
|
||||
<title><filename>meta/recipes-bsp/</filename></title>
|
||||
|
||||
<para>
|
||||
This directory contains anything linking to specific hardware or hardware configuration information
|
||||
such as "u-boot" and "grub".
|
||||
This directory contains anything linking to specific hardware or hardware
|
||||
configuration information such as "u-boot" and "grub".
|
||||
</para>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<!-- Dummy chapter -->
|
||||
<appendix id='ref-variables-glos'>
|
||||
@@ -75,7 +76,7 @@
|
||||
<glossentry id='var-BB_NUMBER_THREADS'><glossterm>BB_NUMBER_THREADS</glossterm>
|
||||
<glossdef>
|
||||
<para>The maximum number of tasks BitBake should run in parallel at any one time.
|
||||
If your host development system supports mulitiple cores a good rule of thumb
|
||||
If your host development system supports multiple cores, a good rule of thumb
|
||||
is to set this variable to twice the number of cores.</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
@@ -285,6 +286,7 @@
|
||||
|
||||
<glossentry id='var-DISTRO_EXTRA_RRECOMMENDS'><glossterm>DISTRO_EXTRA_RRECOMMENDS</glossterm>
|
||||
<glossdef>
|
||||
<para></para>
|
||||
<para>The list of packages which extend usability of the image.
|
||||
Those packages will automatically be installed but can be removed by user.</para>
|
||||
</glossdef>
|
||||
@@ -305,8 +307,8 @@
|
||||
<glossentry id='var-DISTRO_PN_ALIAS'><glossterm>DISTRO_PN_ALIAS</glossterm>
|
||||
<glossdef>
|
||||
<para>Alias names used for the recipe in various Linux distributions.</para>
|
||||
<para>See <link linkend='usingpoky-configuring-DISTRO_PN_ALIAS'>
|
||||
Handling a Package Name Alias</link> section for more information.</para>
|
||||
<para>See "<link linkend='usingpoky-configuring-DISTRO_PN_ALIAS'>
|
||||
Handling a Package Name Alias</link>" section for more information.</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
@@ -328,6 +330,7 @@
|
||||
|
||||
<glossentry id='var-ENABLE_BINARY_LOCALE_GENERATION'><glossterm>ENABLE_BINARY_LOCALE_GENERATION</glossterm>
|
||||
<glossdef>
|
||||
<para></para>
|
||||
<para>Variable that controls which locales for <filename>eglibc</filename> are
|
||||
to be generated during the build (useful if the target device has 64Mbytes
|
||||
of RAM or less).</para>
|
||||
@@ -444,7 +447,7 @@
|
||||
The options to pass in
|
||||
<filename><link linkend='var-TARGET_CFLAGS'>TARGET_CFLAGS</link></filename>
|
||||
and <filename><link linkend='var-CFLAGS'>CFLAGS</link></filename>
|
||||
when compiling an optimised system.
|
||||
when compiling an optimized system.
|
||||
This variable defaults to
|
||||
"-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2".
|
||||
</para>
|
||||
@@ -474,7 +477,7 @@
|
||||
Typically, you configure this variable in image recipes.
|
||||
Note that you can add extra features to the image by using the
|
||||
<filename><link linkend='var-EXTRA_IMAGE_FEATURES'>EXTRA_IMAGE_FEATURES</link></filename> variable.
|
||||
See the <link linkend="ref-features-image">Reference: Images</link> section for the
|
||||
See the "<link linkend="ref-features-image">Reference: Images</link>" section for the
|
||||
list of features present in images built by the Yocto Project.</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
@@ -676,8 +679,8 @@
|
||||
This variable must be defined for all recipes (unless <filename>LICENSE</filename>
|
||||
is set to "CLOSED")</para>
|
||||
<para>For more information, see the
|
||||
<link linkend='usingpoky-configuring-LIC_FILES_CHKSUM'>
|
||||
Track License Change</link> section</para>
|
||||
"<link linkend='usingpoky-configuring-LIC_FILES_CHKSUM'>Track License Change</link>"
|
||||
section</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
@@ -693,6 +696,7 @@
|
||||
|
||||
<glossentry id='var-MACHINE_ESSENTIAL_EXTRA_RDEPENDS'><glossterm>MACHINE_ESSENTIAL_EXTRA_RDEPENDS</glossterm>
|
||||
<glossdef>
|
||||
<para></para>
|
||||
<para>
|
||||
A list of required packages to install as part of the package being
|
||||
built.
|
||||
@@ -704,7 +708,7 @@
|
||||
</para>
|
||||
<para>
|
||||
This variable is similar to the
|
||||
<link linkend='var-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS'>MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS</link>
|
||||
<filename><link linkend='var-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS'>MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS</link></filename>
|
||||
variable with the exception that the package being built has a build
|
||||
dependency on the variable's list of packages.
|
||||
In other words, the image will not build if a file in this list is not found.
|
||||
@@ -722,6 +726,7 @@
|
||||
|
||||
<glossentry id='var-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS'><glossterm>MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS</glossterm>
|
||||
<glossdef>
|
||||
<para></para>
|
||||
<para>
|
||||
A list of recommended packages to install as part of the package being
|
||||
built.
|
||||
@@ -733,7 +738,7 @@
|
||||
</para>
|
||||
<para>
|
||||
This variable is similar to the
|
||||
<link linkend='var-MACHINE_ESSENTIAL_EXTRA_RDEPENDS'>MACHINE_ESSENTIAL_EXTRA_RDEPENDS</link>
|
||||
<filename><link linkend='var-MACHINE_ESSENTIAL_EXTRA_RDEPENDS'>MACHINE_ESSENTIAL_EXTRA_RDEPENDS</link></filename>
|
||||
variable with the exception that the package being built does not have a build
|
||||
dependency on the variable's list of packages.
|
||||
In other words, the image will build if a file in this list is not found.
|
||||
@@ -781,7 +786,7 @@
|
||||
</para>
|
||||
<para>
|
||||
This variable is similar to the
|
||||
<link linkend='var-MACHINE_EXTRA_RRECOMMENDS'>MACHINE_EXTRA_RRECOMMENDS</link>
|
||||
<filename><link linkend='var-MACHINE_EXTRA_RRECOMMENDS'>MACHINE_EXTRA_RRECOMMENDS</link></filename>
|
||||
variable with the exception that the package being built has a build
|
||||
dependency on the variable's list of packages.
|
||||
In other words, the image will not build if a file in this list is not found.
|
||||
@@ -805,6 +810,7 @@
|
||||
|
||||
<glossentry id='var-MACHINE_EXTRA_RRECOMMENDS'><glossterm>MACHINE_EXTRA_RRECOMMENDS</glossterm>
|
||||
<glossdef>
|
||||
<para></para>
|
||||
<para>
|
||||
A list of optional but non-machine essential packages to install as
|
||||
part of the package being built.
|
||||
@@ -817,7 +823,7 @@
|
||||
</para>
|
||||
<para>
|
||||
This variable is similar to the
|
||||
<link linkend='var-MACHINE_EXTRA_RDEPENDS'>MACHINE_EXTRA_RDEPENDS</link>
|
||||
<filename><link linkend='var-MACHINE_EXTRA_RDEPENDS'>MACHINE_EXTRA_RDEPENDS</link></filename>
|
||||
variable with the exception that the package being built does not have a build
|
||||
dependency on the variable's list of packages.
|
||||
In other words, the image will build if a file in this list is not found.
|
||||
@@ -843,7 +849,7 @@
|
||||
<glossentry id='var-MACHINE_FEATURES'><glossterm>MACHINE_FEATURES</glossterm>
|
||||
<glossdef>
|
||||
<para>Specifies the list of device features.
|
||||
See the <link linkend='ref-features-machine'>Machine</link> section for
|
||||
See the "<link linkend='ref-features-machine'>Machine</link>" section for
|
||||
more information.</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
@@ -881,7 +887,7 @@
|
||||
</literallayout>
|
||||
For information on build performance effects as a result of the
|
||||
package manager use, see
|
||||
<link linkend='ref-classes-package'>Packaging - <filename>package*.bbclass</filename></link>
|
||||
"<link linkend='ref-classes-package'>Packaging - <filename>package*.bbclass</filename></link>"
|
||||
in this manual.
|
||||
</para>
|
||||
</glossdef>
|
||||
@@ -927,7 +933,7 @@
|
||||
This variable is usually in the form <filename>-j 4</filename>, where the number
|
||||
represents the maximum number of parallel threads make can run.
|
||||
If you development host supports multiple cores a good rule of thumb is to set
|
||||
this variable to one and a half times the number of cores on the host.</para>
|
||||
this variable to twice the number of cores on the host.</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
@@ -1112,7 +1118,7 @@
|
||||
The package being built does not depend on this list of packages in
|
||||
order to successfully build, but needs them for the extended usability.
|
||||
To specify runtime dependencies for packages, see the
|
||||
<link linkend='var-RDEPENDS'>RDEPENDS</link> variable.
|
||||
<filename><link linkend='var-RDEPENDS'>RDEPENDS</link></filename> variable.
|
||||
</para>
|
||||
<para>
|
||||
The Yocto Project build process automatically installs the list of packages
|
||||
@@ -1155,7 +1161,7 @@
|
||||
<para>
|
||||
The path to unpacked sources.
|
||||
By default, this path is
|
||||
"${<link linkend='var-WORKDIR'>WORKDIR</link>}/${<link linkend='var-PN'>PN</link>}-${<link linkend='var-PV'>PV</link>}".
|
||||
"<filename>${<link linkend='var-WORKDIR'>WORKDIR</link>}/${<link linkend='var-PN'>PN</link>}-${<link linkend='var-PV'>PV</link>}</filename>".
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
@@ -1230,13 +1236,14 @@
|
||||
|
||||
<glossentry id='var-SRC_URI_OVERRIDES_PACKAGE_ARCH'><glossterm>SRC_URI_OVERRIDES_PACKAGE_ARCH</glossterm>
|
||||
<glossdef>
|
||||
<para></para>
|
||||
<para>
|
||||
By default, the Yocto Project automatically detects whether
|
||||
<filename><link linkend='var-SRC_URI'>SRC_URI</link></filename>
|
||||
contains files that are machine-specific.
|
||||
If so, the Yocto Project automatically changes
|
||||
<filename><link linkend='var-PACKAGE_ARCH'>PACKAGE_ARCH</link></filename>.
|
||||
Setting this variable to "0" disables this behaviour.
|
||||
Setting this variable to "0" disables this behavior.
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<appendix id='ref-varlocality'>
|
||||
<title>Reference: Variable Context</title>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<appendix id='resources'>
|
||||
<title>Contributing to the Yocto Project</title>
|
||||
@@ -10,10 +11,8 @@
|
||||
The Yocto Project team is happy for people to experiment with the Yocto Project.
|
||||
A number of places exist to find help if you run into difficulties or find bugs.
|
||||
To find out how to download source code,
|
||||
see the <ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html#local-yp-release'>
|
||||
Yocto Project Release</ulink> list item in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html'>The Yocto
|
||||
Project Development Manual</ulink>.
|
||||
see the "<ulink url='&YOCTO_DOCS_DEV_URL;#local-yp-release'>Yocto Project Release</ulink>"
|
||||
list item in the Yocto Project Development Manual.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -22,7 +21,7 @@
|
||||
|
||||
<para>
|
||||
If you find problems with the Yocto Project, you should report them using the
|
||||
Bugzilla application at <ulink url='http://bugzilla.yoctoproject.org/'></ulink>.
|
||||
Bugzilla application at <ulink url='&YOCTO_BUGZILLA_URL;'></ulink>.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -33,13 +32,13 @@
|
||||
To subscribe to the Yocto Project mailing lists, click on the following URLs and follow the instructions:
|
||||
<itemizedlist>
|
||||
<listitem><para><emphasis>
|
||||
<ulink url='http://lists.yoctoproject.org/listinfo/yocto-announce'></ulink></emphasis>:
|
||||
<ulink url='&YOCTO_LISTS_URL;/listinfo/yocto-announce'></ulink></emphasis>:
|
||||
Use this list to receive offical Yocto Project announcements for developments and
|
||||
to learn about Yocto Project milestones.</para></listitem>
|
||||
<listitem><para><emphasis><ulink url='http://lists.yoctoproject.org/listinfo/yocto'></ulink></emphasis>:
|
||||
<listitem><para><emphasis><ulink url='&YOCTO_LISTS_URL;/listinfo/yocto'></ulink></emphasis>:
|
||||
Use this list to monitor Yocto Project development discussions, ask questions, and
|
||||
get help.</para></listitem>
|
||||
<listitem><para><emphasis><ulink url='http://lists.yoctoproject.org/listinfo/poky'></ulink></emphasis>:
|
||||
<listitem><para><emphasis><ulink url='&YOCTO_LISTS_URL;/listinfo/poky'></ulink></emphasis>:
|
||||
Use this list to monitor discussions about the Yocto Project build system Poky,
|
||||
ask questions, and get help.</para></listitem>
|
||||
</itemizedlist>
|
||||
@@ -50,7 +49,7 @@
|
||||
<title>Internet Relay Chat (IRC)</title>
|
||||
|
||||
<para>
|
||||
Two IRC channels on freenode are available for Yocto Project and Poky discussions:
|
||||
Two IRC channels on freenode are available for the Yocto Project and Poky discussions:
|
||||
<itemizedlist>
|
||||
<listitem><para><filename>#yocto</filename></para></listitem>
|
||||
<listitem><para><filename>#poky</filename></para></listitem>
|
||||
@@ -64,19 +63,19 @@
|
||||
<para>
|
||||
Following is a list of resources you will find helpful:
|
||||
<itemizedlist>
|
||||
<listitem><para><emphasis><ulink url='http://yoctoproject.org'>The Yocto Project website</ulink>:
|
||||
<listitem><para><emphasis><ulink url='&YOCTO_HOME_URL;'>The Yocto Project website</ulink>:
|
||||
</emphasis> The home site for the Yocto Project.</para></listitem>
|
||||
<listitem><para><emphasis><ulink url='http://www.openedhand.com/'>OpenedHand</ulink>:</emphasis>
|
||||
<listitem><para><emphasis><ulink url='&OH_HOME_URL;'>OpenedHand</ulink>:</emphasis>
|
||||
The company where the Yocto Project build system Poky was first developed.
|
||||
OpenedHand has since been acquired by Intel Corporation.</para></listitem>
|
||||
<listitem><para><emphasis><ulink url='http://www.intel.com/'>Intel Corporation</ulink>:</emphasis>
|
||||
The company who acquired OpenedHand in 2008 and continues development on the
|
||||
Yocto Project.</para></listitem>
|
||||
<listitem><para><emphasis><ulink url='http://www.openembedded.org/'>OpenEmbedded</ulink>:</emphasis>
|
||||
<listitem><para><emphasis><ulink url='&OE_HOME_URL;'>OpenEmbedded</ulink>:</emphasis>
|
||||
The upstream, generic, embedded distribution the Yocto Project build system (Poky) derives
|
||||
from and to which it contributes.</para></listitem>
|
||||
<listitem><para><emphasis><ulink url='http://developer.berlios.de/projects/bitbake/'>
|
||||
Bitbake</ulink>:</emphasis> The tool used to process Yocto Project metadata.</para></listitem>
|
||||
BitBake</ulink>:</emphasis> The tool used to process Yocto Project metadata.</para></listitem>
|
||||
<listitem><para><emphasis><ulink url='http://bitbake.berlios.de/manual/'>
|
||||
BitBake User Manual</ulink>:</emphasis> A comprehensive guide to the BitBake tool.
|
||||
</para></listitem>
|
||||
@@ -96,11 +95,9 @@
|
||||
The Yocto Project gladly accepts contributions.
|
||||
You can submit changes to the project either by creating and sending pull requests,
|
||||
or by submitting patches through email.
|
||||
For information on how to do both, see
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html#how-to-submit-a-change'>
|
||||
How to Submit a Change</ulink> in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html'>
|
||||
The Yocto Project Development Manual</ulink>.
|
||||
For information on how to do both, see the
|
||||
"<ulink url='&YOCTO_DOCS_DEV_URL;#how-to-submit-a-change'>How to Submit a Change</ulink>"
|
||||
section in the Yocto Project Development Manual.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -654,7 +654,7 @@ hr {
|
||||
|
||||
|
||||
.tip, .warning, .caution, .note {
|
||||
border-color: #aaa;
|
||||
border-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
@@ -662,24 +662,24 @@ hr {
|
||||
.warning table th,
|
||||
.caution table th,
|
||||
.note table th {
|
||||
border-bottom-color: #aaa;
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
.warning {
|
||||
background-color: #fea;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.caution {
|
||||
background-color: #fea;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.tip {
|
||||
background-color: #eff;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.note {
|
||||
background-color: #dfc;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.glossary dl dt,
|
||||
@@ -946,8 +946,8 @@ table {
|
||||
|
||||
.tip,
|
||||
.note {
|
||||
background: #666666;
|
||||
color: #fff;
|
||||
background: #f0f0f2;
|
||||
color: #333;
|
||||
padding: 20px;
|
||||
margin: 20px;
|
||||
}
|
||||
@@ -958,11 +958,26 @@ table {
|
||||
margin: 0em;
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.tip a,
|
||||
.note a {
|
||||
color: #fff;
|
||||
color: #333;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.footnote {
|
||||
font-size: small;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
/* Changes the announcement text */
|
||||
.tip h3,
|
||||
.warning h3,
|
||||
.caution h3,
|
||||
.note h3 {
|
||||
font-size:large;
|
||||
color: #00557D;
|
||||
}
|
||||
|
||||
|
||||
569
documentation/poky-ref-manual/technical-details.xml
Normal file
@@ -0,0 +1,569 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<chapter id='technical-details'>
|
||||
<title>Technical Details</title>
|
||||
|
||||
<para>
|
||||
This chapter provides technical details for various parts of the Yocto Project.
|
||||
Currently, topics include Yocto Project components and shared state (sstate) cache.
|
||||
</para>
|
||||
|
||||
<section id='usingpoky-components'>
|
||||
<title>Yocto Project Components</title>
|
||||
|
||||
<para>
|
||||
The BitBake task executor together with various types of configuration files form the
|
||||
Yocto Project core.
|
||||
This section overviews the BitBake task executor and the
|
||||
configuration files by describing what they are used for and how they interact.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
BitBake handles the parsing and execution of the data files.
|
||||
The data itself is of various types:
|
||||
<itemizedlist>
|
||||
<listitem><para><emphasis>Recipes:</emphasis> Provides details about particular
|
||||
pieces of software</para></listitem>
|
||||
<listitem><para><emphasis>Class Data:</emphasis> An abstraction of common build
|
||||
information (e.g. how to build a Linux kernel).</para></listitem>
|
||||
<listitem><para><emphasis>Configuration Data:</emphasis> Defines machine-specific settings,
|
||||
policy decisions, etc.
|
||||
Configuration data acts as the glue to bind everything together.</para></listitem>
|
||||
</itemizedlist>
|
||||
For more information on data, see the
|
||||
"<ulink url='&YOCTO_DOCS_DEV_URL;#yocto-project-terms'>Yocto Project Terms</ulink>"
|
||||
section in the Yocto Project Development Manual.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
BitBake knows how to combine multiple data sources together and refers to each data source
|
||||
as a "<link linkend='usingpoky-changes-layers'>layer</link>".
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Following are some brief details on these core components.
|
||||
For more detailed information on these components see the
|
||||
"<link linkend='ref-structure'>Reference: Directory Structure</link>" appendix.
|
||||
</para>
|
||||
|
||||
<section id='usingpoky-components-bitbake'>
|
||||
<title>BitBake</title>
|
||||
|
||||
<para>
|
||||
BitBake is the tool at the heart of the Yocto Project and is responsible
|
||||
for parsing the metadata, generating a list of tasks from it,
|
||||
and then executing those tasks.
|
||||
To see a list of the options BitBake supports, use the following help command:
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake --help
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The most common usage for BitBake is <filename>bitbake <packagename></filename>, where
|
||||
<filename>packagename</filename> is the name of the package you want to build
|
||||
(referred to as the "target" in this manual).
|
||||
The target often equates to the first part of a <filename>.bb</filename> filename.
|
||||
So, to run the <filename>matchbox-desktop_1.2.3.bb</filename> file, you
|
||||
might type the following:
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake matchbox-desktop
|
||||
</literallayout>
|
||||
Several different versions of <filename>matchbox-desktop</filename> might exist.
|
||||
BitBake chooses the one selected by the distribution configuration.
|
||||
You can get more details about how BitBake chooses between different
|
||||
target versions and providers in the
|
||||
"<link linkend='ref-bitbake-providers'>Preferences and Providers</link>" section.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
BitBake also tries to execute any dependent tasks first.
|
||||
So for example, before building <filename>matchbox-desktop</filename>, BitBake
|
||||
would build a cross compiler and <filename>eglibc</filename> if they had not already
|
||||
been built.
|
||||
<note>This release of the Yocto Project does not support the <filename>glibc</filename>
|
||||
GNU version of the Unix standard C library. By default, the Yocto Project builds with
|
||||
<filename>eglibc</filename>.</note>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
A useful BitBake option to consider is the <filename>-k</filename> or
|
||||
<filename>--continue</filename> option.
|
||||
This option instructs BitBake to try and continue processing the job as much
|
||||
as possible even after encountering an error.
|
||||
When an error occurs, the target that
|
||||
failed and those that depend on it cannot be remade.
|
||||
However, when you use this option other dependencies can still be processed.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='usingpoky-components-metadata'>
|
||||
<title>Metadata (Recipes)</title>
|
||||
|
||||
<para>
|
||||
The <filename>.bb</filename> files are usually referred to as "recipes."
|
||||
In general, a recipe contains information about a single piece of software.
|
||||
The information includes the location from which to download the source patches
|
||||
(if any are needed), which special configuration options to apply,
|
||||
how to compile the source files, and how to package the compiled output.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The term "package" can also be used to describe recipes.
|
||||
However, since the same word is used for the packaged output from the Yocto
|
||||
Project (i.e. <filename>.ipk</filename> or <filename>.deb</filename> files),
|
||||
this document avoids using the term "package" when referring to recipes.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='usingpoky-components-classes'>
|
||||
<title>Classes</title>
|
||||
|
||||
<para>
|
||||
Class files (<filename>.bbclass</filename>) contain information that is useful to share
|
||||
between metadata files.
|
||||
An example is the Autotools class, which contains
|
||||
common settings for any application that Autotools uses.
|
||||
The "<link linkend='ref-classes'>Reference: Classes</link>" appendix provides details
|
||||
about common classes and how to use them.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='usingpoky-components-configuration'>
|
||||
<title>Configuration</title>
|
||||
|
||||
<para>
|
||||
The configuration files (<filename>.conf</filename>) define various configuration variables
|
||||
that govern the Yocto Project build process.
|
||||
These files fall into several areas that define machine configuration options,
|
||||
distribution configuration options, compiler tuning options, general common configuration
|
||||
options and user configuration options (<filename>local.conf</filename>, which is found
|
||||
in the Yocto Project files build directory).
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id="shared-state-cache">
|
||||
<title>Shared State Cache</title>
|
||||
|
||||
<para>
|
||||
By design, the Yocto Project build system builds everything from scratch unless
|
||||
BitBake can determine that parts don't need to be rebuilt.
|
||||
Fundamentally, building from scratch is attractive as it means all parts are
|
||||
built fresh and there is no possibility of stale data causing problems.
|
||||
When developers hit problems, they typically default back to building from scratch
|
||||
so they know the state of things from the start.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Building an image from scratch is both an advantage and a disadvantage to the process.
|
||||
As mentioned in the previous paragraph, building from scratch ensures that
|
||||
everything is current and starts from a known state.
|
||||
However, building from scratch also takes much longer as it generally means
|
||||
rebuilding things that don't necessarily need rebuilt.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The Yocto Project implements shared state code that supports incremental builds.
|
||||
The implementation of the shared state code answers the following questions that
|
||||
were fundamental roadblocks within the Yocto Project incremental build support system:
|
||||
<itemizedlist>
|
||||
<listitem>What pieces of the system have changed and what pieces have not changed?</listitem>
|
||||
<listitem>How are changed pieces of software removed and replaced?</listitem>
|
||||
<listitem>How are pre-built components that don't need to be rebuilt from scratch
|
||||
used when they are available?</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For the first question, the build system detects changes in the "inputs" to a given task by
|
||||
creating a checksum (or signature) of the task's inputs.
|
||||
If the checksum changes, the system assumes the inputs have changed and the task needs to be
|
||||
rerun.
|
||||
For the second question, the shared state (sstate) code tracks which tasks add which output
|
||||
to the build process.
|
||||
This means the output from a given task can be removed, upgraded or otherwise manipulated.
|
||||
The third question is partly addressed by the solution for the second question
|
||||
assuming the build system can fetch the sstate objects from remote locations and
|
||||
install them if they are deemed to be valid.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The rest of this section goes into detail about the overall incremental build
|
||||
architecture, the checksums (signatures), shared state, and some tips and tricks.
|
||||
</para>
|
||||
|
||||
<section id='overall-architecture'>
|
||||
<title>Overall Architecture</title>
|
||||
|
||||
<para>
|
||||
When determining what parts of the system need to be built, BitBake
|
||||
uses a per-task basis and does not use a per-recipe basis.
|
||||
You might wonder why using a per-task basis is preferred over a per-recipe basis.
|
||||
To help explain, consider having the IPK packaging backend enabled and then switching to DEB.
|
||||
In this case, <filename>do_install</filename> and <filename>do_package</filename>
|
||||
output are still valid.
|
||||
However, with a per-recipe approach, the build would not include the
|
||||
<filename>.deb</filename> files.
|
||||
Consequently, you would have to invalidate the whole build and rerun it.
|
||||
Rerunning everything is not the best situation.
|
||||
Also in this case, the core must be "taught" much about specific tasks.
|
||||
This methodology does not scale well and does not allow users to easily add new tasks
|
||||
in layers or as external recipes without touching the packaged-staging core.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='checksums'>
|
||||
<title>Checksums (Signatures)</title>
|
||||
|
||||
<para>
|
||||
The shared state code uses a checksum, which is a unique signature of a task's
|
||||
inputs, to determine if a task needs to be run again.
|
||||
Because it is a change in a task's inputs that triggers a rerun, the process
|
||||
needs to detect all the inputs to a given task.
|
||||
For shell tasks, this turns out to be fairly easy because
|
||||
the build process generates a "run" shell script for each task and
|
||||
it is possible to create a checksum that gives you a good idea of when
|
||||
the task's data changes.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To complicate the problem, there are things that should not be included in
|
||||
the checksum.
|
||||
First, there is the actual specific build path of a given task -
|
||||
the <filename>WORKDIR</filename>.
|
||||
It does not matter if the working directory changes because it should not
|
||||
affect the output for target packages.
|
||||
Also, the build process has the objective of making native/cross packages relocatable.
|
||||
The checksum therefore needs to exclude <filename>WORKDIR</filename>.
|
||||
The simplistic approach for excluding the working directory is to set
|
||||
<filename>WORKDIR</filename> to some fixed value and create the checksum
|
||||
for the "run" script.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Another problem results from the "run" scripts containing functions that
|
||||
might or might not get called.
|
||||
The incremental build solution contains code that figures out dependencies
|
||||
between shell functions.
|
||||
This code is used to prune the "run" scripts down to the minimum set,
|
||||
thereby alleviating this problem and making the "run" scripts much more
|
||||
readable as a bonus.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
So far we have solutions for shell scripts.
|
||||
What about python tasks?
|
||||
The same approach applies even though these tasks are more difficult.
|
||||
The process needs to figure out what variables a python function accesses
|
||||
and what functions it calls.
|
||||
Again, the incremental build solution contains code that first figures out
|
||||
the variable and function dependencies, and then creates a checksum for the data
|
||||
used as the input to the task.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Like the <filename>WORKDIR</filename> case, situations exist where dependencies
|
||||
should be ignored.
|
||||
For these cases, you can instruct the build process to ignore a dependency
|
||||
by using a line like the following:
|
||||
<literallayout class='monospaced'>
|
||||
PACKAGE_ARCHS[vardepsexclude] = "MACHINE"
|
||||
</literallayout>
|
||||
This example ensures that the <filename>PACKAGE_ARCHS</filename> variable does not
|
||||
depend on the value of <filename>MACHINE</filename>, even if it does reference it.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Equally, there are cases where we need to add dependencies BitBake is not able to find.
|
||||
You can accomplish this by using a line like the following:
|
||||
<literallayout class='monospaced'>
|
||||
PACKAGE_ARCHS[vardeps] = "MACHINE"
|
||||
</literallayout>
|
||||
This example explicitly adds the <filename>MACHINE</filename> variable as a
|
||||
dependency for <filename>PACKAGE_ARCHS</filename>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Consider a case with inline python, for example, where BitBake is not
|
||||
able to figure out dependencies.
|
||||
When running in debug mode (i.e. using <filename>-DDD</filename>), BitBake
|
||||
produces output when it discovers something for which it cannot figure out
|
||||
dependencies.
|
||||
The Yocto Project team has currently not managed to cover those dependencies
|
||||
in detail and is aware of the need to fix this situation.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Thus far, this section has limited discussion to the direct inputs into a task.
|
||||
Information based on direct inputs is referred to as the "basehash" in the
|
||||
code.
|
||||
However, there is still the question of a task's indirect inputs - the
|
||||
things that were already built and present in the build directory.
|
||||
The checksum (or signature) for a particular task needs to add the hashes
|
||||
of all the tasks on which the particular task depends.
|
||||
Choosing which dependencies to add is a policy decision.
|
||||
However, the effect is to generate a master checksum that combines the basehash
|
||||
and the hashes of the task's dependencies.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
At the code level, there are a variety of ways both the basehash and the
|
||||
dependent task hashes can be influenced.
|
||||
Within the BitBake configuration file, we can give BitBake some extra information
|
||||
to help it construct the basehash.
|
||||
The following statements effectively result in a list of global variable
|
||||
dependency excludes - variables never included in any checksum:
|
||||
<literallayout class='monospaced'>
|
||||
BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH"
|
||||
BB_HASHBASE_WHITELIST += "DL_DIR SSTATE_DIR THISDIR FILESEXTRAPATHS"
|
||||
BB_HASHBASE_WHITELIST += "FILE_DIRNAME HOME LOGNAME SHELL TERM USER"
|
||||
BB_HASHBASE_WHITELIST += "FILESPATH USERNAME STAGING_DIR_HOST STAGING_DIR_TARGET"
|
||||
</literallayout>
|
||||
The previous example actually excludes
|
||||
<link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>
|
||||
since it is actually constructed as a path within
|
||||
<filename>TMPDIR</filename>, which is on
|
||||
the whitelist.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The rules for deciding which hashes of dependent tasks to include through
|
||||
dependency chains are more complex and are generally accomplished with a
|
||||
python function.
|
||||
The code in <filename>meta/lib/oe/sstatesig.py</filename> shows two examples
|
||||
of this and also illustrates how you can insert your own policy into the system
|
||||
if so desired.
|
||||
This file defines the two basic signature generators <filename>OE-Core</filename>
|
||||
uses: "OEBasic" and "OEBasicHash".
|
||||
By default, there is a dummy "noop" signature handler enabled in BitBake.
|
||||
This means that behavior is unchanged from previous versions.
|
||||
<filename>OE-Core</filename> uses the "OEBasic" signature handler by default
|
||||
through this setting in the <filename>bitbake.conf</filename> file:
|
||||
<literallayout class='monospaced'>
|
||||
BB_SIGNATURE_HANDLER ?= "OEBasic"
|
||||
</literallayout>
|
||||
The "OEBasicHash" <filename>BB_SIGNATURE_HANDLER</filename> is the same as the
|
||||
"OEBasic" version but adds the task hash to the stamp files.
|
||||
This results in any metadata change that changes the task hash, automatically
|
||||
causing the task to be run again.
|
||||
This removes the need to bump <link linkend='var-PR'><filename>PR</filename></link>
|
||||
values and changes to metadata automatically ripple across the build.
|
||||
Currently, this behavior is not the default behavior for <filename>OE-Core</filename>
|
||||
but is the default in <filename>poky</filename>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
It is also worth noting that the end result of these signature generators is to
|
||||
make some dependency and hash information available to the build.
|
||||
This information includes:
|
||||
<literallayout class='monospaced'>
|
||||
BB_BASEHASH_task-<taskname> - the base hashes for each task in the recipe
|
||||
BB_BASEHASH_<filename:taskname> - the base hashes for each dependent task
|
||||
BBHASHDEPS_<filename:taskname> - The task dependencies for each task
|
||||
BB_TASKHASH - the hash of the currently running task
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='shared-state'>
|
||||
<title>Shared State</title>
|
||||
|
||||
<para>
|
||||
Checksums and dependencies, as discussed in the previous section, solve half the
|
||||
problem.
|
||||
The other part of the problem is being able to use checksum information during the build
|
||||
and being able to reuse or rebuild specific components.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The shared state class (<filename>sstate.bbclass</filename>)
|
||||
is a relatively generic implementation of how to "capture" a snapshot of a given task.
|
||||
The idea is that the build process does not care about the source of a task's output.
|
||||
Output could be freshly built or it could be downloaded and unpacked from
|
||||
somewhere - the build process doesn't need to worry about its source.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
There are two types of output, one is just about creating a directory
|
||||
in <filename>WORKDIR</filename>.
|
||||
A good example is the output of either <filename>do_install</filename> or
|
||||
<filename>do_package</filename>.
|
||||
The other type of output occurs when a set of data is merged into a shared directory
|
||||
tree such as the sysroot.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The Yocto Project team has tried to keep the details of the implementation hidden in
|
||||
<filename>sstate.bbclass</filename>.
|
||||
From a user's perspective, adding shared state wrapping to a task
|
||||
is as simple as this <filename>do_deploy</filename> example taken from
|
||||
<filename>do_deploy.bbclass</filename>:
|
||||
<literallayout class='monospaced'>
|
||||
DEPLOYDIR = "${WORKDIR}/deploy-${PN}"
|
||||
SSTATETASKS += "do_deploy"
|
||||
do_deploy[sstate-name] = "deploy"
|
||||
do_deploy[sstate-inputdirs] = "${DEPLOYDIR}"
|
||||
do_deploy[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"
|
||||
|
||||
python do_deploy_setscene () {
|
||||
sstate_setscene(d)
|
||||
}
|
||||
addtask do_deploy_setscene
|
||||
</literallayout>
|
||||
In the example, we add some extra flags to the task, a name field ("deploy"), an
|
||||
input directory where the task sends data, and the output
|
||||
directory where the data from the task should eventually be copied.
|
||||
We also add a <filename>_setscene</filename> variant of the task and add the task
|
||||
name to the <filename>SSTATETASKS</filename> list.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If you have a directory whose contents you need to preserve, you can do this with
|
||||
a line like the following:
|
||||
<literallayout class='monospaced'>
|
||||
do_package[sstate-plaindirs] = "${PKGD} ${PKGDEST}"
|
||||
</literallayout>
|
||||
This method, as well as the following example, also works for multiple directories.
|
||||
<literallayout class='monospaced'>
|
||||
do_package[sstate-inputdirs] = "${PKGDESTWORK} ${SHLIBSWORKDIR}"
|
||||
do_package[sstate-outputdirs] = "${PKGDATA_DIR} ${SHLIBSDIR}"
|
||||
do_package[sstate-lockfile] = "${PACKAGELOCK}"
|
||||
</literallayout>
|
||||
These methods also include the ability to take a lockfile when manipulating
|
||||
shared state directory structures since some cases are sensitive to file
|
||||
additions or removals.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Behind the scenes, the shared state code works by looking in
|
||||
<filename>SSTATE_DIR</filename> and
|
||||
<filename>SSTATE_MIRRORS</filename> for shared state files.
|
||||
Here is an example:
|
||||
<literallayout class='monospaced'>
|
||||
SSTATE_MIRRORS ?= "\
|
||||
file://.* http://someserver.tld/share/sstate/ \n \
|
||||
file://.* file:///some/local/dir/sstate/"
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The shared state package validity can be detected just by looking at the
|
||||
filename since the filename contains the task checksum (or signature) as
|
||||
described earlier in this section.
|
||||
If a valid shared state package is found, the build process downloads it
|
||||
and uses it to accelerate the task.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The build processes uses the <filename>*_setscene</filename> tasks
|
||||
for the task acceleration phase.
|
||||
BitBake goes through this phase before the main execution code and tries
|
||||
to accelerate any tasks for which it can find shared state packages.
|
||||
If a shared state package for a task is available, the shared state
|
||||
package is used.
|
||||
This means the task and any tasks on which it is dependent are not
|
||||
executed.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
As a real world example, the aim is when building an IPK-based image,
|
||||
only the <filename>do_package_write_ipk</filename> tasks would have their
|
||||
shared state packages fetched and extracted.
|
||||
Since the sysroot is not used, it would never get extracted.
|
||||
This is another reason why a task-based approach is preferred over a
|
||||
recipe-based approach, which would have to install the output from every task.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='tips-and-tricks'>
|
||||
<title>Tips and Tricks</title>
|
||||
|
||||
<para>
|
||||
The code in the Yocto Project that supports incremental builds is not
|
||||
simple code.
|
||||
This section presents some tips and tricks that help you work around
|
||||
issues related to shared state code.
|
||||
</para>
|
||||
|
||||
<section id='debugging'>
|
||||
<title>Debugging</title>
|
||||
|
||||
<para>
|
||||
When things go wrong, debugging needs to be straightforward.
|
||||
Because of this, the Yocto Project team included strong debugging
|
||||
tools:
|
||||
<itemizedlist>
|
||||
<listitem><para>Whenever a shared state package is written out, so is a
|
||||
corresponding <filename>.siginfo</filename> file.
|
||||
This practice results in a pickled python database of all
|
||||
the metadata that went into creating the hash for a given shared state
|
||||
package.</para></listitem>
|
||||
<listitem><para>If BitBake is run with the <filename>--dump-signatures</filename>
|
||||
(or <filename>-S</filename>) option, BitBake dumps out
|
||||
<filename>.siginfo</filename> files in
|
||||
the stamp directory for every task it would have executed instead of
|
||||
building the specified target package.</para></listitem>
|
||||
<listitem><para>There is a <filename>bitbake-diffsigs</filename> command that
|
||||
can process these <filename>.siginfo</filename> files.
|
||||
If one file is specified, it will dump out the dependency
|
||||
information in the file.
|
||||
If two files are specified, it will compare the two files and dump out
|
||||
the differences between the two.
|
||||
This allows the question of "What changed between X and Y?" to be
|
||||
answered easily.</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='invalidating-shared-state'>
|
||||
<title>Invalidating Shared State</title>
|
||||
|
||||
<para>
|
||||
The shared state code uses checksums and shared state memory
|
||||
cache to avoid unnecessarily rebuilding tasks.
|
||||
As with all schemes, this one has some drawbacks.
|
||||
It is possible that you could make implicit changes that are not factored
|
||||
into the checksum calculation, but do affect a task's output.
|
||||
A good example is perhaps when a tool changes its output.
|
||||
Let's say that the output of <filename>rpmdeps</filename> needed to change.
|
||||
The result of the change should be that all the "package", "package_write_rpm",
|
||||
and "package_deploy-rpm" shared state cache items would become invalid.
|
||||
But, because this is a change that is external to the code and therefore implicit,
|
||||
the associated shared state cache items do not become invalidated.
|
||||
In this case, the build process would use the cached items rather than running the
|
||||
task again.
|
||||
Obviously, these types of implicit changes can cause problems.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To avoid these problems during the build, you need to understand the effects of any
|
||||
change you make.
|
||||
Note that any changes you make directly to a function automatically are factored into
|
||||
the checksum calculation and thus, will invalidate the associated area of sstate cache.
|
||||
You need to be aware of any implicit changes that are not obvious changes to the
|
||||
code and could affect the output of a given task.
|
||||
Once you are aware of such a change, you can take steps to invalidate the cache
|
||||
and force the task to run.
|
||||
The step to take is as simple as changing a function's comments in the source code.
|
||||
For example, to invalidate package shared state files, change the comment statements
|
||||
of <filename>do_package</filename> or the comments of one of the functions it calls.
|
||||
The change is purely cosmetic, but it causes the checksum to be recalculated and
|
||||
forces the task to be run again.
|
||||
</para>
|
||||
|
||||
<note>
|
||||
For an example of a commit that makes a cosmetic change to invalidate
|
||||
a shared state, see this
|
||||
<ulink url='&YOCTO_GIT_URL;/cgit.cgi/poky/commit/meta/classes/package.bbclass?id=737f8bbb4f27b4837047cb9b4fbfe01dfde36d54'>commit</ulink>.
|
||||
</note>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
</chapter>
|
||||
<!--
|
||||
vim: expandtab tw=80 ts=4
|
||||
-->
|
||||
@@ -1,216 +1,87 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<chapter id='usingpoky'>
|
||||
<title>Using the Yocto Project</title>
|
||||
|
||||
<para>
|
||||
This section gives an overview of the components that make up the Yocto Project
|
||||
followed by information about Yocto Project builds and dealing with any
|
||||
problems that might arise.
|
||||
This chapter describes common usage for the Yocto Project.
|
||||
The information is introductory in nature as other manuals in the Yocto Project
|
||||
provide more details on how to use the Yocto Project.
|
||||
</para>
|
||||
|
||||
<section id='usingpoky-components'>
|
||||
<title>Yocto Project Components</title>
|
||||
|
||||
<para>
|
||||
The BitBake task executor together with various types of configuration files form the
|
||||
Yocto Project core.
|
||||
This section overviews the BitBake task executor and the
|
||||
configuration files by describing what they are used for and they they interact.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
BitBake handles the parsing and execution of the data files.
|
||||
The data itself is of various types:
|
||||
<itemizedlist>
|
||||
<listitem><para><emphasis>Recipes:</emphasis> Provides details about particular
|
||||
pieces of software</para></listitem>
|
||||
<listitem><para><emphasis>Class Data:</emphasis> An abstraction of common build
|
||||
information (e.g. how to build a Linux kernel).</para></listitem>
|
||||
<listitem><para><emphasis>Configuration Data:</emphasis> Defines machine-specific settings,
|
||||
policy decisions, etc.
|
||||
Configuration data acts a the glue to bind everything together.</para></listitem>
|
||||
</itemizedlist>
|
||||
For more information on data, see the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html#yocto-project-terms'>
|
||||
Yocto Project Terms</ulink> section in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html'>
|
||||
The Yocto Project Development Manual</ulink>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
BitBake knows how to combine multiple data sources together and refers to each data source
|
||||
as a <link linkend='usingpoky-changes-layers'>'layer'</link>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Following are some brief details on these core components.
|
||||
For more detailed information on these components see the
|
||||
<link linkend='ref-structure'>'Reference: Directory Structure'</link>
|
||||
appendix.
|
||||
</para>
|
||||
|
||||
<section id='usingpoky-components-bitbake'>
|
||||
<title>BitBake</title>
|
||||
|
||||
<para>
|
||||
BitBake is the tool at the heart of the Yocto Project and is responsible
|
||||
for parsing the metadata, generating a list of tasks from it,
|
||||
and then executing those tasks.
|
||||
To see a list of the options BitBake supports, use the following help command:
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake --help
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The most common usage for BitBake is <filename>bitbake <packagename></filename>, where
|
||||
<filename>packagename</filename> is the name of the package you want to build
|
||||
(referred to as the "target" in this manual).
|
||||
The target often equates to the first part of a <filename>.bb</filename> filename.
|
||||
So, to run the <filename>matchbox-desktop_1.2.3.bb</filename> file, you
|
||||
might type the following:
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake matchbox-desktop
|
||||
</literallayout>
|
||||
Several different versions of <filename>matchbox-desktop</filename> might exist.
|
||||
BitBake chooses the one selected by the distribution configuration.
|
||||
You can get more details about how BitBake chooses between different
|
||||
target versions and providers in the
|
||||
<link linkend='ref-bitbake-providers'>Preferences and Providers</link> section.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
BitBake also tries to execute any dependent tasks first.
|
||||
So for example, before building <filename>matchbox-desktop</filename>, BitBake
|
||||
would build a cross compiler and <filename>eglibc</filename> if they had not already
|
||||
been built.
|
||||
<note>This release of the Yocto Project does not support the <filename>glibc</filename>
|
||||
GNU version of the Unix standard C library. By default, the Yocto Project builds with
|
||||
<filename>eglibc</filename>.</note>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
A useful BitBake option to consider is the <filename>-k</filename> or
|
||||
<filename>--continue</filename> option.
|
||||
This option instructs BitBake to try and continue processing the job as much
|
||||
as possible even after encountering an error.
|
||||
When an error occurs, the target that
|
||||
failed and those that depend on it cannot be remade.
|
||||
However, when you use this option other dependencies can still be processed.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='usingpoky-components-metadata'>
|
||||
<title>Metadata (Recipes)</title>
|
||||
|
||||
<para>
|
||||
The <filename>.bb</filename> files are usually referred to as "recipes."
|
||||
In general, a recipe contains information about a single piece of software.
|
||||
The information includes the location from which to download the source patches
|
||||
(if any are needed), which special configuration options to apply,
|
||||
how to compile the source files, and how to package the compiled output.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The term "package" can also be used to describe recipes.
|
||||
However, since the same word is used for the packaged output from the Yocto
|
||||
Project (i.e. <filename>.ipk</filename> or <filename>.deb</filename> files),
|
||||
this document avoids using the term "package" to refer to recipes.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='usingpoky-components-classes'>
|
||||
<title>Classes</title>
|
||||
|
||||
<para>
|
||||
Class files (<filename>.bbclass</filename>) contain information that is useful to share
|
||||
between metadata files.
|
||||
An example is the Autotools class, which contains
|
||||
common settings for any application that Autotools uses.
|
||||
The <link linkend='ref-classes'>Reference: Classes</link> appendix provides details
|
||||
about common classes and how to use them.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id='usingpoky-components-configuration'>
|
||||
<title>Configuration</title>
|
||||
|
||||
<para>
|
||||
The configuration files (<filename>.conf</filename>) define various configuration variables
|
||||
that govern the Yocto Project build process.
|
||||
These files fall into several areas that define machine configuration options,
|
||||
distribution configuration options, compiler tuning options, general common configuration
|
||||
options and user configuration options (<filename>local.conf</filename>, which is found
|
||||
in the Yocto Project files build directory).
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
||||
<section id='usingpoky-build'>
|
||||
<title>Running a Build</title>
|
||||
|
||||
<para>
|
||||
You can find information on how to build an image using the Yocto Project in the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html#building-image'>
|
||||
Building an Image</ulink> section of the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html'>
|
||||
Yocto Project Quick Start</ulink>.
|
||||
This section provides a quick overview.
|
||||
You can find general information on how to build an image using the
|
||||
Yocto Project in the
|
||||
"<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>"
|
||||
section of The Yocto Project Quick Start.
|
||||
This section provides a summary of the build process and provides information
|
||||
for less obvious aspects of the build process.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The first thing you need to do is set up the Yocto Project build environment by sourcing
|
||||
the environment setup script as follows:
|
||||
<literallayout class='monospaced'>
|
||||
$ source oe-init-build-env [build_dir];
|
||||
</literallayout>
|
||||
</para>
|
||||
<section id='build-overview'>
|
||||
<title>Build Overview</title>
|
||||
|
||||
<para>
|
||||
The <filename>build_dir</filename> is optional and specifies the directory Yocto Project
|
||||
uses for the build.
|
||||
If you do not specify a build directory it defaults to <filename>build</filename>
|
||||
in the Yocto Project files directory structure.
|
||||
A common practice is to use a different build directory for different targets.
|
||||
For example, <filename>~/build/x86</filename> for a <filename>qemux86</filename>
|
||||
target, and <filename>~/build/arm</filename> for a <filename>qemuarm</filename> target.
|
||||
See <link linkend="structure-core-script">oe-init-build-env</link>
|
||||
for more information on this script.
|
||||
</para>
|
||||
<para>
|
||||
The first thing you need to do is set up the Yocto Project build environment by sourcing
|
||||
the environment setup script as follows:
|
||||
<literallayout class='monospaced'>
|
||||
$ source oe-init-build-env [build_dir]
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Once the Yocto Project build environment is set up, you can build a target using:
|
||||
<literallayout class='monospaced'>
|
||||
<para>
|
||||
The <filename>build_dir</filename> is optional and specifies the directory Yocto Project
|
||||
uses for the build.
|
||||
If you do not specify a build directory it defaults to <filename>build</filename>
|
||||
in your current working directory.
|
||||
A common practice is to use a different build directory for different targets.
|
||||
For example, <filename>~/build/x86</filename> for a <filename>qemux86</filename>
|
||||
target, and <filename>~/build/arm</filename> for a <filename>qemuarm</filename> target.
|
||||
See <link linkend="structure-core-script">oe-init-build-env</link>
|
||||
for more information on this script.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Once the Yocto Project build environment is set up, you can build a target using:
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake <target>
|
||||
</literallayout>
|
||||
</para>
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The <filename>target</filename> is the name of the recipe you want to build.
|
||||
Common targets are the images in <filename>meta/recipes-core/images</filename>,
|
||||
<filename>/meta/recipes-sato/images</filename>, etc. all found in the Yocto Project
|
||||
files.
|
||||
Or, the target can be the name of a recipe for a specific piece of software such as
|
||||
<application>busybox</application>.
|
||||
For more details about the images Yocto Project supports, see the
|
||||
<link linkend="ref-images">'Reference: Images'</link> appendix.
|
||||
</para>
|
||||
<para>
|
||||
The <filename>target</filename> is the name of the recipe you want to build.
|
||||
Common targets are the images in <filename>meta/recipes-core/images</filename>,
|
||||
<filename>/meta/recipes-sato/images</filename>, etc. all found in the Yocto Project
|
||||
files.
|
||||
Or, the target can be the name of a recipe for a specific piece of software such as
|
||||
<application>busybox</application>.
|
||||
For more details about the images the Yocto Project supports, see the
|
||||
"<link linkend="ref-images">Reference: Images</link>" appendix.
|
||||
</para>
|
||||
|
||||
<note>
|
||||
Building an image without GNU Public License Version 3 (GPLv3) components is
|
||||
only supported for minimal and base images.
|
||||
See <link linkend='ref-images'>'Reference: Images'</link> for more information.
|
||||
</note>
|
||||
<note>
|
||||
Building an image without GNU Public License Version 3 (GPLv3) components is
|
||||
only supported for minimal and base images.
|
||||
See the "<link linkend='ref-images'>Reference: Images</link>" appendix for more information.
|
||||
</note>
|
||||
</section>
|
||||
|
||||
<note>
|
||||
When building an image using GPL components, you need to maintain your original
|
||||
settings and not switch back and forth applying different versions of the GNU
|
||||
Public License.
|
||||
If you rebuild using different versions of GPL, dependency errors might occur
|
||||
due to some components not being rebuilt.
|
||||
</note>
|
||||
<section id='building-an-image-using-gpl-components'>
|
||||
<title>Building an Image Using GPL Components</title>
|
||||
|
||||
<para>
|
||||
When building an image using GPL components, you need to maintain your original
|
||||
settings and not switch back and forth applying different versions of the GNU
|
||||
Public License.
|
||||
If you rebuild using different versions of GPL, dependency errors might occur
|
||||
due to some components not being rebuilt.
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id='usingpoky-install'>
|
||||
@@ -222,10 +93,8 @@
|
||||
<filename class="directory">tmp/deploy/images</filename>.
|
||||
For information on how to run pre-built images such as <filename>qemux86</filename>
|
||||
and <filename>qemuarm</filename>, see the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html#using-pre-built'>
|
||||
Using Pre-Built Binaries and QEMU</ulink> section in the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html'>
|
||||
Yocto Project Quick Start</ulink>.
|
||||
"<ulink url='&YOCTO_DOCS_QS_URL;#using-pre-built'>Using Pre-Built Binaries and QEMU</ulink>"
|
||||
section in the Yocto Project Quick Start.
|
||||
For information about how to install these images, see the documentation for your
|
||||
particular board/machine.
|
||||
</para>
|
||||
@@ -310,7 +179,7 @@
|
||||
You can view a list of tasks in a given package by running the
|
||||
<filename>listtasks</filename> task as follows:
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake matchbox-desktop -c
|
||||
$ bitbake matchbox-desktop -c listtasks
|
||||
</literallayout>
|
||||
The results are in the file <filename>${WORKDIR}/temp/log.do_listtasks</filename>.
|
||||
</para>
|
||||
@@ -426,7 +295,7 @@
|
||||
if fatal_error:
|
||||
bb.fatal("fatal_error detected, unable to print the task list")
|
||||
bb.plain("The tasks present are abc")
|
||||
bb.debug(2, "Finished figureing out the tasklist")
|
||||
bb.debug(2, "Finished figuring out the tasklist")
|
||||
}
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
48
documentation/poky.ent
Normal file
@@ -0,0 +1,48 @@
|
||||
<!ENTITY DISTRO "1.1.2">
|
||||
<!ENTITY DISTRO_NAME "edison">
|
||||
<!ENTITY YOCTO_DOC_VERSION "1.1.2">
|
||||
<!ENTITY POKYVERSION "6.0.2">
|
||||
<!ENTITY YOCTO_POKY "poky-&DISTRO_NAME;-&POKYVERSION;">
|
||||
<!ENTITY COPYRIGHT_YEAR "2010-2012">
|
||||
<!ENTITY YOCTO_DL_URL "http://downloads.yoctoproject.org">
|
||||
<!ENTITY YOCTO_HOME_URL "http://www.yoctoproject.org">
|
||||
<!ENTITY YOCTO_LISTS_URL "http://lists.yoctoproject.org">
|
||||
<!ENTITY YOCTO_BUGZILLA_URL "http://bugzilla.yoctoproject.org">
|
||||
<!ENTITY YOCTO_WIKI_URL "https://wiki.yoctoproject.org">
|
||||
<!ENTITY YOCTO_AB_URL "http://autobuilder.yoctoproject.org">
|
||||
<!ENTITY YOCTO_GIT_URL "http://git.yoctoproject.org">
|
||||
<!ENTITY YOCTO_ADTREPO_URL "http://adtrepo.yoctoproject.org">
|
||||
<!ENTITY OE_HOME_URL "http://www.openembedded.org">
|
||||
<!ENTITY OE_DOCS_URL "http://docs.openembedded.org">
|
||||
<!ENTITY OH_HOME_URL "http://o-hand.com">
|
||||
<!ENTITY BITBAKE_HOME_URL "http://developer.berlios.de/projects/bitbake/">
|
||||
<!ENTITY BITBAKE_DOCS_URL "http://bitbake.berlios.de/manual/">
|
||||
<!ENTITY ECLIPSE_MAIN_URL "http://www.eclipse.org/downloads">
|
||||
<!ENTITY ECLIPSE_DL_URL "http://download.eclipse.org">
|
||||
<!ENTITY ECLIPSE_DL_PLUGIN_URL "&YOCTO_DL_URL;/releases/eclipse-plugin/&DISTRO;">
|
||||
<!ENTITY ECLIPSE_UPDATES_URL "&ECLIPSE_DL_URL;/tm/updates/3.3">
|
||||
<!ENTITY ECLIPSE_INDIGO_URL "&ECLIPSE_DL_URL;/releases/indigo">
|
||||
<!ENTITY ECLIPSE_INDIGO_CDT_URL "&ECLIPSE_DL_URL;tools/cdt/releases/indigo">
|
||||
<!ENTITY YOCTO_DOCS_URL "&YOCTO_HOME_URL;/docs">
|
||||
<!ENTITY YOCTO_SOURCES_URL "&YOCTO_HOME_URL;/sources/">
|
||||
<!ENTITY YOCTO_AB_PORT_URL "&YOCTO_AB_URL;:8010">
|
||||
<!ENTITY YOCTO_AB_NIGHTLY_URL "&YOCTO_AB_URL;/nightly/">
|
||||
<!ENTITY YOCTO_POKY_URL "&YOCTO_DL_URL;/releases/poky/">
|
||||
<!ENTITY YOCTO_RELEASE_DL_URL "&YOCTO_DL_URL;/releases/yocto/yocto-&DISTRO;">
|
||||
<!ENTITY YOCTO_TOOLCHAIN_DL_URL "&YOCTO_RELEASE_DL_URL;/toolchain/">
|
||||
<!ENTITY YOCTO_ECLIPSE_DL_URL "&YOCTO_RELEASE_DL_URL;/eclipse-plugin/indigo;">
|
||||
<!ENTITY YOCTO_ADTINSTALLER_DL_URL "&YOCTO_RELEASE_DL_URL;/adt_installer">
|
||||
<!ENTITY YOCTO_POKY_DL_URL "&YOCTO_RELEASE_DL_URL;/&YOCTO_POKY;.tar.bz2">
|
||||
<!ENTITY YOCTO_MACHINES_DL_URL "&YOCTO_RELEASE_DL_URL;/machines">
|
||||
<!ENTITY YOCTO_QEMU_DL_URL "&YOCTO_MACHINES_DL_URL;/qemu">
|
||||
<!ENTITY YOCTO_PYTHON-i686_DL_URL "&YOCTO_DL_URL;/releases/miscsupport/python-nativesdk-standalone-i686.tar.bz2">
|
||||
<!ENTITY YOCTO_PYTHON-x86_64_DL_URL "&YOCTO_DL_URL;/releases/miscsupport/python-nativesdk-standalone-x86_64.tar.bz2">
|
||||
<!ENTITY YOCTO_DOCS_QS_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/yocto-project-qs/yocto-project-qs.html">
|
||||
<!ENTITY YOCTO_DOCS_ADT_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/adt-manual/adt-manual.html">
|
||||
<!ENTITY YOCTO_DOCS_REF_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/poky-ref-manual/poky-ref-manual.html">
|
||||
<!ENTITY YOCTO_DOCS_BSP_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/bsp-guide/bsp-guide.html">
|
||||
<!ENTITY YOCTO_DOCS_DEV_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/dev-manual/dev-manual.html">
|
||||
<!ENTITY YOCTO_DOCS_KERNEL_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/kernel-manual/kernel-manual.html">
|
||||
<!ENTITY YOCTO_ADTPATH_DIR "/opt/poky/&DISTRO;">
|
||||
<!ENTITY YOCTO_POKY_TARBALL "&YOCTO_POKY;.tar.bz2">
|
||||
<!ENTITY OE_INIT_PATH "&YOCTO_POKY;/oe-init-build-env">
|
||||
@@ -654,7 +654,7 @@ hr {
|
||||
|
||||
|
||||
.tip, .warning, .caution, .note {
|
||||
border-color: #aaa;
|
||||
border-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
@@ -662,24 +662,24 @@ hr {
|
||||
.warning table th,
|
||||
.caution table th,
|
||||
.note table th {
|
||||
border-bottom-color: #aaa;
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
.warning {
|
||||
background-color: #fea;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.caution {
|
||||
background-color: #fea;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.tip {
|
||||
background-color: #eff;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.note {
|
||||
background-color: #dfc;
|
||||
background-color: #f0f0f2;
|
||||
}
|
||||
|
||||
.glossary dl dt,
|
||||
@@ -946,8 +946,8 @@ table {
|
||||
|
||||
.tip,
|
||||
.note {
|
||||
background: #666666;
|
||||
color: #fff;
|
||||
background: #f0f0f2;
|
||||
color: #333;
|
||||
padding: 20px;
|
||||
margin: 20px;
|
||||
}
|
||||
@@ -958,11 +958,26 @@ table {
|
||||
margin: 0em;
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.tip a,
|
||||
.note a {
|
||||
color: #fff;
|
||||
color: #333;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.footnote {
|
||||
font-size: small;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
/* Changes the announcement text */
|
||||
.tip h3,
|
||||
.warning h3,
|
||||
.caution h3,
|
||||
.note h3 {
|
||||
font-size:large;
|
||||
color: #00557D;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<article id='intro'>
|
||||
<imagedata fileref="figures/yocto-project-transp.png" width="6in" depth="1in" align="right" scale="25" />
|
||||
|
||||
<section id='fake-title'>
|
||||
<title>Yocto Project Quick Start</title>
|
||||
<para>Copyright © 2010-2011 Linux Foundation</para>
|
||||
<title>The Yocto Project Quick Start</title>
|
||||
<para>Copyright © ©RIGHT_YEAR; Linux Foundation</para>
|
||||
</section>
|
||||
|
||||
<section id='welcome'>
|
||||
@@ -18,6 +19,7 @@
|
||||
Amongst other things, the Yocto Project uses the Poky build system to
|
||||
construct complete Linux images.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This short document will give you some basic information about the environment as well
|
||||
as let you experience it in its simplest form.
|
||||
@@ -26,26 +28,28 @@
|
||||
This document steps you through a simple example showing you how to build a small image
|
||||
and run it using the QEMU emulator.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For complete information on the Yocto Project, you should check out the
|
||||
<ulink url='http://www.yoctoproject.org'>Yocto Project Website</ulink>.
|
||||
Through the website, you can find the latest builds, breaking news, full development
|
||||
documentation, and a
|
||||
rich Yocto Project Development Community into which you can tap.
|
||||
</para>
|
||||
<para>
|
||||
Finally, you might find the Frequently Asked Questions (FAQ) for the Yocto Project
|
||||
at <ulink url='https://wiki.yoctoproject.org/wiki/FAQ'>Yocto Project FAQ</ulink> and
|
||||
the FAQ appendix located in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html'>
|
||||
The Yocto Project Reference Manual</ulink> helpful.
|
||||
For more detailed information on the Yocto Project, you should check out these resources:
|
||||
<itemizedlist>
|
||||
<listitem><para><emphasis>Website:</emphasis> The <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
|
||||
provides the latest builds, breaking news, full development documentation, and a rich Yocto
|
||||
Project Development Community into which you can tap.
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis>FAQs:</emphasis> Lists commonly asked Yocto Project questions and answers.
|
||||
You can find two FAQs: <ulink url='&YOCTO_WIKI_URL;/wiki/FAQ'>Yocto Project FAQ</ulink> on
|
||||
a wiki, and the
|
||||
<ulink url='&YOCTO_DOCS_REF_URL;#faq'>FAQ</ulink> appendix in the
|
||||
The Yocto Project Reference Manual.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<note>
|
||||
Due to production processes, there could be differences between the Yocto Project
|
||||
documentation bundled in the release tarball and the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-project-qs.html'>
|
||||
<ulink url='&YOCTO_DOCS_QS_URL;'>
|
||||
Yocto Project Quick Start</ulink> on
|
||||
the <ulink url='http://www.yoctoproject.org'>Yocto Project</ulink> website.
|
||||
the <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink> website.
|
||||
For the latest version of this manual, see the manual on the website.
|
||||
</note>
|
||||
</section>
|
||||
@@ -130,7 +134,7 @@
|
||||
<para>A host system running a supported Linux distribution (i.e. recent releases of
|
||||
Fedora, openSUSE, Debian, and Ubuntu).
|
||||
If the host system supports multiple cores and threads, you can configure the
|
||||
Yocto Project build system to increase the time needed to build images
|
||||
Yocto Project build system to decrease the time needed to build images
|
||||
significantly.
|
||||
</para>
|
||||
</listitem>
|
||||
@@ -149,18 +153,18 @@
|
||||
The Yocto Project team is continually verifying more and more Linux
|
||||
distributions with each release.
|
||||
In general, if you have the current release minus one of the following
|
||||
distributions you should no problems.
|
||||
distributions you should have no problems.
|
||||
<itemizedlist>
|
||||
<listitem><para>Ubuntu</para></listitem>
|
||||
<listitem><para>Fedora</para></listitem>
|
||||
<listitem><para>openSUSE</para></listitem>
|
||||
</itemizedlist>
|
||||
For a list of the distributions under validation and their status, see the
|
||||
<ulink url='https://wiki.yoctoproject.org/wiki/Distribution_Support'>Distribution
|
||||
<ulink url='&YOCTO_WIKI_URL;/wiki/Distribution_Support'>Distribution
|
||||
Support</ulink> wiki page.
|
||||
<note>
|
||||
For notes about using the Yocto Project on a RHEL 4-based host, see the
|
||||
<ulink url='https://wiki.yoctoproject.org/wiki/BuildingOnRHEL4'>BuildingOnRHEL4</ulink>
|
||||
<ulink url='&YOCTO_WIKI_URL;/wiki/BuildingOnRHEL4'>BuildingOnRHEL4</ulink>
|
||||
wiki page.
|
||||
</note>
|
||||
</para>
|
||||
@@ -174,12 +178,12 @@
|
||||
If you attempt to use a distribution not in the above list, you may or may not have success - you
|
||||
are venturing into untested territory.
|
||||
Refer to
|
||||
<ulink url='http://openembedded.net/index.php?title=OEandYourDistro&action=historysubmit&diff=4309&okdid=4225'>OE and Your Distro</ulink> and
|
||||
<ulink url='http://openembedded.net/index.php?title=Required_software&action=historysubmit&diff=4311&oldid=4251'>Required Software</ulink>
|
||||
<ulink url='&OE_HOME_URL;/index.php?title=OEandYourDistro&action=historysubmit&diff=4309&okdid=4225'>OE and Your Distro</ulink> and
|
||||
<ulink url='&OE_HOME_URL;/index.php?title=Required_software&action=historysubmit&diff=4311&oldid=4251'>Required Software</ulink>
|
||||
for information for other distributions used with the OpenEmbedded project, which might be
|
||||
a starting point for exploration.
|
||||
If you go down this path, you should expect problems.
|
||||
When you do, please go to <ulink url='http://bugzilla.yoctoproject.org'>Yocto Project Bugzilla</ulink>
|
||||
When you do, please go to <ulink url='&YOCTO_BUGZILLA_URL;'>Yocto Project Bugzilla</ulink>
|
||||
and submit a bug.
|
||||
We are interested in hearing about your experience.
|
||||
</para></note>
|
||||
@@ -191,50 +195,78 @@
|
||||
<para>
|
||||
Packages and package installation vary depending on your development system.
|
||||
In general, you need to have root access and then install the required packages.
|
||||
The next few sections show you how to get set up with the right packages for
|
||||
Ubuntu, Fedora, and openSUSE.
|
||||
</para>
|
||||
|
||||
<section id='ubuntu'>
|
||||
<title>Ubuntu</title>
|
||||
|
||||
<note><para>
|
||||
If you are using a Fedora version prior to version 15, you will need to take some
|
||||
extra steps to enable <filename>sudo</filename>.
|
||||
See the <ulink url='https://fedoraproject.org/wiki/Configuring_Sudo'>Configuring Sudo</ulink>
|
||||
wiki page for details.
|
||||
</para></note>
|
||||
<para>
|
||||
If your distribution is Ubuntu, you need to be running the bash shell.
|
||||
You can be sure you are running this shell by entering the following command and
|
||||
selecting "No" at the prompt:
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo dpkg-reconfigure dash
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The packages you need for a Debian-based host are shown in the following command:
|
||||
</para>
|
||||
<para>
|
||||
The packages you need for a supported Ubuntu distribution are shown in the following command:
|
||||
</para>
|
||||
|
||||
<literallayout class='monospaced'>
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo apt-get install sed wget cvs subversion git-core coreutils \
|
||||
unzip texi2html texinfo libsdl1.2-dev docbook-utils gawk \
|
||||
python-pysqlite2 diffstat help2man make gcc build-essential \
|
||||
unzip texi2html texinfo libsdl1.2-dev docbook-utils gawk fop \
|
||||
python-pysqlite2 diffstat help2man make gcc build-essential xsltproc \
|
||||
g++ desktop-file-utils chrpath libgl1-mesa-dev libglu1-mesa-dev \
|
||||
mercurial autoconf automake groff libtool xterm
|
||||
</literallayout>
|
||||
</literallayout>
|
||||
</section>
|
||||
|
||||
<para>
|
||||
The packages you need for an RPM-based host like Fedora and openSUSE,
|
||||
respectively, are as follows:
|
||||
</para>
|
||||
<section id='fedora'>
|
||||
<title>Fedora</title>
|
||||
|
||||
<literallayout class='monospaced'>
|
||||
<para>
|
||||
The packages you need for a supported Fedora distribution are shown in the following
|
||||
commands:
|
||||
</para>
|
||||
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo yum groupinstall "development tools"
|
||||
$ sudo yum install python m4 make wget curl ftp hg tar bzip2 gzip \
|
||||
unzip python-psyco perl texinfo texi2html diffstat openjade \
|
||||
docbook-style-dsssl sed docbook-style-xsl docbook-dtds \
|
||||
docbook-style-dsssl sed docbook-style-xsl docbook-dtds fop xsltproc \
|
||||
docbook-utils sed bc eglibc-devel ccache pcre pcre-devel quilt \
|
||||
groff linuxdoc-tools patch linuxdoc-tools cmake help2man \
|
||||
perl-ExtUtils-MakeMaker tcl-devel gettext chrpath ncurses apr \
|
||||
SDL-devel mesa-libGL-devel mesa-libGLU-devel gnome-doc-utils \
|
||||
autoconf automake libtool xterm
|
||||
</literallayout>
|
||||
</literallayout>
|
||||
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo zypper install python gcc gcc-c++ libtool \
|
||||
subversion git chrpath automake \
|
||||
help2man diffstat texinfo mercurial wget
|
||||
</literallayout>
|
||||
|
||||
<note><para>
|
||||
If you are using a Fedora version prior to version 15, you will need to take some
|
||||
extra steps to enable <filename>sudo</filename>, or you will need to run
|
||||
the commands as root user.
|
||||
See the <ulink url='https://fedoraproject.org/wiki/Configuring_Sudo'>Configuring Sudo</ulink>
|
||||
wiki page for details.
|
||||
</para></note>
|
||||
</section>
|
||||
|
||||
<section id='opensuse'>
|
||||
<title>openSUSE</title>
|
||||
|
||||
<para>
|
||||
The packages you need for a supported openSUSE distribution are shown in the following
|
||||
command:
|
||||
</para>
|
||||
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo zypper install python gcc gcc-c++ libtool fop \
|
||||
subversion git chrpath automake make wget help2man xsltproc \
|
||||
diffstat texinfo mercurial freeglut-devel libSDL-devel
|
||||
</literallayout>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id='releases'>
|
||||
@@ -242,13 +274,13 @@
|
||||
|
||||
<para>
|
||||
You can download the latest Yocto Project release by going to the
|
||||
<ulink url="http://yoctoproject.org/download">Yocto Project Download page</ulink>.
|
||||
<ulink url="&YOCTO_HOME_URL;/download">Yocto Project Download page</ulink>.
|
||||
Just go to the page and click the "Yocto Downloads" link found in the "Download"
|
||||
navigation pane to the right to view all available Yocto Project releases.
|
||||
Then, click the "Yocto Release" link for the release you want from the list to
|
||||
begin the download.
|
||||
Nightly and developmental builds are also maintained at
|
||||
<ulink url="http://autobuilder.yoctoproject.org/nightly/"></ulink>.
|
||||
<ulink url="&YOCTO_AB_NIGHTLY_URL;"></ulink>.
|
||||
However, for this document a released version of Yocto Project is used.
|
||||
</para>
|
||||
|
||||
@@ -257,10 +289,8 @@
|
||||
development system.
|
||||
Doing so allows you to contribute back to the project.
|
||||
For information on how to get set up using this method, see the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html#local-yp-release'>Yocto
|
||||
Project Release</ulink>" item in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html'>The Yocto Project
|
||||
Development Manual</ulink>.
|
||||
"<ulink url='&YOCTO_DOCS_DEV_URL;#local-yp-release'>Yocto
|
||||
Project Release</ulink>" item in The Yocto Project Development Manual.
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
@@ -269,7 +299,7 @@
|
||||
<title>A Quick Test Run</title>
|
||||
|
||||
<para>
|
||||
Now that you have your system requirements in order, you can give Yocto Project a try.
|
||||
Now that you have your system requirements in order, you can give the Yocto Project a try.
|
||||
This section presents some steps that let you do the following:
|
||||
</para>
|
||||
|
||||
@@ -278,7 +308,7 @@
|
||||
<para>Build an image and run it in the QEMU emulator</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Or, use a pre-built image and run it in the QEMU emulator</para>
|
||||
<para>Use a pre-built image and run it in the QEMU emulator</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
@@ -315,48 +345,46 @@
|
||||
By default, the Yocto Project searches for source code using a pre-determined order
|
||||
through a set of locations.
|
||||
If you encounter problems with the Yocto Project finding and downloading source code, see
|
||||
the FAQ entry "How does Poky obtain source code and will it work behind my
|
||||
the FAQ entry "How does the Yocto Project build system obtain source code and will it work behind my
|
||||
firewall or proxy server?" in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html'>
|
||||
<ulink url='&YOCTO_DOCS_REF_URL;#faq'>
|
||||
The Yocto Project Reference Manual</ulink>.
|
||||
</para></note>
|
||||
|
||||
<para>
|
||||
<literallayout class='monospaced'>
|
||||
$ wget http://www.yoctoproject.org/downloads/poky/poky-edison-6.0.tar.bz2
|
||||
$ tar xjf poky-edison-6.0.tar.bz2
|
||||
$ source poky-edison-6.0/oe-init-build-env edison-6.0-build
|
||||
$ wget &YOCTO_POKY_DL_URL;
|
||||
$ tar xjf &YOCTO_POKY;.tar.bz2
|
||||
$ source &OE_INIT_PATH; &YOCTO_POKY;-build
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<tip><para>
|
||||
To help conserve disk space during builds, you can add the following statement
|
||||
to your <filename>local.conf</filename> file in the Yocto Project build
|
||||
directory, which for this example
|
||||
is <filename>edison-6.0-build</filename>.
|
||||
to your project's configuration file, which for this example
|
||||
is <filename>&YOCTO_POKY;-build/conf/local.conf</filename>.
|
||||
Adding this statement deletes the work directory used for building a package
|
||||
once the package is built.
|
||||
<literallayout class='monospaced'>
|
||||
INHERIT += rm_work
|
||||
INHERIT += "rm_work"
|
||||
</literallayout>
|
||||
</para></tip>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem><para>The first command retrieves the Yocto Project release tarball from the
|
||||
source repositories.
|
||||
Notice, the example uses the <filename>wget</filename> shell command.
|
||||
<listitem><para>In the previous example, the first command retrieves the Yocto Project
|
||||
release tarball from the source repositories using the
|
||||
<filename>wget</filename> command.
|
||||
Alternatively, you can go to the
|
||||
<ulink url='http://www.yoctoproject.org'>Yocto Project website</ulink> downloads
|
||||
area to retrieve the tarball.</para></listitem>
|
||||
<ulink url='&YOCTO_HOME_URL;/download'>Yocto Project website's Downloads page</ulink>
|
||||
to retrieve the tarball.</para></listitem>
|
||||
<listitem><para>The second command extracts the files from the tarball and places
|
||||
them into a directory named <filename>poky-edison-6.0</filename> in the current
|
||||
directory.
|
||||
</para></listitem>
|
||||
them into a directory named <filename>&YOCTO_POKY;</filename> in the current
|
||||
directory.</para></listitem>
|
||||
<listitem><para>The third command runs the Yocto Project environment setup script.
|
||||
Running this script defines Yocto Project build environment settings needed to
|
||||
complete the build.
|
||||
The script also creates the Yocto Project
|
||||
build directory, which is <filename>edison-6.0-build</filename> in this case.
|
||||
build directory, which is <filename>&YOCTO_POKY;-build</filename> in this case.
|
||||
After the script runs, your current working directory is set
|
||||
to the build directory.
|
||||
Later, when the build completes, the build directory contains all the files
|
||||
@@ -364,32 +392,28 @@
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
<para>
|
||||
Take some time to examine your <filename>conf/local.conf</filename> file found in the
|
||||
Yocto Project build directory.
|
||||
The defaults in the <filename>local.conf</filename> should work fine.
|
||||
Take some time to examine your <filename>local.conf</filename> file
|
||||
in your project's configuration directory.
|
||||
The defaults in that file should work fine.
|
||||
However, there are some variables of interest at which you might look.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
By default, the target architecture for the build is <filename>qemux86</filename>,
|
||||
which is an image that can be used in the QEMU emulator and is targeted for an
|
||||
which produces an image that can be used in the QEMU emulator and is targeted at an
|
||||
<trademark class='registered'>Intel</trademark> 32-bit based architecture.
|
||||
To change this default, edit the value of the <filename>MACHINE</filename> variable in the
|
||||
<filename>conf/local.conf</filename> file in the build directory before
|
||||
launching the build.
|
||||
To change this default, edit the value of the <filename>MACHINE</filename> variable
|
||||
in the configuration file before launching the build.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Another couple of variables of interest are the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html#var-BB_NUMBER_THREADS'><filename>BB_NUMBER_THREADS</filename></ulink> and the
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html#var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></ulink> variables.
|
||||
<ulink url='&YOCTO_DOCS_REF_URL;#var-BB_NUMBER_THREADS'><filename>BB_NUMBER_THREADS</filename></ulink> and the
|
||||
<ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></ulink> variables.
|
||||
By default, these variables are commented out.
|
||||
However, if you have a multi-core CPU you might want to remove the comment
|
||||
and set the variable
|
||||
<filename>BB_NUMBER_THREADS</filename> equal to twice the number of your
|
||||
However, if you have a multi-core CPU you might want to uncomment
|
||||
the lines and set both variables equal to twice the number of your
|
||||
host's processor cores.
|
||||
Also, you could set the variable <filename>PARALLEL_MAKE</filename> equal to the number
|
||||
of processor cores.
|
||||
Setting these variables can significantly shorten your build time.
|
||||
</para>
|
||||
|
||||
@@ -398,11 +422,10 @@
|
||||
the image.
|
||||
By default, the Yocto Project build system uses the RPM package manager.
|
||||
You can control this configuration by using the
|
||||
<filename><ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink></filename> variable.
|
||||
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink></filename> variable.
|
||||
For additional package manager selection information, see
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html#ref-classes-package'>Packaging - <filename>package*.bbclass</filename></ulink>" in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html'>
|
||||
The Yocto Project Reference Manual</ulink>.
|
||||
"<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-package'>Packaging - <filename>package*.bbclass</filename></ulink>"
|
||||
in The Yocto Project Reference Manual.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -410,16 +433,16 @@
|
||||
<filename>core-image-sato</filename> in this example.
|
||||
For information on the <filename>-k</filename> option use the
|
||||
<filename>bitbake --help</filename> command or see the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html#usingpoky-components-bitbake'>BitBake</ulink>" section in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html'>The Yocto Project Reference Manual</ulink>.
|
||||
"<ulink url='&YOCTO_DOCS_REF_URL;#usingpoky-components-bitbake'>BitBake</ulink>" section in
|
||||
The Yocto Project Reference Manual.
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake -k core-image-sato
|
||||
</literallayout>
|
||||
<note><para>
|
||||
BitBake requires Python 2.6 or 2.7. For more information on this requirement,
|
||||
see the FAQ appendix in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html'>
|
||||
The Yocto Project Reference Manual</ulink>.
|
||||
see the
|
||||
<ulink url='&YOCTO_DOCS_REF_URL;#faq'>FAQ</ulink> in The Yocto Project Reference
|
||||
Manual.
|
||||
</para></note>
|
||||
The final command runs the image:
|
||||
<literallayout class='monospaced'>
|
||||
@@ -457,7 +480,7 @@
|
||||
</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem><para>Install the stand-alone Yocto toolchain tarball.</para></listitem>
|
||||
<listitem><para>Install the appropriate stand-alone Yocto toolchain tarball.</para></listitem>
|
||||
<listitem><para>Download the pre-built image that will boot with QEMU.
|
||||
You need to be sure to get the QEMU image that matches your target machine’s
|
||||
architecture (e.g. x86, ARM, etc.).</para></listitem>
|
||||
@@ -471,10 +494,10 @@
|
||||
<title>Installing the Toolchain</title>
|
||||
<para>
|
||||
You can download the pre-built toolchain, which includes the <filename>runqemu</filename>
|
||||
script and support files, from
|
||||
<ulink url='http://yoctoproject.org/downloads/yocto-1.1/toolchain/'></ulink>.
|
||||
script and support files, from the appropriate directory under
|
||||
<ulink url='&YOCTO_TOOLCHAIN_DL_URL;'></ulink>.
|
||||
Toolchains are available for 32-bit and 64-bit development systems from the
|
||||
<filename>i686</filename> and <filename>x86_64</filename> folders, respectively.
|
||||
<filename>i686</filename> and <filename>x86-64</filename> directories, respectively.
|
||||
Each type of development system supports five target architectures.
|
||||
The tarball files are named such that a string representing the host system appears
|
||||
first in the filename and then is immediately followed by a string representing
|
||||
@@ -482,7 +505,7 @@
|
||||
</para>
|
||||
|
||||
<literallayout class='monospaced'>
|
||||
yocto-eglibc<<emphasis>host_system</emphasis>>-<<emphasis>arch</emphasis>>-toolchain-gmae-<<emphasis>release</emphasis>>.tar.bz2
|
||||
poky-eglibc-<<emphasis>host_system</emphasis>>-<<emphasis>arch</emphasis>>-toolchain-gmae-<<emphasis>release</emphasis>>.tar.bz2
|
||||
|
||||
Where:
|
||||
<<emphasis>host_system</emphasis>> is a string representing your development system:
|
||||
@@ -500,7 +523,7 @@
|
||||
</para>
|
||||
|
||||
<literallayout class='monospaced'>
|
||||
yocto-eglibc-x86_64-i586-toolchain-gmae-1.1.tar.bz2
|
||||
poky-eglibc-x86_64-i586-toolchain-gmae-&DISTRO;.tar.bz2
|
||||
</literallayout>
|
||||
|
||||
<para>
|
||||
@@ -513,16 +536,15 @@
|
||||
<para>
|
||||
<literallayout class='monospaced'>
|
||||
$ cd /
|
||||
$ sudo tar -xvjf ~/toolchains/yocto-eglibc-x86_64-i586-toolchain-gmae-1.1.tar.bz2
|
||||
$ sudo tar -xvjf ~/toolchains/poky-eglibc-x86_64-i586-toolchain-gmae-&DISTRO;.tar.bz2
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For more information on how to install tarballs, see the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/adt-manual/adt-manual.html#using-an-existing-toolchain-tarball'>Using a Cross-Toolchain Tarball</ulink>" and
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/adt-manual/adt-manual.html#using-the-toolchain-from-within-the-build-tree'>Using BitBake and the Yocto Project Build Tree</ulink>" sections in
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/adt-manual/adt-manual.html'>The Yocto Project
|
||||
Application Development Toolkit (ADT) Development Manual</ulink>.
|
||||
"<ulink url='&YOCTO_DOCS_ADT_URL;#using-an-existing-toolchain-tarball'>Using a Cross-Toolchain Tarball</ulink>" and
|
||||
"<ulink url='&YOCTO_DOCS_ADT_URL;#using-the-toolchain-from-within-the-build-tree'>Using BitBake and the Yocto Project Build Tree</ulink>" sections in The Yocto Project Application Development Toolkit (ADT)
|
||||
User's Guide.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -531,35 +553,29 @@
|
||||
|
||||
<para>
|
||||
You can download the pre-built Linux kernel suitable for running in the QEMU emulator from
|
||||
<ulink url='http://yoctoproject.org/downloads/yocto-1.1/machines/qemu'></ulink>.
|
||||
<ulink url='&YOCTO_QEMU_DL_URL;'></ulink>.
|
||||
Be sure to use the kernel that matches the architecture you want to simulate.
|
||||
Download areas exist for the five supported machine architectures:
|
||||
<filename>qemuarm</filename>, <filename>qemumips</filename>, <filename>qemuppc</filename>,
|
||||
<filename>qemux86</filename>, and <filename>qemux86_64</filename>.
|
||||
<filename>qemux86</filename>, and <filename>qemux86-64</filename>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Most kernel files have one of the following forms:
|
||||
<literallayout class='monospaced'>
|
||||
*zImage-<<emphasis>kernel-rev</emphasis>>-qemu<<emphasis>arch</emphasis>>-<<emphasis>release</emphasis>>*.bin
|
||||
vmlinux-<<emphasis>kernel-rev</emphasis>>-qemu<<emphasis>arch</emphasis>>-<<emphasis>release</emphasis>>*.bin
|
||||
*zImage-qemu<<emphasis>arch</emphasis>>.bin
|
||||
vmlinux-qemu<<emphasis>arch</emphasis>>.bin
|
||||
|
||||
Where:
|
||||
<<emphasis>kernel-rev</emphasis>> is the base Linux kernel revision
|
||||
(e.g. 2.6.37).
|
||||
|
||||
<<emphasis>arch</emphasis>> is a string representing the target architecture:
|
||||
x86, x86-64, ppc, mips, or arm.
|
||||
|
||||
<<emphasis>release</emphasis>> is the version of Yocto Project.
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
You can learn more about downloading a Yocto Project kernel in the
|
||||
"<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html#local-kernel-files'>Linux Yocto Kernel</ulink>" section of
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/dev-manual/dev-manual.html'>The
|
||||
Yocto Project Development Manual</ulink>.
|
||||
"<ulink url='&YOCTO_DOCS_DEV_URL;#local-kernel-files'>Linux Yocto Kernel</ulink>" section of
|
||||
The Yocto Project Development Manual.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -568,7 +584,7 @@
|
||||
|
||||
<para>
|
||||
You can also download the filesystem image suitable for your target architecture from
|
||||
<ulink url='http://yoctoproject.org/downloads/yocto-1.1/machines/qemu'></ulink>.
|
||||
<ulink url='&YOCTO_QEMU_DL_URL;'></ulink>.
|
||||
Again, be sure to use the filesystem that matches the architecture you want
|
||||
to simulate.
|
||||
</para>
|
||||
@@ -579,21 +595,19 @@
|
||||
You must use the <filename>ext3</filename> form when booting an image using the
|
||||
QEMU emulator.
|
||||
The <filename>tar</filename> form can be flattened out in your host development system
|
||||
and used for Yocto Project build purposes.
|
||||
and used for build purposes with the Yocto Project.
|
||||
<literallayout class='monospaced'>
|
||||
yocto-image-<<emphasis>profile</emphasis>>-qemu<<emphasis>arch</emphasis>>-<<emphasis>release</emphasis>>.rootfs.ext3.bz2
|
||||
yocto-image-<<emphasis>profile</emphasis>>-qemu<<emphasis>arch</emphasis>>-<<emphasis>release</emphasis>>.rootfs.tar.bz2
|
||||
core-image-<<emphasis>profile</emphasis>>-qemu<<emphasis>arch</emphasis>>.ext3
|
||||
core-image-<<emphasis>profile</emphasis>>-qemu<<emphasis>arch</emphasis>>.tar.bz2
|
||||
|
||||
Where:
|
||||
<<emphasis>profile</emphasis>> is the filesystem image's profile:
|
||||
lsb, lsb-dev, lsb-sdk, minimal, minimal-dev, sato, sato-dev, or sato-sdk.
|
||||
lsb, lsb-dev, lsb-sdk, lsb-qt3, minimal, minimal-dev, sato, sato-dev, or sato-sdk.
|
||||
For information on these types of image profiles, see
|
||||
<ulink url='http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html#ref-images'>Reference: Images</ulink> in the Yocto Project Reference Manual.
|
||||
<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Reference: Images</ulink> in the Yocto Project Reference Manual.
|
||||
|
||||
<<emphasis>arch</emphasis>> is a string representing the target architecture:
|
||||
x86, x86-64, ppc, mips, or arm.
|
||||
|
||||
<<emphasis>release</emphasis>> is the version of Yocto Project.
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
@@ -605,7 +619,7 @@
|
||||
Before you start the QEMU emulator, you need to set up the emulation environment.
|
||||
The following command form sets up the emulation environment.
|
||||
<literallayout class='monospaced'>
|
||||
$ source /opt/poky/1.1/environment-setup-<<emphasis>arch</emphasis>>-poky-linux-<<emphasis>if</emphasis>>
|
||||
$ source &YOCTO_ADTPATH_DIR;/environment-setup-<<emphasis>arch</emphasis>>-poky-linux-<<emphasis>if</emphasis>>
|
||||
|
||||
Where:
|
||||
<<emphasis>arch</emphasis>> is a string representing the target architecture:
|
||||
@@ -635,12 +649,14 @@
|
||||
<para>
|
||||
Continuing with the example, the following two commands setup the emulation
|
||||
environment and launch QEMU.
|
||||
This example assumes the root filesystem tarball has been downloaded and expanded, and
|
||||
that the kernel and filesystem are for a 32-bit target architecture.
|
||||
This example assumes the root filesystem (<filename>.ext3</filename> file) and
|
||||
the pre-built kernel image file both reside in your home directory.
|
||||
The kernel and filesystem are for a 32-bit target architecture.
|
||||
<literallayout class='monospaced'>
|
||||
$ source /opt/poky/1.1/environment-setup-i686-poky-linux
|
||||
$ runqemu qemux86 bzImage-3.0-qemux86-1.1.bin \
|
||||
yocto-image-sato-qemux86-1.1.rootfs.ext3
|
||||
$ cd $HOME
|
||||
$ source &YOCTO_ADTPATH_DIR;/environment-setup-i586-poky-linux
|
||||
$ runqemu qemux86 bzImage-qemux86.bin \
|
||||
core-image-sato-qemux86.ext3
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
|
||||
@@ -17,13 +17,12 @@ PACKAGES =+ "${PN}-user3"
|
||||
|
||||
inherit useradd
|
||||
|
||||
# Specify which package(s) should include the user/group code.
|
||||
# Make sure that any packages which install files owned by custom
|
||||
# users/groups are included here. The code which adds users and
|
||||
# groups is idempotent.
|
||||
# You must set USERADD_PACKAGES when you inherit useradd. This
|
||||
# lists which output packages will include the user/group
|
||||
# creation code.
|
||||
USERADD_PACKAGES = "${PN} ${PN}-user3"
|
||||
|
||||
# You *must* set USERADD_PARAM and/or GROUPADD_PARAM when
|
||||
# You must also set USERADD_PARAM and/or GROUPADD_PARAM when
|
||||
# you inherit useradd.
|
||||
|
||||
# USERADD_PARAM specifies command line options to pass to the
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
DISTRO = "poky"
|
||||
DISTRO_NAME = "Yocto (Built by Poky 6.0)"
|
||||
DISTRO_VERSION = "1.1"
|
||||
DISTRO_NAME = "Yocto (Built by Poky 6.0.2)"
|
||||
DISTRO_VERSION = "1.1.2"
|
||||
SDK_VENDOR = "-pokysdk"
|
||||
SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
|
||||
SDK_VERSION := "${DISTRO_VERSION}"
|
||||
|
||||
MAINTAINER = "Poky <poky@yoctoproject.org>"
|
||||
|
||||
@@ -18,6 +18,11 @@ PREFERRED_VERSION_linux-yocto_qemux86-64 ?= "3.0%"
|
||||
PREFERRED_VERSION_linux-yocto_qemuarm ?= "3.0%"
|
||||
PREFERRED_VERSION_linux-yocto_qemumips ?= "3.0%"
|
||||
PREFERRED_VERSION_linux-yocto_qemuppc ?= "3.0%"
|
||||
PREFERRED_VERSION_linux-yocto-rt_qemux86 ?= "3.0%"
|
||||
PREFERRED_VERSION_linux-yocto-rt_qemux86-64 ?= "3.0%"
|
||||
PREFERRED_VERSION_linux-yocto-rt_qemuarm ?= "3.0%"
|
||||
PREFERRED_VERSION_linux-yocto-rt_qemumips ?= "3.0%"
|
||||
PREFERRED_VERSION_linux-yocto-rt_qemuppc ?= "3.0%"
|
||||
|
||||
SDK_NAME = "${DISTRO}-${TCLIBC}-${SDK_ARCH}-${TARGET_ARCH}"
|
||||
SDKPATH = "/opt/${DISTRO}/${SDK_VERSION}"
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
|
||||
#DISTRO_FEATURES = "alsa bluetooth ext2 irda pcmcia usbgadget usbhost wifi nfs zeroconf pci ${DISTRO_FEATURES_LIBC}"
|
||||
|
||||
# If you want to get an image based on gtk+directfb without x11, Please copy this variable to build/conf/local.conf
|
||||
#DISTRO_FEATURES = "alsa argp bluetooth ext2 irda largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g directfb ${DISTRO_FEATURES_LIBC}"
|
||||
|
||||
# ENABLE_BINARY_LOCALE_GENERATION controls the generation of binary locale
|
||||
# packages at build time using qemu-native. Disabling it (by setting it to 0)
|
||||
# will save some build time at the expense of breaking i18n on devices with
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
include conf/machine/include/tune-atom.inc
|
||||
|
||||
MACHINE_FEATURES = "kernel26 screen keyboard pci usbhost ext2 ext3 x86 wifi \
|
||||
acpi"
|
||||
acpi alsa"
|
||||
|
||||
KERNEL_IMAGETYPE = "bzImage"
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@ export CONFIG_SITE = "${@siteinfo_get_files(d)}"
|
||||
acpaths = "default"
|
||||
EXTRA_AUTORECONF = "--exclude=autopoint"
|
||||
|
||||
export lt_cv_sys_lib_dlsearch_path_spec = "${libdir} ${base_libdir}"
|
||||
|
||||
def autotools_set_crosscompiling(d):
|
||||
if not bb.data.inherits_class('native', d):
|
||||
return " cross_compiling=yes"
|
||||
@@ -66,10 +68,8 @@ CONFIGUREOPTS = " --build=${BUILD_SYS} \
|
||||
|
||||
oe_runconf () {
|
||||
if [ -x ${S}/configure ] ; then
|
||||
cfgcmd="${S}/configure \
|
||||
${CONFIGUREOPTS} ${EXTRA_OECONF} $@"
|
||||
bbnote "Running $cfgcmd..."
|
||||
$cfgcmd || bbfatal "oe_runconf failed"
|
||||
bbnote "Running ${S}/configure ${CONFIGUREOPTS} ${EXTRA_OECONF} $@"
|
||||
${S}/configure ${CONFIGUREOPTS} ${EXTRA_OECONF} "$@" || bbfatal "oe_runconf failed"
|
||||
else
|
||||
bbfatal "no configure script found"
|
||||
fi
|
||||
|
||||
@@ -283,7 +283,7 @@ python base_eventhandler() {
|
||||
logfile.close()
|
||||
}
|
||||
|
||||
addtask configure after do_unpack do_patch
|
||||
addtask configure after do_patch
|
||||
do_configure[dirs] = "${CCACHE_DIR} ${S} ${B}"
|
||||
do_configure[deptask] = "do_populate_sysroot"
|
||||
base_do_configure() {
|
||||
@@ -327,7 +327,7 @@ python () {
|
||||
|
||||
# If PRINC is set, try and increase the PR value by the amount specified
|
||||
princ = bb.data.getVar('PRINC', d, True)
|
||||
if princ:
|
||||
if princ and princ != "0":
|
||||
pr = bb.data.getVar('PR', d, True)
|
||||
pr_prefix = re.search("\D+",pr)
|
||||
prval = re.search("\d+",pr)
|
||||
|
||||
@@ -62,13 +62,52 @@ build_boot_bin() {
|
||||
|
||||
install -m 444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}/ldlinux.sys
|
||||
|
||||
# Do a little math, bash style
|
||||
#BLOCKS=`du -s ${HDDDIR} | cut -f 1`
|
||||
BLOCKS=`du -bks ${HDDDIR} | cut -f 1`
|
||||
SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}`
|
||||
# Calculate the size required for the final image including the
|
||||
# data and filesystem overhead.
|
||||
# Sectors: 512 bytes
|
||||
# Blocks: 1024 bytes
|
||||
|
||||
mkdosfs -n ${BOOTIMG_VOLUME_ID} -d ${HDDDIR} \
|
||||
-C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE
|
||||
# Determine the sector count just for the data
|
||||
SECTORS=$(expr $(du --apparent-size -ks ${HDDDIR} | cut -f 1) \* 2)
|
||||
|
||||
# Account for the filesystem overhead. This includes directory
|
||||
# entries in the clusters as well as the FAT itself.
|
||||
# Assumptions:
|
||||
# FAT32 (12 or 16 may be selected by mkdosfs, but the extra
|
||||
# padding will be minimal on those smaller images and not
|
||||
# worth the logic here to caclulate the smaller FAT sizes)
|
||||
# < 16 entries per directory
|
||||
# 8.3 filenames only
|
||||
|
||||
# 32 bytes per dir entry
|
||||
DIR_BYTES=$(expr $(find ${HDDDIR} | tail -n +2 | wc -l) \* 32)
|
||||
# 32 bytes for every end-of-directory dir entry
|
||||
DIR_BYTES=$(expr $DIR_BYTES + $(expr $(find ${HDDDIR} -type d | tail -n +2 | wc -l) \* 32))
|
||||
# 4 bytes per FAT entry per sector of data
|
||||
FAT_BYTES=$(expr $SECTORS \* 4)
|
||||
# 4 bytes per FAT entry per end-of-cluster list
|
||||
FAT_BYTES=$(expr $FAT_BYTES + $(expr $(find ${HDDDIR} -type d | tail -n +2 | wc -l) \* 4))
|
||||
|
||||
# Use a ceiling function to determine FS overhead in sectors
|
||||
DIR_SECTORS=$(expr $(expr $DIR_BYTES + 511) / 512)
|
||||
# There are two FATs on the image
|
||||
FAT_SECTORS=$(expr $(expr $(expr $FAT_BYTES + 511) / 512) \* 2)
|
||||
SECTORS=$(expr $SECTORS + $(expr $DIR_SECTORS + $FAT_SECTORS))
|
||||
|
||||
# Determine the final size in blocks accounting for some padding
|
||||
BLOCKS=$(expr $(expr $SECTORS / 2) + ${BOOTIMG_EXTRA_SPACE})
|
||||
|
||||
|
||||
# Ensure total sectors is an integral number of sectors per
|
||||
# track or mcopy will complain. Sectors are 512 bytes, and we
|
||||
# generate images with 32 sectors per track. This calculation is
|
||||
# done in blocks, thus the mod by 16 instead of 32.
|
||||
BLOCKS=$(expr $BLOCKS + $(expr 16 - $(expr $BLOCKS % 16)))
|
||||
|
||||
IMG=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
|
||||
mkdosfs -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${IMG} ${BLOCKS}
|
||||
# Copy HDDDIR recursively into the image file directly
|
||||
mcopy -i ${IMG} -s ${HDDDIR}/* ::/
|
||||
|
||||
syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
|
||||
chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
|
||||
|
||||
@@ -48,14 +48,27 @@ def set_device(e):
|
||||
# something like stick DL_DIR on a different partition and this would
|
||||
# throw stats gathering off. The same goes with SSTATE_DIR. However, let's
|
||||
# get the basics in here and work on the cornercases later.
|
||||
# A note. /proc/diskstats does not contain info on encryptfs, tmpfs, etc.
|
||||
# If we end up hitting one of these fs, we'll just skip diskstats collection.
|
||||
############################################################################
|
||||
device=os.stat(tmpdir)
|
||||
majordev=os.major(device.st_dev)
|
||||
minordev=os.minor(device.st_dev)
|
||||
for line in open("/proc/diskstats", "r"):
|
||||
if majordev == int(line.split()[0]) and minordev == int(line.split()[1]):
|
||||
rdev=line.split()[2]
|
||||
file = open(bb.data.getVar('DEVFILE', e.data, True), "w")
|
||||
############################################################################
|
||||
# Bug 1700:
|
||||
# Because tmpfs/encryptfs/ramfs etc inserts no entry in /proc/diskstats
|
||||
# we set rdev to NoLogicalDevice and search for it later. If we find NLD
|
||||
# we do not collect diskstats as the method to collect meaningful statistics
|
||||
# for these fs types requires a bit more research.
|
||||
############################################################################
|
||||
rdev="NoLogicalDevice"
|
||||
try:
|
||||
for line in open("/proc/diskstats", "r"):
|
||||
if majordev == int(line.split()[0]) and minordev == int(line.split()[1]):
|
||||
rdev=line.split()[2]
|
||||
except:
|
||||
pass
|
||||
file = open(e.data.getVar('DEVFILE', True), "w")
|
||||
file.write(rdev)
|
||||
file.close()
|
||||
|
||||
@@ -71,12 +84,15 @@ def get_diskstats(dev):
|
||||
# For info on what these are, see kernel doc file iostats.txt
|
||||
############################################################################
|
||||
DSTAT_KEYS = ['ReadsComp', 'ReadsMerged', 'SectRead', 'TimeReads', 'WritesComp', 'SectWrite', 'TimeWrite', 'IOinProgress', 'TimeIO', 'WTimeIO']
|
||||
for x in open("/proc/diskstats", "r"):
|
||||
if dev in x:
|
||||
diskstats_val = x.rstrip().split()[4:]
|
||||
diskstats = dict(itertools.izip(DSTAT_KEYS, diskstats_val))
|
||||
try:
|
||||
for x in open("/proc/diskstats", "r"):
|
||||
if dev in x:
|
||||
diskstats_val = x.rstrip().split()[4:]
|
||||
except IOError as e:
|
||||
return
|
||||
diskstats = dict(itertools.izip(DSTAT_KEYS, diskstats_val))
|
||||
return diskstats
|
||||
|
||||
|
||||
def set_diskdata(var, dev, data):
|
||||
data.setVar(var, get_diskstats(dev))
|
||||
|
||||
@@ -133,10 +149,11 @@ def write_task_data(status, logfile, dev, e):
|
||||
# For the best information, running things with BB_TOTAL_THREADS = "1"
|
||||
# would return accurate per task results.
|
||||
############################################################################
|
||||
diskdata = get_diskdata("__diskdata_task", dev, e.data)
|
||||
if diskdata:
|
||||
for key in sorted(diskdata.iterkeys()):
|
||||
file.write(key + ": " + diskdata[key] + "\n")
|
||||
if dev != "NoLogicalDevice":
|
||||
diskdata = get_diskdata("__diskdata_task", dev, e.data)
|
||||
if diskdata:
|
||||
for key in sorted(diskdata.iterkeys()):
|
||||
file.write(key + ": " + diskdata[key] + "\n")
|
||||
if status is "passed":
|
||||
file.write("Status: PASSED \n")
|
||||
else:
|
||||
@@ -169,7 +186,8 @@ python run_buildstats () {
|
||||
bb.mkdirhier(bsdir)
|
||||
except:
|
||||
pass
|
||||
set_diskdata("__diskdata_build", device, e.data)
|
||||
if device != "NoLogicalDevice":
|
||||
set_diskdata("__diskdata_build", device, e.data)
|
||||
set_timedata("__timedata_build", e.data)
|
||||
build_time = os.path.join(bsdir, "build_stats")
|
||||
# write start of build into build_time
|
||||
@@ -185,7 +203,7 @@ python run_buildstats () {
|
||||
|
||||
elif isinstance(e, bb.event.BuildCompleted):
|
||||
bn = get_bn(e)
|
||||
dev = get_device(e)
|
||||
device = get_device(e)
|
||||
bsdir = os.path.join(bb.data.getVar('BUILDSTATS_BASE', e.data, True), bn)
|
||||
taskdir = os.path.join(bsdir, bb.data.expand("${PF}", e.data))
|
||||
build_time = os.path.join(bsdir, "build_stats")
|
||||
@@ -201,10 +219,11 @@ python run_buildstats () {
|
||||
file.write("Elapsed time: %0.2f seconds \n" % (time))
|
||||
if cpu:
|
||||
file.write("CPU usage: %0.1f%% \n" % cpu)
|
||||
diskio = get_diskdata("__diskdata_build", dev, e.data)
|
||||
if diskio:
|
||||
for key in sorted(diskio.iterkeys()):
|
||||
file.write(key + ": " + diskio[key] + "\n")
|
||||
if device != "NoLogicalDevice":
|
||||
diskio = get_diskdata("__diskdata_build", device, e.data)
|
||||
if diskio:
|
||||
for key in sorted(diskio.iterkeys()):
|
||||
file.write(key + ": " + diskio[key] + "\n")
|
||||
file.close()
|
||||
|
||||
if isinstance(e, bb.build.TaskStarted):
|
||||
@@ -212,7 +231,8 @@ python run_buildstats () {
|
||||
device = get_device(e)
|
||||
bsdir = os.path.join(bb.data.getVar('BUILDSTATS_BASE', e.data, True), bn)
|
||||
taskdir = os.path.join(bsdir, bb.data.expand("${PF}", e.data))
|
||||
set_diskdata("__diskdata_task", device, e.data)
|
||||
if device != "NoLogicalDevice":
|
||||
set_diskdata("__diskdata_task", device, e.data)
|
||||
set_timedata("__timedata_task", e.data)
|
||||
try:
|
||||
bb.mkdirhier(taskdir)
|
||||
|
||||
@@ -72,3 +72,5 @@ distutils_do_install() {
|
||||
}
|
||||
|
||||
EXPORT_FUNCTIONS do_compile do_install
|
||||
|
||||
export LDSHARED="${CCLD} -shared"
|
||||
|
||||
@@ -5,8 +5,7 @@ inherit imagetest-${IMAGETEST}
|
||||
|
||||
LICENSE = "MIT"
|
||||
PACKAGES = ""
|
||||
MULTILIB_IMAGE_INSTALL ?= ""
|
||||
RDEPENDS += "${IMAGE_INSTALL} ${LINGUAS_INSTALL} ${MULTILIB_IMAGE_INSTALL} ${NORMAL_FEATURE_INSTALL}"
|
||||
RDEPENDS += "${IMAGE_INSTALL} ${LINGUAS_INSTALL} ${NORMAL_FEATURE_INSTALL}"
|
||||
RRECOMMENDS += "${NORMAL_FEATURE_INSTALL_OPTIONAL}"
|
||||
|
||||
INHIBIT_DEFAULT_DEPS = "1"
|
||||
@@ -54,7 +53,6 @@ IMAGE_INSTALL ?= ""
|
||||
IMAGE_INSTALL[type] = "list"
|
||||
IMAGE_BASENAME[export] = "1"
|
||||
export PACKAGE_INSTALL ?= "${IMAGE_INSTALL} ${FEATURE_INSTALL}"
|
||||
export MULTILIB_PACKAGE_INSTALL ?= "${MULTILIB_IMAGE_INSTALL}"
|
||||
PACKAGE_INSTALL_ATTEMPTONLY ?= "${FEATURE_INSTALL_OPTIONAL}"
|
||||
|
||||
# Images are generally built explicitly, do not need to be part of world.
|
||||
@@ -78,6 +76,8 @@ inherit image-${IMAGE_TYPE}
|
||||
python () {
|
||||
deps = bb.data.getVarFlag('do_rootfs', 'depends', d) or ""
|
||||
for type in (bb.data.getVar('IMAGE_FSTYPES', d, True) or "").split():
|
||||
if type == "live":
|
||||
type = "ext3"
|
||||
for dep in ((bb.data.getVar('IMAGE_DEPENDS_%s' % type, d) or "").split() or []):
|
||||
deps += " %s:do_populate_sysroot" % dep
|
||||
for dep in (bb.data.getVar('EXTRA_IMAGEDEPENDS', d, True) or "").split():
|
||||
|
||||
@@ -38,22 +38,22 @@ IMAGE_CMD_jffs2 = "mkfs.jffs2 --root=${IMAGE_ROOTFS} --faketime --output=${DEPLO
|
||||
|
||||
IMAGE_CMD_cramfs = "mkcramfs ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cramfs ${EXTRA_IMAGECMD}"
|
||||
|
||||
IMAGE_CMD_ext2 = "genext2fs -b $ROOTFS_SIZE -d ${IMAGE_ROOTFS} ${EXTRA_IMAGECMD} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext2"
|
||||
IMAGE_CMD_ext2 = "genext2fs -b $ROOTFS_SIZE -i 4096 -d ${IMAGE_ROOTFS} ${EXTRA_IMAGECMD} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext2"
|
||||
IMAGE_CMD_ext2.gz () {
|
||||
rm -rf ${DEPLOY_DIR_IMAGE}/tmp.gz-${PN} && mkdir ${DEPLOY_DIR_IMAGE}/tmp.gz-${PN}
|
||||
genext2fs -b $ROOTFS_SIZE -d ${IMAGE_ROOTFS} ${EXTRA_IMAGECMD} ${DEPLOY_DIR_IMAGE}/tmp.gz-${PN}/${IMAGE_NAME}.rootfs.ext2
|
||||
genext2fs -b $ROOTFS_SIZE -i 4096 -d ${IMAGE_ROOTFS} ${EXTRA_IMAGECMD} ${DEPLOY_DIR_IMAGE}/tmp.gz-${PN}/${IMAGE_NAME}.rootfs.ext2
|
||||
gzip -f -9 ${DEPLOY_DIR_IMAGE}/tmp.gz-${PN}/${IMAGE_NAME}.rootfs.ext2
|
||||
mv ${DEPLOY_DIR_IMAGE}/tmp.gz-${PN}/${IMAGE_NAME}.rootfs.ext2.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext2.gz
|
||||
rmdir ${DEPLOY_DIR_IMAGE}/tmp.gz-${PN}
|
||||
}
|
||||
|
||||
IMAGE_CMD_ext3 () {
|
||||
genext2fs -b $ROOTFS_SIZE -d ${IMAGE_ROOTFS} ${EXTRA_IMAGECMD} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext3
|
||||
genext2fs -b $ROOTFS_SIZE -i 4096 -d ${IMAGE_ROOTFS} ${EXTRA_IMAGECMD} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext3
|
||||
tune2fs -j ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext3
|
||||
}
|
||||
IMAGE_CMD_ext3.gz () {
|
||||
rm -rf ${DEPLOY_DIR_IMAGE}/tmp.gz-${PN} && mkdir ${DEPLOY_DIR_IMAGE}/tmp.gz-${PN}
|
||||
genext2fs -b $ROOTFS_SIZE -d ${IMAGE_ROOTFS} ${EXTRA_IMAGECMD} ${DEPLOY_DIR_IMAGE}/tmp.gz-${PN}/${IMAGE_NAME}.rootfs.ext3
|
||||
genext2fs -b $ROOTFS_SIZE -i 4096 -d ${IMAGE_ROOTFS} ${EXTRA_IMAGECMD} ${DEPLOY_DIR_IMAGE}/tmp.gz-${PN}/${IMAGE_NAME}.rootfs.ext3
|
||||
tune2fs -j ${DEPLOY_DIR_IMAGE}/tmp.gz-${PN}/${IMAGE_NAME}.rootfs.ext3
|
||||
gzip -f -9 ${DEPLOY_DIR_IMAGE}/tmp.gz-${PN}/${IMAGE_NAME}.rootfs.ext3
|
||||
mv ${DEPLOY_DIR_IMAGE}/tmp.gz-${PN}/${IMAGE_NAME}.rootfs.ext3.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext3.gz
|
||||
@@ -61,7 +61,7 @@ IMAGE_CMD_ext3.gz () {
|
||||
}
|
||||
|
||||
oe_mkext4fs () {
|
||||
genext2fs -b $ROOTFS_SIZE -d ${IMAGE_ROOTFS} ${EXTRA_IMAGECMD} $1
|
||||
genext2fs -b $ROOTFS_SIZE -i 4096 -d ${IMAGE_ROOTFS} ${EXTRA_IMAGECMD} $1
|
||||
tune2fs -O extents,uninit_bg,dir_index,has_journal $1
|
||||
e2fsck -yfDC0 $1 || chk=$?
|
||||
case $chk in
|
||||
@@ -111,7 +111,7 @@ IMAGE_CMD_ubi () {
|
||||
echo vol_flags=autoresize >> ubinize.cfg
|
||||
mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubifs ${MKUBIFS_ARGS} && ubinize -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi ${UBINIZE_ARGS} ubinize.cfg
|
||||
}
|
||||
IMAGE_CMD_ubifs = "mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.ubifs.img ${MKUBIFS_ARGS}"
|
||||
IMAGE_CMD_ubifs = "mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubifs ${MKUBIFS_ARGS}"
|
||||
|
||||
EXTRA_IMAGECMD = ""
|
||||
EXTRA_IMAGECMD_jffs2 ?= "--pad --little-endian --eraseblock=0x40000"
|
||||
|
||||
@@ -70,7 +70,7 @@ def qemuimagetest_main(d):
|
||||
os.environ["DISPLAY"] = bb.data.getVar("DISPLAY", d, True)
|
||||
os.environ["COREBASE"] = bb.data.getVar("COREBASE", d, True)
|
||||
os.environ["TOPDIR"] = bb.data.getVar("TOPDIR", d, True)
|
||||
os.environ["TMPDIR"] = bb.data.getVar("TMPDIR", d, True)
|
||||
os.environ["OE_TMPDIR"] = bb.data.getVar("TMPDIR", d, True)
|
||||
os.environ["TEST_STATUS"] = bb.data.getVar("TEST_STATUS", d, True)
|
||||
os.environ["TARGET_IPSAVE"] = bb.data.getVar("TARGET_IPSAVE", d, True)
|
||||
os.environ["TEST_SERIALIZE"] = bb.data.getVar("TEST_SERIALIZE", d, True)
|
||||
@@ -80,9 +80,31 @@ def qemuimagetest_main(d):
|
||||
bb.note("Run %s test in scenario %s" % (case, scen))
|
||||
os.system("%s" % fulltestpath)
|
||||
|
||||
"""function to check testcase list and remove inappropriate cases"""
|
||||
def check_list(list):
|
||||
final_list = []
|
||||
for test in list:
|
||||
(scen, case, fullpath) = test
|
||||
|
||||
"""Skip rpm/zypper if package_rpm not set for PACKAGE_CLASSES"""
|
||||
if case.find("zypper") != -1 or case.find("rpm") != -1:
|
||||
if d.getVar("PACKAGE_CLASSES", True).find("rpm", 0, 11) == -1:
|
||||
bb.note("skip rpm/zypper cases since package_rpm not set in PACKAGE_CLASSES")
|
||||
continue
|
||||
else:
|
||||
final_list.append((scen, case, fullpath))
|
||||
else:
|
||||
final_list.append((scen, case, fullpath))
|
||||
|
||||
if not final_list:
|
||||
raise bb.build.FuncFailed("There is no suitable testcase for this target")
|
||||
|
||||
return final_list
|
||||
|
||||
"""Generate testcase list in runtime"""
|
||||
def generate_list(testlist):
|
||||
list = []
|
||||
final_list = []
|
||||
if len(testlist) == 0:
|
||||
raise bb.build.FuncFailed("No testcase defined in TEST_SCEN")
|
||||
|
||||
@@ -114,7 +136,8 @@ def qemuimagetest_main(d):
|
||||
if not os.path.isfile(fulltestcase):
|
||||
raise bb.build.FuncFailed("Testcase %s not found" % fulltestcase)
|
||||
list.append((item, casefile, fulltestcase))
|
||||
return list
|
||||
final_list = check_list(list)
|
||||
return final_list
|
||||
|
||||
"""Clean tmp folder for testing"""
|
||||
def clean_tmp():
|
||||
|
||||
@@ -44,7 +44,7 @@ SPDXLICENSEMAP[MPLv1.1] = "MPL-1"
|
||||
SPDXLICENSEMAP[MIT-X] = "MIT"
|
||||
|
||||
#Openssl variations
|
||||
SPDXLICENSEMAP[openssl] = "Openssl"
|
||||
SPDXLICENSEMAP[openssl] = "OpenSSL"
|
||||
|
||||
#Other variations
|
||||
SPDXLICENSEMAP[AFL2.1] = "AFL-2"
|
||||
|
||||
@@ -14,8 +14,11 @@ do_make_scripts() {
|
||||
-C ${STAGING_KERNEL_DIR} scripts
|
||||
}
|
||||
|
||||
addtask make_scripts before do_compile
|
||||
do_make_scripts[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
|
||||
do_make_scripts[deptask] = "do_populate_sysroot"
|
||||
|
||||
module_do_compile() {
|
||||
do_make_scripts
|
||||
unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
|
||||
oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR} \
|
||||
KERNEL_SRC=${STAGING_KERNEL_DIR} \
|
||||
|
||||
@@ -56,9 +56,8 @@ python __anonymous () {
|
||||
map_dependencies("PACKAGE_INSTALL", d)
|
||||
map_dependencies("LINGUAS_INSTALL", d)
|
||||
map_dependencies("RDEPENDS", d)
|
||||
pinstall = d.getVar("LINGUAS_INSTALL", True) + " " + d.getVar("PACKAGE_INSTALL", True) + " " + d.getVar("MULTILIB_PACKAGE_INSTALL", False)
|
||||
d.setVar("MULTILIB_PACKAGE_INSTALL", pinstall)
|
||||
d.setVar("PACKAGE_INSTALL", "")
|
||||
pinstall = d.getVar("LINGUAS_INSTALL", True) + " " + d.getVar("PACKAGE_INSTALL", True)
|
||||
d.setVar("PACKAGE_INSTALL", pinstall)
|
||||
d.setVar("LINGUAS_INSTALL", "")
|
||||
# FIXME, we need to map this to something, not delete it!
|
||||
d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", "")
|
||||
|
||||
@@ -69,6 +69,11 @@ exec_prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
|
||||
|
||||
libdir = "${STAGING_DIR_NATIVE}${libdir_native}"
|
||||
|
||||
baselib = "lib"
|
||||
|
||||
# Libtool's default paths are correct for the native machine
|
||||
lt_cv_sys_lib_dlsearch_path_spec[unexport] = "1"
|
||||
|
||||
NATIVE_PACKAGE_PATH_SUFFIX = ""
|
||||
bindir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
|
||||
libdir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
|
||||
|
||||
@@ -916,16 +916,37 @@ python populate_packages () {
|
||||
if file in seen:
|
||||
continue
|
||||
seen.append(file)
|
||||
|
||||
def mkdir(src, dest, p):
|
||||
src = os.path.join(src, p)
|
||||
dest = os.path.join(dest, p)
|
||||
bb.mkdirhier(dest)
|
||||
fstat = os.stat(src)
|
||||
os.chmod(dest, fstat.st_mode)
|
||||
os.chown(dest, fstat.st_uid, fstat.st_gid)
|
||||
if p not in seen:
|
||||
seen.append(p)
|
||||
|
||||
def mkdir_recurse(src, dest, paths):
|
||||
while paths.startswith("./"):
|
||||
paths = paths[2:]
|
||||
p = "."
|
||||
for c in paths.split("/"):
|
||||
p = os.path.join(p, c)
|
||||
if not os.path.exists(os.path.join(dest, p)):
|
||||
mkdir(src, dest, p)
|
||||
|
||||
if os.path.isdir(file) and not os.path.islink(file):
|
||||
bb.mkdirhier(os.path.join(root,file))
|
||||
os.chmod(os.path.join(root,file), os.stat(file).st_mode)
|
||||
mkdir_recurse(dvar, root, file)
|
||||
continue
|
||||
|
||||
mkdir_recurse(dvar, root, os.path.dirname(file))
|
||||
fpath = os.path.join(root,file)
|
||||
dpath = os.path.dirname(fpath)
|
||||
bb.mkdirhier(dpath)
|
||||
if not os.path.islink(file):
|
||||
os.link(file, fpath)
|
||||
fstat = os.stat(file)
|
||||
os.chmod(fpath, fstat.st_mode)
|
||||
os.chown(fpath, fstat.st_uid, fstat.st_gid)
|
||||
continue
|
||||
ret = bb.copyfile(file, fpath)
|
||||
if ret is False or ret == 0:
|
||||
@@ -939,13 +960,13 @@ python populate_packages () {
|
||||
dir = root[len(dvar):]
|
||||
if not dir:
|
||||
dir = os.sep
|
||||
for f in files:
|
||||
for f in (files + dirs):
|
||||
path = os.path.join(dir, f)
|
||||
if ('.' + path) not in seen:
|
||||
unshipped.append(path)
|
||||
|
||||
if unshipped != []:
|
||||
bb.warn("For recipe %s, the following files were installed but not shipped in any package:" % pn)
|
||||
bb.warn("For recipe %s, the following files/directories were installed but not shipped in any package:" % pn)
|
||||
for f in unshipped:
|
||||
bb.warn(" " + f)
|
||||
|
||||
@@ -1089,7 +1110,7 @@ if [ x"$D" = "x" ]; then
|
||||
fi
|
||||
}
|
||||
|
||||
RPMDEPS = "${STAGING_LIBDIR_NATIVE}/rpm/bin/rpmdeps"
|
||||
RPMDEPS = "${STAGING_LIBDIR_NATIVE}/rpm/bin/rpmdeps --macros ${STAGING_LIBDIR_NATIVE}/rpm/macros --define '_rpmfc_magic_path ${STAGING_DIR_NATIVE}/usr/share/misc/magic.mgc' --rpmpopt ${STAGING_LIBDIR_NATIVE}/rpm/rpmpopt"
|
||||
|
||||
# Collect perfile run-time dependency metadata
|
||||
# Output:
|
||||
|
||||
@@ -83,12 +83,34 @@ package_tryout_install_multilib_ipk() {
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
split_multilib_packages() {
|
||||
INSTALL_PACKAGES_NORMAL_IPK=""
|
||||
INSTALL_PACKAGES_MULTILIB_IPK=""
|
||||
for pkg in ${INSTALL_PACKAGES_IPK}; do
|
||||
is_multilib=0
|
||||
for item in ${MULTILIB_VARIANTS}; do
|
||||
local pkgname_prefix="${item}-"
|
||||
if [ ${pkg:0:${#pkgname_prefix}} == ${pkgname_prefix} ]; then
|
||||
is_multilib=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${is_multilib} = 0 ]; then
|
||||
INSTALL_PACKAGES_NORMAL_IPK="${INSTALL_PACKAGES_NORMAL_IPK} ${pkg}"
|
||||
else
|
||||
INSTALL_PACKAGES_MULTILIB_IPK="${INSTALL_PACKAGES_MULTILIB_IPK} ${pkg}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
#
|
||||
# install a bunch of packages using opkg
|
||||
# the following shell variables needs to be set before calling this func:
|
||||
# INSTALL_ROOTFS_IPK - install root dir
|
||||
# INSTALL_CONF_IPK - configuration file
|
||||
# INSTALL_PACKAGES_NORMAL_IPK - packages to be installed
|
||||
# INSTALL_PACKAGES_IPK - packages to be installed
|
||||
# INSTALL_PACKAGES_ATTEMPTONLY_IPK - packages attemped to be installed only
|
||||
# INSTALL_PACKAGES_LINGUAS_IPK - additional packages for uclibc
|
||||
# INSTALL_TASK_IPK - task name
|
||||
@@ -97,15 +119,18 @@ package_install_internal_ipk() {
|
||||
|
||||
local target_rootfs="${INSTALL_ROOTFS_IPK}"
|
||||
local conffile="${INSTALL_CONF_IPK}"
|
||||
local package_to_install="${INSTALL_PACKAGES_NORMAL_IPK}"
|
||||
local package_attemptonly="${INSTALL_PACKAGES_ATTEMPTONLY_IPK}"
|
||||
local package_linguas="${INSTALL_PACKAGES_LINGUAS_IPK}"
|
||||
local package_multilib="${INSTALL_PACKAGES_MULTILIB_IPK}"
|
||||
local task="${INSTALL_TASK_IPK}"
|
||||
|
||||
split_multilib_packages
|
||||
|
||||
local package_to_install="${INSTALL_PACKAGES_NORMAL_IPK}"
|
||||
local package_multilib="${INSTALL_PACKAGES_MULTILIB_IPK}"
|
||||
|
||||
mkdir -p ${target_rootfs}${localstatedir}/lib/opkg/
|
||||
|
||||
local ipkg_args="-f ${conffile} -o ${target_rootfs} --force-overwrite"
|
||||
local ipkg_args="-f ${conffile} -o ${target_rootfs} --force-overwrite --force_postinstall"
|
||||
|
||||
opkg-cl ${ipkg_args} update
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ resolve_package_rpm () {
|
||||
# INSTALL_PLATFORM_RPM - main platform
|
||||
# INSTALL_PLATFORM_EXTRA_RPM - extra platform
|
||||
# INSTALL_CONFBASE_RPM - configuration file base name
|
||||
# INSTALL_PACKAGES_NORMAL_RPM - packages to be installed
|
||||
# INSTALL_PACKAGES_RPM - packages to be installed
|
||||
# INSTALL_PACKAGES_ATTEMPTONLY_RPM - packages attemped to be installed only
|
||||
# INSTALL_PACKAGES_LINGUAS_RPM - additional packages for uclibc
|
||||
# INSTALL_PROVIDENAME_RPM - content for provide name
|
||||
@@ -166,8 +166,7 @@ package_install_internal_rpm () {
|
||||
local platform="${INSTALL_PLATFORM_RPM}"
|
||||
local platform_extra="${INSTALL_PLATFORM_EXTRA_RPM}"
|
||||
local confbase="${INSTALL_CONFBASE_RPM}"
|
||||
local package_to_install="${INSTALL_PACKAGES_NORMAL_RPM}"
|
||||
local multilib_to_install="${INSTALL_PACKAGES_MULTILIB_RPM}"
|
||||
local package_to_install="${INSTALL_PACKAGES_RPM}"
|
||||
local package_attemptonly="${INSTALL_PACKAGES_ATTEMPTONLY_RPM}"
|
||||
local package_linguas="${INSTALL_PACKAGES_LINGUAS_RPM}"
|
||||
local providename="${INSTALL_PROVIDENAME_RPM}"
|
||||
@@ -211,12 +210,14 @@ package_install_internal_rpm () {
|
||||
echo "Processing $pkg..."
|
||||
|
||||
archvar=base_archs
|
||||
manifest=install.manifest
|
||||
ml_prefix=`echo ${pkg} | cut -d'-' -f1`
|
||||
ml_pkg=$pkg
|
||||
for i in ${MULTILIB_PREFIX_LIST} ; do
|
||||
if [ ${ml_prefix} == ${i} ]; then
|
||||
ml_pkg=$(echo ${pkg} | sed "s,^${ml_prefix}-\(.*\),\1,")
|
||||
archvar=ml_archs
|
||||
manifest=install_multilib.manifest
|
||||
break
|
||||
fi
|
||||
done
|
||||
@@ -226,7 +227,7 @@ package_install_internal_rpm () {
|
||||
echo "Unable to find package $pkg ($ml_pkg)!"
|
||||
exit 1
|
||||
fi
|
||||
echo $pkg_name >> ${target_rootfs}/install/install.manifest
|
||||
echo $pkg_name >> ${target_rootfs}/install/${manifest}
|
||||
done
|
||||
fi
|
||||
fi
|
||||
@@ -235,12 +236,14 @@ package_install_internal_rpm () {
|
||||
echo "Processing $pkg..."
|
||||
|
||||
archvar=base_archs
|
||||
manifest=install.manifest
|
||||
ml_prefix=`echo ${pkg} | cut -d'-' -f1`
|
||||
ml_pkg=$pkg
|
||||
for i in ${MULTILIB_PREFIX_LIST} ; do
|
||||
if [ ${ml_prefix} == ${i} ]; then
|
||||
ml_pkg=$(echo ${pkg} | sed "s,^${ml_prefix}-\(.*\),\1,")
|
||||
archvar=ml_archs
|
||||
manifest=install_multilib.manifest
|
||||
break
|
||||
fi
|
||||
done
|
||||
@@ -250,7 +253,7 @@ package_install_internal_rpm () {
|
||||
echo "Unable to find package $pkg ($ml_pkg)!"
|
||||
exit 1
|
||||
fi
|
||||
echo $pkg_name >> ${target_rootfs}/install/install.manifest
|
||||
echo $pkg_name >> ${target_rootfs}/install/${manifest}
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -356,29 +359,7 @@ package_install_internal_rpm () {
|
||||
|
||||
touch ${target_rootfs}/install/install_multilib_solution.manifest
|
||||
|
||||
if [ ! -z "${multilib_to_install}" ]; then
|
||||
for pkg in ${multilib_to_install} ; do
|
||||
echo "Processing $pkg..."
|
||||
|
||||
archvar=base_archs
|
||||
ml_prefix=`echo ${pkg} | cut -d'-' -f1`
|
||||
ml_pkg=$pkg
|
||||
for i in ${MULTILIB_PREFIX_LIST} ; do
|
||||
if [ ${ml_prefix} == ${i} ]; then
|
||||
ml_pkg=$(echo ${pkg} | sed "s,^${ml_prefix}-\(.*\),\1,")
|
||||
archvar=ml_archs
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
pkg_name=$(resolve_package_rpm ${confbase}-${archvar}.conf ${ml_pkg})
|
||||
if [ -z "$pkg_name" ]; then
|
||||
echo "Unable to find package $pkg ($ml_pkg)!"
|
||||
exit 1
|
||||
fi
|
||||
echo $pkg_name >> ${target_rootfs}/install/install_multilib.manifest
|
||||
done
|
||||
|
||||
if [ -e "${target_rootfs}/install/install_multilib.manifest" ]; then
|
||||
# multilib package installation
|
||||
|
||||
# Generate an install solution by doing a --justdb install, then recreate it with
|
||||
@@ -398,16 +379,49 @@ package_install_internal_rpm () {
|
||||
|
||||
fi
|
||||
|
||||
cat ${target_rootfs}/install/install_solution.manifest > ${target_rootfs}/install/total_solution.manifest
|
||||
# If base-passwd or shadow are in the list of packages to install,
|
||||
# ensure they are installed first to support later packages that
|
||||
# may create custom users/groups (fixes Yocto bug #2127)
|
||||
infile=${target_rootfs}/install/install_solution.manifest
|
||||
outfile=${target_rootfs}/install/total_solution.manifest
|
||||
cat $infile | grep /base-passwd-[0-9] > $outfile || true
|
||||
cat $infile | grep /shadow-[0-9] >> $outfile || true
|
||||
cat $infile | grep -v /shadow-[0-9] | grep -v /base-passwd-[0-9] >> $outfile
|
||||
cat ${target_rootfs}/install/install_multilib_solution.manifest >> ${target_rootfs}/install/total_solution.manifest
|
||||
|
||||
# Construct install scriptlet wrapper
|
||||
cat << EOF > ${WORKDIR}/scriptlet_wrapper
|
||||
#!/bin/bash
|
||||
|
||||
export PATH="${PATH}"
|
||||
export D="${target_rootfs}"
|
||||
export OFFLINE_ROOT="\$D"
|
||||
export IPKG_OFFLINE_ROOT="\$D"
|
||||
export OPKG_OFFLINE_ROOT="\$D"
|
||||
|
||||
\$2 \$1/\$3 \$4
|
||||
if [ \$? -ne 0 ]; then
|
||||
mkdir -p \$1/etc/rpm-postinsts
|
||||
num=100
|
||||
while [ -e \$1/etc/rpm-postinsts/\${num} ]; do num=\$((num + 1)); done
|
||||
echo "#!\$2" > \$1/etc/rpm-postinsts/\${num}
|
||||
echo "# Arg: \$4" >> \$1/etc/rpm-postinsts/\${num}
|
||||
cat \$1/\$3 >> \$1/etc/rpm-postinsts/\${num}
|
||||
chmod +x \$1/etc/rpm-postinsts/\${num}
|
||||
fi
|
||||
EOF
|
||||
|
||||
chmod 0755 ${WORKDIR}/scriptlet_wrapper
|
||||
|
||||
# Attempt install
|
||||
${RPM} --root ${target_rootfs} \
|
||||
--predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \
|
||||
--predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \
|
||||
-D "_var ${localstatedir}" \
|
||||
-D "_dbpath ${rpmlibdir}" \
|
||||
--noscripts --notriggers --noparentdirs --nolinktos --replacepkgs \
|
||||
--noparentdirs --nolinktos --replacepkgs \
|
||||
-D "__dbi_txn create nofsync private" \
|
||||
-D "_cross_scriptlet_wrapper ${WORKDIR}/scriptlet_wrapper" \
|
||||
-Uhv ${target_rootfs}/install/total_solution.manifest
|
||||
}
|
||||
|
||||
@@ -490,6 +504,16 @@ python write_specfile () {
|
||||
else:
|
||||
target.append(path + "/" + file)
|
||||
|
||||
# Prevent the prerm/postrm scripts from being run during an upgrade
|
||||
def wrap_uninstall(scriptvar):
|
||||
scr = scriptvar.strip()
|
||||
if scr.startswith("#!"):
|
||||
pos = scr.find("\n") + 1
|
||||
else:
|
||||
pos = 0
|
||||
scr = scr[:pos] + 'if [ "$1" = "0" ] ; then\n' + scr[pos:] + '\nfi'
|
||||
return scr
|
||||
|
||||
packages = bb.data.getVar('PACKAGES', d, True)
|
||||
if not packages or packages == '':
|
||||
bb.debug(1, "No packages; nothing to do")
|
||||
@@ -690,8 +714,11 @@ python write_specfile () {
|
||||
spec_scriptlets_bottom.append('%%post -n %s' % splitname)
|
||||
elif script == 'prerm':
|
||||
spec_scriptlets_bottom.append('%%preun -n %s' % splitname)
|
||||
scriptvar = wrap_uninstall(scriptvar)
|
||||
elif script == 'postrm':
|
||||
spec_scriptlets_bottom.append('%%postun -n %s' % splitname)
|
||||
scriptvar = wrap_uninstall(scriptvar)
|
||||
spec_scriptlets_bottom.append('# %s - %s' % (splitname, script))
|
||||
spec_scriptlets_bottom.append(scriptvar)
|
||||
spec_scriptlets_bottom.append('')
|
||||
|
||||
@@ -769,19 +796,25 @@ python write_specfile () {
|
||||
|
||||
if srcpreinst:
|
||||
spec_scriptlets_top.append('%pre')
|
||||
spec_scriptlets_top.append('# %s - preinst' % srcname)
|
||||
spec_scriptlets_top.append(srcpreinst)
|
||||
spec_scriptlets_top.append('')
|
||||
if srcpostinst:
|
||||
spec_scriptlets_top.append('%post')
|
||||
spec_scriptlets_top.append('# %s - postinst' % srcname)
|
||||
spec_scriptlets_top.append(srcpostinst)
|
||||
spec_scriptlets_top.append('')
|
||||
if srcprerm:
|
||||
spec_scriptlets_top.append('%preun')
|
||||
spec_scriptlets_top.append(srcprerm)
|
||||
spec_scriptlets_top.append('# %s - prerm' % srcname)
|
||||
scriptvar = wrap_uninstall(srcprerm)
|
||||
spec_scriptlets_top.append(scriptvar)
|
||||
spec_scriptlets_top.append('')
|
||||
if srcpostrm:
|
||||
spec_scriptlets_top.append('%postun')
|
||||
spec_scriptlets_top.append(srcpostrm)
|
||||
spec_scriptlets_top.append('# %s - postrm' % srcname)
|
||||
scriptvar = wrap_uninstall(srcpostrm)
|
||||
spec_scriptlets_top.append(scriptvar)
|
||||
spec_scriptlets_top.append('')
|
||||
|
||||
# Write the SPEC file
|
||||
@@ -929,6 +962,7 @@ python do_package_rpm () {
|
||||
cmd = cmd + " --define '_unpackaged_files_terminate_build 0'"
|
||||
cmd = cmd + " --define 'debug_package %{nil}'"
|
||||
cmd = cmd + " --define '_rpmfc_magic_path " + magicfile + "'"
|
||||
cmd = cmd + " --define '_tmppath " + workdir + "'"
|
||||
cmd = cmd + " -bb " + outspecfile
|
||||
|
||||
# Build the rpm package!
|
||||
|
||||
@@ -138,7 +138,7 @@ python patch_do_patch() {
|
||||
raise bb.build.FuncFailed(str(sys.exc_value))
|
||||
resolver.Resolve()
|
||||
}
|
||||
patch_do_patch[vardepsexclude] = "DATE SRCDATE"
|
||||
patch_do_patch[vardepsexclude] = "DATE SRCDATE PATCHRESOLVE"
|
||||
|
||||
addtask patch after do_unpack
|
||||
do_patch[dirs] = "${WORKDIR}"
|
||||
|
||||
@@ -18,6 +18,13 @@ PID = "${@os.getpid()}"
|
||||
|
||||
EXCLUDE_FROM_WORLD = "1"
|
||||
|
||||
python () {
|
||||
# If we don't do this we try and run the mapping hooks while parsing which is slow
|
||||
# bitbake should really provide something to let us know this...
|
||||
if bb.data.getVar('BB_WORKERCONTEXT', d, True) is not None:
|
||||
runtime_mapping_rename("TOOLCHAIN_TARGET_TASK", d)
|
||||
}
|
||||
|
||||
fakeroot do_populate_sdk() {
|
||||
rm -rf ${SDK_OUTPUT}
|
||||
mkdir -p ${SDK_OUTPUT}
|
||||
|
||||
@@ -13,7 +13,7 @@ populate_sdk_post_deb () {
|
||||
tar -cf - -C ${STAGING_ETCDIR_NATIVE} -ps apt | tar -xf - -C ${target_rootfs}/etc
|
||||
}
|
||||
|
||||
fakeroot populate_sdk_deb () {
|
||||
populate_sdk_deb () {
|
||||
|
||||
# update index
|
||||
package_update_index_deb
|
||||
@@ -27,7 +27,7 @@ fakeroot populate_sdk_deb () {
|
||||
export INSTALL_ROOTFS_DEB="${SDK_OUTPUT}/${SDKTARGETSYSROOT}"
|
||||
export INSTALL_BASEARCH_DEB="${DPKG_ARCH}"
|
||||
export INSTALL_ARCHS_DEB="${PACKAGE_ARCHS}"
|
||||
export INSTALL_PACKAGES_NORMAL_DEB="${TOOLCHAIN_TARGET_TASK}"
|
||||
export INSTALL_PACKAGES_DEB="${TOOLCHAIN_TARGET_TASK}"
|
||||
export INSTALL_PACKAGES_ATTEMPTONLY_DEB=""
|
||||
export PACKAGES_LINGUAS_DEB=""
|
||||
export INSTALL_TASK_DEB="populate_sdk-target"
|
||||
@@ -43,7 +43,7 @@ fakeroot populate_sdk_deb () {
|
||||
export INSTALL_ROOTFS_DEB="${SDK_OUTPUT}"
|
||||
export INSTALL_BASEARCH_DEB="${DEB_SDK_ARCH}"
|
||||
export INSTALL_ARCHS_DEB="${SDK_PACKAGE_ARCHS}"
|
||||
export INSTALL_PACKAGES_NORMAL_DEB="${TOOLCHAIN_HOST_TASK}"
|
||||
export INSTALL_PACKAGES_DEB="${TOOLCHAIN_HOST_TASK}"
|
||||
export INSTALL_PACKAGES_ATTEMPTONLY_DEB=""
|
||||
export PACKAGES_LINGUAS_DEB=""
|
||||
export INSTALL_TASK_DEB="populate_sdk-nativesdk"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
do_populate_sdk[depends] += "opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot"
|
||||
do_populate_sdk[recrdeptask] += "do_package_write_ipk"
|
||||
|
||||
fakeroot populate_sdk_ipk() {
|
||||
populate_sdk_ipk() {
|
||||
|
||||
rm -f ${IPKGCONF_TARGET}
|
||||
touch ${IPKGCONF_TARGET}
|
||||
@@ -18,14 +18,19 @@ fakeroot populate_sdk_ipk() {
|
||||
#install target
|
||||
export INSTALL_ROOTFS_IPK="${SDK_OUTPUT}/${SDKTARGETSYSROOT}"
|
||||
export INSTALL_CONF_IPK="${IPKGCONF_TARGET}"
|
||||
export INSTALL_PACKAGES_NORMAL_IPK="${TOOLCHAIN_TARGET_TASK}"
|
||||
export INSTALL_PACKAGES_IPK="${TOOLCHAIN_TARGET_TASK}"
|
||||
|
||||
export D=${INSTALL_ROOTFS_IPK}
|
||||
export OFFLINE_ROOT=${INSTALL_ROOTFS_IPK}
|
||||
export IPKG_OFFLINE_ROOT=${INSTALL_ROOTFS_IPK}
|
||||
export OPKG_OFFLINE_ROOT=${IPKG_OFFLINE_ROOT}
|
||||
|
||||
package_install_internal_ipk
|
||||
|
||||
#install host
|
||||
export INSTALL_ROOTFS_IPK="${SDK_OUTPUT}"
|
||||
export INSTALL_CONF_IPK="${IPKGCONF_SDK}"
|
||||
export INSTALL_PACKAGES_NORMAL_IPK="${TOOLCHAIN_HOST_TASK}"
|
||||
export INSTALL_PACKAGES_IPK="${TOOLCHAIN_HOST_TASK}"
|
||||
|
||||
package_install_internal_ipk
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ populate_sdk_post_rpm () {
|
||||
rm -rf ${target_rootfs}/install
|
||||
}
|
||||
|
||||
fakeroot populate_sdk_rpm () {
|
||||
populate_sdk_rpm () {
|
||||
|
||||
package_update_index_rpm
|
||||
package_generate_rpm_conf
|
||||
@@ -32,7 +32,7 @@ fakeroot populate_sdk_rpm () {
|
||||
export INSTALL_ROOTFS_RPM="${SDK_OUTPUT}/${SDKTARGETSYSROOT}"
|
||||
export INSTALL_PLATFORM_RPM="${TARGET_ARCH}"
|
||||
export INSTALL_CONFBASE_RPM="${RPMCONF_TARGET_BASE}"
|
||||
export INSTALL_PACKAGES_NORMAL_RPM="${TOOLCHAIN_TARGET_TASK}"
|
||||
export INSTALL_PACKAGES_RPM="${TOOLCHAIN_TARGET_TASK}"
|
||||
export INSTALL_PACKAGES_ATTEMPTONLY_RPM=""
|
||||
export INSTALL_PACKAGES_LINGUAS_RPM=""
|
||||
export INSTALL_PROVIDENAME_RPM="/bin/sh /bin/bash /usr/bin/env /usr/bin/perl pkgconfig pkgconfig(pkg-config)"
|
||||
@@ -81,7 +81,7 @@ EOF
|
||||
export INSTALL_ROOTFS_RPM="${SDK_OUTPUT}"
|
||||
export INSTALL_PLATFORM_RPM="${SDK_ARCH}"
|
||||
export INSTALL_CONFBASE_RPM="${RPMCONF_HOST_BASE}"
|
||||
export INSTALL_PACKAGES_NORMAL_RPM="${TOOLCHAIN_HOST_TASK}"
|
||||
export INSTALL_PACKAGES_RPM="${TOOLCHAIN_HOST_TASK}"
|
||||
export INSTALL_PACKAGES_ATTEMPTONLY_RPM=""
|
||||
export INSTALL_PACKAGES_LINGUAS_RPM=""
|
||||
export INSTALL_PROVIDENAME_RPM="/bin/sh /bin/bash /usr/bin/env /usr/bin/perl pkgconfig libGL.so()(64bit) libGL.so"
|
||||
|
||||
@@ -44,7 +44,7 @@ fakeroot rootfs_ipk_do_rootfs () {
|
||||
pkginfo="`opkg-cl ${IPKG_ARGS} info $i`"
|
||||
if [ ! -z "$pkginfo" ]; then
|
||||
echo "$pkginfo" | grep -e '^Package:' -e '^Architecture:' -e '^Version:' >> $STATUS
|
||||
echo "Status: deinstall ok not-installed" >> $STATUS
|
||||
echo "Status: deinstall hold not-installed" >> $STATUS
|
||||
echo >> $STATUS
|
||||
else
|
||||
echo "Requested ignored recommendation $i is not a package"
|
||||
@@ -58,10 +58,7 @@ fakeroot rootfs_ipk_do_rootfs () {
|
||||
|
||||
export INSTALL_ROOTFS_IPK="${IMAGE_ROOTFS}"
|
||||
export INSTALL_CONF_IPK="${IPKGCONF_TARGET}"
|
||||
export INSTALL_PACKAGES_NORMAL_IPK="${PACKAGE_INSTALL}"
|
||||
export INSTALL_PACKAGES_MULTILIB_IPK="${MULTILIB_PACKAGE_INSTALL}"
|
||||
|
||||
package_install_internal_ipk
|
||||
export INSTALL_PACKAGES_IPK="${PACKAGE_INSTALL}"
|
||||
|
||||
#post install
|
||||
export D=${IMAGE_ROOTFS}
|
||||
@@ -69,6 +66,8 @@ fakeroot rootfs_ipk_do_rootfs () {
|
||||
export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
|
||||
export OPKG_OFFLINE_ROOT=${IPKG_OFFLINE_ROOT}
|
||||
|
||||
package_install_internal_ipk
|
||||
|
||||
# Distro specific packages should create this
|
||||
#mkdir -p ${IMAGE_ROOTFS}/etc/opkg/
|
||||
#grep "^arch" ${IPKGCONF_TARGET} >${IMAGE_ROOTFS}/etc/opkg/arch.conf
|
||||
@@ -76,22 +75,8 @@ fakeroot rootfs_ipk_do_rootfs () {
|
||||
${OPKG_POSTPROCESS_COMMANDS}
|
||||
${ROOTFS_POSTINSTALL_COMMAND}
|
||||
|
||||
runtime_script_required=0
|
||||
for i in ${IMAGE_ROOTFS}${opkglibdir}/info/*.preinst; do
|
||||
if [ -f $i ] && ! sh $i; then
|
||||
runtime_script_required=1
|
||||
opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .preinst`
|
||||
fi
|
||||
done
|
||||
for i in ${IMAGE_ROOTFS}${opkglibdir}/info/*.postinst; do
|
||||
if [ -f $i ] && ! sh $i configure; then
|
||||
runtime_script_required=1
|
||||
opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .postinst`
|
||||
fi
|
||||
done
|
||||
|
||||
if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then
|
||||
if [ $runtime_script_required -eq 1 ]; then
|
||||
if grep Status:.install.ok.unpacked ${IMAGE_ROOTFS}${opkglibdir}status; then
|
||||
echo "Some packages could not be configured offline and rootfs is read-only."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -20,8 +20,6 @@ do_rootfs[depends] += "opkg-native:do_populate_sysroot"
|
||||
|
||||
do_rootfs[recrdeptask] += "do_package_write_rpm"
|
||||
|
||||
AWKPOSTINSTSCRIPT = "${COREBASE}/scripts/rootfs_rpm-extract-postinst.awk"
|
||||
|
||||
RPM_PREPROCESS_COMMANDS = "package_update_index_rpm; package_generate_rpm_conf; "
|
||||
RPM_POSTPROCESS_COMMANDS = ""
|
||||
|
||||
@@ -46,7 +44,7 @@ RPM="rpm ${RPMOPTS}"
|
||||
do_rootfs[lockfiles] += "${DEPLOY_DIR_RPM}/rpm.lock"
|
||||
|
||||
fakeroot rootfs_rpm_do_rootfs () {
|
||||
#set +x
|
||||
set +x
|
||||
|
||||
${RPM_PREPROCESS_COMMANDS}
|
||||
|
||||
@@ -57,8 +55,7 @@ fakeroot rootfs_rpm_do_rootfs () {
|
||||
export INSTALL_ROOTFS_RPM="${IMAGE_ROOTFS}"
|
||||
export INSTALL_PLATFORM_RPM="${TARGET_ARCH}"
|
||||
export INSTALL_CONFBASE_RPM="${RPMCONF_TARGET_BASE}"
|
||||
export INSTALL_PACKAGES_NORMAL_RPM="${PACKAGE_INSTALL}"
|
||||
export INSTALL_PACKAGES_MULTILIB_RPM="${MULTILIB_PACKAGE_INSTALL}"
|
||||
export INSTALL_PACKAGES_RPM="${PACKAGE_INSTALL}"
|
||||
export INSTALL_PACKAGES_ATTEMPTONLY_RPM="${PACKAGE_INSTALL_ATTEMPTONLY}"
|
||||
export INSTALL_PACKAGES_LINGUAS_RPM="${LINGUAS_INSTALL}"
|
||||
export INSTALL_PROVIDENAME_RPM=""
|
||||
@@ -109,19 +106,9 @@ EOF
|
||||
|
||||
${ROOTFS_POSTINSTALL_COMMAND}
|
||||
|
||||
mkdir -p ${IMAGE_ROOTFS}/etc/rpm-postinsts/
|
||||
${RPM} --root ${IMAGE_ROOTFS} -D '_dbpath ${rpmlibdir}' -qa \
|
||||
-D "__dbi_txn create nofsync private" \
|
||||
--qf 'Name: %{NAME}\n%|POSTIN?{postinstall scriptlet%|POSTINPROG?{ (using %{POSTINPROG})}|:\n%{POSTIN}\n}:{%|POSTINPROG?{postinstall program: %{POSTINPROG}\n}|}|' \
|
||||
> ${IMAGE_ROOTFS}/etc/rpm-postinsts/combined
|
||||
awk -f ${AWKPOSTINSTSCRIPT} < ${IMAGE_ROOTFS}/etc/rpm-postinsts/combined
|
||||
rm ${IMAGE_ROOTFS}/etc/rpm-postinsts/combined
|
||||
|
||||
for i in ${IMAGE_ROOTFS}/etc/rpm-postinsts/*.sh; do
|
||||
if [ -f $i ] && sh $i; then
|
||||
# rm $i
|
||||
mv $i $i.done
|
||||
fi
|
||||
# Report delayed package scriptlets
|
||||
for i in ${IMAGE_ROOTFS}/etc/rpm-postinsts/*; do
|
||||
echo "Delayed package scriptlet: `head -n 3 $i | tail -n 1`"
|
||||
done
|
||||
|
||||
install -d ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d
|
||||
@@ -129,11 +116,10 @@ EOF
|
||||
i=\$i
|
||||
cat > ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure << EOF
|
||||
#!/bin/sh
|
||||
for i in /etc/rpm-postinsts/*.sh; do
|
||||
for i in /etc/rpm-postinsts/*; do
|
||||
echo "Running postinst $i..."
|
||||
if [ -f $i ] && sh $i; then
|
||||
# rm $i
|
||||
mv $i $i.done
|
||||
if [ -f $i ] && $i; then
|
||||
rm $i
|
||||
else
|
||||
echo "ERROR: postinst $i failed."
|
||||
fi
|
||||
|
||||
@@ -10,12 +10,14 @@ SSTATE_PKGSPEC = "sstate-${PN}-${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}-$
|
||||
SSTATE_PKGNAME = "${SSTATE_PKGSPEC}${BB_TASKHASH}"
|
||||
SSTATE_PKG = "${SSTATE_DIR}/${SSTATE_PKGNAME}"
|
||||
|
||||
SSTATE_SCAN_CMD ?= "find ${SSTATE_BUILDDIR} \( -name "*.la" -o -name "*-config" \) -type f"
|
||||
SSTATE_SCAN_FILES ?= "*.la *-config"
|
||||
SSTATE_SCAN_CMD ?= 'find ${SSTATE_BUILDDIR} \( -name "${@"\" -o -name \"".join(d.getVar("SSTATE_SCAN_FILES", True).split())}" \) -type f'
|
||||
|
||||
BB_HASHFILENAME = "${SSTATE_PKGNAME}"
|
||||
|
||||
SSTATE_MANMACH ?= "${SSTATE_PKGARCH}"
|
||||
|
||||
SSTATEPREINSTFUNCS ?= ""
|
||||
SSTATEPOSTINSTFUNCS ?= ""
|
||||
|
||||
python () {
|
||||
@@ -114,15 +116,16 @@ def sstate_install(ss, d):
|
||||
for state in ss['dirs']:
|
||||
oe.path.copytree(state[1], state[2])
|
||||
for walkroot, dirs, files in os.walk(state[1]):
|
||||
bb.debug(2, "Staging files from %s to %s" % (state[1], state[2]))
|
||||
for file in files:
|
||||
srcpath = os.path.join(walkroot, file)
|
||||
dstpath = srcpath.replace(state[1], state[2])
|
||||
bb.debug(2, "Staging %s to %s" % (srcpath, dstpath))
|
||||
#bb.debug(2, "Staging %s to %s" % (srcpath, dstpath))
|
||||
sharedfiles.append(dstpath)
|
||||
for dir in dirs:
|
||||
srcdir = os.path.join(walkroot, dir)
|
||||
dstdir = srcdir.replace(state[1], state[2])
|
||||
bb.debug(2, "Staging %s to %s" % (srcdir, dstdir))
|
||||
#bb.debug(2, "Staging %s to %s" % (srcdir, dstdir))
|
||||
if not dstdir.endswith("/"):
|
||||
dstdir = dstdir + "/"
|
||||
shareddirs.append(dstdir)
|
||||
@@ -168,6 +171,10 @@ def sstate_installpkg(ss, d):
|
||||
|
||||
bb.data.setVar('SSTATE_INSTDIR', sstateinst, d)
|
||||
bb.data.setVar('SSTATE_PKG', sstatepkg, d)
|
||||
|
||||
for preinst in (d.getVar('SSTATEPREINSTFUNCS', True) or '').split():
|
||||
bb.build.exec_func(preinst, d)
|
||||
|
||||
bb.build.exec_func('sstate_unpack_package', d)
|
||||
|
||||
# Fixup hardcoded paths
|
||||
@@ -258,10 +265,15 @@ def sstate_clean(ss, d):
|
||||
bb.utils.unlockfile(lock)
|
||||
|
||||
stfile = d.getVar("STAMP", True) + ".do_" + ss['task']
|
||||
extrainf = d.getVarFlag("do_" + ss['task'], 'stamp-extra-info', True)
|
||||
oe.path.remove(stfile)
|
||||
oe.path.remove(stfile + "_setscene")
|
||||
oe.path.remove(stfile + ".*")
|
||||
oe.path.remove(stfile + "_setscene" + ".*")
|
||||
if extrainf:
|
||||
oe.path.remove(stfile + ".*" + extrainf)
|
||||
oe.path.remove(stfile + "_setscene" + ".*" + extrainf)
|
||||
else:
|
||||
oe.path.remove(stfile + ".*")
|
||||
oe.path.remove(stfile + "_setscene" + ".*")
|
||||
|
||||
CLEANFUNCS += "sstate_cleanall"
|
||||
|
||||
@@ -355,12 +367,12 @@ def sstate_package(ss, d):
|
||||
for file in files:
|
||||
srcpath = os.path.join(walkroot, file)
|
||||
dstpath = srcpath.replace(state[1], sstatebuild + state[0])
|
||||
bb.debug(2, "Preparing %s for packaging at %s" % (srcpath, dstpath))
|
||||
make_relative_symlink(srcpath, dstpath, d)
|
||||
for dir in dirs:
|
||||
srcpath = os.path.join(walkroot, dir)
|
||||
dstpath = srcpath.replace(state[1], sstatebuild + state[0])
|
||||
make_relative_symlink(srcpath, dstpath, d)
|
||||
bb.debug(2, "Preparing tree %s for packaging at %s" % (state[1], sstatebuild + state[0]))
|
||||
oe.path.copytree(state[1], sstatebuild + state[0])
|
||||
|
||||
workdir = bb.data.getVar('WORKDIR', d, True)
|
||||
@@ -441,12 +453,14 @@ python sstate_task_postfunc () {
|
||||
#
|
||||
sstate_create_package () {
|
||||
cd ${SSTATE_BUILDDIR}
|
||||
TFILE=`mktemp ${SSTATE_PKG}.XXXXXXXX`
|
||||
# Need to handle empty directories
|
||||
if [ "$(ls -A)" ]; then
|
||||
tar -czf ${SSTATE_PKG} *
|
||||
tar -czf $TFILE *
|
||||
else
|
||||
tar -cz --file=${SSTATE_PKG} --files-from=/dev/null
|
||||
tar -cz --file=$TFILE --files-from=/dev/null
|
||||
fi
|
||||
mv $TFILE ${SSTATE_PKG}
|
||||
|
||||
cd ${WORKDIR}
|
||||
rm -rf ${SSTATE_BUILDDIR}
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
USERADDPN ?= "${PN}"
|
||||
|
||||
# base-passwd-cross provides the default passwd and group files in the
|
||||
# target sysroot, and shadow -native and -sysroot provide the utilities
|
||||
# and support files needed to add and modify user and group accounts
|
||||
DEPENDS_append = " base-passwd shadow-native shadow-sysroot"
|
||||
RDEPENDS_${USERADDPN}_append = " base-passwd shadow"
|
||||
DEPENDS_append = "${USERADDDEPENDS}"
|
||||
USERADDDEPENDS = " base-passwd shadow-native shadow-sysroot shadow"
|
||||
USERADDDEPENDS_virtclass-cross = ""
|
||||
USERADDDEPENDS_virtclass-native = ""
|
||||
USERADDDEPENDS_virtclass-nativesdk = ""
|
||||
|
||||
# This preinstall function will be run in two contexts: once for the
|
||||
# native sysroot (as invoked by the useradd_sysroot() wrapper), and
|
||||
# also as the preinst script in the target package.
|
||||
# This preinstall function can be run in four different contexts:
|
||||
#
|
||||
# a) Before do_install
|
||||
# b) At do_populate_sysroot_setscene when installing from sstate packages
|
||||
# c) As the preinst script in the target package at do_rootfs time
|
||||
# d) As the preinst script in the target package on device as a package upgrade
|
||||
#
|
||||
useradd_preinst () {
|
||||
OPT=""
|
||||
SYSROOT=""
|
||||
@@ -37,7 +42,29 @@ if test "x$GROUPADD_PARAM" != "x"; then
|
||||
opts=`echo "$GROUPADD_PARAM" | cut -d ';' -f 1`
|
||||
remaining=`echo "$GROUPADD_PARAM" | cut -d ';' -f 2-`
|
||||
while test "x$opts" != "x"; do
|
||||
eval $PSEUDO groupadd -f $OPT $opts
|
||||
groupname=`echo "$opts" | awk '{ print $NF }'`
|
||||
group_exists=`grep "^$groupname:" $SYSROOT/etc/group || true`
|
||||
if test "x$group_exists" = "x"; then
|
||||
count=1
|
||||
while true; do
|
||||
eval $PSEUDO groupadd $OPT $opts || true
|
||||
group_exists=`grep "^$groupname:" $SYSROOT/etc/group || true`
|
||||
if test "x$group_exists" = "x"; then
|
||||
# File locking issues can require us to retry the command
|
||||
echo "WARNING: groupadd command did not succeed. Retrying..."
|
||||
sleep 1
|
||||
else
|
||||
break
|
||||
fi
|
||||
count=`expr $count + 1`
|
||||
if test $count = 11; then
|
||||
echo "ERROR: tried running groupadd command 10 times without success, giving up"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "Note: group $groupname already exists, not re-creating it"
|
||||
fi
|
||||
|
||||
if test "x$opts" = "x$remaining"; then
|
||||
break
|
||||
@@ -59,7 +86,23 @@ if test "x$USERADD_PARAM" != "x"; then
|
||||
username=`echo "$opts" | awk '{ print $NF }'`
|
||||
user_exists=`grep "^$username:" $SYSROOT/etc/passwd || true`
|
||||
if test "x$user_exists" = "x"; then
|
||||
eval $PSEUDO useradd $OPT $opts
|
||||
count=1
|
||||
while true; do
|
||||
eval $PSEUDO useradd $OPT $opts || true
|
||||
user_exists=`grep "^$username:" $SYSROOT/etc/passwd || true`
|
||||
if test "x$user_exists" = "x"; then
|
||||
# File locking issues can require us to retry the command
|
||||
echo "WARNING: useradd command did not succeed. Retrying..."
|
||||
sleep 1
|
||||
else
|
||||
break
|
||||
fi
|
||||
count=`expr $count + 1`
|
||||
if test $count = 11; then
|
||||
echo "ERROR: tried running useradd command 10 times without success, giving up"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "Note: username $username already exists, not re-creating it"
|
||||
fi
|
||||
@@ -74,8 +117,10 @@ fi
|
||||
}
|
||||
|
||||
useradd_sysroot () {
|
||||
export PSEUDO="${STAGING_DIR_NATIVE}${bindir}/pseudo"
|
||||
export PSEUDO_LOCALSTATEDIR="${STAGING_DIR_TARGET}${localstatedir}/pseudo"
|
||||
# Pseudo may (do_install) or may not (do_populate_sysroot_setscene) be running
|
||||
# at this point so we're explicit about the environment so pseudo can load if
|
||||
# not already present.
|
||||
export PSEUDO="${FAKEROOTENV} PSEUDO_LOCALSTATEDIR=${STAGING_DIR_TARGET}${localstatedir}/pseudo ${STAGING_DIR_NATIVE}${bindir}/pseudo"
|
||||
|
||||
# Explicitly set $D since it isn't set to anything
|
||||
# before do_install
|
||||
@@ -84,41 +129,54 @@ useradd_sysroot () {
|
||||
}
|
||||
|
||||
useradd_sysroot_sstate () {
|
||||
if [ "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
|
||||
if [ "${BB_CURRENTTASK}" = "package_setscene" ]
|
||||
then
|
||||
useradd_sysroot
|
||||
fi
|
||||
}
|
||||
|
||||
do_install[prefuncs] += "useradd_sysroot"
|
||||
SSTATEPOSTINSTFUNCS += "useradd_sysroot_sstate"
|
||||
do_install[prefuncs] += "${SYSROOTFUNC}"
|
||||
SYSROOTFUNC = "useradd_sysroot"
|
||||
SYSROOTFUNC_virtclass-cross = ""
|
||||
SYSROOTFUNC_virtclass-native = ""
|
||||
SYSROOTFUNC_virtclass-nativesdk = ""
|
||||
SSTATEPREINSTFUNCS += "${SYSROOTPOSTFUNC}"
|
||||
SYSROOTPOSTFUNC = "useradd_sysroot_sstate"
|
||||
SYSROOTPOSTFUNC_virtclass-cross = ""
|
||||
SYSROOTPOSTFUNC_virtclass-native = ""
|
||||
SYSROOTPOSTFUNC_virtclass-nativesdk = ""
|
||||
|
||||
USERADDSETSCENEDEPS = "base-passwd:do_populate_sysroot_setscene shadow-native:do_populate_sysroot_setscene ${MLPREFIX}shadow-sysroot:do_populate_sysroot_setscene"
|
||||
USERADDSETSCENEDEPS_virtclass-cross = ""
|
||||
USERADDSETSCENEDEPS_virtclass-native = ""
|
||||
USERADDSETSCENEDEPS_virtclass-nativesdk = ""
|
||||
do_package_setscene[depends] = "${USERADDSETSCENEDEPS}"
|
||||
|
||||
# Recipe parse-time sanity checks
|
||||
def update_useradd_after_parse(d):
|
||||
if not d.getVar('USERADD_PACKAGES', False):
|
||||
if not d.getVar('USERADD_PARAM', False) and not d.getVar('GROUPADD_PARAM', False):
|
||||
raise bb.build.FuncFailed, "%s inherits useradd but doesn't set USERADD_PARAM or GROUPADD_PARAM" % bb.data.getVar('FILE', d)
|
||||
useradd_packages = d.getVar('USERADD_PACKAGES', True)
|
||||
|
||||
if not useradd_packages:
|
||||
raise bb.build.FuncFailed, "%s inherits useradd but doesn't set USERADD_PACKAGES" % bb.data.getVar('FILE', d)
|
||||
|
||||
for pkg in useradd_packages.split():
|
||||
if not d.getVar('USERADD_PARAM_%s' % pkg, True) and not d.getVar('GROUPADD_PARAM_%s' % pkg, True):
|
||||
raise bb.build.FuncFailed, "%s inherits useradd but doesn't set USERADD_PARAM or GROUPADD_PARAM for package %s" % (bb.data.getVar('FILE', d), pkg)
|
||||
|
||||
python __anonymous() {
|
||||
update_useradd_after_parse(d)
|
||||
}
|
||||
|
||||
# Return a single [GROUP|USER]ADD_PARAM formatted string which includes the
|
||||
# [group|user]add parameters for all packages in this recipe
|
||||
# [group|user]add parameters for all USERADD_PACKAGES in this recipe
|
||||
def get_all_cmd_params(d, cmd_type):
|
||||
import string
|
||||
|
||||
param_type = cmd_type.upper() + "ADD_PARAM_%s"
|
||||
params = []
|
||||
|
||||
pkgs = d.getVar('USERADD_PACKAGES', True)
|
||||
if not pkgs:
|
||||
pkgs = d.getVar('USERADDPN', True)
|
||||
packages = (d.getVar('PACKAGES', True) or "").split()
|
||||
if packages and pkgs not in packages:
|
||||
pkgs = packages[0]
|
||||
|
||||
for pkg in pkgs.split():
|
||||
useradd_packages = d.getVar('USERADD_PACKAGES', True) or ""
|
||||
for pkg in useradd_packages.split():
|
||||
param = d.getVar(param_type % pkg, True)
|
||||
if param:
|
||||
params.append(param)
|
||||
@@ -141,16 +199,15 @@ fakeroot python populate_packages_prepend () {
|
||||
preinst += d.getVar('useradd_preinst', True)
|
||||
bb.data.setVar('pkg_preinst_%s' % pkg, preinst, d)
|
||||
|
||||
# We add the user/group calls to all packages to allow any package
|
||||
# to contain files owned by the users/groups defined in the recipe.
|
||||
# The user/group addition code is careful not to create duplicate
|
||||
# entries, so this is safe.
|
||||
pkgs = d.getVar('USERADD_PACKAGES', True)
|
||||
if not pkgs:
|
||||
pkgs = d.getVar('USERADDPN', True)
|
||||
packages = (d.getVar('PACKAGES', True) or "").split()
|
||||
if packages and pkgs not in packages:
|
||||
pkgs = packages[0]
|
||||
for pkg in pkgs.split():
|
||||
update_useradd_package(pkg)
|
||||
# RDEPENDS setup
|
||||
rdepends = d.getVar("RDEPENDS_%s" % pkg, True) or ""
|
||||
rdepends += " base-passwd shadow"
|
||||
bb.data.setVar("RDEPENDS_%s" % pkg, rdepends, d)
|
||||
|
||||
# Add the user/group preinstall scripts and RDEPENDS requirements
|
||||
# to packages specified by USERADD_PACKAGES
|
||||
if not bb.data.inherits_class('nativesdk', d):
|
||||
useradd_packages = d.getVar('USERADD_PACKAGES', True) or ""
|
||||
for pkg in useradd_packages.split():
|
||||
update_useradd_package(pkg)
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
# Used by multilib code to change the library paths
|
||||
baselib = "${BASELIB}"
|
||||
baselib[vardepvalue] = "${baselib}"
|
||||
BASELIB = "lib"
|
||||
BASELIB_powerpc64 = "lib64"
|
||||
|
||||
@@ -159,7 +160,6 @@ ASSUME_PROVIDED = "\
|
||||
python-native-runtime \
|
||||
svn-native \
|
||||
tar-native \
|
||||
texinfo-native \
|
||||
virtual/libintl-native \
|
||||
"
|
||||
|
||||
@@ -170,6 +170,7 @@ ASSUME_PROVIDED = "\
|
||||
PN = "${@bb.parse.BBHandler.vars_from_file(bb.data.getVar('FILE',d),d)[0] or 'defaultpkgname'}"
|
||||
PV = "${@bb.parse.BBHandler.vars_from_file(bb.data.getVar('FILE',d),d)[1] or '1.0'}"
|
||||
PR = "${@bb.parse.BBHandler.vars_from_file(bb.data.getVar('FILE',d),d)[2] or 'r0'}"
|
||||
PRINC ?= "0"
|
||||
PF = "${PN}-${EXTENDPE}${PV}-${PR}"
|
||||
EXTENDPE = "${@['','${PE\x7d_'][bb.data.getVar('PE',d,1) > 0]}"
|
||||
P = "${PN}-${PV}"
|
||||
@@ -242,7 +243,7 @@ PROVIDES = ""
|
||||
PROVIDES_prepend = "${P} ${PF} ${PN} "
|
||||
RPROVIDES = ""
|
||||
|
||||
MULTI_PROVIDER_WHITELIST = "virtual/libintl virtual/libintl-native virtual/libintl-nativesdk virtual/xserver"
|
||||
MULTI_PROVIDER_WHITELIST = "virtual/libintl virtual/libintl-native virtual/libintl-nativesdk virtual/xserver virtual/update-alternatives-native virtual/update-alternatives"
|
||||
|
||||
SOLIBS = ".so.*"
|
||||
SOLIBS_darwin = ".*.dylib"
|
||||
@@ -407,7 +408,7 @@ export PATH
|
||||
CCACHE = "${@bb.which(bb.data.getVar('PATH', d, 1), 'ccache') and 'ccache '}"
|
||||
TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TARGET}"
|
||||
|
||||
export CCACHE_DIR = "${TMPDIR}/ccache/${HOST_SYS}/${PN}"
|
||||
export CCACHE_DIR = "${TMPDIR}/ccache/${MULTIMACH_HOST_SYS}/${PN}"
|
||||
export CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
|
||||
export CXX = "${CCACHE}${HOST_PREFIX}g++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
|
||||
export F77 = "${CCACHE}${HOST_PREFIX}g77 ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
|
||||
@@ -659,6 +660,7 @@ AUTO_LIBNAME_PKGS = "${PACKAGES}"
|
||||
OVERRIDES = "${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:forcevariable"
|
||||
DISTROOVERRIDES ?= "${DISTRO}"
|
||||
MACHINEOVERRIDES ?= "${MACHINE}"
|
||||
MACHINEOVERRIDES[vardepsexclude] = "MACHINE"
|
||||
|
||||
CPU_FEATURES ?= ""
|
||||
CPU_FEATURES_arm ?= "vfp"
|
||||
@@ -751,7 +753,7 @@ TRANSLATED_TARGET_ARCH ??= "${@d.getVar('TARGET_ARCH', True).replace("_", "-")}"
|
||||
# Setup our default hash policy
|
||||
BB_SIGNATURE_HANDLER ?= "basic"
|
||||
BB_HASHTASK_WHITELIST ?= "(.*-cross$|.*-native$|.*-cross-initial$|.*-cross-intermediate$|^virtual:native:.*|^virtual:nativesdk:.*)"
|
||||
BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM USER FILESPATH USERNAME STAGING_DIR_HOST STAGING_DIR_TARGET COREBASE"
|
||||
BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM USER FILESPATH STAGING_DIR_HOST STAGING_DIR_TARGET COREBASE"
|
||||
|
||||
MLPREFIX ??= ""
|
||||
MULTILIB_VARIANTS ??= ""
|
||||
|
||||
@@ -348,6 +348,7 @@ BBCLASSEXTEND_append_pn-setserial = " ${MULTILIBS}"
|
||||
BBCLASSEXTEND_append_pn-settings-daemon = " ${MULTILIBS}"
|
||||
BBCLASSEXTEND_append_pn-sgml-common = " ${MULTILIBS}"
|
||||
BBCLASSEXTEND_append_pn-shadow = " ${MULTILIBS}"
|
||||
BBCLASSEXTEND_append_pn-shadow-sysroot = " ${MULTILIBS}"
|
||||
BBCLASSEXTEND_append_pn-shared-mime-info = " ${MULTILIBS}"
|
||||
BBCLASSEXTEND_append_pn-slang = " ${MULTILIBS}"
|
||||
BBCLASSEXTEND_append_pn-speex = " ${MULTILIBS}"
|
||||
|
||||
14
meta/files/common-licenses/Adobe
Normal file
@@ -0,0 +1,14 @@
|
||||
Copyright 1990-1998 Adobe Systems Incorporated.
|
||||
All Rights Reserved.
|
||||
|
||||
Patents Pending
|
||||
|
||||
NOTICE: All information contained herein is the property of Adobe
|
||||
Systems Incorporated.
|
||||
|
||||
Permission is granted for redistribution of this file provided
|
||||
this copyright notice is maintained intact and that the contents
|
||||
of this file are not altered in any way from its original form.
|
||||
|
||||
PostScript and Display PostScript are trademarks of Adobe Systems
|
||||
Incorporated which may be registered in certain jurisdictions.
|
||||