topjohnwu / Magisk

The Magic Mask for Android
GNU General Public License v3.0
45.84k stars 11.54k forks source link

Modules not loaded on VirtualBox Android x86 #2551

Closed ghost closed 4 years ago

ghost commented 4 years ago

I have a Android x86_64 on VirtualBox. I patched ramdisk.img and magisk 20.3 start without issue. I tried to install some modules as riru core, riru xposed and others but after reboot the module is not loaded. In log I can't see nothing.

1|x86_64:/sbin # cat /cache/magisk.log                                                                                                                                                                            
--------- beginning of main
--------- beginning of system
03-16 08:47:12.128  1172  1172 I Magisk  : Magisk v20.3(20300) daemon started
03-16 08:47:12.128  1172  1172 I Magisk  : * Device API level: 27
03-16 08:47:12.139  1172  1173 I Magisk  : ** late_start service mode running
03-16 08:47:16.223  1172  1659 I Magisk  : ** boot_complete triggered
KaMyKaSii commented 4 years ago

Before reporting bugs you need to try Magisk Canary to ensure that the bug exists or not on the current code. Anyway, I believe that this problem has already been solved, as you can see in this report

ghost commented 4 years ago

I installed and tried canary version (debug), same result in the list of installed modules: No modules found.

Installation riru-core

x86_64:/ # cat /cache/magisk.log                                                                                                                                                                                  
--------- beginning of main
--------- beginning of system
03-18 11:39:54.863  1074  1074 I Magisk  : Magisk v72f6770d(20307) daemon started
03-18 11:39:54.863  1074  1074 I Magisk  : * Device API level: 27
03-18 11:39:54.873  1074  1075 D Magisk  : resetprop: getprop [ro.crypto.state]: [unsupported]
03-18 11:39:54.874  1074  1075 D Magisk  : resetprop: getprop [init.svc.vold]: [running]
03-18 11:39:54.884  1074  1075 I Magisk  : ** post-fs-data mode running
03-18 11:39:54.886  1074  1075 I Magisk  : * Initializing Magisk environment
03-18 11:39:55.096  1074  1075 I Magisk  : * Mounting mirrors
03-18 11:39:55.096  1074  1075 E Magisk  : stat /dev/loop0 failed with 2: No such file or directory
03-18 11:39:55.097  1074  1075 E Magisk  : mount /sbin/.magisk/block/system->/sbin/.magisk/mirror/system failed with 2: No such file or directory
03-18 11:39:55.097  1074  1075 I Magisk  : mount: /sbin/.magisk/mirror/system <- /sbin/.magisk/block/system
03-18 11:39:55.097  1074  1075 I Magisk  : mount: /sbin/.magisk/mirror/data <- /sbin/.magisk/block/data
03-18 11:39:55.097  1074  1075 I Magisk  : link: /sbin/.magisk/mirror/vendor <- /sbin/.magisk/mirror/system/vendor
03-18 11:39:55.097  1074  1075 I Magisk  : * Setting up internal busybox
03-18 11:39:55.170  1074  1075 I Magisk  : * Running post-fs-data.d scripts
03-18 11:39:55.170  1074  1075 I Magisk  : Upgrade / New module: riru-core
03-18 11:39:55.171  1074  1075 E Magisk  : mount /sbin/.magisk/mirror/data/adb/modules->/sbin/.magisk/modules failed with 2: No such file or directory
03-18 11:39:55.172  1074  1075 I Magisk  : * Running module post-fs-data scripts
03-18 11:39:55.172  1074  1075 I Magisk  : riru-core: exec [post-fs-data.sh]
03-18 11:39:55.232  1074  1075 I Magisk  : * Loading modules
03-18 11:39:55.534  1074  1133 I Magisk  : ** late_start service mode running
03-18 11:39:55.534  1074  1133 I Magisk  : * Running service.d scripts
03-18 11:39:55.534  1074  1133 I Magisk  : * Running module service scripts
03-18 11:40:47.265  1074  1627 I Magisk  : ** boot_complete triggered
03-18 11:40:59.029  1074  2006 D Magisk  : su: request from pid=[2003], client=[6]
03-18 11:40:59.029  1074  2006 D Magisk  : su: request from uid=[10071]
03-18 11:40:59.259  1074  2006 D Magisk  : su: waiting child pid=[2012]
03-18 11:40:59.259  2012  2012 D Magisk  : su: fork handler
03-18 11:40:59.259  2012  2012 D Magisk  : su: use global namespace
03-18 11:41:27.381  1074  3582 D Magisk  : su: request from pid=[3581], client=[7]
03-18 11:41:27.381  1074  3582 D Magisk  : su: request from uid=[2000]
03-18 11:41:37.631  1074  3582 D Magisk  : su: waiting child pid=[3708]
03-18 11:41:37.633  3708  3708 D Magisk  : su: fork handler
03-18 11:41:37.634  3708  3708 D Magisk  : su: pts_slave=[/dev/pts/1]
03-18 11:41:37.634  3708  3708 D Magisk  : su: use namespace of pid=[3581]

