casualsnek / waydroid_script

Python Script to add OpenGapps, Magisk, libhoudini translation library and libndk translation library to waydroid !
GNU General Public License v3.0
1.84k stars 168 forks source link

Magisk install fails #12

Open arun54321 opened 2 years ago

arun54321 commented 2 years ago

Traceback (most recent call last): File "/home/arun/waydroid_script/waydroid_extras.py", line 566, in main() File "/home/arun/waydroid_script/waydroid_extras.py", line 561, in main install_magisk() File "/home/arun/waydroid_script/waydroid_extras.py", line 478, in install_magisk shutil.copyfile(os.path.join(extract_to, arch_dir, "magiskinit{arch}".format(arch=arch)), File "/usr/lib/python3.9/shutil.py", line 265, in copyfile with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst: FileNotFoundError: [Errno 2] No such file or directory: '/tmp/waydroidimage/sbin/magiskinit'

casualsnek commented 2 years ago

what android version system image are you using ?

arun54321 commented 2 years ago

android 11 image

casualsnek commented 2 years ago

the magisk used in this script does not work with android 11 images, this is a known issue and i am trying to get it work without any success :(

youling257 commented 2 years ago

@casualsnek you can study wsa install magisk method. https://github.com/LSPosed/MagiskOnWSA/blob/main/.github/workflows/magisk.yml#L162

youling257 commented 2 years ago

my init.rc for waydroid android 11.

on post-fs-data mkdir /dev/waydroid-magisk mount tmpfs tmpfs /dev/waydroid-magisk mode=0755 copy /data/adb/magisk/magisk64 /dev/waydroid-magisk/magisk64 chmod 0755 /dev/waydroid-magisk/magisk64 symlink ./magisk64 /dev/waydroid-magisk/magisk symlink ./magisk64 /dev/waydroid-magisk/su symlink ./magisk64 /dev/waydroid-magisk/resetprop copy /data/adb/magisk/magisk32 /dev/waydroid-magisk/magisk32 chmod 0755 /dev/waydroid-magisk/magisk32 copy /data/adb/magisk/magiskinit /dev/waydroid-magisk/magiskinit chmod 0755 /dev/waydroid-magisk/magiskinit symlink ./magiskinit /dev/waydroid-magisk/magiskpolicy mkdir /dev/waydroid-magisk/.magisk 700 mkdir /dev/waydroid-magisk/.magisk/mirror 700 mkdir /dev/waydroid-magisk/.magisk/mirror/data 700 mkdir /dev/waydroid-magisk/.magisk/block 700 mount none /data /dev/waydroid-magisk/.magisk/mirror/data bind rec start FAhW7H9G5sf

service FAhW7H9G5sf /dev/waydroid-magisk/magisk --post-fs-data user root oneshot

service HLiFsR1HtIXVN6 /dev/waydroid-magisk/magisk --service class late_start user root oneshot

on property:sys.boot_completed=1 start YqCTLTppv3ML

service YqCTLTppv3ML /dev/waydroid-magisk/magisk --boot-complete user root oneshot

youling257 commented 2 years ago

extract Magisk-v23.0.apk as zip, lib/x86/libbusybox.so libmagisk32.so libmagisk64.so libmagiskboot libmagiskinit.so is binary, rename them.

casualsnek commented 2 years ago

extract Magisk-v23.0.apk as zip, lib/x86/libbusybox.so libmagisk32.so libmagisk64.so libmagiskboot libmagiskinit.so is binary, rename them.

Thanks, i will check it out :)

casualsnek commented 2 years ago

i have a few questions about your magisk instructions, if you are on matrix can you reach out to me ? ( @casualsnek:matrix.org )

essasetic commented 2 years ago

my init.rc for waydroid android 11.

on post-fs-data mkdir /dev/waydroid-magisk mount tmpfs tmpfs /dev/waydroid-magisk mode=0755 copy /data/adb/magisk/magisk64 /dev/waydroid-magisk/magisk64 chmod 0755 /dev/waydroid-magisk/magisk64 symlink ./magisk64 /dev/waydroid-magisk/magisk symlink ./magisk64 /dev/waydroid-magisk/su symlink ./magisk64 /dev/waydroid-magisk/resetprop copy /data/adb/magisk/magisk32 /dev/waydroid-magisk/magisk32 chmod 0755 /dev/waydroid-magisk/magisk32 copy /data/adb/magisk/magiskinit /dev/waydroid-magisk/magiskinit chmod 0755 /dev/waydroid-magisk/magiskinit symlink ./magiskinit /dev/waydroid-magisk/magiskpolicy mkdir /dev/waydroid-magisk/.magisk 700 mkdir /dev/waydroid-magisk/.magisk/mirror 700 mkdir /dev/waydroid-magisk/.magisk/mirror/data 700 mkdir /dev/waydroid-magisk/.magisk/block 700 mount none /data /dev/waydroid-magisk/.magisk/mirror/data bind rec start FAhW7H9G5sf

service FAhW7H9G5sf /dev/waydroid-magisk/magisk --post-fs-data user root oneshot

service HLiFsR1HtIXVN6 /dev/waydroid-magisk/magisk --service class late_start user root oneshot

on property:sys.boot_completed=1 start YqCTLTppv3ML

service YqCTLTppv3ML /dev/waydroid-magisk/magisk --boot-complete user root oneshot

Hey, can I ask for some clarification on these instructions and what parts of the python script I'm meant to modify for this? Trying to get a controller overlay working and rooting has become an absolute necessity (and I'm stumped on how to do it) @youling257 thanks!

