Skip to content

Instantly share code, notes, and snippets.

@fourkbomb
Last active December 22, 2018 15:11
Show Gist options
  • Save fourkbomb/0d94e286dc6f173eb9053c0d75e84783 to your computer and use it in GitHub Desktop.
Save fourkbomb/0d94e286dc6f173eb9053c0d75e84783 to your computer and use it in GitHub Desktop.
switch from CM to Lineage non-destructively

Switch from CyanogenMod to LineageOS without redownloading everything

  1. Init the Lineage manifest: repo init -u ssh://[email protected]/LineageOS/android.git -b cm-14.1 (or cm-13.0 if you prefer that)
  2. Update your local manifest (.repo/local_manifests/roomservice.xml), if it exists - find and replace "CyanogenMod" with "LineageOS" globally.
  3. Move the git objects: mv .repo/project-objects/CyanogenMod .repo/project-objects/LineageOS
  4. curl https://gist.github.com/fourkbomb/0d94e286dc6f173eb9053c0d75e84783/raw/cc1bb94337eab5e30efa689fe1d050db25a1124a/fixlinks.sh > ~/fixlinks.sh
  5. chmod +x ~/fixlinks.sh
  6. cd .repo/projects
  7. find . -name '*.git' -exec ~/fixlinks.sh {} \;
  8. And finally, fix the actual tree:
  9. cd ../..
  10. find * -name '.git' -exec ~/fixlinks.sh {} \;
  11. repo sync
  12. profit
  13. You might wish to manually check for any remaining broken links (as suggested by @mdmower): cd .repo/projects && find . -xtype l
@fourkbomb
Copy link
Author

Thanks, updated.

@ibrokemypie
Copy link

This resulted in a bunch of corrupted .git repos for me, had to manually rm -rf each one then repo sync again to get the next list to remove. Depending on your download speed it may be faster to sync from scratch as repeating the sync and delete process took a number of hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment