Categories · Work

Contribution to Linux Kernel

Recently I contributed to Linux Kernel Organization where I submitted five very easy patches. The patches as I said were very simple which consisted of coding style fixing and checkpatch.pl errors removal. As much as easy the patches were , I did have some trouble with the submissions mainly due to my own carelessness.

At first I took up a driver in the staging directory to clean up. I found a correction, made the correction. I made a patch. The unique this is that here we need to send emails using some email servers like mutt or git send-email and I used the latter. This is so that the patch format doesn’t change. I went and set up the requirements in my gitconfig file. Then sent the patch to the mailing list. Eventually it got accepted but I had little hurdles in between which were due to my carelessness.

My hurdles were:-

  1. I wrote “fixed a coding style issue” in my subject as well as body of my first patch mail and I had to change the body of the mail writing into describing what change I had actually done. This main challenge was to reply this to the same thread. I didn’t know there was an automatic reply option that sent it to the same thread. So I was trying to the message id of the mail I had sent and all that complicating matters. Later I found out any information about a particular patch automatically goes into the respective thread.
  2. When I generated other patches, (a total of five) each patch had [PATCH 1/5] [PATCH 2/5] [PATCH3/5] PATCH[4/5] PATCH[5/5] in the subject whereas it was supposed to be only [PATCH] for each patch as they were different patches. For this I had to waste some time on correcting it. I accidentally sent the reply with [RESEND PATCH] subject for all patches to the mentor only ; and I was supposed to send it to the whole group. Again a careless me!

But finally it was all good and hopefully all pass testing phases. This was a good experience for me and I really learnt to make patches. I was happy at the end of it , though they were simple patches, the efforts weren’t that simple(not difficult as well) specially as it was the first time.

Here are  steps to make patches for Linux Kernel.

Categories · Work

Steps to make a patch for Linux Kernel

  • Make the required changes and save them.

 

  • Run the option “git status“. This will show the changes that are to be committed into the source.

 

  • Run the options “git diff“. This shows what ever changes you have made to the code.

 

  • Compile the changes by running the “make” command; make M = build PATH

 

  • Run “git commit -a” option to commit the changes and enter the following fields:
  1. A subject in the first line.
  2. A description of what changes you have done.
  3. Signed-off-by: Name <email-id> .
  • Run “git log” and this shows the commit made.

 

  • Run “git show” and this shows the mail form that gets generated.

 

  • Run “git show –pretty = full” and this also shows us properly the changes.

 

  • Run “git format-patch master..tutorial” and tadaa.. your patch is generated.

 

  • Run git send-email –to <to-email-id> file.patch

And we are done with the submission of the patch as well.

 

Hope this was useful 😀 .