using.txt 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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::menuconfig.png[]
  17. First of all you need to choose your target architecture, your target
  18. system, your target C library, your target firmware type and your target
  19. package format. After that you can select individual packages and kernel
  20. settings or just use one of the predefined package collections. When you
  21. are ready exit and save. You can always redefine the configuration
  22. using +make menuconfig+.
  23. image::menuconfig-configured.png[]
  24. Once everything is configured, the configuration tool generates a
  25. +.config+ file that contains the description of your configuration. It
  26. will be used by the Makefiles to do what's needed.
  27. Let's go:
  28. --------------------
  29. $ make
  30. --------------------
  31. You *should never* use +make -jN+ with OpenADK: it does not support 'top-level
  32. parallel make'. Instead, use the +ADK_MAKE_JOBS+ option in +Global settings+ to
  33. tell OpenADK to run each package compilation with +make -jN+.
  34. The `make` command will generally perform the following steps:
  35. * download source files (as required);
  36. * configure, build and install required host tools;
  37. * configure, build and install the cross-compiling toolchain;
  38. * build a kernel image, if selected;
  39. * build/install selected target packages;
  40. * build a bootloader, if selected;
  41. * create a root filesystem in selected format.
  42. OpenADK output is stored in several subdirectories:
  43. * +firmware/+ where all the images and packages are stored.
  44. * +build_<system>_<arch>_<libc>/+ where all the components except for the cross-compilation toolchain are built. The directory contains one subdirectory for each of these components.
  45. * +target_<arch>_<libc>/+ which contains a hierarchy similar to a root filesystem
  46. hierarchy. This directory contains the installation of the
  47. cross-compilation toolchain and all the userspace packages selected
  48. for the target. However, this directory is 'not' intended to be
  49. the root filesystem for the target: it contains a lot of development
  50. files, unstripped binaries and libraries that make it far too big
  51. for an embedded system. These development files are used to compile
  52. libraries and applications for the target that depend on other
  53. libraries.
  54. * +root_<system>_<arch>_<libc>/+ which contains the complete root filesystem for
  55. the target. One exception, it doesn't have the correct
  56. permissions (e.g. setuid for the busybox binary) for some files.
  57. Therefore, this directory *should not be used on your target*.
  58. Instead, you should use one of the images or archives built in the
  59. +firmware/+ directory. If you need an
  60. extracted image of the root filesystem for booting over NFS, then
  61. use the tarball image generated in +firmware/+ and extract it as
  62. root. Compared to +build_*/+, +target_*/+ contains only the files and
  63. libraries needed to run the selected target applications: the
  64. development files are (exception: if any dev packages are selected)
  65. not present, the binaries are stripped.
  66. * +host_<gnu_host_name>/+ contains the installation of tools compiled for the host
  67. that are needed for the proper execution of OpenADK
  68. * +toolchain_<gnu_host_name>/+ contains just the cross-compilation toolchain.
  69. Can be used together with +target_<arch>_<libc>/+ for other projects. Toolchain
  70. is relocatable.
  71. * +toolchain_build_<arch>_<libc>/+ contains the build directories for the various
  72. components of the cross-compilation toolchain.
  73. * +pkg_<system>_<arch>_<libc>/+ contains stamp files and file lists for the various components.
  74. The command, +make menuconfig+ and +make+, are the
  75. basic ones that allow to easily and quickly generate images fitting
  76. your needs, with all the supports and applications you enabled.
  77. More details about the "make" command usage are given in
  78. xref:make-tips[].