|
36 | 36 | ``` |
37 | 37 | + You will get something like this: |
38 | 38 | ```bash |
39 | | - /sdcard/dualboot# magiskboot unpack boot.img |
| 39 | + /sdcard/dualboot# /data/adb/magisk/magiskboot unpack boot.img |
40 | 40 | Parsing boot image: [boot.img] |
41 | 41 | HEADER_VER [1] |
42 | 42 | KERNEL_SZ [41576325] |
|
55 | 55 | /sdcard/dualboot# ls |
56 | 56 | boot kernel kernel_dtb ramdisk.cpio |
57 | 57 | ``` |
58 | | - |
| 58 | +::: TIP |
| 59 | +Please do not patch a patched kernel. |
| 60 | +::: |
59 | 61 | - Apply patch with dualboot kernel patcher. |
60 | 62 | + Assume the patcher and shellcodes and config you downloaded above was saved at `/sdcard/Download/` |
61 | | - + Unpack these zips: |
| 63 | + + Unpack these zips with these cmds, or extract in file manager. |
| 64 | + ``` |
| 65 | + unzip /sdcard/Download/Shellcodes.zip |
| 66 | + unzip /sdcard/Download/DualBootKernelPatcher-Linux-arm64.zip |
| 67 | + unzip /sdcard/Download/Config.zip |
| 68 | + ``` |
| 69 | + + Give permission to dualboot kernel patcher |
| 70 | + ```bash |
| 71 | + mv DualBootKernelPatcher ~/ |
| 72 | + chmod +x ~/DualBootKernelPatcher |
| 73 | + ``` |
| 74 | + + Patch kernel with a shellcode. |
| 75 | + ```bash |
| 76 | + ./DualBootKernelPatcher /sdcard/dualboot/patched_kernel <Path-to>/SM8150_EFI.fd /sdcard/dualboot/kernel <Path-To>/Config/DualBoot.Sm8150.cfg <Path-To>/ShellCode.XXXX.bin |
| 77 | + ``` |
| 78 | + + Repack boot image with patched kernel |
| 79 | + ```bash |
| 80 | + cd /sdcard/dualboot/ |
| 81 | + mv patched_kernel kernel |
| 82 | + /data/adb/magisk/magiskboot repack boot.img |
| 83 | + ``` |
| 84 | + + You will get a file named `new-boot.img` if magiskboot success. |
| 85 | + |
| 86 | +- Test with fastboot. |
| 87 | + + Send `new-boot.img` to your computer: |
| 88 | + ```pwsh |
| 89 | + adb pull /sdcard/dualboot/new-boot.img |
| 90 | + ``` |
| 91 | + + Reboot to fastboot |
| 92 | + ```pwsh |
| 93 | + adb reboot bootloader |
| 94 | + ``` |
| 95 | + + Ensure OS-switch is on the correct state before it loading. Like magnet shell or tri-state key. |
| 96 | + + Try load boot image once. |
| 97 | + ```pwsh |
| 98 | + fastboot boot new-boot.img |
| 99 | + ``` |
| 100 | + + See if the device is entering a correct os. |
| 101 | + |
| 102 | +- Flash boot image into disk |
| 103 | + + If everything goes well and boot image was backuped. You can flash boot image into disk now. Then no fastboot command is required when using dualboot. |
| 104 | + + Flash boot: |
| 105 | + ```pwsh |
| 106 | + fastboot flash boot new-boot.img |
62 | 107 | ``` |
63 | | - unzip /sdcard/Download/ |
| 108 | +- Recover original boot image: |
| 109 | + + If you want to remove dualboot, flash your backuped boot image. |
| 110 | + ```pwsh |
| 111 | + fastboot flash boot.img |
64 | 112 | ``` |
65 | 113 |
|
66 | | -- |
| 114 | +## Remove dualboot |
| 115 | +Run `DualBootPatchRemover` on the patched kernel and rebuild the boot image. After flashing to boot parition the dualboot feature will disappear. |
0 commit comments