How init.rc setprop works

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How init.rc setprop works

跳至解决方案
3,623 次查看
mrigendra_chaub
Contributor III

I have android 8 from nxp and using it on sabresd board.
I am trying to change dpi settings through setprop settings
So I have put this iside init.${hardware}.rc on boot event

# Set the density to 160dpi, default 128dpi is not good
# Set the density to 128 dpi for 480x800, 7 inch.
setprop ro.sf.lcd_density 128

The device works fine and if I do this

wm density
Physical density:128

Now I put this dpi setting in kernel command line

androidboot.sf.lcd_density=128

but I do not see device to be in 128 dpi setting. Also

wm density
Physical density:160

Now this baffles me.Who gave 160dpi settings?

1. How putting setprop in init.$hardware.rc affects the display but not in kernel command line.

2. Who really processes setprop.
I tried putting prints like this

on boot
exec /system/bin/echo "Trigger test E"

I saw nothing, so does that mean boot event never happened?

0 项奖励
回复
1 解答
3,179 次查看
diegoadrian
NXP Employee
NXP Employee

Hello,

you can try running a service in the init.rc that is a script from a kernel command to change the density. I do not know if I made me understand.

It can be as below:

service script /system/bin/script.sh

    user root

    oneshot

And the script.sh will contain the commands to modify the screen density.

You will only need to place the scrip in the specified path.

Hope this can help you.

Best Regards,

Diego.

在原帖中查看解决方案

1 回复
3,180 次查看
diegoadrian
NXP Employee
NXP Employee

Hello,

you can try running a service in the init.rc that is a script from a kernel command to change the density. I do not know if I made me understand.

It can be as below:

service script /system/bin/script.sh

    user root

    oneshot

And the script.sh will contain the commands to modify the screen density.

You will only need to place the scrip in the specified path.

Hope this can help you.

Best Regards,

Diego.