OnePlus 6 (oneplus-enchilada)/Dual Booting and Custom Partitioning

Spliting userdata for a/b slot dual booing
Using a modified recovery, it is possible to split the userdata partition. (Keep in mind to first use Android 9-based recovery, and match the version mentioned in the modified recovery's name, as suggested in the link above)

A/B partitioning was tested and works perfectly with FDE enabled on pmOS and FBE enabled on Android, although data sharing will not work with an A/B partition layout if encryption is used. A common data partition may be possible with the A/B/C layout option available. Since the pmOS initramfs searches for a partition label instead of a specific partition, it will automatically detect the partition that the pmOS rootfs was installed to.

Reverting back to stock partition layout from spliting userdata
Reverting to a stock partition layout from the modified userdata layout is extremely simple. Simply boot into TWRP on either slot, push the Dualboot mod to /tmp/ as before, and flash. When the installer asks if you would like to keep your current layout, select no, and then select the stock layout when prompted. Follow the rest of the instructions as you would like (if you are going to be reflashing OOS afterwards, these options do not matter).

Partitioning for booting pmos via Renegade Project
First remove unused partition (see )

Then create two partition : pmOS_boot and pmOS_root (see Partition Layout)

Partitioning for dual booting pmos with other uefi based os (like openbsd, netbsd, freebsd,windows,etc) via Renegade Project
First fellow

Next create partition for your uefi based os needed (for example : openbsd, netbsd , freebsd ,windows useually need 2 partition : uefi/boot partition , root partition).

Erasing unused partitions/Custom formatting
It is safe to wipe partitions /dev/sda13-17 (system_a, system_b , odm_a , odm_b , userdata) without any harm being done to the bootloader (on oneplus 6t you can only can remove /dev/sda17. Removing /dev/sda13-16 will cause the bootloader cant boot anything). Erasing these partitions will leave only mainline kernels bootable.

Since only advanced users should be doing this, no detailed instructions are going to be provided in this guide (ie: no copy/pasting Terminal commands). man pages are helpful here if you do not know how to use a tool.

First thing's first: You must have a working aarch64 binary of sgdisk or parted. If you have an OS of any kind installed to your phone, you can get it from there. Find a way to run that binary in a Terminal on your device. Custom android recovery (like orange fox, twrp) , a mainline Linux liveboot (pmOS supports netboot) or a custom postmaketos android boot image that has the debug shell enabled and has included the parted or sgdisk.they will work as long as nothing is accessing the device storage.(For some reason parted error out on custom android recovery when doing custom partition.)

Using sgdisk or parted, delete partitions /dev/sda13 (or /dev/block/sda13 if using TWRP) through /dev/sda17.

Using sgdisk ot parted, create whatever partitions you want, then change the labels to whatever you want. Syboxez choses to create two partitions of different sizes: one named 'rootfs_stable' for postmarketOS, and one named 'rootfs_test' for other mainline distros. Make sure your labels do not conflict with any existing partitions.

After creating the partitions, fastboot will successfully flash images to those partitions using the labels you assigned to them. So for instance, 'pmbootstrap flasher flash_rootfs -- partition rootfs_stable' would work fine, along with using 'fastboot flash rootfs_temp linuxdistrotwoelectricboogaloo.img' Converting to sparse images isn't necessary, since fastboot will do that for you.

Reverting to stock partition
To revert to stock, MsmDownloadTool or bkerler's edl tool with an extracted ops is necessary. Normal unbricking instructions through EDL mode apply here. If for any reason, it is impossible to access EDL mode anymore by plugging in a USB cable while the phone is off and volume up is being held down, then the phone is bricked.

Dual boot pm os with android via a/b slot
To install Android on slot A and pmOS on slot B: (NOTE: if you would like to use Jumpdrive, then you will need to put pmOS on Slot A)


 * Remember that all zips will always flash to the opposite slot.
 * First, install the latest version of OOS 10 onto both slots via recovery, or via stock local upgrade. (In Syboxez cases, it was possible to just install LineageOS in both slots, which allows to skip the next step and installing Android custom ROM later on.)
 * Because OOS 10 was installed, "fastboot boot" will stop working, so you may need to flash a working recovery (such as LineageOS recovery) to either boot_a or boot_b (or just boot to flash to your current slot) partitions from fastboot is necessary.

fastboot flash boot lineageos-18.1-202xxxxx-enchilada-recovery.img


 * Select Reboot Recovery and sideload a working version of TWRP.

adb sideload twrp-3.4.0-3-enchilada-installer.zip

adb push Dualboot_TWRP_OP6_enchilada_v6_2.zip /tmp/
 * Reboot recovery. Push the Dualboot zip:

For encryption, keep slot B as-is, and make sure you select no for Magisk on slot B. Options for Slot A are up to the user. If you would like file-based encryption enabled, you will have to manually patch the fstab. adb shell mount /dev/block/sde16 /vendor #Mounts vendor_a to /vendor adb pull /vendor/etc/fstab.qcom ./ adb push ./fstab.qcom /vendor/etc/fstab.qcom
 * Now in TWRP, install and navigate to /tmp/Dualboot_TWRP_OP6_enchilada_v6_2.zip and install it. Select the options that you would like.
 * After installation, Reboot to recovery. Go to reboot, select Slot B, and reboot to recovery again.
 * Install the Android ROM you would like, then without rebooting, reflash the Dualboot mod to repatch the boot.img with the recovery ramdisk.
 * Reboot to recovery again.
 * Currently, there seems to be a bug with the Dualboot installer, where it will always disable encryption on Android.
 * 1) If you want encryption enabled in Android:
 * In the line that mounts userdata, there will be an option listed as such: "... ,=ice, ...". If you would like encryption enabled, change that to "fileencryption=ice" and push it back with
 * 1) If you want encryption enabled in Android:

