diff --git a/en/application-dev/dfx/hitracemeter-guidelines.md b/en/application-dev/dfx/hitracemeter-guidelines.md
index 3244aa9356bbcd3748594061a3752fad8aa3d3f3..b5934a99c75f8576288222696d185367ec35eb66 100644
--- a/en/application-dev/dfx/hitracemeter-guidelines.md
+++ b/en/application-dev/dfx/hitracemeter-guidelines.md
@@ -17,11 +17,11 @@ hiTraceMeter provides APIs for system performance tracing. You can call the APIs
## Constraints
-Due to the asynchronous I/O feature of JS, the hiTraceMeter module provides only asynchronous APIs.
+- Due to the asynchronous I/O feature of JS, the hiTraceMeter module provides only asynchronous APIs.
## Available APIs
-The performance tracing APIs are provided by the **hiTraceMeter** module. For details, see [API Reference](../reference/apis/js-apis-hitracemeter.md).
+The performance tracing APIs are provided by the **hiTraceMeter** module. For details, see [API Reference]( ../reference/apis/js-apis-hitracemeter.md).
**APIs for performance tracing**
@@ -35,114 +35,120 @@ The performance tracing APIs are provided by the **hiTraceMeter** module. For de
In this example, distributed call chain tracing begins when the application startup execution page is loaded and stops when the service usage is completed.
-1. Create a JS application project. In the displayed **Project** window, choose **entry** > **src** > **main** > **js** > **default** > **pages** > **index**, and double-click **index.js**. Add the code to implement performance tracing upon page loading. The sample code is as follows:
-
- ```js
- import hiTraceMeter from '@ohos.hiTraceMeter'
-
- export default {
- data: {
- title: ""
- },
- onInit() {
- this.title = this.$t('strings.world');
-
- // Start trace tasks with the same name concurrently.
- hiTraceMeter.startTrace("business", 1);
- // Keep the service process running.
- console.log(`business running`);
- hiTraceMeter.startTrace("business", 2); // Start the second trace task with the same name while the first task is still running. The tasks are running concurrently and therefore their taskId must be different.
- // Keep the service process running.
- console.log(`business running`);
- hiTraceMeter.finishTrace("business", 1);
- // Keep the service process running.
- console.log(`business running`);
- hiTraceMeter.finishTrace("business", 2);
-
- // Start trace tasks with the same name in serial mode.
- hiTraceMeter.startTrace("business", 1);
- // Keep the service process running.
- console.log(`business running`);
- hiTraceMeter.finishTrace("business", 1); // End the first trace task.
- // Keep the service process running.
- console.log(`business running`);
- hiTraceMeter.startTrace("business", 1); // Start the second trace task with the same name in serial mode.
- // Keep the service process running.
- console.log(`business running`);
-
- let traceCount = 3;
- hiTraceMeter.traceByValue("myTestCount", traceCount);
- traceCount = 4;
- hiTraceMeter.traceByValue("myTestCount", traceCount);
- hiTraceMeter.finishTrace("business", 1);
- }
- }
- ```
-
-2. Create an ArkTs application project. In the displayed **Project** window, choose **entry** > **src** > **main** > **ets** > **pages** > **index**, and double-click **index.js**. Add the code to implement performance tracing upon page loading. For example, if the name of the trace task is **HITRACE\_TAG\_APP**, the sample code is as follows:
-
- ```ts
- import hitrace from '@ohos.hiTraceMeter';
-
- @Entry
- @Component
- struct Index {
- @State message: string = 'Hello World';
+1. Create a project, and call hiTraceMeter APIs in the service logic to implement performance tracing.
- build() {
- Row() {
- Column() {
- Text(this.message)
- .fontSize(50)
- .fontWeight(FontWeight.Bold)
- .onClick(() => {
- this.message = 'Hello ArkUI';
-
- // Start trace tasks with the same name concurrently.
- hitrace.startTrace("HITRACE_TAG_APP", 1001);
- // Keep the service process running.
- console.log(`HITRACE_TAG_APP running`);
-
- // Start the second trace task with the same name while the first task is still running. The tasks are running concurrently and therefore their taskId must be different.
- hitrace.startTrace("HITRACE_TAG_APP", 1002);
- // Keep the service process running.
- console.log(`HITRACE_TAG_APP running`);
-
- hitrace.finishTrace("HITRACE_TAG_APP", 1001);
- hitrace.finishTrace("HITRACE_TAG_APP", 1002);
-
- // If trace tasks with the same name are not run concurrently, the same taskId can be used.
- hitrace.startTrace("HITRACE_TAG_APP", 1003);
- // Keep the service process running.
- console.log(`HITRACE_TAG_APP running`);
- // End the first trace task.
- hitrace.finishTrace("HITRACE_TAG_APP", 1003);
-
- // Start the second trace task with the same name in serial mode. It uses a taskId different from the first trace task.
- hitrace.startTrace("HITRACE_TAG_APP", 1004);
- // Keep the service process running.
- console.log(`HITRACE_TAG_APP running`);
- let traceCount = 3;
- hitrace.traceByValue("myTestCount", traceCount);
- hitrace.finishTrace("HITRACE_TAG_APP", 1004);
-
- // Start the third trace task with the same name in serial mode. It uses a taskId same as the second trace task.
- hitrace.startTrace("HITRACE_TAG_APP", 1004);
- // Keep the service process running.
- console.log(`HITRACE_TAG_APP running`);
- // End the third trace task.
- hitrace.finishTrace("HITRACE_TAG_APP", 1004);
-
- })
+ - **ArkTS application project**
+
+ Create an ArkTS application project. In the displayed **Project** window, choose **entry** > **src** > **main** > **ets** > **pages** > **index**, and double-click **index.js**. Add the code to implement performance tracing upon page loading. For example, if the name of the trace task is **HITRACE\_TAG\_APP**, the sample code is as follows:
+
+ ```ts
+ import hitrace from '@ohos.hiTraceMeter';
+
+ @Entry
+ @Component
+ struct Index {
+ @State message: string = 'Hello World';
+
+ build() {
+ Row() {
+ Column() {
+ Text(this.message)
+ .fontSize(50)
+ .fontWeight(FontWeight.Bold)
+ .onClick(() => {
+ this.message = 'Hello ArkUI';
+
+ // Start trace tasks with the same name concurrently.
+ hitrace.startTrace("HITRACE_TAG_APP", 1001);
+ // Keep the service process running.
+ console.log(`HITRACE_TAG_APP running`);
+
+ // Start the second trace task with the same name while the first task is still running. The tasks are running concurrently and therefore their taskId must be different.
+ hitrace.startTrace("HITRACE_TAG_APP", 1002);
+ // Keep the service process running.
+ console.log(`HITRACE_TAG_APP running`);
+
+ hitrace.finishTrace("HITRACE_TAG_APP", 1001);
+ hitrace.finishTrace("HITRACE_TAG_APP", 1002);
+
+ // If trace tasks with the same name are not run concurrently, the same taskId can be used.
+ hitrace.startTrace("HITRACE_TAG_APP", 1003);
+ // Keep the service process running.
+ console.log(`HITRACE_TAG_APP running`);
+ // End the first trace task.
+ hitrace.finishTrace("HITRACE_TAG_APP", 1003);
+
+ // Start the second trace task with the same name in serial mode. It uses a taskId different from the first trace task.
+ hitrace.startTrace("HITRACE_TAG_APP", 1004);
+ // Keep the service process running.
+ console.log(`HITRACE_TAG_APP running`);
+ let traceCount = 3;
+ hitrace.traceByValue("myTestCount", traceCount);
+ hitrace.finishTrace("HITRACE_TAG_APP", 1004);
+
+ // Start the third trace task with the same name in serial mode. It uses a taskId same as the second trace task.
+ hitrace.startTrace("HITRACE_TAG_APP", 1004);
+ // Keep the service process running.
+ console.log(`HITRACE_TAG_APP running`);
+ // End the third trace task.
+ hitrace.finishTrace("HITRACE_TAG_APP", 1004);
+
+ })
+ }
+ .width('100%')
+ }
+ .height('100%')
}
- .width('100%')
- }
- .height('100%')
}
- }
- ```
-
-3. Click the run button on the application page. Then, run the following commands in sequence in shell:
+ ```
+
+ - **JS application project**
+
+ Create a JS application project. In the displayed **Project** window, choose **entry** > **src** > **main** > **js** > **default** > **pages** > **index**, and double-click **index.js**. Add the code to implement performance tracing upon page loading. The sample code is as follows:
+
+ ```js
+ import hiTraceMeter from '@ohos.hiTraceMeter'
+
+ export default {
+ data: {
+ title: ""
+ },
+ onInit() {
+ this.title = this.$t('strings.world');
+
+ // Start trace tasks with the same name concurrently.
+ hiTraceMeter.startTrace("business", 1);
+ // Keep the service process running.
+ console.log(`business running`);
+ hiTraceMeter.startTrace("business", 2); // Start the second trace task with the same name while the first task is still running. The tasks are running concurrently and therefore their taskId must be different.
+ // Keep the service process running.
+ console.log(`business running`);
+ hiTraceMeter.finishTrace("business", 1);
+ // Keep the service process running.
+ console.log(`business running`);
+ hiTraceMeter.finishTrace("business", 2);
+
+ // Start trace tasks with the same name in serial mode.
+ hiTraceMeter.startTrace("business", 1);
+ // Keep the service process running.
+ console.log(`business running`);
+ hiTraceMeter.finishTrace("business", 1); // End the first trace task.
+ // Keep the service process running.
+ console.log(`business running`);
+ hiTraceMeter.startTrace("business", 1); // Start the second trace task with the same name in serial mode.
+ // Keep the service process running.
+ console.log(`business running`);
+
+ let traceCount = 3;
+ hiTraceMeter.traceByValue("myTestCount", traceCount);
+ traceCount = 4;
+ hiTraceMeter.traceByValue("myTestCount", traceCount);
+ hiTraceMeter.finishTrace("business", 1);
+ }
+ }
+ ```
+
+2. Click the run button on the application page. Then, run the following commands in sequence in shell:
```shell
hdc shell
diff --git a/en/application-dev/reference/apis/js-apis-i18n.md b/en/application-dev/reference/apis/js-apis-i18n.md
index ab2a04c6ec9894e6391ff8c8299dd3ccad6e265b..7c0048159ee30fa35822328c59ac16163b4db190 100644
--- a/en/application-dev/reference/apis/js-apis-i18n.md
+++ b/en/application-dev/reference/apis/js-apis-i18n.md
@@ -1,6 +1,6 @@
# @ohos.i18n (Internationalization)
- This module provides system-related or enhanced I18N capabilities, such as locale management, phone number formatting, and calendar, through supplementary I18N APIs that are not defined in ECMA 402.
+The **i18n** module provides system-related or enhanced I18N capabilities, such as locale management, phone number formatting, and calendar, through supplementary I18N APIs that are not defined in ECMA 402.
The [Intl](js-apis-intl.md) module provides basic I18N capabilities through the standard I18N APIs defined in ECMA 402. It works with the I18N module to provide a complete suite of I18N capabilities.
> **NOTE**
@@ -46,7 +46,7 @@ For details about the error codes, see [I18N Error Codes](../errorcodes/errorcod
| ID | Error Message |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**Example**
```js
@@ -85,7 +85,7 @@ For details about the error codes, see [I18N Error Codes](../errorcodes/errorcod
| ID | Error Message |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**Example**
```js
@@ -116,7 +116,7 @@ For details about the error codes, see [I18N Error Codes](../errorcodes/errorcod
| ID | Error Message |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**Example**
```js
@@ -153,7 +153,7 @@ For details about the error codes, see [I18N Error Codes](../errorcodes/errorcod
| ID | Error Message |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**Example**
```js
@@ -183,7 +183,7 @@ Checks whether the system language matches the specified region.
| Type | Description |
| ------- | ---------------------------------------- |
-| boolean | Returns **true** if the system language matches the specified region; returns **false** otherwise.|
+| boolean | The value **true** indicates that the system language matches the specified region, and the value **false** indicates the opposite.|
**Error codes**
@@ -191,7 +191,7 @@ For details about the error codes, see [I18N Error Codes](../errorcodes/errorcod
| ID | Error Message |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid|
**Example**
```js
@@ -222,7 +222,7 @@ For details about the error codes, see [I18N Error Codes](../errorcodes/errorcod
| ID | Error Message |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 |param value not valid |
**Example**
```js
@@ -257,7 +257,7 @@ For details about the error codes, see [I18N Error Codes](../errorcodes/errorcod
| ID | Error Message |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid|
**Example**
```js
@@ -288,7 +288,7 @@ For details about the error codes, see [I18N Error Codes](../errorcodes/errorcod
| ID | Error Message |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**Example**
```js
@@ -315,7 +315,7 @@ This is a system API.
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ----- |
-| region | string | Yes | Region ID.|
+| region | string | Yes | System region ID.|
**Error codes**
@@ -323,7 +323,7 @@ For details about the error codes, see [I18N Error Codes](../errorcodes/errorcod
| ID | Error Message |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid|
**Example**
```js
@@ -354,7 +354,7 @@ For details about the error codes, see [I18N Error Codes](../errorcodes/errorcod
| ID | Error Message |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**Example**
```js
@@ -389,7 +389,7 @@ For details about the error codes, see [I18N Error Codes](../errorcodes/errorcod
| ID | Error Message |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid|
**Example**
```js
@@ -412,7 +412,7 @@ Checks whether the 24-hour clock is used.
| Type | Description |
| ------- | ---------------------------------------- |
-| boolean | Returns **true** if the 24-hour clock is used; returns **false** otherwise.|
+| boolean | The value **true** indicates that the 24-hour clock is used, and the value **false** indicates the opposite.|
**Error codes**
@@ -420,7 +420,7 @@ For details about the error codes, see [I18N Error Codes](../errorcodes/errorcod
| ID | Error Message |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid|
**Example**
```js
@@ -455,7 +455,7 @@ For details about the error codes, see [I18N Error Codes](../errorcodes/errorcod
| ID | Error Message |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid|
**Example**
```js
@@ -492,7 +492,7 @@ For details about the error codes, see [I18N Error Codes](../errorcodes/errorcod
| ID | Error Message |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid|
**Example**
```js
@@ -530,7 +530,7 @@ For details about the error codes, see [I18N Error Codes](../errorcodes/errorcod
| ID | Error Message |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**Example**
```js
@@ -563,7 +563,7 @@ For details about the error codes, see [I18N Error Codes](../errorcodes/errorcod
| ID | Error Message |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid|
**Example**
```js
@@ -594,7 +594,7 @@ For details about the error codes, see [I18N Error Codes](../errorcodes/errorcod
| ID | Error Message |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**Example**
```js
@@ -625,7 +625,7 @@ For details about the error codes, see [I18N Error Codes](../errorcodes/errorcod
| ID | Error Message |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**Example**
```js
@@ -660,7 +660,7 @@ For details about the error codes, see [I18N Error Codes](../errorcodes/errorcod
| ID | Error Message |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 |param value not valid |
**Example**
```ts
@@ -683,7 +683,7 @@ Checks whether use of local digits is enabled.
| Type | Description |
| ------- | ---------------------------------------- |
-| boolean | Result indicating whether the local digit switch is turned on. The value **true** indicates that the local digit switch is turned on, and the value **false** indicates the opposite.|
+| boolean | The value **true** indicates that the local digit switch is turned on, and the value **false** indicates the opposite.|
**Error codes**
@@ -691,7 +691,7 @@ For details about the error codes, see [I18N Error Codes](../errorcodes/errorcod
| ID | Error Message |
| ------ | ---------------------- |
-| 890001 | Unspported para value. |
+| 890001 | param value not valid |
**Example**
```ts
@@ -721,7 +721,7 @@ Checks whether the localized script for the specified language is displayed from
| Type | Description |
| ------- | ---------------------------------------- |
-| boolean | Returns **true** if the localized script is displayed from right to left; returns **false** otherwise.|
+| boolean | The value **true** indicates that the localized script is displayed from right to left, and the value **false** indicates the opposite.|
**Example**
```js
@@ -1004,7 +1004,7 @@ Obtains the **Calendar** object name displayed for the specified locale.
| Type | Description |
| ------ | ------------------- |
-| string | **Calendar** object name displayed for the specified locale.|
+| string | Displayed name of the **Calendar** object for the specified locale.|
**Example**
```js
@@ -1031,7 +1031,7 @@ Checks whether the specified date in this **Calendar** object is a weekend.
| Type | Description |
| ------- | ----------------------------------- |
-| boolean | Returns **true** if the date is a weekend; returns **false** if the date is a weekday.|
+| boolean | The value **true** indicates that the date is a weekend, and the value **false** indicates that the date is a weekday.|
**Example**
```js
@@ -1085,7 +1085,7 @@ Checks whether the format of the specified phone number is valid.
| Type | Description |
| ------- | ------------------------------------- |
-| boolean | Returns **true** if the phone number format is valid; returns **false** otherwise.|
+| boolean | The value **true** indicates that the phone number format is valid, and the value **false** indicates the opposite.|
**Example**
```js
@@ -1190,7 +1190,7 @@ Creates an **IndexUtil** object.
| Type | Description |
| ------------------------ | --------------------- |
-| [IndexUtil](#indexutil8) | **IndexUtil** object mapping to the specified locale.|
+| [IndexUtil](#indexutil8) | **IndexUtil** object mapping to the **locale** object.|
**Example**
```js
@@ -1213,7 +1213,7 @@ Obtains the index list for this **locale** object.
| Type | Description |
| ------------------- | ------------------ |
-| Array<string> | Index list for this **locale** object.|
+| Array<string> | Index list for the **locale** object.|
**Example**
```js
@@ -1249,7 +1249,7 @@ Adds the index of the new **locale** object to the index list.
getIndex(text: string): string
-Obtains the index of a text object.
+Obtains the index of a **text** object.
**System capability**: SystemCapability.Global.I18n
@@ -1378,7 +1378,7 @@ Puts the [BreakIterator](#breakiterator8) object to the first text boundary, whi
| Type | Description |
| ------ | ----------------- |
-| number | Offset to the first text boundary of the processed text.|
+| number | Offset to the first break point of the processed text.|
**Example**
```js
@@ -1400,7 +1400,7 @@ Puts the [BreakIterator](#breakiterator8) object to the last text boundary, whic
| Type | Description |
| ------ | ------------------ |
-| number | Offset to the last text boundary of the processed text.|
+| number | Offset to the last break point of the processed text.|
**Example**
```js
@@ -1428,7 +1428,7 @@ Moves the [BreakIterator](#breakiterator8) object backward by the specified numb
| Type | Description |
| ------ | ---------------------------------------- |
-| number | Position of the [BreakIterator](#breakiterator8) object in the text after it is moved by the specified number of text boundaries. The value **-1** is returned if the position of the [BreakIterator](#breakiterator8) object is outside of the processed text after it is moved by the specified number of text boundaries.|
+| number | Position of the [BreakIterator](#breakiterator8) object in the text after it is moved by the specified number of text boundaries. The value **-1** is returned if the position of the [BreakIterator](#breakiterator8) object is outside of the processed text after it is moved by the specified number of break points.|
**Example**
```js
@@ -1452,7 +1452,7 @@ Moves the [BreakIterator](#breakiterator8) object to the previous text boundary.
| Type | Description |
| ------ | ---------------------------------------- |
-| number | Position of the [BreakIterator](#breakiterator8) object in the text after it is moved to the previous text boundary. The value **-1** is returned if the position of the [BreakIterator](#breakiterator8) object is outside of the processed text after it is moved by the specified number of text boundaries.|
+| number | Position of the [BreakIterator](#breakiterator8) object in the text after it is moved to the previous text boundary. The value **-1** is returned if the position of the [BreakIterator](#breakiterator8) object is outside of the processed text after it is moved by the specified number of break points.|
**Example**
```js
@@ -1512,7 +1512,7 @@ Checks whether the position specified by the offset is a text boundary. If **tru
| Type | Description |
| ------- | ------------------------------- |
-| boolean | Returns **true** if the position specified by the offset is a text boundary; returns **false** otherwise.|
+| boolean | The value **true** indicates that the position specified by the offset is a break point, and the value **false** indicates the opposite.|
**Example**
```js
@@ -1689,7 +1689,7 @@ Obtains the list of time zone city IDs supported by the system.
static getCityDisplayName(cityID: string, locale: string): string
-Obtains the localized display of a time zone city in the specified locale.
+Obtains the localized representation of a time zone city in the specified locale.
**System capability**: SystemCapability.Global.I18n
@@ -1704,7 +1704,7 @@ Obtains the localized display of a time zone city in the specified locale.
| Type | Description |
| ------ | ------------------ |
-| string | Localized display of the time zone city in the specified locale.|
+| string | Localized representation of the time zone city in the specified locale.|
**Example**
```ts
@@ -1837,7 +1837,7 @@ Checks whether the input character string is composed of digits.
| Type | Description |
| ------- | ------------------------------------ |
-| boolean | Returns **true** if the input character is a digit; returns **false** otherwise.|
+| boolean | The value **true** indicates that the input character is a digit, and the value **false** indicates the opposite.|
**Example**
```js
@@ -1863,7 +1863,7 @@ Checks whether the input character is a space.
| Type | Description |
| ------- | -------------------------------------- |
-| boolean | Returns **true** if the input character is a space; returns **false** otherwise.|
+| boolean | The value **true** indicates that the input character is a space, and the value **false** indicates the opposite.|
**Example**
```js
@@ -1889,7 +1889,7 @@ Checks whether the input character is a white space.
| Type | Description |
| ------- | -------------------------------------- |
-| boolean | Returns **true** if the input character is a white space; returns **false** otherwise.|
+| boolean | The value **true** indicates that the input character is a white space, and the value **false** indicates the opposite.|
**Example**
```js
@@ -1915,7 +1915,7 @@ Checks whether the input character is of the right to left (RTL) language.
| Type | Description |
| ------- | ---------------------------------------- |
-| boolean | Returns **true** if the input character is of the RTL language; returns **false** otherwise.|
+| boolean | The value **true** indicates that the input character is of the RTL language, and the value **false** indicates the opposite.|
**Example**
```js
@@ -1941,7 +1941,7 @@ Checks whether the input character is an ideographic character.
| Type | Description |
| ------- | ---------------------------------------- |
-| boolean | Returns **true** if the input character is an ideographic character; returns **false** otherwise.|
+| boolean | The value **true** indicates that the input character is an ideographic character, and the value **false** indicates the opposite.|
**Example**
```js
@@ -1967,7 +1967,7 @@ Checks whether the input character is a letter.
| Type | Description |
| ------- | ------------------------------------ |
-| boolean | Returns **true** if the input character is a letter; returns **false** otherwise.|
+| boolean | The value **true** indicates that the input character is a letter, and the value **false** indicates the opposite.|
**Example**
```js
@@ -1993,7 +1993,7 @@ Checks whether the input character is a lowercase letter.
| Type | Description |
| ------- | ---------------------------------------- |
-| boolean | Returns **true** if the input character is a lowercase letter; returns **false** otherwise.|
+| boolean | The value **true** indicates that the input character is a lowercase letter, and the value **false** indicates the opposite.|
**Example**
```js
@@ -2019,7 +2019,7 @@ Checks whether the input character is an uppercase letter.
| Type | Description |
| ------- | ---------------------------------------- |
-| boolean | Returns **true** if the input character is an uppercase letter; returns **false** otherwise.|
+| boolean | The value **true** indicates that the input character is an uppercase letter, and the value **false** indicates the opposite.|
**Example**
```js
@@ -2031,7 +2031,7 @@ Checks whether the input character is an uppercase letter.
static getType(char: string): string
-Obtains the type of the input character string.
+Obtains the category value of the input character string.
**System capability**: SystemCapability.Global.I18n
@@ -2045,7 +2045,7 @@ Obtains the type of the input character string.
| Type | Description |
| ------ | ----------- |
-| string | Type of the input character.|
+| string | Category value of the input character.|
**Example**
```js
@@ -2118,7 +2118,7 @@ getDisplayCountry(country: string, locale: string, sentenceCase?: boolean): stri
Obtains the localized script for the specified country.
-This API is deprecated since API version 9. You are advised to use [System.getDisplayCountry](#getdisplaycountry9) instead.
+This API is deprecated since API version 9. You are advised to use [System.getDisplayCountry](#getdisplaycountry9).
**System capability**: SystemCapability.Global.I18n
@@ -2149,7 +2149,7 @@ getDisplayLanguage(language: string, locale: string, sentenceCase?: boolean): st
Obtains the localized script for the specified language.
-This API is deprecated since API version 9. You are advised to use [System.getDisplayLanguage](#getdisplaylanguage9) instead.
+This API is deprecated since API version 9. You are advised to use [System.getDisplayLanguage](#getdisplaylanguage9).
**System capability**: SystemCapability.Global.I18n
@@ -2180,7 +2180,7 @@ getSystemLanguage(): string
Obtains the system language.
-This API is deprecated since API version 9. You are advised to use [System.getSystemLanguage](#getsystemlanguage9) instead.
+This API is deprecated since API version 9. You are advised to use [System.getSystemLanguage](#getsystemlanguage9).
**System capability**: SystemCapability.Global.I18n
@@ -2202,7 +2202,7 @@ getSystemRegion(): string
Obtains the system region.
-This API is deprecated since API version 9. You are advised to use [System.getSystemRegion](#getsystemregion9) instead.
+This API is deprecated since API version 9. You are advised to use [System.getSystemRegion](#getsystemregion9).
**System capability**: SystemCapability.Global.I18n
@@ -2224,7 +2224,7 @@ getSystemLocale(): string
Obtains the system locale.
-This API is deprecated since API version 9. You are advised to use [System.getSystemLocale](#getsystemlocale9) instead.
+This API is deprecated since API version 9. You are advised to use [System.getSystemLocale](#getsystemlocale9).
**System capability**: SystemCapability.Global.I18n
@@ -2246,7 +2246,7 @@ is24HourClock(): boolean
Checks whether the 24-hour clock is used.
-This API is deprecated since API version 9. You are advised to use [System.is24HourClock](#is24hourclock9) instead.
+This API is deprecated since API version 9. You are advised to use [System.is24HourClock](#is24hourclock9).
**System capability**: SystemCapability.Global.I18n
@@ -2254,7 +2254,7 @@ This API is deprecated since API version 9. You are advised to use [System.is24H
| Type | Description |
| ------- | ---------------------------------------- |
-| boolean | Returns **true** if the 24-hour clock is used; returns **false** otherwise.|
+| boolean | The value **true** indicates that the 24-hour clock is used, and the value **false** indicates the opposite.|
**Example**
```js
@@ -2268,7 +2268,7 @@ set24HourClock(option: boolean): boolean
Sets the 24-hour clock.
-This API is deprecated since API version 9. You are advised to use [System.set24HourClock](#set24hourclock9) instead.
+This API is deprecated since API version 9. You are advised to use [System.set24HourClock](#set24hourclock9).
**Permission required**: ohos.permission.UPDATE_CONFIGURATION
@@ -2284,7 +2284,7 @@ This API is deprecated since API version 9. You are advised to use [System.set24
| Type | Description |
| ------- | ----------------------------- |
-| boolean | Returns **true** if the 24-hour clock is enabled; returns **false** otherwise.|
+| boolean | The value **true** indicates that the 24-hour clock is enabled, and the value **false** indicates the opposite.|
**Example**
```js
@@ -2299,7 +2299,7 @@ addPreferredLanguage(language: string, index?: number): boolean
Adds a preferred language to the specified position on the preferred language list.
-This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [System.addPreferredLanguage](#addpreferredlanguage9) instead.
+This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [System.addPreferredLanguage](#addpreferredlanguage9).
**Permission required**: ohos.permission.UPDATE_CONFIGURATION
@@ -2316,7 +2316,7 @@ This API is supported since API version 8 and is deprecated since API version 9.
| Type | Description |
| ------- | ----------------------------- |
-| boolean | Returns **true** if the preferred language is successfully added; returns **false** otherwise.|
+| boolean | The value **true** indicates that the preferred language is successfully added, and the value **false** indicates the opposite.|
**Example**
```js
@@ -2333,7 +2333,7 @@ removePreferredLanguage(index: number): boolean
Deletes a preferred language from the specified position on the preferred language list.
-This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [System.removePreferredLanguage](#removepreferredlanguage9) instead.
+This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [System.removePreferredLanguage](#removepreferredlanguage9).
**Permission required**: ohos.permission.UPDATE_CONFIGURATION
@@ -2349,7 +2349,7 @@ This API is supported since API version 8 and is deprecated since API version 9.
| Type | Description |
| ------- | ----------------------------- |
-| boolean | Returns **true** if the preferred language is deleted; returns **false** otherwise.|
+| boolean | The value **true** indicates that the preferred language is deleted, and the value **false** indicates the opposite.|
**Example**
```js
@@ -2365,7 +2365,7 @@ getPreferredLanguageList(): Array<string>
Obtains the list of preferred languages.
-This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [System.getPreferredLanguageList](#getpreferredlanguagelist9) instead.
+This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [System.getPreferredLanguageList](#getpreferredlanguagelist9).
**System capability**: SystemCapability.Global.I18n
@@ -2387,7 +2387,7 @@ getFirstPreferredLanguage(): string
Obtains the first language in the preferred language list.
-This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [System.getFirstPreferredLanguage](#getfirstpreferredlanguage9) instead.
+This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [System.getFirstPreferredLanguage](#getfirstpreferredlanguage9).
**System capability**: SystemCapability.Global.I18n
@@ -2412,7 +2412,7 @@ static unitConvert(fromUnit: UnitInfo, toUnit: UnitInfo, value: number, locale:
Converts one measurement unit into another and formats the unit based on the specified locale and style.
-This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [unitConvert](#unitconvert9) instead.
+This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [unitConvert](#unitconvert9).
**System capability**: SystemCapability.Global.I18n
@@ -2442,7 +2442,7 @@ static isDigit(char: string): boolean
Checks whether the input character string is composed of digits.
-This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [isDigit](#isdigit9) instead.
+This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [isDigit](#isdigit9).
**System capability**: SystemCapability.Global.I18n
@@ -2456,7 +2456,7 @@ This API is supported since API version 8 and is deprecated since API version 9.
| Type | Description |
| ------- | ------------------------------------ |
-| boolean | Returns **true** if the input character is a digit; returns **false** otherwise.|
+| boolean | The value **true** indicates that the input character is a digit, and the value **false** indicates the opposite.|
### isSpaceChar(deprecated)
@@ -2465,7 +2465,7 @@ static isSpaceChar(char: string): boolean
Checks whether the input character is a space.
-This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [isSpaceChar](#isspacechar9) instead.
+This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [isSpaceChar](#isspacechar9).
**System capability**: SystemCapability.Global.I18n
@@ -2479,7 +2479,7 @@ This API is supported since API version 8 and is deprecated since API version 9.
| Type | Description |
| ------- | -------------------------------------- |
-| boolean | Returns **true** if the input character is a space; returns **false** otherwise.|
+| boolean | The value **true** indicates that the input character is a space, and the value **false** indicates the opposite.|
### isWhitespace(deprecated)
@@ -2488,7 +2488,7 @@ static isWhitespace(char: string): boolean
Checks whether the input character is a white space.
-This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [isWhitespace](#iswhitespace9) instead.
+This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [isWhitespace](#iswhitespace9).
**System capability**: SystemCapability.Global.I18n
@@ -2502,7 +2502,7 @@ This API is supported since API version 8 and is deprecated since API version 9.
| Type | Description |
| ------- | -------------------------------------- |
-| boolean | Returns **true** if the input character is a white space; returns **false** otherwise.|
+| boolean | The value **true** indicates that the input character is a white space, and the value **false** indicates the opposite.|
### isRTL(deprecated)
@@ -2511,7 +2511,7 @@ static isRTL(char: string): boolean
Checks whether the input character is of the right to left (RTL) language.
-This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [isRTL](#isrtl9) instead.
+This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [isRTL](#isrtl9).
**System capability**: SystemCapability.Global.I18n
@@ -2525,7 +2525,7 @@ This API is supported since API version 8 and is deprecated since API version 9.
| Type | Description |
| ------- | ---------------------------------------- |
-| boolean | Returns **true** if the input character is of the RTL language; returns **false** otherwise.|
+| boolean | The value **true** indicates that the input character is of the RTL language, and the value **false** indicates the opposite.|
### isIdeograph(deprecated)
@@ -2534,7 +2534,7 @@ static isIdeograph(char: string): boolean
Checks whether the input character is an ideographic character.
-This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [isIdeograph](#isideograph9) instead.
+This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [isIdeograph](#isideograph9).
**System capability**: SystemCapability.Global.I18n
@@ -2548,7 +2548,7 @@ This API is supported since API version 8 and is deprecated since API version 9.
| Type | Description |
| ------- | ---------------------------------------- |
-| boolean | Returns **true** if the input character is an ideographic character; returns **false** otherwise.|
+| boolean | The value **true** indicates that the input character is an ideographic character, and the value **false** indicates the opposite.|
### isLetter(deprecated)
@@ -2557,7 +2557,7 @@ static isLetter(char: string): boolean
Checks whether the input character is a letter.
-This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [isLetter](#isletter9) instead.
+This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [isLetter](#isletter9).
**System capability**: SystemCapability.Global.I18n
@@ -2571,7 +2571,7 @@ This API is supported since API version 8 and is deprecated since API version 9.
| Type | Description |
| ------- | ------------------------------------ |
-| boolean | Returns **true** if the input character is a letter; returns **false** otherwise.|
+| boolean | The value **true** indicates that the input character is a letter, and the value **false** indicates the opposite.|
### isLowerCase(deprecated)
@@ -2580,7 +2580,7 @@ static isLowerCase(char: string): boolean
Checks whether the input character is a lowercase letter.
-This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [isLowerCase](#islowercase9) instead.
+This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [isLowerCase](#islowercase9).
**System capability**: SystemCapability.Global.I18n
@@ -2594,7 +2594,7 @@ This API is supported since API version 8 and is deprecated since API version 9.
| Type | Description |
| ------- | ---------------------------------------- |
-| boolean | Returns **true** if the input character is a lowercase letter; returns **false** otherwise.|
+| boolean | The value **true** indicates that the input character is a lowercase letter, and the value **false** indicates the opposite.|
### isUpperCase(deprecated)
@@ -2603,7 +2603,7 @@ static isUpperCase(char: string): boolean
Checks whether the input character is an uppercase letter.
-This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [isUpperCase](#isuppercase9) instead.
+This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [isUpperCase](#isuppercase9).
**System capability**: SystemCapability.Global.I18n
@@ -2617,16 +2617,16 @@ This API is supported since API version 8 and is deprecated since API version 9.
| Type | Description |
| ------- | ---------------------------------------- |
-| boolean | Returns **true** if the input character is an uppercase letter; returns **false** otherwise.|
+| boolean | The value **true** indicates that the input character is an uppercase letter, and the value **false** indicates the opposite.|
### getType(deprecated)
static getType(char: string): string
-Obtains the type of the input character string.
+Obtains the category value of the input character string.
-This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [getType](#gettype9) instead.
+This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [getType](#gettype9).
**System capability**: SystemCapability.Global.I18n
@@ -2640,4 +2640,4 @@ This API is supported since API version 8 and is deprecated since API version 9.
| Type | Description |
| ------ | ----------- |
-| string | Type of the input character.|
+| string | Category value of the input character.|
diff --git a/en/application-dev/reference/errorcodes/errorcode-i18n.md b/en/application-dev/reference/errorcodes/errorcode-i18n.md
index e78abf39b82bf0e4da3f35c0dfc14aaa78e31165..4eb16a6ce63ccb172e5038b67fcaa8ced8a9d65f 100644
--- a/en/application-dev/reference/errorcodes/errorcode-i18n.md
+++ b/en/application-dev/reference/errorcodes/errorcode-i18n.md
@@ -1,4 +1,4 @@
-# i18n Error Codes
+# I18N Error Codes
> **NOTE**
>
@@ -8,7 +8,7 @@
**Error Message**
-Unspported para value.
+param value not valid
**Description**
@@ -21,21 +21,3 @@ Invalid parameter values are probably due to incorrect parameter types.
**Solution**
Check whether the parameter type is correct.
-
-## 890002 Incorrect Configuration Option
-
-**Error Message**
-
-Unspported option value.
-
-**Description**
-
-This error code is reported if an I18N API is called with invalid option values specified.
-
-**Possible Causes**
-
-Invalid option values are probably due to incorrect option types.
-
-**Solution**
-
-Check whether the option type is correct.
diff --git a/en/device-dev/subsystems/subsys-boot-overview.md b/en/device-dev/subsystems/subsys-boot-overview.md
index 2636bc078baedad412e0e96ab6fcf022bf0328b0..24e184b3dbe611885e1c697d33621ea13fd70dc1 100644
--- a/en/device-dev/subsystems/subsys-boot-overview.md
+++ b/en/device-dev/subsystems/subsys-boot-overview.md
@@ -11,45 +11,45 @@ The following figure shows the context structure of the Startup subsystem.
When the system is powered on, the kernel loads and starts services and applications as follows:
-1. The kernel loads the init process, which is specified by **cmdline** of the kernel when the bootloader starts the kernel.
-2. After the init process is started, **tmpfs** and **procfs** are mounted and basic **dev** nodes are created to establish a basic root file system.
-3. The init process starts the ueventd process to listen for device hot-swap events in the kernel and creates **dev** nodes for related devices as well as partitions for the block device.
-4. After mounting partitions (**system** and **vendor**) of the block device, the init process scans for the init startup script of each system service and starts the respective system ability (SA).
+1. The kernel loads the init process, which is specified by `cmdline` of the kernel when the bootloader starts the kernel.
+2. After the init process is started, `tmpfs` and `procfs` are mounted and basic `dev` nodes are created to establish a basic root file system.
+3. The init process starts the ueventd process to listen for device hot-swap events in the kernel and creates `dev` nodes for related devices as well as partitions for the block device.
+4. After mounting partitions (`system` and `vendor`) of the block device, the init process scans for the init startup script of each system service and starts the respective system ability (SA).
5. Each SA registers with the samgr process, which serves as the service registration center. The samgr process assigns each SA with an ID, which will be used by an application to access the desired SA.
-6. The foundation process sends the application startup request to the appspawn process. The foundation implements application lifecycle management. It is a special SA service process that provides the user program management framework and basic services.
-7. The appspawn process directly spawns the application process, eliminating the need for the application to load the JS runtime environment. This reduces the application startup time.
+6. The foundation process implements application lifecycle management. It is a special SA service process that provides the user program management framework and basic services.
+7. For an application, loading of the JS running environment involves a great deal of preparations. To reduce the application startup time, the appspawn process directly spawns an application process once receiving an application startup request from the foundation process.
The Startup subsystem consists of the following modules:
-- init module
+- init Module
- This module corresponds to the init process, which is the first user-mode process started after the kernel is initialized. After the init process starts, it reads and parses the **init.cfg** file. Based on the parsing result, the init module executes the commands listed in Table 2 in [Job Management](../subsystems/subsys-boot-init-jobs.md) and starts the key system service processes in sequence with corresponding permissions granted.
+ This module corresponds to the init process, which is the first user-space process started after the kernel is initialized. After the init process starts, it reads and parses the `init.cfg` file. Based on the parsing result, the init module executes the commands listed in Table 2 in [Job Management](../subsystems/subsys-boot-init-jobs.md#available-apis) and starts the key system service processes in sequence with corresponding permissions granted.
- ueventd module
- This module listens for **netlink** events about hot swap of kernel device drivers and dynamically manages the **dev** node of the corresponding device based on the event type.
+ This module listens for **netlink** events about hot plug of kernel device drivers and dynamically manages the `dev` node of the corresponding device based on the event type.
-- appspawn module
+- appspawn Module
This module spawns application processes upon receiving commands from the foundation, configures permissions for new processes, and calls the entry function of the application framework.
-- bootstrap module
+- bootstrap Module
- This module provides entry identifiers for starting services and features. When SAMGR is started, the entry function identified by bootstrap is called and system services are started.
+ This module provides entry identifiers for starting services and features. When samgr is started, the entry function identified by bootstrap is called and system services are started.
-- syspara module
+- syspara
This module provides APIs for obtaining device information, such as the product name, brand name, and manufacturer name, based on the OpenHarmony Product Compatibility Specifications (PCS). It also provides APIs for setting and obtaining system attributes.
## Constraints
- The source code directory of the Startup subsystem varies according to the platform.
+ The source code directory of the Startup subsystem varies according to the platform.
- **Table 1** Directories and applicable platforms of the Startup subsystem
+ **Table 1** Directories and applicable platforms of the Startup subsystem
-| Source Code Directory| Applicable Platform|
+| Name| Applicable Platform|
| -------- | -------- |
| base/startup/appspawn_lite | Small-system devices (reference memory ≥ 1 MiB), for example, Hi3516D V300 and Hi3518E V300|
| base/startup/bootstrap_lite | Mini-system devices (reference memory ≥ 128 KiB), for example, Hi3861 V100|
@@ -57,14 +57,14 @@ The Startup subsystem consists of the following modules:
| base/startup/syspara_lite | - Mini-system devices (reference memory ≥ 128 KiB), for example, Hi3861 V100
- Small-system devices (reference memory ≥ 1 MiB), for example, Hi3516D V300 and Hi3518E V300|
- init module
- - To start a system service, you first need to write a boot script file named **init.cfg**, in which you define the service name, path of executable files, permissions, etc.
- - The boot script of each system service is installed in the **/system/etc/init** directory. The init process scans this directory for the boot script to execute.
+ - To start a system service, you first need to write a boot script file named `init.cfg`, in which you define the service name, path of executable files, permissions, etc.
+ - The boot script of each system service is installed in the `/system/etc/init` directory. The init process scans this directory for the boot script to execute.
-- When porting a new chip platform, you need to add the **/vendor/etc/init/init.{hardware}.cfg** file that contains the platform-level initialization configuration. This file is used to implement platform-level initialization, for example, installing the ko driver and configuring information on the related **/proc** nodes.
+- When porting a new chip platform, you need to add the `/vendor/etc/init/init.{hardware}.cfg` file that contains the platform-level initialization configuration. This file is used to implement platform-level initialization, for example, installing the ko driver and configuring information on the related `/proc` nodes.
> **NOTE**
- >
- > The configuration file **init.cfg** must be in JSON format.
+ >
+ > The configuration file `init.cfg` must be in JSON format.
- bootstrap module: The zInit code must be configured in the link script.
@@ -83,67 +83,67 @@ By default, the OpenHarmony standard system supports the images listed in the fo
On each development board, you need to partition the memory to store the preceding images. When the SoC starts, the bootloader loads the images as follows:
- Initializes hardware such as the ROM and RAM, and loads the partition table information.
-- Loads the **boot.img** file based on the partition table and parses and loads the **ramdisk.img** file to the memory.
-- Prepares the partition table information and ramdisk address and enters the kernel, so that the kernel loads the ramdisk image and starts the init process.
-- Waits until the init process prepares the initial file system and mounts **required.fstab** (including **system.img** and **vendor.img**) to the file system.
-- Scans the boot scripts in the **etc/init** directory in **system.img** and **vendor.img** and runs each boot command.
+- Loads the `boot.img` file based on the partition table and parses and loads the `ramdisk.img` file to the memory.
+- Prepares the partition table information and ramdisk address and enters the kernel, so that the kernel loads the the ramdisk image and starts the init process.
+- Waits until the init process prepares the initial file system and mounts `required.fstab` (including `system.img` and `vendor.img`) to the file system.
+- Scans the boot scripts in the `etc/init` directory in `system.img` and `vendor.img` and runs each boot command.
### U-Boot Process
-[U-Boot](https://elinux.org/U-Boot) is used as an example to describe the key image loading process. When U-Boot starts the system, it passes the boot information to the system by using **bootargs**.
+[U-Boot](https://elinux.org/U-Boot) is used as an example to describe the key image loading process. When U-Boot starts the system, it passes the boot information to the system by using `bootargs`.
-- **boot.img** loading and parsing
+- `boot.img` loading and parsing
- - **boot.img** format
+ - `boot.img` format
- **boot.img** building and loading vary depending on the platform. The implementation on mainstream OpenHarmony platforms is as follows:
+ `boot.img` building and loading varies depending on the platform. The implementation on mainstream OpenHarmony platforms is as follows:
- - Hi3516D V300
+ - Hi3516DV300
- On this platform, the **boot.img** file uses the flattened image tree (FIT) format. It is generated by the Mkimage tool by packing the **zImage-dtb** and **cpio** images, which are generated after kernel compilation, based on the information in the **.its** file.
+ On this platform, the `boot.img` file uses the flattened image tree (FIT) format. It is generated by the Mkimage tool by packing the `ramdisk.img` files, which are packed by using `zImage-dtb` or `cpio` during kernel building, based on the information in the `its` file.
The related files and tool are described as follows:
- 1. **.its** file
+ 1. `its` file
- An image source file that describes the information about the image to be generated. You need to create the file, for example, the **ohos.its** file on the Hi3516 platform.
+ An image source file that describes the information about the image to be generated. You need to create the file, for example, the `ohos.its` file on the Hi3516 platform.
2. Mkimage packaging tool
- A tool that parses **its** files and packs the corresponding images based on the image configuration to generate an **itb** file, that is, **boot.img**.
+ A tool that parses `its` files and packs the corresponding images based on the image configuration to generate an `itb` file, that is, `boot.img`.
- 3. ramdisk
+ 3. `ramdisk` image
- An image file generated by packing **cpio** images.
+ A `ramdisk.img` file packed by using `cpio`.
- 4. zImage-dtb
+ 4. `zImage-dtb` image
- An image file that contains the compressed kernel image and device description file image.
+ An image that contains the compressed kernel image and device description file image.
- rk3568
- On this platform, the **boot.img** file is named **boot_linux.img**. The packaged files are different from those on the Hi3516D V300 platform.
+ On this platform, the `boot.img` file is named `boot_linux.img`. The packaged files are different from those on the Hi3516D V300 platform.
1. Image
- Image file generated after kernel compilation.
+ Image file generated after kernel building.
2. toybrick.dtb
- A file that is similar to the device description file image generated after dts compilation.
+ A file that is similar to the device description file image generated through `dts` building.
3. ramdisk.img
- An image file generated by packing **cpio** images.
+ A `ramdisk.img` file packed by using `cpio`.
- U-Boot loading
- The ramdisk boot process is supported. In this scenario, you need to modify the product configuration file in **productdefine** and enable ramdisk generation by setting **enable_ramdisk**. The ramdisk processing method varies according to the platform. Take the Hi3516D V300 platform as an example. You need to change the original U-Boot parameter to **root=/dev/ram0 initrd=0x84000000,0x292e00**.
+ The ramdisk boot process is supported. In this scenario, you need to modify the product configuration file in `productdefine` and enable ramdisk generation by setting `enable_ramdisk`. The ramdisk processing method varies according to the platform. Take the Hi3516D V300 platform as an example. You need to change the original U-Boot parameter to `root=/dev/ram0 initrd=0x84000000,0x292e00`.
- Kernel start
- When the U-Boot starts the kernel, it can pass key information to the kernel through **bootargs**. The information varies according to the platform. The main fields are described in the table below.
+ When U-Boot starts the kernel, it can pass key information to the kernel through `bootargs`. The information varies according to the platform. The main fields are described in the table below.
| Name | Example | Description |
| ----------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
@@ -151,53 +151,53 @@ On each development board, you need to partition the memory to store the precedi
| init | /init | |
| blkdevparts | mmcblk0:1M(boot),15M(kernel),200M(system),200M(vendor),
2M(misc),20M(updater),-(userdata) | Partition table information. The kernel creates physical partitions based on the information. |
| hardware | Hi3516D V300, rk3568, etc. | (Mandatory information) Hardware platform.|
- | root | /dev/ram0 (Hi3516D V00) , root=PARTUUID=614e0000-0000 rw (rk3568) | Boot device loaded by the kernel.|
+ | root | /dev/ram0 (Hi3516DV00), root=PARTUUID=614e0000-0000 rw (rk3568) | Boot device loaded by the kernel.|
| rootfstype | ext4 | Type of the root file system.|
- | default_boot_device | soc/10100000.himci.eMMC | (Recommended information) Default boot device. In the first phase of the boot process, a soft link will be created for the required device based on this field.|
- | ohos.required_mount.xxx | /dev/block/platform/soc/10100000.himci.eMMC/by-name/xxx@/usr@ext4@ro,barrier=1@wait,required | The fstab information is first read from cmdline. If this fails, the system will try to read the information from the **fstab.required** file.|
+ | default_boot_device | soc/10100000.himci.eMMC | (Recommended information) Default boot device. In the first phase of the boot process, a soft link will be created for the `required` partition device based on this field.|
+ | ohos.required_mount.xxx | /dev/block/platform/soc/10100000.himci.eMMC/by-name/xxx@/usr@ext4@ro,barrier=1@wait,required | The fstab information is first read from cmdline. If this fails, the system will try to read the information from the `fstab.required` file.|
-- Mounting of required partitions
+- Mounting of `required` partitions
- A required partition is one that is essential for system boot. It must be mounted before level-2 boot. For mandatory images like system and vendor images, the corresponding block device files must be created before mounting. This is usually done based on UEVENT events reported by the kernel. The init process needs to know the main device directory of the storage device. The bootloader passes the primary device directory of the storage device to the init process through **default_boot_device**.
+ A `required` partition is one that is essential for system boot. It must be mounted before level-2 boot. For mandatory images like system and vendor images, the corresponding block device files must be created before mounting. This is usually done based on the **uevent** messages reported by the kernel. The init process needs to know the main device directory of the storage device. The bootloader process passes the primary device directory of the storage device to the init process through `default_boot_device`.
- Currently, the init process obtains required partition information in two ways. The init process first reads the required partition information through the **bootargs** in **/proc/cmdline**. If the attempt fails, the init process reads the **fstab.required** file in the ramdisk image.
+ Currently, the init process obtains `required` partition information in two ways. The init process first reads the `required` partition information through `bootargs` in `/proc/cmdline`. If the attempt fails, the init process reads the `fstab.required` file in the ramdisk image.
- Logic of block device creation
- Preparation
- 1. The init process reads the required fstab information from **cmdline**. If the attempt fails, the init process reads the **fstab.required** file to obtain **PARTNAME** of the block devices that must be mounted, for example, **system** or **vendor**.
- 2. Create a socket for receiving uevent messages reported by the kernel and read **default_boot_device** from **/proc/cmdline**.
- 3. Traverse the **/sys/devices** directory with the fstab information and socket handle to get the kernel prepared for reporting uevent messages.
+ 1. The init process reads the `fstab.required` file from `cmdline`. If the attempt fails, the init process reads the `fstab.required` file to obtain `PARTNAME` of the block devices that must be mounted, for example, `system` or `vendor`.
+ 2. Create a socket for receiving **uevent** messages reported by the kernel and read `default_boot_device` from `/proc/cmdline`.
+ 3. Traverse the `/sys/devices` directory with the fstab information and socket handle to get the kernel prepared for reporting **uevent** messages.
- - Event triggering
+ - Trigger event
- 1. Use **ueventd** to trigger the kernel to report a uevent message.
- 2. Check whether **partitionName** in the uevent message matches with device information in the required fstab.
- 3. If they match, format the device node path and proceed with device node creation.
+ 1. Use **ueventd** to trigger the kernel to report a **uevent** message.
+ 2. Check whether `partitionName` in the **uevent** message matches with device information in the `fstab.required` file.
+ 3. If they match, format the device node path and proceed with device node creation.
- - Device node creation
+ - Creating Nodes
- 1. Format the path of the soft link to be created for required block device nodes. A soft link helps facilitate access to device nodes in user mode and improve their readability.
- 2. Create device nodes based on the primary and secondary device numbers passed in the uevent message, and the device node path and soft link path obtained in the previous steps. Meanwhile, create a soft link for them.
+ 1. Format the path of the soft link to be created for required block device nodes. A soft link helps facilitate access to device nodes in user mode and improve their readability.
+ 2. Create device nodes based on the primary and secondary device numbers passed in the **uevent** message, and the device node path and soft link path obtained in the previous steps. Meanwhile, create a soft link for them.
Up to now, the creation of block device nodes is complete.
- - Mapping with **default_boot_device**
+ - Mapping with `default_boot_device`
- The kernel writes **bootargs** information to **/proc/cmdline**. The information includes **default_boot_device**, which specifies the primary device directory required for system boot. The content prefixed with **ohos.required_mount.** is the partition mounting information required for system boot. It should be the same as that in the **fstab.required** file. In addition, the block device node in the partition mounting information should be a device node pointed by the soft link under **by-name** in the **default_boot_device** directory. For example, if the value of **default_boot_device** is **soc/10100000.himci.eMMC**, then the value of **ohos.required_mount.system** contains **/dev/block/platform/soc/10100000.himci.eMMC/by-name/system**, which is the soft link pointing to the system device node.
+ The kernel writes `bootargs` information to `/proc/cmdline`. The information includes `default_boot_device`, which specifies the primary device directory required for system boot. The content prefixed with `ohos.required_mount.` is the partition mounting information required for system boot. It should be the same as that in the `fstab.required` file. In addition, the block device node in the partition mounting information should be a device node pointed by the soft link under `by-name` in the `default_boot_device` directory. For example, if the value of `default_boot_device` is `soc/10100000.himci.eMMC`, then the value of `ohos.required_mount.system` contains `/dev/block/platform/soc/10100000.himci.eMMC/by-name/system`, which is the soft link pointing to the system device node.
- During creation of a block device node, the device path will be matched against the value of **default_boot_device**. If the matching is successful, a soft link pointing to the real block device node will be created in **/dev/block/by-name**. In this way, device node access is made irrelevant to the chip platform.
+ During creation of a block device node, the device path will be matched against the value of `default_boot_device`. If the matching is successful, a soft link pointing to the real block device node will be created in `/dev/block/by-name`. In this way, device node access is made irrelevant to the chip platform.
- Example
- This example assumes the **system** partition as the required partition on the Hi3516D V300 platform to illustrate the boot process. During this process, the init process reads the required fstab information, creates a block device node, and mounts it to the required partition. The following provides the key code snippets and log information as reference for debugging.
+ This example assumes the `system` partition as the `required` partition on the Hi3516D V300 platform to illustrate the boot process. During this process, the init process reads the `fstab.required` file, creates a block device node, and mounts it to the `required` partition. The following provides the key code snippets and log information as reference for debugging.
> **NOTE**
- >
+ >
> The code snippets below are exhibited in the logical sequence. They are not neighboring to each other in the source code.
- 1. Obtain required device information.
+ 1. Obtain `required` partition device information.
```
Fstab* LoadRequiredFstab(void)
{
@@ -209,20 +209,20 @@ On each development board, you need to partition the memory to store the precedi
if (access(fstabFile, F_OK) != 0) {
fstabFile = "/system/etc/fstab.required";
}
- INIT_ERROR_CHECK(access(fstabFile, F_OK) == 0, abort(), "Failed to get fstab.required");
+ INIT_ERROR_CHECK(access(fstabFile, F_OK) == 0, abort(), "Failed get fstab.required");
fstab = ReadFstabFromFile(fstabFile, false);
}
return fstab;
}
```
- The preceding code provides two methods for the init process to obtain the fstab information. First, the init process calls **LoadFstabFromCommandLine()** to read the fstab information from **cmdline**. If the attempt fails, the init process reads the **fstab.required** file to obtain the fstab information.
+ The preceding code provides two methods for the init process to obtain the fstab information. First, the init process calls `LoadFstabFromCommandLine()` to read the fstab information from `cmdline`. If the attempt fails, the init process outputs log information and continues to read the `fstab.required` file for the fstab information.
- For the **system** partition, the key information read from **devices** is as follows:
+ For the `system` partition, the key information read from `devices` is as follows:
```
/dev/block/platform/fe310000.sdhci/by-name/system
```
- 2. Create a socket and trigger the kernel to report a uevent message.
+ 2. Create a socket and trigger the kernel to report a **uevent** message.
```
static int StartUeventd(char **requiredDevices, int num)
{
@@ -238,15 +238,15 @@ On each development board, you need to partition the memory to store the precedi
}
```
- 3. Read information from **cmdline** to obtain **default_boot_device**.
+ 3. Read information from `cmdline` to obtain `default_boot_device`.
```
char *buffer = ReadFileData("/proc/cmdline");
int ret = GetProcCmdlineValue("default_boot_device", buffer, bootDevice, CMDLINE_VALUE_LEN_MAX);
- INIT_CHECK_ONLY_ELOG(ret == 0, "Failed to get default_boot_device value from cmdline");
+ INIT_CHECK_ONLY_ELOG(ret == 0, "Failed get default_boot_device value from cmdline");
```
- In this example, the value of **default_boot_device** is **soc/10100000.himci.eMMC**. The value is stored in the global variable **bootDevice** and will be matched with the path of the **system** partition device when a soft link is created.
+ In this example, the value of `default_boot_device` is `soc/10100000.himci.eMMC`. The value is stored in the global variable `bootDevice` and will be matched with the path of the `system` partition device when a soft link is created.
- 4. Process the uevent message of the required partition device.
+ 4. Process the **uevent** message of the `required` partition device.
```
if (uevent->partitionName == NULL) {
INIT_LOGI("Match with %s for %s", devices[i], uevent->syspath);
@@ -264,11 +264,11 @@ On each development board, you need to partition the memory to store the precedi
break;
}
```
- In this step, the device information in **devices** is matched with the uevent message reported by the kernel. The value of **uevent->partitionName** should be **system** for the uevent message of the **system** partition device. If the value matches the **/dev/block/platform/fe310000.sdhci/by-name/system** field in **devices**, the uevent message of the **system** partition device will be processed.
+ In this step, the device information in `devices` is matched with the **uevent** message reported by the kernel. The value of `uevent -> partitionName` should be `system` for the **uevent** message of the `system` partition device. If the value matches the `/dev/block/platform/fe310000.sdhci/by-name/system` field in `devices`, the **uevent** message of the `system` partition device will be processed.
- 5. Create the required device node and the corresponding soft link.
+ 5. Create the `required` partition device node and the corresponding soft link.
- The first thing is to format the path of the corresponding soft link. In this step, the value of **default_boot_device** in **bootargs** will be matched with the path of the required device node in the uevent message, so as to create a platform-irrelevant soft link that points to the device node. The key code is as follows:
+ The first thing is to format the path of the corresponding soft link. In this step, the value of `default_boot_device` in `bootargs` will be matched with the path of the required device node in the **uevent** message, so as to create a platform-irrelevant soft link that points to the device node. The key code is as follows:
```
if (STRINGEQUAL(bus, "/sys/bus/platform")) {
INIT_LOGV("Find a platform device: %s", parent);
@@ -285,29 +285,28 @@ On each development board, you need to partition the memory to store the precedi
```
The key variables in the code are as follows:
- - **bus**: a string that saves the path of the bus connected to the current device.
- - **parent**: a string that stores the device path obtained from **syspath** in the uevent message.
- - **links**: a pointer to the memory that stores the soft link path.
- - **bootDevice**: a string that stores the value of **default_boot_device** in **bootargs**
-
- According to the code, the corresponding soft link is created for the device only when the type of the connected bus is **platform**. The path of the soft link is as follows:
+ - `bus`: a string that saves the path of the bus connected to the current device.
+ - `parent`: a string that stores the device path obtained from `uevent -> syspath` in the **uevent** message.
+ - `links`: a pointer to the memory that stores the soft link path.
+ - `bootDevice`: a string that stores the value of `default_boot_device` in `bootargs`.
+ According to the code, the corresponding soft link is created for the device only when the type of the connected bus is `platform`. The path of the soft link is as follows:
```
/dev/block/platform/soc/10100000.himci.eMMC/by-name
```
- A platform-irrelevant soft link is created only when the device path matches that in **bootDevice**.
+ A platform-irrelevant soft link is created only when the device path matches that in `bootDevice`.
For the **system** partition device, the path is as follows:
```
/sys/devices/platform/soc/10100000.himci.eMMC/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p5
```
- Therefore, when processing the uevent message of the device, the init process compares the device path with that in **bootDevice**, that is, **soc/10100000.himci.eMMC**. If they match, a soft link will be created as follows:
+ Therefore, when processing the **uevent** message of the device, the init process compares the device path with that in `bootDevice`, that is, `soc/10100000.himci.eMMC`. If they match, a soft link will be created as follows:
```
/dev/block/by-name/system
```
- After the soft link path is formatted, the init process creates the device node and soft link based on the information in the uevent message. Up to now, the creation of a device node for the system partition is complete.
+ After the soft link path is formatted, the init process creates the device node and soft link based on the information in the **uevent** message. Up to now, the creation of a device node for the `system` partition is complete.
- 6. Mount the required partition.
+ 6. Mount the `required` partition.
After a device node is created, mount it to the corresponding partition. The code is as follows:
```
@@ -320,45 +319,47 @@ On each development board, you need to partition the memory to store the precedi
return rc;
}
```
- Therefore, when "Mount required partitions" is displayed, the required partition device is ready for mounting. During the mounting process, the following key information is printed:
+ Therefore, when "Mount required partitions" is displayed, the `required` partition device is ready for mounting. During the mounting process, the following key information is printed:
```
BEGET_LOGE("Unsupported file system \" %s \"", item->fsType);
- // The current file system type is not supported.
-
+ ```
+ The current file system type is not supported.
+ ```
BEGET_LOGE("Cannot get stat of \" %s \", err = %d", target, errno);
- // Failed to obtain the mount point directory.
-
+ ```
+ The attempt to obtain the mount point directory has failed.
+ ```
BEGET_LOGE("Failed to create dir \" %s \", err = %d", target, errno);
- // Failed to create the mount point directory.
-
+ ```
+ The attempt to create the mount point directory has failed.
+ ```
BEGET_LOGI("Mount %s to %s successful", item->deviceName, item->mountPoint);
- // The device is successfully mounted. The output also contains the name of the mounted device and information about the mount point.
```
+ The device is successfully mounted. The output also contains the name of the mounted device and information about the mount point.
+- Mounting of the `vendor` partition
-- Mounting of vendor partitions
-
- After mounting required partitions, the init process scans each script file in the **vendor** partition. The initialization scripts related to the chip or development board are named in the format of **/vendor/etc/init.{ohos.boot.hardware}.cfg**. Wherein, **/vendor/etc/fstab.{ohos.boot.hardware}** represents the extended mount partition file; **hardware** is sourced from **bootargs**, which is passed from the bootloader to the kernel.
+After mounting required partitions, the init process scans each script file in the `vendor` partition. The initialization scripts related to the chip or development board is named in the format of `/vendor/etc/init.{ohos.boot.hardware}.cfg`. Wherein, `/vendor/etc/fstab.{ohos.boot.hardware}` represents the extended mount partition file; `hardware` is sourced from `bootargs`, which is passed from the bootloader to the kernel.
### Boot Loading Without ramdisk
-Certain development boards do not use the ramdisk boot mode. For these boards, the boot process is implemented by directly loading the **system.img** file through the kernel. In such case, you need to modify the product configuration file in **productdefine**. Specifically, you need to turn off the **enable_ramdisk** switch to disable ramdisk generation so that the init process does not boot from ramdisk to system.
+Certain development boards do not use the ramdisk boot mode. For these boards, the boot process is implemented by directly loading the `system.img` file through the kernel. In such case, you need to modify the product configuration file in `productdefine`. Specifically, you need to turn off the `enable_ramdisk` switch to disable ramdisk generation so that the init process does not boot from ramdisk to system.
-Boot loading in this scenario is similar to that in the preceding section. The only difference is as follows: If ramdisk is used, the init process mounts **system.img** to the **/usr** directory and then switches to the **/usr** directory using **chroot**. If ramdisk is not used, the init process directly runs the **init.cfg** file.
+The boot loading process in this scenario is similar to that in the preceding section. The only difference is as follows: If ramdisk is used, the init process mounts `system.img` to the `/usr` directory and then switches to the `/usr` directory using `chroot`. If ramdisk is not used, the init process directly runs the `init.cfg` file.
-For boot loading without ramdisk (that is, system as root), the block device where the root file system is located is passed to the kernel through **bootargs**, for example, **root=/dev/mmcblk0p5 and rootfstype=ext4**. During initialization of the root file system, the kernel parses the **root** field in **bootargs** to complete mounting of the root file system.
+For the boot loading process without ramdisk, that is, system as root, the block device where the root file system is located is passed to the kernel through `bootargs`, for example, `root=/dev/mmcblk0p5, rootfstype=ext4`. During initialization of the root file system, the kernel parses the `root` field in `bootargs` to complete mounting of the root file system.
### Partition A/B Booting
-Currently, OpenHarmony supports booting from partitions A and B (active and standby system partitions), both of which are configured in the same device storage. During the booting process, the system partition to load is determined based on the slot of the active partition. Partition A/B booting is supported only for the system partition and chipset partition.
+Currently, OpenHarmony supports booting from partitions A and B (active and standby system partitions), both of which are configured in the same device storage. During the booting process, the system partition to load is determined based on the slot of the active partition. Partition A/B booting is supported only for the `system` and `chipset` partitions.
- bootslots
- Number of the supported boot partitions. If **bootslots** is set to **2**, the system can boot from both system partitions A and B. If **bootslots** is set to **1**, partition A/B booting is not supported and the system can boot only from the default system partition.
+ Number of the supported boot partitions. If `bootslots` is set to `2`, the system can boot from both system partitions A and B. If `bootslots` is set to `1`, partition A/B booting is not supported and the system can boot only from the default system partition.
- In the initial phase of init process startup, the system reads the **bootslots** value to determine whether partition A/B booting is supported. If yes, the system continues to determine the system partition to mount. If not, the system mounts the system partition based on the default fstab. The API for the init process to obtain the **bootslots** value is as follows:
+ In the initial phase of init process startup, the system reads the `bootslots` value to determine whether partition A/B booting is supported. If yes, the system continues to determine the system partition to mount. If not, the system mounts the system partition based on the default fstab. The API for the init process to obtain the `bootslots` value is as follows:
```
int GetBootSlots(void)
{
@@ -368,16 +369,16 @@ Currently, OpenHarmony supports booting from partitions A and B (active and stan
return GetSlotInfoFromCmdLine("bootslots");
}
```
- After normal system startup, you can obtain the **bootslots** value from the system parameter **ohos.boot.bootslots** to check whether the current system supports partition A/B booting. The command for obtaining **ohos.boot.bootslots** is as follows:
+ After normal system startup, you can obtain the `bootslots` value from the system parameter `ohos.boot.bootslots` to check whether the current system supports partition A/B booting. The command for obtaining `ohos.boot.bootslots` is as follows:
```
param get ohos.boot.bootslots
```
- currentslot
- Current system partition, for example, partition A or partition B. The value of **currentslot** is a number. For example, **1** indicates partition A, and **2** indicates partition B.
+ Current system partition, for example, partition A or partition B. The value of `currentslot` is a number. For example, `1` indicates partition A, and `2` indicates partition B.
- In the initial phase of startup, the init process determines whether the system supports partition A/B booting based on **bootslots**. If the system does not support partition A/B booting, the init process directly boots from the default system partition instead of obtaining the **currentslot** value. If the system supports partition A/B booting, the init process obtains the **currentslot** value and determines whether partition A or partition B is the current system partition. The API for the init process to obtain the **currentslot** value is as follows:
+ In the initial phase of startup, the init process determines whether the system supports partition A/B booting based on `bootslots`. If the system does not support partition A/B booting, the init process directly boots from the default system partition instead of obtaining the `currentslot` value. If the system supports partition A/B booting, the init process obtains the `currentslot` value and determines whether partition A or partition B is the current system partition. The API for the init process to obtain the `currentslot` value is as follows:
```
int GetCurrentSlot(void)
{
@@ -396,10 +397,10 @@ Currently, OpenHarmony supports booting from partitions A and B (active and stan
}
```
-- Partition A/B booting process
+- Partition A/B Booting Process
- 1. Obtain the **currentslot** value to determine whether partition A or partition B is the current system partition.
- 2. Construct new partition mounting configuration based on the original fstab file, and add the suffix **a** or **b** to the partitions that support partition A/B booting, that is, system and chipset partitions.
+ 1. Obtain the `currentslot` value to determine whether partition A or partition B is the current system partition.
+ 2. Construct new partition mounting configuration based on the original `fstab` file, and add the suffix `_a` or `_b` to the partitions that support partition A/B booting, that is, system and chipset partitions.
3. Mount the partition added with the corresponding suffix and enter the second phase of startup. This phase occurs in partition A or B and concludes the partition A/B booting process.
The API for constructing new partition mounting configuration is as follows:
@@ -420,7 +421,7 @@ Currently, OpenHarmony supports booting from partitions A and B (active and stan
}
```
-- Development example
+- Development Example
The following uses the rk3568 platform as an example to illustrate how to change from default partition booting to partition A/B booting.
@@ -429,50 +430,51 @@ Currently, OpenHarmony supports booting from partitions A and B (active and stan

Use the original image to construct images of the partitions used for partition A/B booting, and test the partition A/B booting function.
- - Copy the **system** and **vendor** images, and add the suffix **\_b** to them.
- - Add partitions **system_b** and **vendor_b** to the partition table in **parameter.txt**.
+ - Copy the `system` and `vendor` images, and add the suffix `_b` to them.
+ - Add partitions `system_b` and `vendor_b` to the partition table in the `parameter.txt` file.
2. Burn the images of the partitions used for partition A/B booting.
- - Import the partition configuration to the rk3568 burning tool, and select the **parameter.txt** file containing the **system_b** and **vendor_b** partitions.
- - Select images (including **system_b** and **vendor_b** images) based on the new partition table configuration, and then burn the images.
+ - Import the partition configuration to the rk3568 burning tool, and select the `parameter.txt` file containing the `system_b` and `vendor_b` partitions.
+ - Select images (including `system_b` and `vendor_b` images) based on the new partition table configuration, and then burn the images.
3. After the configuration is complete, perform the following:
- 1. Run the **cat /proc/cmdline** command. If the command output contains **bootslot=2**, the system supports partition A/B booting.
+ 1. Run the `cat /proc/cmdline` command. If the command output contains `bootslot=2`, the system supports partition A/B booting.

- 2. Run the **param get ohos.boot.bootslot** command. If the command output contains **2**, the **bootslot** information is successfully written to the **parameter.txt**.
+ 2. Run the `param get ohos.boot.bootslot` command. If the command output contains `2`, the `bootslot` information is successfully written to the `parameter.txt` file.
- 3. Run the **ls -l /dev/block/by-name** command. If the command output contains **system_b** and **vendor_b**, device nodes are successfully created in partition B.
+ 3. Run the `ls -l /dev/block/by-name` command. If the command output contains `system_b` and `vendor_b`, device nodes are successfully created in partition B.

- 4. Run the **df -h** command to check the partitions mounted to the system.
+ 4. Run the `df -h` command to check the partitions mounted to the system.

- As shown in the figure, partition **mmcblk0p6** is mounted to the root file system (represented by a slash), and partition **mmcblk0p7** is mounted to **/vendor**. Based on the command output in step 3, **mmcblk0p6** is the **system** partition, and **mmcblk0p7** is the **vendor** partition. That is, the mounted partitions are the default partitions, that is, **system** and **vendor** partitions without suffixes. In other words, partition A is the default partition.
+ As shown in the figure, partition `mmcblk0p6` is mounted to the root file system (represented by a slash), and partition `mmcblk0p7` is mounted to `/vendor`. Based on the command output in step 3, `mmcblk0p6` is the `system` partition, and `mmcblk0p7` is the `vendor` partition. That is, the mounted partitions are the default partitions, that is, `system` and `vendor` partitions without suffixes. In other words, partition A is the default partition.
Next, let's try booting from partition B.
- 1) Run the **partitionslot setactive 2** command to set the slot of the active partition to **2**, that is, the slot of partition B.
+ 1. Run the `partitionslot setactive 2` command to set the slot of the active partition to `2`, that is, the slot of partition B.
- 
+ 
- 2) Run the **partitionslot getslot** command to check the configured slot.
+ 2. Run the `partitionslot getslot` command to check the configured slot.
- 
+ 
- If **current slot** is **2**, the slot of the active partition is successfully set to **2**.
+ If `current slot: 2` is `2`, the slot of the active partition is successfully set to `2`.
- 3) Upon restarting, run the **df -h** command to check the partitions mounted to the system.
- According to the command output, partition **mmcblk0p11** is mounted to the root file system, and partition **mmcblk0p12** is mounted to **/vendor**.
+ 3. Upon restarting, run the `df -h` command to check the partitions mounted to the system.
+
+ According to the command output, partition `mmcblk0p11` is mounted to the root file system, and partition `mmcblk0p12` is mounted to `/vendor`.
- 
+ 
- 4) Run the **ls -l /dev/block/by-name** command again.
+ 4. Run the `ls -l /dev/block/by-name` command again.
- 
+ 
- **mmcblk0p11** corresponds to **system_b**, and **mmcblk0p12** corresponds to **vendor_b**. That is, the system is successfully booted from partition B.
+ `mmcblk0p11` corresponds to `system_b`, and `mmcblk0p12` corresponds to `vendor_b`. That is, the system is successfully booted from partition B.