Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
556832be
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,发现更多精彩内容 >>
提交
556832be
编写于
3月 10, 2022
作者:
X
xionglei6
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:selinux、suspend、rk3568切换回合release
Signed-off-by:
N
xionglei6
<
xionglei6@huawei.com
>
上级
9318dc79
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
185 addition
and
35 deletion
+185
-35
services/etc/param/ohos.para
services/etc/param/ohos.para
+46
-1
services/etc/passwd
services/etc/passwd
+2
-0
services/init/init_common_service.c
services/init/init_common_service.c
+6
-0
services/init/init_service_manager.c
services/init/init_service_manager.c
+4
-1
services/init/standard/init_cmds.c
services/init/standard/init_cmds.c
+15
-0
services/init/standard/init_signal_handler.c
services/init/standard/init_signal_handler.c
+4
-1
services/param/service/param_service.c
services/param/service/param_service.c
+106
-31
services/utils/init_utils.c
services/utils/init_utils.c
+2
-1
未找到文件。
services/etc/param/ohos.para
浏览文件 @
556832be
...
@@ -17,7 +17,7 @@ build_version = 2.0
...
@@ -17,7 +17,7 @@ build_version = 2.0
hw_sc.build.os.enable=true
hw_sc.build.os.enable=true
# ohos API version number.
# ohos API version number.
hw_sc.build.os.apiversion=
8
hw_sc.build.os.apiversion=
9
# ohos system version.
# ohos system version.
hw_sc.build.os.version=2.2.0
hw_sc.build.os.version=2.2.0
...
@@ -37,3 +37,48 @@ const.build.characteristics=default
...
@@ -37,3 +37,48 @@ const.build.characteristics=default
const.product.model=ohos
const.product.model=ohos
const.product.name="OpenHarmony 2.0 Canary"
const.product.name="OpenHarmony 2.0 Canary"
persist.sys.usb.config=hdc
persist.sys.usb.config=hdc
const.sandbox=enable
# const.build.characteristics=default
const.product.devicetype=default
# OHOS_SOFTWARE_MODEL[] = {"default"}
const.software.model=default
# OHOS_MANUFACTURE[] = {"default"}
const.product.manufacturer=default
# OHOS_BRAND[] = {"default"}
const.product.brand=default
# OHOS_PRODUCT_SERIES[] = {"default"}
const.build.product=default
# OHOS_HARDWARE_MODEL[] = {"default"}
const.product.hardwareversion=default
# OHOS_BOOTLOADER_VERSION[] = {"bootloader"}
const.product.bootloader.version=bootloader
# OHOS_ABI_LIST[] = {"default"}
const.product.cpu.abilist=default
# OHOS_SECURITY_PATCH_TAG[] = { "2020-09-01" }
const.ohos.version.security_patch=2020-09-01
# OHOS_DISPLAY_VERSION[] = {"OpenHarmony 3.1.5.2"}
const.product.software.version=OpenHarmony 3.1.5.2
# OHOS_INCREMENTAL_VERSION[] = {"default"}
const.product.incremental.version=default
# OHOS_FIRST_API_LEVEL = 1
const.product.firstapiversion=1
# OHOS_BUILD_TYPE[] = {"default"}
const.product.build.type=default
# OHOS_BUILD_USER[] = {"default"}
const.product.build.user=default
# OHOS_BUILD_HOST[] = {"default"}
const.product.build.host=default
# OHOS_BUILD_TIME[] = {"default"}
const.product.build.date=default
# OHOS_HARDWARE_PROFILE[] = {"default"}
const.product.hardwareprofile=default
# OHOS_RELEASE_TYPE[] = { "Canary1" }
const.ohos.releasetype=Canary1
# OHOS_SDK_API_LEVEL = 8;
const.ohos.apiversion=8
# OHOS_BUILD_ROOT_HASH[] = { "default" }
const.ohos.buildroothash=default
# OHOS_SDK_API_LEVEL = 8
const.ohos.sdkapilevel=8
# OHOS_OS_NAME[] = { "OpenHarmony" }
const.ohos.name=OpenHarmony
services/etc/passwd
浏览文件 @
556832be
...
@@ -4,6 +4,7 @@ system:x:1000:1000:::/bin/false
...
@@ -4,6 +4,7 @@ system:x:1000:1000:::/bin/false
radio:x:1001:1001:::/bin/false
radio:x:1001:1001:::/bin/false
bluetooth:x:1002:1002:::/bin/false
bluetooth:x:1002:1002:::/bin/false
graphics:x:1003:1003:::/bin/false
graphics:x:1003:1003:::/bin/false
samgr:x:1005:1005:::/bin/false
file_manager:x:1006:1006:::/bin/false
file_manager:x:1006:1006:::/bin/false
log:x:1007:1007:::/bin/false
log:x:1007:1007:::/bin/false
user_data_rw:x:1008:1008:::/bin/false
user_data_rw:x:1008:1008:::/bin/false
...
@@ -32,5 +33,6 @@ wakelock:x:3010:3010:::/bin/false
...
@@ -32,5 +33,6 @@ wakelock:x:3010:3010:::/bin/false
uhid:x:3011:3011:::/bin/false
uhid:x:3011:3011:::/bin/false
ddms:x:3012:3012:::/bin/false
ddms:x:3012:3012:::/bin/false
access_token:x:3020:3020:::/bin/false
access_token:x:3020:3020:::/bin/false
dms:x:5522:5522:::/bin/false
misc:x:9998:9998:::/bin/false
misc:x:9998:9998:::/bin/false
app:x:10000:10000:::/bin/false
app:x:10000:10000:::/bin/false
services/init/init_common_service.c
浏览文件 @
556832be
...
@@ -64,6 +64,12 @@ static int SetAllAmbientCapability(void)
...
@@ -64,6 +64,12 @@ static int SetAllAmbientCapability(void)
static
int
SetPerms
(
const
Service
*
service
)
static
int
SetPerms
(
const
Service
*
service
)
{
{
INIT_CHECK_RETURN_VALUE
(
KeepCapability
()
==
0
,
SERVICE_FAILURE
);
INIT_CHECK_RETURN_VALUE
(
KeepCapability
()
==
0
,
SERVICE_FAILURE
);
if
(
service
->
servPerm
.
gIDCnt
==
0
)
{
// use uid as gid
INIT_ERROR_CHECK
(
setgid
(
service
->
servPerm
.
uID
)
==
0
,
return
SERVICE_FAILURE
,
"SetPerms, setgid for %s failed. %d"
,
service
->
name
,
errno
);
}
if
(
service
->
servPerm
.
gIDCnt
>
0
)
{
if
(
service
->
servPerm
.
gIDCnt
>
0
)
{
INIT_ERROR_CHECK
(
setgid
(
service
->
servPerm
.
gIDArray
[
0
])
==
0
,
return
SERVICE_FAILURE
,
INIT_ERROR_CHECK
(
setgid
(
service
->
servPerm
.
gIDArray
[
0
])
==
0
,
return
SERVICE_FAILURE
,
"SetPerms, setgid for %s failed. %d"
,
service
->
name
,
errno
);
"SetPerms, setgid for %s failed. %d"
,
service
->
name
,
errno
);
...
...
services/init/init_service_manager.c
浏览文件 @
556832be
...
@@ -305,7 +305,10 @@ static int GetServiceGids(const cJSON *curArrItem, Service *curServ)
...
@@ -305,7 +305,10 @@ static int GetServiceGids(const cJSON *curArrItem, Service *curServ)
{
{
int
gidCount
;
int
gidCount
;
cJSON
*
arrItem
=
cJSON_GetObjectItemCaseSensitive
(
curArrItem
,
GID_STR_IN_CFG
);
cJSON
*
arrItem
=
cJSON_GetObjectItemCaseSensitive
(
curArrItem
,
GID_STR_IN_CFG
);
if
(
!
cJSON_IsArray
(
arrItem
))
{
if
(
!
arrItem
)
{
curServ
->
servPerm
.
gIDCnt
=
0
;
return
SERVICE_SUCCESS
;
}
else
if
(
!
cJSON_IsArray
(
arrItem
))
{
gidCount
=
1
;
gidCount
=
1
;
}
else
{
}
else
{
gidCount
=
cJSON_GetArraySize
(
arrItem
);
gidCount
=
cJSON_GetArraySize
(
arrItem
);
...
...
services/init/standard/init_cmds.c
浏览文件 @
556832be
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
*/
*/
#include "init_cmds.h"
#include "init_cmds.h"
#include <dlfcn.h>
#include <errno.h>
#include <errno.h>
#include <fcntl.h>
#include <fcntl.h>
#include <net/if.h>
#include <net/if.h>
...
@@ -180,6 +181,20 @@ static void DoExec(const struct CmdArgs *ctx)
...
@@ -180,6 +181,20 @@ static void DoExec(const struct CmdArgs *ctx)
if
(
pid
==
0
)
{
if
(
pid
==
0
)
{
INIT_ERROR_CHECK
(
ctx
!=
NULL
&&
ctx
->
argv
[
0
]
!=
NULL
,
_exit
(
0x7f
),
INIT_ERROR_CHECK
(
ctx
!=
NULL
&&
ctx
->
argv
[
0
]
!=
NULL
,
_exit
(
0x7f
),
"DoExec: invalid arguments to exec
\"
%s
\"
"
,
ctx
->
argv
[
0
]);
"DoExec: invalid arguments to exec
\"
%s
\"
"
,
ctx
->
argv
[
0
]);
#ifdef SUPPORT_PROFILER_HIDEBUG
void
*
handle
=
dlopen
(
"/system/lib/libhidebug.so"
,
RTLD_LAZY
);
if
(
handle
==
NULL
)
{
INIT_LOGE
(
"Failed to dlopen libhidebug.so, %s
\n
"
,
dlerror
());
return
;
}
bool
(
*
initParam
)();
initParam
=
(
bool
(
*
)())
dlsym
(
handle
,
"InitEnvironmentParam"
);
if
(
initParam
==
NULL
)
{
INIT_LOGE
(
"Failed to dlsym InitEnvironmentParam, %s
\n
"
,
dlerror
());
return
;
}
(
*
initParam
)(
ctx
->
argv
[
0
]);
#endif
int
ret
=
execv
(
ctx
->
argv
[
0
],
ctx
->
argv
);
int
ret
=
execv
(
ctx
->
argv
[
0
],
ctx
->
argv
);
if
(
ret
==
-
1
)
{
if
(
ret
==
-
1
)
{
INIT_LOGE
(
"DoExec: execute
\"
%s
\"
failed: %d."
,
ctx
->
argv
[
0
],
errno
);
INIT_LOGE
(
"DoExec: execute
\"
%s
\"
failed: %d."
,
ctx
->
argv
[
0
],
errno
);
...
...
services/init/standard/init_signal_handler.c
浏览文件 @
556832be
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
#include "init_adapter.h"
#include "init_adapter.h"
#include "init_log.h"
#include "init_log.h"
#include "init_param.h"
#include "init_service_manager.h"
#include "init_service_manager.h"
#include "loop_event.h"
#include "loop_event.h"
...
@@ -48,7 +49,9 @@ static void ProcessSignal(const struct signalfd_siginfo *siginfo)
...
@@ -48,7 +49,9 @@ static void ProcessSignal(const struct signalfd_siginfo *siginfo)
}
}
case
SIGTERM
:
{
case
SIGTERM
:
{
INIT_LOGI
(
"SigHandler, SIGTERM received."
);
INIT_LOGI
(
"SigHandler, SIGTERM received."
);
StopAllServices
(
0
,
NULL
,
0
,
NULL
);
SystemWriteParam
(
"startup.device.ctl"
,
"stop"
);
// exec reboot use toybox reboot cmd
ExecReboot
(
"reboot"
);
break
;
break
;
}
}
default:
default:
...
...
services/param/service/param_service.c
浏览文件 @
556832be
...
@@ -71,7 +71,9 @@ static int AddParam(WorkSpace *workSpace, const char *name, const char *value, u
...
@@ -71,7 +71,9 @@ static int AddParam(WorkSpace *workSpace, const char *name, const char *value, u
PARAM_CHECK
(
offset
>
0
,
return
PARAM_CODE_REACHED_MAX
,
"Failed to allocate name %s"
,
name
);
PARAM_CHECK
(
offset
>
0
,
return
PARAM_CODE_REACHED_MAX
,
"Failed to allocate name %s"
,
name
);
SaveIndex
(
&
node
->
dataIndex
,
offset
);
SaveIndex
(
&
node
->
dataIndex
,
offset
);
}
}
*
dataIndex
=
node
->
dataIndex
;
if
(
dataIndex
!=
NULL
)
{
*
dataIndex
=
node
->
dataIndex
;
}
return
0
;
return
0
;
}
}
...
@@ -115,13 +117,15 @@ static int CheckParamValue(const WorkSpace *workSpace, const ParamTrieNode *node
...
@@ -115,13 +117,15 @@ static int CheckParamValue(const WorkSpace *workSpace, const ParamTrieNode *node
int
WriteParam
(
const
WorkSpace
*
workSpace
,
const
char
*
name
,
const
char
*
value
,
uint32_t
*
dataIndex
,
int
onlyAdd
)
int
WriteParam
(
const
WorkSpace
*
workSpace
,
const
char
*
name
,
const
char
*
value
,
uint32_t
*
dataIndex
,
int
onlyAdd
)
{
{
PARAM_CHECK
(
workSpace
!=
NULL
&&
dataIndex
!=
NULL
,
return
PARAM_CODE_INVALID_PARAM
,
"Invalid workSpace"
);
PARAM_CHECK
(
workSpace
!=
NULL
,
return
PARAM_CODE_INVALID_PARAM
,
"Invalid workSpace"
);
PARAM_CHECK
(
value
!=
NULL
&&
name
!=
NULL
,
return
PARAM_CODE_INVALID_PARAM
,
"Invalid name or value"
);
PARAM_CHECK
(
value
!=
NULL
&&
name
!=
NULL
,
return
PARAM_CODE_INVALID_PARAM
,
"Invalid name or value"
);
ParamTrieNode
*
node
=
FindTrieNode
(
workSpace
,
name
,
strlen
(
name
),
NULL
);
ParamTrieNode
*
node
=
FindTrieNode
(
workSpace
,
name
,
strlen
(
name
),
NULL
);
int
ret
=
CheckParamValue
(
workSpace
,
node
,
name
,
value
);
int
ret
=
CheckParamValue
(
workSpace
,
node
,
name
,
value
);
PARAM_CHECK
(
ret
==
0
,
return
ret
,
"Invalid param value param: %s=%s"
,
name
,
value
);
PARAM_CHECK
(
ret
==
0
,
return
ret
,
"Invalid param value param: %s=%s"
,
name
,
value
);
if
(
node
!=
NULL
&&
node
->
dataIndex
!=
0
)
{
if
(
node
!=
NULL
&&
node
->
dataIndex
!=
0
)
{
*
dataIndex
=
node
->
dataIndex
;
if
(
dataIndex
!=
NULL
)
{
*
dataIndex
=
node
->
dataIndex
;
}
if
(
onlyAdd
)
{
if
(
onlyAdd
)
{
return
0
;
return
0
;
}
}
...
@@ -168,7 +172,7 @@ static char *BuildKey(ParamWorkSpace *workSpace, const char *format, ...)
...
@@ -168,7 +172,7 @@ static char *BuildKey(ParamWorkSpace *workSpace, const char *format, ...)
size_t
buffSize
=
sizeof
(
workSpace
->
buffer
);
size_t
buffSize
=
sizeof
(
workSpace
->
buffer
);
int
len
=
vsnprintf_s
(
workSpace
->
buffer
,
buffSize
,
buffSize
-
1
,
format
,
vargs
);
int
len
=
vsnprintf_s
(
workSpace
->
buffer
,
buffSize
,
buffSize
-
1
,
format
,
vargs
);
va_end
(
vargs
);
va_end
(
vargs
);
if
(
len
>
0
&&
len
<
buffSize
)
{
if
(
len
>
0
&&
(
size_t
)
len
<
buffSize
)
{
workSpace
->
buffer
[
len
]
=
'\0'
;
workSpace
->
buffer
[
len
]
=
'\0'
;
for
(
int
i
=
0
;
i
<
len
;
i
++
)
{
for
(
int
i
=
0
;
i
<
len
;
i
++
)
{
if
(
workSpace
->
buffer
[
i
]
==
'|'
)
{
if
(
workSpace
->
buffer
[
i
]
==
'|'
)
{
...
@@ -535,35 +539,107 @@ PARAM_STATIC int ProcessMessage(const ParamTaskPtr worker, const ParamMessage *m
...
@@ -535,35 +539,107 @@ PARAM_STATIC int ProcessMessage(const ParamTaskPtr worker, const ParamMessage *m
return
0
;
return
0
;
}
}
static
int
LoadOneParam_
(
char
*
line
,
uint32_t
mode
,
const
char
*
exclude
[],
uint32_t
count
)
{
char
*
name
;
char
*
value
;
char
*
pos
;
// Skip spaces
name
=
line
;
while
(
isspace
(
*
name
)
&&
(
*
name
!=
'\0'
))
{
name
++
;
}
// Empty line
if
(
*
name
==
'\0'
)
{
return
0
;
}
// Comment line
if
(
*
name
==
'#'
)
{
return
0
;
}
value
=
name
;
// find the first delimiter '='
while
(
*
value
!=
'\0'
)
{
if
(
*
value
==
'='
)
{
(
*
value
)
=
'\0'
;
value
=
value
+
1
;
break
;
}
value
++
;
}
// empty name, just ignore this line
if
(
*
name
==
'\0'
)
{
return
0
;
}
// Trim the ending spaces of name
pos
=
value
-
1
;
pos
-=
1
;
while
(
isspace
(
*
pos
)
&&
pos
>
name
)
{
(
*
pos
)
=
'\0'
;
pos
--
;
}
// Filter excluded parameters
for
(
uint32_t
i
=
0
;
i
<
count
;
i
++
)
{
if
(
strncmp
(
name
,
exclude
[
i
],
strlen
(
exclude
[
i
]))
==
0
)
{
return
0
;
}
}
// Skip spaces for value
while
(
isspace
(
*
value
)
&&
(
*
value
!=
'\0'
))
{
value
++
;
}
// Trim the ending spaces of value
pos
=
value
+
strlen
(
value
);
pos
--
;
while
(
isspace
(
*
pos
)
&&
pos
>
value
)
{
(
*
pos
)
=
'\0'
;
pos
--
;
}
// Strip starting and ending " for value
if
((
*
value
==
'"'
)
&&
(
pos
>
value
)
&&
(
*
pos
==
'"'
))
{
value
=
value
+
1
;
*
pos
=
'\0'
;
}
int
ret
=
CheckParamName
(
name
,
0
);
// Invalid name, just ignore
if
(
ret
!=
0
)
{
return
0
;
}
PARAM_LOGV
(
"Add default parameter [%s] [%s]"
,
name
,
value
);
return
WriteParam
(
&
g_paramWorkSpace
.
paramSpace
,
name
,
value
,
NULL
,
mode
&
LOAD_PARAM_ONLY_ADD
);
}
static
int
LoadDefaultParam_
(
const
char
*
fileName
,
uint32_t
mode
,
const
char
*
exclude
[],
uint32_t
count
)
static
int
LoadDefaultParam_
(
const
char
*
fileName
,
uint32_t
mode
,
const
char
*
exclude
[],
uint32_t
count
)
{
{
// max length for each line of para files: max name length + max value length + spaces
#define PARAM_LINE_MAX_LENGTH (PARAM_NAME_LEN_MAX + PARAM_CONST_VALUE_LEN_MAX + 10)
uint32_t
paramNum
=
0
;
uint32_t
paramNum
=
0
;
FILE
*
fp
=
fopen
(
fileName
,
"r"
);
FILE
*
fp
=
fopen
(
fileName
,
"r"
);
PARAM_CHECK
(
fp
!=
NULL
,
return
-
1
,
"Open file %s fail"
,
fileName
);
if
(
fp
==
NULL
)
{
char
*
buff
=
calloc
(
1
,
sizeof
(
SubStringInfo
)
*
(
SUBSTR_INFO_VALUE
+
1
)
+
PARAM_BUFFER_SIZE
);
return
-
1
;
PARAM_CHECK
(
buff
!=
NULL
,
(
void
)
fclose
(
fp
);
}
return
-
1
,
"Failed to alloc memory for load %s"
,
fileName
);
char
*
buff
=
calloc
(
1
,
PARAM_LINE_MAX_LENGTH
);
SubStringInfo
*
info
=
(
SubStringInfo
*
)(
buff
+
PARAM_BUFFER_SIZE
);
if
(
buff
==
NULL
)
{
while
(
fgets
(
buff
,
PARAM_BUFFER_SIZE
,
fp
)
!=
NULL
)
{
(
void
)
fclose
(
fp
);
buff
[
PARAM_BUFFER_SIZE
-
1
]
=
'\0'
;
return
-
1
;
int
subStrNumber
=
GetSubStringInfo
(
buff
,
strlen
(
buff
),
'='
,
info
,
SUBSTR_INFO_VALUE
+
1
);
}
if
(
subStrNumber
<=
SUBSTR_INFO_VALUE
)
{
continue
;
while
(
fgets
(
buff
,
PARAM_LINE_MAX_LENGTH
,
fp
)
!=
NULL
)
{
}
buff
[
PARAM_LINE_MAX_LENGTH
-
1
]
=
'\0'
;
// 过滤
for
(
uint32_t
i
=
0
;
i
<
count
;
i
++
)
{
int
ret
=
LoadOneParam_
(
buff
,
mode
,
exclude
,
count
);
if
(
strncmp
(
info
[
0
].
value
,
exclude
[
i
],
strlen
(
exclude
[
i
]))
==
0
)
{
PARAM_LOGI
(
"Do not set %s parameters"
,
info
[
0
].
value
);
continue
;
}
}
int
ret
=
CheckParamName
(
info
[
0
].
value
,
0
);
PARAM_CHECK
(
ret
==
0
,
continue
,
"Illegal param name %s"
,
info
[
0
].
value
);
PARAM_LOGV
(
"Add default parameter %s %s"
,
info
[
0
].
value
,
info
[
1
].
value
);
uint32_t
dataIndex
=
0
;
ret
=
WriteParam
(
&
g_paramWorkSpace
.
paramSpace
,
info
[
0
].
value
,
info
[
1
].
value
,
&
dataIndex
,
mode
&
LOAD_PARAM_ONLY_ADD
);
PARAM_CHECK
(
ret
==
0
,
continue
,
"Failed to set param %d %s"
,
ret
,
buff
);
PARAM_CHECK
(
ret
==
0
,
continue
,
"Failed to set param %d %s"
,
ret
,
buff
);
paramNum
++
;
paramNum
++
;
}
}
...
@@ -639,9 +715,8 @@ static int LoadParamFromCmdLine(void)
...
@@ -639,9 +715,8 @@ static int LoadParamFromCmdLine(void)
PARAM_LOGV
(
"Add param from cmdline %s %s"
,
cmdLines
[
i
],
value
);
PARAM_LOGV
(
"Add param from cmdline %s %s"
,
cmdLines
[
i
],
value
);
ret
=
CheckParamName
(
cmdLines
[
i
],
0
);
ret
=
CheckParamName
(
cmdLines
[
i
],
0
);
PARAM_CHECK
(
ret
==
0
,
break
,
"Invalid name %s"
,
cmdLines
[
i
]);
PARAM_CHECK
(
ret
==
0
,
break
,
"Invalid name %s"
,
cmdLines
[
i
]);
uint32_t
dataIndex
=
0
;
PARAM_LOGV
(
"**** cmdLines[%d] %s, value %s"
,
i
,
cmdLines
[
i
],
value
);
PARAM_LOGV
(
"**** cmdLines[%d] %s, value %s"
,
i
,
cmdLines
[
i
],
value
);
ret
=
WriteParam
(
&
g_paramWorkSpace
.
paramSpace
,
cmdLines
[
i
],
value
,
&
dataIndex
,
0
);
ret
=
WriteParam
(
&
g_paramWorkSpace
.
paramSpace
,
cmdLines
[
i
],
value
,
NULL
,
0
);
PARAM_CHECK
(
ret
==
0
,
break
,
"Failed to write param %s %s"
,
cmdLines
[
i
],
value
);
PARAM_CHECK
(
ret
==
0
,
break
,
"Failed to write param %s %s"
,
cmdLines
[
i
],
value
);
}
else
{
}
else
{
PARAM_LOGE
(
"Can not find arrt %s"
,
cmdLines
[
i
]);
PARAM_LOGE
(
"Can not find arrt %s"
,
cmdLines
[
i
]);
...
...
services/utils/init_utils.c
浏览文件 @
556832be
...
@@ -168,8 +168,9 @@ int GetProcCmdlineValue(const char *name, const char *buffer, char *value, int l
...
@@ -168,8 +168,9 @@ int GetProcCmdlineValue(const char *name, const char *buffer, char *value, int l
endIndex
=
i
;
endIndex
=
i
;
break
;
break
;
}
}
if
(
*
tmp
==
' '
)
{
if
(
*
tmp
==
' '
||
*
tmp
==
'\n'
||
*
tmp
==
'\r'
||
*
tmp
==
'\t'
)
{
endIndex
=
i
;
endIndex
=
i
;
break
;
}
}
if
(
*
tmp
==
'='
)
{
if
(
*
tmp
==
'='
)
{
if
(
endIndex
!=
0
)
{
// for root=uuid=xxxx
if
(
endIndex
!=
0
)
{
// for root=uuid=xxxx
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录