Install any addons you may want (GApps if you need them, for example). Format data (do not just wipe Internal Storage) and reboot.
 * Select reboot and make sure Slot A is the current slot, then back out without rebooting.
 * Once Android boots, verify that your phone is either encrypted or not encrypted (depending on what you wanted) and reboot to the bootloader.

To flash postmarketOS to slot B, follow the general OP6 pmbootstrap install instructions (optionally with --fde to enable full disk encryption) and flash: fastboot --set-active=b fastboot erase dtbo_b pmbootstrap flasher flash_rootfs --partition userdata_b pmbootstrap flasher flash_kernel --partition boot_b fastboot reboot

You should now be booting into postmarketOS.
 * Note: Make sure OTA updates are disabled in your Android ROM. It will mess with things if it is not.
 * Note: In mainline Linux, userdata_a is /dev/sda17 and userdata_b is /dev/sda18

On the go
To reboot to pmOS from Android: To boot Android from pmOS, use command: sudo qbootctl -s a
 * either use bundled Dualboot Companion app (note - it did not work for me, because Syboxez did not root my Android ROM)
 * or simply boot the recovery, go to Reboot, switch to the opposite slot then pick Reboot and Do not install.

Using fastboot
To switch to Android, reboot to bootloader, and use fastboot to switch slots:

fastboot --set-active=[a|b] fastboot reboot

Updating Android
Updating Android is a bit more of a pain, since Android ROMs are always flashed to the opposite slot.
 * Backup your pmOS boot.img (located at /boot/boot.img in pmOS) to your PC.
 * Grab this script (adapted from LineageOS original), which will copy your boot and dtbo partitions from Slot A to Slot B, temporarily overwriting the pmOS kernel/initram.
 * Boot into TWRP on your Android slot (Slot A in this case) and start sideloading:

adb sideload copy-boot.zip


 * Switch to your pmOS slot (Slot B in this case), reboot to recovery, update your ROM, flash the Dualboot mod again, repatch the fstab on vendor_a in Slot A recovery for encryption if necessary (or just copy back the one you modified before), install GApps/other addons in Slot A if necessary, and reboot to bootloader.
 * Reflash the pmOS kernel:

fastboot --set-active=b fastboot erase dtbo_b

fastboot flash boot_b /path/to/backup/pmOS/boot.img
 * 1) If you have a pmOS boot.img backup:

pmbootstrap flasher flash_kernel --partition boot_b
 * 1) Alternatively if you did not make a boot.img backup (do not run the command below if you ran the command above this line):

fastboot reboot

Dual booting pmos with other uefi based os (like openbsd, netbsd, freebsd,windows,etc) via Renegade Project
By default, pm os utilize subpartitions to fit the boot partition (pmOS_boot) and root partition (pmOS_root) into a one normal partiton on oneplus 6/6t and many device (see Partition Layout).That partition scheme isnt suitable for booing pm os via Renegade Project because of leak of uefi partition so you need to convert pm os "subpartitions" partition scheme to "Use the whole storage device" partition scheme. (pmOS_boot had to be fat32/16). After that you you need to add pm os to Renegade Project boot menu or  install a uefi bootloader to pm os.(if you want the aduio to work, do the first one )

After all that, you need to install other uefi based os by fellow their guies.If you done all that correctly , you should saw a boot entry for other uefi based os in Renegade Project.

Dual booting pmos with other uefi based os and android (like openbsd, netbsd, freebsd,windows,etc) via Renegade Project and slot A/B
First install android in slot a (See [#Dual boot pm os with android via a/b slot] )

Next install Renegade Project slot b

Then fellow