[oe] [PATCH][mtd-utils][how to] Numonyx chip support

Paul Menzel paulepanter at users.sourceforge.net
Wed Mar 10 09:12:14 UTC 2010


Dear Michal,


please do not top post.


Am Mittwoch, den 10.03.2010, 09:10 +0100 schrieb Michal Stawinski:
> 2010/2/25 Michał Stawinski <nazgee at gmail.com>
> > I am a newb in working with open projects, so please take it easy if I'll
> > do something wrong.
>
> Can anyone help me on this, please?

Welcome! And sorry that nobody responded earlier to you. Next time this
happens I suggest, you join the IRC channel and contact the developers
directly.

> > Below (and in the attachment) is "git format-patch" output.
> > It introduces support for Numonyx memories, that have oobsize=64 and
> > pagesize=4096, that are used e.g. in OMAP3, igep0020b machine.
> >
> > Solution is very straightforward, though you'll probably reject my patch,
> > as diff contains full path to files that i altered (not relative to
> > mtd-utils). I hope however, that you can tell me how to generate patches for
> > sepcific packages correctly, so it won't contain whole path (e.g.
> > a/build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nanddump.c)
> >
> > That is how I've done it:
> > - "git pull"      //to update oe dev branch
> > - bitbake mtd-utils      //to get *.c files refreshed
> > - git checkout -b mtd_utils      //to create my new development branch
> > - git add build/tmp-igep0020/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.3.1-r0/git/nanddump.c
> > //to add files I am going to alter
> > - git commit     //to create a starting point for my development
> > - :::editing=>compiling=>testing:::
> > - git commit     //to check in changes I've made
> > - git format-patch HEAD^     //to create patch from changes I've made
> >
> > What am I doing wrong? Sources of packages like mitd-utils are not added to
> > .git repository in OE tree,

That is correct. OE does not distribute the sources but just the magic
(recipes) on how to get the sources and install them correctly.
Therefore you should not have your build directory in the OE tree.

> > and when I add it manually to it (as above), and
> > then create patch, whole path relative to OR root is generated, which makes
> > my patch useles to other builds than the one I did (IGEPv2).
> >
> > I really'd like to contribute, but I can't find any how-to realted to *.c
> > sources editing (*.bb editing is straightforward, as these files are already
> > in oe git tree).

As you figured out, you have to patch the source. BitBake provides a way
to apply patches to the source. Unfortunately [2] is down right now, but
I try to give different references.

First you find a lot of information in the OE user manual [3]. The
source files for the manual are also in the Git repository [4].

        $ ls recipes/mtd/mtd-utils/
        add-exclusion-to-mkfs-jffs2-git-2.patch  lzo_1x-git.patch
        add-exclusion-to-mkfs-jffs2-git.patch    lzo_1x.patch
        fix-ignoreerrors-git.patch
        $ $ more recipes/mtd/mtd-utils_1.3.1.bb 
        require mtd-utils.inc
        
        DEPENDS += "e2fsprogs-libs"
        
        PARALLEL_MAKE = ""
        ARM_INSTRUCTION_SET = "arm"
        
        # This is the default package, thus we lock to a specific git version so 
        # upstream changes will not break builds.
        
        TAG = "v${PV}"
        
        SRC_URI = "git://git.infradead.org/mtd-utils.git;protocol=git;tag=${TAG} \
        	   file://add-exclusion-to-mkfs-jffs2-git-2.patch;patch=1 \
        	   file://fix-ignoreerrors-git.patch;patch=1 \
        	   file://lzo_1x-git.patch;patch=1"
        […]

So in `SRC_URI` you see the `file://…` lines. That is how patches get
applied in OE.

So I suggest

1. you to create the patch for mtd-utils in its source directory (get
the source, for example [5] in a seperate directory outside the OE tree,
adapt it and create a patch).
2. Copy the patch to `recipes/mtd/mtd-utils/`.
3. Add a file line to SRC_URI.
4. If this works, add the patch to the OE Git tree (`git add …`) and
proceed as you did before.

[…]

> Maybe it is wrong mailing-list- should I be writing somewhere else?

It would be really nice to get your patch included upstream, so that
patches are not needed in the future [6]. So please also send it to
upstream MTD [1][7].


Thanks,

Paul


[1] http://www.linux-mtd.infradead.org/
[2] http://www.openembedded.org
[3] http://docs.openembedded.org/usermanual/html/recipes_syntax.html
[4] docs/usermanual/chapters/recipes.xml
[5] git clone git://git.infradead.org/mtd-utils.git
[6] http://wiki.openembedded.net/index.php/Push_patches_upstream
[7] http://www.linux-mtd.infradead.org/mail.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
URL: <http://lists.openembedded.org/pipermail/openembedded-devel/attachments/20100310/e7c41d98/attachment-0002.sig>


More information about the Openembedded-devel mailing list