Installation riru-edxposed

x86_64:/ # cat /cache/magisk.log                                                                                                                                                                                  
--------- beginning of main
--------- beginning of system
03-18 11:45:03.036  1074  1074 I Magisk  : Magisk v72f6770d(20307) daemon started
03-18 11:45:03.036  1074  1074 I Magisk  : * Device API level: 27
03-18 11:45:03.047  1074  1075 D Magisk  : resetprop: getprop [ro.crypto.state]: [unsupported]
03-18 11:45:03.047  1074  1075 D Magisk  : resetprop: getprop [init.svc.vold]: [running]
03-18 11:45:03.058  1074  1075 I Magisk  : ** post-fs-data mode running
03-18 11:45:03.060  1074  1075 I Magisk  : * Initializing Magisk environment
03-18 11:45:03.250  1074  1075 I Magisk  : * Mounting mirrors
03-18 11:45:03.250  1074  1075 E Magisk  : stat /dev/loop0 failed with 2: No such file or directory
03-18 11:45:03.250  1074  1075 E Magisk  : mount /sbin/.magisk/block/system->/sbin/.magisk/mirror/system failed with 2: No such file or directory
03-18 11:45:03.250  1074  1075 I Magisk  : mount: /sbin/.magisk/mirror/system <- /sbin/.magisk/block/system
03-18 11:45:03.251  1074  1075 I Magisk  : mount: /sbin/.magisk/mirror/data <- /sbin/.magisk/block/data
03-18 11:45:03.251  1074  1075 I Magisk  : link: /sbin/.magisk/mirror/vendor <- /sbin/.magisk/mirror/system/vendor
03-18 11:45:03.264  1074  1075 I Magisk  : * Setting up internal busybox
03-18 11:45:03.336  1074  1075 I Magisk  : * Running post-fs-data.d scripts
03-18 11:45:03.348  1074  1075 I Magisk  : Upgrade / New module: riru_edxposed
03-18 11:45:03.348  1074  1075 E Magisk  : mount /sbin/.magisk/mirror/data/adb/modules->/sbin/.magisk/modules failed with 2: No such file or directory
03-18 11:45:03.363  1074  1075 I Magisk  : * Running module post-fs-data scripts
03-18 11:45:03.363  1074  1075 I Magisk  : riru-core: exec [post-fs-data.sh]
03-18 11:45:03.393  1074  1075 I Magisk  : riru_edxposed: exec [post-fs-data.sh]
03-18 11:45:11.326  1074  1075 I Magisk  : * Loading modules
03-18 11:45:11.326  1074  1075 I Magisk  : riru_edxposed: loading [system.prop]
03-18 11:45:11.327  1074  1075 D Magisk  : resetprop: Parse prop file [/data/adb/modules/riru_edxposed/system.prop]
03-18 11:45:11.343  1074  1075 D Magisk  : resetprop: New prop [dalvik.vm.dex2oat-filter]
03-18 11:45:11.344  1074  1075 D Magisk  : resetprop: setprop [dalvik.vm.dex2oat-filter]: [quicken] by modifing prop data structure
03-18 11:45:11.344  1074  1075 D Magisk  : resetprop: New prop [dalvik.vm.dex2oat-flags]
03-18 11:45:11.344  1074  1075 D Magisk  : resetprop: setprop [dalvik.vm.dex2oat-flags]: [--inline-max-code-units=0] by modifing prop data structure
03-18 11:45:11.344  1074  1075 I Magisk  : riru_edxposed: constructing magic mount structure
03-18 11:45:11.344  1074  1075 E Magisk  : opendir: /sbin/.magisk/mirror/system/framework failed with 2: No such file or directory
03-18 11:45:11.344  1074  1075 E Magisk  : opendir: /sbin/.magisk/mirror/system/lib failed with 2: No such file or directory
03-18 11:45:11.344  1074  1075 E Magisk  : opendir: /sbin/.magisk/mirror/system/lib64 failed with 2: No such file or directory
03-18 11:45:11.344  1074  1075 E Magisk  : mount /sbin/.magisk/modules/riru_edxposed/system/bin/app_process32->/system/bin/app_process32 failed with 2: No such file or directory
03-18 11:45:11.344  1074  1075 I Magisk  : bind_mount: /system/bin/app_process32 <- /sbin/.magisk/modules/riru_edxposed/system/bin/app_process32
03-18 11:45:11.344  1074  1075 E Magisk  : mount /sbin/.magisk/modules/riru_edxposed/system/bin/app_process64->/system/bin/app_process64 failed with 2: No such file or directory
03-18 11:45:11.344  1074  1075 I Magisk  : bind_mount: /system/bin/app_process64 <- /sbin/.magisk/modules/riru_edxposed/system/bin/app_process64
03-18 11:45:11.766  1074  1215 I Magisk  : ** late_start service mode running
03-18 11:45:11.767  1074  1215 I Magisk  : * Running service.d scripts
03-18 11:45:11.944  1074  1215 I Magisk  : * Running module service scripts
03-18 11:45:55.156  1074  1704 I Magisk  : ** boot_complete triggered

