Skip to content
Snippets Groups Projects
Commit 2d574cb1 authored by Andrei Gherzan's avatar Andrei Gherzan :penguin:
Browse files

ohos-image.bbclass: Introduce class


This class allows to hook a post install function that would mask getty
services enabled by systemd as part of `systemd_preset_all`.

To take advantage of it, an image would:
1. inherit this class
2. define SYSTEMD_MASK_GETTY to point to a list of tty devices that the
   hook will mask the getty service for.

Common use-case: disable running getty on tty1 at boot.

Signed-off-by: Andrei Gherzan's avatarAndrei Gherzan <andrei.gherzan@huawei.com>
parent 1e30b72d
No related branches found
No related tags found
No related merge requests found
# OpenHarmony functionality for images
# List of tty to mask getty for
SYSTEMD_MASK_GETTY ?= ""
systemd_mask_getty () {
if [ -e ${IMAGE_ROOTFS}${root_prefix}/lib/systemd/systemd ]; then
for i in ${SYSTEMD_MASK_GETTY}; do
systemctl --root="${IMAGE_ROOTFS}" mask "getty@${i}.service"
done
fi
}
IMAGE_PREPROCESS_COMMAND_append = " ${@ 'systemd_mask_getty;' if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d) and not bb.utils.contains('IMAGE_FEATURES', 'stateless-rootfs', True, False, d) else ''}"
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