These are guidelines that should be followed when doing Replicant development.
Prerequisites¶Developing on Replicant isn't much harder than developing on any other free software project as it doesn't require specific knowledge. In facts, you'll probably learn a lot along the way regarding how hardware works, how the Android system is composed, how the kernel works, etc, but you don't need to know all of this to start. However a basic set of skills is required, among which:
- C language programming skills and the ability to understand other languages such as C++ and Java
- Makefile skills (no need to know every detail about it, a general idea of how Makefiles work is enough)
- git skills (basically, how to commit changes, send them to our repos, dealing with branches without making a mess, etc)
If you think you can cope with the requirements, then developing on Replicant should cause you no particular issue.
Writing free software replacements¶
Writing free software replacements for non-free components may require more skills depending on what you're trying to achieve, though there may be people with the adequate knowledge to help you and from whom you will likely learn a lot.
When working with Replicant repos, make sure to avoid breaking things. For instance, if you push a commit introducing a compilation error, it will break the whole build process.
It is better to create separate branches (that are not used by the official manifest branches) when your work is still in progress.
Creating branches that add debug infos on a particular topic is usually a good idea since it will save you time next time you want to debug the same component.
When creating a repository¶
In order to keep repo naming consistent, please name repositories by their name on the tree, replacing the
For instance, when forking the CyanogenMod repo:
android_device_samsung_crespo, rename it to
device_samsung_crespo on the Replicant repos.
This creates a more consistent way of naming repositories and makes it easier when pushing: just look at the location in the source tree and replace
When creating a branch¶Official replicant branches are named the following way:
- The Replicant version
replicant-2.3 This should be used on the projects repositories as well as the manifest repository.
Any other branch should be considered as Work In Progress (WIP) and thus not be part of any official branch of the manifest.
There is although one exception, with the
master branch, that can be used by any project and be in any manifest given that the code held in the
master branch will work on any Replicant version.
It is generally a good idea to send some changes back to upstream, assuming that they will benefit from it as well.
When it is about the replacement of a non-free component present in the upstream systems, make sure that your replacement is reliable and complete.
Contact the interested developers on the upstream projects before attempting to send your replacement.
The CyanogenMod team uses Gerrit to manage patch submissions. The process to get your patch included in CyanogenMod repos is explained on their wiki: Howto:Gerrit
Writing free software replacements¶Here are some tips that may help you achieving a free software replacement for a specific component (some may be more or less relevant regarding the nature of what the component does):
- Look for interested people from other projects: CyanogenMod people are constantly fighting with non-free blobs and are sometimes happy to help replacing one.
- Use tools such as
objdumpagainst the non-free binary to have a better idea of how things work. (Make sure this is legal where you live!)
- Try to make the non-free binary as verbose as possible by enabling all the possible debug options on the config file or such.
- Run the program in
straceand analyze the trace to understand what the program does.
- Add verbose debug prints in the concerned kernel driver (with
printkand show them via the
- Collect data out of the kernel driver (via debug prints) and out of the non-free binary (via debug prints on the upper-layer).
- If there is a mathematical algorithm involved, force the values returned by the kernel to the non-free binary and analyze how it reacts, for instance with spreadsheet software.
New images release guide¶
1. Modify vendor/replicant/CHANGELOG.mkdn, commit and push
2. Update prebuilts (FDroid, Terminal Emulator, etc)
3. Start the build
4. Run the release script and ensure everything is OK
5. Compress the release files
tar -cjf 0005.tar.bz2 0005
6. Upload the release to ftp-osl.osuosl.org
scp -v 0005.tar.bz2 firstname.lastname@example.org:/home/replicant/data/images/replicant-2.3/0005.tar.bz2
7. Unpack the release, fix permissions
8. Modify ReplicantImages, last image on every devices page
9. Announce the release on the blog, mailing list
10. Update the IRC topic
New device documentation guide¶1. Create the device main page, following the naming guidelines applied to other devices (e.g. the Samsung Galaxy S II is called Galaxy S2 and its page is GalaxyS2)
2. Create all the related sub-pages (build guide and firmwares list at least), following the naming guidelines applied to other devices (e.g. GalaxyS2Build and GalaxyS2Firmwares)
3. Create or update the installation process page for the device. If it is shared across devices, add the key combination for your device to the page.
4. Update the ReplicantStatus page of the wiki with the current status of the device
5. Modify the WikiStart page of the wiki and add the new device in the following sections:
6. Add your device to the Devices and Download pages of the Blog
Wiki License: Creative Commons BY-SA