Google Pixel 3 (google-blueline)

Contributors

 * hreikin

How to enter flash mode
The Pixel 3, like all Google Pixel/Nexus devices, uses Fastboot as the flashing protocol.

To enter Fastboot mode, hold Volume Down while powering on the device. Let go of Volume Down when "Fastboot mode" displays on the screen.

Alternatively, if connected to a pc then you can also use.

Installation
The steps below should allow you to flash postmarketOS to a Pixel 3 and boot to a point that telnet can be accessed.

CONFIG_EXT4_FS=y CONFIG_KERNEL_GZIP=y CONFIG_CGROUPS=y CONFIG_ANDROID_PARANOID_NETWORK=n CONFIG_PFT=n CONFIG_USE_VFB=n CONFIG_KINETO_GAN=n CONFIG_SAMSUNG_TUI=n CONFIG_SEC_RESTRICT_ROOTING=n CONFIG_TZDEV=n sdm845-c1-dvt1.1.dtbo id=0x215 rev=0x2 /dts-v1/;
 * Run  and then delete the generated linux-google-blueline folder
 * Edit the APKBUILD in the device-google-blueline folder to remove the  and   dependencies and insert the   and   dependencies
 * Clone the sdm845 mainline kernel and create a new branch for your changes, copy the DTS file available in the Linaro kernel to the sdm845 mainline kernel and edit the Makefile to include it, comment out the following nodes to ensure the kernel compiles successfully:,  ,   and
 * Add the following kernel configuration options to the sdm845.config file:
 * 1) Pixel 3
 * Source  and run   and   to compile the kernel, run ,   and
 * Run,   and
 * Clone this DTBO repository from the crosshatch port
 * Edit the dtboimg.cfg file with the following changes:
 * Edit the sdm845-c1-dvt1.1.dts file with the following changes before running build.sh to create the dtbo.img:

/ {	model = "Google Inc. MSM sdm845 C1 DVT1.1"; compatible = "google,b1c1-sdm845", "qcom,sdm845"; qcom,board-id = ; }; fastboot set_active b fastboot flash dtbo_b /path/to/dtbo.img pmbootstrap flasher flash_kernel fastboot flash vendor /path/to/exported/google-blueline-boot.img fastboot flash userdata /path/to/exported/google-blueline-root.img / # mount_subpartitions / # mount_boot_partition Mount boot partition (/dev/sda10) to (read-only) mount: mounting /dev/sda10 on failed: No such file or directory / # mount -o ro -t ext2 /dev/sda10 /boot mount: mounting /dev/sda10 on /boot failed: Invalid argument [ 118.355939] EXT4-fs (sda10): mounting ext2 file system using the ext4 subsystem [ 118.363336] EXT4-fs (sda10): bad block size 1024
 * Run the following commands to flash everything to the phone, You have to flash the dtbo.img and then the kernel normally for the telnet shell and then use fastboot to flash the boot and root images created with  otherwise nothing shows up in telnet when running  :
 * The phone boots and you should get the white screen with Google logo, sometimes it has a graphical glitch and others it doesn't. The SSH isn't working, it should have an IP and you can ping it but you can't connect by SSH. You can however connect to a shell with the telnet command;
 * Run, the vendor and userdata partitions should show up with the   and   labels
 * Source  and   before running   which seems to complete with no errors reported in the shell or via dmesg but could be unsuccessful as nothing new is mounted when looking with   or
 * Running  shows an error in telnet but not in dmesg however if you run   you should get the following errors output to the shell and dmesg:
 * You can successfully mount the root partition with  and it is viewable in.

Here are some links to the config files and logs, scroll down for multiple files:
 * dmesg and pmOS_init.log
 * defconfig, sdm845.config and generated .config files from kernel compilation

Status
Work is ongoing, flashing works and telnet can be accessed during boot.

USB
See also: https://github.com/Peter-Easton/android-debug-cable-howto, Serial_debugging:Cable_schematics

Baud rate is 115200. Voltage is 3.3V, although 1.8V seems to work as well.


 * 1) Obtain a USB-C breakout board and a UART adapter
 * 2) Connect pins   as following:
 * 3) A1 (GND) - GND
 * 4) A8 (SBU1) - RXD
 * 5) B8 (SBU2) - TXD
 * 6) Connect breakout board and phone using a USB-C cable that has working SBU1/2 (I had to use a thicker TB3/USB 3.0 capable cable). Make sure the cable is in "top" orientation (in my case Thunderbolt logos were facing same side as phone's screen and the   side of breakout board), it won't work if the plug is reversed on one side.
 * 7) Boot phone into fastboot, then execute   and poweroff.