Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
13a17660
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
大约 1 年 前同步成功
通知
3
Star
37
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Startup Init Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
13a17660
编写于
3月 28, 2022
作者:
X
xionglei6
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'fixbug' of
https://gitee.com/xionglei6/startup_init_lite
into fixbug
上级
e4ec3363
204c731c
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
96 addition
and
17 deletion
+96
-17
interfaces/innerkits/socket/BUILD.gn
interfaces/innerkits/socket/BUILD.gn
+0
-1
services/etc/group
services/etc/group
+27
-1
services/etc/init.cfg
services/etc/init.cfg
+6
-5
services/etc/init.without_two_stages.cfg
services/etc/init.without_two_stages.cfg
+3
-2
services/etc/param/ohos.para.dac
services/etc/param/ohos.para.dac
+3
-2
services/etc/passwd
services/etc/passwd
+26
-1
services/log/BUILD.gn
services/log/BUILD.gn
+0
-1
test/unittest/BUILD.gn
test/unittest/BUILD.gn
+2
-0
test/unittest/init/service_socket_unittest.cpp
test/unittest/init/service_socket_unittest.cpp
+3
-1
test/unittest/param/watcher_agent_unittest.cpp
test/unittest/param/watcher_agent_unittest.cpp
+9
-1
test/unittest/param/watcher_proxy_unittest.cpp
test/unittest/param/watcher_proxy_unittest.cpp
+4
-0
watchdog/BUILD.gn
watchdog/BUILD.gn
+4
-1
watchdog/init_watchdog.c
watchdog/init_watchdog.c
+9
-1
未找到文件。
interfaces/innerkits/socket/BUILD.gn
浏览文件 @
13a17660
...
...
@@ -50,6 +50,5 @@ if (defined(ohos_lite)) {
"system",
"updater",
]
relative_install_dir = "platform-vndk"
}
}
services/etc/group
浏览文件 @
13a17660
...
...
@@ -21,7 +21,7 @@ sdcard_r:x:1028:
package_info:x:1032:
logd:x:1036:
shared_relro:x:1037:
audio
server
:x:1041:
audio:x:1041:
cameraserver:x:1047:
servicectrl:x:1050:root,shell,system,samgr,hdf_devmgr
shell:x:2000:
...
...
@@ -33,5 +33,31 @@ wakelock:x:3010:
uhid:x:3011:
ddms:x:3012:
access_token:x:3020:
blue_host:x:3021:
sample_host:x:3022:
usb_host:x:3023:
usbfnMaster_host:x:3024:
power_host:x:3025:
wifi_host:x:3026:
audio_hdi_server_host:x:3027:
camera_host:x:3028:
input_user_host:x:3029:
display_gralloc_host:x:3030:
codec_host:x:3031:
riladapter_host:x:3032:
sensor_dal_host:x:3033:
vibrator_dal_host:x:3034:
light_dal_host:x:3035:
wifi_c_host:x:3036:
disp_gralloc_host:x:3037:
dcamera_host:x:3038:
hwc_host:x:3039:
gralloc_host:x:3040:
sensor_host:x:3041:
nfc_host:x:3042:
a2dp_host:x:3043:
hdf_devmgr:x:3044:
connected_tag_host:x:3045:
dms:x:5522:
misc:x:9998:
app:x:10000:
services/etc/init.cfg
浏览文件 @
13a17660
...
...
@@ -245,9 +245,9 @@
"mkdir /data/misc/vpn 0770 system vpn",
"mkdir /data/misc/shared_relro 0771 shared_relro shared_relro",
"mkdir /data/misc/systemkeys 0700 system system",
"mkdir /data/misc/wifi 0770
wifi wifi
",
"mkdir /data/misc/wifi/sockets 0770
wifi wifi
",
"mkdir /data/misc/wifi/wpa_supplicant 0
770 wifi wifi
",
"mkdir /data/misc/wifi 0770
system system
",
"mkdir /data/misc/wifi/sockets 0770
system system
",
"mkdir /data/misc/wifi/wpa_supplicant 0
660 system system
",
"mkdir /data/misc/ethernet 0770 system system",
"mkdir /data/misc/dhcp 0770 dhcp dhcp",
"mkdir /data/misc/user 0771 root root",
...
...
@@ -255,7 +255,7 @@
"chmod 0660 /data/misc/wifi/wpa_supplicant.conf",
"mkdir /data/local 0751 root root",
"mkdir /data/misc/media 0700 media media",
"mkdir /data/misc/audio
server 0700 audioserver audioserver
",
"mkdir /data/misc/audio
0700 audio audio
",
"mkdir /data/misc/cameraserver 0700 cameraserver cameraserver",
"mkdir /data/misc/vold 0700 root root",
"mkdir /data/misc/boottrace 0771 system shell",
...
...
@@ -313,7 +313,8 @@
"mkdir /data/init_agent 0770 shell system",
"setparam sys.use_memfd false",
"chown root system /dev/fscklogs/log",
"chmod 0770 /dev/fscklogs/log"
"chmod 0770 /dev/fscklogs/log",
"chmod 0660 /dev/fuse"
]
}, {
"name" : "boot",
...
...
services/etc/init.without_two_stages.cfg
浏览文件 @
13a17660
...
...
@@ -245,7 +245,7 @@
"chmod 0660 /data/misc/wifi/wpa_supplicant.conf",
"mkdir /data/local 0751 root root",
"mkdir /data/misc/media 0700 media media",
"mkdir /data/misc/audio
server 0700 audioserver audioserver
",
"mkdir /data/misc/audio
0700 audio audio
",
"mkdir /data/misc/cameraserver 0700 cameraserver cameraserver",
"mkdir /data/misc/vold 0700 root root",
"mkdir /data/misc/boottrace 0771 system shell",
...
...
@@ -303,7 +303,8 @@
"mkdir /data/init_agent 0770 shell system",
"setparam sys.use_memfd false",
"chown root system /dev/fscklogs/log",
"chmod 0770 /dev/fscklogs/log"
"chmod 0770 /dev/fscklogs/log",
"chmod 0660 /dev/fuse"
]
}, {
"name" : "boot",
...
...
services/etc/param/ohos.para.dac
浏览文件 @
13a17660
...
...
@@ -26,8 +26,9 @@ const.debuggable = root:root:0777
persist.sys.usb.config = root:root:0777
# default forbit other user to start service
ohos.servicectrl. = system:servicectrl:077
5
ohos.servicectrl. = system:servicectrl:077
7
test.permission. = root:root:0770
test.permission.read. = root:root:0774
test.permission.write. = root:root:0772
test.permission.watcher. = root:root:0771
\ No newline at end of file
test.permission.watcher. = root:root:0771
services/etc/passwd
浏览文件 @
13a17660
...
...
@@ -22,7 +22,7 @@ sdcard_r:x:1028:1028:::/bin/false
package_info:x:1032:1032:::/bin/false
logd:x:1036:1036:::/bin/false
shared_relro:x:1037:1037:::/bin/false
audio
server
:x:1041:1041:::/bin/false
audio:x:1041:1041:::/bin/false
cameraserver:x:1047:1047:::/bin/false
shell:x:2000:2000:::/bin/false
cache:x:2001:2001:::/bin/false
...
...
@@ -33,6 +33,31 @@ wakelock:x:3010:3010:::/bin/false
uhid:x:3011:3011:::/bin/false
ddms:x:3012:3012:::/bin/false
access_token:x:3020:3020:::/bin/false
blue_host:x:3021:3021:::/bin/false
sample_host:x:3022:3022:::/bin/false
usb_host:x:3023:3023:::/bin/false
usbfnMaster_host:x:3024:3024:::/bin/false
power_host:x:3025:3025:::/bin/false
wifi_host:x:3026:3026:::/bin/false
audio_hdi_server_host:x:3027:3027:::/bin/false
camera_host:x:3028:3028:::/bin/false
input_user_host:x:3029:3029:::/bin/false
display_gralloc_host:x:3030:3030:::/bin/false
codec_host:x:3031:3031:::/bin/false
riladapter_host:x:3032:3032:::/bin/false
sensor_dal_host:x:3033:3033:::/bin/false
vibrator_dal_host:x:3034:3034:::/bin/false
light_dal_host:x:3035:3035:::/bin/false
wifi_c_host:x:3036:3036:::/bin/false
disp_gralloc_host:x:3037:3037:::/bin/false
dcamera_host:x:3038:3038:::/bin/false
hwc_host:x:3039:3039:::/bin/false
gralloc_host:x:3040:3040:::/bin/false
sensor_host:x:3041:3041:::/bin/false
nfc_host:x:3042:3042:::/bin/false
a2dp_host:x:3043:3043:::/bin/false
hdf_devmgr:x:3044:3044:::/bin/false
connected_tag_host:x:3045:3045:::/bin/false
dms:x:5522:5522:::/bin/false
misc:x:9998:9998:::/bin/false
app:x:10000:10000:::/bin/false
services/log/BUILD.gn
浏览文件 @
13a17660
...
...
@@ -40,7 +40,6 @@ if (defined(ohos_lite)) {
"system",
"updater",
]
relative_install_dir = "platform-vndk"
install_enable = true
part_name = "init"
subsystem_name = "startup"
...
...
test/unittest/BUILD.gn
浏览文件 @
13a17660
...
...
@@ -185,6 +185,8 @@ ohos_unittest("init_ut") {
]
defines = [
"READ_CHECK",
"PARAM_SUPPORT_DAC_CHECK",
"INIT_AGENT",
"STARTUP_INIT_TEST",
"PARAM_SUPPORT_SAVE_PERSIST",
...
...
test/unittest/init/service_socket_unittest.cpp
浏览文件 @
13a17660
...
...
@@ -38,7 +38,9 @@ HWTEST_F(ServiceSocketUnitTest, TestCreateSocket, TestSize.Level0)
ASSERT_NE
(
service
,
nullptr
);
ServiceSocket
*
sockopt
=
(
ServiceSocket
*
)
calloc
(
1
,
sizeof
(
ServiceSocket
)
+
strlen
(
testSocName
)
+
1
);
ASSERT_NE
(
sockopt
,
nullptr
);
sockopt
->
type
=
SOCK_SEQPACKET
;
sockopt
->
type
=
SOCK_STREAM
;
sockopt
->
protocol
=
0
;
sockopt
->
family
=
PF_UNIX
;
sockopt
->
sockFd
=
-
1
;
sockopt
->
uid
=
1000
;
sockopt
->
gid
=
1000
;
...
...
test/unittest/param/watcher_agent_unittest.cpp
浏览文件 @
13a17660
...
...
@@ -23,6 +23,7 @@
#include "iwatcher_manager.h"
#include "message_parcel.h"
#include "param_utils.h"
#include "param_request.h"
#include "sys_param.h"
#include "system_ability_definition.h"
#include "watcher.h"
...
...
@@ -43,7 +44,14 @@ public:
WatcherAgentUnitTest
()
{}
virtual
~
WatcherAgentUnitTest
()
{}
void
SetUp
()
{}
void
SetUp
()
{
ParamWorkSpace
*
space
=
GetClientParamWorkSpace
();
if
(
space
!=
nullptr
&&
space
->
securityLabel
!=
nullptr
)
{
space
->
securityLabel
->
cred
.
uid
=
1000
;
// 1000 test uid
space
->
securityLabel
->
cred
.
gid
=
1000
;
// 1000 test gid
}
}
void
TearDown
()
{}
void
TestBody
()
{}
...
...
test/unittest/param/watcher_proxy_unittest.cpp
浏览文件 @
13a17660
...
...
@@ -68,6 +68,7 @@ public:
MessageParcel
reply
;
MessageOption
option
;
data
.
WriteInterfaceToken
(
IWatcherManager
::
GetDescriptor
());
data
.
WriteString
(
keyPrefix
);
sptr
<
IWatcher
>
watcher
=
new
TestWatcher
();
bool
ret
=
data
.
WriteRemoteObject
(
watcher
->
AsObject
());
...
...
@@ -87,6 +88,7 @@ public:
MessageParcel
data
;
MessageParcel
reply
;
MessageOption
option
;
data
.
WriteInterfaceToken
(
IWatcherManager
::
GetDescriptor
());
data
.
WriteString
(
keyPrefix
);
data
.
WriteUint32
(
watcherId
);
watcherManager
->
OnRemoteRequest
(
IWatcherManager
::
DEL_WATCHER
,
data
,
reply
,
option
);
...
...
@@ -138,6 +140,8 @@ public:
MessageParcel
data
;
MessageParcel
reply
;
MessageOption
option
;
data
.
WriteInterfaceToken
(
IWatcherManager
::
GetDescriptor
());
data
.
WriteString
(
keyPrefix
);
sptr
<
IWatcher
>
watcher
=
new
TestWatcher
();
bool
ret
=
data
.
WriteRemoteObject
(
watcher
->
AsObject
());
...
...
watchdog/BUILD.gn
浏览文件 @
13a17660
...
...
@@ -23,7 +23,10 @@ if (defined(ohos_lite)) {
"//base/startup/init_lite/interfaces/innerkits/include",
]
deps = [ "//base/startup/init_lite/services/log:init_log" ]
defines = [ "_GNU_SOURCE" ]
defines = [
"_GNU_SOURCE",
"OHOS_LITE_WATCHDOG",
]
if (ohos_kernel_type == "linux") {
defines += [ "LINUX_WATCHDOG" ]
}
...
...
watchdog/init_watchdog.c
浏览文件 @
13a17660
...
...
@@ -15,8 +15,10 @@
#include <errno.h>
#include <fcntl.h>
#include <sched.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h>
...
...
@@ -75,7 +77,13 @@ int main(int argc, const char *argv[])
gap
=
(
gap
>
0
)
?
gap
:
DEFAULT_GAP
;
INIT_LOGI
(
"watchdoge started (interval %d, margin %d), fd = %d
\n
"
,
interval
,
gap
,
fd
);
#ifdef OHOS_LITE_WATCHDOG
#ifndef LINUX_WATCHDOG
if
(
setpriority
(
PRIO_PROCESS
,
0
,
14
)
!=
0
)
{
// 14 is process priority
INIT_LOGE
(
"setpriority failed err=%d
\n
"
,
errno
);
}
#endif
#endif
int
timeoutSet
=
interval
+
gap
;
int
timeoutGet
=
0
;
int
ret
=
ioctl
(
fd
,
WDIOC_SETTIMEOUT
,
&
timeoutSet
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录