Building and installing
There are multiple installation methods for your Google Pixel 2. They all rely on flashing one or more partitions on your device.
All installation methods can lead to data loss.
Flashing a partition will erase everything on the partition. Additionally,
the common backups methods, e.g. TWRP, will not backup the
This will produce a folder with a flashing script, and the partition images for your Google Pixel 2.
$ nix-build --argstr device google-walleye -A build.android-fastboot-images
Alternatively, you can build a specific partition image:
$ nix-build --argstr device google-walleye -A build.android-bootimg $ nix-build --argstr device google-walleye -A build.rootfs
The device will need to be booted in its bootloader, or
The boot images can be installed using the following command, assuming the
android-fastboot-images output was used.
If you have a system image (
system.img) built, you can use
flash it to the device. Note that it might be too big to fit over the
partition. In such case, it can be flashed on the
$ fastboot flash userdata system.img
Using a flashable zip
An alternative installation method is to use a flashable zip. The flashable zip can be built for your Google Pixel 2 using one of the following commands:
$ nix-build --argstr device google-walleye -A build.android-flashable-bootimg $ nix-build --argstr device google-walleye -A build.android-flashable-system $ nix-build --argstr device google-walleye -A build.android-flashable-zip
The first two will flash only a specific partition. The last one contains the partitions of the two previous one.
The zip can either be copied to the device and selected in a compatible
Android recovery, or sent to the device through
$ adb sideload /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-flashable-google-walleye-boot.zip
By default it will flash to the
system partition. Some configurations may
change this to flash to the
userdata partition. In that case, no warning is
given before flashing.
Adding this to your configuration will make it so the shell in initrd will
mobile.boot.stage-1.shell.console = "ttyMSM0";