-
Notifications
You must be signed in to change notification settings - Fork 11.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to Unpack RockChip Boot Image #755
Comments
Same problem with another Rockchip device - Beelink R89 (RockChip RK3288). Firmware files (including TWRP recovery and stock boot.img): |
@DarknessChild's "boot.img" isn't normal, even for RK. It's possibly just a raw ramdisk without any header. Not sure what you can do with that. @omgiafs's "boot.img" and "recovery.img" are in the normal RK KRNL headered format, which is basically just a normal .cpio.gz ramdisk signed with their rkcrc tool. "kernel.img" is the uncompressed(?) kernel Image, also apparently signed with rkcrc. The latter is definitely easy to support, since I already support it in AIK and AK2; basically just skipping 8 bytes to dump the ramdisk past the header, then signing it with rkcrc on repack, and presumably you could do something similar with the kernel Image (if that's even needed). rkcrc source is here: https://github.com/rockchip-linux/rkflashtool |
This comment has been minimized.
This comment has been minimized.
Having similar issues with the NanoPC-T4. Any updates? Love this product BTW! |
Same device with same problem...... |
Same problem here with NanoPC-T4 ... |
Same problem with RK3328 |
I can unpack alle the needed files manually. Just dont know how to manually deploy Magisk into this system. I can also get a root Shell on the running system with adb. One of these options would allow me to manually install magisk? |
Just use "dd" command in root shell to overwrite patched image to boot block dd if=/sdcard/patched_boot.img of=/dev/block/platform/soc/7824900.sdhci/by-name/boot Reboot the device,and you should have it rooted with Magisk. |
@zengpinyi No i mean manually insert Magisk into the image. Since we can manually unpack the boot.img and repack and resign it. |
Another fun trick is, using AIK-mobile, to unpack the ramdisk, then just take the whole ramdisk.cpio.gz, put it in a generic AOSP format boot.img. Then have Magisk Manager patch that, and then unpack magisk_patched.img to get the patched ramdisk.cpio.gz and then repack it as RK in AIK-mobile again. 👍 That said, @topjohnwu has said he will likely support RK "KRNL" headered images, since rkcrc is pretty trivial code, but it's not a priority. |
@osm0sis |
Hi all, just successfully completed all the steps suggested by @osm0sis but now...what to do more? After new patched boot has been flashed, system restarted, Magisk Manager (just installed) says "Magisk not installed".....probably I miss some further steps, please guide me. thank you all |
@traversone You could try version 18 if that's the case |
I have used latest 19.1 version meaning that I patched the (modified in AIK as suggested earlier) with Manager 7.1.2 ! Now you are suggesting to patch the same (AOSP wise) file with Manager 6.1.0, aren't you? thank you |
@traversone |
sure, I will try again! So, our expectaion is that - by simply flashing proper boot.img - Manager running in the System will see the root working. thanks |
@traversone i tried 7.1.2 too. Same result: Magisk not found |
..which steps have you followed? I am a bit suprised as - once the AOSP boot.img is repacked with "boot_ori.img-ramdisk.cpio.gz" file taken from KRNL boot.img and overwritten to the original - a new "ramdisk-new.cpio.gz" appears in the AIK root directory. What is this? |
@traversone Then replaced the ramdisk with the patched one and created a RK boot image and flashed it to the device. I dont know if there are other steps that need to be done after this. Ill check the filesystem of the device when i get home and see if the Magisk binaries are on the system. |
Manager 7.0.0 needs (mandatory?) to be upgraded to 7.1.2 thus making impossible to patch the boot.img.....I really hope @topjohnwu will manage to make his fantastic tool able to work with such kind of images! |
I have done like osm0sis told and it works very well with last version. My rockchip device is a px3 car unit with android 7.1 |
@tugaz |
First I unpacked in AIK windows my AOSP recovery.img, after I copyed the split_img files from this img to another folder with my unpacked boot.img and packed in AOSP format, then I exported my boot.img to my device, then patched in magisk, unpack it with AIK-mobile, change the imgtype file from AOSP to KRNL, repack it again and flashed in my device and it works fine. |
How to change the image format? Sorry for the stupid question maybe |
@tugaz I cant unpack the image i have for my device with AIK I used rkunpack to extract the recovery image and got the boot.img and kernel.img of that |
I used recovery image from my device that is AOSP format. |
Ok. Mine wont unpack in AIK :( |
I think that you can use the split_img files from any AOSP image to use in your boot image but I not sure of that |
hmk. I reflashed it manually (the patched patched boot.img) with dd When i dump the bootimg from my device, and i unpack it, i see the smaller init file that magisk installes (326 kb) when i look on my device with adb shell i see when i do ls -al / anyone know whats going on ? :) edit: weird.. the files are there.. magisk is just not starting |
On what System did you patch the boot.img ? I had the same problem .. made a boot.img with the ramdisk from the rk image and patched it on a 64bit qcom device ... so magisk replaced the init file in the ramdisk with the 64bit version but my rk was 32bit so it could not work... |
I patched it on my rockchip device, so the target device. I will try your suggestions tho. Thanks Edit: turns out the SoC is 64bit but the OS is 32bit. I looked at dmesg | grep magisk and see the folowwing. dmesg log is here |
I patched a Rockchip RK3328 Oreo boot.img and Magisk works sometimes. Magisk 19.1 Canary build also never gives the popup message that Additional setup is required like in older 17.1 versions, So that is also a bug. So what is different in a 'Restart' compared to a cold boot/power on that Magisk Manager says it's not installed? I think Magisk might be loaded too early in the boot process or maybe something to do with the 64-bit patched boot.img files that have a problem compared to 32-bit? Magisk is fully supported on Rockchip on Android Pie firmware by Rockchip themselves. Here is a logcat of Magisk 19.1 Canary build on RK3328 Oreo when it worked and I used 'Restart' after power on. We really need to get it working on earlier Android OS's correctly so it doesn't say 'Magisk is not installed' with a manually patched boot.img. @topjohnwu Please check the Magisk issue on Rockchip devices, mounting to early, Magisk not loaded, Rockchip krnl repacking support etc. |
@mo123 Im on android 8.1 |
Can you also try - TvSettings - About - Restart then wait 2 minutes and open Magisk Manager again a few times? Here is my patched boot.img for RK3328 Oreo, unzip it first. |
For me it worked once, and it told me that Additional setup is required, so i think my bootimg is patched correctly. I will try the 2 minutes after restart when i get home. Edit: fun fact is i wanted to install magisk to use the Sony Framework module, which isn't even updated for 19.1 lol. update:I couldnt get magisk to work. |
I'm using a Libre Renegade with a RK3328, 4GB. OS is Station OS, Android 7.1. The on-board recovery is basically useless since it wants you to use vol up/down and those keys don't exist. I managed to use the latest Magisk Manager to patch the boot.img from the last update.zip and applied it with the proprietary 'upgrade_tool' for RockUSB mode. It applies, but the system won't boot and I'm stuck at recovery. Using upgrade_tool to flash the original boot.img lets it boot. Magisk displays no errors patching the file. Any ideas where to start? |
@uudruid74 If IT says AOSP change it to KRNL and repack the image and flash it to your device. |
#1595 Related issue, Magisk Manager cannot determine RockChip boot image location. |
The new Magisk Manager correctly identifies that it doesn't understand this format. Unpacking it shows it to be in AOSP format. Changing it to KRNL format drops the size down to about 1/10, so I'm guessing some information is lost. I need to put this back into the upgrade.zip (if Magisk ever recognizes it). However, this unpack/change format/repack doesn't give me a format that Magisk understands. I just want to root this thing! Is there another way? |
The boot partiton is 32MB i think (OR 16, dont remember exactly). But most of it is empty. So when u repack it it strips all.the empty data at the end. Mine ends up about 1.6 MB i think. When its patched with magisk repack it to KRNL format and Just dd it to the boot partition |
I was able to successfully install magisk on Android 8.1, RockPro64 (Rockchip3399) using the directions by @tugaz and @osm0sis
|
I tried to follow along with these steps using the Linux/macOS version and the mobile version of AIK but so far I've had no luck. I have an RK3229 board on 8.1 Oreo, that came factory rooted with koush's Superuser. I'll supply my boot.img if anyone can help with this. Then comes the fun part of removing Superuser and the su binary without TWRP (since I don't have it) and without bricking :/ Thanks for anyone's help. I really appreciate it. |
After evaluating the effort of bringing up support for Rockchip, I have decided not to spend time on such drastically different image format, as it requires significant code changes. |
Hi, I got an Onyx Boox Nova which is Android 6.0.1 on RK3288. Since the device has no TWRP therefore I used the Magisk Manager method. Here are my steps:
But my device it goes to recovery directly after the reboot. I have to flash the original boot.img back to the system in order to get the system back to work. There are several questions I would like to seek help from the experts
Thanks in advance I attached the boot.zip as a backup. |
In addition I did the following procedure:
And it won't boot. So I am not sure if the repack tool really can generate a boot.img the device needed. |
I followed these steps only to be met with an error at number 4 :/
|
Help me when i am patching my boot.img through magisk manager it is saying unable to unpack /unknown image format please help me. I am providing you my boot.img please help me. |
The image header is OPPOENCRYPT! So unless you can decrypt it first you won't be able to patch it. Also don't necro-bump old unrelated issues. |
Device: Geekbox (RockChip RK3368)
Attempted to modify boot.img from Magisk Manager
Android 6.0.1
Log:https://drive.google.com/open?id=1bRc4r5AzXdjS1AdK4KLvM8VoXSaCOJgU
boot.img: https://drive.google.com/open?id=1vKl74AqkbvjpKVwQO5mn31ggk-Q_iNe-
The text was updated successfully, but these errors were encountered: