Clear Linux OS is composed of many different open source software projects and welcomes all contributors to improve the project.
Before contributing, please review and abide by the Code of Conduct. Ensure any contributions align with Clear Linux philosophies on stateless and security.
Before you start, consider if it would be better to contribute upstream. Clear Linux will benefit from improvements to upstream software just like everyone else.
Note: for the Linux kernel package specifically, please see the kernel development documentation.
- Setup a development environment on a Clear Linux OS system.
- Identify and clone the repository corresponding to the software package by running
make clone_<PACKAGENAME>
. This will clone the repsoitory from https://github.com/clearlinux-pkgs which contain existing files and directories created by the autospec tooling.
If required, separately submit changes to a package's autospec configuration before submitting any source code changes so the Clear Linux release pipeline gets updated as expected.
- Modify the autospec control files to change compilation and packaging settings.
- Create one or more patch files from the package's autospec directory using
git-format-patch
(see the patching source code section) - Submit patches through Clear Linux Distribution issues on GitHub
- Modify the source code (see the patching source code section).
- Run
make autospec
to regenerate the.spec
file and build RPMs. - Test the newly packaged software on a Clear Linux OS system.
- Submit patches through Clear Linux Distribution issues on GitHub. Be sure to include the package name in the issue subject and body.
If accepted, the Clear Linux team will update the package in Clear Linux OS and make the patches available at: https://github.com/clearlinux-pkgs
Make sure the licensing of the package you want to include allows Clear Linux to package and distribute it. Licensing should use a common identifier and format as found at https://spdx.org/licenses/ and ideally be a permissive license.
- Setup a development environment on a Clear Linux OS system.
- Generate an autospec directory for the software package using the autospec tooling on Clear Linux.
- Create a new git repository in the folder containing the autospec package workspace.
- Create a single patch file using
git-format-patch
.[1] - Submit the patch through Clear Linux Distribution issues on GitHub.
- Include suggestions for which bundle(s) the package should be added to and any ideas for tests that would be relevant.
If accepted, the Clear Linux team will add the package to Clear Linux OS and make the repository available at: https://github.com/clearlinux-pkgs
For projects under https://github.com/clearlinux, refer to the README and contribution guidelines in those repositories.
Source code from upstream software packages can be patched in different ways. As a developer, your choice to use one of these patching workflows depends on the existing methodology that is in use by the upstream project already, and the required change.
Using the git format-patch
is the strongly preferred as patching workflow and
will increase the likelihood of patches being accepted.
- Run
make sources
to download the upstream software source code. - Extract the software source code archive. (
tar -xvf <PACKAGE>.tar.xz
) - Create a new local git repository and initialize. (
git init && git add -A && git commit -m "Initial commit"
) - Apply any existing patches from the package's autospec repository. (
git am ../*.patch
) - Make any desired code modifications and track them with
git
. (git add -A && git commit
) - Create one or more patch files. (
git-format-patch -<N>
)[1] - Copy the patch file(s) into the package's autospec directory from step #2. (
cp *.patch ../
) - Add the patch file names to
series
file in the package's autospec directory. (echo "0001-example-fix--for-bug.patch" >> series
)
- Run
make sources
to download the upstream software source code. - Create a directory
a/
with the original source code.- Extract the software source code archive. (
tar -xvf <PACKAGE>.tar.xz
) - Apply any existing patches from the package's autospec repository. (
patch -p1 ../*.patch
)
- Extract the software source code archive. (
- Create a second directory
b/
with the new modifications.- Extract the software source code archive. (
tar -xvf <PACKAGE>.tar.xz
) - Make any desired code modifications.
- Extract the software source code archive. (
- Run a
diff
between the two directories and create a patch file. (diff -Nru a/ b/ > 0001-example-fix--for-bug.patch
) - Add the patch file names to
series
file in the package's autospec directory. (echo "0001-example-fix--for-bug.patch" >> series
)
quilt
is a patch management tool used by some software projects to manage many patches or patch sets.
See the links below for more information on how quilt
can be used:
- http://www.shakthimaan.com/downloads/glv/quilt-tutorial/quilt-doc.pdf
- https://wiki.debian.org/UsingQuilt
Please submit any issues in upstream packages to their respective projects. Bugs or issues related to Clear Linux Distribution may be submitted here: https://github.com/clearlinux/distribution/issues
Visit Intel's Security Portal for best practices on reporting security issues.
[1] Make sure your git user.name and git user.email are set correctly as they may appear in public patch files.