Skip to content
Snippets Groups Projects
Verified Commit 66ad4440 authored by Andrei Gherzan's avatar Andrei Gherzan :penguin:
Browse files

x-mounts: Introduce recipe for system partition mount units


This components defines, generates and provides systemd mount units for
the system partitions (based on filesystem labels) as it follows:

boot partition -> label "boot" -> "mountpoint: /run/mount/boot"
devdata partition -> label "devdata" -> "mountpoint: /run/mount/devdata"
sysdata partition -> label "sysdata" -> "mountpoint: /run/mount/sysdata"
appdata partition -> label "appdata" -> "mountpoint: /run/mount/appdata"

When installed, the units are enabled early in the boot process as part
of the local-fs.target.

Signed-off-by: Andrei Gherzan's avatarAndrei Gherzan <andrei.gherzan@huawei.com>
parent 215ae566
No related branches found
No related tags found
No related merge requests found
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
SUMMARY = "Systemd mount units for the provided partitions"
SECTION = "base"
DESCRIPTION = "This recipe provides a set of mount units for the partition \
table used for the OS. It becomes the foundation of various functionalities. \
For example, runtime state management as part of a separatae state partition \
(sysdata)"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
SRC_URI = " \
file://run-mount-boot.mount \
file://run-mount-devdata.mount \
file://run-mount-appdata.mount \
file://run-mount-sysdata.mount \
"
inherit allarch systemd
SYSTEMD_SERVICE_${PN} = " \
run-mount-boot.mount \
run-mount-sysdata.mount \
run-mount-devdata.mount \
run-mount-appdata.mount \
"
SYSTEMD_AUTO_ENABLE = "enable"
LABELS = " \
${BOOT_PARTITION_LABEL} \
${DEVDATA_PARTITION_LABEL} \
${APPDATA_PARTITION_LABEL} \
${SYSDATA_PARTITION_LABEL} \
"
do_install () {
install -d ${D}${systemd_unitdir}/system
for label in ${LABELS}; do
install -m 0644 "${WORKDIR}/run-mount-${label}.mount" "${D}${systemd_unitdir}/system"
done
}
FILES_${PN} += "${systemd_unitdir}"
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
[Unit]
Description=Application Data File System
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target
[Mount]
What=/dev/disk/by-label/appdata
Where=/run/mount/appdata
[Install]
WantedBy=local-fs.target
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
[Unit]
Description=Boot File System
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target
[Mount]
What=/dev/disk/by-label/boot
Where=/run/mount/boot
[Install]
WantedBy=local-fs.target
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
[Unit]
Description=Device Data File System
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target
[Mount]
What=/dev/disk/by-label/devdata
Where=/run/mount/devdata
Options=ro
[Install]
WantedBy=local-fs.target
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
[Unit]
Description=System Data File System
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target
[Mount]
What=/dev/disk/by-label/sysdata
Where=/run/mount/sysdata
[Install]
WantedBy=local-fs.target
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment