GrapheneOS: Installation Tutorial
This tutorial describes the process to install the GrapheneOS ROM on a Google Pixel XL smartphone (the first generation)…
Prerequisites
- Before using the
fastboot
command, the stock image needs to be up-to-date. This can be achieved:- manually (switching the smartphone on, connecting it to the WiFi and updating it without registering with Google),
- or using sideloading of OTA images downloaded from developers.google.com. Note: For sideloading, the device needs to be already unlocked as per the next section.
- The latest version of the
fastboot
tool, i.e.:
$ yaourt -S android-tools ! or alternatively from AUR: yaourt -S android-sdk-platform-tools
$ fastboot --version
fastboot version 9.0.0_r41
Installed as /usr/bin/fastboot
Enabling OEM Unlocking
The OEM unlocking needs option needs to be enabled from within the operating system in order to successfully install AOSP. This can be achieved as follows:
- Enabling the Developer settings menu by:
- going to
Settings -> System -> About phone
- and pressing on the build number menu entry until developer mode is enabled.
- going to
- It is also necessary to:
- go to
Settings -> Developer
options, - toggle on the Enable OEM unlocking setting
- and toggle on the USB debugging setting.
- go to
Unlocking the Bootloader
Booting into the bootloader interface can be achieved after connecting the device to the computer and by:
- turning off the device and then turning it on by holding both the Volume Down and Power buttons,
- or, using the
adb reboot bootloader
command from the computer.
The bootloader can be unlocked to allow flashing new images as follows:
$ fastboot flashing unlock
The fastboot
command needs to be confirmed on the device. This erases all data on the target device!
Flashing the Factory Images
The factory images (stable or beta) need to be obtained first. The following example is for the Google Pixel XL smartphone (the first generation):
$ cd ${HOME}
$ mkdir -p grapheneos
$ cd grapheneos
$ wget https://seamlessupdate.app/marlin-factory-2019.05.08.15.zip
$ wget https://seamlessupdate.app/marlin-factory-2019.05.08.15.zip.sig
Verification of the downloaded files:
$ gpg --recv-keys 65EEFE022108E2B708CBFCF7F9E712E59AF5F22A
$ gpg --verify marlin-factory-2019.05.08.15.zip.sig marlin-factory-2019.05.08.15.zip
The installation process is straightforward. The downloaded archive needs to be unzipped and the appropriate BASH script needs to be executed as follows:
$ cd ${HOME}/grapheneos
$ unzip marlin-factory-2019.05.08.15.zip
$ cd marlin-pq3a.190505.001
$ ./flash-all.sh
Locking the Bootloader
Before using the device, the bootloader should be locked again in order to maintain its security feature, as locking wipes the data again. This can be achieved as follows:
- Enabling the Developer settings menu by:
- going to
Settings -> System -> About phone
- and pressing on the build number menu entry until developer mode is enabled.
- going to
- It is also necessary to:
- go to
Settings -> Developer
options, - toggle on the USB debugging setting
- and run:
- go to
$ adb reboot bootloader
$ fastboot flashing lock
Again, the confirmation is needed to be performed on the screen using the side buttons. The device restarts shortly after.
Conclusion
The GrapheneOS is a very promising project. However, should one need to revert back to the stock ROM, the following tutorial can be used.