installation MagiskHidePropsConf

x86_64:/ # cat /cache/magisk.log                                                                                                                                                                                  
--------- beginning of main
--------- beginning of system
03-18 11:51:56.139  1074  1074 I Magisk  : Magisk v72f6770d(20307) daemon started
03-18 11:51:56.139  1074  1074 I Magisk  : * Device API level: 27
03-18 11:51:56.150  1074  1075 D Magisk  : resetprop: getprop [ro.crypto.state]: [unsupported]
03-18 11:51:56.150  1074  1075 D Magisk  : resetprop: getprop [init.svc.vold]: [running]
03-18 11:51:56.162  1074  1075 I Magisk  : ** post-fs-data mode running
03-18 11:51:56.163  1074  1075 I Magisk  : * Initializing Magisk environment
03-18 11:51:56.399  1074  1075 I Magisk  : * Mounting mirrors
03-18 11:51:56.400  1074  1075 E Magisk  : stat /dev/loop0 failed with 2: No such file or directory
03-18 11:51:56.400  1074  1075 E Magisk  : mount /sbin/.magisk/block/system->/sbin/.magisk/mirror/system failed with 2: No such file or directory
03-18 11:51:56.400  1074  1075 I Magisk  : mount: /sbin/.magisk/mirror/system <- /sbin/.magisk/block/system
03-18 11:51:56.400  1074  1075 I Magisk  : mount: /sbin/.magisk/mirror/data <- /sbin/.magisk/block/data
03-18 11:51:56.400  1074  1075 I Magisk  : link: /sbin/.magisk/mirror/vendor <- /sbin/.magisk/mirror/system/vendor
03-18 11:51:56.413  1074  1075 I Magisk  : * Setting up internal busybox
03-18 11:51:56.478  1074  1075 I Magisk  : * Running post-fs-data.d scripts
03-18 11:51:56.486  1074  1075 I Magisk  : Upgrade / New module: MagiskHidePropsConf
03-18 11:51:56.486  1074  1075 E Magisk  : mount /sbin/.magisk/mirror/data/adb/modules->/sbin/.magisk/modules failed with 2: No such file or directory
03-18 11:51:56.553  1074  1075 I Magisk  : * Running module post-fs-data scripts
03-18 11:51:56.553  1074  1075 I Magisk  : riru-core: exec [post-fs-data.sh]
03-18 11:51:56.593  1074  1075 I Magisk  : riru_edxposed: exec [post-fs-data.sh]
03-18 11:52:04.506  1074  1075 I Magisk  : MagiskHidePropsConf: exec [post-fs-data.sh]
03-18 11:52:04.518  1074  1075 I Magisk  : * Loading modules
03-18 11:52:04.518  1074  1075 I Magisk  : riru_edxposed: loading [system.prop]
03-18 11:52:04.518  1074  1075 D Magisk  : resetprop: Parse prop file [/data/adb/modules/riru_edxposed/system.prop]
03-18 11:52:04.528  1074  1075 D Magisk  : resetprop: New prop [dalvik.vm.dex2oat-filter]
03-18 11:52:04.528  1074  1075 D Magisk  : resetprop: setprop [dalvik.vm.dex2oat-filter]: [quicken] by modifing prop data structure
03-18 11:52:04.528  1074  1075 D Magisk  : resetprop: New prop [dalvik.vm.dex2oat-flags]
03-18 11:52:04.528  1074  1075 D Magisk  : resetprop: setprop [dalvik.vm.dex2oat-flags]: [--inline-max-code-units=0] by modifing prop data structure
03-18 11:52:04.528  1074  1075 I Magisk  : riru_edxposed: constructing magic mount structure
03-18 11:52:04.528  1074  1075 I Magisk  : MagiskHidePropsConf: loading [system.prop]
03-18 11:52:04.528  1074  1075 D Magisk  : resetprop: Parse prop file [/data/adb/modules/MagiskHidePropsConf/system.prop]
03-18 11:52:04.553  1074  1075 I Magisk  : MagiskHidePropsConf: constructing magic mount structure
03-18 11:52:04.553  1074  1075 E Magisk  : opendir: /sbin/.magisk/mirror/system/framework failed with 2: No such file or directory
03-18 11:52:04.553  1074  1075 E Magisk  : opendir: /sbin/.magisk/mirror/system/lib failed with 2: No such file or directory
03-18 11:52:04.553  1074  1075 E Magisk  : opendir: /sbin/.magisk/mirror/system/lib64 failed with 2: No such file or directory
03-18 11:52:04.553  1074  1075 E Magisk  : opendir: /sbin/.magisk/mirror/system/bin failed with 2: No such file or directory
03-18 11:52:04.867  1074  1221 I Magisk  : ** late_start service mode running
03-18 11:52:04.868  1074  1221 I Magisk  : * Running service.d scripts
03-18 11:52:04.886  1074  1221 I Magisk  : * Running module service scripts
03-18 11:52:04.886  1074  1221 I Magisk  : MagiskHidePropsConf: exec [service.sh]
03-18 11:52:49.517  1074  2167 I Magisk  : ** boot_complete triggered
03-18 11:53:03.411  1074  2635 D Magisk  : su: request from pid=[2632], client=[6]
03-18 11:53:03.411  1074  2635 D Magisk  : su: request from uid=[10071]
03-18 11:53:03.704  1074  2635 D Magisk  : su: waiting child pid=[2663]
03-18 11:53:03.704  2663  2663 D Magisk  : su: fork handler
03-18 11:53:03.706  2663  2663 D Magisk  : su: use global namespace
03-18 11:56:47.317  1074  4682 D Magisk  : su: request from pid=[4681], client=[7]
03-18 11:56:47.317  1074  4682 D Magisk  : su: request from uid=[2000]
03-18 11:56:47.365  1074  4682 D Magisk  : magiskdb: query policy=[2] log=[1] notify=[1]
03-18 11:56:47.368  1074  4682 D Magisk  : su: waiting child pid=[4685]
03-18 11:56:47.369  4685  4685 D Magisk  : su: fork handler
03-18 11:56:47.370  4685  4685 D Magisk  : su: pts_slave=[/dev/pts/1]
03-18 11:56:47.370  4685  4685 D Magisk  : su: use namespace of pid=[4681]

