DualBootPatcher Docs

This program is designed to run on Linux, and will patch a boot.img file to support dual-booting

It uses the osm0sis mkbootimg tools to unpack and repack the bootimg. It uses home-written scripts to enable the actual dual-booting though.

Dependencies

Usage

  1. Clone this repo and enter it's directory
  2. Run
    make
  3. Extract boot.img (RAMDISK.img for Huawei) from phone
  4. Remove the AVB Footer. One method is by installing Magisk.
  5. Copy the boot.img without the AVB footer into this directory
  6. Run
    sudo python3 main.py
  7. Now there is a file boot.img-repack. Install it to the same partition it came from.

Installing a dual system

The way that the dualbooter works is by mounting /system/[ab] over /system. This means that whatever files you put in /system will be perfectly replicated to /system (including symlinks). It does the same to /data and /cache

Installing a system

Try this for an automated installation

  1. Download the zip file for the system
  2. Extract it.
  3. If there are any .br files, extract them too (brotli)
  4. Use https://github.com/xpirt/sdat2img to covert it to a system.img
  5. Send this system.img to the phone
  6. Enter the twrp shell (Advanced --> Terminal) and run (replacing paths with the correct ones) rm -rf /mnt/tmp;mkdir /mnt/tmp;mount -o loop -t auto /path/to/system.img /mnt/tmp
  7. Exit the twrp shell and enter File Manager
  8. Navigate to /mnt/tmp
  9. Click the blue folder icon in the bottom right corner.
  10. Select 'Copy'
  11. Navigate to /system/(a|b) (make the folder if it doesn't exist)
  12. Click the blue folder icon again and paste the files. This will take a while.
  13. Reboot System!

Bugs