Documentation:NGW/GitForAvr32KernelDevelopment

From AVRFreaks Wiki

Jump to: navigation, search

Here I will ( hopefully with the help of others ) give an introduction on how to use git to generate patches that can be submitted to the kernel, so others may also benefit from your coding.

This page will change over time and will progrably contain bugs and ineffective methods, consider yourself warned!

Contents

[edit] Making a folder for a start and enter it

Create a folder

~/mkdir my_kern_fold

Enter the folder

~/cd my_kern_fold

[edit] Copying the git tree

Command for creating a git copy of the read revision of the linux kernel, master branch.

~/my_kern_fold$ git-clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git my_linux
Initialized empty Git repository in /home/my/my_kern_fold/my_linux/.git/
remote: Counting objects: 1449214, done.
remote: Compressing objects: 100% (233559/233559), done.
remote: Total 1449214 (delta 1205471), reused 1448397 (delta 1204692)
Receiving objects: 100% (1449214/1449214), 315.74 MiB | 2227 KiB/s, done.
Resolving deltas: 100% (1205471/1205471), done.
Checking out files: 100% (31504/31504), done.
~/my_kern_fold$ cd my_linux/
~/my_kern_fold/my_linux$

You should now be ready to edit config and compile the kernel code.

[edit] Setup user data

Set user e-mail

git config user.email test@example.net

Set users name

git config user.name 'John Doe'

[edit] Commit a change

[edit] Add a file

git add arch/avr32/boards/my_b/my_b.c

[edit] Commit the added file

git commit -a

[edit] Generate a patch set between the masterand local version

git diff master > 001changes_by_me.patch

But this will not include a summary of the patch.

[edit] Generate a patch

Personal tools