自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

[觸覺智能RK3568]指定單個(gè)鏡像進(jìn)行獨(dú)立編譯

系統(tǒng) OpenHarmony
OpenHarmony Beta4和5編譯構(gòu)建過程中,只可以在編譯命令./build.sh --product-name rk3568 --ccache指定--build-target images或者--build-target make_images對所有鏡像進(jìn)行編譯。

??想了解更多關(guān)于開源的內(nèi)容,請?jiān)L問:??

??51CTO 開源基礎(chǔ)軟件社區(qū)??

??https://ost.51cto.com??

一、OpenHarmony master最新分支提供支持獨(dú)立編譯鏡像的功能

OpenHarmony master最新分支提供支持獨(dú)立編譯鏡像的功能。支持獨(dú)立編譯的鏡像有

chip_prod.img、sys_prod.img、system.img、usedata.img、vendor.img、ramdisk.img、updater.img。

例如./build.sh --product-name rk3568 --ccache --build-target system_image可以單獨(dú)編譯出system.img鏡像

OpenHarmony Beta4和5編譯構(gòu)建過程中,只可以在編譯命令./build.sh --product-name rk3568 --ccache指定--build-target images或者--build-target make_images對所有鏡像進(jìn)行編譯。無法通過指定單個(gè)鏡像進(jìn)行獨(dú)立編譯,同時(shí)單個(gè)鏡像與platform關(guān)聯(lián),無法直接指定單個(gè)鏡像的名稱。

out/rk3568/packages/phone/images下鏡像文件:MiniLoaderAll.bin boot_linux.img chip_prod.img config.cfg parameter.txt ramdisk.img resource.img sys_prod.img system.img uboot.img updater.img userdata.img vendor.img

二、修改OpenHarmonyBeta4源碼新增獨(dú)立編譯鏡像的功能

1、在OpenHarmonyBeta4源碼build/ohos/images/BUILD.gn第48行添加如下內(nèi)容。

group("chip_prod_image") {
deps = []
if (is_standard_system) {
deps += [
"http://third_party/e2fsprogs:e2fsprogs_host_toolchain",
"http://third_party/f2fs-tools:f2fs-tools_host_toolchain",
]
}
foreach(_platform, target_platform_list) {
deps += [ ":${_platform}_chip_prod_image" ]
}
}
group("sys_prod_image") {
deps = []
if (is_standard_system) {
deps += [
"http://third_party/e2fsprogs:e2fsprogs_host_toolchain",
"http://third_party/f2fs-tools:f2fs-tools_host_toolchain",
]
}
foreach(_platform, target_platform_list) {
deps += [ ":${_platform}_sys_prod_image" ]
}
}
group("system_image") {
deps = []
if (is_standard_system) {
deps += [
"http://third_party/e2fsprogs:e2fsprogs_host_toolchain",
"http://third_party/f2fs-tools:f2fs-tools_host_toolchain",
]
}
foreach(_platform, target_platform_list) {
deps += [ ":${_platform}_system_image" ]
}
}
group("userdata_image") {
deps = []
if (is_standard_system) {
deps += [
"http://third_party/e2fsprogs:e2fsprogs_host_toolchain",
"http://third_party/f2fs-tools:f2fs-tools_host_toolchain",
]
}
foreach(_platform, target_platform_list) {
deps += [ ":${_platform}_userdata_image" ]
}
}
group("vendor_image") {
deps = []
if (is_standard_system) {
deps += [
"http://third_party/e2fsprogs:e2fsprogs_host_toolchain",
"http://third_party/f2fs-tools:f2fs-tools_host_toolchain",
]
}
foreach(_platform, target_platform_list) {
deps += [ ":${_platform}_vendor_image" ]
}
}
group("ramdisk_image") {
deps = []
if (is_standard_system) {
deps += [
"http://third_party/e2fsprogs:e2fsprogs_host_toolchain",
"http://third_party/f2fs-tools:f2fs-tools_host_toolchain",
]
}
foreach(_platform, target_platform_list) {
if (enable_ramdisk) {
deps += [ ":${_platform}_ramdisk_image" ]
}
}
}
group("updater_ramdisk_image") {
deps = []
if (is_standard_system) {
deps += [
"http://third_party/e2fsprogs:e2fsprogs_host_toolchain",
"http://third_party/f2fs-tools:f2fs-tools_host_toolchain",
]
}
foreach(_platform, target_platform_list) {
if (enable_ramdisk) {
deps += [ ":${_platform}_updater_ramdisk_image" ]
}
}
}
group("updater_image") {
deps = []
if (is_standard_system) {
deps += [
"http://third_party/e2fsprogs:e2fsprogs_host_toolchain",
"http://third_party/f2fs-tools:f2fs-tools_host_toolchain",
]
}
foreach(_platform, target_platform_list) {
if (!enable_ramdisk) {
deps += [ ":${_platform}_updater_image" ]
}
}
}

