Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
ad69eace
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,发现更多精彩内容 >>
提交
ad69eace
编写于
9月 16, 2022
作者:
史
史晓晓
提交者:
Gitee
9月 16, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of gitee.com:openharmony/startup_init_lite into master
Signed-off-by:
N
史晓晓
<
shixiaoxiao2@huawei.com
>
上级
17ce0865
3f670ebd
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
94 addition
and
7 deletion
+94
-7
device_info/device_info_stub.cpp
device_info/device_info_stub.cpp
+10
-1
device_info/device_info_stub.h
device_info/device_info_stub.h
+3
-2
interfaces/innerkits/fs_manager/fstab_mount.c
interfaces/innerkits/fs_manager/fstab_mount.c
+2
-2
services/etc/group
services/etc/group
+1
-1
services/param/watcher/proxy/watcher_manager.cpp
services/param/watcher/proxy/watcher_manager.cpp
+75
-0
services/param/watcher/proxy/watcher_manager.h
services/param/watcher/proxy/watcher_manager.h
+3
-1
未找到文件。
device_info/device_info_stub.cpp
浏览文件 @
ad69eace
...
...
@@ -104,8 +104,17 @@ void DeviceInfoService::OnStart(void)
}
return
;
}
void
DeviceInfoService
::
OnStop
()
void
DeviceInfoService
::
OnStop
(
void
)
{
}
int
DeviceInfoService
::
Dump
(
int
fd
,
const
std
::
vector
<
std
::
u16string
>&
args
)
{
(
void
)
args
;
DINFO_LOGI
(
"DeviceInfoService Dump"
);
DINFO_CHECK
(
fd
>=
0
,
return
-
1
,
"Invalid fd for dump %d"
,
fd
);
return
dprintf
(
fd
,
"%s
\n
"
,
"No information to dump for this service"
);
}
}
// namespace device_info
}
// namespace OHOS
device_info/device_info_stub.h
浏览文件 @
ad69eace
...
...
@@ -44,8 +44,9 @@ public:
#ifndef STARTUP_INIT_TEST
protected:
#endif
void
OnStart
()
override
;
void
OnStop
()
override
;
void
OnStart
(
void
)
override
;
void
OnStop
(
void
)
override
;
int
Dump
(
int
fd
,
const
std
::
vector
<
std
::
u16string
>&
args
)
override
;
};
}
// namespace device_info
}
// namespace OHOS
...
...
interfaces/innerkits/fs_manager/fstab_mount.c
浏览文件 @
ad69eace
...
...
@@ -316,7 +316,7 @@ static int GetSlotInfoFromCmdLine(const char *slotInfoName)
char
value
[
MAX_BUFFER_LEN
]
=
{
0
};
char
*
buffer
=
ReadFileData
(
BOOT_CMD_LINE
);
BEGET_ERROR_CHECK
(
buffer
!=
NULL
,
return
-
1
,
"Failed to read cmdline"
);
BEGET_
ERROR
_CHECK
(
GetProcCmdlineValue
(
slotInfoName
,
buffer
,
value
,
MAX_BUFFER_LEN
)
==
0
,
BEGET_
INFO
_CHECK
(
GetProcCmdlineValue
(
slotInfoName
,
buffer
,
value
,
MAX_BUFFER_LEN
)
==
0
,
free
(
buffer
);
buffer
=
NULL
;
return
-
1
,
"Failed to get %s value from cmdline"
,
slotInfoName
);
free
(
buffer
);
buffer
=
NULL
;
...
...
@@ -336,7 +336,7 @@ static int GetSlotInfoFromMisc(off_t offset, off_t size)
BEGET_ERROR_CHECK
(
lseek
(
fd
,
offset
,
SEEK_SET
)
>=
0
,
close
(
fd
);
return
-
1
,
"Failed to lseek misc device fd, errno %d"
,
errno
);
int
slotInfo
=
0
;
BEGET_
ERROR
_CHECK
(
read
(
fd
,
&
slotInfo
,
size
)
==
size
,
close
(
fd
);
return
-
1
,
BEGET_
INFO
_CHECK
(
read
(
fd
,
&
slotInfo
,
size
)
==
size
,
close
(
fd
);
return
-
1
,
"Failed to read current slot from misc, errno %d"
,
errno
);
close
(
fd
);
return
slotInfo
;
...
...
services/etc/group
浏览文件 @
ad69eace
...
...
@@ -32,7 +32,7 @@ uiserver:x:1048:
servicectrl:x:1050:root,shell,system,samgr,hdf_devmgr
powerctrl:x:1051:root,shell,system,update,power_host
bootctrl:x:1052:root,shell,system
deviceprivate:x:1053:root,shell,system,samgr,hdf_devmgr,deviceinfo,dsoftbus,dms,account,useriam,device_manager
deviceprivate:x:1053:root,shell,system,samgr,hdf_devmgr,deviceinfo,dsoftbus,dms,account,useriam,
access_token,
device_manager
hiview:x:1201:
hidumper_service:x:1212:
shell:x:2000:
...
...
services/param/watcher/proxy/watcher_manager.cpp
浏览文件 @
ad69eace
...
...
@@ -24,6 +24,7 @@
#include "param_message.h"
#include "init_param.h"
#include "system_ability_definition.h"
#include "string_ex.h"
#include "watcher_utils.h"
namespace
OHOS
{
...
...
@@ -435,5 +436,79 @@ int32_t WatcherManager::RefreshWatcher(const std::string &keyPrefix, uint32_t wa
SendLocalChange
(
keyPrefix
,
paramWatcher
);
return
0
;
}
WatcherManager
::
ParamWatcher
*
WatcherManager
::
WatcherGroup
::
GetNextWatcher
(
WatcherManager
::
ParamWatcher
*
watcher
)
{
if
(
watcher
==
nullptr
)
{
if
(
ListEmpty
(
watchers_
))
{
return
nullptr
;
}
return
reinterpret_cast
<
WatcherManager
::
ParamWatcher
*>
(
GetWatchers
()
->
next
);
}
if
(
watcher
->
GetGroupNode
()
==
nullptr
)
{
return
nullptr
;
}
if
(
watcher
->
GetGroupNode
()
->
next
!=
GetWatchers
())
{
return
reinterpret_cast
<
WatcherManager
::
ParamWatcher
*>
(
watcher
->
GetGroupNode
()
->
next
);
}
return
nullptr
;
}
void
WatcherManager
::
DumpWatcherGroup
(
int
fd
,
const
WatcherManager
::
WatcherGroupPtr
&
watchGroup
)
{
dprintf
(
fd
,
"Watch prefix : %s
\n
"
,
watchGroup
->
GetKeyPrefix
().
c_str
());
dprintf
(
fd
,
"Watch group id : %d
\n
"
,
watchGroup
->
GetGroupId
());
// watcher id
WatcherManager
::
ParamWatcher
*
watcher
=
watchGroup
->
GetNextWatcher
(
nullptr
);
if
(
watcher
!=
nullptr
)
{
dprintf
(
fd
,
"Watch id list : %d"
,
watcher
->
GetWatcherId
());
}
else
{
return
;
}
watcher
=
watchGroup
->
GetNextWatcher
(
watcher
);
while
(
watcher
!=
nullptr
)
{
dprintf
(
fd
,
", %d"
,
watcher
->
GetWatcherId
());
watcher
=
watchGroup
->
GetNextWatcher
(
watcher
);
}
dprintf
(
fd
,
"
\n
"
);
}
int
WatcherManager
::
Dump
(
int
fd
,
const
std
::
vector
<
std
::
u16string
>&
args
)
{
WATCHER_CHECK
(
fd
>=
0
,
return
-
1
,
"Invalid fd for dump %d"
,
fd
);
std
::
vector
<
std
::
string
>
params
;
for
(
auto
&
arg
:
args
)
{
params
.
emplace_back
(
Str16ToStr8
(
arg
));
}
if
(
params
.
size
()
>=
1
&&
params
[
0
]
==
"-h"
)
{
std
::
string
dumpInfo
=
{};
dumpInfo
.
append
(
"Usage:
\n
"
)
.
append
(
" -h "
)
.
append
(
"|help text for the tool
\n
"
)
.
append
(
" -k "
)
.
append
(
"|dump watcher infomation for key prefix
\n
"
);
dprintf
(
fd
,
"%s
\n
"
,
dumpInfo
.
c_str
());
return
0
;
}
if
(
params
.
size
()
>
1
&&
params
[
0
]
==
"-k"
)
{
auto
group
=
GetWatcherGroup
(
params
[
1
]);
if
(
group
==
NULL
)
{
dprintf
(
fd
,
"Prefix %s not found in watcher list
\n
"
,
params
[
1
].
c_str
());
return
0
;
}
DumpWatcherGroup
(
fd
,
group
);
return
0
;
}
// all output
std
::
lock_guard
<
std
::
mutex
>
lock
(
watcherMutex_
);
// dump all watcher
for
(
auto
it
=
groupMap_
.
begin
();
it
!=
groupMap_
.
end
();
it
++
)
{
if
(
watcherGroups_
.
find
(
it
->
second
)
!=
watcherGroups_
.
end
())
{
DumpWatcherGroup
(
fd
,
watcherGroups_
[
it
->
second
]);
}
}
return
0
;
}
}
// namespace init_param
}
// namespace OHOS
services/param/watcher/proxy/watcher_manager.h
浏览文件 @
ad69eace
...
...
@@ -126,6 +126,7 @@ public:
{
return
&
watchers_
;
}
ParamWatcher
*
GetNextWatcher
(
ParamWatcher
*
watcher
);
private:
uint32_t
groupId_
;
std
::
string
keyPrefix_
{
};
...
...
@@ -144,6 +145,7 @@ protected:
#endif
void
OnStart
()
override
;
void
OnStop
()
override
;
int
Dump
(
int
fd
,
const
std
::
vector
<
std
::
u16string
>&
args
)
override
;
#ifndef STARTUP_INIT_TEST
private:
#endif
...
...
@@ -161,7 +163,7 @@ private:
int
GetServerFd
(
bool
retry
);
int
GetWatcherId
(
uint32_t
&
watcherId
);
int
GetGroupId
(
uint32_t
&
groupId
);
void
DumpWatcherGroup
(
int
fd
,
const
WatcherGroupPtr
&
group
);
private:
std
::
atomic
<
uint32_t
>
watcherId_
{
0
};
std
::
atomic
<
uint32_t
>
groupId_
{
0
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录