From: Elvis D. <elv...@ma...> - 2010-06-10 04:24:32
|
Hi, On Jun 10, 2010, at 12:00 AM, plasmaphase wrote: > I think by git -a -m "modification description" you mean: > > git commit -a -m "modification description" Yes that is the correct command :-) > When you say modify the linux-omap3-2.6.32.bb (actually I'm using > linux-omap3-2.6.33.bb) I am not entirely sure I understand how to do this. > I did read some of the OpenEmbedded User Manual, however, the patches > section is not documented. What I did was this: > > > > SRC_URI = > "git://www.sakoman.com/git/linux-omap-2.6.git;branch=omap3-2.6.33;protocol=git > \ > file://defconfig \ > file://0001-board-overo.c-change-for-SPI.patch;patch=1 > " You'll need to add a \ at the end of file://0001-board-overo.c-change-for-SPI.patch;patch=1 I think > I saw that during the compile the patch was recognized and attempted to > patch: > > Applying patch 0001-board-overo.c-change-for-SPI.patch > patching file arch/arm/mach-omap2/board-overo.c > Hunk #2 FAILED at 31. > Hunk #3 FAILED at 47. > Hunk #4 FAILED at 76. > Hunk #5 FAILED at 148. > ..... > > > Is this because of non-compatible files due to revisions? Thanks again for > your help. Now when you clone your git repository, it might be at a particular SRCREV. What you should do is to look up the SRCREV in the linux-omap3-2.6.33 recipe, and then go a git checkout <SRCREV number> This will ensure that the repo will be at the same state as what bitbake tries to get it to , before applying the patches. I'm attaching a technote for doing this. Technote Overo-021: Quick command list for creating patches for the Overo OE platform Overview This document describes how to quickly create patches for Overo. For example, modifying a linux kernel file. Procedure Step 01.00: Checkout the linux-omap3-2.6.29 kernel project. The following command will clone the linux-omap-2.6 project into a folder called linux-omap-2.6. $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git The following command will checkout the master branch. This is the one the Overo uses, along with some patches. $ git checkout --track -b master origin/master The following command will checkout the omap-2.6.29 branch. $ git checkout --track -b omap-2.6.29 origin/omap-2.6.29 Step 02.00: Create a cloned copy of the linux-omap3-2.6.29 project for creating your patches. $ cd linux-omap-2.6 $ git clone . ../linux-omap-2.6-patches/linux-omap3-2.6.29-patches Step 03.00: Apply all the overo specific files to bring it to the current baseline. Look in the $OE_HOME/org.openembedded.dev/recipes/linux/linux-omap3-2.6.29 folder for the list of overo patches. You will find some more patches in the overo subfolder. Apply all the Overo specific patches. $ cd ../linux-omap-2.6-patches/linux-omap3-2.6.29-patches $ git apply dss2.patch Step 04.00: Make changes to your files or create new files. Use a text editor or eclipse to create, delete or modify files. You can simultaneously modify all your source files and the KConfig files here, as a set. Step 05.00: Commit your changes. $ git add . # be careful not to add the output files. these are anyway located outside the current directory. $ git commit -a -m "SPI: Added support for xyz device." Step 06.00: Create a patch file. $ git format-patch -1 or $ git diff > spi-device-support.patch Step 07.00: Copy the patch file to your Overo OE user.collection folder. Copy the file to $OE_HOME/user.collection/recipes/linux/linux-omap3-2.6.29 folder. $ cp spi-device-support.patch $OE_HOME/user.collection/recipes/linux/linux-omap3-2.6.29 Step 08.00: Clean the previous kernel version. $ cd $OE_HOME $ bitbake -c clean linux-omap3-2.6.29 Step 09.00: Modify the linux-omap3.2.6.29 recipe file in your Overo OE user.collection folder. Edit the recipe file. $ vi $OE_HOME/user.collection/recipes/linux/linux-omap3-2.6.29.bb Bump up the PR number, e.g. from PR=”rc1” to “rc2”. Add a new entry to the SRC_URI_ section, and add the newly generated patch file. Step 10.00: Build the kernel $ cd $OE_HOME $ bitbake linux-omap3-2.6.29 Step 11.00: Configure the kernel $ cd $OE_HOME $ bitbake -c menuconfig linux-omap3-2.6.29 Tweak the kernel configuration and copy the generated .config file, renamed as defconfig for the OE recipe. $ cp $OE_HOME/tmp/work/overo-angstrom-linux-gnueabi/linux-omap3-2.6.29-rc1/git/.config \ $OE_HOME/user.collection/recipes/linux/linux-omap3-2.6.29/overo/defconfig Step 12.00: Rebuild the kernel with the new defconfig file. $ cd $OE_HOME $ bitbake -c clean linux-omap3-2.6.29 $ bitbake -c rebuild linux-omap3-2.6.29 The newly generated kernel image can be found in $OE_HOME/tmp/deploy/glibc/images/overo. Step 13.00: If you want to merge cumulative commits into a single commit. $ git reset --soft <commitid> Step 14.00: To show a list of recent commits and their SHA1 hashes $ git log Step 15.00: To extract the last two commits $ git format-patch -2 Step 16.00: To list the branches $ git branch Step 17.00: To erase a recent commit from the record permanently $ git reset --hard SHA1_HASH Step 18.00: To hop back to an old state briefly $ git checkout SHA1_HASH Step 19.00: Change you user name and email address before submitting patches. $ git config user.name "John Doe" $ git config user.email joh...@gm... Step 20.00: To apply a series of patches from a folder. $ git am /path/to/patches/* To abort a failed attempt, type the following command: $ git am --abort To remove all files and folders from a previous git apply operation, type the following command: $ git clean -d -f Step 21.00: To extract a specific commit from the branch. $ git format-patch -1 ed99db8e5c53acced1a7c02aa9a94d50bea48409 0001-ARM-OMAP-No-need-to-include-board-overo.h-from-har.patch Step 22.00: To checkout a specific branch of the linux-omap-2.6 repository, corresponding to the linux-omap3-2.6.29.bb reciple. $ git checkout 90e758af52ba803cba233fabee81176d99589f09 Step 23.00: To extract all patches from a particular commit, leading up to the latest commit, for the current branch. For example, say you have synchronized with the Tomi’s linux-omap-dss repository and are on the master branch. You can extract all the patches starting from the commit of the linux-omap3-2.6.29.bb recipe which is at SRCREV 90e758af52ba803cba233fabee81176d99589f09 to Tomi’s latest DSS2 patches, by typing the following command: $ git format-patch 90e758af52ba803cba233fabee81176d99589f09 Step 24.00: If you run into problem getting new revisions of the linux-omap-2.6 kernel sources, delete the files in the ${GITDIR}. Also delete the ${GITDIR}/git_git.kernel.org.pub.scm.linux.kernel.git.tmlind.linux-omap-2.6.git_* tar files. Assuming you haven't overridden it in local.conf, the definitions from bitbake.conf will be what you're getting: CO_DIR = "${DL_DIR}" GITDIR = "${CO_DIR}/git" If you have ${DL_DIR} set to /usr/share/sources, so the bits in question are most likely in /usr/share/sources/git. Step 25.00: If you want to import an existing library and create a new git repository. $ mkdir project $ cd project $ git init $ git config user.name "John Doe" $ git config user.email joh...@gm... $ git add . $ git commit -a -m “Initial project baseline import” Step 26.00: If you want to configure git to warn about trailing white spaces and spaces before tab Modify .gitconfig as follows [core] whitespace = trailing-space,space-before-tab [apply] whitespace = fix Type the following commands within a git repository $ git config core.whitespace "trailing-space,space-before-tab" $ git config apply.whitespace "fix" Step 27.00: Extract commits between revisions R1 and R2, and apply them on top of the current branch using git am to cherry-pick them: $ git format-patch -k --stdout R1..R2 | git am -3 -k Step 28.00: Show all patches submitted by a particular author. git log --author="John Doe <joh...@gm...>" If you want to output only the commit ids for all patches sub git log --author="John Doe <joh...@gm...>" --pretty=format:"%H" 5f5fd774e7e368538b56ddcb805c8e5c916fbc3e ba95a60ec1f7b211e959d58640df11794e0286be ba969929450c0f11a16c3352d03f1583801509bc 3ad94c97a8577d32a585a3f41547067fb7d4941f 1f11706f24a11caf76d3e427115f4ddf0842ab98 2bc4d3b2eafcdeb8729e54da2ebedccd1de75351 aa8f6e80c327ebd2cbb9fd472388e078cffcc5ac 32ef2ec63135edfa1611f45802835bc875dc4348 b86fc43821ff11fd9b7543521051a8a057b77fdc 1d73d7cc81a4a6d8da203ee915a6cba210b34dab 43ed00b256f3ff61c3bb4b3c9e0c5391cd89559c 4a043bd35bba02172805d61ff8efd65ed0597539 3c7da3d2911c52e190116c62c3b74a0e09a1d6ab 3eab550929b80f6b2b8315be0595fa0cb406b3c2 45b71e09176d5955172ddc45f66338e091aa53e6 eaa071e20ff9151bf1152cfc8c0f20dabd4e4845 5a3053117b8d628fdb7ba27f2edf14e9ab65390b e9944420db85c7d2210867c6ac5a178c6d15a8c5 10a71f12607fb1fefa15229b338f6bc4ed5eba86 If you want to output everything on one line, for commits that were submitted 14 days ago $ git log --author=johannes.schindelin --since="14 days ago" --pretty=oneline 26be15f09db15d2b53a13d0f184d77fb54367f33 filter-branch: do not consider diver e1e4389832f32bb6ce029d6a6b110aa9ec768ea8 apply: fix access to an uninitialize 418566b6fdcc0eb1b5549d0742366aa13a7ff277 Fix 'git diff --no-index' with a non f7951e1d97aeb7b3ed359faeab5edf9e870ec8a5 Simplify t3412 37e5c8f46042510176a71d73c903c44214e09815 Simplify t3411 4bd03d15e495086a38470b59447296db4c235cb9 Simplify t3410 008849689e04e774aa7b194cd690405761e2383a test-lib.sh: introduce test_commit() 03af0870a0e6d551a31eb830d5c2682b82ae0ac6 lib-rebase.sh: Document what set_fak 29a03348a336f28025c824436a713cb9cb01b7a6 t3404 & t3411: undo copy&paste b8469ad0578d6b84ec92752a5f8df3ca5828af77 test-path-utils: Fix off by one, fou f265458f6116a0c03200477ae3b839f2a75bf0fa get_sha1_basic(): fix invalid memory Repositories 01. linux-omap-2.6 $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git Related Topics None. Related Links 01. git(1) - kernel.org docs. 02. Tell git your user name and email address - Guides - GitHub. 03. Git – sourceforge. 04. Everyday GIT With 20 Commands Or So. 05. git cheatsheet. 06. Git Community Book. 07. http://learn.github.com/p/log.html 08. http://www.kernel.org/pub/software/scm/git/docs/git-log.html Best regards, Elvis |