How to enable init.d to function in LineageOS 14.x (and later more?) - LineageOS News & Discussion

I am using LineageOS 14 on my Galaxy S5 and while I do have the directory /system/etc/init.d , its scripts are not executed on startup as one would expect.
Searching different forums didn't lead to much beyond installing some random person's script with root permission or doing hacks.
I've invested sometime to get init.d work on my phone and wanted to share the how to with you:
Prerequisite:
Root access (shell) [ I am using addonsu-14.1-arm if that make a difference ]
LineageOS 14 (not tested on other versions but should work)
Steps:
1. mount your system partition as read/write
Code:
mount -oremount,rw /system
2. go to init directory
Code:
cd /system/etc/init/
3. create file init_d.rc with following content
Code:
service init_d /system/bin/sh /system/bin/sysinit
user root
group root
disabled
oneshot
seclabel u:r:sudaemon:s0
on property:sys.boot_completed=1 && property:sys.logbootcomplete=1
start init_d
That's it.
Explanation:
/system/etc/init/ is android's version of linux's init.d but it have very different syntax and restricted set of commands.
the file init_d define a service called init_d which basically execute sysinit script (the script responsible for running /etc/init.d/ scripts).
the service is set to be disabled so it won't run by default. Finally I say that when the system finish booting start the service. the oneshot keyword is important because without the system will keep executing sysinit each time it exit.
the seclabel define SELinux label for this service, this one should give it full access

I tried this on a lineage 15.1 build and followed all steps , it did not work.

Worked like a charm!
I needed it to run swapon once (to free some unused RAM) without modifying any system files, only adding new ones, so system updates wouldn't overwrite the configuration.
Thank you very much!
Running LineageOS 15.1, 2018-11-30 nightly build on griffin (XT1650-3).
ramast_ said:
I am using LineageOS 14 on my Galaxy S5 and while I do have the directory /system/etc/init.d , its scripts are not executed on startup as one would expect.
Searching different forums didn't lead to much beyond installing some random person's script with root permission or doing hacks.
I've invested sometime to get init.d work on my phone and wanted to share the how to with you:
Prerequisite:
Root access (shell) [ I am using addonsu-14.1-arm if that make a difference ]
LineageOS 14 (not tested on other versions but should work)
Steps:
1. mount your system partition as read/write
Code:
mount -oremount,rw /system
2. go to init directory
Code:
cd /system/etc/init/
3. create file init_d.rc with following content
Code:
service init_d /system/bin/sh /system/bin/sysinit
user root
group root
disabled
oneshot
seclabel u:r:sudaemon:s0
on property:sys.boot_completed=1 && property:sys.logbootcomplete=1
start init_d
That's it.
Explanation:
/system/etc/init/ is android's version of linux's init.d but it have very different syntax and restricted set of commands.
the file init_d define a service called init_d which basically execute sysinit script (the script responsible for running /etc/init.d/ scripts).
the service is set to be disabled so it won't run by default. Finally I say that when the system finish booting start the service. the oneshot keyword is important because without the system will keep executing sysinit each time it exit.
the seclabel define SELinux label for this service, this one should give it full access
Click to expand...
Click to collapse

Thank you so much !
ramast_ said:
I am using LineageOS 14 on my Galaxy S5 and while I do have the directory /system/etc/init.d , its scripts are not executed on startup as one would expect.
Searching different forums didn't lead to much beyond installing some random person's script with root permission or doing hacks.
I've invested sometime to get init.d work on my phone and wanted to share the how to with you:
Prerequisite:
Root access (shell) [ I am using addonsu-14.1-arm if that make a difference ]
LineageOS 14 (not tested on other versions but should work)
Steps:
1. mount your system partition as read/write
Code:
mount -oremount,rw /system
2. go to init directory
Code:
cd /system/etc/init/
3. create file init_d.rc with following content
Code:
service init_d /system/bin/sh /system/bin/sysinit
user root
group root
disabled
oneshot
seclabel u:r:sudaemon:s0
on property:sys.boot_completed=1 && property:sys.logbootcomplete=1
start init_d
That's it.
Explanation:
/system/etc/init/ is android's version of linux's init.d but it have very different syntax and restricted set of commands.
the file init_d define a service called init_d which basically execute sysinit script (the script responsible for running /etc/init.d/ scripts).
the service is set to be disabled so it won't run by default. Finally I say that when the system finish booting start the service. the oneshot keyword is important because without the system will keep executing sysinit each time it exit.
the seclabel define SELinux label for this service, this one should give it full access
Click to expand...
Click to collapse
You are great bro !
I try it on lineage os 14.1 on moto G and it works !
I tried many ways to do this but all of them are not effective, thanks

