Jump to content

Google Pixel (google-pixel): Difference between revisions

From postmarketOS Wiki
Ojbr (talk | contribs)
m Update codename
Wiktorpyk6 (talk | contribs)
No edit summary
 
(22 intermediate revisions by 8 users not shown)
Line 1: Line 1:
[[Category:Not booting]]
{{Infobox device
{{Infobox device
| manufacturer = Google
| manufacturer = Google
| name = Pixel
| name = Pixel
| codename = sailfish
| codename = google-pixel
| image = File:Sailfish.jpg
| imagecaption = Google Pixel
| releaseyear = 2016
| releaseyear = 2016
| originalsoftware = Android 7.1 (Nougat)
| originalsoftware = Android
| chipset = Qualcomm MSM8996 Snapdragon 821
| originalversion = 7.1
| cpu = Quad-core (2x2.15 GHz Kryo & 2x1.6 GHz Kryo)
| extendedversion = 10
| chipset = Qualcomm Snapdragon 821 (MSM8996Pro)
| cpu = Quad-core (2x 2.15 GHz Kryo & 2x 1.6 GHz Kryo)
| gpu = Adreno 530
| gpu = Adreno 530
| storage = 32/128GB
| storage = 32/128 GB
| display = 5.0 inch AMOLED capacitive multi-touch screen, 1280x1920
| display = 1080×1920 AMOLED
| memory = 4GB Dual Channel LPDDR4
| memory = 4 GB Dual Channel LPDDR4
| image = File:Sailfish.jpg
| architecture = aarch64
| imagecaption = Google Pixel (sailfish)
| type = handset
| status_usbnet =
| status_flashing =
| status_touch =
| status_screen =
| status_wifi =
| status_xwayland =
| status_fde =
| status_mainline =
| status_battery =
| status_3d =
| status_accel =
| status_audio =
| status_bluetooth =
| status_camera =  
| status_gps =
| status_mobiledata =
| status_sms =
| status_calls =
| status = Kernel compiles, panics on boot
| booting = no
}}
}}


