diff options
Diffstat (limited to 'documentation/dev-manual/dev-manual-common-tasks.xml')
-rw-r--r-- | documentation/dev-manual/dev-manual-common-tasks.xml | 88 |
1 files changed, 81 insertions, 7 deletions
diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index 824aac1236..918d884681 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml | |||
@@ -1352,6 +1352,8 @@ | |||
1352 | <para> | 1352 | <para> |
1353 | The easiest way to define kernel configurations is to set them through the | 1353 | The easiest way to define kernel configurations is to set them through the |
1354 | <filename>menuconfig</filename> tool. | 1354 | <filename>menuconfig</filename> tool. |
1355 | This tool provides an interactive method with which | ||
1356 | to set kernel configurations. | ||
1355 | For general information on <filename>menuconfig</filename>, see | 1357 | For general information on <filename>menuconfig</filename>, see |
1356 | <ulink url='http://en.wikipedia.org/wiki/Menuconfig'></ulink>. | 1358 | <ulink url='http://en.wikipedia.org/wiki/Menuconfig'></ulink>. |
1357 | </para> | 1359 | </para> |
@@ -1359,6 +1361,9 @@ | |||
1359 | <para> | 1361 | <para> |
1360 | To use the <filename>menuconfig</filename> tool in the Yocto Project development | 1362 | To use the <filename>menuconfig</filename> tool in the Yocto Project development |
1361 | environment, you must build the tool using BitBake. | 1363 | environment, you must build the tool using BitBake. |
1364 | Thus, the environment must be set up using the <filename>&OE_INIT_FILE;</filename> | ||
1365 | script found in the | ||
1366 | <link linkend='build-directory'>Build Directory</link>. | ||
1362 | The following commands build and invoke <filename>menuconfig</filename> assuming the | 1367 | The following commands build and invoke <filename>menuconfig</filename> assuming the |
1363 | source directory top-level folder is <filename>~/poky</filename>: | 1368 | source directory top-level folder is <filename>~/poky</filename>: |
1364 | <literallayout class='monospaced'> | 1369 | <literallayout class='monospaced'> |
@@ -1367,17 +1372,86 @@ | |||
1367 | $ bitbake linux-yocto -c menuconfig | 1372 | $ bitbake linux-yocto -c menuconfig |
1368 | </literallayout> | 1373 | </literallayout> |
1369 | Once <filename>menuconfig</filename> comes up, its standard interface allows you to | 1374 | Once <filename>menuconfig</filename> comes up, its standard interface allows you to |
1370 | examine and configure all the kernel configuration parameters. | 1375 | interactively examine and configure all the kernel configuration parameters. |
1371 | Once you have made your changes, simply exit the tool and save your changes to | 1376 | After making your changes, simply exit the tool and save your changes to |
1372 | create an updated version of the <filename>.config</filename> configuration file. | 1377 | create an updated version of the <filename>.config</filename> configuration file. |
1373 | </para> | 1378 | </para> |
1374 | 1379 | ||
1375 | <para> | 1380 | <para> |
1376 | For an example that shows how to change a specific kernel option | 1381 | Consider an example that configures the <filename>linux-yocto-3.4</filename> |
1377 | using <filename>menuconfig</filename>, see the | 1382 | kernel. |
1378 | "<link linkend='changing-the-config-smp-configuration-using-menuconfig'>Changing | 1383 | The OpenEmbedded build system recognizes this kernel as |
1379 | the <filename>CONFIG_SMP</filename> Configuration Using <filename>menuconfig</filename></link>" | 1384 | <filename>linux-yocto</filename>. |
1380 | section. | 1385 | Thus, the following commands from the shell in which you previously sourced the |
1386 | environment initialization script cleans the shared state cache and the | ||
1387 | <ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink> | ||
1388 | directory and then builds and launches <filename>menuconfig</filename>: | ||
1389 | <literallayout class='monospaced'> | ||
1390 | $ bitbake linux-yocto -c menuconfig | ||
1391 | </literallayout> | ||
1392 | </para> | ||
1393 | |||
1394 | <para> | ||
1395 | Once <filename>menuconfig</filename> launches, you use the interface | ||
1396 | to navigate through the selections to find the configuration settings in | ||
1397 | which you are interested. | ||
1398 | For example, consider the <filename>CONFIG_SMP</filename> configuration setting. | ||
1399 | You can find it at <filename>Processor Type and Features</filename> under | ||
1400 | the configuration selection <filename>Symmetric Multi-processing Support</filename>. | ||
1401 | After highlighting the selection, you can use the arrow keys to select or deselect | ||
1402 | the setting. | ||
1403 | When you are finished with all your selections, exit out and save them. | ||
1404 | </para> | ||
1405 | |||
1406 | <para> | ||
1407 | Saving the selections updates the <filename>.config</filename> configuration file. | ||
1408 | This is the file that the OpenEmbedded build system uses to configure the | ||
1409 | kernel during the build. | ||
1410 | You can find and examine this file in the build directory in | ||
1411 | <filename>tmp/work/</filename>. | ||
1412 | The actual <filename>.config</filename> is located in the area where the | ||
1413 | specific kernel is built. | ||
1414 | For example, if you were building a Linux Yocto kernel based on the | ||
1415 | Linux 3.4 kernel and you were building a QEMU image targeted for | ||
1416 | <filename>x86</filename> architecture, the | ||
1417 | <filename>.config</filename> file would be located here: | ||
1418 | <literallayout class='monospaced'> | ||
1419 | ~/poky/build/tmp/work/qemux86-poky-linux/linux-yocto-3.4.11+git1+84f... | ||
1420 | ...656ed30-r1/linux-qemux86-standard-build | ||
1421 | </literallayout> | ||
1422 | <note> | ||
1423 | The previous example directory is artificially split and many of the characters | ||
1424 | in the actual filename are omitted in order to make it more readable. | ||
1425 | Also, depending on the kernel you are using, the exact pathname | ||
1426 | for <filename>linux-yocto-3.4...</filename> might differ. | ||
1427 | </note> | ||
1428 | </para> | ||
1429 | |||
1430 | <para> | ||
1431 | Within the <filename>.config</filename> file, you can see the kernel settings. | ||
1432 | For example, the following entry shows that symmetric multi-processor support | ||
1433 | is not set: | ||
1434 | <literallayout class='monospaced'> | ||
1435 | # CONFIG_SMP is not set | ||
1436 | </literallayout> | ||
1437 | </para> | ||
1438 | |||
1439 | <para> | ||
1440 | A good method to isolate changed configurations is to use a combination of the | ||
1441 | <filename>menuconfig</filename> tool and simple shell commands. | ||
1442 | Before changing configurations with <filename>menuconfig</filename>, copy the | ||
1443 | existing <filename>.config</filename> and rename it to something else, | ||
1444 | use <filename>menuconfig</filename> to make | ||
1445 | as many changes an you want and save them, then compare the renamed configuration | ||
1446 | file against the newly created file. | ||
1447 | You can use the resulting differences as your base to create configuration fragments | ||
1448 | to permanently save in your kernel layer. | ||
1449 | <note> | ||
1450 | Be sure to make a copy of the <filename>.config</filename> and don't just | ||
1451 | rename it. | ||
1452 | The build system needs an existing <filename>.config</filename> | ||
1453 | from which to work. | ||
1454 | </note> | ||
1381 | </para> | 1455 | </para> |
1382 | </section> | 1456 | </section> |
1383 | 1457 | ||