2、鏡像單獨(dú)編譯前需要執(zhí)行一次全量編譯./build.sh --product-name rk3568 --ccache生成全部鏡像。

3、然后在./build.sh --product-name rk3568 --ccache 后指定–build-target chip_prod_image、sys_prod_image、system_image、userdata_image、vendor_image、updater_image/updater_ramdisk_image、ramdisk_image分別生成對應(yīng)的單獨(dú)鏡像。

  • –build-target updater_ramdisk_image是編譯出ramdisk類型的updater.img。
  • –build-target updater_image是編譯出非ramdisk類型的updater.img。

目前Beta5版本的仍然可以選擇編譯非ramdisk類型和ramdisk類型的updater.img,但是最新分支master版本updater與enable_ramdisk 不再關(guān)聯(lián),都編譯ramdisk類型的updater.img鏡像,相關(guān)issue:南向適配,歸一化一級二級啟動(dòng)。

例如執(zhí)行./build.sh --product-name rk3568 --ccache --build-target updater_image生成非ramdisk類型的updater.img。

 #創(chuàng)作者激勵(lì)#[觸覺智能RK3568]指定單個(gè)鏡像進(jìn)行獨(dú)立編譯-開源基礎(chǔ)軟件社區(qū)

 #創(chuàng)作者激勵(lì)#[觸覺智能RK3568]指定單個(gè)鏡像進(jìn)行獨(dú)立編譯-開源基礎(chǔ)軟件社區(qū)

三、修改OpenHarmonyBeta5源碼新增獨(dú)立編譯鏡像的功能

OpenHarmonyBeta5 已經(jīng)支持單獨(dú)編譯 多產(chǎn)品各自的chipprod鏡像,且前面提到目前Beta5版本的仍然可以選擇編譯非ramdisk類型和ramdisk類型的updater.img

所以和OpenHarmonyBeta4中添加的代碼不同,Beta5不需要添加group(“chip_prod_image”)的部分

1、在OpenHarmonyBeta5源碼build/ohos/images/BUILD.gn第48行添加如下內(nèi)容

group("sys_prod_image") {
deps = []
if (is_standard_system) {
deps += [
"http://third_party/e2fsprogs:e2fsprogs_host_toolchain",
"http://third_party/f2fs-tools:f2fs-tools_host_toolchain",
]
}
foreach(_platform, target_platform_list) {
deps += [ ":${_platform}_sys_prod_image" ]
}
}
group("system_image") {
deps = []
if (is_standard_system) {
deps += [
"http://third_party/e2fsprogs:e2fsprogs_host_toolchain",
"http://third_party/f2fs-tools:f2fs-tools_host_toolchain",
]
}
foreach(_platform, target_platform_list) {
deps += [ ":${_platform}_system_image" ]
}
}
group("userdata_image") {
deps = []
if (is_standard_system) {
deps += [
"http://third_party/e2fsprogs:e2fsprogs_host_toolchain",
"http://third_party/f2fs-tools:f2fs-tools_host_toolchain",
]
}
foreach(_platform, target_platform_list) {
deps += [ ":${_platform}_userdata_image" ]
}
}
group("vendor_image") {
deps = []
if (is_standard_system) {
deps += [
"http://third_party/e2fsprogs:e2fsprogs_host_toolchain",
"http://third_party/f2fs-tools:f2fs-tools_host_toolchain",
]
}
foreach(_platform, target_platform_list) {
deps += [ ":${_platform}_vendor_image" ]
}
}
group("ramdisk_image") {
deps = []
if (is_standard_system) {
deps += [
"http://third_party/e2fsprogs:e2fsprogs_host_toolchain",
"http://third_party/f2fs-tools:f2fs-tools_host_toolchain",
]
}
foreach(_platform, target_platform_list) {
if (enable_ramdisk) {
deps += [ ":${_platform}_ramdisk_image" ]
}
}
}
group("updater_ramdisk_image") {
deps = []
if (is_standard_system) {
deps += [
"http://third_party/e2fsprogs:e2fsprogs_host_toolchain",
"http://third_party/f2fs-tools:f2fs-tools_host_toolchain",
]
}
foreach(_platform, target_platform_list) {
if (enable_ramdisk) {
deps += [ ":${_platform}_updater_ramdisk_image" ]
}
}
}
group("updater_image") {
deps = []
if (is_standard_system) {
deps += [
"http://third_party/e2fsprogs:e2fsprogs_host_toolchain",
"http://third_party/f2fs-tools:f2fs-tools_host_toolchain",
]
}
foreach(_platform, target_platform_list) {
if (!enable_ramdisk) {
deps += [ ":${_platform}_updater_image" ]
}
}
}

