举例:
想在系统启动后执行初始化can参数的命令:
shell脚本如下:
#!/system/bin/sh
ip link set can0 up type can bitrate 250000命名该脚本文件为"can0shell",将该脚本拷贝到/system/etc/目录
然后在init.rc文件中添加如下代码:
service can0shell /system/bin/sh /system/etc/can0shell
user root
group root
disabled
oneshot
on property:sys.boot_completed=1
start can0shell
本文介绍如何在系统启动后通过Shell脚本自动执行初始化can参数的命令,并将其整合进init.rc文件,实现自动化操作。
3012

被折叠的 条评论
为什么被折叠?



