From 2c68e31c3ccef1cee7267bfa91ae044a37337489 Mon Sep 17 00:00:00 2001 From: Andrei Gherzan <andrei.gherzan@huawei.com> Date: Tue, 1 Jun 2021 12:02:01 +0100 Subject: [PATCH] docs: Add OS topic on partition table Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com> --- docs/index.rst | 1 + docs/os/index.rst | 14 ++++ docs/os/linux/index.rst | 11 ++++ docs/os/linux/partition-table.rst | 105 ++++++++++++++++++++++++++++++ 4 files changed, 131 insertions(+) create mode 100644 docs/os/index.rst create mode 100644 docs/os/linux/index.rst create mode 100644 docs/os/linux/partition-table.rst diff --git a/docs/index.rst b/docs/index.rst index 9dc32766..9ac6552e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -13,6 +13,7 @@ Build System Guide repo-workspace build-flavours/index ohos-build/index + os/index ci/index blueprints/index supported-images diff --git a/docs/os/index.rst b/docs/os/index.rst new file mode 100644 index 00000000..507188a5 --- /dev/null +++ b/docs/os/index.rst @@ -0,0 +1,14 @@ +.. SPDX-FileCopyrightText: Huawei Inc. +.. +.. SPDX-License-Identifier: CC-BY-4.0 + +Operating System +################ + +All Scenarios OS provides support for a set of kernels. This documentation +details various aspects for each kernel type. + +.. toctree:: + :maxdepth: 2 + + linux/index diff --git a/docs/os/linux/index.rst b/docs/os/linux/index.rst new file mode 100644 index 00000000..e57e6b9a --- /dev/null +++ b/docs/os/linux/index.rst @@ -0,0 +1,11 @@ +.. SPDX-FileCopyrightText: Huawei Inc. +.. +.. SPDX-License-Identifier: CC-BY-4.0 + +All Scenarios OS - Linux +######################## + +.. toctree:: + :maxdepth: 1 + + partition-table diff --git a/docs/os/linux/partition-table.rst b/docs/os/linux/partition-table.rst new file mode 100644 index 00000000..22b6ca9f --- /dev/null +++ b/docs/os/linux/partition-table.rst @@ -0,0 +1,105 @@ +.. SPDX-FileCopyrightText: Huawei Inc. +.. +.. SPDX-License-Identifier: CC-BY-4.0 + +Disk Partition Table +#################### + +.. contents:: + :depth: 2 + +Overview +******** + +The OS defines the partitions included as part of the Linux-based distro as it +follows: + +* boot + + * filesystem label: x-boot (partition name when relevant) + + * It provides boot artefacts required by the lower bootloader assumptions. It + is device-specific both in terms of filesystem and content. + +* sys-a + + * filesystem label: x-sys-a (partition name when relevant) + + * It provides the root filesystem hierarchy. + + * Filesystem type, configuration and structure are device-independent. + + * This partition is the only one provided with a redundant counterpart (see + below). + +* sys-b + + * filesystem label: x-sys-b (partition name when relevant) + + * It provides a redundant root filesystem hierarchy used as part of the + system update strategies. + + * Filesystem type, configuration and structure are device-independent. + +* dev-data + + * filesystem label: x-dev-data (partition name when relevant) + + * Device-specific data meant to be preserved over system reset (factory + reset). + + * The runtime will completely treat this data read-only. + +* sys-data + + * filesystem label: x-sys-data (partition name when relevant) + + * This partition holds the system state to deal with the root filesystem as a + read-only asset. + + * It ties closely into the system update strategies. + + * Data is kept over system updates (subject to state transition hooks) but + discarded over factory reset. + +* app-data + + * filesystem label: x-app-data (partition name when relevant) + + * This partition provides application data storage. + + * Data is kept over system updates (subject to state transition hooks) but + discarded over factory reset. + +The build system tries to unify the partition as much as possible, leaving +upper layers (for example, the system update layers) with as few deviations to +deal with as feasible. This means that filesystem labels and partition names +are to be assumed by the OS components. + +Partition Table +*************** + +The OS will support both MBR and GPT as partition table type. In this way, the +OS can achieve more extensive device support. + +The OS assumes a GPT disk layout as it follows: + +* 4MiB is left untouched at the start of the disk (to accommodate for + hardware-specific requirements). + +* All partitions are aligned to 4MiB. + +* The filesystem labels and partition names are as described above. + +On the MBR side, the disk layout is similar to GPT. The design mainly +workarounds the four physical partitions limitation: + +* 4MiB is left untouched at the start of the disk (to accommodate for + hardware-specific requirements). + +* All partitions are aligned to 4MiB. + +* The filesystem labels and partition names are as described above. + +* The 4th partition is defined as extended and contains all the data partitions + (dev-data, sys-data and app-data). -- GitLab