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
- Clone this repo and enter it's directory
- Run
make
- Extract boot.img (RAMDISK.img for Huawei) from phone
- Remove the AVB Footer. One method is by installing Magisk.
- Copy the boot.img without the AVB footer into this directory
- Run
sudo python3 main.py
- 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
- Download the zip file for the system
- Extract it.
- If there are any .br files, extract them too (brotli)
- Use https://github.com/xpirt/sdat2img to covert it to a system.img
- Send this system.img to the phone
- 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
- Exit the twrp shell and enter File Manager
- Navigate to /mnt/tmp
-
- Click the blue folder icon in the bottom right corner.
- Select 'Copy'
- Navigate to /system/(a|b) (make the folder if it doesn't exist)
- Click the blue folder icon again and paste the files. This will take a while.
- Reboot System!
Bugs
- Some samshit's fail the boot.img md5 check, mostly because they're samshit. This can be bypassed by removing the md5 check, but, be warned, it IS there for YOUR safety!