Skip to content
Snippets Groups Projects
Commit 1151573b authored by Thierry Escande's avatar Thierry Escande
Browse files

Merge branch 'feat/services' into 'kirkstone'

openharmony-3.0: Start services from pre-init script

Closes #73 and #75

See merge request eclipse/oniro-core/meta-openharmony!85
parents b00f7682 ddb46ebd
Branches kirkstone
No related tags found
No related merge requests found
Showing
with 339 additions and 78 deletions
[Unit]
Description=OpenHarmony Account Manager service
Requires=appspawn.service
After=appspawn.service
[Service]
Type=exec
# should run as system:system
ExecStart=/usr/bin/sa_main /system/profile/accountmgr.xml
Type=oneshot
ExecStart=/bin/echo "OpenHarmony SystemAbilityFramework Service"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
[Unit]
Description=OpenHarmony Appspawn service
Requires=samgr.service
After=samgr.service
[Service]
Type=exec
# Delay execution by 2 secs after samgr.service
ExecStartPre=/bin/sleep 2
ExecStartPre=mkdir -p /data/app
ExecStart=/usr/bin/appspawn
Type=oneshot
ExecStart=/bin/echo "OpenHarmony Appspawn Service"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
[Unit]
Description=OpenHarmony Device Authentication daemon
Requires=samgr.service
After=samgr.service
[Service]
Type=exec
# Delay execution by 2 secs after samgr.service
ExecStartPre=/bin/sleep 2
ExecStart=/usr/bin/deviceauth_service
Type=oneshot
ExecStart=/bin/echo "OpenHarmony Device Authentication Service"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
[Unit]
Description=OpenHarmony Distributed Data service
Requires=appspawn.service
After=appspawn.service
[Service]
Type=exec
CapabilityBoundingSet=CAP_DAC_READ_SEARCH
# should run as system:system
ExecStart=/usr/bin/sa_main /system/profile/distributeddata.xml
Type=oneshot
ExecStart=/bin/echo "OpenHarmony Distributed Data Service"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
[Unit]
Description=OpenHarmony Distributed Schedule service
Requires=appspawn.service
After=appspawn.service
[Service]
Type=exec
# should run as system:system
ExecStart=/usr/bin/sa_main /system/profile/distributedsched.xml
Type=oneshot
ExecStart=/bin/echo "OpenHarmony Distributed Schedule Service"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
[Unit]
Description=OpenHarmony DSoftBus services
Requires=appspawn.service
After=appspawn.service
[Service]
Type=exec
# should run as system:system
ExecStart=/usr/bin/sa_main /system/profile/softbus_server.xml
Type=oneshot
ExecStart=/bin/echo "OpenHarmony DSoftBus Service"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
[Unit]
Description=OpenHarmony FaultLogger daemon
Requires=openharmony-preinit.service
After=openharmony-preinit.service
[Service]
Type=exec
ExecStartPre=install -m 775 -d /data/log/faultlog /data/log/faultlog/faultlogger /data/log/faultlog/temp/
ExecStart=/usr/bin/faultloggerd
Type=oneshot
ExecStart=/bin/echo "OpenHarmony FaultLogger Service"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
[Unit]
Description=OpenHarmony foundation service
[Service]
Type=oneshot
ExecStart=/bin/echo "OpenHarmony foundation Service"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
[Unit]
Description=OpenHarmony Device Connector Daemon service
[Service]
Type=oneshot
ExecStart=/bin/echo "OpenHarmony Device Connector Daemon Service"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
[Unit]
Description=OpenHarmony hilog daemon
Requires=param.service
After=param.service
[Service]
Type=exec
ExecStartPre=mkdir -p /dev/unix/socket
ExecStartPre=mkdir -p /data/log/hilog
ExecStart=/usr/bin/hilogd
Type=oneshot
ExecStart=/bin/echo "OpenHarmony hilog Service"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
[Unit]
Description=OpenHarmony huks service
Requires=appspawn.service
After=appspawn.service
[Service]
Type=exec
# should run as system:system
ExecStart=/usr/bin/sa_main /system/profile/huks_service.xml
Type=oneshot
ExecStart=/bin/echo "OpenHarmony Huks Service"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
[Unit]
Description=OpenHarmony input method services
Requires=appspawn.service
After=appspawn.service
[Service]
Type=exec
# should run as system:system
ExecStart=/usr/bin/sa_main /system/profile/inputmethod_service.xml
Type=oneshot
ExecStart=/bin/echo "OpenHarmony Input Method Service"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
[Unit]
Description=OpenHarmony Installs service
Requires=samgr.service
After=samgr.service
[Service]
Type=exec
# Delay execution by 2 secs after samgr.service
ExecStartPre=/bin/sleep 2
ExecStart=/usr/bin/installs
Type=oneshot
ExecStart=/bin/echo "OpenHarmony Installs Service"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
[Unit]
Description=OpenHarmony media service
[Service]
Type=oneshot
ExecStart=/bin/echo "OpenHarmony Media Service"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
......@@ -82,3 +82,231 @@ chmod 666 /dev/binder
if [ -c /dev/dri/card0 ]; then
chmod 666 /dev/dri/card0
fi
install -m 755 -d /dev/unix/socket
export XDG_RUNTIME_DIR=/data/weston
export XKB_CONFIG_ROOT=/etc/openharmony/xkb
export XKB_CONFIG_EXTRA_PATH=/etc/openharmony/xkb
STARTUP_CMD_SLEEP=2
# trigger: part of the init process itself
if systemctl -q is-enabled param.service; then
/system/bin/param_service &
sleep "$STARTUP_CMD_SLEEP"
fi
# - pre-init stage
# - init stage
if systemctl -q is-enabled samgr.service; then
/system/bin/samgr &
sleep "$STARTUP_CMD_SLEEP"
fi
# - post-init stage
# - "trigger early-fs",
# - "trigger fs",
# - "trigger post-fs",
# - "trigger late-fs",
# - "trigger post-fs-data",
# - "trigger load_persist_props_action",
# - "trigger firmware_mounts_complete",
# - "trigger early-boot",
# - "trigger boot"
# trigger: post-fs
# "start udevd_service",
# "sleep 1",
# "start multimodalinputservice",
# "start mmi_uinput_service",
# "sleep 2",
# "export XDG_RUNTIME_DIR /data/weston",
# "export XKB_CONFIG_ROOT /etc/xkb",
# "export XKB_CONFIG_EXTRA_PATH /etc/xkb",
# "mkdir /data/weston",
# "chmod 777 /data/weston",
# "start weston",
# "trigger weston_start",
# "sleep 2",
# "exec /system/bin/udevadm trigger",
# "exec /system/bin/udevadm settle --timeout=30"
if systemctl -q is-enabled weston.service; then
/system/bin/weston -c /system/etc/weston.ini -B drm-backend.so --tty=1 --use-pixman &
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: late-fs
# "name" : "installs",
# "path" : ["/system/bin/installs"],
# "importance" : -20,
# "uid" : "root",
# "gid" : ["root"]
if systemctl -q is-enabled installs.service; then
/system/bin/installs & # saId 511
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: late-fs
# "name" : "appspawn",
# "path" : ["/system/bin/appspawn"],
# "importance" : -20,
# "uid" : "root",
# "gid" : ["root"]
if systemctl -q is-enabled appspawn.service; then
/system/bin/appspawn & # SA: 1401 180 3703 3008
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: post-fs-data
# "mkdir /data/log/ 0770 system log",
# "mkdir /data/log/hilog/ 0750 logd log",
# "uid" : "logd",
# "gid" : "log",
# "socket" : [
# "hilogInput dgram 0666 logd logd passcred",
# "hilogControl seqpacket 0600 logd logd false"
# ]
if systemctl -q is-enabled hilogd.service; then
/system/bin/hilogd &
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: post-fs-data
# "name" : "huks_service",
# "path" : ["/system/bin/sa_main", "/system/profile/huks_service.xml"],
# "uid" : "system",
# "gid" : ["system", "shell"]
if systemctl -q is-enabled huks.service; then
/system/bin/sa_main /system/profile/huks_service.xml & # SA: 3510
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: post-fs-data
# "name" : "deviceauth_service",
# "path" : ["/system/bin/deviceauth_service"],
# "uid" : "system",
# "gid" : ["system", "shell"]
if systemctl -q is-enabled deviceauth.service; then
/system/bin/deviceauth_service & # SA: 4701 | Required SA: 3510
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: post-fs-data
# "name" : "accountmgr",
# "path" : ["/system/bin/sa_main", "/system/profile/accountmgr.xml"],
# "uid" : "system",
# "gid" : ["system", "shell"],
# "writepid" : [
# "/dev/cpuset/foreground/tasks",
# "/dev/stune/foreground/tasks",
# "/dev/blkio/foreground/tasks"
# ]
if systemctl -q is-enabled accountmgr.service; then
/system/bin/sa_main /system/profile/accountmgr.xml & # SA: 200
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: post-fs-data
# "name" : "softbus_server",
# "path" : ["/system/bin/sa_main", "/system/profile/softbus_server.xml"],
# "uid" : "system",
# "gid" : ["system", "shell"]
if systemctl -q is-enabled dsoftbus.service; then
/system/bin/sa_main /system/profile/softbus_server.xml & # SA: 1401 4700 | Required SA: 3299
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: not used?
#sa_main /system/profile/dps_service.xml & # SA: 1401 180 3502
#sleep "$STARTUP_CMD_SLEEP"
# trigger: post-fs-data
# "name" : "distributedsched",
# "path" : ["/system/bin/sa_main", "/system/profile/distributedsched.xml"],
# "uid" : "system",
# "gid" : ["system", "shell"]
if systemctl -q is-enabled distributedsched.service; then
/system/bin/sa_main /system/profile/distributedsched.xml & # SA: 1401
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: boot
# "name" : "distributeddata",
# "path" : ["/system/bin/sa_main","/system/profile/distributeddata.xml"],
# "caps" : ["DAC_READ_SEARCH"],
# "uid" : "system",
# "gid" : ["system","shell","readproc"],
# "writepid":[
# "/dev/cpuset/foreground/tasks",
# "/dev/stune/foreground/tasks",
# "/dev/blkio/foreground/tasks"
# ]
if systemctl -q is-enabled distributed_data.service; then
/system/bin/sa_main /system/profile/distributeddata.xml & # SA: 1301
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: boot
# "name" : "time_service",
# "path" : ["/system/bin/sa_main", "/system/profile/time_service.xml"],
# "uid" : "system",
# "gid" : ["system", "shell"],
# "caps" : ["SYS_TIME", "WAKE_ALARM"]
if systemctl -q is-enabled time.service; then
/system/bin/sa_main /system/profile/time_service.xml & # SA: 1401 180 3702
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: boot
# "name" : "foundation",
# "path" : ["/system/bin/sa_main", "/system/profile/foundation.xml"],
# "importance" : -20,
# "uid" : "system",
# "gid" : ["system"],
# "caps" : ["SYS_PTRACE", "KILL"]
if systemctl -q is-enabled foundation.service; then
/system/bin/sa_main /system/profile/foundation.xml & # SA: 180 182 3203 3299 3301 3308 3501 4010 | Required SA: 4700
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: boot
# "name" : "media_service",
# "path" : ["/system/bin/sa_main", "/system/profile/media_service.xml"],
# "uid" : "system",
# "gid" : ["media_rw", "system"]
if systemctl -q is-enabled media.service; then
/system/bin/sa_main /system/profile/media_service.xml &
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: boot
# "name" : "inputmethod_service",
# "path" : ["/system/bin/sa_main", "/system/profile/inputmethod_service.xml"],
# "uid" : "system",
# "gid" : ["system", "shell"],
# "caps" : ["SYS_TIME"]
if systemctl -q is-enabled inputmethod.service; then
/system/bin/sa_main /system/profile/inputmethod_service.xml & # SA: 180 1401 3703
sleep "$STARTUP_CMD_SLEEP"
fi
# trigger: boot?
# "name" : "hdcd",
# "path" : ["/system/bin/hdcd"],
# "socket" : [
# "hdcd seqpacket 660 system system false"
# ],
# "disabled" : 1
if systemctl -q is-enabled hdcd.service; then
setparam persist.hdc.port 35000
sleep "$STARTUP_CMD_SLEEP"
/system/bin/hdcd -t &
fi
if systemctl -q is-enabled faultloggerd.service; then
/usr/bin/install -m 775 -d /data/log/faultlog /data/log/faultlog/faultlogger /data/log/faultlog/temp/
/system/bin/faultloggerd &
fi
[Unit]
Description=OpenHarmony Param Service
Requires=openharmony-preinit.service
After=openharmony-preinit.service
[Service]
Type=exec
ExecStartPre=install -m 755 -d /dev/unix/socket
ExecStart=/usr/bin/param_service /system/etc/ohos.para
Type=oneshot
ExecStart=/bin/echo "OpenHarmony Param Service"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
[Unit]
Description=OpenHarmony SystemAbilityFramework service
Requires=param.service
After=param.service
[Service]
Type=exec
ExecStartPre=install -m 755 -d /data/sadata_se /data/sadata_se/samgr
ExecStart=/usr/bin/samgr
Type=oneshot
ExecStart=/bin/echo "OpenHarmony SystemAbilityFramework Service"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
[Unit]
Description=OpenHarmony Time service
Requires=appspawn.service
After=appspawn.service
[Service]
Type=exec
# should run as system:system
ExecStart=/usr/bin/sa_main /system/profile/time_service.xml
Type=oneshot
ExecStart=/bin/echo "OpenHarmony Time Service"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
[Unit]
Description=OpenHarmony Weston window manager service
[Service]
Type=oneshot
ExecStart=/bin/echo "OpenHarmony Weston Service"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
......@@ -499,11 +499,13 @@ RDEPENDS:${PN}-ptest += "${PN}-appspawn-ptest"
# //foundation/appexecfwk/standard component
PACKAGES =+ "${PN}-appexecfwk"
SYSTEMD_PACKAGES += "${PN}-appexecfwk"
SYSTEMD_SERVICE:${PN}-appexecfwk = "installs.service"
SYSTEMD_SERVICE:${PN}-appexecfwk = "installs.service foundation.service"
SRC_URI += "file://installs.service"
SRC_URI += "file://foundation.service"
do_install:append() {
install -d ${D}/${systemd_unitdir}/system
install -m 644 ${WORKDIR}/installs.service ${D}${systemd_unitdir}/system/
install -m 644 ${WORKDIR}/foundation.service ${D}${systemd_unitdir}/system/
rm -f ${D}${sysconfdir}/openharmony/init/installs.cfg
}
FILES:${PN}-appexecfwk = "\
......@@ -1299,7 +1301,15 @@ FILES:${PN}-graphic = " \
${libdir}/module/libdisplay*${SOLIBS} \
${libdir}/module/libwindow*${SOLIBS} \
${bindir}/bootanimation \
${systemd_unitdir}/weston.service \
"
SYSTEMD_PACKAGES += "${PN}-graphic"
SYSTEMD_SERVICE:${PN}-graphic = "weston.service"
SRC_URI += "file://weston.service"
do_install:append() {
install -d ${D}/${systemd_unitdir}/system
install -m 644 ${WORKDIR}/weston.service ${D}${systemd_unitdir}/system/
}
RDEPENDS:${PN}-graphic += "musl libcxx"
RDEPENDS:${PN}-graphic += "${PN}-multimodalinput ${PN}-hilog ${PN}-libutils ${PN}-thirdparty-weston ${PN}-thirdparty-wayland ${PN}-thirdparty-libffi ${PN}-thirdparty-libinput"
RDEPENDS:${PN}-graphic += "${PN}-graphic ${PN}-multimedia-media ${PN}-ipc ${PN}-display-gralloc ${PN}-samgr ${PN}-thirdparty-libdrm ${PN}-thirdparty-libevdev"
......@@ -1358,6 +1368,13 @@ FILES:${PN}-multimedia-media = " \
${libdir}/module/multimedia/libmedia*${SOLIBS} \
${libdir}/openharmony/profile/media_service.xml \
"
SYSTEMD_PACKAGES += "${PN}-multimedia-media"
SYSTEMD_SERVICE:${PN}-multimedia-media = "media.service"
SRC_URI += "file://media.service"
do_install:append() {
install -d ${D}/${systemd_unitdir}/system
install -m 644 ${WORKDIR}/media.service ${D}${systemd_unitdir}/system/
}
RDEPENDS:${PN}-multimedia-media += "musl libcxx"
RDEPENDS:${PN}-multimedia-media += "${PN}-hilog ${PN}-libutils ${PN}-ipc ${PN}-samgr ${PN}-safwk ${PN}-graphic ${PN}-peripheral-display"
RDEPENDS:${PN}-multimedia-media += "${PN}-multimedia-audio ${PN}-thirdparty-gstreamer ${PN}-thirdparty-glib ${PN}-syspara ${PN}-ace-napi"
......@@ -1718,7 +1735,17 @@ RDEPENDS:${PN}-ptest += "${PN}-distributedhardware-devicemanager-ptest"
# //developtools/hdc_standard
PACKAGES =+ "${PN}-hdc"
FILES:${PN}-hdc = "${bindir}/hdcd"
FILES:${PN}-hdc = " \
${bindir}/hdcd \
${systemd_unitdir}/hdcd.service \
"
SYSTEMD_PACKAGES += "${PN}-hdc"
SYSTEMD_SERVICE:${PN}-hdc = "hdcd.service"
SRC_URI += "file://hdcd.service"
do_install:append() {
install -d ${D}/${systemd_unitdir}/system
install -m 644 ${WORKDIR}/hdcd.service ${D}${systemd_unitdir}/system/
}
RDEPENDS:${PN}-hdc += "musl libcxx"
RDEPENDS:${PN}-hdc += "${PN}-libutils ${PN}-syspara libcrypto"
RDEPENDS:${PN} += "${PN}-hdc"
......
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