From 41591d4f8c586aa801220fac0924556f406c58bd Mon Sep 17 00:00:00 2001 From: Jan-Simon Moeller Date: Tue, 8 Dec 2020 11:15:02 +0100 Subject: SPEC-3723: restructure meta-agl-demo All demo related components should be in here now. We keep the packagegroups on purpose for now to stay backward-compatible. v2: layer does pass yocto-check-layer, dependencies adapted v3: remove the dynamic-layer setup, use all-in-one approach v4: Fixed comments from Paul Barker. Tnx! v5: Removed wayland/weston/agl-compositor additions, except for demo specific weston-init bbappend Follow-up changes required later: - massaging packagegroups - scrub of recipes Bug-AGL: SPEC-3723 Signed-off-by: Jan-Simon Moeller Signed-off-by: Scott Murray Change-Id: I47cefd8c23d46b2cdd063470e3f7d97d5ad952d8 --- .../run-agl-postinsts/run-agl-postinsts | 48 ++++++++++++++++++++++ .../run-agl-postinsts/run-agl-postinsts.service | 17 ++++++++ .../run-agl-postinsts/run-agl-postinsts_1.0.bb | 46 +++++++++++++++++++++ .../run-agl-postinsts_1.0.bbappend | 1 + 4 files changed, 112 insertions(+) create mode 100755 recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts create mode 100644 recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts.service create mode 100644 recipes-devtools/run-agl-postinsts/run-agl-postinsts_1.0.bb create mode 100644 recipes-devtools/run-agl-postinsts/run-agl-postinsts_1.0.bbappend (limited to 'recipes-devtools/run-agl-postinsts') diff --git a/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts b/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts new file mode 100755 index 00000000..1d1a5a05 --- /dev/null +++ b/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts @@ -0,0 +1,48 @@ +#!/bin/sh +# +# Copyright 2017 IoT.bzh. + +# Author: Ronan Le Martret +# + +# The following script will run all the scriptlets found in #SYSCONFDIR#/agl-postinsts. + +agl_pi_dir="#SYSCONFDIR#/agl-postinsts" + +POSTINST_LOGGING=1 +LOGFILE=/var/log/agl-postinstall.log + +[ -e $LOGFILE ] && mv ${LOGFILE} ${LOGFILE}.old.$(date +%F--%H%M.%S) + +append_log=">>$LOGFILE 2>&1" + +exec_postinst_scriptlets() { + for i in `ls $agl_pi_dir`; do + i=$agl_pi_dir/$i + echo "Running postinst $i..." + [ "$POSTINST_LOGGING" = "1" ] && eval echo "Running postinst $i..." $append_log + if [ -x $i ]; then + eval sh -c $i $append_log + if [ $? -eq 0 ]; then + rm $i + else + echo "ERROR: postinst $i failed." + [ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i failed." $append_log + remove_agl_pi_dir=0 + fi + else + echo "ERROR: postinst $i do not exists or do not have execute permission." + [ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i do not exists or do not have execute permission." $append_log + remove_agl_pi_dir=0 + fi + done +} + +remove_agl_pi_dir=1 +exec_postinst_scriptlets +systemctl daemon-reload + +# since all postinstalls executed successfully, remove the postinstalls directory +if [ $remove_agl_pi_dir = 1 ]; then + rm -rf $agl_pi_dir +fi diff --git a/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts.service b/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts.service new file mode 100644 index 00000000..8f8667db --- /dev/null +++ b/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts.service @@ -0,0 +1,17 @@ +[Unit] +Description=Run pending agl postinsts +DefaultDependencies=no +After=#SYSTEMD_SERVICE_AFTER# +Before=#SYSTEMD_SERVICE_BEFORE# +ConditionPathExists=#SYSCONFDIR#/agl-postinsts + +[Service] +Type=oneshot +StandardOutput=journal+console +ExecStart=#SBINDIR#/run-agl-postinsts +ExecStartPost=#BASE_BINDIR#/systemctl disable run-agl-postinsts.service +RemainAfterExit=No +TimeoutSec=0 + +[Install] +WantedBy=multi-user.target diff --git a/recipes-devtools/run-agl-postinsts/run-agl-postinsts_1.0.bb b/recipes-devtools/run-agl-postinsts/run-agl-postinsts_1.0.bb new file mode 100644 index 00000000..31503aa2 --- /dev/null +++ b/recipes-devtools/run-agl-postinsts/run-agl-postinsts_1.0.bb @@ -0,0 +1,46 @@ +SUMMARY = "Runs AGL postinstall scripts on first boot of the target device" +SECTION = "devel" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI = "file://run-agl-postinsts \ + file://run-agl-postinsts.service" + +S = "${WORKDIR}" + +inherit allarch systemd + +SYSTEMD_SERVICE_${PN} = "run-agl-postinsts.service" + +SYSTEMD_SERVICE_AFTER ?= "dbus.service cynagora.service" + +SYSTEMD_SERVICE_BEFORE ?= "systemd-user-sessions.service" + +do_configure() { + : +} + +do_compile () { + : +} + +do_install() { + install -d ${D}${sbindir} + install -m 0755 ${WORKDIR}/run-agl-postinsts ${D}${sbindir}/ + + install -d ${D}${systemd_unitdir}/system/ + install -m 0644 ${WORKDIR}/run-agl-postinsts.service ${D}${systemd_unitdir}/system/ + + sed -i -e 's:#SYSCONFDIR#:${sysconfdir}:g' \ + -e 's:#SBINDIR#:${sbindir}:g' \ + -e 's:#BASE_BINDIR#:${base_bindir}:g' \ + -e 's:#LOCALSTATEDIR#:${localstatedir}:g' \ + ${D}${sbindir}/run-agl-postinsts \ + ${D}${systemd_unitdir}/system/run-agl-postinsts.service + + sed -i -e 's:#SYSTEMD_SERVICE_AFTER#:${SYSTEMD_SERVICE_AFTER}:g' \ + -e 's:#SYSTEMD_SERVICE_BEFORE#:${SYSTEMD_SERVICE_BEFORE}:g' \ + ${D}${systemd_unitdir}/system/run-agl-postinsts.service +} + diff --git a/recipes-devtools/run-agl-postinsts/run-agl-postinsts_1.0.bbappend b/recipes-devtools/run-agl-postinsts/run-agl-postinsts_1.0.bbappend new file mode 100644 index 00000000..590ab708 --- /dev/null +++ b/recipes-devtools/run-agl-postinsts/run-agl-postinsts_1.0.bbappend @@ -0,0 +1 @@ +SYSTEMD_SERVICE_AFTER_append = " afm-system-daemon.service" -- cgit 1.2.3-korg