一丶环境信息

硬件信息:设备dayu200

软件信息:Openhamrony5.0.3

 

二丶操作方法

在源码根目录下base\startup\init\services\etc\init.cfg\init.cfg中添加:

{

            "name" : "post-fs-data",

            "cmds" : [

                "mkdir /storage/media 0711 root root",

                "mkdir /data/misc 01771 system misc",

                "mkdir /data/misc/shared_relro 0771 root root",

                "mkdir /data/local 0751 root root",

                "mkdir /data/vendor 0771 root root",

                "mkdir /data/local/tmp 0771 shell shell",

                "mkdir /data/local/tmp/debugserver 0755 shell shell",

                "mkdir /data/local/traces 0775 shell shell",

                "mkdir /data/data 0771 system system",

                "mkdir /data/app 0771 system system",

                "mkdir /data/nfc 0770 nfc nfc",

                "mkdir /data/nfc/param 0770 nfc nfc",

                "setparam sys.use_memfd false",

                "chown root system /dev/fscklogs/log",

                "chmod 0770 /dev/fscklogs/log",

                "chmod 0660 /dev/fuse",

                "restorecon /data/service/el1/public",

                "restorecon /data/service/el1/public/activation_lock",

                "restorecon /data/service/el1/startup/parameters",

                "exec /system/bin/hilog -Q pidoff",

                "exec /system/bin/hilog -b D",

                "exec /system/bin/hilog -p off",

                "exec /system/bin/hilog -w start -n 1000 -l 10M",

                "exec /system/bin/hilog -w start -t kmsg"

            ]

        }

这样在烧录的时候,日志就自动落盘了,每次开机启动后,日志存放在/data/log/hilog里方便大家调试。

如果需要更改hilog的配置也需要在base\hiviewdfx\hilog\services\hilogd\etc\hilog.para中按照自己的调试要求来修改:

hilog.private.on=false
hilog.debug.on=false
persist.sys.hilog.kmsg.on=true
persist.sys.hilog.debug.on=false
hilog.flowctrl.proc.on=false
hilog.flowctrl.domain.on=false

persist.sys.hilog.loggable.global=I
hilog.buffersize.global=262144

 

Logo

社区规范:仅讨论OpenHarmony相关问题。

更多推荐