xref: /aosp_15_r20/external/dtc/CONTRIBUTING.md (revision cd60bc56d4bea3af4ec04523e4d71c2b272c8aff)
1# Contributing to dtc or libfdt
2
3There are two ways to submit changes for dtc or libfdt:
4
5* Post patches directly to the the
6  [devicetree-compiler](mailto:[email protected])
7  mailing list.
8* Submit pull requests via
9  [Github](https://github.com/dgibson/dtc/pulls)
10
11## Adding a new function to libfdt.h
12
13The shared library uses `libfdt/version.lds` to list the exported
14functions, so add your new function there. Check that your function
15works with pylibfdt. If it cannot be supported, put the declaration in
16`libfdt.h` behind `#ifndef SWIG` so that swig ignores it.
17
18## Tests
19
20Test files are kept in the `tests/` directory. Use `make check` to build and run
21all tests.
22
23If you want to adjust a test file, be aware that `tree_tree1.dts` is compiled
24and checked against a binary tree from assembler macros in `trees.S`. So
25if you change that file you must change `tree.S` also.
26
27## Developer's Certificate of Origin
28
29Like many other projects, dtc and libfdt have adopted the "Developer's
30Certificate of Origin" (Signed-off-by) process created by the Linux
31kernel community to improve tracking of who did what.  Here's how it
32works (this is a very slight modification of the description from
33`Documentation/process/submitting-patches.rst` in the kernel tree):
34
35The sign-off is a simple line at the end of the explanation for the
36patch, which certifies that you wrote it or otherwise have the right
37to pass it on as an open-source patch.  The rules are pretty simple:
38if you can certify the below:
39
40    Developer's Certificate of Origin 1.1
41
42    By making a contribution to this project, I certify that:
43
44        (a) The contribution was created in whole or in part by me and I
45            have the right to submit it under the open source license
46            indicated in the file; or
47
48        (b) The contribution is based upon previous work that, to the best
49            of my knowledge, is covered under an appropriate open source
50            license and I have the right under that license to submit that
51            work with modifications, whether created in whole or in part
52            by me, under the same open source license (unless I am
53            permitted to submit under a different license), as indicated
54            in the file; or
55
56        (c) The contribution was provided directly to me by some other
57            person who certified (a), (b) or (c) and I have not modified
58            it.
59
60        (d) I understand and agree that this project and the contribution
61            are public and that a record of the contribution (including all
62            personal information I submit with it, including my sign-off) is
63            maintained indefinitely and may be redistributed consistent with
64            this project or the open source license(s) involved.
65
66then you just add a line saying::
67
68	Signed-off-by: Random J Developer <[email protected]>
69
70using your real name (sorry, no pseudonyms or anonymous
71contributions.)  This will be done for you automatically if you use
72`git commit -s`.  Reverts should also include "Signed-off-by". `git
73revert -s` does that for you.
74
75Any further SoBs (Signed-off-by:'s) following the author's SoB are
76from people handling and transporting the patch, but were not involved
77in its development. SoB chains should reflect the **real** route a
78patch took as it was propagated to the maintainers, with the first SoB
79entry signalling primary authorship of a single author.
80