Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[GUIDES][Q&A]How-To Guides For Beginners + Q&A

OP timmaaa

6th August 2014, 04:25 AM   |  #1  
timmaaa's Avatar
OP Recognized Contributor
Flag Melbourne
Thanks Meter: 7,592
 
15,589 posts
Join Date:Joined: Jun 2011
Donate to Me
More
Timmaaa's How-To Guide For Beginners + Q&A
OnePlus One

See Also:
[INDEX] OnePlus One Resources Compilation Roll-Up

[FAQ] OnePlus One Frequently Asked Questions


This thread will serve as a location for basic how-to guides for the OnePlus One (Bacon). I'm going to start off with a couple of the more obvious ones and go from there. If anyone has any suggestions for additions please feel free to let me know.

Please note: you'll need a working adb/fastboot environment on your PC to get through some of these guides. Go here to download the full Android SDK, which will give you most updated version of adb and fastboot. You'll find universal adb/fastboot drivers here.


By attempting any of the processes listed this thread you accept full responsibility for your actions. I will not be held responsible if your device stops working, catches on fire, or turns into a hipster and claims to have been modified before it was cool.

Index
1. How To Unlock Your Bootloader

2. How To Install A Custom Recovery On Your Device

3. How To Make A Nandroid Backup With TWRP Recovery

4. How To Root Your Stock Rom

5. How To Install A ROM with TWRP Recovery

6. How To Install A Custom Kernel With TWRP Recovery

7. How To Flash The Stock Kernel With Fastboot

8.How To Flash The XNPH44S Fastboot Images

9. How To Make Sure You Can Pretty Much Always Recover From An Accidentally Wiped System

10. How To Backup & Restore Your EFS Partition
1. How To Unlock Your Bootloader
-Power off your phone then boot into fastboot mode (power + volume up).

-Connect your phone to your PC via usb cable.

-Open a command prompt from within your fastboot folder (navigate to where you have fastboot.exe located on your PC, shift + right click anywhere within that folder, select open command prompt here).

-Check your fastboot connection by issuing this command:

Code:
fastboot devices
It should return your device serial number, if not you need to make sure your drivers are installed correctly.
-Once you've confirmed your fastboot connection issue this command:

Code:
fastboot oem unlock
The device will now go through the automated unlocking process, just let it do its thing and it'll boot up into Android.
-Go back to fastboot mode and issue this command to ensure that it worked:

Code:
fastboot oem device-info
It should have a couple of lines there, both with the flag set to true.
-You can now reboot your phone using this command:

Code:
fastboot reboot
-It's now safe to disconnect your usb cable.

Please note: this will erase all user data from your device, it is best to do this before turning your phone on for the first time, otherwise make sure you backup anything important.
2. How To Install A Custom Recovery On Your Device
-You first need to go into Settings/Developer Options and uncheck the "Update recovery with system updates" option (to enable Developer Options go into Settings/About Phone and click 'build number' about seven or eight times).