directory modules is empty


x86_64:/sbin/.magisk/modules # ls -l
total 0
KaMyKaSii commented 4 years ago

So the problem is not in the loading of the modules, it is in the installation. There is a new commit on the modules installation code, wait for the next update of the Magisk Canary to see if it solves your problem or wait for some response from topjohnwu

ghost commented 4 years ago

@KaMyKaSii sorry for wrong informations, but while the installation of modules I can't see errors on screen, so I thought the issue was on loading. I tested the new version and continue with the same issue


x86:/sbin/.magisk/modules # cat /cache/magisk.log                                                                                                                                                                 
--------- beginning of main
--------- beginning of system
03-19 16:27:57.883  1075  1075 I Magisk  : Magisk vf7142e69(20308) daemon started
03-19 16:27:57.883  1075  1075 I Magisk  : * Device API level: 27
03-19 16:27:57.909  1075  1076 I Magisk  : ** post-fs-data mode running
03-19 16:27:58.837  1075  1076 I Magisk  : * Initializing Magisk environment
03-19 16:27:59.046  1075  1076 I Magisk  : * Mounting mirrors
03-19 16:27:59.047  1075  1076 E Magisk  : stat /dev/loop0 failed with 2: No such file or directory
03-19 16:27:59.047  1075  1076 E Magisk  : mount /sbin/.magisk/block/system->/sbin/.magisk/mirror/system failed with 15: Block device required
03-19 16:27:59.047  1075  1076 I Magisk  : mount: /sbin/.magisk/mirror/system
03-19 16:27:59.047  1075  1076 I Magisk  : mount: /sbin/.magisk/mirror/data
03-19 16:27:59.048  1075  1076 I Magisk  : link: /sbin/.magisk/mirror/vendor
03-19 16:27:59.048  1075  1076 I Magisk  : * Setting up internal busybox
03-19 16:27:59.104  1075  1076 I Magisk  : * Running post-fs-data.d scripts
03-19 16:27:59.105  1075  1076 I Magisk  : Upgrade / New module: riru-core
03-19 16:27:59.105  1075  1076 E Magisk  : mount /sbin/.magisk/mirror/data/adb/modules->/sbin/.magisk/modules failed with 2: No such file or directory
03-19 16:27:59.106  1075  1076 I Magisk  : * Running module post-fs-data scripts
03-19 16:27:59.106  1075  1076 I Magisk  : riru-core: exec [post-fs-data.sh]
03-19 16:27:59.158  1075  1076 I Magisk  : * Loading modules
03-19 16:27:59.567  1075  1132 I Magisk  : ** late_start service mode running
03-19 16:27:59.567  1075  1132 I Magisk  : * Running service.d scripts
03-19 16:27:59.567  1075  1132 I Magisk  : * Running module service scripts
03-19 16:28:39.028  1075  1606 I Magisk  : ** boot_complete triggered
ghost commented 4 years ago

