2012-11-11 04:14:42 +01:00
|
|
|
// -*- mode:doc; -*-
|
2013-02-13 13:59:02 +01:00
|
|
|
// vim: set syntax=asciidoc:
|
2012-11-11 04:14:42 +01:00
|
|
|
|
manual: use one-line titles instead of two-line titles (trivial)
Asciidoc supports two syntaxes for section titles: two-line titles (title
plus underline consisting of a particular symbol), and one-line titles
(title prefixed with a specific number of = signs).
The two-line title underlines are:
Level 0 (top level): ======================
Level 1: ----------------------
Level 2: ~~~~~~~~~~~~~~~~~~~~~~
Level 3: ^^^^^^^^^^^^^^^^^^^^^^
Level 4 (bottom level): ++++++++++++++++++++++
and the one-line title prefixes:
= Document Title (level 0) =
== Section title (level 1) ==
=== Section title (level 2) ===
==== Section title (level 3) ====
===== Section title (level 4) =====
The buildroot manual is currenly using the two-line titles, but this has
multiple disadvantages:
- asciidoc also uses some of the underline symbols for other purposes (like
preformatted code, example blocks, ...), which makes it difficult to do
mass replacements, such as a planned follow-up patch that needs to move
all sections one level down.
- it is difficult to remember which level a given underline symbol (=-~^+)
corresponds to, while counting = signs is easy.
This patch changes all two-level titles to one-level titles in the manual.
The bulk of the change was done with the following Python script, except for
the level 1 titles (-----) as these underlines are also used for literal
code blocks.
This patch only changes the titles, no other changes. In
adding-packages-directory.txt, I did add missing newlines between some
titles and their content.
----------------------------------------------------------------------------
#!/usr/bin/env python
import sys
import mmap
import re
for input in sys.argv[1:]:
f = open(input, 'r+')
f.flush()
s = mmap.mmap(f.fileno(), 0)
# Level 0 (top level): ====================== =
# Level 1: ---------------------- ==
# Level 2: ~~~~~~~~~~~~~~~~~~~~~~ ===
# Level 3: ^^^^^^^^^^^^^^^^^^^^^^ ====
# Level 4 (bottom level): ++++++++++++++++++++++ =====
def replace_title(s, symbol, replacement):
pattern = re.compile(r'(.+\n)\%s{2,}\n' % symbol, re.MULTILINE)
return pattern.sub(r'%s \1' % replacement, s)
new = s
new = replace_title(new, '=', '=')
new = replace_title(new, '+', '=====')
new = replace_title(new, '^', '====')
new = replace_title(new, '~', '===')
#new = replace_title(new, '-', '==')
s.seek(0)
s.write(new)
s.resize(s.tell())
s.close()
f.close()
----------------------------------------------------------------------------
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-02 07:47:30 +02:00
|
|
|
=== Package directory
|
2011-10-10 10:46:39 +02:00
|
|
|
|
|
|
|
First of all, create a directory under the +package+ directory for
|
|
|
|
your software, for example +libfoo+.
|
|
|
|
|
|
|
|
Some packages have been grouped by topic in a sub-directory:
|
2016-09-21 14:34:07 +02:00
|
|
|
+x11r7+, +qt5+ and +gstreamer+. If your package fits in
|
2011-10-10 10:46:39 +02:00
|
|
|
one of these categories, then create your package directory in these.
|
2012-11-27 12:59:17 +01:00
|
|
|
New subdirectories are discouraged, however.
|
2011-10-10 10:46:39 +02:00
|
|
|
|
2015-03-11 09:09:58 +01:00
|
|
|
=== Config files
|
2012-03-18 09:54:02 +01:00
|
|
|
|
2015-03-11 09:09:58 +01:00
|
|
|
For the package to be displayed in the configuration tool, you need to
|
|
|
|
create a Config file in your package directory. There are two types:
|
|
|
|
+Config.in+ and +Config.in.host+.
|
2011-10-10 10:46:39 +02:00
|
|
|
|
2015-03-11 09:09:58 +01:00
|
|
|
==== +Config.in+ file
|
|
|
|
|
|
|
|
For packages used on the target, create a file named +Config.in+. This
|
|
|
|
file will contain the option descriptions related to our +libfoo+ software
|
|
|
|
that will be used and displayed in the configuration tool. It should basically
|
|
|
|
contain:
|
2011-10-10 10:46:39 +02:00
|
|
|
|
|
|
|
---------------------------
|
|
|
|
config BR2_PACKAGE_LIBFOO
|
|
|
|
bool "libfoo"
|
|
|
|
help
|
|
|
|
This is a comment that explains what libfoo is.
|
|
|
|
|
|
|
|
http://foosoftware.org/libfoo/
|
|
|
|
---------------------------
|
|
|
|
|
2014-06-02 18:02:45 +02:00
|
|
|
The +bool+ line, +help+ line and other metadata information about the
|
2011-11-13 09:54:44 +01:00
|
|
|
configuration option must be indented with one tab. The help text
|
2015-05-17 13:38:31 +02:00
|
|
|
itself should be indented with one tab and two spaces, lines should
|
|
|
|
not be longer than 72 columns, and it must mention the upstream URL
|
|
|
|
of the project.
|
2011-11-13 09:54:44 +01:00
|
|
|
|
2016-01-16 23:37:21 +01:00
|
|
|
As a convention specific to Buildroot, the ordering of the attributes
|
|
|
|
is as follows:
|
|
|
|
|
|
|
|
1. The type of option: +bool+, +string+... with the prompt
|
|
|
|
2. If needed, the +default+ value(s)
|
|
|
|
3. Any dependency of the +depends on+ form
|
|
|
|
4. Any dependency of the +select+ form
|
|
|
|
5. The help keyword and help text.
|
|
|
|
|
2016-01-16 23:37:20 +01:00
|
|
|
You can add other sub-options into a +if BR2_PACKAGE_LIBFOO...endif+
|
|
|
|
statement to configure particular things in your software. You can look at
|
|
|
|
examples in other packages. The syntax of the +Config.in+ file is the same
|
|
|
|
as the one for the kernel Kconfig file. The documentation for this syntax is
|
|
|
|
available at http://kernel.org/doc/Documentation/kbuild/kconfig-language.txt[]
|
2011-10-10 10:46:39 +02:00
|
|
|
|
|
|
|
Finally you have to add your new +libfoo/Config.in+ to
|
|
|
|
+package/Config.in+ (or in a category subdirectory if you decided to
|
|
|
|
put your package in one of the existing categories). The files
|
|
|
|
included there are 'sorted alphabetically' per category and are 'NOT'
|
|
|
|
supposed to contain anything but the 'bare' name of the package.
|
|
|
|
|
|
|
|
--------------------------
|
|
|
|
source "package/libfoo/Config.in"
|
|
|
|
--------------------------
|
|
|
|
|
2015-03-11 09:09:58 +01:00
|
|
|
|
|
|
|
==== +Config.in.host+ file
|
|
|
|
|
|
|
|
Some packages also need to be built for the host system. There are two
|
|
|
|
options here:
|
|
|
|
|
|
|
|
* The host package is only required to satisfy build-time
|
|
|
|
dependencies of one or more target packages. In this case, add
|
|
|
|
+host-foo+ to the target package's +BAR_DEPENDENCIES+ variable. No
|
|
|
|
+Config.in.host+ file should be created.
|
|
|
|
|
|
|
|
* The host package should be explicitly selectable by the user from
|
|
|
|
the configuration menu. In this case, create a +Config.in.host+ file
|
|
|
|
for that host package:
|
|
|
|
+
|
|
|
|
---------------------------
|
|
|
|
config BR2_PACKAGE_HOST_FOO
|
|
|
|
bool "host foo"
|
|
|
|
help
|
|
|
|
This is a comment that explains what foo for the host is.
|
|
|
|
|
|
|
|
http://foosoftware.org/foo/
|
|
|
|
---------------------------
|
|
|
|
+
|
|
|
|
The same coding style and options as for the +Config.in+ file are valid.
|
|
|
|
+
|
|
|
|
Finally you have to add your new +libfoo/Config.in.host+ to
|
|
|
|
+package/Config.in.host+. The files included there are 'sorted alphabetically'
|
|
|
|
and are 'NOT' supposed to contain anything but the 'bare' name of the package.
|
|
|
|
+
|
|
|
|
--------------------------
|
|
|
|
source "package/foo/Config.in.host"
|
|
|
|
--------------------------
|
|
|
|
+
|
|
|
|
The host package will then be available from the +Host utilities+ menu.
|
|
|
|
|
2012-11-11 04:14:47 +01:00
|
|
|
[[depends-on-vs-select]]
|
manual: use one-line titles instead of two-line titles (trivial)
Asciidoc supports two syntaxes for section titles: two-line titles (title
plus underline consisting of a particular symbol), and one-line titles
(title prefixed with a specific number of = signs).
The two-line title underlines are:
Level 0 (top level): ======================
Level 1: ----------------------
Level 2: ~~~~~~~~~~~~~~~~~~~~~~
Level 3: ^^^^^^^^^^^^^^^^^^^^^^
Level 4 (bottom level): ++++++++++++++++++++++
and the one-line title prefixes:
= Document Title (level 0) =
== Section title (level 1) ==
=== Section title (level 2) ===
==== Section title (level 3) ====
===== Section title (level 4) =====
The buildroot manual is currenly using the two-line titles, but this has
multiple disadvantages:
- asciidoc also uses some of the underline symbols for other purposes (like
preformatted code, example blocks, ...), which makes it difficult to do
mass replacements, such as a planned follow-up patch that needs to move
all sections one level down.
- it is difficult to remember which level a given underline symbol (=-~^+)
corresponds to, while counting = signs is easy.
This patch changes all two-level titles to one-level titles in the manual.
The bulk of the change was done with the following Python script, except for
the level 1 titles (-----) as these underlines are also used for literal
code blocks.
This patch only changes the titles, no other changes. In
adding-packages-directory.txt, I did add missing newlines between some
titles and their content.
----------------------------------------------------------------------------
#!/usr/bin/env python
import sys
import mmap
import re
for input in sys.argv[1:]:
f = open(input, 'r+')
f.flush()
s = mmap.mmap(f.fileno(), 0)
# Level 0 (top level): ====================== =
# Level 1: ---------------------- ==
# Level 2: ~~~~~~~~~~~~~~~~~~~~~~ ===
# Level 3: ^^^^^^^^^^^^^^^^^^^^^^ ====
# Level 4 (bottom level): ++++++++++++++++++++++ =====
def replace_title(s, symbol, replacement):
pattern = re.compile(r'(.+\n)\%s{2,}\n' % symbol, re.MULTILINE)
return pattern.sub(r'%s \1' % replacement, s)
new = s
new = replace_title(new, '=', '=')
new = replace_title(new, '+', '=====')
new = replace_title(new, '^', '====')
new = replace_title(new, '~', '===')
#new = replace_title(new, '-', '==')
s.seek(0)
s.write(new)
s.resize(s.tell())
s.close()
f.close()
----------------------------------------------------------------------------
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-02 07:47:30 +02:00
|
|
|
==== Choosing +depends on+ or +select+
|
2012-11-27 12:59:20 +01:00
|
|
|
|
2011-11-13 09:54:45 +01:00
|
|
|
The +Config.in+ file of your package must also ensure that
|
|
|
|
dependencies are enabled. Typically, Buildroot uses the following
|
|
|
|
rules:
|
|
|
|
|
|
|
|
* Use a +select+ type of dependency for dependencies on
|
|
|
|
libraries. These dependencies are generally not obvious and it
|
|
|
|
therefore make sense to have the kconfig system ensure that the
|
|
|
|
dependencies are selected. For example, the _libgtk2_ package uses
|
|
|
|
+select BR2_PACKAGE_LIBGLIB2+ to make sure this library is also
|
|
|
|
enabled.
|
2013-09-18 11:01:34 +02:00
|
|
|
The +select+ keyword expresses the dependency with a backward
|
2012-11-11 04:14:47 +01:00
|
|
|
semantic.
|
2011-11-13 09:54:45 +01:00
|
|
|
|
|
|
|
* Use a +depends on+ type of dependency when the user really needs to
|
|
|
|
be aware of the dependency. Typically, Buildroot uses this type of
|
2013-10-13 16:55:31 +02:00
|
|
|
dependency for dependencies on target architecture, MMU support and
|
|
|
|
toolchain options (see xref:dependencies-target-toolchain-options[]),
|
|
|
|
or for dependencies on "big" things, such as the X.org system.
|
2013-09-18 11:01:34 +02:00
|
|
|
The +depends on+ keyword expresses the dependency with a forward
|
2012-11-11 04:14:47 +01:00
|
|
|
semantic.
|
|
|
|
|
|
|
|
.Note
|
|
|
|
The current problem with the _kconfig_ language is that these two
|
|
|
|
dependency semantics are not internally linked. Therefore, it may be
|
|
|
|
possible to select a package, whom one of its dependencies/requirement
|
|
|
|
is not met.
|
2011-11-13 09:54:45 +01:00
|
|
|
|
|
|
|
An example illustrates both the usage of +select+ and +depends on+.
|
|
|
|
|
|
|
|
--------------------------
|
2015-03-30 23:07:31 +02:00
|
|
|
config BR2_PACKAGE_RRDTOOL
|
|
|
|
bool "rrdtool"
|
|
|
|
depends on BR2_USE_WCHAR
|
|
|
|
select BR2_PACKAGE_FREETYPE
|
|
|
|
select BR2_PACKAGE_LIBART
|
|
|
|
select BR2_PACKAGE_LIBPNG
|
|
|
|
select BR2_PACKAGE_ZLIB
|
2011-11-13 09:54:45 +01:00
|
|
|
help
|
2015-03-30 23:07:31 +02:00
|
|
|
RRDtool is the OpenSource industry standard, high performance
|
|
|
|
data logging and graphing system for time series data.
|
2011-11-13 09:54:45 +01:00
|
|
|
|
2015-03-30 23:07:31 +02:00
|
|
|
http://oss.oetiker.ch/rrdtool/
|
2011-11-13 09:54:45 +01:00
|
|
|
|
2015-03-30 23:07:31 +02:00
|
|
|
comment "rrdtool needs a toolchain w/ wchar"
|
|
|
|
depends on !BR2_USE_WCHAR
|
2011-11-13 09:54:45 +01:00
|
|
|
--------------------------
|
|
|
|
|
|
|
|
|
2012-03-18 09:54:03 +01:00
|
|
|
Note that these two dependency types are only transitive with the
|
|
|
|
dependencies of the same kind.
|
|
|
|
|
|
|
|
This means, in the following example:
|
|
|
|
|
|
|
|
--------------------------
|
|
|
|
config BR2_PACKAGE_A
|
|
|
|
bool "Package A"
|
|
|
|
|
|
|
|
config BR2_PACKAGE_B
|
|
|
|
bool "Package B"
|
|
|
|
depends on BR2_PACKAGE_A
|
|
|
|
|
|
|
|
config BR2_PACKAGE_C
|
|
|
|
bool "Package C"
|
|
|
|
depends on BR2_PACKAGE_B
|
|
|
|
|
|
|
|
config BR2_PACKAGE_D
|
|
|
|
bool "Package D"
|
|
|
|
select BR2_PACKAGE_B
|
|
|
|
|
|
|
|
config BR2_PACKAGE_E
|
|
|
|
bool "Package E"
|
|
|
|
select BR2_PACKAGE_D
|
|
|
|
--------------------------
|
|
|
|
|
|
|
|
* Selecting +Package C+ will be visible if +Package B+ has been
|
|
|
|
selected, which in turn is only visible if +Package A+ has been
|
|
|
|
selected.
|
|
|
|
|
|
|
|
* Selecting +Package E+ will select +Package D+, which will select
|
|
|
|
+Package B+, it will not check for the dependencies of +Package B+,
|
|
|
|
so it will not select +Package A+.
|
|
|
|
|
|
|
|
* Since +Package B+ is selected but +Package A+ is not, this violates
|
2014-12-19 08:12:33 +01:00
|
|
|
the dependency of +Package B+ on +Package A+. Therefore, in such a
|
2012-03-18 09:54:03 +01:00
|
|
|
situation, the transitive dependency has to be added explicitly:
|
|
|
|
|
|
|
|
--------------------------
|
|
|
|
config BR2_PACKAGE_D
|
|
|
|
bool "Package D"
|
|
|
|
select BR2_PACKAGE_B
|
|
|
|
depends on BR2_PACKAGE_A
|
|
|
|
|
|
|
|
config BR2_PACKAGE_E
|
|
|
|
bool "Package E"
|
|
|
|
select BR2_PACKAGE_D
|
|
|
|
depends on BR2_PACKAGE_A
|
|
|
|
--------------------------
|
|
|
|
|
|
|
|
Overall, for package library dependencies, +select+ should be
|
|
|
|
preferred.
|
|
|
|
|
2012-11-16 05:54:19 +01:00
|
|
|
Note that such dependencies will ensure that the dependency option
|
2011-11-13 09:54:45 +01:00
|
|
|
is also enabled, but not necessarily built before your package. To do
|
|
|
|
so, the dependency also needs to be expressed in the +.mk+ file of the
|
|
|
|
package.
|
|
|
|
|
2012-11-16 05:54:19 +01:00
|
|
|
Further formatting details: see xref:writing-rules-config-in[the
|
2012-11-27 12:59:17 +01:00
|
|
|
coding style].
|
2012-11-11 04:14:47 +01:00
|
|
|
|
2013-10-13 16:55:31 +02:00
|
|
|
[[dependencies-target-toolchain-options]]
|
manual: use one-line titles instead of two-line titles (trivial)
Asciidoc supports two syntaxes for section titles: two-line titles (title
plus underline consisting of a particular symbol), and one-line titles
(title prefixed with a specific number of = signs).
The two-line title underlines are:
Level 0 (top level): ======================
Level 1: ----------------------
Level 2: ~~~~~~~~~~~~~~~~~~~~~~
Level 3: ^^^^^^^^^^^^^^^^^^^^^^
Level 4 (bottom level): ++++++++++++++++++++++
and the one-line title prefixes:
= Document Title (level 0) =
== Section title (level 1) ==
=== Section title (level 2) ===
==== Section title (level 3) ====
===== Section title (level 4) =====
The buildroot manual is currenly using the two-line titles, but this has
multiple disadvantages:
- asciidoc also uses some of the underline symbols for other purposes (like
preformatted code, example blocks, ...), which makes it difficult to do
mass replacements, such as a planned follow-up patch that needs to move
all sections one level down.
- it is difficult to remember which level a given underline symbol (=-~^+)
corresponds to, while counting = signs is easy.
This patch changes all two-level titles to one-level titles in the manual.
The bulk of the change was done with the following Python script, except for
the level 1 titles (-----) as these underlines are also used for literal
code blocks.
This patch only changes the titles, no other changes. In
adding-packages-directory.txt, I did add missing newlines between some
titles and their content.
----------------------------------------------------------------------------
#!/usr/bin/env python
import sys
import mmap
import re
for input in sys.argv[1:]:
f = open(input, 'r+')
f.flush()
s = mmap.mmap(f.fileno(), 0)
# Level 0 (top level): ====================== =
# Level 1: ---------------------- ==
# Level 2: ~~~~~~~~~~~~~~~~~~~~~~ ===
# Level 3: ^^^^^^^^^^^^^^^^^^^^^^ ====
# Level 4 (bottom level): ++++++++++++++++++++++ =====
def replace_title(s, symbol, replacement):
pattern = re.compile(r'(.+\n)\%s{2,}\n' % symbol, re.MULTILINE)
return pattern.sub(r'%s \1' % replacement, s)
new = s
new = replace_title(new, '=', '=')
new = replace_title(new, '+', '=====')
new = replace_title(new, '^', '====')
new = replace_title(new, '~', '===')
#new = replace_title(new, '-', '==')
s.seek(0)
s.write(new)
s.resize(s.tell())
s.close()
f.close()
----------------------------------------------------------------------------
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-02 07:47:30 +02:00
|
|
|
==== Dependencies on target and toolchain options
|
|
|
|
|
2013-10-13 16:55:31 +02:00
|
|
|
Many packages depend on certain options of the toolchain: the choice of
|
2015-04-19 14:39:58 +02:00
|
|
|
C library, C++ support, thread support, RPC support, wchar support,
|
|
|
|
or dynamic library support. Some packages can only be built on certain
|
|
|
|
target architectures, or if an MMU is available in the processor.
|
2013-11-07 09:24:36 +01:00
|
|
|
|
|
|
|
These dependencies have to be expressed with the appropriate 'depends
|
|
|
|
on' statements in the Config.in file. Additionally, for dependencies on
|
2013-10-13 16:55:31 +02:00
|
|
|
toolchain options, a +comment+ should be displayed when the option is
|
|
|
|
not enabled, so that the user knows why the package is not available.
|
|
|
|
Dependencies on target architecture or MMU support should not be
|
|
|
|
made visible in a comment: since it is unlikely that the user can
|
|
|
|
freely choose another target, it makes little sense to show these
|
|
|
|
dependencies explicitly.
|
|
|
|
|
2013-11-07 09:24:36 +01:00
|
|
|
The +comment+ should only be visible if the +config+ option itself would
|
|
|
|
be visible when the toolchain option dependencies are met. This means
|
|
|
|
that all other dependencies of the package (including dependencies on
|
|
|
|
target architecture and MMU support) have to be repeated on the
|
|
|
|
+comment+ definition. To keep it clear, the +depends on+ statement for
|
|
|
|
these non-toolchain option should be kept separate from the +depends on+
|
|
|
|
statement for the toolchain options.
|
|
|
|
If there is a dependency on a config option in that same file (typically
|
|
|
|
the main package) it is preferable to have a global +if ... endif+
|
|
|
|
construct rather than repeating the +depends on+ statement on the
|
|
|
|
comment and other config options.
|
|
|
|
|
2013-10-13 16:55:31 +02:00
|
|
|
The general format of a dependency +comment+ for package foo is:
|
2014-11-15 17:29:21 +01:00
|
|
|
|
2013-10-13 16:55:31 +02:00
|
|
|
--------------------------
|
|
|
|
foo needs a toolchain w/ featA, featB, featC
|
|
|
|
--------------------------
|
|
|
|
|
|
|
|
for example:
|
2014-11-15 17:29:21 +01:00
|
|
|
|
2013-10-13 16:55:31 +02:00
|
|
|
--------------------------
|
2015-03-30 23:07:31 +02:00
|
|
|
mpd needs a toolchain w/ C++, threads, wchar
|
2013-10-13 16:55:31 +02:00
|
|
|
--------------------------
|
2014-11-15 17:29:21 +01:00
|
|
|
|
2014-03-28 19:48:34 +01:00
|
|
|
or
|
2014-11-15 17:29:21 +01:00
|
|
|
|
2014-03-28 19:48:34 +01:00
|
|
|
--------------------------
|
|
|
|
crda needs a toolchain w/ threads
|
|
|
|
--------------------------
|
2013-10-13 16:55:31 +02:00
|
|
|
|
|
|
|
Note that this text is kept brief on purpose, so that it will fit on a
|
|
|
|
80-character terminal.
|
|
|
|
|
|
|
|
The rest of this section enumerates the different target and toolchain
|
|
|
|
options, the corresponding config symbols to depend on, and the text to
|
|
|
|
use in the comment.
|
|
|
|
|
|
|
|
* Target architecture
|
|
|
|
** Dependency symbol: +BR2_powerpc+, +BR2_mips+, ... (see +arch/Config.in+)
|
|
|
|
** Comment string: no comment to be added
|
|
|
|
|
|
|
|
* MMU support
|
|
|
|
** Dependency symbol: +BR2_USE_MMU+
|
|
|
|
** Comment string: no comment to be added
|
|
|
|
|
2016-02-02 16:31:21 +01:00
|
|
|
* Gcc +__sync_*+ built-ins used for atomic operations. They are
|
|
|
|
available in variants operating on 1 byte, 2 bytes, 4 bytes and 8
|
|
|
|
bytes. Since different architectures support atomic operations on
|
|
|
|
different sizes, one dependency symbol is available for each size:
|
|
|
|
** Dependency symbol: +BR2_TOOLCHAIN_HAS_SYNC_1+ for 1 byte,
|
|
|
|
+BR2_TOOLCHAIN_HAS_SYNC_2+ for 2 bytes,
|
|
|
|
+BR2_TOOLCHAIN_HAS_SYNC_4+ for 4 bytes, +BR2_TOOLCHAIN_HAS_SYNC_8+
|
|
|
|
for 8 bytes.
|
|
|
|
** Comment string: no comment to be added
|
|
|
|
|
|
|
|
* Gcc +__atomic_*+ built-ins used for atomic operations.
|
|
|
|
** Dependency symbol: +BR2_TOOLCHAIN_HAS_ATOMIC+.
|
|
|
|
** Comment string: no comment to be added
|
|
|
|
|
2014-03-01 15:53:03 +01:00
|
|
|
* Kernel headers
|
|
|
|
** Dependency symbol: +BR2_TOOLCHAIN_HEADERS_AT_LEAST_X_Y+, (replace
|
|
|
|
+X_Y+ with the proper version, see +toolchain/toolchain-common.in+)
|
2014-07-25 23:28:14 +02:00
|
|
|
** Comment string: +headers >= X.Y+ and/or `headers <= X.Y` (replace
|
|
|
|
+X.Y+ with the proper version)
|
2014-03-01 15:53:03 +01:00
|
|
|
|
2015-08-04 20:00:36 +02:00
|
|
|
* GCC version
|
|
|
|
** Dependency symbol: +BR2_TOOLCHAIN_GCC_AT_LEAST_X_Y+, (replace
|
|
|
|
+X_Y+ with the proper version, see +toolchain/toolchain-common.in+)
|
|
|
|
** Comment string: +gcc >= X.Y+ and/or `gcc <= X.Y` (replace
|
|
|
|
+X.Y+ with the proper version)
|
|
|
|
|
2015-12-31 01:34:13 +01:00
|
|
|
* Host GCC version
|
|
|
|
** Dependency symbol: +BR2_HOST_GCC_AT_LEAST_X_Y+, (replace
|
|
|
|
+X_Y+ with the proper version, see +Config.in+)
|
|
|
|
** Comment string: no comment to be added
|
|
|
|
** Note that it is usually not the package itself that has a minimum
|
|
|
|
host GCC version, but rather a host-package on which it depends.
|
|
|
|
|
2013-10-13 16:55:31 +02:00
|
|
|
* C library
|
|
|
|
** Dependency symbol: +BR2_TOOLCHAIN_USES_GLIBC+,
|
2014-09-28 18:26:27 +02:00
|
|
|
+BR2_TOOLCHAIN_USES_MUSL+, +BR2_TOOLCHAIN_USES_UCLIBC+
|
2013-10-13 16:55:31 +02:00
|
|
|
** Comment string: for the C library, a slightly different comment text
|
2016-06-08 23:40:54 +02:00
|
|
|
is used: +foo needs a glibc toolchain+, or `foo needs a glibc
|
2014-05-02 12:49:28 +02:00
|
|
|
toolchain w/ C++`
|
2013-10-13 16:55:31 +02:00
|
|
|
|
|
|
|
* C++ support
|
|
|
|
** Dependency symbol: +BR2_INSTALL_LIBSTDCPP+
|
|
|
|
** Comment string: `C++`
|
|
|
|
|
2016-07-03 15:47:41 +02:00
|
|
|
* Fortran support
|
|
|
|
** Dependency symbol: +BR2_TOOLCHAIN_HAS_FORTRAN+
|
|
|
|
** Comment string: `fortran`
|
|
|
|
|
2013-10-13 16:55:31 +02:00
|
|
|
* thread support
|
|
|
|
** Dependency symbol: +BR2_TOOLCHAIN_HAS_THREADS+
|
2014-02-18 22:09:00 +01:00
|
|
|
** Comment string: +threads+ (unless +BR2_TOOLCHAIN_HAS_THREADS_NPTL+
|
|
|
|
is also needed, in which case, specifying only +NPTL+ is sufficient)
|
|
|
|
|
|
|
|
* NPTL thread support
|
|
|
|
** Dependency symbol: +BR2_TOOLCHAIN_HAS_THREADS_NPTL+
|
|
|
|
** Comment string: +NPTL+
|
2013-10-13 16:55:31 +02:00
|
|
|
|
|
|
|
* RPC support
|
|
|
|
** Dependency symbol: +BR2_TOOLCHAIN_HAS_NATIVE_RPC+
|
|
|
|
** Comment string: +RPC+
|
|
|
|
|
|
|
|
* wchar support
|
|
|
|
** Dependency symbol: +BR2_USE_WCHAR+
|
|
|
|
** Comment string: +wchar+
|
|
|
|
|
|
|
|
* dynamic library
|
2014-12-03 22:41:29 +01:00
|
|
|
** Dependency symbol: +!BR2_STATIC_LIBS+
|
2013-10-13 16:55:31 +02:00
|
|
|
** Comment string: +dynamic library+
|
|
|
|
|
manual: use one-line titles instead of two-line titles (trivial)
Asciidoc supports two syntaxes for section titles: two-line titles (title
plus underline consisting of a particular symbol), and one-line titles
(title prefixed with a specific number of = signs).
The two-line title underlines are:
Level 0 (top level): ======================
Level 1: ----------------------
Level 2: ~~~~~~~~~~~~~~~~~~~~~~
Level 3: ^^^^^^^^^^^^^^^^^^^^^^
Level 4 (bottom level): ++++++++++++++++++++++
and the one-line title prefixes:
= Document Title (level 0) =
== Section title (level 1) ==
=== Section title (level 2) ===
==== Section title (level 3) ====
===== Section title (level 4) =====
The buildroot manual is currenly using the two-line titles, but this has
multiple disadvantages:
- asciidoc also uses some of the underline symbols for other purposes (like
preformatted code, example blocks, ...), which makes it difficult to do
mass replacements, such as a planned follow-up patch that needs to move
all sections one level down.
- it is difficult to remember which level a given underline symbol (=-~^+)
corresponds to, while counting = signs is easy.
This patch changes all two-level titles to one-level titles in the manual.
The bulk of the change was done with the following Python script, except for
the level 1 titles (-----) as these underlines are also used for literal
code blocks.
This patch only changes the titles, no other changes. In
adding-packages-directory.txt, I did add missing newlines between some
titles and their content.
----------------------------------------------------------------------------
#!/usr/bin/env python
import sys
import mmap
import re
for input in sys.argv[1:]:
f = open(input, 'r+')
f.flush()
s = mmap.mmap(f.fileno(), 0)
# Level 0 (top level): ====================== =
# Level 1: ---------------------- ==
# Level 2: ~~~~~~~~~~~~~~~~~~~~~~ ===
# Level 3: ^^^^^^^^^^^^^^^^^^^^^^ ====
# Level 4 (bottom level): ++++++++++++++++++++++ =====
def replace_title(s, symbol, replacement):
pattern = re.compile(r'(.+\n)\%s{2,}\n' % symbol, re.MULTILINE)
return pattern.sub(r'%s \1' % replacement, s)
new = s
new = replace_title(new, '=', '=')
new = replace_title(new, '+', '=====')
new = replace_title(new, '^', '====')
new = replace_title(new, '~', '===')
#new = replace_title(new, '-', '==')
s.seek(0)
s.write(new)
s.resize(s.tell())
s.close()
f.close()
----------------------------------------------------------------------------
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-02 07:47:30 +02:00
|
|
|
==== Dependencies on a Linux kernel built by buildroot
|
|
|
|
|
2013-12-15 13:20:40 +01:00
|
|
|
Some packages need a Linux kernel to be built by buildroot. These are
|
|
|
|
typically kernel modules or firmware. A comment should be added in the
|
|
|
|
Config.in file to express this dependency, similar to dependencies on
|
|
|
|
toolchain options. The general format is:
|
|
|
|
|
|
|
|
--------------------------
|
|
|
|
foo needs a Linux kernel to be built
|
|
|
|
--------------------------
|
|
|
|
|
|
|
|
If there is a dependency on both toolchain options and the Linux
|
|
|
|
kernel, use this format:
|
2014-11-15 17:29:21 +01:00
|
|
|
|
2013-12-15 13:20:40 +01:00
|
|
|
--------------------------
|
|
|
|
foo needs a toolchain w/ featA, featB, featC and a Linux kernel to be built
|
|
|
|
--------------------------
|
2013-10-13 16:55:31 +02:00
|
|
|
|
manual: use one-line titles instead of two-line titles (trivial)
Asciidoc supports two syntaxes for section titles: two-line titles (title
plus underline consisting of a particular symbol), and one-line titles
(title prefixed with a specific number of = signs).
The two-line title underlines are:
Level 0 (top level): ======================
Level 1: ----------------------
Level 2: ~~~~~~~~~~~~~~~~~~~~~~
Level 3: ^^^^^^^^^^^^^^^^^^^^^^
Level 4 (bottom level): ++++++++++++++++++++++
and the one-line title prefixes:
= Document Title (level 0) =
== Section title (level 1) ==
=== Section title (level 2) ===
==== Section title (level 3) ====
===== Section title (level 4) =====
The buildroot manual is currenly using the two-line titles, but this has
multiple disadvantages:
- asciidoc also uses some of the underline symbols for other purposes (like
preformatted code, example blocks, ...), which makes it difficult to do
mass replacements, such as a planned follow-up patch that needs to move
all sections one level down.
- it is difficult to remember which level a given underline symbol (=-~^+)
corresponds to, while counting = signs is easy.
This patch changes all two-level titles to one-level titles in the manual.
The bulk of the change was done with the following Python script, except for
the level 1 titles (-----) as these underlines are also used for literal
code blocks.
This patch only changes the titles, no other changes. In
adding-packages-directory.txt, I did add missing newlines between some
titles and their content.
----------------------------------------------------------------------------
#!/usr/bin/env python
import sys
import mmap
import re
for input in sys.argv[1:]:
f = open(input, 'r+')
f.flush()
s = mmap.mmap(f.fileno(), 0)
# Level 0 (top level): ====================== =
# Level 1: ---------------------- ==
# Level 2: ~~~~~~~~~~~~~~~~~~~~~~ ===
# Level 3: ^^^^^^^^^^^^^^^^^^^^^^ ====
# Level 4 (bottom level): ++++++++++++++++++++++ =====
def replace_title(s, symbol, replacement):
pattern = re.compile(r'(.+\n)\%s{2,}\n' % symbol, re.MULTILINE)
return pattern.sub(r'%s \1' % replacement, s)
new = s
new = replace_title(new, '=', '=')
new = replace_title(new, '+', '=====')
new = replace_title(new, '^', '====')
new = replace_title(new, '~', '===')
#new = replace_title(new, '-', '==')
s.seek(0)
s.write(new)
s.resize(s.tell())
s.close()
f.close()
----------------------------------------------------------------------------
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-02 07:47:30 +02:00
|
|
|
==== Dependencies on udev /dev management
|
|
|
|
|
2013-12-19 21:13:02 +01:00
|
|
|
If a package needs udev /dev management, it should depend on symbol
|
2014-02-07 14:21:33 +01:00
|
|
|
+BR2_PACKAGE_HAS_UDEV+, and the following comment should be added:
|
2013-12-19 21:13:02 +01:00
|
|
|
|
|
|
|
--------------------------
|
|
|
|
foo needs udev /dev management
|
|
|
|
--------------------------
|
|
|
|
|
|
|
|
If there is a dependency on both toolchain options and udev /dev
|
|
|
|
management, use this format:
|
|
|
|
|
|
|
|
--------------------------
|
|
|
|
foo needs udev /dev management and a toolchain w/ featA, featB, featC
|
|
|
|
--------------------------
|
|
|
|
|
2014-06-08 16:15:17 +02:00
|
|
|
==== Dependencies on features provided by virtual packages
|
|
|
|
|
|
|
|
Some features can be provided by more than one package, such as the
|
|
|
|
openGL libraries.
|
|
|
|
|
|
|
|
See xref:virtual-package-tutorial[] for more on the virtual packages.
|
|
|
|
|
|
|
|
See xref:virtual-package-list[] for the symbols to depend on if your package
|
|
|
|
depends on a feature provided by a virtual package.
|
|
|
|
|
manual: use one-line titles instead of two-line titles (trivial)
Asciidoc supports two syntaxes for section titles: two-line titles (title
plus underline consisting of a particular symbol), and one-line titles
(title prefixed with a specific number of = signs).
The two-line title underlines are:
Level 0 (top level): ======================
Level 1: ----------------------
Level 2: ~~~~~~~~~~~~~~~~~~~~~~
Level 3: ^^^^^^^^^^^^^^^^^^^^^^
Level 4 (bottom level): ++++++++++++++++++++++
and the one-line title prefixes:
= Document Title (level 0) =
== Section title (level 1) ==
=== Section title (level 2) ===
==== Section title (level 3) ====
===== Section title (level 4) =====
The buildroot manual is currenly using the two-line titles, but this has
multiple disadvantages:
- asciidoc also uses some of the underline symbols for other purposes (like
preformatted code, example blocks, ...), which makes it difficult to do
mass replacements, such as a planned follow-up patch that needs to move
all sections one level down.
- it is difficult to remember which level a given underline symbol (=-~^+)
corresponds to, while counting = signs is easy.
This patch changes all two-level titles to one-level titles in the manual.
The bulk of the change was done with the following Python script, except for
the level 1 titles (-----) as these underlines are also used for literal
code blocks.
This patch only changes the titles, no other changes. In
adding-packages-directory.txt, I did add missing newlines between some
titles and their content.
----------------------------------------------------------------------------
#!/usr/bin/env python
import sys
import mmap
import re
for input in sys.argv[1:]:
f = open(input, 'r+')
f.flush()
s = mmap.mmap(f.fileno(), 0)
# Level 0 (top level): ====================== =
# Level 1: ---------------------- ==
# Level 2: ~~~~~~~~~~~~~~~~~~~~~~ ===
# Level 3: ^^^^^^^^^^^^^^^^^^^^^^ ====
# Level 4 (bottom level): ++++++++++++++++++++++ =====
def replace_title(s, symbol, replacement):
pattern = re.compile(r'(.+\n)\%s{2,}\n' % symbol, re.MULTILINE)
return pattern.sub(r'%s \1' % replacement, s)
new = s
new = replace_title(new, '=', '=')
new = replace_title(new, '+', '=====')
new = replace_title(new, '^', '====')
new = replace_title(new, '~', '===')
#new = replace_title(new, '-', '==')
s.seek(0)
s.write(new)
s.resize(s.tell())
s.close()
f.close()
----------------------------------------------------------------------------
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-02 07:47:30 +02:00
|
|
|
=== The +.mk+ file
|
|
|
|
|
2013-02-05 08:15:59 +01:00
|
|
|
[[adding-packages-mk]]
|
2011-10-10 10:46:39 +02:00
|
|
|
|
|
|
|
Finally, here's the hardest part. Create a file named +libfoo.mk+. It
|
|
|
|
describes how the package should be downloaded, configured, built,
|
|
|
|
installed, etc.
|
|
|
|
|
|
|
|
Depending on the package type, the +.mk+ file must be written in a
|
|
|
|
different way, using different infrastructures:
|
|
|
|
|
2011-11-13 09:54:46 +01:00
|
|
|
* *Makefiles for generic packages* (not using autotools or CMake):
|
|
|
|
These are based on an infrastructure similar to the one used for
|
2012-11-16 05:54:19 +01:00
|
|
|
autotools-based packages, but require a little more work from the
|
2011-10-10 10:46:39 +02:00
|
|
|
developer. They specify what should be done for the configuration,
|
2013-12-07 10:16:47 +01:00
|
|
|
compilation and installation of the package. This
|
2011-10-10 10:46:39 +02:00
|
|
|
infrastructure must be used for all packages that do not use the
|
|
|
|
autotools as their build system. In the future, other specialized
|
2014-12-19 08:12:33 +01:00
|
|
|
infrastructures might be written for other build systems. We cover
|
2012-07-06 00:06:46 +02:00
|
|
|
them through in a xref:generic-package-tutorial[tutorial] and a
|
|
|
|
xref:generic-package-reference[reference].
|
2011-10-10 10:46:39 +02:00
|
|
|
|
|
|
|
* *Makefiles for autotools-based software* (autoconf, automake, etc.):
|
|
|
|
We provide a dedicated infrastructure for such packages, since
|
|
|
|
autotools is a very common build system. This infrastructure 'must'
|
|
|
|
be used for new packages that rely on the autotools as their build
|
2012-07-06 00:06:46 +02:00
|
|
|
system. We cover them through a xref:autotools-package-tutorial[tutorial]
|
|
|
|
and xref:autotools-package-reference[reference].
|
2011-10-10 10:46:39 +02:00
|
|
|
|
2011-11-13 09:54:46 +01:00
|
|
|
* *Makefiles for cmake-based software*: We provide a dedicated
|
|
|
|
infrastructure for such packages, as CMake is a more and more
|
|
|
|
commonly used build system and has a standardized behaviour. This
|
|
|
|
infrastructure 'must' be used for new packages that rely on
|
2012-07-06 00:06:46 +02:00
|
|
|
CMake. We cover them through a xref:cmake-package-tutorial[tutorial]
|
|
|
|
and xref:cmake-package-reference[reference].
|
2011-11-13 09:54:46 +01:00
|
|
|
|
2014-02-23 16:04:30 +01:00
|
|
|
* *Makefiles for Python modules*: We have a dedicated infrastructure
|
|
|
|
for Python modules that use either the +distutils+ or the
|
|
|
|
+setuptools+ mechanism. We cover them through a
|
|
|
|
xref:python-package-tutorial[tutorial] and a
|
|
|
|
xref:python-package-reference[reference].
|
|
|
|
|
|
|
|
* *Makefiles for Lua modules*: We have a dedicated infrastructure for
|
|
|
|
Lua modules available through the LuaRocks web site. We cover them
|
|
|
|
through a xref:luarocks-package-tutorial[tutorial] and a
|
|
|
|
xref:luarocks-package-reference[reference].
|
|
|
|
|
2013-09-25 10:56:34 +02:00
|
|
|
Further formatting details: see xref:writing-rules-mk[the writing
|
2012-11-11 04:14:47 +01:00
|
|
|
rules].
|
2014-07-03 21:36:22 +02:00
|
|
|
|
|
|
|
[[adding-packages-hash]]
|
|
|
|
=== The +.hash+ file
|
|
|
|
|
|
|
|
Optionally, you can add a third file, named +libfoo.hash+, that contains
|
|
|
|
the hashes of the downloaded files for the +libfoo+ package.
|
|
|
|
|
|
|
|
The hashes stored in that file are used to validate the integrity of the
|
|
|
|
downloaded files.
|
|
|
|
|
|
|
|
The format of this file is one line for each file for which to check the
|
|
|
|
hash, each line being space-separated, with these three fields:
|
|
|
|
|
|
|
|
* the type of hash, one of:
|
2015-05-03 17:37:39 +02:00
|
|
|
** +md5+, +sha1+, +sha224+, +sha256+, +sha384+, +sha512+, +none+
|
2014-07-03 21:36:22 +02:00
|
|
|
* the hash of the file:
|
support/download: add explicit no-hash support
Add support to explicitly state that an archive has no hash.
This can be used for archives downloaded from a repository, like a
git-clone or a subversion checkout, or using the github helper.
This will come in handy when we'll eventually make hashes mandatory as
soon as a .hash file exists: for some packages, like gcc, some versions
are downloaded as archives from upstream, while other versions may come
from a GitHub repository (via the github herlper).
In this case, a .hash file would exist, that contains hashes for the
downloaded tarballs, but archives downloaded from the repository would
not have a hash (since it is currently not possible to have reproducible
such archives). So, we'd need a way to explicitly state there is no
hash, on purpose, for those archives.
So, add 'none' as a new type of hash.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-04-01 00:15:03 +02:00
|
|
|
** for +none+, one or more non-space chars, usually just the string +xxx+
|
2015-05-03 17:37:39 +02:00
|
|
|
** for +md5+, 32 hexadecimal characters
|
2014-07-03 21:36:22 +02:00
|
|
|
** for +sha1+, 40 hexadecimal characters
|
|
|
|
** for +sha224+, 56 hexadecimal characters
|
|
|
|
** for +sha256+, 64 hexadecimal characters
|
|
|
|
** for +sha384+, 96 hexadecimal characters
|
|
|
|
** for +sha512+, 128 hexadecimal characters
|
|
|
|
* the name of the file, without any directory component
|
|
|
|
|
|
|
|
Lines starting with a +#+ sign are considered comments, and ignored. Empty
|
|
|
|
lines are ignored.
|
|
|
|
|
|
|
|
There can be more than one hash for a single file, each on its own line. In
|
|
|
|
this case, all hashes must match.
|
|
|
|
|
2015-05-03 17:37:39 +02:00
|
|
|
.Note
|
2014-07-03 21:36:22 +02:00
|
|
|
Ideally, the hashes stored in this file should match the hashes published by
|
|
|
|
upstream, e.g. on their website, in the e-mail announcement... If upstream
|
2015-05-03 17:37:39 +02:00
|
|
|
provides more than one type of hash (e.g. +sha1+ and +sha512+), then it is
|
2014-07-03 21:36:22 +02:00
|
|
|
best to add all those hashes in the +.hash+ file. If upstream does not
|
2015-05-03 17:37:39 +02:00
|
|
|
provide any hash, or only provides an +md5+ hash, then compute at least one
|
|
|
|
strong hash yourself (preferably +sha256+, but not +md5+), and mention
|
|
|
|
this in a comment line above the hashes.
|
2014-07-03 21:36:22 +02:00
|
|
|
|
2015-05-03 17:37:39 +02:00
|
|
|
.Note
|
|
|
|
The number of spaces does not matter, so one can use spaces (or tabs) to
|
2014-07-03 21:36:22 +02:00
|
|
|
properly align the different fields.
|
|
|
|
|
support/download: add explicit no-hash support
Add support to explicitly state that an archive has no hash.
This can be used for archives downloaded from a repository, like a
git-clone or a subversion checkout, or using the github helper.
This will come in handy when we'll eventually make hashes mandatory as
soon as a .hash file exists: for some packages, like gcc, some versions
are downloaded as archives from upstream, while other versions may come
from a GitHub repository (via the github herlper).
In this case, a .hash file would exist, that contains hashes for the
downloaded tarballs, but archives downloaded from the repository would
not have a hash (since it is currently not possible to have reproducible
such archives). So, we'd need a way to explicitly state there is no
hash, on purpose, for those archives.
So, add 'none' as a new type of hash.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-04-01 00:15:03 +02:00
|
|
|
The +none+ hash type is reserved to those archives downloaded from a
|
2015-10-18 17:26:14 +02:00
|
|
|
repository, like a 'git clone', a 'subversion checkout'...
|
support/download: add explicit no-hash support
Add support to explicitly state that an archive has no hash.
This can be used for archives downloaded from a repository, like a
git-clone or a subversion checkout, or using the github helper.
This will come in handy when we'll eventually make hashes mandatory as
soon as a .hash file exists: for some packages, like gcc, some versions
are downloaded as archives from upstream, while other versions may come
from a GitHub repository (via the github herlper).
In this case, a .hash file would exist, that contains hashes for the
downloaded tarballs, but archives downloaded from the repository would
not have a hash (since it is currently not possible to have reproducible
such archives). So, we'd need a way to explicitly state there is no
hash, on purpose, for those archives.
So, add 'none' as a new type of hash.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-04-01 00:15:03 +02:00
|
|
|
|
2014-07-03 21:36:22 +02:00
|
|
|
The example below defines a +sha1+ and a +sha256+ published by upstream for
|
2015-05-03 17:37:39 +02:00
|
|
|
the main +libfoo-1.2.3.tar.bz2+ tarball, an +md5+ from upstream and a
|
|
|
|
locally-computed +sha256+ hashes for a binary blob, a +sha256+ for a
|
|
|
|
downloaded patch, and an archive with no hash:
|
2014-07-03 21:36:22 +02:00
|
|
|
|
|
|
|
----
|
|
|
|
# Hashes from: http://www.foosoftware.org/download/libfoo-1.2.3.tar.bz2.{sha1,sha256}:
|
|
|
|
sha1 486fb55c3efa71148fe07895fd713ea3a5ae343a libfoo-1.2.3.tar.bz2
|
|
|
|
sha256 efc8103cc3bcb06bda6a781532d12701eb081ad83e8f90004b39ab81b65d4369 libfoo-1.2.3.tar.bz2
|
|
|
|
|
2015-05-03 17:37:39 +02:00
|
|
|
# md5 from: http://www.foosoftware.org/download/libfoo-1.2.3.tar.bz2.md5, sha256 locally computed:
|
|
|
|
md5 2d608f3c318c6b7557d551a5a09314f03452f1a1 libfoo-data.bin
|
|
|
|
sha256 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b libfoo-data.bin
|
|
|
|
|
|
|
|
# Locally computed:
|
2014-07-03 21:36:22 +02:00
|
|
|
sha256 ff52101fb90bbfc3fe9475e425688c660f46216d7e751c4bbdb1dc85cdccacb9 libfoo-fix-blabla.patch
|
support/download: add explicit no-hash support
Add support to explicitly state that an archive has no hash.
This can be used for archives downloaded from a repository, like a
git-clone or a subversion checkout, or using the github helper.
This will come in handy when we'll eventually make hashes mandatory as
soon as a .hash file exists: for some packages, like gcc, some versions
are downloaded as archives from upstream, while other versions may come
from a GitHub repository (via the github herlper).
In this case, a .hash file would exist, that contains hashes for the
downloaded tarballs, but archives downloaded from the repository would
not have a hash (since it is currently not possible to have reproducible
such archives). So, we'd need a way to explicitly state there is no
hash, on purpose, for those archives.
So, add 'none' as a new type of hash.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-04-01 00:15:03 +02:00
|
|
|
|
2015-10-18 17:26:14 +02:00
|
|
|
# No hash for 1234:
|
support/download: add explicit no-hash support
Add support to explicitly state that an archive has no hash.
This can be used for archives downloaded from a repository, like a
git-clone or a subversion checkout, or using the github helper.
This will come in handy when we'll eventually make hashes mandatory as
soon as a .hash file exists: for some packages, like gcc, some versions
are downloaded as archives from upstream, while other versions may come
from a GitHub repository (via the github herlper).
In this case, a .hash file would exist, that contains hashes for the
downloaded tarballs, but archives downloaded from the repository would
not have a hash (since it is currently not possible to have reproducible
such archives). So, we'd need a way to explicitly state there is no
hash, on purpose, for those archives.
So, add 'none' as a new type of hash.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-04-01 00:15:03 +02:00
|
|
|
none xxx libfoo-1234.tar.gz
|
2014-07-03 21:36:22 +02:00
|
|
|
----
|
|
|
|
|
|
|
|
If the +.hash+ file is present, and it contains one or more hashes for a
|
|
|
|
downloaded file, the hash(es) computed by Buildroot (after download) must
|
|
|
|
match the hash(es) stored in the +.hash+ file. If one or more hashes do
|
|
|
|
not match, Buildroot considers this an error, deletes the downloaded file,
|
|
|
|
and aborts.
|
|
|
|
|
|
|
|
If the +.hash+ file is present, but it does not contain a hash for a
|
2015-04-01 00:15:06 +02:00
|
|
|
downloaded file, Buildroot considers this an error and aborts. However,
|
|
|
|
the downloaded file is left in the download directory since this
|
|
|
|
typically indicates that the +.hash+ file is wrong but the downloaded
|
|
|
|
file is probably OK.
|
2014-07-03 21:36:22 +02:00
|
|
|
|
2015-04-01 00:15:02 +02:00
|
|
|
Sources that are downloaded from a version control system (git, subversion,
|
|
|
|
etc...) can not have a hash, because the version control system and tar
|
|
|
|
may not create exactly the same file (dates, files ordering...), so the
|
|
|
|
hash could be wrong even for a valid download. Therefore, the hash check
|
|
|
|
is entirely skipped for such sources.
|
|
|
|
|
2014-07-03 21:36:22 +02:00
|
|
|
If the +.hash+ file is missing, then no check is done at all.
|