3、鏡像單獨(dú)編譯前同樣需要執(zhí)行一次全量編譯生成全部鏡像。

4、然后在./build.sh --product-name rk3568 --ccache 后指定–build-target chip_prod_image、sys_prod_image、system_image、userdata_image、vendor_image、updater_image/updater_ramdisk_image、ramdisk_image分別生成對應(yīng)的單獨(dú)鏡像。

四、指定userdata.img鏡像進(jìn)行獨(dú)立編譯并且刷入觸覺智能RK3568

1、筆者基于OpenHarmony Beta5源碼如上述步驟修改源碼后執(zhí)行./build.sh --product-name rk3568 --ccache --build-target userdata_image單獨(dú)編譯生成userdata.img。

2、觸覺智能rk3568這款開發(fā)板鏡像鏈接如下:

鏈接:https://pan.baidu.com/s/1JXEBH9CQb4ruzOGz1prrjA?pwd=1234
提取碼:1234

3、解壓觸覺智能rk3568開發(fā)板鏡像后替換userdata.img,將完整鏡像刷入開發(fā)板。

 #創(chuàng)作者激勵(lì)#[觸覺智能RK3568]指定單個(gè)鏡像進(jìn)行獨(dú)立編譯-開源基礎(chǔ)軟件社區(qū)

4、燒錄完畢,系統(tǒng)正常啟動(dòng)。

知識點(diǎn)附送

如何更改OpenHarmony版本信息、SDK和NDK版本信息

源碼目錄下/sources/build/version.gni文件是OpenHarmony版本信息、SDK和NDK版本信息,要修改版本信息只需要在這個(gè)文件修改就好了

例如,Beta5的版本信息如下

# OHOS version
declare_args() {
sdk_version = "3.2.10.6"
api_version = "9"
# Release type, optional values: Betax, RCx...
release_type = "Beta5"
meta_version = "3.0.0"
}
# ohos SDK version
declare_args() {
current_sdk_version = sdk_version
}
# ohos NDK version
declare_args() {
current_ndk_version = current_sdk_version
}

改變一個(gè)鏡像文件的名稱需要做哪些工作。

以該issues為參考 https://gitee.com/openharmony/build/issues/I5VQZ7 學(xué)習(xí)將vendor.img改為chipset.img,其實(shí)只要把vendor字符全部替換成chipset。通過這個(gè)issue可以知道vendor.img涉及到源碼中哪些文件。

關(guān)于 --build-target

build-target 是傳給ninja的參數(shù),out/rk3568/build.ninja里面的任務(wù)都可以。

1、gn里面的一個(gè)target都可以,包括可執(zhí)行程序,動(dòng)態(tài)庫,group,action,部件名。

2、如果直接指定名稱報(bào)unkonw target的話,可能是重名等原因,按照gn的全名稱指定:{目標(biāo)所在BUILD.gn的路徑}:{目標(biāo)名}, 比如: --build-target commonlibrary/c_utils/base:utils。

3、build-target參數(shù)一次可以指定多,比如:–build-target A --build-target B。

4、subsystem_name不是編譯目標(biāo)。

5、部件名是一個(gè)特殊的目標(biāo),根據(jù)ohos.build編譯系統(tǒng)生產(chǎn)的gn目標(biāo),如果直接指定部件名,使用–build-target {部件名} 報(bào)錯(cuò)unkonw target,可以使用一個(gè)部件的全名稱指定:–build-target out/{device_name}/build_configs/{subsystem_name}/{part_name}:{part_name}。

編譯流程主要分為:preloader->loader->gn->ninja這四個(gè)過程。

如何修改分區(qū)文件系統(tǒng)類型由ext4為f2fs

以該issues為例學(xué)習(xí)將修改/data分區(qū)文件系統(tǒng)由ext4為f2fs。

1、修改鏡像文件打包描述文件。

每個(gè)系統(tǒng)鏡像文件都是由一個(gè)image_conf.txt描述文件來描述。將鏡像文件系統(tǒng)類型由ext4改為f2fs。userdata.img 由build/ohos/images/mkimage/userdata_image_conf.txt描述。在其中將–fs_type=ext4改為–fs_type=f2fs。

2、在rk3568標(biāo)準(zhǔn)系統(tǒng)的defconfig文件中打開prjquota 使能開關(guān),在源碼目錄在kernel/linux/config/linux-5.10/arch/arm64/configs/rk3568_standard_defconfig中第5945行中# CONFIG_QUOTA is not set改為CONFIG_QUOTA=y。

3、修改具體設(shè)備的fstab文件(這里修改的是rk3568的fstab文件,位于/device/board/hihope/rk3568/cfg/fstab.rk3568)中修改分區(qū)的文件系統(tǒng)類型、mnt_flags and options和fs_mgr_flags參數(shù)。

 #創(chuàng)作者激勵(lì)#[觸覺智能RK3568]指定單個(gè)鏡像進(jìn)行獨(dú)立編譯-開源基礎(chǔ)軟件社區(qū)

fstab文件:啟動(dòng)的時(shí)候,系統(tǒng)會自動(dòng)地從這個(gè)文件讀取信息,并且會自動(dòng)將此文件中指定的文件系統(tǒng)掛載到指定的目錄

 #創(chuàng)作者激勵(lì)#[觸覺智能RK3568]指定單個(gè)鏡像進(jìn)行獨(dú)立編譯-開源基礎(chǔ)軟件社區(qū)

修改鏡像打包的配置參數(shù)調(diào)整分區(qū)大小。

以該issue為例學(xué)習(xí)將rk3568 updater分區(qū)從20MB調(diào)整為30MB。

1、如果要修改某個(gè)鏡像的打包參數(shù),只需要修改//build/ohos/images/mkimage目錄下對應(yīng)的{鏡像名}_image_config.txt文件即可。

2、在ramdisk類型的updater.img對應(yīng)的描述文件build/ohos/images/mkimage/updater_ramdisk_image_conf.txt第二行將20971520KB改為33554432KB。

??想了解更多關(guān)于開源的內(nèi)容,請?jiān)L問:??

??51CTO 開源基礎(chǔ)軟件社區(qū)??

??https://ost.51cto.com??

責(zé)任編輯:jianghua 來源: 51CTO 開源基礎(chǔ)軟件社區(qū)
相關(guān)推薦

2023-03-13 15:18:04

NDK工具

2023-03-16 15:37:48

像素密度觸覺智能

2022-04-25 09:10:50

RK3568鴻蒙

2023-02-10 15:34:45

Node.jsN-API組件

2023-03-07 15:54:45

鴻蒙Mesa庫

2023-08-18 14:34:09

HDF驅(qū)動(dòng)框架

2023-03-13 11:58:03

拓?fù)?/a>架構(gòu)模塊

2022-05-23 10:45:34

DAYU200鴻蒙

2023-11-24 09:48:29

C++鴻蒙

2011-06-30 14:44:16

QT Qvfb Embedded

2022-05-06 11:15:25

物聯(lián)網(wǎng)智能家居

2023-08-08 14:26:59

開源開發(fā)板鴻蒙

2011-07-01 13:31:29

Ubuntu Linux QVFB

2021-05-18 14:25:30

Linux運(yùn)維Linux系統(tǒng)

2022-05-27 13:37:55

算法觸覺

2009-12-24 10:04:38

Linux進(jìn)行C編譯

2017-03-30 09:00:25

德國環(huán)境輔助生活OTB

2021-12-24 17:12:31

Android 13Google應(yīng)用程序語言

2020-03-17 16:15:01

Python編譯代碼

2022-05-26 08:38:10

Docker鏡像運(yùn)維
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號