Mega-MU commented 1 year ago

same problem even i umount all the /dev/loopxxx

❯ sudo python3 waydroid_extras.py -m     
/home/megamu/.cache/waydroid_script/downloads
==> Found system image: /var/lib/waydroid/images/system.img
==> Resizing system image....
==> Failed to resize image '/var/lib/waydroid/images/system.img' .. !  e2fsck 1.46.5 (30-Dec-2021)
/var/lib/waydroid/images/system.img is mounted.
e2fsck: Cannot continue, aborting.

==> You can exit and retry with sudo or force continue (May fail installation !), Continue ? [y/N]: y
==> Unmounting .. 
==> Extracting archive...
==> Installing magisk now ...
Traceback (most recent call last):
  File "/home/megamu/waydroid_script/waydroid_extras.py", line 594, in <module>
    main()
  File "/home/megamu/waydroid_script/waydroid_extras.py", line 589, in main
    install_magisk()
  File "/home/megamu/waydroid_script/waydroid_extras.py", line 506, in install_magisk
    shutil.copyfile(os.path.join(extract_to, arch_dir, "magiskinit{arch}".format(arch=arch)),
  File "/usr/lib/python3.10/shutil.py", line 256, in copyfile
    with open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/waydroidimage/sbin/magiskinit'
bitstuffing commented 1 year ago

I don't understand why it happens, the same case for me.

Why this script is seeking for /tmp/waydroidimage/sbin/magiskinit?

RusticBard commented 1 year ago

well IDK if its late to reply or not but I found a solution,

I copied the init.rc posted by @youling257 as /tmp/waydroidimage/init.rc

then I downloaded the magisk v23 apk file and extrated it as zip and copied the lib/x86/libbusybox.so, libmagisk32.so libmagisk64.so libmagiskboot libmagiskinit.so files to /tmp/waydroidimage/sbin ( I had to create the sbin directory)

and that is all, hope it helps anyone looking for it :) @bitstuffing

Aman9das commented 1 year ago

the magisk used in this script does not work with android 11 images, this is a known issue and i am trying to get it work without any success :(

Please add this to the readme too

WesleyVanNeck commented 1 year ago

the magisk used in this script does not work with android 11 images, this is a known issue and i am trying to get it work without any success :(

Please add this to the readme too

It got updated