tiann / KernelSU

A Kernel based root solution for Android

Home Page:https://kernelsu.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't flash - No such file or directory

powellnorma opened this issue · comments

Please check before submitting an issue

  • I have searched the issues and haven't found anything relevant
  • I will upload bugreport file in KernelSU Manager - Settings - Report log
  • I know how to reproduce the issue which may not be specific to my device

Describe the bug

When installing any module, I get this output:

- Preparing image
- Module size: 3,34 MB
- Error: No such file or directory (os error 2)
Error: exit code = 1.
Please save and check the log,

When I click on the "save" Icon for saving the log, the App crashes.

Following is from adb logcat

05-04 23:00:27.032 16884 16884 I KernelSU: ksud::cli: command: Debug { command: Su { global_mnt: false } }
05-04 23:00:27.080 16887 16887 I KernelSU: ksud::cli: command: Module { command: Install { zip: "/data/user/0/me.weishu.kernelsu/cache/module.zip" } }
05-04 23:00:27.284 16887 16887 I KernelSU: ksud::module: module prop: {"version": "v2.4.0", "id": "safetynet-fix", "versionCode": "20400", "description": "A universal fix for SafetyNet and Play Integrity on Android 8–13 devices with hardware attestation.", "updateJson": "https://raw.githubusercontent.com/kdrag0n/safetynet-fix/master/update.json", "author": "kdrag0n", "name": "Universal SafetyNet Fix"}
05-04 23:00:27.285 16887 16887 I KernelSU: ksud::module: zip uncompressed size: 240.07 kB
05-04 23:00:27.285 16887 16887 I KernelSU: ksud::module: Creating brand new module image
05-04 23:00:27.289 16887 16887 E KernelSU: ksud::cli: Error: No such file or directory (os error 2)
05-04 23:00:27.390 16384 16436 I KernelSU: install module content://com.android.providers.downloads.documents/document/raw%3A%2Fstorage%2Femulated%2F0%2FDownload%2Fsafetynet-fix-v2.4.0.zip result: h2.j@41de37f

To Reproduce

No response

Expected behavior

No response

Screenshots

No response

Logs

No response

Device info

Additional context

No response

upload full log

Ok, attached is the full log (tar.gz), after fresh reboot + failed attempt to flash the module.

Btw, I was unable to directly safe/share the log, because of:

[   76.590362] [pid:367,cpu2,logd.auditd]type=1400 audit(1714983679.109:209): avc: denied { open } for pid=3397 comm="Binder:3397_3" path="/data/data/me.weishu.kernelsu/cache/KernelSU_bugreport_2024-05-06_10_21.tar.gz" dev="mmcblk0p56" ino=16258 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:app_data_file:s0 tclass=file permissive=0

Any idea why this might be happening? I am using the stock image, so the selinux config should be normal(?)

KernelSU_bugreport_2024-05-06_10_21.tar.gz

Your kernel doesn't work normally:

[   16.928131] [pid:433,cpu4,init]init: cannot execve('/data/adb/ksud'): Permission denied

Check #943 first.

Probably relevant: #270 (comment)

@tiann

cannot execve('/data/adb/ksud'): Permission denied

Fixed that, the issue still persists though, see new attachment:

KernelSU_bugreport_2024-05-07_11_39.tar.gz

Sorry, I don't have time to play with this old kernel; there must be something wrong somewhere else, like an ext4 mount failure, or the file doesn't have permission to create; please add your own logs to see where the problem is.

I don't have time to play with this old kernel

I see, no problem. I too think there is something wrong in general, because the "file not found" issue appears in other apps too. I might later try to disable selinux / set it to permissive.

please add your own logs to see where the problem is

Ah, you mean recompile ksud to increase the logging level, so one can see exactly what fails? Will maybe try that later, too

05-04 23:00:27.289 16887 16887 E KernelSU: ksud::cli: Error: No such file or directory (os error 2)

I think it is due to missing mkfs.ext4:

HWPRA-H:/ # mkfs.ext4                                                                                                                                                                         
/system/bin/sh: mkfs.ext4: not found

When placing mkfs.ext4 from https://github.com/kmarshal/android-rom/blob/master/Galaxy%20ACE%20GT-5830/build/res/blackhawk-kitchen/mkfs.ext4 to /data/adb/ksu/bin/mkfs.ext4, the error becomes:

- Preparing image
                                                                   
- Module size: 240.07 kB
                                                                   
- Error: Failed to format ext4 image: mke2fs 1.41.12 (17-May-2010)
                                                                   
Error: exit code = 1.
Please save and check the log.

I wonder what the problem is.. Maybe unsupported options?

https://github.com/tiann/KernelSU/blob/57b96da9dbeec9c881c2fe81842d07ddb16e6e49/userspace/ksud/src/module.rs#L292C32-L292C41

Anyone has an idea?

Hm, maybe its because that mkfs.ext4 asks for confirmation.. ?

HWPRA-H:/data/adb # mkfs.ext4 test1                                                                                                                                                           
mke2fs 1.41.12 (17-May-2010)
test1 is not a block special device.
Proceed anyway? (y,n) 

Ok, I used https://github.com/FerryAr/e2fsprogs-arm/blob/master/system/bin/mke2fs - I saved it to /data/adb/ksu/bin/mkfs.ext4 - Now flashing the module works fine!