[Google Pixel XL Guides, News, & Discussion] CZ Eddie:
EDIT

: UPDATED March 6th, 2017 for March Google Security Updates Image

-------------------------------------------------------------------------

-------------------------------------------------------------------------

Stey-by-Step for Newbies Guide for restoring a bootloader-unlocked Pixel XL back to factory stock

This guide is ideal for soft-brick situations where you can't boot to your operating system​

***Verizon users should research before doing ANYTHING.

***Europe users should be researching before using North American images, though it's usually okay to do so.

SOFT BRICK vs. HARD BRICK:

-What is a hard brick? Well, if you cannot access your bootloader then you're probably hard-bricked and need to do a warranty repair.

-A soft brick is when you CAN access your boot loader. Because if you can access your boot loader then you can repair your own software issue by following this guide.

If your phone is soft bricked and you send it in for warranty then you're a twat.

BOOTLOADER:

How do I access my bootloader? Power off your phone. Hold down the power button and volume down button at the same time, for 20-40 seconds. If you just now shut down the phone, then it takes longer for the bootloader to come up. If the phone has been powered down at least 30 seconds then the bootloader should come up quicker. If your phone is stubbornly upset then it may take several tries and also holding down the two buttons for 40-60 seconds. Another thing that may prevent you from accessing the bootloader is a low battery of course. Never do any software trickery without at least a half full battery for multiple random reasons.

The directions below are for Windows 7 and may need to be modified for other OS's.

***Anyone who doesn't want to lose their setup/apps/user data, just edit the

flash-all.bat

to remove the -w from the script. Then it won't wipe anything.

You can use this modified flash-all.bat. It's for the latest March "B" image:

http://www.filedropper.com/flash-all_1

1) Install the Google Android driver if your Pixel XL isn't already recognized by your computer when booted to fastboot mode.

https://developer.android.com/studio/run/win-usb.html#download

2) Download the factory system image for Pixel XL (Marlin) to C:/Google

https://developers.google.com/android/images

---Here is the direct link for March "B - NOF27B" for All Other users (what we're using in this guide):

---https://dl.google.com/dl/android/aosp/marlin-nof27b-factory-2259c206.zip

---Here is the direct link for March "C - NOF27C" for Rogers users:

---https://dl.google.com/dl/android/aosp/marlin-nof27c-factory-b49c0e7b.zip

3) This is what the folder should look like after the download:

4) Now extract the file.

Your folder should look like this:

5) Go into the extracted folder:

6) The contents of the extracted folder should look like this:

7) Download Google's ADB/Fastboot files to this same folder:

https://dl.google.com/android/repository/platform-tools-latest-windows.zip

8) Now extract the ADB download to this same folder. Edit the path to look like it does below:

9) The folder should now look like this:

10) Go into that new folder and CUT all the contents:

11) Go up one folder and PASTE the files into the factory image folder:

12) The folder should now look like this:

13) Now boot your phone to Fastboot mode.

Power off the phone & disconnect from USB cable.

Wait 30 seconds.

Then press Power + Volume Down until you see this screen on your phone:

14) Now connect your phone to your computer via USB-C cable.

15) Wait 30 seconds.

16) Then double-click the ever famous "flash-all.bat" to restore your phone to stock.

17) You'll see a black command prompt window pup up and start restoring your phone to stock image.

It'll take 5-15 minutes and when completed, the output should look just like this, except for the "A" vs. "B" designations may be swapped around, and that's fine.