I followed this guide and I convert android x86 8.1 from one partition to 3 partitions (boot, /system and /data), works only with 20.1 after update to 20.3 the previous working modules disappear.

osm0sis commented 4 years ago

2594 might help. You'll have to test again after the next build with it merged.

shakalaca commented 4 years ago

The filesystem layout is kind of weird ..

Screen Shot 2020-03-28 at 11 51 24 AM

I put the init file (inside initrd.img) here: https://gist.github.com/shakalaca/68020f29a75b816bed8245761c746f34

Looks like some of the entries in /proc/mounts came before chroot, so Magisk could not mount /system and /data partition properly and the module system failed because of that ..

osm0sis commented 4 years ago

Sounds like it was pure luck that it ever worked at all. Does the emulator.sh work for this use case?

androidacy-user commented 4 years ago

Modules never worked because the emulator.sh can't be ran on boot (excl modifying the ramdisk)

shakalaca commented 4 years ago

If we can do the hack on Android x86 project, I think it's better to keep the complexity there and leave Magisk clean and simple, so here's the hack : (for AVD we still need the patch https://github.com/topjohnwu/Magisk/pull/2594): https://github.com/shakalaca/MagiskOnEmulator

@etmatrix please have a look and see if it works for you :)

ghost commented 4 years ago

