xref: /kernel/linux/linux-5.10/README (revision 8c2ecf20)
18c2ecf20Sopenharmony_ciContributions to OpenHarmony linux kernel project
28c2ecf20Sopenharmony_ci==========================================
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ciSign DCO
58c2ecf20Sopenharmony_ci--------
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ciBefore submitting any Contributions to OpenHarmony kernel, you have to sign
88c2ecf20Sopenharmony_ciDCO.
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ciSee:
118c2ecf20Sopenharmony_ci     https://dco.openharmony.io/sign-dco
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ciSteps of submitting patches
148c2ecf20Sopenharmony_ci---------------------------
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci1. Compile and test your patches successfully.
178c2ecf20Sopenharmony_ci   You should test your patch in OpenHamrony supported boards, hi3516dv300,
188c2ecf20Sopenharmony_ci   etc.
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci2. Generate patches
218c2ecf20Sopenharmony_ci   Your patches should be based on top of latest OpenHarmony branch, and
228c2ecf20Sopenharmony_ci   should use git-format-patch to generate patches, and if it's a patchset,
238c2ecf20Sopenharmony_ci   it's better to use --cover-letter option to describe what the patchset
248c2ecf20Sopenharmony_ci   does.
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci   Using scripts/checkpatch.pl to make sure there's no coding style issue.
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci   And make sure your patch follow unified OpenHarmony patch format describe
298c2ecf20Sopenharmony_ci   below.
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci   *Tips*: Learn more about linux kernel coding style
328c2ecf20Sopenharmony_ci    en:
338c2ecf20Sopenharmony_ci    https://gitee.com/openharmony/kernel_linux/blob/master/Documentation/process/coding-style.rst
348c2ecf20Sopenharmony_ci    zh:
358c2ecf20Sopenharmony_ci    https://gitee.com/openharmony/kernel_linux/blob/master/Documentation/translations/zh_CN/coding-style.rst
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci3. Send patch to OpenHarmony mailing list
388c2ecf20Sopenharmony_ci   Use this command to send patches to OpenHarmony kernel mailing list:
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci     git send-email *.patch -to="kernel@openharmony.io" --suppress-cc=all
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci   *NOTE*: that you must add --suppress-cc=all if you use git send-email,
438c2ecf20Sopenharmony_ci   otherwise the email will be cced to the people in upstream community and
448c2ecf20Sopenharmony_ci   mailing lists.
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci   *Tips*: Subscribe the mailing list
478c2ecf20Sopenharmony_ci    https://lists.openatom.io/postorius/lists/kernel.openharmony.io/
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci   *See*: How to send patches using git-send-email
508c2ecf20Sopenharmony_ci    https://git-scm.com/docs/git-send-email
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci4. Mark "v1, v2, v3 ..." in your patch subject if you have multiple versions
538c2ecf20Sopenharmony_ci   to send out.
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci   Use --subject-prefix="PATCH v2" option to add v2 tag for patchset.
568c2ecf20Sopenharmony_ci     git format-patch --subject-prefix="PATCH v2" -1
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci   Subject examples:
598c2ecf20Sopenharmony_ci     Subject: [PATCH v2 01/27] fork: fix some -Wmissing-prototypes warnings
608c2ecf20Sopenharmony_ci     Subject: [PATCH v3] ext2: improve scalability of bitmap searching
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci5. Upstream your kernel patch to kernel community is strongly recommended.
638c2ecf20Sopenharmony_ci   OpenHarmony will sync up with kernel master timely.
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci6. Sign your work - the Developer's Certificate of Origin
668c2ecf20Sopenharmony_ci   As the same of upstream kernel community, you also need to sign your
678c2ecf20Sopenharmony_ci   patch.
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci   See:
708c2ecf20Sopenharmony_ci   https://www.kernel.org/doc/html/latest/process/submitting-patches.html
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci   The sign-off is a simple line at the end of the explanation for the
738c2ecf20Sopenharmony_ci   patch, which certifies that you wrote it or otherwise have the right to
748c2ecf20Sopenharmony_ci   pass it on as an open-source patch. The rules are pretty simple: if you
758c2ecf20Sopenharmony_ci   can certify the below:
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci   Developer's Certificate of Origin 1.1
788c2ecf20Sopenharmony_ci   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci     By making a contribution to this project, I certify that:
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci     (a) The contribution was created in whole or in part by me and I have
838c2ecf20Sopenharmony_ci         the right to submit it under the open source license indicated in
848c2ecf20Sopenharmony_ci         the file; or
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci     (b  The contribution is based upon previous work that, to the best of
878c2ecf20Sopenharmony_ci         my knowledge, is covered under an appropriate open source license
888c2ecf20Sopenharmony_ci         and I have the right under that license to submit that work with
898c2ecf20Sopenharmony_ci         modifications, whether created in whole or in part by me, under
908c2ecf20Sopenharmony_ci         the same open source license (unless I am permitted to submit under
918c2ecf20Sopenharmony_ci         a different license), as indicated in the file; or
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci     (c) The contribution was provided directly to me by some other person
948c2ecf20Sopenharmony_ci         who certified (a), (b) or (c) and I have not modified it.
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci     (d) I understand and agree that this project and the contribution are
978c2ecf20Sopenharmony_ci         public and that a record of the contribution (including all
988c2ecf20Sopenharmony_ci         personal information I submit with it, including my sign-off) is
998c2ecf20Sopenharmony_ci         maintained indefinitely and may be redistributed consistent with
1008c2ecf20Sopenharmony_ci         this project or the open source license(s) involved.
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci   then you just add a line saying:
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci     Signed-off-by: Random J Developer <random@developer.example.org>
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ci   using your real name (sorry, no pseudonyms or anonymous contributions.)
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ciUse unified patch format
1098c2ecf20Sopenharmony_ci------------------------
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ciReasons:
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci1. long term maintainability
1148c2ecf20Sopenharmony_ci   OpenHarmony will merge massive patches. If all patches are merged by
1158c2ecf20Sopenharmony_ci   casual changelog format without a unified format, the git log will be
1168c2ecf20Sopenharmony_ci   messy, and then it's hard to figure out the original patch.
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci2. kernel upgrade
1198c2ecf20Sopenharmony_ci   We definitely will upgrade our OpenHarmony kernel in someday, using
1208c2ecf20Sopenharmony_ci   strict patch management will alleviate the pain to migrate patches
1218c2ecf20Sopenharmony_ci   during big upgrade.
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci3. easy for script parsing
1248c2ecf20Sopenharmony_ci   Keyword highlighting is necessary for script parsing.
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ciPatch format definition
1278c2ecf20Sopenharmony_ci-----------------------
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci[M] stands for "mandatory"
1308c2ecf20Sopenharmony_ci[O] stands for "option"
1318c2ecf20Sopenharmony_ci$category can be: bug preparation, bugfix, perf, feature, doc, other...
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ciIf category is feature, then we also need to add feature name like below:
1348c2ecf20Sopenharmony_ci	category: feature
1358c2ecf20Sopenharmony_ci	feature: YYY (the feature name)
1368c2ecf20Sopenharmony_ci
1378c2ecf20Sopenharmony_ciIf the patch is related to CVE or issue/bugzilla, then we need add the
1388c2ecf20Sopenharmony_cicorresponding tag like below (In general, it should include at least one
1398c2ecf20Sopenharmony_ciof the following):
1408c2ecf20Sopenharmony_ci	CVE: $cve-id or NA
1418c2ecf20Sopenharmony_ci	issue: $issue-id or NA
1428c2ecf20Sopenharmony_ci	bugzilla: $bug-id or NA
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ciissue: https://gitee.com/openharmony/kernel_linux/issues
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ciAdditional changelog should include at least one of the flollwing:
1478c2ecf20Sopenharmony_ci	1) Why we should apply this patch
1488c2ecf20Sopenharmony_ci	2) What real problem in product does this patch resolved
1498c2ecf20Sopenharmony_ci	3) How could we reproduce this bug or how to test
1508c2ecf20Sopenharmony_ci	4) Other useful information for help to understand this patch or problem
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ciThe detail information is very useful for porting patch to another kenrel
1538c2ecf20Sopenharmony_cibranch.
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci1. stable patch
1568c2ecf20Sopenharmony_ci	stable inclusion	[M]
1578c2ecf20Sopenharmony_ci	from $stable-version	[M]
1588c2ecf20Sopenharmony_ci	commit $id		[M]
1598c2ecf20Sopenharmony_ci	bugzilla: $bug-id       [O]
1608c2ecf20Sopenharmony_ci	issue: $issue-id	[O]
1618c2ecf20Sopenharmony_ci	CVE: $cve-id            [O]
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_ci	additional changelog	[O]
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_ci	--------------------------------
1668c2ecf20Sopenharmony_ci
1678c2ecf20Sopenharmony_ci	original changelog
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci	Signed-off-by: $your_name <$your_mail>	[M]
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ci	($stable-version would be stable-4.19.156, stable-4.19.157, etc...
1728c2ecf20Sopenharmony_ci	 $id would be stable commit)
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ci2. mainline patch:
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_ci	mainline inclusion      [M]
1778c2ecf20Sopenharmony_ci	from $mainline-version  [M]
1788c2ecf20Sopenharmony_ci	commit $id              [M]
1798c2ecf20Sopenharmony_ci	category: $category     [M]
1808c2ecf20Sopenharmony_ci	bugzilla: $bug-id       [O]
1818c2ecf20Sopenharmony_ci	issue: $issue-id	[O]
1828c2ecf20Sopenharmony_ci	CVE: $cve-id            [O]
1838c2ecf20Sopenharmony_ci
1848c2ecf20Sopenharmony_ci	additional changelog    [O]
1858c2ecf20Sopenharmony_ci
1868c2ecf20Sopenharmony_ci	--------------------------------
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_ci	original changelog
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci	Signed-off-by: $your_name <$your_mail>   [M]
1918c2ecf20Sopenharmony_ci
1928c2ecf20Sopenharmony_ci	($mainline-version could be mainline-5.6, mainline-5.10, etc...
1938c2ecf20Sopenharmony_ci	 $id would be mainline commit)
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_ci3. ohos patch
1968c2ecf20Sopenharmony_ci	ohos inclusion			[M]
1978c2ecf20Sopenharmony_ci	category: $category		[M]
1988c2ecf20Sopenharmony_ci	bugzilla: $bug-id or NA		[O]
1998c2ecf20Sopenharmony_ci	issue: $issue-id or NA		[O]
2008c2ecf20Sopenharmony_ci	CVE: $cve-id or NA		[O]
2018c2ecf20Sopenharmony_ci
2028c2ecf20Sopenharmony_ci	--------------------------------
2038c2ecf20Sopenharmony_ci
2048c2ecf20Sopenharmony_ci	changelog
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_ci	Signed-off-by: $your_name <$your_mail>	[M]
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_ciExamples
2098c2ecf20Sopenharmony_ci--------
2108c2ecf20Sopenharmony_ci
2118c2ecf20Sopenharmony_cimainline inclusion
2128c2ecf20Sopenharmony_cifrom mainline-4.10
2138c2ecf20Sopenharmony_cicommit 0becc0ae5b42828785b589f686725ff5bc3b9b25
2148c2ecf20Sopenharmony_cicategory: bugfix
2158c2ecf20Sopenharmony_ciissue: 1000
2168c2ecf20Sopenharmony_ciCVE: NA
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ciThe patch fixes a BUG_ON in the product: injecting single bit ECC error
2198c2ecf20Sopenharmony_cito memory before system boot use hardware inject tools, which cause a
2208c2ecf20Sopenharmony_cilarge amount of CMCI during system booting .
2218c2ecf20Sopenharmony_ci
2228c2ecf20Sopenharmony_ci[    1.146580] mce: [Hardware Error]: Machine check events logged
2238c2ecf20Sopenharmony_ci[    1.152908] ------------[ cut here ]------------
2248c2ecf20Sopenharmony_ci[    1.157751] kernel BUG at kernel/timer.c:951!
2258c2ecf20Sopenharmony_ci[    1.162321] invalid opcode: 0000 [#1] SMP
2268c2ecf20Sopenharmony_ci...
2278c2ecf20Sopenharmony_ci
2288c2ecf20Sopenharmony_ci-------------------------------------------------
2298c2ecf20Sopenharmony_ci
2308c2ecf20Sopenharmony_cioriginal changelog
2318c2ecf20Sopenharmony_ci
2328c2ecf20Sopenharmony_ci<original S-O-B>
2338c2ecf20Sopenharmony_ciSigned-off-by: Zhang San <zhangsan@163.com>
2348c2ecf20Sopenharmony_ciTested-by: Li Si <lisi@163.com>
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ciEmail Client - Thunderbird Settings
2378c2ecf20Sopenharmony_ci-----------------------------------
2388c2ecf20Sopenharmony_ci
2398c2ecf20Sopenharmony_ciIf you are newly developer in the kernel community, it is highly recommended
2408c2ecf20Sopenharmony_cito use thunderbird mail client.
2418c2ecf20Sopenharmony_ci
2428c2ecf20Sopenharmony_ci1. Thunderbird Installation
2438c2ecf20Sopenharmony_ci   Get English version Thunderbird from http://www.mozilla.org/ and install
2448c2ecf20Sopenharmony_ci   it on your system.
2458c2ecf20Sopenharmony_ci
2468c2ecf20Sopenharmony_ci   Download url: https://www.thunderbird.net/en-US/thunderbird/all/
2478c2ecf20Sopenharmony_ci
2488c2ecf20Sopenharmony_ci2. Settings
2498c2ecf20Sopenharmony_ci   2.1 Use plain text format instead of HTML format
2508c2ecf20Sopenharmony_ci       Options -> Account Settings -> Composition & Addressing, do *NOT*
2518c2ecf20Sopenharmony_ci       select "Compose message in HTML format".
2528c2ecf20Sopenharmony_ci
2538c2ecf20Sopenharmony_ci   2.2 Editor Settings
2548c2ecf20Sopenharmony_ci       Tools->Options->Advanced->Config editor.
2558c2ecf20Sopenharmony_ci
2568c2ecf20Sopenharmony_ci       - To bring up the thunderbird's registry editor, and set:
2578c2ecf20Sopenharmony_ci         "mailnews.send_plaintext_flowed" to "false".
2588c2ecf20Sopenharmony_ci       - Disable HTML Format: Set "mail.identity.id1.compose_html" to
2598c2ecf20Sopenharmony_ci         "false".
2608c2ecf20Sopenharmony_ci       - Enable UTF8: Set "prefs.converted-to-utf8" to "true".
2618c2ecf20Sopenharmony_ci       - View message in UTF-8: Set "mailnews.view_default_charset" to
2628c2ecf20Sopenharmony_ci         "UTF-8".
2638c2ecf20Sopenharmony_ci       - Set mailnews.wraplength to 9999 for avoiding auto-wrap
2648c2ecf20Sopenharmony_ci
2658c2ecf20Sopenharmony_ciLinux kernel
2668c2ecf20Sopenharmony_ci============
2678c2ecf20Sopenharmony_ci
2688c2ecf20Sopenharmony_ciThere are several guides for kernel developers and users. These guides can
2698c2ecf20Sopenharmony_cibe rendered in a number of formats, like HTML and PDF. Please read
2708c2ecf20Sopenharmony_ciDocumentation/admin-guide/README.rst first.
2718c2ecf20Sopenharmony_ci
2728c2ecf20Sopenharmony_ciIn order to build the documentation, use ``make htmldocs`` or
2738c2ecf20Sopenharmony_ci``make pdfdocs``.  The formatted documentation can also be read online at:
2748c2ecf20Sopenharmony_ci
2758c2ecf20Sopenharmony_ci    https://www.kernel.org/doc/html/latest/
2768c2ecf20Sopenharmony_ci
2778c2ecf20Sopenharmony_ciThere are various text files in the Documentation/ subdirectory,
2788c2ecf20Sopenharmony_ciseveral of them using the Restructured Text markup notation.
2798c2ecf20Sopenharmony_ci
2808c2ecf20Sopenharmony_ciPlease read the Documentation/process/changes.rst file, as it contains the
2818c2ecf20Sopenharmony_cirequirements for building and running the kernel, and information about
2828c2ecf20Sopenharmony_cithe problems which may result by upgrading your kernel.
283