GIT vs. Linux 3.x

MTD development is kept in GIT and managed according to standard Linux development practices. Development is based off of one of several trees, depending on what you're targeting. For MTD development, patches are kept in the linux-mtd.git and l2-mtd.git repositories. The former targets the current release cycle (use this only for bugfixes other material that's worthy of rapid integration into Linus' tree), while the latter targets the next Linux release (use this for most development). UBI and UBIFS development is tracked separately, in linux-ubifs.git. User-space tools are kept in mtd-utils.git.

All of the kernel trees are included in the linux-next tree and are viewable using gitweb at, along with a separate tree for the userspace tools, and users' own trees.

Tree NameGIT URLGitweb URL
MTD git://
MTD (next) git://
UBI / UBIFS git://
MTD user-space tools git://
This website git://

Gitweb can give patches between specific points in the tree. To obtain the full patch between Linus' official kernel tree and the current MTD tree, use the following URL:;a=commitdiff_plain;h=master;hp=linus. This produces a full patch from the branch known as 'linus' in the git repository, which represents the last point at which Linus' official kernel tree was merged into the MTD git tree. This should apply correctly to the current kernel, but beware that it will not include changes which were already taken by Linus.

When cloning the tree, please try to conserve network bandwidth (and your own disk space) by using 'alternates' -- if you have a local clone of Linus' official kernel tree, share the object directory with that instead of downloading the same objects all over again. With GIT 1.3.0 and onwards, that's simple enough. Assuming you have a local tree named '~/git/linux' already, you can clone the MTD tree as follows:

git clone --reference ~/git/linux git://

Users with accounts on can create their own trees there, which are also accessible via public git:// URLs and visible in gitweb. For more details see the GIT HOWTO.

Patch submission

If you have the facility to do so, please create a temporary git tree from which patches can be pulled. The GIT HOWTO documents how to do this. Please make sure that any such such GIT trees are based on the current linux-mtd GIT tree and not on Linus' tree, so that unnecessary merges are avoided.

Users without an account on (which is a different machine to the old may send trivial patches to the mailing list -- but expect to be given an account and expected to use git if you make a habit of it.

If you are sending patches to the mailing list, please remember to base them on the appropriate tree listed above, not Linus' tree.

Patch Format Guidelines

In order to make the lives of the patchmonkeys/maintainers easier, a few simple rules should be followed when submitting patches

  1. Provide a short summary line of the patch in the format:

  2. [PATCH] mtd: DETAILEDTARGET: short summary

    DETAILEDTARGET should be one of the MTD subcomponents, e.g. nand, chips, maps, core, and/or a filename if it simplifies the review/recognition of patch relevance.

  3. Empty new line
  4. Add a long comment to explain the patch
  5. Please use understandable wording. We are not experts in witchcraft. Please omit comments which just resemble the short summary line for simple patches.

  6. Add the appropriate origin information
  7. [From: Realname <realmail>]
    [Acked-by: Realname <realmail>]
    Signed-off-by: Realname <realmail>

Kernel versions

The MTD code in the linux kernel is updated from the MTD GIT tree in kernel version 3.x (newest) only. The 2.4 kernel does not have NAND support in JFFS2, and will not have anything but high-priority bug-fixes applied to it.

As of March 2005 we dropped Linux 2.4 support from CVS head. This means we no longer care whether the CVS code can be used on Linux 2.4 or not.

As of April 2006 we stopped using CVS altogether and switched to a GIT tree based on the current 2.6 kernel. You may be able to massage the current code to work in older kernels, if you have a sufficient supply of illegal narcotics that you actually desire such a thing. Please don't ask us about it though.

If you are using the ancient 2.4 kernel, that's probably because you're interested in stablity -- it is old and long-tested code. If that's what you want, then you should use the original JFFS2 code which is part of the 2.4 kernel. It's old and slow and doesn't support NAND flash, but it is stable, and is maintained.

The MTD community is neither able nor interested to provide support for new MTD and JFFS2 code with ancient kernels. Move yourself and update to a recent kernel. If you use a vendor supplied kernel, please get support from your kernel vendor. Do not ask on the mailinglist for help with such problems. You are either ignored or you get a pointer to this text. Please save the bandwidth and our time to sort out such questions.

Valid XHTML 1.0! Valid CSS!