@shakalaca thank you for you work. The script prepare_image.sh doesn't work properly and I don't know if will never work. mount /dev/block/sda1 return Device busy.

mount -o ro -t ext4 /dev/block/sda1 /data/local/tmp/root/
mount: '/dev/block/sda1'->'/data/local/tmp/root/': Device or resource busy

I got ramdisk.img and initrd.img with:

I think the correct script to run for vbox is patch_vbox.sh, doesn't matter, I pulled all files and executed process.sh as root, after this operation I pushed the new ramdisk.img and initrd.img and copied, but after I poweron the virtual machine, it's stuck on boot. I debugging it, maybe the loop while true which check the directory /sbin/.magisk/

EDIT Sorry my fault, I execute the entire process another one and now works, module are loaded on boot with magisk 20.4

ghost commented 4 years ago

I tested the script of @shakalaca and works on Android 8.1 r4 x86/x86_64, Android 9 r2 x86 (x86_64 not yet tested).

I think the scripts prepare and installation are not usable with android x86, but process.sh is fantastic for installation and patching of magisk on android x86

RouatbiH commented 3 years ago

I tested the script of @shakalaca and works on Android 8.1 r4 x86/x86_64, Android 9 r2 x86 (x86_64 not yet tested).

  • copy ramdisk.img and initrd.img from installation disk
  • clone repository https://github.com/shakalaca/MagiskOnEmulator
  • download latest version of magisk's zip and rename to magisk.zip
  • connect to device with adb
  • adb push initrd.patch process.sh magisk.zip update-binary /data/local/tmp
  • adb push ramdisk.img /data/local/tmp/ramdisk.img.gz
  • adb push initrd.img /data/local/tmp/initrd.img.gz
  • adb shell "sh /data/local/tmp/process.sh /data/local/tmp/"
  • adb pull /data/local/tmp/ramdisk.img
  • adb pull /data/local/tmp/initrd.img
  • restore new ramdisk.img and initrd.img to installation disk

I think the scripts prepare and installation are not usable with android x86, but process.sh is fantastic for installation and patching of magisk on android x86

how to connect to device with adb when i type adb in cmd windows it shown

image

0xD34DC0DE commented 3 years ago

@lamjed001 You need to add adb to the PATH environment variable

ouija commented 3 years ago
* copy ramdisk.img and initrd.img from installation disk
* clone repository https://github.com/shakalaca/MagiskOnEmulator
* download latest version of magisk's zip and rename to magisk.zip
* connect to device with adb
* adb push initrd.patch process.sh magisk.zip update-binary /data/local/tmp
* adb push ramdisk.img /data/local/tmp/ramdisk.img.gz
* adb push initrd.img /data/local/tmp/initrd.img.gz
* adb shell "sh /data/local/tmp/process.sh /data/local/tmp/"
* adb pull /data/local/tmp/ramdisk.img
* adb pull /data/local/tmp/initrd.img
* restore new ramdisk.img and initrd.img to installation disk

This method was working up until March of 2021, here's an updated version I've used with Android-x86 and Magisk v22.0:

adb wait-for-device adb -e push ramdisk.img /data/local/tmp/ramdisk.img.gz adb -e push initrd.img /data/local/tmp/initrd.img.gz adb -e push magisk.zip /data/local/tmp/magisk.zip adb -e push busybox /data/local/tmp/ adb -e push initrd.patch /data/local/tmp/ adb -e push process.sh /data/local/tmp/ adb -e shell "dos2unix /data/local/tmp/process.sh" adb -e shell "sh /data/local/tmp/process.sh /data/local/tmp $1" [ -d patched ] || mkdir patched adb -e pull /data/local/tmp/ramdisk.img ./patched/ adb -e pull /data/local/tmp/initrd.img ./patched/


