Adding patches through git
WIP incomplete
Add patches to be committed to the Preware feed by following this guide.
Prerequisites
- SSH key generated, with the id_dsa.pub authorised for commital on git.webos-internals.org (rwhitby is able to do this)
- GPL compliant patch to submit (preferably with a .patch extension)
Initialising your local repository
- You will need to pull down the kernel/patches repository as a starting point with
<source lang="text">git clone git@git.webos-internals.org:kernels/patches.git</source>
A worked example is as follows:
<source lang="text"> mason~/kernels$ git clone git@git.webos-internals.org:kernels/patches.git Initialized empty Git repository in /home/sbromwich/kernels/patches/.git/ Enter passphrase for key '/home/sbromwich/.ssh/id_dsa': remote: Counting objects: 70, done. remote: Compressing objects: 100% (68/68), done. remote: Total 70 (delta 23), reused 0 (delta 0) Receiving objects: 100% (70/70), 15.21 KiB, done. Resolving deltas: 100% (23/23), done. mason~/kernels$ ls patches mason~/kernels$ ls -l total 4 drwxr-xr-x 5 sbromwich sbromwich 4096 Apr 22 22:17 patches mason~/kernels$ cd patches/ mason~/kernels/patches$ ls LICENSE overclocking sensors mason~/kernels/patches$ ls -l total 12 -rw-r--r-- 1 sbromwich sbromwich 88 Apr 22 22:17 LICENSE drwxr-xr-x 2 sbromwich sbromwich 4096 Apr 22 22:17 overclocking drwxr-xr-x 2 sbromwich sbromwich 4096 Apr 22 22:17 sensors mason~/kernels/patches$ </source>
- Create a directory for your patch(es) and copy them in there.
Tag patches and submit to git
- Find the next available git tag with
<source lang="text">git -l</source>
In the following case, the next tag is v1.4.1-10:
<source lang="text"> mason~/kernels/patches/prcm$ git tag -l v1.4.0-0 v1.4.0-1 v1.4.1-1 v1.4.1-2 v1.4.1-3 v1.4.1-4 v1.4.1-5 v1.4.1-6 v1.4.1-7 v1.4.1-8 v1.4.1-9 mason~/kernels/patches/prcm$ </source>
- Tag the files with a meaningful commit message and the tag from the previous step:
<source lang="text"> mason~/kernels/patches/prcm$ git tag -a -m "PRCM resume from suspend fix/kludge" v1.4.1-10 mason~/kernels/patches/prcm$ </source>
- Send the tagged files to the upstream repository with
<source lang="text">git push ; git push --tags</source>
For example:
<source lang="text"> mason~/kernels/patches/prcm$ git push ; git push --tags Enter passphrase for key '/home/sbromwich/.ssh/id_dsa': Everything up-to-date Enter passphrase for key '/home/sbromwich/.ssh/id_dsa': Counting objects: 1, done. Writing objects: 100% (1/1), 187 bytes, done. Total 1 (delta 0), reused 0 (delta 0) To git@git.webos-internals.org:kernels/patches.git
* [new tag] v1.4.1-10 -> v1.4.1-10
mason~/kernels/patches/prcm$ </source>
Commit the tagged files to git
Committing the tagged files is the following three step process:
- git add filenames
- git commit -m "commit message" filenames
- git push
Worked example:
<source lang="text"> mason~/kernels/patches/prcm$ git add * mason~/kernels/patches/prcm$ git commit -m "PRCM resume from suspend fix/kludge" * Created commit 16fbb97: PRCM resume from suspend fix/kludge
3 files changed, 84 insertions(+), 0 deletions(-) create mode 100644 prcm/README create mode 100644 prcm/prcm_clk.c.diff create mode 100644 prcm/proc_pwr.c.diff
mason~/kernels/patches/prcm$ git push Enter passphrase for key '/home/sbromwich/.ssh/id_dsa': Counting objects: 7, done. Compressing objects: 100% (6/6), done. Writing objects: 100% (6/6), 1.96 KiB, done. Total 6 (delta 0), reused 0 (delta 0) To git@git.webos-internals.org:kernels/patches.git
b949e1d..16fbb97 master -> master
mason~/kernels/patches/prcm$ </source>