nitanmarcel / waydroid-magisk

Kitsune Mask (magisk) manager for Waydroid.
GNU General Public License v3.0
162 stars 5 forks source link

clone_attr /sbin -> /root failed: No data available (os error 61) #31

Open dontknowhy opened 4 months ago

dontknowhy commented 4 months ago

Describe the bug Run sudo waydroid_magisk install and boot Android. And it just stuck in the boot process until it is timeout.

To Reproduce After you realize this boy is failed,you can use sudo waydroid shell to discover what's wrong.

:/system/etc/init/magisk # /system/etc/init/magisk/magisk64 --auto-selinux --setup-sbin /system/etc/init/magisk
clone_attr /sbin -> /root failed: No data available (os error 61)

Expected behavior A clear and concise description of what you expected to happen.

Logs lxc-attach: waydroid: ../src/lxc/attach.c: lxc_attach_run_command: 1841 No such file or directory - Failed to exec "su" Magisk isn't ready so we don't have any su command.

Desktop (please complete the following information):

Additional context Add any other context about the problem here. I modified rc file but nothing goes right.

on post-fs-data
    start logd
    exec u:r:su:s0 root root -- /system/etc/init/magisk/magisk64 --auto-selinux --setup-sbin /system/etc/init/magisk
    exec u:r:su:s0 root root -- /system/etc/init/magisk/magiskpolicy --live --magisk "allow * magisk_file lnk_file *"
    mkdir /sbin/.magisk 700
    mkdir /sbin/.magisk/mirror 700
    mkdir /sbin/.magisk/block 700
    copy /system/etc/init/magisk/config /sbin/.magisk/config
    rm /dev/.magisk_unblock
    start tWToGj9AI
    wait /dev/.magisk_unblock 40
    rm /dev/.magisk_unblock

service tWToGj9AI /sbin/magisk --auto-selinux --post-fs-data
    user root
    seclabel u:r:su:s0
    oneshot

service IHBzNRXz7LJ58Y8 /sbin/magisk --auto-selinux --service
    class late_start
    user root
    seclabel u:r:su:s0
    oneshot

on property:sys.boot_completed=1
    mkdir /data/adb/magisk 755
    exec u:r:su:s0 root root -- /sbin/magisk --auto-selinux --boot-complete

on property:init.svc.zygote=restarting
    exec u:r:su:s0 root root -- /sbin/magisk --auto-selinux --zygote-restart

on property:init.svc.zygote=stopped
    exec u:r:su:s0 root root -- /sbin/magisk --auto-selinux --zygote-restart

PS: this is another .rc file, NOT bootanim.rc

ayasa520 commented 3 months ago

Comment out the parts with #[cfg(feature = "selinux")] in get_attr and set_attr in native/src/base/files.rs of the Kitsune source code and recompile. Magisk continues to work, but Zygisk does not. I have no knowledge of Magisk; I just roughly compared the old code to find this workaround.

image

nitanmarcel commented 3 months ago

Comment out the parts with #[cfg(feature = "selinux")] in get_attr and set_attr in native/src/base/files.rs of the Kitsune source code and recompile. Magisk continues to work, but Zygisk does not. I have no knowledge of Magisk; I just roughly compared the old code to find this workaround.

image

Try to revert this for zygisk

https://github.com/KitsuneMagisk/Magisk/commit/1eecd4b8223a6ccae4006ec2267a44c95b62ecae