target reported max download size of 536870912 bytes
sending 'bootloader_a' (32976 KB)...
OKAY [ 0.876s]
writing 'bootloader_a'...
(bootloader) Valid bootloader version.
(bootloader) Flashing active slot "_a"
(bootloader) Flashing active slot "_a"
OKAY [ 4.705s]
finished. total time: 5.583s
rebooting into bootloader...
OKAY [ 0.047s]
finished. total time: 0.048s
< waiting for any device >
target reported max download size of 536870912 bytes
sending 'radio_a' (57192 KB)...
OKAY [ 1.457s]
writing 'radio_a'...
OKAY [ 0.562s]
finished. total time: 2.022s
rebooting into bootloader...
OKAY [ 0.046s]
finished. total time: 0.048s
< waiting for any device >
target reported max download size of 536870912 bytes
archive does not contain 'boot.sig'
archive does not contain 'boot_other.img'
archive does not contain 'recovery.img'
archive does not contain 'system.sig'
archive does not contain 'system.sig'
archive does not contain 'vendor.sig'
archive does not contain 'vendor_other.img'
wiping userdata...
Creating filesystem with parameters:
Size: 26663190528
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 32768
Label:
Blocks: 6509568
Block groups: 199
Reserved block group size: 1024
Created filesystem with 11/1630208 inodes and 146354/6509568 blocks
--------------------------------------------
Bootloader Version...: 8996-012001-1701181700
Baseband Version.....: 8996-012511-1701091826
Serial Number........: HT6920203793
--------------------------------------------
checking product...
OKAY [ 0.050s]
checking version-bootloader...
OKAY [ 0.049s]
checking version-baseband...
OKAY [ 0.048s]
sending 'boot_a' (26173 KB)...
OKAY [ 0.690s]
writing 'boot_a'...
OKAY [ 0.299s]
erasing 'system_a'...
OKAY [ 0.265s]
sending sparse 'system_a' 1/4 (515613 KB)...
OKAY [ 13.636s]
writing 'system_a' 1/4...
OKAY [ 5.355s]
sending sparse 'system_a' 2/4 (514104 KB)...
OKAY [ 13.720s]
writing 'system_a' 2/4...
OKAY [ 6.234s]
sending sparse 'system_a' 3/4 (499613 KB)...
OKAY [ 13.263s]
writing 'system_a' 3/4...
OKAY [ 5.738s]
sending sparse 'system_a' 4/4 (32756 KB)...
OKAY [ 0.891s]
writing 'system_a' 4/4...
OKAY [ 0.359s]
erasing 'system_b'...
OKAY [ 0.297s]
sending sparse 'system_b' 1/4 (517080 KB)...
OKAY [ 13.672s]
writing 'system_b' 1/4...
OKAY [ 5.247s]
sending sparse 'system_b' 2/4 (514384 KB)...
OKAY [ 13.502s]
writing 'system_b' 2/4...
OKAY [ 10.252s]
sending sparse 'system_b' 3/4 (524287 KB)...
OKAY [ 13.766s]
writing 'system_b' 3/4...
OKAY [ 13.995s]
sending sparse 'system_b' 4/4 (85786 KB)...
OKAY [ 2.280s]
writing 'system_b' 4/4...
OKAY [ 2.969s]
erasing 'vendor_a'...
OKAY [ 0.250s]
sending 'vendor_a' (235322 KB)...
OKAY [ 6.049s]
writing 'vendor_a'...
OKAY [ 5.236s]
Setting current slot to 'a'...
OKAY [ 0.172s]
erasing 'userdata'...
OKAY [ 5.251s]
sending 'userdata' (138957 KB)...
OKAY [ 3.550s]
writing 'userdata'...
OKAY [ 1.298s]
rebooting...

