Skip to content

Team Win Recovery for Samsung based devices. Tutorial, premade ramdisk's, and kernels

Notifications You must be signed in to change notification settings

smasher816/Team-Win-Recovery-Project-Samsung

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Team Win Recovery Project - Samsung

Note: This is BETA quality, a WIP for developers only

Normal users - Wait for a developer to port TWRP, then follow their instructions
Developers - Follow the tutorial below to port TWRP to your samsung device, and create flashable zips for users.

If you have any problems, sugestions, etc feel free to hop into #twrp on irc.freenode.net for some IRC help.
I Smasher816 (or my bouncer) will always be on, so feel free to msg me.

INTRO

HTC phones have a separate recovery partition, allowing recoveries such as TWRP to be flashed independent of the rom installed.
However, most samsung phones (excluding nexus') must have the recovery built into the kernel, making recoveries such as TWRP uncommon.
This tutorial will hopefully make this a problem of the past.

Compile TWRP

(If I have already provided a ramdisk-recovery.img for a device, you are still encouraged to build it, keep it updated, and support the device and its users. Sorry but I can't manage every one)

How to Compile TWRP from Source has more information and possible device flags, to serve as a good reference.

TWRP is only designed to be made against the CM7 tree so we will set that up.
Go ahead and follow the cyanogenmod wiki to setup your build environment
(ex: Compile CyanogenMod (Linux)
A completed install should have the necessary programs to build, the full repo synced, proprietary files for your vendor and phone, and prebuilts such as rom manager.

(replace ~/CM7 with your CM7 source path, and captivatemtd with your device)

First we must add some extra folders used by TWRP

clone https://github.com/Dees-Troy/TWRP2-CM7_external_libjpeg to ~/CM7/external/libjpeg
clone https://github.com/Dees-Troy/TWRP2-CM7_external_pigz to ~/CM7/external/pigz

Next, we have to replace three of the stock CM7 folders, with ones modified by TWRP. replace

~/CM7/bootable/recovery with https://github.com/TeamWin/Team-Win-Recovery-Project
~/CM7/build with https://github.com/Dees-Troy/TWRP2-CM7_build
~/CM7/external/busybox with https://github.com/Dees-Troy/TWRP2-CM7_external_busybox

Finally, we have to modify some device files
cd to ~/CM7/device/samsung/aries-common and edit recovery.rc
under on init and # setup the global environment make the two lines look like below

export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
export LD_LIBRARY_PATH /sbin:/vendor/lib:/system/lib

at the end of the BoardConfigCommon.mk file add (change to your screen size)
(may also have to add this line to BoardConfig.mk in ~/CM7/device/samsung/captivate)

DEVICE_RESOLUTION := 480x800
TW_INCLUDE_INJECTTWRP := true
TW_NO_REBOOT_BOOTLOADER := true

Your CM7 tree is now ready to build TWRP, so lets make some ramdisks
cd to ~/CM7 and run

. build/envsetup.sh && lunch full_captivatemtd-eng && make bootimage

This command should have built a new CM7 kernel with new recovery ramdisks.
From here you can flash the kernel (stored as ~/CM7/device/samsung/captivate/kernel),
or create a flashable CM7 zip with brunch captivatemtd
Either way, everything made should have TWRP in it.

Build TWRP Package

This process used to be long and confusing (feel free to look at README-OLD.mkdn)
Now Dees_Troy has converted this script to a C program runable on the device,
this breakthrough allows developers to do everything on a device

Get a boot.img from a kernels zip, or with dump_image boot boot.img
Get a recovery-ramdisk.img by following the guide above (or by downloading a prebuilt from someone who has done this already)
Use Dees_Troy's injecttwrp program to inject the recovery-ramdisk.img into the boot.img
Flash the newly injected boot.img (with flash_image boot boot.img, heimdall flash --kernel, or anything else that flashes kernels)


This process has been streamlined with .sh scripts, and now cwm flashable zips.

Download injectTWRP-template.zip from above,
add your devices ramdisk-recovery.img,
and modify the updater-script to your liking.

All we ask, is for you to give some credit.
To upload zips to goo.im for easier controll and updating via the app.
And to nofity us via teamw.in, so that we can help spread the word :D

Enjoy!

About

Team Win Recovery for Samsung based devices. Tutorial, premade ramdisk's, and kernels

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published