Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
e59c93e1
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看板
未验证
提交
e59c93e1
编写于
1月 29, 2022
作者:
O
openharmony_ci
提交者:
Gitee
1月 29, 2022
浏览文件
操作
浏览文件
下载
差异文件
!270 ramdisk增加基础的boybox和mksh,系统异常时可进入shell调试。
Merge pull request !270 from handy/0126
上级
fcec75a6
a411f058
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
35 addition
and
13 deletion
+35
-13
begetd.gni
begetd.gni
+5
-0
interfaces/innerkits/fs_manager/fstab_mount.c
interfaces/innerkits/fs_manager/fstab_mount.c
+4
-2
services/init/init_config.c
services/init/init_config.c
+1
-0
services/init/main.c
services/init/main.c
+2
-1
services/init/standard/init.c
services/init/standard/init.c
+8
-8
services/param/BUILD.gn
services/param/BUILD.gn
+5
-0
services/param/service/param_service.c
services/param/service/param_service.c
+10
-2
未找到文件。
begetd.gni
100644 → 100755
浏览文件 @
e59c93e1
...
...
@@ -14,4 +14,9 @@
declare_args() {
param_feature_watcher = true
param_test = false
if (defined(product_name) && product_name == "rk3568") {
boot_kernel_extended_cmdline =
"hardware=rk3568 default_boot_device=fe310000.sdhci"
}
}
interfaces/innerkits/fs_manager/fstab_mount.c
浏览文件 @
e59c93e1
...
...
@@ -276,9 +276,11 @@ static int Mount(const char *source, const char *target, const char *fsType,
if
(
errno
==
EAGAIN
)
{
BEGET_LOGE
(
"Mount %s to %s failed. try again"
,
source
,
target
);
continue
;
}
else
{
break
;
}
if
(
errno
==
EBUSY
)
{
rc
=
0
;
}
break
;
}
return
rc
;
}
...
...
services/init/init_config.c
浏览文件 @
e59c93e1
...
...
@@ -87,6 +87,7 @@ void ReadConfig(void)
if
(
InUpdaterMode
()
==
0
)
{
ParseInitCfg
(
INIT_CONFIGURATION_FILE
,
NULL
);
ReadFileInDir
(
OTHER_CFG_PATH
,
".cfg"
,
ParseInitCfg
,
NULL
);
ReadFileInDir
(
"/vendor/etc/init"
,
".cfg"
,
ParseInitCfg
,
NULL
);
}
else
{
ReadFileInDir
(
"/etc"
,
".cfg"
,
ParseInitCfg
,
NULL
);
}
...
...
services/init/main.c
浏览文件 @
e59c93e1
...
...
@@ -33,10 +33,11 @@ int main(int argc, char * const argv[])
INIT_LOGE
(
"Process id error %d!"
,
getpid
());
return
0
;
}
LogInit
();
if
(
isSecondStage
==
0
)
{
SystemPrepare
();
}
LogInit
();
(
void
)
AtlibInit
();
SystemInit
();
SystemExecuteRcs
();
...
...
services/init/standard/init.c
浏览文件 @
e59c93e1
...
...
@@ -121,8 +121,6 @@ void LogInit(void)
}
}
#ifndef DISABLE_INIT_TWO_STAGES
static
char
**
GetRequiredDevices
(
Fstab
fstab
,
int
*
requiredNum
)
{
int
num
=
0
;
...
...
@@ -167,6 +165,9 @@ static void StartInitSecondStage(void)
{
const
char
*
fstabFile
=
"/etc/fstab.required"
;
Fstab
*
fstab
=
NULL
;
if
(
access
(
fstabFile
,
F_OK
)
!=
0
)
{
fstabFile
=
"/system/etc/fstab.required"
;
}
INIT_ERROR_CHECK
(
access
(
fstabFile
,
F_OK
)
==
0
,
abort
(),
"Failed get fstab.required"
);
fstab
=
ReadFstabFromFile
(
fstabFile
,
false
);
INIT_ERROR_CHECK
(
fstab
!=
NULL
,
abort
(),
"Read fstab file
\"
%s
\"
failed
\n
"
,
fstabFile
);
...
...
@@ -186,10 +187,13 @@ static void StartInitSecondStage(void)
// If mount required partitions failure.
// There is no necessary to continue.
// Just abort
INIT_LOGE
(
"Mount requried partitions failed"
);
INIT_LOGE
(
"Mount requried partitions failed; please check fstab file"
);
// Execute sh for debugging
execv
(
"/bin/sh"
,
NULL
);
abort
();
}
}
#ifndef DISABLE_INIT_TWO_STAGES
SwitchRoot
(
"/usr"
);
// Execute init second stage
char
*
const
args
[]
=
{
...
...
@@ -201,8 +205,8 @@ static void StartInitSecondStage(void)
INIT_LOGE
(
"Failed to exec
\"
/bin/init
\"
, err = %d"
,
errno
);
exit
(
-
1
);
}
}
#endif
}
void
SystemPrepare
(
void
)
{
...
...
@@ -210,7 +214,6 @@ void SystemPrepare(void)
// Make sure init log always output to /dev/kmsg.
EnableDevKmsg
();
CreateDeviceNode
();
#ifndef DISABLE_INIT_TWO_STAGES
// Only ohos normal system support
// two stages of init.
// If we are in updater mode, only one stage of init,
...
...
@@ -218,9 +221,6 @@ void SystemPrepare(void)
if
(
InUpdaterMode
()
==
0
)
{
StartInitSecondStage
();
}
#else
INIT_LOGI
(
"DISABLE_INIT_TWO_STAGES defined"
);
#endif
}
void
SystemLoadSelinux
(
void
)
...
...
services/param/BUILD.gn
浏览文件 @
e59c93e1
...
...
@@ -10,6 +10,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//base/startup/init_lite/begetd.gni")
import("//build/ohos.gni")
declare_args() {
...
...
@@ -46,6 +47,10 @@ ohos_static_library("param_service") {
defines = [ "PARAM_SUPPORT_SAVE_PERSIST" ]
if (defined(boot_kernel_extended_cmdline)) {
defines += [ "BOOT_EXTENDED_CMDLINE=\"${boot_kernel_extended_cmdline}\"" ]
}
if (param_security == "selinux") {
sources += [ "adapter/param_selinux.c" ]
defines += [ "PARAM_SUPPORT_SELINUX" ]
...
...
services/param/service/param_service.c
浏览文件 @
e59c93e1
...
...
@@ -589,6 +589,7 @@ static int GetParamValueFromBuffer(const char *name, const char *buffer, char *v
static
int
LoadParamFromCmdLine
(
void
)
{
int
ret
;
static
const
char
*
cmdLines
[]
=
{
OHOS_BOOT
"hardware"
,
OHOS_BOOT
"bootgroup"
,
...
...
@@ -611,7 +612,14 @@ static int LoadParamFromCmdLine(void)
return
-
1
,
"Failed to read file %s"
,
PARAM_CMD_LINE
);
for
(
size_t
i
=
0
;
i
<
ARRAY_LENGTH
(
cmdLines
);
i
++
)
{
int
ret
=
GetParamValueFromBuffer
(
cmdLines
[
i
],
data
,
value
,
PARAM_CONST_VALUE_LEN_MAX
);
#ifdef BOOT_EXTENDED_CMDLINE
ret
=
GetParamValueFromBuffer
(
cmdLines
[
i
],
BOOT_EXTENDED_CMDLINE
,
value
,
PARAM_CONST_VALUE_LEN_MAX
);
if
(
ret
!=
0
)
{
ret
=
GetParamValueFromBuffer
(
cmdLines
[
i
],
data
,
value
,
PARAM_CONST_VALUE_LEN_MAX
);
}
#else
ret
=
GetParamValueFromBuffer
(
cmdLines
[
i
],
data
,
value
,
PARAM_CONST_VALUE_LEN_MAX
);
#endif
if
(
ret
==
0
)
{
PARAM_LOGV
(
"Add param from cmdline %s %s"
,
cmdLines
[
i
],
value
);
ret
=
CheckParamName
(
cmdLines
[
i
],
0
);
...
...
@@ -744,4 +752,4 @@ void DumpParametersAndTriggers(void)
if
(
GetTriggerWorkSpace
()
!=
NULL
)
{
DumpTrigger
(
GetTriggerWorkSpace
());
}
}
\ No newline at end of file
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录