Installing OxygenOS on the Google Pixel/Pixel XLThis is a guide on how to install OxygenOS on the Google Pixel with a resized system partition.
BEFORE WE START I'D LIKE TO THANK NYAN SATAN FOR LETTING ME USE THEIR WEBSITE AS A TEMPLATE
I am NOT responsible for any damage caused to you or your device, everything you do is on you, I'm just writing the guide
Getting startedFirst off, you need to have TWRP downloaded for your Google Pixel along with GNU parted which can be found here
You also need platform-tools for ADB and fastboot which can be found here
When you have those downloaded, boot TWRP and push parted (replace parted with the path to the executable) to /sbin with
./adb push parted /sbin/partedthen open a shell with
./adb shelland set it as executable with
cd /sbin && chmod 777 parted
PartitioningNow comes the fun part, resizing the system partitions to fit the OxygenOS system image.
First, run parted with
./parted /dev/block/sdathen list your partition table with
Now start with deleting system_a and system_b, for me these are partitions 33 and 34
rm 34for the partitions to be recreated with more space you also need to delete userdata and reserve0 (make sure your data is backed up)
rm 36verify all of the partitions are deleted with print and then proceed
Now time to make new partitions, first start by typing
mkpartnow it will ask for a name
Partition name? system_anow it will ask for the filesystem, for system_a it is ext4
File system type? ext4then it will ask for the start, this is the end of the previous partition, in my case it's 930
Start? 930and now it will ask for the end, here I will use 3.1GB as it is a working combo and higher capacities can brick your Pixel
so do start + 3100, for me this is 930 + 3100 which equals 4030
End? 4030type yes and ignore to any messages parted gives you which are warnings and not errors, do NOT type yes if it talks about sectors being moved.
Now let's do it again for system_b
Partition name? system_bit will ask for the filesystem again, for system_b it is ext2
File system type? ext2this time the start is the end of system_a, for me this is 4030
Start? 4030now I will add 3100 to the start so I will do 4030 + 3100 which equals 7130 and that will be the end of system_b
End? 7130again, same warnings as last time
Now we will create the final partition, we will stretch this one out across the final space as it's the users data partition
Partition name? userdatathe filesystem for userdata is ext4
File system type? ext4same again for the start of the new partition, for me this is 7130
Start? 7130for the end take your devices internal storage size and minus the end of the last partition, for me this is 32000 - 7130 which equals 24870
End? 24870and we won't remake reserve0 as it's just reserved space and won't be needed any more.
Now we need to name the partitions so the bootloader can find them
Name? userdataIf everything went well you'll have a partition table which looks something like this.
Now you'll notice that we're missing msftdata, we can add that back to system_a and userdata with a simple command.
set PARTNUMBER msftdata onnow let's do that for the partitions mentioned above
set 33 msftdata on
set 35 msftdata onIf all has gone well your partitions should look something like this
And you're done!
Reboot into TWRP and if everything went well you can format data and wipe system just fine
Continue to part 2 to install OxygenOS