-Connect to device via adb and run `sh ./patch.sh`
-Replace the patched initrd.img and ramdisk.img files from the `./patched` folder into the Android-x86 installation folder.
pupa91 commented 3 years ago
* copy ramdisk.img and initrd.img from installation disk
* clone repository https://github.com/shakalaca/MagiskOnEmulator
* download latest version of magisk's zip and rename to magisk.zip
* connect to device with adb
* adb push initrd.patch process.sh magisk.zip update-binary /data/local/tmp
* adb push ramdisk.img /data/local/tmp/ramdisk.img.gz
* adb push initrd.img /data/local/tmp/initrd.img.gz
* adb shell "sh /data/local/tmp/process.sh /data/local/tmp/"
* adb pull /data/local/tmp/ramdisk.img
* adb pull /data/local/tmp/initrd.img
* restore new ramdisk.img and initrd.img to installation disk

This method was working up until March of 2021, here's an updated version I've used with Android-x86 and Magisk v22.0:

  • Clone the repository at https://github.com/shakalaca/MagiskOnEmulator
  • Copy initrd.img and ramdisk.img from Android installer to folder where you cloned repo
  • Download latest copy of Magisk v22 apk and save to this same folder as "magisk.zip"
  • Edit the patch.sh script and replace with:
#!/bin/sh

adb wait-for-device
adb -e push ramdisk.img /data/local/tmp/ramdisk.img.gz
adb -e push initrd.img /data/local/tmp/initrd.img.gz
adb -e push magisk.zip /data/local/tmp/magisk.zip
adb -e push busybox /data/local/tmp/
adb -e push initrd.patch /data/local/tmp/
adb -e push process.sh /data/local/tmp/
adb -e shell "dos2unix /data/local/tmp/process.sh"
adb -e shell "sh /data/local/tmp/process.sh /data/local/tmp $1"
[ -d patched ] || mkdir patched
adb -e pull /data/local/tmp/ramdisk.img ./patched/
adb -e pull /data/local/tmp/initrd.img ./patched/

-Connect to device via adb and run sh ./patch.sh -Replace the patched initrd.img and ramdisk.img files from the ./patched folder into the Android-x86 installation folder.

Hello ouija, sorry to disturb you, I followed your steps to complete, but the module still cannot be installed, thank you for your advice. 捕获

olbb commented 2 years ago

Great! I follow the step, and it worked. Despite with the log 'Device or resource busy' But the magisk's devices is mounted while init, which is add via initrd.patch.

If the shell is not worked for some reason, You may also unpack the initrc.img file as the shell do, and change the init file with initrc.patch, repack the img.

ugegkonst commented 1 year ago

Hello -Replace the patched initrd.img and ramdisk.img files from the ./patched folder into the Android-x86 installation folder. How can i do that? I can't do any changes because it's read only

olbb commented 1 year ago

Hello -Replace the patched initrd.img and ramdisk.img files from the ./patched folder into the Android-x86 installation folder. How can i do that? I can't do any changes because it's read only

It's on your physical disk where the android x86 installed. You can replace the img files on other OS, e.g PE.

Zwackn commented 1 year ago

" > * adb push initrd.patch process.sh magisk.zip update-binary /data/local/tmp"

Someone can tell me, where i can find that "update-binary"? by shooting this command, i get an error: adb: error: cannot stat 'update-binary': No such file or directory

this update-binary is not found in the repository... maybe somewhere in the Android system? someone can tell me near infos about that? Where i can find that? What is that?

and another problem is the message i get, when try: adb shell "sh /data/local/tmp/process.sh /data/local/tmp/" it tells me: Grab magisk.zip or magisk.apk first ! but magisk.zip is pushed already in the folder /data/local/tmp/

someone can advice me what im doing wrong?

I am grateful for any help..