Lordlight said:
You are great bro !
I try it on lineage os 14.1 on moto G and it works !
I tried many ways to do this but all of them are not effective, thanks
Click to expand...
Click to collapse
I am glad you found it useful.

ramast_ said:
I am glad you found it useful.
Click to expand...
Click to collapse
Hi, i have a prblem with this:
The script run BEFORE the bootanimation finished, i need run AFTER the fully animation is finished. What need i do ?

There is a process responsible for showing bootanimation, I don't remember exact process name but should contain word "animation" in it.
Once you figured out its name, you can make your script check every second - in a while loop - if that process is running or not. Once the process stopped, you can assume that bootanimation has stopped.
There might be a better way but I honestly don't know.

the seclabel define SELinux label for this service, this one should give it full access
Click to expand...
Click to collapse
Hey,
I tried your solution on the following LineageOS version:
Code:
Android 7.1.2
14.1-20190207-NIGHTLY-falcon
Linux version 3.4.113-g22bc4ed ([email protected]) (gcc version 4.9 20150123 (prerelease) (GCC) ) #1 SMP PREEMPT Thu Feb 7 14:09:49 UTC 2019
Scripts in /etc/init.d are being executed, fine, but all them are running with insufficient privileges - under the selinux context of u:r:sysinit:s0
As a result I couldn't start sshd using that script:
Code:
12-27 12:10:58.848 2559 2559 I sysinit : Running /system/etc/init.d/99ssh
12-27 12:10:58.950 2562 2562 W start-ssh: type=1400 audit(0.0:9): avc: denied { getattr } for uid=0 path="/data/ssh/ssh_host_dsa_key" dev="mmcblk0p36" ino=198109 scontext=u:r:sysinit:s0 tcontext=u:object_r:system_data_file:s0 tclass=file permissive=0
12-27 12:11:01.100 2564 2564 W ssh-keygen: type=1400 audit(0.0:10): avc: denied { getattr } for uid=0 path="/data/ssh/ssh_host_dsa_key" dev="mmcblk0p36" ino=198109 scontext=u:r:sysinit:s0 tcontext=u:object_r:system_data_file:s0 tclass=file permissive=0
12-27 12:11:01.103 2564 2564 W ssh-keygen: type=1400 audit(0.0:11): avc: denied { write } for uid=0 name="ssh_host_dsa_key" dev="mmcblk0p36" ino=198109 scontext=u:r:sysinit:s0 tcontext=u:object_r:system_data_file:s0 tclass=file permissive=0
12-27 12:11:01.143 2743 2743 W chmod : type=1400 audit(0.0:12): avc: denied { getattr } for uid=0 path="/data/ssh/ssh_host_dsa_key" dev="mmcblk0p36" ino=198109 scontext=u:r:sysinit:s0 tcontext=u:object_r:system_data_file:s0 tclass=file permissive=0
12-27 12:11:01.186 2746 2746 W chmod : type=1400 audit(0.0:13): avc: denied { getattr } for uid=0 path="/data/ssh/ssh_host_dsa_key.pub" dev="mmcblk0p36" ino=197164 scontext=u:r:sysinit:s0 tcontext=u:object_r:system_data_file:s0 tclass=file permissive=0
12-27 12:11:01.190 2562 2562 W start-ssh: type=1400 audit(0.0:14): avc: denied { getattr } for uid=0 path="/data/ssh/ssh_host_rsa_key" dev="mmcblk0p36" ino=203831 scontext=u:r:sysinit:s0 tcontext=u:object_r:system_data_file:s0 tclass=file permissive=0
12-27 12:11:10.896 2749 2749 W ssh-keygen: type=1400 audit(0.0:15): avc: denied { getattr } for uid=0 path="/data/ssh/ssh_host_rsa_key" dev="mmcblk0p36" ino=203831 scontext=u:r:sysinit:s0 tcontext=u:object_r:system_data_file:s0 tclass=file permissive=0
12-27 12:11:10.896 2749 2749 W ssh-keygen: type=1400 audit(0.0:16): avc: denied { write } for uid=0 name="ssh_host_rsa_key" dev="mmcblk0p36" ino=203831 scontext=u:r:sysinit:s0 tcontext=u:object_r:system_data_file:s0 tclass=file permissive=0
12-27 12:11:10.950 2969 2969 W chmod : type=1400 audit(0.0:17): avc: denied { getattr } for uid=0 path="/data/ssh/ssh_host_rsa_key" dev="mmcblk0p36" ino=203831 scontext=u:r:sysinit:s0 tcontext=u:object_r:system_data_file:s0 tclass=file permissive=0
12-27 12:11:11.003 2972 2972 W chmod : type=1400 audit(0.0:18): avc: denied { getattr } for uid=0 path="/data/ssh/ssh_host_rsa_key.pub" dev="mmcblk0p36" ino=203640 scontext=u:r:sysinit:s0 tcontext=u:object_r:system_data_file:s0 tclass=file permissive=0
12-27 12:11:11.103 2979 2979 W sshd : type=1400 audit(0.0:19): avc: denied { setgid } for uid=0 capability=6 scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=capability permissive=0
12-27 12:11:11.116 2979 2979 W sshd : type=1400 audit(0.0:20): avc: denied { create } for uid=0 scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
12-27 12:11:11.116 2979 2979 W sshd : type=1400 audit(0.0:21): avc: denied { create } for uid=0 scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
12-27 12:11:11.120 2977 2977 I sshd : bad addr or host: <NULL> (No address associated with hostname)
12-27 12:11:11.121 2977 2977 I sshd : sshd terminated by exit(255)
Anyone has an idea, how to force init.d scripts to run as u:r:su:s0 ?
Thanks