-Download the recovery of your choice (my preferred recovery is TWRP, and we'll be using that for this guide, grab it here).

-Make sure you check the md5 to verify its integrity.

-Place the file in your fastboot folder (this is where fastboot.exe is located on your PC).

-Put the phone in fastboot mode and connect it to your PC via usb cable.

-Open a command prompt from within your fastboot folder (shift + right click, select open command prompt here), and enter the following commands:

Code:
fastboot flash recovery openrecovery-twrp-2.8.1.0-bacon.img
(The recovery filename in the command will change depending on which recovery you're flashing)

Code:
fastboot format cache
Code:
fastboot reboot
-Let the device reboot, it's now safe to disconnect your usb cable.

Now you can use the advanced power menu (or the power + volume down button combo) to enter your custom recovery.
3. How To Make A Nandroid Backup With TWRP Recovery
A nandroid backup is a very important thing to have before installing any custom software on your device. It's basically a backup of your stock system that you can fall back on if anything goes wrong or if you just want your stock ROM back. You can also use the backup tool to create a backup of your favourite ROM set up exactly the way you like it. The backup you create can be easily restored using the restore tool in TWRP recovery.

All you need to do is enter TWRP recovery, select the backup option from the TWRP home screen, check the system/data/boot boxes, and swipe to backup. The process will take a few minutes.
4. How To Root Your Stock Rom
-First you need to download SuperSU.

-Enter TWRP recovery via the advanced power menu (or power + volume down).

-Select the install option from the TWRP home screen.

-Navigate to where you have SuperSU stored on your sd card and select it.

-Swipe to install.

-Once you've installed SuperSU you'll have an option to wipe cache/dalvik and an option to reboot system. Wipe the cache/dalvik, hit the back button, and hit the reboot system button. That's it.
5. How To Install A ROM with TWRP Recovery
Installing a ROM is a pretty straight forward and easy process. Before you install anything you should make a nandroid backup (instructions above).

-Perform a full wipe.
-Select the wipe option from the TWRP home screen.

-Select advanced wipe.

-Check the system, data, cache, and dalvik cache options.

-Swipe to wipe.
-Install the ROM.
-Select the install option from the TWRP home screen.

-Navigate to where you have the ROM zip stored on your sd card and select it.

-Swipe to install.
Most ROMs will run an installer script at this point but some ROMs have what is called an Aroma Installer which allow you to choose some install options before the script runs.
-You will also need to install the appropriate gapps package directly after installing the ROM.

-Once you've installed all necessary zips you'll have an option to wipe cache/dalvik and an option to reboot system. Wipe the cache/dalvik, hit the back button, and hit the reboot system button.
6. How To Install A Custom Kernel With TWRP Recovery
A custom kernel can open up a new level of control over your device, such as overclocking/underclocking, changing governors, enabling sweep2wake, and many other options.

-Download a kernel that is compatible with your current ROM.

-Check the md5 to verify its integrity.

-Enter TWRP recovery.

-Select the install option from the TWRP home screen.

-Navigate to the kernel and select it.

-Swipe to install.

-You'll have an option to wipe cache/dalvik and an option to reboot system. Wipe the cache/dalvik, hit the back button, and hit the reboot system button.

Once your phone has booted up you can use a kernel tuning app to change governors, I/O scheduler, clock speed, and other options. Some of the popular kernel apps are Trickster Mod, No Frills, Kernel Tuner, and many more.
7. How To Flash The Stock Kernel (boot.img) With Fastboot
If you're running a custom kernel on CM11S you'll need to flash the stock kernel back in order to take an OTA update.

-Download a stock kernel (boot.img) from this thread.

-Put it in your fastboot folder (where you have fastboot.exe located) on your PC.

-Boot into fastboot mode (power + volume up) and connect your phone to your PC via usb cable.

-Open a command prompt from within your fastboot folder (shift + right click, select open command prompt here).

-Issue this fastboot command:

Code:
fastboot flash boot .img
It'll take a few seconds to flash the boot.img, once it's finished you can manually reboot your phone or use the following command to reboot it:

Code:
fastboot reboot
-It's now safe to disconnect your usb cable.

Now you have the stock kernel back on your device.
8. How To Flash The XNPH44S Fastboot Images
Please note: This procedure requires an unlocked bootloader. This procedure will factory reset your device! All user data (settings, apps, data on internal storage) will be wiped!

-Download the file cm-11.0-XNPH44S-bacon-signed-fastboot.zip to your PC from here.

-Reboot your device into Fastboot Mode (power + volume up) and connect your phone to your PC via usb cable.

-Unzip the file you downloaded and put its contents into your fastboot folder (the same folder that you have adb.exe and fastboot.exe located in on your PC). Also put the unextracted zip there too.

-Open a command prompt from within your adb/fastboot folder (shift + right click, select open command prompt here).

-Issue these fastboot commands:

Code:
fastboot flash modem NON-HLOS.bin
Code:
fastboot flash sbl1 sbl1.mbn
Code:
fastboot flash dbi sdi.mbn
Code:
fastboot flash aboot emmc_appsboot.mbn
Code:
fastboot flash rpm rpm.mbn
Code:
fastboot flash tz tz.mbn
Code:
fastboot flash LOGO logo.bin
Code:
fastboot flash oppostanvbk static_nvbk.bin
Code:
fastboot update -w cm-11.0-XNPH44S-bacon-signed-fastboot.zip
(Please note: the -w component of this command will wipe your entire device, including your user data. It's possible to issue the command without the -w if a full wipe isn't completely necessary in your situation)

-Reboot your device with this command:

Code:
fastboot reboot
-It's now safe to disconnect your usb cable.
9. How To Make Sure You Can Pretty Much Always Recover From An Accidentally Wiped System
There may come a time when you accidentally wipe your OS while trying to perform a basic cache wipe in recovery. Don't laugh, it can happen to the best of us. The best way to insure yourself against being stuck in recovery is to keep a ROM zip or a TWRP/CWM backup (a nandroid backup) on your sd card at all times.
This solution seems like common sense but apparently there are quite a few people out there who don't store a ROM or backup on their phone. You might think it's easy to just mount the OTG storage and copy a ROM across to your phone from your PC (which is definitely an option), but there's always a chance that you won't be near your HDD or sd card at the time, or it won't recognise your phone properly. Basically you need to insure yourself against Murphy's law.
10. How To Backup & Restore Your EFS Partition
All too often on this device I've seen folks who have a corrupted or missing EFS Partition. This results in your IMEI being lost and no cellular activity on the device at all. This can be a royal PITA to fix, and some folks haven't been able to fix it at all. You can take a precautionary measure to safeguard yourself against this by taking a couple of minutes to back up your modemst files.

-Open up Terminal Emulator on your phone (if you don't have it you can download it here).

-Once it's open you'll be greeted with a command line prompt, in which you can enter text commands, the first thing you need to do is enable root access by entering this line (press the enter key on your on-screen keyboard after each command to issue it):

Code:
su
If this is the first time you've used Terminal Emulator a Superuser or SuperSU popup will appear, make sure you grant root access.
-Now enter these two commands:

Code:
dd if=/dev/block/mmcblk0p10 of=/sdcard/modemst1.bin bs=512
Code:
dd if=/dev/block/mmcblk0p11 of=/sdcard/modemst2.bin bs=512
The result should look like this:



This will place two files (modemst1.bin & modemst2.bin) on the root of your internal storage, make sure you copy them to your PC immediately so that you have a backup there to use if you need to restore it in future.

If by chance you end up with a corrupt EFS partition all you need to do is flash the files back to your device using fastboot.

-Boot into fastboot mode (power + volume up) and connect your phone to your PC via usb cable.

-Make sure the two files are in your fastboot folder on your PC.

-These fastboot commands will restore the files:

Code:
fastboot flash modemst1 modemst1.bin
Code:
fastboot flash modemst2 modemst2.bin
-Reboot your device:

Code:
fastboot reboot
-It's now safe to disconnect your usb cable.

Credit goes to @Vonnegut for originally posting this method in the TWRP thread.

You can also find an auto script by @Vonnegut here, this script will backup everything in the following list that doesn't have an asterisk on the right side.

Code:
Number  Size(Kb)   Name          Device
 1      65536      modem         /dev/block/mmcblk0p1   (*) FAT16
 2      512        sbl1          /dev/block/mmcblk0p2   (*)
 3      32         dbi           /dev/block/mmcblk0p3   (*)
 4      32         DDR           /dev/block/mmcblk0p4
 5      1024       aboot         /dev/block/mmcblk0p5   (*)
 6      500        rpm           /dev/block/mmcblk0p6   (*)
 7      16384      boot          /dev/block/mmcblk0p7   (*)
 8      500        tz            /dev/block/mmcblk0p8   (*)
 9      1024       pad           /dev/block/mmcblk0p9
10      1536       modemst1      /dev/block/mmcblk0p10
11      1536       modemst2      /dev/block/mmcblk0p11
12      10240      oppodycnvbk   /dev/block/mmcblk0p12
13      10240      oppostanvbk   /dev/block/mmcblk0p13
14      1355776    system        /dev/block/mmcblk0p14  (*) EXT4
15      32768      persist       /dev/block/mmcblk0p15      EXT4
16      524288     cache         /dev/block/mmcblk0p16  (*) EXT4
17      16384      recovery      /dev/block/mmcblk0p17  (*)
18      1536       fsg           /dev/block/mmcblk0p18
19      1          fsc           /dev/block/mmcblk0p19
20      8          ssd           /dev/block/mmcblk0p20
21      1024       misc          /dev/block/mmcblk0p21
22      16384      LOGO          /dev/block/mmcblk0p22  (*)
23      32768      DRIVER        /dev/block/mmcblk0p23
24      32768      reserve1      /dev/block/mmcblk0p24
25      16384      reserve2      /dev/block/mmcblk0p25
26      8192       reserve3      /dev/block/mmcblk0p26
27      65536      reserve4      /dev/block/mmcblk0p27
28      58510540   userdata      /dev/block/mmcblk0p28  (*) EXT4
29      294895     grow          /dev/block/mmcblk0p29


Donate To Me
Last edited by timmaaa; 12th December 2014 at 09:41 PM.
The Following 142 Users Say Thank You to timmaaa For This Useful Post: [ View ]
6th August 2014, 01:31 PM   |  #2  
26.2man's Avatar
Senior Member
Forest Hill MD
Thanks Meter: 38
 
386 posts
Join Date:Joined: Aug 2010
More
Nice guide!

Sent from my One using Tapatalk
The Following 2 Users Say Thank You to 26.2man For This Useful Post: [ View ]
6th August 2014, 04:40 PM   |  #3  
nicholaschum's Avatar
Senior Member
Flag Toronto, ON (Hong Kong S.A.R.)
Thanks Meter: 1,768
 
2,371 posts
Join Date:Joined: Feb 2011
Donate to Me
More
Great guide. Short and simple, just how I like it.
6th August 2014, 05:07 PM   |  #4  
ksoze11's Avatar
Senior Member
Thanks Meter: 11
 
143 posts
Join Date:Joined: Nov 2011
Quote:
Originally Posted by timmaaa

The best way to insure yourself against being stuck in recovery is to keep a ROM zip or a TWRP/CWM backup (a nandroid backup) on your sd card at all times.

Can you confirm that backups made through CW recovery are fully functional? I remember that my previous phone's kernel wasn't backing up /preload while making nandroid backups...
The Following User Says Thank You to ksoze11 For This Useful Post: [ View ]
6th August 2014, 10:14 PM   |  #5  
timmaaa's Avatar
OP Recognized Contributor
Flag Melbourne
Thanks Meter: 7,592
 
15,589 posts
Join Date:Joined: Jun 2011
Donate to Me
More
Quote:
Originally Posted by ksoze11

Can you confirm that backups made through CW recovery are fully functional? I remember that my previous phone's kernel wasn't backing up /preload while making nandroid backups...

I don't use CWM recovery so I can't confirm that personally. I use TWRP and can confirm that backups are fully functional with that recovery.

Transmitted via Bacon
The Following User Says Thank You to timmaaa For This Useful Post: [ View ]
6th August 2014, 10:22 PM   |  #6  
Senior Member
Thanks Meter: 18
 
237 posts
Join Date:Joined: Nov 2013
Ive rooted my OPO, how do i perform a nandroid backup ? when i rooted i dont know if i put a custom recovery on it.. i followed this guide https://forums.oneplus.net/threads/r...6#post-3809224
6th August 2014, 10:31 PM   |  #7  
timmaaa's Avatar
OP Recognized Contributor
Flag Melbourne
Thanks Meter: 7,592
 
15,589 posts
Join Date:Joined: Jun 2011
Donate to Me
More
Quote:
Originally Posted by Quinnaay

Ive rooted my OPO, how do i perform a nandroid backup ? when i rooted i dont know if i put a custom recovery on it.. i followed this guide https://forums.oneplus.net/threads/r...6#post-3809224

You didn't install a custom recovery or unlock your bootloader if you followed that tutorial. Just unlock your bootloader, it'll wipe your data so just backup anything that's important first. Then you can flash TWRP recovery and make a nandroid backup.

Transmitted via Bacon
6th August 2014, 10:33 PM   |  #8  
Senior Member
Thanks Meter: 18
 
237 posts
Join Date:Joined: Nov 2013
urgh, i was hoping i could keep all my data. Think ill give it a miss, it was only so i can install Xposed, but that should work anyway right?
6th August 2014, 10:35 PM   |  #9  
timmaaa's Avatar
OP Recognized Contributor
Flag Melbourne
Thanks Meter: 7,592
 
15,589 posts
Join Date:Joined: Jun 2011
Donate to Me
More
Quote:
Originally Posted by Quinnaay

urgh, i was hoping i could keep all my data. Think ill give it a miss, it was only so i can install Xposed, but that should work anyway right?

If you're rooted you can just install the Xposed Framework apk and away you go. But, I'd strongly recommend you actually unlock your bootloader now, it's only gonna get harder to do the longer you wait.

Transmitted via Bacon
6th August 2014, 10:41 PM   |  #10  
timmaaa's Avatar
OP Recognized Contributor
Flag Melbourne
Thanks Meter: 7,592
 
15,589 posts
Join Date:Joined: Jun 2011
Donate to Me
More
Come to think of it, there's a method around that'll unlock your bootloader without wiping any data, it's in the general section I think, have a look.

Transmitted via Bacon

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes