Closed Bug 1209096 Opened 7 years ago Closed 6 years ago

Fork CyanogenMod recovery to B2G for maximum device compatibility


(Firefox OS Graveyard :: GonkIntegration, defect)

Gonk (Firefox OS)
Not set


(Not tracked)



(Reporter: afarden, Assigned: afarden)




(5 files, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.99 Safari/537.36

Steps to reproduce:

AOSP recovery is very simple and not very useful to someone who likes to tinker with their devices. CyanogenMod recovery already has a whole range of fixes for device specific quirks, as well as file system and usability enhancements.

Despite its extensive modifications, it doesn't depend on too many system modifications (mostly for the extra file system support).

Lets fork it and make it our own.
The current plan: add a cm-recovery.xml file to b2g-manifests which any device can optionally include. it will override AOSP recovery and pull in some extra repos from CyanogenMod upstream stable branch (about half a dozen or so).
Attached file Manifest PR
This manifest is incomplete; it doesn't include cherry-picks to system/core and system/extras. I will push those to github later.
Blocks: 1080483
FML I just spent far too long figuring out why CM recovery is not working. AOSP deletes the the recovery ramdisk and rebuilds it from the root ramdisk. Anything you add to recovery ramdisk gets blown away.
1. AOSP deletes the recovery ramdisk folder before recreating it. We need to stop this.
2. Because our init binary is a symlink to, "cp -R" fails. Replace it with "rsync -aP".
3. CM recovery already has busybox symlinks so we can remove them from
4. CM uses pathmap to determine (among other things) which recovery to build. Disable this.

Is rsync safe?

When AOSP executes "cp -R" we are copying to an empty directory, when we want to execute "rsync -aP" we will have files necessary for CM recovery.

The only overwrite seems to be busybox. We're copying our static_min_busybox over CM's static_busybox (~200kb difference) so there are probably some symlinks in recovery that will not work. with rsync we can exclude files to copy, keeping the static_busybox.
Attached file Build PR
Depends on: 1211123
Attached file PR
Attached file CM Recovery, B2G branch (obsolete) —
I updated the recovery branding to match our Foxfood branding.
Attachment #8669408 - Attachment is obsolete: true
I just noticed that vendor/cm has extra dependencies that may be needed for some of the more advanced functions of CM recovery (eg f2fs, exFAT support). Since this a large repo with mostly useless stuff, it may be easier to just port those changes to a 'mini vendor/cm'
I've created the vendor/cm-fake repo for the sepolicy, extra build definitions (needed for recovery sepolicy weirdness) and dependencies for some extra tools in the build.

I also left a few default settings in there in case they may be useful, however I'll probably need to remove some of them.
Assignee: nobody → adam
Ever confirmed: true
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.