Answering my own question, in case someone else would encounter this
It turned out, my LineageOS 14.1 already had init.d scripts working. However, it still was executed under a restricted selinux context u:r:sysinit:s0. To overcome that I had to recompile LineageOS from sources, where I could explicitly modify vendor/cm/prebuilt/common/etc/init.local.rc file and put there only one additional line seclabel u:r:sudaemon:s0 so it finaly looks like this:
Code:
..
.
# sysinit (/system/etc/init.d)
service sysinit /system/bin/sysinit
user root
group root
disabled
oneshot
seclabel u:r:sudaemon:s0
..
.
Now I can run commands in userinit.sh with the highest privileges
Thanks!

Related

System read-only exception (While it isn't)

Apps runs with root permissions
Code:
//Requesting root
try {
Runtime.getRuntime().exec("su");
} catch (IOException e) {
}
I'm trying to save script to init.d folder
Code:
public void WriteScript(View view) {
Save("/system/etc/init.d/10zram", getString(R.string.sys_script), false);
}
Code:
public static void Save(String file, String textToSave, boolean overwrite) {
Log.w("Advanced ZRAM", "Writer start");
if (overwrite) new File(file).delete();
try {
BufferedWriter out = new BufferedWriter(new FileWriter(file));
out.write(textToSave);
out.close();
} catch (IOException error) { Log.e("Advanced ZRAM", "File saving failed", error);
}
}
And have this exception.
Code:
05-14 14:56:08.691: ERROR/Advanced ZRAM(31270): File saving failed
java.io.FileNotFoundException: /system/etc/init.d/10zram: open failed: EROFS (Read-only file system)
at libcore.io.IoBridge.open(IoBridge.java:416)
at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
at java.io.FileWriter.<init>(FileWriter.java:80)
at test.zrammgr.Configurator.Save(Configurator.java:36)
at test.zrammgr.Configurator.WriteScript(Configurator.java:23)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3594)
at android.view.View.performClick(View.java:4204)
at android.view.View$PerformClick.run(View.java:17355)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5226)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:106)
at dalvik.system.NativeStart.main(Native Method)
Caused by: libcore.io.ErrnoException: open failed: EROFS (Read-only file system)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
at libcore.io.IoBridge.open(IoBridge.java:400)
... 20 more
Why it can't write to /system? I have remouted /system via ADB shell, but this didn't helped
Code:
adb shell
[email protected]:/ $ su
su
[email protected]:/ # mount -o rw,remount /system
mount -o rw,remount /system
[email protected]:/ # cd /system
cd /system
[email protected]:/system # touch test
touch test
[email protected]:/system #
test appeared
GR0S said:
Apps runs with root permissions
Code:
//Requesting root
try {
Runtime.getRuntime().exec("su");
} catch (IOException e) {
}
I'm trying to save script to init.d folder
Code:
public void WriteScript(View view) {
Save("/system/etc/init.d/10zram", getString(R.string.sys_script), false);
}
Code:
public static void Save(String file, String textToSave, boolean overwrite) {
Log.w("Advanced ZRAM", "Writer start");
if (overwrite) new File(file).delete();
try {
BufferedWriter out = new BufferedWriter(new FileWriter(file));
out.write(textToSave);
out.close();
} catch (IOException error) { Log.e("Advanced ZRAM", "File saving failed", error);
}
}
And have this exception.
Code:
05-14 14:56:08.691: ERROR/Advanced ZRAM(31270): File saving failed
java.io.FileNotFoundException: /system/etc/init.d/10zram: open failed: EROFS (Read-only file system)
at libcore.io.IoBridge.open(IoBridge.java:416)
at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
at java.io.FileWriter.<init>(FileWriter.java:80)
at test.zrammgr.Configurator.Save(Configurator.java:36)
at test.zrammgr.Configurator.WriteScript(Configurator.java:23)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3594)
at android.view.View.performClick(View.java:4204)
at android.view.View$PerformClick.run(View.java:17355)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5226)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:106)
at dalvik.system.NativeStart.main(Native Method)
Caused by: libcore.io.ErrnoException: open failed: EROFS (Read-only file system)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
at libcore.io.IoBridge.open(IoBridge.java:400)
... 20 more
Why it can't write to /system? I have remouted /system via ADB shell, but this didn't helped
Code:
adb shell
[email protected]:/ $ su
su
[email protected]:/ # mount -o rw,remount /system
mount -o rw,remount /system
[email protected]:/ # cd /system
cd /system
[email protected]:/system # touch test
touch test
[email protected]:/system #
test appeared
Click to expand...
Click to collapse
afaik you have to use the runtime to move around files, you can't do it from java. At least, that is the way I do it.
Zatta said:
afaik you have to use the runtime to move around files, you can't do it from java. At least, that is the way I do it.
Click to expand...
Click to collapse
Can you share some code?
GR0S said:
Can you share some code?
Click to expand...
Click to collapse
Use the java.lang.Process you get by calling
Code:
try {
Runtime.getRuntime().exec("su");
} catch (IOException e) {
}
to invoke commands on it as described here: http://forum.xda-developers.com/showthread.php?t=2226664
For writing on /system you need to mount it rw before that. Do not forget to mount it with read-only permission afterwards! (http://forum.xda-developers.com/showthread.php?p=7257098)
Then move your files using the mv command. If you want to move files between different partitions, you will have to use "busybox mv ..." instead. (http://linux.about.com/library/cmd/blcmdl1_mv.htm)
Root features can just be used in this process the command line way. That is because Android was not designed to be rooted. Additionally every app has its own VM and cannot access to the system partition for that reason.
GR0S said:
Can you share some code?
Click to expand...
Click to collapse
For an easy implementation, use RootTools
I am using a (slightly modified) version of the ShellProvider class from the nitrality project.

[SOLVED][Q] Commands not properly executing

EDIT:
The problem was that i was trying to read a line from the inputreader, when there was no line, so it was waiting for a response there...
Hello,
I am currently building an app to fix a little problem that exists on some devices with the wifi-mac and bluetooth addresses constantly changing (for me it's a N4 but I read somewhere that there are other devices with that problem too)
The thing the app should do is (steps taken from another xda thread: http://forum.xda-developers.com/showpost.php?p=43164157&postcount=1 )
- Mount /persist
- create the folders wifi and bluetooth
- create a text file in each of these directories containing the addresses that should be used in future
- fix the owners and permissions of these files and directories
- execute /system/bin/conn_init as su
The app is mostly done but somehow not working at all.
Everything from generating random adresses to saving them in a temporary file seems to work fine, but as soon as I try to mount the persist directory, the app stops to react.
At first, this was the first thing done by the SU Shell class that I wrote for executing su shell commands, so I thought that might be not working, but when I let that execute echo test it returns test just fine...
The code that is used could be expressed like that (this is missing some debug info and strings that get passed, but it should technically have the same result):
Code:
try {
shell = Runtime.getRuntime().exec("su");
outputStream = new DataOutputStream(shell.getOutputStream());
inputStream = new BufferedReader(new InputStreamReader(shell.getInputStream()));
outputStream.writeBytes("mount /dev/block/mmcblk0p20 /persist");
outputStream.flush();
} catch (IOException e) {
e.printStackTrace();
}
The attached zip file contains my main activity and the before mentioned su shell.
The complete source code of the app is available via my git server: http://greensserver.redirectme.net/greenchris/WiFi-MAC-and-Bluetooth-Adress-Fix.git
Does anybody have an idea why this isn't working?
Greetings
GreenChris
Edit:
I forgot to add the logcat...
Code:
04-09 23:33:21.289 3903-3903/com.janchristiangruenhage.macfixer I/art﹕ Late-enabling -Xcheck:jni
04-09 23:33:21.791 3903-3949/com.janchristiangruenhage.macfixer D/OpenGLRenderer﹕ Render dirty regions requested: true
04-09 23:33:21.797 3903-3903/com.janchristiangruenhage.macfixer D/Atlas﹕ Validating map...
04-09 23:33:21.951 3903-3949/com.janchristiangruenhage.macfixer I/Adreno-EGL﹕ : QUALCOMM Build: 10/28/14, c33033c, Ia6306ec328
04-09 23:33:21.953 3903-3949/com.janchristiangruenhage.macfixer I/OpenGLRenderer﹕ Initialized EGL, version 1.4
04-09 23:33:21.985 3903-3949/com.janchristiangruenhage.macfixer D/OpenGLRenderer﹕ Enabling debug mode 0
04-09 23:33:22.318 3903-3903/com.janchristiangruenhage.macfixer I/Timeline﹕ Timeline: Activity_idle id: [email protected] time:14543691
04-09 23:33:31.781 3903-3919/com.janchristiangruenhage.macfixer I/art﹕ Background sticky concurrent mark sweep GC freed 11333(680KB) AllocSpace objects, 3(44KB) LOS objects, 13% free, 4MB/5MB, paused 5.706ms total 39.550ms
04-09 23:33:31.843 3903-3903/com.janchristiangruenhage.macfixer D/macfixer﹕ address-bytes generated
04-09 23:33:43.923 3903-3903/com.janchristiangruenhage.macfixer D/macfixer﹕ save .bdaddr
04-09 23:33:43.925 3903-3903/com.janchristiangruenhage.macfixer D/macfixer﹕ address written: .bdaddr
04-09 23:33:43.954 3903-3903/com.janchristiangruenhage.macfixer D/macfixer﹕ su shell started
04-09 23:33:43.955 3903-3903/com.janchristiangruenhage.macfixer D/macfixer﹕ added outputstream
04-09 23:33:43.957 3903-3903/com.janchristiangruenhage.macfixer D/macfixer﹕ added inputstreamreader
04-09 23:33:43.957 3903-3903/com.janchristiangruenhage.macfixer D/macfixer﹕ echo test
04-09 23:33:43.973 3903-3903/com.janchristiangruenhage.macfixer D/macfixer﹕ test
04-09 23:33:43.974 3903-3903/com.janchristiangruenhage.macfixer D/macfixer﹕ mount /dev/block/mmcblk0p20 /persist

[help][custom rom]

question about this crash,stuck at logo asus but i can get the log
here is the log
--------- beginning of main
__bionic_open_tzdata: couldn't find any tzdata when looking for localtime!
__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
E/ServiceManager( 0): failed to open binder driver
W/auditd ( 252): type=2000 audit(0.0:1): initialized
I/auditd ( 252): type=1403 audit(0.0:2): policy loaded auid=4294967295 ses=4294967295
W/lmkd ( 254): type=1400 audit(0.0:3): avc: denied { execmem } for scontext=u:r:init:s0 tcontext=u:r:init:s0 tclass=process result=0
W/lmkd ( 254): type=1400 audit(0.0:5): avc: denied { execmem } for scontext=u:r:lmkd:s0 tcontext=u:r:lmkd:s0 tclass=process result=0
W/servicemanager( 255): type=1400 audit(0.0:4): avc: denied { execmem } for scontext=u:r:servicemanager:s0 tcontext=u:r:servicemanager:s0 tclass=process result=0
W/surfaceflinger( 257): type=1400 audit(0.0:6): avc: denied { execmem } for scontext=u:r:surfaceflinger:s0 tcontext=u:r:surfaceflinger:s0 tclass=process result=0
W/logd ( 252): type=1400 audit(0.0:7): avc: denied { execmem } for scontext=u:r:logd:s0 tcontext=u:r:logd:s0 tclass=process result=0
W/lmkd ( 254): type=1400 audit(0.0:8): avc: denied { module_request } for kmod="personality-8" scontext=u:r:lmkd:s0 tcontext=u:r:kernel:s0 tclass=system result=0
W/surfaceflinger( 257): type=1400 audit(0.0:9): avc: denied { module_request } for kmod="personality-8" scontext=u:r:surfaceflinger:s0 tcontext=u:r:kernel:s0 tclass=system result=0
W/servicemanager( 255): type=1400 audit(0.0:11): avc: denied { module_request } for kmod="personality-8" scontext=u:r:servicemanager:s0 tcontext=u:r:kernel:s0 tclass=system result=0
I/lowmemorykiller( 0): Using in-kernel low memory killer interface
W/keystore( 273): type=1400 audit(0.0:12): avc: denied { execmem } for scontext=u:r:keystore:s0 tcontext=u:r:keystore:s0 tclass=process result=0
W/sdcard ( 280): type=1400 audit(0.0:13): avc: denied { execmem } for scontext=u:r:sdcardd:s0 tcontext=u:r:sdcardd:s0 tclass=process result=0
W/debuggerd( 276): type=1400 audit(0.0:14): avc: denied { execmem } for scontext=u:r:debuggerd:s0 tcontext=u:r:debuggerd:s0 tclass=process result=0
W/sdcard ( 280): type=1400 audit(0.0:15): avc: denied { module_request } for kmod="personality-8" scontext=u:r:sdcardd:s0 tcontext=u:r:kernel:s0 tclass=system result=0
W/keystore( 273): type=1400 audit(0.0:16): avc: denied { module_request } for kmod="personality-8" scontext=u:r:keystore:s0 tcontext=u:r:kernel:s0 tclass=system result=0
W/netd ( 275): type=1400 audit(0.0:17): avc: denied { execmem } for scontext=u:r:netd:s0 tcontext=u:r:netd:s0 tclass=process result=0
W/installd( 278): type=1400 audit(0.0:18): avc: denied { execmem } for scontext=u:r:installd:s0 tcontext=u:r:installd:s0 tclass=process result=0
W/sh ( 274): type=1400 audit(0.0:19): avc: denied { module_request } for kmod="personality-8" scontext=u:r:shell:s0 tcontext=u:r:kernel:s0 tclass=system result=0
W/installd( 278): type=1400 audit(0.0:20): avc: denied { module_request } for kmod="personality-8" scontext=u:r:installd:s0 tcontext=u:r:kernel:s0 tclass=system result=0
I/installd( 278): installd firing up
I/ ( 276): debuggerd: Apr 8 2016 14:47:26
--------- beginning of system
I/sdcard ( 280): [fuse_debug]fuse.free_size =2991951872
E/sdcard ( 280): missing packages.list; retrying
E/sdcard ( 280): missing packages.list; retrying
W/surfaceflinger( 314): type=1400 audit(0.0:28): avc: denied { execmem } for scontext=u:r:surfaceflinger:s0 tcontext=u:r:surfaceflinger:s0 tclass=process result=0
W/servicemanager( 312): type=1400 audit(0.0:29): avc: denied { module_request } for kmod="personality-8" scontext=u:r:servicemanager:s0 tcontext=u:r:kernel:s0 tclass=system result=0
W/surfaceflinger( 314): type=1400 audit(0.0:30): avc: denied { module_request } for kmod="personality-8" scontext=u:r:surfaceflinger:s0 tcontext=u:r:kernel:s0 tclass=system result=0
E/ServiceManager( 312): failed to open binder driver
W/mediaserver( 320): type=1400 audit(0.0:31): avc: denied { execmem } for scontext=u:r:init:s0 tcontext=u:r:init:s0 tclass=process result=0
W/app_process( 329): type=1400 audit(0.0:32): avc: denied { module_request } for kmod="personality-8" scontext=u:r:zygote:s0 tcontext=u:r:kernel:s0 tclass=system result=0
E/sdcard ( 280): missing packages.list; retrying
E/ServiceManager( 339): failed to open binder driver
E/sdcard ( 280): missing packages.list; retrying
W/sh ( 356): type=1400 audit(0.0:33): avc: denied { execmem } for scontext=u:r:adbd:s0 tcontext=u:r:adbd:s0 tclass=process result=0
W/keystore( 348): type=1400 audit(0.0:34): avc: denied { module_request } for kmod="personality-8" scontext=u:r:keystore:s0 tcontext=u:r:kernel:s0 tclass=system result=0
E/sdcard ( 280): missing packages.list; retrying
E/ServiceManager( 372): failed to open binder driver
I/SurfaceFlinger( 374): SurfaceFlinger is starting
I/SurfaceFlinger( 374): SurfaceFlinger's main thread ready to run. Initializing graphics H/W...
F/libEGL ( 374): couldn't find an OpenGL ES implementation
--------- beginning of crash
F/libc ( 374): Fatal signal 6 (SIGABRT), code 0 in tid 374 (surfaceflinger)
I/DEBUG ( 276): failed to change ownership of /data/tombstones: Read-only file system
Click to expand...
Click to collapse
HagameHyuma said:
question about this crash,stuck at logo asus but i can get the log
here is the log
Click to expand...
Click to collapse
you have 2x fatal error, but i dont know if are the problem, you should PM tank or dgadelha

Log Spam: Access denied finding property "vendor.debug.egl.swapinterval"

I see this message in logs a couple of times each second...
Access denied finding property "vendor.debug.egl.swapinterval"
Followed by:
type=1400 audit(0.0:58203): avc: denied { read } for name="ubject_r:vendor_default_prop:s0" dev="tmpfs" ino=19023 scontext=u:r:untrusted_app:s0:c169,c256,c512,c768 tcontext=ubject_r:vendor_default_prop:s0 tclass=file permissive=0
Seems OP has removed something, but the system still tries to access it...

[FIX] Magisk avc denials

A few weeks ago I noticed some avc denials spamming my logcat (several times a second), that seemed to be related to Magisk. The entries looked like this:
Code:
W/magisk.bin( 3464): type=1400 audit(0.0:369437): avc: denied { connectto } for path=006F7548376267326B594870356668695237506A33326741706137314A456F6871 scontext=u:r:qti_init_shell:s0
tcontext=u:r:magisk:s0 tclass=unix_stream_socket permissive=0 ppid=1 pcomm="init" pgid=1 pgcomm="init"
I don't know if this warning arose because of how I installed Magisk (IIRC a direct install from within Magisk Manager), or if it even affects anyone else, but I will note how I fixed it here - by adding a magiskpolicy rule to my boot script in service.d:
Code:
magiskpolicy --live "allow qti_init_shell magisk unix_stream_socket { connectto }"
Another site had a little more detail about this denial but I may not be allowed to link to it
There are still some different avc denials but they are not as frequent, don't seem important, and aren't related to Magisk so I left them. An example:
Code:
W/main (21651): type=1400 audit(0.0:347370): avc: denied { read } for name="u:object_r:sys_usb_tethering_prop:s0" dev="tmpfs" ino=11750 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:sys_usb_tethering_prop:s0 tclass=file permissive=0 ppid=746 pcomm="main" pgid=746 pgcomm="main"
+-
Good find, I am also certain that magisk cause more issues.
Envoyé de mon G8142 en utilisant Tapatalk

Categories

Resources