finished. total time: 158.668s
Press any key to exit...
`

You're done.

There is no reason to continue reading this thread unless you want to "go the extra mile".

=================================

=================================

18) The phone automatically reboots at this point.

15) After it finished booting, I let it settle for five minutes.

16) I then reboot the phone (unnecessary step, just something I like to do).

17) I then log in and tell Google to restore my account from the cloud.

18) I set Display to stay on for 30 minutes so the phone doesn't go to sleep and my apps can restore without interruption.

19) After all apps are restored, I reboot and then update any remaining apps that need updates.

***OPTIONAL TIP*** Just prior to doing the flash-all.bat, it may not be a bad idea to make the additional step of flashing stock boot.img to both the A & B partitions.

Why not, right? This step is entirely optional and is only for good measure

Make sure you extracted the Google Image you downloaded, to the point where you find the boot.img and place it into the C:/Google folder.

The fastboot commands to install it are as follows:

fastboot flash boot_a boot.img

then...

fastboot flash boot_b boot.img

The output should look like this:

C:\Google>fastboot flash boot_a boot.img
target reported max download size of 536870912 bytes
sending 'boot_a' (26229 KB)...
OKAY [ 0.718s]
writing 'boot_a'...
OKAY [ 0.296s]
finished. total time: 1.030s

C:\Google>fastboot flash boot_b boot.img
target reported max download size of 536870912 bytes
sending 'boot_b' (26229 KB)...
OKAY [ 0.718s]
writing 'boot_b'...
OKAY [ 0.265s]
finished. total time: 0.983s

C:\Google>

20) Boom, you're all done.

Either go find something else to do or continue reading this guide to root your phone, install TWRP and custom kernel.

=================================

=================================

***

MAY UPDATE

USERS SEE THIS POST BEFORE GOING ANY FURTHER:

https://xdaforums.com/showpost.php?p=72329767&postcount=176

TWRP, ROOT AND CUSTOM KERNEL INSTALL

****The next steps are only if you want to install TWRP, Root your phone and install ElementalX kernel.****

1) I enabled SystemUI Tuner (OPTIONAL).

2) I enabled Developer Options (OPTIONAL).

3) I enabled USB Debugging in Developer Options (OPTIONAL).

4) I enabled "Unknown Sources" in Security (OPTIONAL).

5) Download SuperSU root v2.79 SR3:

https://plus.google.com/+Chainfire/posts/27xToSqi5em

-----------Support thread for SuperSU

6a) Download TWRP RC1 IMG file:

https://dl.twrp.me/marlin/twrp-3.0.2-0-RC1-fastboot-marlin.img.html

6b) Download TWRP RC1 zip file:

https://dl.twrp.me/marlin/twrp-pixel-installer-marlin-3.0.2-0-RC1.zip.html

-----------Support thread for TWRP

7) Download ElementalX-P-1.07 kernel:

http://elementalx.org/devices/pixel/

-----------Support thread for ElementalX

8) Copy the TWRP, kernel and Root zip files to your Pixel's /sdcard (filenames in pic are outdated, sorry):

9) Copy TWRP's RC1 IMG file to C:/Google

10) Right-click any white spot in C:/Google and select the option to "Open Command Window Here"

11) Copy and paste the command "fastboot boot twrp-3.0.2-0-RC1-fastboot-marlin.img".

The output should look like this after you press enter.

C:\Google>fastboot boot twrp-3.0
.2-0-RC1-fastboot-marlin.img
downloading 'boot.img'...
OKAY [ 0.710s]
booting...
OKAY [ 0.858s]
finished. total time: 1.578s

C:\Google>

The Pixel will automatically reboot to TWRP RC1 recovery.

12) Put a checkmark on the box "Never show this screen during boot again" and then swipe to allow modifications.

Click "Install".

Scroll down and click on the file named "twrp-pixel-installer-marlin-3.0.2-0-RC1.zip"

Swipe to confirm flash.

13) Reboot to Recovery.

14) Click the "Install" button.

15) Install the root file "SR3-SuperSU-v2.79-SR3-20170114223742.zip".

16) Reboot phone and verify root works. Do NOT install kernel yet. You need Superuser running first to gain ElementalX's advanced install options.

17) Now reboot to TWRP RC1 Recovery to install Kernel.

18) Install the kernel file "ElementalX-P-1.07.zip".

Go through the prompts to select your kernel options you want.

I recommend choosing the defaults unless you're a kernel expert who knows what to expect.

Now reboot normally.

Wait five minutes after bootup for the kernel to "settle".

Enjoy your modded Pixel XL!

=================================

=================================

TWRP BACKUP AND RESTORE

This section is if you installed TWRP and want to do a full ROM backup.

It's not as "obvious" on how to do this vs. older phones with TWRP.

The initial method is the same.

1) Boot to TWRP

2) Select the "Backup" option

3) Back up the "Boot", "System", "Vendor" and "Data". The Vendor option is important and may be new to some of you (it was to me).

If you want a "bit-for-bit" backup, then also select "System Image" and "Vendor Image". This will make your backup file size much larger than usual.

To restore, just do as normal.

Locate your backup and restore all items listed above.