Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
dbf39231
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看板
未验证
提交
dbf39231
编写于
8月 10, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 10, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1047 optimize A/B partition startup
Merge pull request !1047 from cheng_jinsong/slot
上级
553b642f
a3727e83
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
32 addition
and
7 deletion
+32
-7
begetd.gni
begetd.gni
+1
-0
interfaces/innerkits/include/fs_manager/fs_manager.h
interfaces/innerkits/include/fs_manager/fs_manager.h
+2
-1
services/begetctl/BUILD.gn
services/begetctl/BUILD.gn
+1
-1
test/unittest/innerkits/innerkits_unittest.cpp
test/unittest/innerkits/innerkits_unittest.cpp
+19
-0
test/unittest/param/param_stub.cpp
test/unittest/param/param_stub.cpp
+9
-5
未找到文件。
begetd.gni
浏览文件 @
dbf39231
...
...
@@ -16,6 +16,7 @@ declare_args() {
enable_ohos_startup_init_feature_deviceinfo = true
param_test = true
control_test = false
enable_ohos_startup_init_feature_ab_partition = false
# init begetctl support liteos
enable_ohos_startup_init_feature_begetctl_liteos = false
...
...
interfaces/innerkits/include/fs_manager/fs_manager.h
浏览文件 @
dbf39231
...
...
@@ -72,7 +72,8 @@ typedef struct SlotInfo {
}
SlotInfo
;
Fstab
*
LoadFstabFromCommandLine
(
void
);
int
GetSlotInfo
(
void
);
int
GetBootSlots
(
void
);
int
GetCurrentSlot
(
void
);
void
ReleaseFstab
(
Fstab
*
fstab
);
Fstab
*
ReadFstabFromFile
(
const
char
*
file
,
bool
procMounts
);
FstabItem
*
FindFstabItemForPath
(
Fstab
fstab
,
const
char
*
path
);
...
...
services/begetctl/BUILD.gn
浏览文件 @
dbf39231
...
...
@@ -125,7 +125,7 @@ if (defined(ohos_lite)) {
"dump_service",
]
if (
product_name == "rk3568"
) {
if (
enable_ohos_startup_init_feature_ab_partition
) {
sources += [ "partitionslot.cpp" ]
external_deps +=
[ "drivers_peripheral_partitionslot:libpartition_slot_manager" ]
...
...
test/unittest/innerkits/innerkits_unittest.cpp
浏览文件 @
dbf39231
...
...
@@ -117,4 +117,23 @@ HWTEST_F(InnerkitsUnitTest, GetMountFlags_unitest, TestSize.Level1)
ReleaseFstab
(
fstab
);
fstab
=
nullptr
;
}
HWTEST_F
(
InnerkitsUnitTest
,
GetSlotInfo_unittest
,
TestSize
.
Level1
)
{
EXPECT_NE
(
GetBootSlots
(),
-
1
);
EXPECT_NE
(
GetCurrentSlot
(),
-
1
);
}
HWTEST_F
(
InnerkitsUnitTest
,
LoadFstabFromCommandLine_unittest
,
TestSize
.
Level1
)
{
EXPECT_NE
(
LoadFstabFromCommandLine
(),
(
Fstab
*
)
NULL
);
}
HWTEST_F
(
InnerkitsUnitTest
,
GetBlockDevicePath_unittest
,
TestSize
.
Level1
)
{
char
devicePath
[
MAX_BUFFER_LEN
]
=
{
0
};
EXPECT_EQ
(
GetBlockDevicePath
(
"/vendor"
,
devicePath
,
MAX_BUFFER_LEN
),
0
);
EXPECT_EQ
(
GetBlockDevicePath
(
"/misc"
,
devicePath
,
MAX_BUFFER_LEN
),
0
);
EXPECT_EQ
(
GetBlockDevicePath
(
"/invalid"
,
devicePath
,
MAX_BUFFER_LEN
),
-
1
);
}
}
// namespace init_ut
test/unittest/param/param_stub.cpp
浏览文件 @
dbf39231
...
...
@@ -343,14 +343,18 @@ void PrepareCmdLineHasSn()
// for cmdline
const
char
*
cmdLineHasSnroot
=
"bootgroup=device.charge.group earlycon=uart8250,mmio32,0xfe660000 "
"root=PARTUUID=614e0000-0000 rw rootwait rootfstype=ext4 console=ttyFIQ0 hardware=rk3568"
" BOOT_IMAGE=/kernel ohos.boot.sn=/test init=/init ohos.required_mount.system="
"/dev/block/platform/soc/10100000.himci.eMMC/by-name/misc@none@none@none@wait,required"
;
" BOOT_IMAGE=/kernel ohos.boot.sn=/test init=/init"
;
CreateTestFile
(
BOOT_CMD_LINE
,
cmdLineHasSnroot
);
LoadParamFromCmdLine
();
const
char
*
cmdLineHasntSn
=
"bootgroup=device.charge.group earlycon=uart8250,mmio32,0xfe660000 "
"root=PARTUUID=614e0000-0000 rw rootwait rootfstype=ext4 console=ttyFIQ0 hardware=rk3568"
" BOOT_IMAGE=/kernel init=/init ohos.required_mount.system="
"/dev/block/platform/soc/10100000.himci.eMMC/by-name/misc@none@none@none@wait,required"
;
"root=PARTUUID=614e0000-0000 rw rootwait rootfstype=ext4 console=ttyFIQ0 hardware=rk3568 "
"BOOT_IMAGE=/kernel init=/init default_boot_device=fe310000.sdhci bootslots=2 "
"ohos.required_mount.system="
"/dev/block/platform/fe310000.sdhci/by-name/system@/usr@ext4@ro,barrier=1@wait,required "
"ohos.required_mount.vendor="
"/dev/block/platform/fe310000.sdhci/by-name/vendor@/vendor@ext4@ro,barrier=1@wait,required "
"ohos.required_mount.misc="
"/dev/block/platform/fe310000.sdhci/by-name/misc@none@none@none@wait,required"
;
CreateTestFile
(
BOOT_CMD_LINE
,
cmdLineHasntSn
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录