getting_started.rst 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. Getting Started
  2. ===============
  3. Selecting the right version
  4. ---------------------------
  5. Gluon's releases are managed using `Git tags`_. If you're a community getting
  6. started with Gluon we recommend to use the latest stable release of Gluon.
  7. Take a look at the `list of gluon releases`_ and notice the latest release,
  8. e.g. *v2014.3*.
  9. Please keep in mind that a matching site configuration for your community
  10. is required. Due to new features being added (or sometimes being removed)
  11. the format of the site configuration changes slightly between releases.
  12. Recent releases (starting with *v2014.3.1*) will come with an example
  13. configuration located in *docs/site-example/*.
  14. .. _Git tags: http://git-scm.com/book/en/Git-Basics-Tagging
  15. .. _list of gluon releases: https://github.com/freifunk-gluon/gluon/releases
  16. Dependencies
  17. ------------
  18. To build Gluon, several packages need to be installed on the system. On a
  19. freshly installed Debian Wheezy system the following packages are required:
  20. * `git` (to get Gluon and other dependencies)
  21. * `subversion`
  22. * `build-essential`
  23. * `gawk`
  24. * `unzip`
  25. * `libncurses-dev` (actually `libncurses5-dev`)
  26. * `libz-dev` (actually `zlib1g-dev`)
  27. Building the images
  28. -------------------
  29. To build Gluon, first check out the repository. Replace *RELEASE* with the
  30. version you'd like to checkout, e.g. *v2014.4*.
  31. ::
  32. git clone https://github.com/freifunk-gluon/gluon.git gluon -b RELEASE
  33. This command will create a directory named *gluon/*.
  34. It might also tell a scary message about being in a *detached state*.
  35. **Don't panic!** Everything's fine.
  36. Now, enter the freshly created directory:
  37. ::
  38. cd gluon
  39. It's time to add (or create) your site configuration.
  40. So let's create the directory *site/*:
  41. ::
  42. mkdir site
  43. cd site
  44. Copy *site.conf*, *site.mk* and *i18n* from *docs/site-example*:
  45. ::
  46. cp ../docs/site-example/site.conf .
  47. cp ../docs/site-example/site.mk .
  48. cp -r ../docs/site-example/i18n .
  49. Edit these files to match your community, then go back to the top-level Gluon
  50. directory and build Gluon:
  51. ::
  52. cd ..
  53. make update # Get other repositories used by Gluon
  54. make GLUON_TARGET=ar71xx-generic # Build Gluon
  55. When calling make, the OpenWrt build environment is prepared/updated.
  56. In case of errors read the messages carefully and try to fix the stated issues (e.g. install tools not available yet).
  57. ``ar71xx-generic`` is the most common target and will generated images for most of the supported hardware.
  58. To see a complete list of supported targets, call ``make`` without setting ``GLUON_TARGET``.
  59. The built images can be found in the directory `images`. Of these, the factory
  60. images are to be used when flashing from the original firmware a device came with,
  61. and sysupgrade is to upgrade from other versions of Gluon or any other OpenWRT-based
  62. system.
  63. You should reserve about 10GB of disk space for each `GLUON_TARGET`.
  64. There are two levels of `make clean`:
  65. ::
  66. make clean GLUON_TARGET=ar71xx-generic
  67. will ensure all packages are rebuilt for a single target; this is what you normally want to do after an update.
  68. ::
  69. make dirclean
  70. will clean the entire tree, so the toolchain will be rebuilt as well, which is
  71. not necessary in most cases, and will take a while.
  72. Environment variables
  73. ---------------------
  74. Gluon's build process can be controlled by various environment variables.
  75. GLUON_SITEDIR
  76. Path to the site configuration. Defaults to ``site/``.
  77. GLUON_IMAGEDIR
  78. Path where images will be stored. Defaults to ``images/``.
  79. GLUON_BUILDDIR
  80. Working directory during build. Defaults to ``build/``.
  81. So all in all, to update and rebuild a Gluon build tree, the following commands should be used (repeat the
  82. ``make clean`` and ``make`` for all targets you want to build):
  83. ::
  84. git pull
  85. (cd site && git pull)
  86. make update
  87. make clean GLUON_TARGET=ar71xx-generic
  88. make GLUON_TARGET=ar71xx-generic