This is a collection of scripts that will patch your ramdisk (part of the kernel) to allow you do dualboot your Android phone.
- It boots and works correctly on my Project Treble phone on both Oreo and Pie
- You can install magisk over the patched ramdisk, and it works.
- Android works and no noticable bugs are created
- Bluetooth pairings are lost every time you switch data (Needs Confirmation)
- On some weird devices (that don't conform to google specs) there is a risk that the boot.img requires AVB to work. This is also the case on Huawei's patch01 if I understand correctly. Currently, the system will simply pad the AVB field with nulls. This means that the checksum will fail if your device has a non-null AVB field (aka stock, unpatched boot.img). This will be fixed in a later release, as it will fail the checksum check.
- Clone this repo
- Get the file containing your ramdisk from the phone or stock rom and put it in this folder with the name
boot.img
make
- Run as either
fakeroot
(unsupported) or root (eithersudo
orsu
):python3 main.py
- The output will be generated in
boot.img-repack
- Copy this file to the phone and flash it to the same partition it came from. Various checks are conducted to ensure it won't brick the phone.
- Wipe data and cache in TWRP
- Reboot!
https://github.com/penn5/DualBootInstaller will do it automatically.
- 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!
- If it is booting, get /dev/mounts - this is a tmpfs with all the logs in
- If it isn't booting, send the
ramdisk
folder relative to this file.