1
0

using.txt 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. // -*- mode:doc; -*-
  2. // vim: set syntax=asciidoc:
  3. Using OpenADK
  4. -------------
  5. OpenADK has a nice configuration tool similar to the one you can
  6. find in the http://www.kernel.org/[Linux kernel] or in
  7. http://www.busybox.net/[Busybox]. Note that you can *and should build
  8. everything as a normal user*. There is no need to be root to configure
  9. and use OpenADK. The first step is to run the configuration
  10. assistant:
  11. --------------------
  12. $ make menuconfig
  13. --------------------
  14. For each menu entry in the configuration tool, you can find associated
  15. help that describes the purpose of the entry.
  16. image::openadk-menu.png[]
  17. First of all you need to choose if you want to build a Linux firmware
  18. or a bare-metal toolchain. Linux is choosen as default.
  19. image::openadk-arch.png[]
  20. After that you should select your target architecture.
  21. image::openadk-system.png[]
  22. Now you can select your target system, endianess, cpu and other stuff.
  23. image::openadk-task.png[]
  24. If you want to compile some predefined appliance tasks, you can select it in +Tasks+.
  25. You can later simply add your own tasks, which is a collection of options, packages,
  26. kernel modules or features, runtime configuration and more. They can either be placed
  27. inside the +tasks+ directory or in your own custom directory that you pass via
  28. +ADK_CUSTOM_TASKS_DIR+ to make.
  29. When you are ready exit and save. You can always redefine the
  30. configuration using +make menuconfig+.
  31. Once everything is configured, the configuration tool generates a
  32. +.config+ file that contains the description of your configuration. It
  33. will be used by the Makefiles to do what's needed.
  34. Let's go:
  35. --------------------
  36. $ make
  37. --------------------
  38. You *should never* use +make -jN+ with OpenADK: it does not support 'top-level
  39. parallel make'. Instead, use the +ADK_MAKE_JOBS+ option in +Global settings+ to
  40. tell OpenADK to run each package compilation with +make -jN+.
  41. The `make` command will generally perform the following steps:
  42. * download source files
  43. * configure, build and install required host tools
  44. * configure, build and install the cross-compiling toolchain
  45. * build a kernel image, if selected
  46. * build/install selected target packages
  47. * build a bootloader, if selected
  48. * create a root filesystem in selected format
  49. OpenADK output is stored in several subdirectories:
  50. * +firmware/+ where all the images and packages are stored.
  51. * +build_<system>_<libc>_<arch>_<abi>/+ where all the components except for the
  52. cross-compilation toolchain are built. The directory contains one
  53. subdirectory for each of these components.
  54. * +target_<system>_<libc>_<arch>_<abi>/+ which contains a hierarchy similar to a root filesystem
  55. hierarchy. This directory contains the installation of the
  56. cross-compilation toolchain and all the userspace packages selected
  57. for the target. However, this directory is 'not' intended to be
  58. the root filesystem for the target: it contains a lot of development
  59. files, unstripped binaries and libraries that make it far too big
  60. for an embedded system. These development files are used to compile
  61. libraries and applications for the target that depend on other
  62. libraries.
  63. * +root_<system>_<libc>_<arch>_<abi>/+ which contains the complete root filesystem for
  64. the target. One exception, it doesn't have the correct
  65. permissions (e.g. setuid for the busybox binary) for some files.
  66. Therefore, this directory *should not be used on your target*.
  67. Instead, you should use one of the images or archives built in the
  68. +firmware/+ directory. If you need an
  69. extracted image of the root filesystem for booting over NFS, then
  70. use the tarball image generated in +firmware/+ and extract it as
  71. root. Compared to +build_*/+, +target_*/+ contains only the files and
  72. libraries needed to run the selected target applications: the
  73. development files are (exception: if any dev packages are selected)
  74. not present, the binaries are stripped.
  75. * +host_<gnu_host_name>/+ contains the installation of tools compiled for the host
  76. that are needed for the proper execution of OpenADK
  77. * +host_build_<gnu_host_name>/+ contains the build directories of tools compiled for the host
  78. that are needed for the proper execution of OpenADK
  79. * +toolchain_<system>_<libc>_<arch>_<abi>>/+ contains just the cross-compilation toolchain.
  80. Can be used together with +target_<system>_<libc>_<arch>_<abi>/+ for other projects. Toolchain
  81. is relocatable.
  82. * +toolchain_build_<system>_<libc>_<arch>_<abi>/+ contains the build directories for the various
  83. components of the cross-compilation toolchain.
  84. * +pkg_<system>_<libc>_<arch>_<abi>/+ contains stamp files and file lists for the various components.
  85. The command, +make menuconfig+ and +make+, are the
  86. basic ones that allow to easily and quickly generate images fitting
  87. your needs, with all the applications you enabled.
  88. More details about the "make" command usage are given in
  89. xref:make-tips[].