== Contributors ==
== Contributors ==
* [https://gitlab.com/ojbr Oliver 'ojbr' Brammer]
* [https://gitlab.com/ojbr ojbr]
* [https://gitlab.com/steamport steamport]


== Maintainer(s) ==
=== Maintainers ===
* [mailto:oliver@octo.im Oliver 'ojbr' Brammer]
-


<!-- Only if this device doesn't run on linux-postmarketos yet! -->
== Pixel / Pixel XL ==
<!-- This person needs to be willing to answer questions from users of this device -->


== Note on device codenames and compatibility ==
The Pixel (sailfish) and Pixel XL (marlin) share identical kernel architectures. This port should work for both devices.


The sailfish variant of the Google Pixel shares the same kernel builds as the Pixel XL (marlin). Therefore, anything here referencing sailfish should also be relevant to marlin.
=== Device Owners ===
{{Device owners}}


== What works ==
== What works ==
Line 33: Line 57:
* Kernel compilation
* Kernel compilation
* Flashing
* Flashing
* Booting kernel (serial only)
* Booting kernel (partial boot with serial logging - panics / halts)


== What does not work ==
== What does not work ==
Line 41: Line 65:
* Screen
* Screen
* WiFi
* WiFi
* Bluetooth (might actually work!)
* Bluetooth
* Camera
* Camera
* GPS
* GPS
* Modem
* Modem


N.B: The Pixel/Pixel XL are slightly different in format to a typical Android ecosystem. They are given two partition slots, dubbed slot A & B. Out-of-the-box Android installations also enable filesystem encryption by default. However, this is a non-issue for pmOS, since TWRP can reformat the partition layout to drop FDE for testing.
== Development Notes ==


=== Default Partition Layout ===
=== Partition Layout ===
 
Out of the box, the Google Pixel uses an A/B partition layout. Both slots are known working. Should you need to change slots, this can be done with:
<pre>
<nowiki>#fastboot set_active a
#fastboot reboot bootloader</nowiki>
</pre>


<pre>
<pre>
Line 74: Line 104:
</pre>
</pre>


== How to enter flash mode ==
== Bootloader Unlocking ==


It is required that the device is '''cell carrier unlocked''' before attempting to perform an OEM unlock using fastboot.
The bootloader can be unlocked once the device has been unlocked by the cell carrier. An unlock code is usually obtained from your network provider directly, or from a third party.
Be aware, a bootloader unlock will erase all userdata. Make sure to keep a backup of any important data.


* Enter fastboot by shutting down the device, and hold volume down + power until you see the fastboot screen.
* Enter fastboot by shutting down the device, and hold volume down + power until you see the fastboot screen.
* Depending on the phone's previous sleep state, you may be alerted that a RAM dump is in progress. Ignore these, keep holding the buttons until you end up in fastboot.
* Depending on the phone's previous sleep state, you may be alerted that a RAM dump is in progress. Ignore these, keep holding the buttons until you end up in fastboot.


Once cell unlocked, you must OEM unlock from fastboot through the standard command:
The standard OEM unlock command can then be be used:
<pre>
<pre>
<nowiki>#fastboot oem unlock</nowiki>
<nowiki>#fastboot oem unlock</nowiki>
</pre>
Be sure that you are using fastboot slot A. If you need to change slots, perform:
<pre>
<nowiki>#fastboot set_active a
#fastboot reboot bootloader</nowiki>
</pre>
</pre>


At this point, you should be ready to test pmOS deployments.
At this point, you should be ready to test pmOS deployments.
== Installation ==
More details to this section are coming soon.
<!-- add more sections below as necessary, e.g. Wifi, photos, ... -->


=== Backup with TWRP ===
=== Backup with TWRP ===
Line 107: Line 127:
* Take your backup, note this does not include the user data directory. You need to copy that over with MTP as well.
* Take your backup, note this does not include the user data directory. You need to copy that over with MTP as well.


=== Installation Steps ===
== Installation ==
 
=== Boot Only ===
 
The device is capable of sideloading a boot.img over USB with fastboot. The standard command in pmOS works:
 
<pre><nowiki>
# pmbootstrap flasher boot
</nowiki></pre>
 
=== Flashing ===
 
<pre><nowiki>
<pre><nowiki>
#fastboot set_active a
# fastboot set_active a
#fastboot reboot bootloader
# fastboot reboot bootloader
#pmbootstrap flasher flash_rootfs
# pmbootstrap flasher flash_rootfs
#pmbootstrap flasher flash_kernel
# pmbootstrap flasher flash_kernel
#fastboot reboot
# fastboot reboot
</nowiki></pre>
</nowiki></pre>


== Serial Debugging ==
== Debugging ==
 
=== Kernel Logging via Serial ===


It is possible to debug the Pixel/Pixel XL with a standard [[Serial debugging|Nexus Serial debug cable]]. This must be enabled in fastboot first:
It is possible to debug the Pixel/Pixel XL with a standard [[Serial debugging|Nexus Serial debug cable]]. This must be enabled in fastboot first:
<pre>
<pre>
#fastboot oem uart enable
# fastboot oem uart enable
</pre>
</pre>


The baud rate is 115200.
The baud rate is 115200.


== Known Issues ==
== Troubleshooting ==
 
==== skip_initramfs ====


This is something added specific to Android, which skips the initramfs loading - something that shouldn't happen on pmOS.
==== Unable to mount rootfs ====


A patch exists which strips the offending commit. However, a more comprehensive patch might be worth investing time into - since this does not remove the extra cmdline parameters.
When running from a vendor kernel, Android is configured to skip loading with an initramfs. For postmarketOS to boot, the offending change would have to be removed with a [https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/66/diffs?commit_id=b6a70454d1e999678fe8d770ed3d59bd28da8549 patch].


Without the patch, you'll encounter:
Without the patch, the rootfs will fail to mount:
<pre>
<pre>
[  14.025620] No filesystem could mount root, tried:  ext3 ext2 ext4 vfat msdos fuseblk
[  14.025620] No filesystem could mount root, tried:  ext3 ext2 ext4 vfat msdos fuseblk
Line 139: Line 170:
</pre>
</pre>


==== Firmware images not available ====
==== Firmware image not available ====


Need to include the [https://developers.google.com/android/drivers#sailfish proprietary vendor drivers].
Proprietary [https://developers.google.com/android/drivers#sailfish vendor drivers] are missing, and will need to be built into the resulting boot image.


<pre>
<pre>
Line 147: Line 178:
</pre>
</pre>


== To Do List ==
== See also ==
 
* TBC
=== Done ===
 
* [ojbr] - Fix kernel panic on boot (skip_initramfs)
* [ojbr] - Serial debugging is possible with the kernel builds available on my mirror repository
* [ojbr] - Re-enable LZMA kernel image compression, add via makedepends
* [ojbr] - Test device flashing using fastboot
 
=== Doing ===
 
* Investigate boot process; attempt to get SSH over USB
* Investigate missing driver binaries
 
=== Backlog ===
 
* Investigate Kernel upgrade path to 4.X where MSM8996 has better support in mainline


== See also ==
* [https://octo.sh/ojbr/pmbootstrap/tree/wip-google-pixel ojbr's postmarketOS google-pixel fork on GitLab]
<!--
<!--
Link to related GitHub issues or pull requests like the following (replace CHANGEME with the ID, e.g. 1234):
Link to related GitHub issues or pull requests like the following (replace CHANGEME with the ID, e.g. 1234):

Latest revision as of 09:55, 14 March 2025

This device is marked as not booting.
Status: Kernel compiles, panics on boot
Google Pixel
Google Pixel
Google Pixel
Manufacturer Google
Name Pixel
Codename google-pixel
Released 2016
Type handset
Hardware
Chipset Qualcomm Snapdragon 821 (MSM8996Pro)
CPU Quad-core (2x 2.15 GHz Kryo & 2x 1.6 GHz Kryo)
GPU Adreno 530
Display 1080×1920 AMOLED
Storage 32/128 GB
Memory 4 GB Dual Channel LPDDR4
Architecture aarch64
Software
Original software Android
Original version 7.1
Extended version 10
postmarketOS
Category testing
Pre-built images no


Contributors

Maintainers

-

Pixel / Pixel XL

The Pixel (sailfish) and Pixel XL (marlin) share identical kernel architectures. This port should work for both devices.

Device Owners


What works

  • Kernel compilation
  • Flashing
  • Booting kernel (partial boot with serial logging - panics / halts)

What does not work

  • SSH over USB
  • Touch
  • Screen
  • WiFi
  • Bluetooth
  • Camera
  • GPS
  • Modem

Development Notes

Partition Layout

Out of the box, the Google Pixel uses an A/B partition layout. Both slots are known working. Should you need to change slots, this can be done with:

#fastboot set_active a
#fastboot reboot bootloader
~#: fdisk -l /dev/block/sda


bootlocker_a    bootlocker_b
keymaster_a     keymaster_b
tz_a            tz_b
rpm_a           rpm_b
pmic_a          pmic_b
hyp_a           hyp_b
cmnlib32_a      cmnlib32_b
cmnlib64_a      cmnlib64_b
aboot_a         aboot_b
hosd_a          hosd_b
devcfg_a        devcfg_b
modem_a         modem_b
msadp_a         msadp_b
apdp_a          apdp_b
vendor_a        vendor_b
system_a        system_b
userdata
reserve0

Bootloader Unlocking

The bootloader can be unlocked once the device has been unlocked by the cell carrier. An unlock code is usually obtained from your network provider directly, or from a third party. Be aware, a bootloader unlock will erase all userdata. Make sure to keep a backup of any important data.

  • Enter fastboot by shutting down the device, and hold volume down + power until you see the fastboot screen.
  • Depending on the phone's previous sleep state, you may be alerted that a RAM dump is in progress. Ignore these, keep holding the buttons until you end up in fastboot.

The standard OEM unlock command can then be be used:

#fastboot oem unlock

At this point, you should be ready to test pmOS deployments.

Backup with TWRP

Take precaution, and keep backups if this is your primary device.

  • Download the latest TWRP (both img and zip)
  • From the TWRP directory, run the fastboot command:
    #fastboot boot <your-twrp.img>
  • At this point, TWRP will load
  • Take your backup, note this does not include the user data directory. You need to copy that over with MTP as well.

Installation

Boot Only

The device is capable of sideloading a boot.img over USB with fastboot. The standard command in pmOS works:

# pmbootstrap flasher boot

Flashing

# fastboot set_active a
# fastboot reboot bootloader
# pmbootstrap flasher flash_rootfs
# pmbootstrap flasher flash_kernel
# fastboot reboot

Debugging

Kernel Logging via Serial

It is possible to debug the Pixel/Pixel XL with a standard Nexus Serial debug cable. This must be enabled in fastboot first:

# fastboot oem uart enable

The baud rate is 115200.

Troubleshooting

Unable to mount rootfs

When running from a vendor kernel, Android is configured to skip loading with an initramfs. For postmarketOS to boot, the offending change would have to be removed with a patch.

Without the patch, the rootfs will fail to mount:

[   14.025620] No filesystem could mount root, tried:  ext3 ext2 ext4 vfat msdos fuseblk
[   14.033436] c2      1 Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(253,0)

Firmware image not available

Proprietary vendor drivers are missing, and will need to be built into the resulting boot image.

[TP]: [ERR]:fwu_start_reflash: Firmware image synaptics_bl71.img not available

See also

  • TBC