diff options
Diffstat (limited to 'meta-app-framework')
22 files changed, 102 insertions, 201 deletions
diff --git a/meta-app-framework/README b/meta-app-framework/README new file mode 120000 index 000000000..4a7a1a175 --- /dev/null +++ b/meta-app-framework/README @@ -0,0 +1 @@ +README-AGL.md
\ No newline at end of file diff --git a/meta-app-framework/README-AGL.md b/meta-app-framework/README-AGL.md new file mode 100644 index 000000000..bd0c2de8f --- /dev/null +++ b/meta-app-framework/README-AGL.md @@ -0,0 +1,31 @@ +Overview +======== + +The +[AGL Project](https://www.automotivelinux.org/) is an automotive-specific +development environment that provides a Linux distribution +[AGL UCB](https://www.automotivelinux.org/software/unified-code-base). + +AGL uses layers designed to be compatible with the +[Yocto Project](https://www.yoctoproject.org) and the +[OpenEmbedded Project (OE)](https://www.openembedded.org/wiki/Main_Page). + +This section provides information about the layers used by the AGL Project: + +* **`meta-agl/meta-app-framework`**: Application (lifecycle) manager + + ``` + $ git clone https://gerrit.automotivelinux.org/gerrit/AGL/meta-agl + ``` + +Maintenance +----------- + +All patches must be submitted via the AGL Gerrit instance at +<https://gerrit.automotivelinux.org>. See this wiki page for +details: + +<https://wiki.automotivelinux.org/agl-distro/contributing> + +Layer maintainers: +* Jan-Simon Möller <jsmoeller@linuxfoundation.org> diff --git a/meta-app-framework/classes/agl-app.bbclass b/meta-app-framework/classes/agl-app.bbclass index 6565fdfae..491a36e02 100644 --- a/meta-app-framework/classes/agl-app.bbclass +++ b/meta-app-framework/classes/agl-app.bbclass @@ -68,6 +68,14 @@ do_install:append () { Environment=AGL_APP_WAM_DIR=${AGL_APP_WAM_DIR} EOF fi + + if [ "${AGL_APP_TEMPLATE}" = "agl-app-flutter" ]; then + # Install icon if present + if [ -f ${S}/package/${AGL_APP_ID}.svg ]; then + install -d ${D}${datadir}/icons/hicolor/scalable + install -m 0644 ${S}/package/${AGL_APP_ID}.svg ${D}${datadir}/icons/hicolor/scalable/ + fi + fi } FILES:${PN}:append = " ${systemd_system_unitdir} ${datadir}/icons" diff --git a/meta-app-framework/conf/layer.conf b/meta-app-framework/conf/layer.conf index 10d458001..0fe82784b 100644 --- a/meta-app-framework/conf/layer.conf +++ b/meta-app-framework/conf/layer.conf @@ -9,5 +9,5 @@ BBFILE_COLLECTIONS += "meta-app-framework" BBFILE_PATTERN_meta-app-framework = "^${LAYERDIR}/" BBFILE_PRIORITY_meta-app-framework = "60" -LAYERSERIES_COMPAT_meta-app-framework = "kirkstone" -LAYERDEPENDS_meta-app-framework = "core aglcore" +LAYERSERIES_COMPAT_meta-app-framework = "scarthgap" +LAYERDEPENDS_meta-app-framework = "core aglcore openembedded-layer" diff --git a/meta-app-framework/recipes-config/agl-session/agl-session_0.1.bb b/meta-app-framework/recipes-config/agl-session/agl-session_0.1.bb deleted file mode 100644 index ecad1615d..000000000 --- a/meta-app-framework/recipes-config/agl-session/agl-session_0.1.bb +++ /dev/null @@ -1,46 +0,0 @@ -SUMMARY = "AGL user session" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" - -SRC_URI = "\ - file://agl-session@.service \ - file://agl-session.target \ - file://50-xdg-data-dirs.sh \ -" - -inherit systemd allarch useradd - -USERADD_PACKAGES = "${PN}" -USERADDEXTENSION = "useradd-staticids" -GROUPADD_PARAM:${PN} = "\ - --system display ; \ - --system video ; \ - --system pipewire ; \ - -g 1001 agl-driver ; \ -" -USERADD_PARAM:${PN} = "\ - -g 1001 -u 1001 -G video,display,pipewire -o -d /home/agl-driver -m -K PASS_MAX_DAYS=-1 agl-driver ; \ -" - -SYSTEMD_PACKAGES = "${PN}" -# Instantiate session for the 'agl-driver' user, so we don't have to hardcode -# the user name/ID in the service file itself -SYSTEMD_SERVICE:${PN} = "agl-session@agl-driver.service" -SYSTEMD_AUTO_ENABLE:${PN} = "enable" - -do_install() { - install -d ${D}${systemd_system_unitdir} - install -m 0644 ${WORKDIR}/agl-session@.service ${D}${systemd_system_unitdir} - - install -d ${D}${systemd_user_unitdir} - install -m 0644 ${WORKDIR}/agl-session.target ${D}${systemd_user_unitdir} - - install -d ${D}${libdir}/systemd/user-environment-generators - install -m 0755 ${WORKDIR}/50-xdg-data-dirs.sh ${D}${libdir}/systemd/user-environment-generators/ -} - -FILES:${PN} += " \ - ${systemd_system_unitdir} \ - ${systemd_user_unitdir} \ - ${libdir}/systemd/user-environment-generators/ \ -" diff --git a/meta-app-framework/recipes-config/agl-session/files/50-xdg-data-dirs.sh b/meta-app-framework/recipes-config/agl-session/files/50-xdg-data-dirs.sh deleted file mode 100644 index 15ec3744a..000000000 --- a/meta-app-framework/recipes-config/agl-session/files/50-xdg-data-dirs.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# use a default value if not already set -XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share/:/usr/share}" - -# write our output -echo "XDG_DATA_DIRS=${XDG_DATA_DIRS}" diff --git a/meta-app-framework/recipes-config/agl-session/files/agl-session.target b/meta-app-framework/recipes-config/agl-session/files/agl-session.target deleted file mode 100644 index 84d9daa5b..000000000 --- a/meta-app-framework/recipes-config/agl-session/files/agl-session.target +++ /dev/null @@ -1,5 +0,0 @@ -[Unit] -Description=AGL user session - -BindsTo=graphical-session.target -Before=graphical-session.target diff --git a/meta-app-framework/recipes-config/agl-session/files/agl-session@.service b/meta-app-framework/recipes-config/agl-session/files/agl-session@.service deleted file mode 100644 index 61afa4141..000000000 --- a/meta-app-framework/recipes-config/agl-session/files/agl-session@.service +++ /dev/null @@ -1,24 +0,0 @@ -[Unit] -Description=AGL user session -After=systemd-user-sessions.service -Wants=dbus.socket -After=dbus.socket -After=session-c1.scope -Before=multi-user.target - -[Service] -Environment=XDG_SESSION_TYPE=wayland -ExecStart=/bin/systemctl --wait --user start agl-session.target -TimeoutStartSec=30 -# This is a template service, instantiate for desired user's name or uid -User=%i -PAMName=login -WorkingDirectory=~ -StandardInput=tty-fail -StandardOutput=journal -StandardError=journal -Restart=always -RestartSec=3s - -[Install] -WantedBy=multi-user.target diff --git a/meta-app-framework/recipes-config/polkit-rule-agl-app/files/50-agl-app.rules b/meta-app-framework/recipes-config/polkit-rule-agl-app/files/50-agl-app.rules index dd4b6940d..35b9559c5 100644 --- a/meta-app-framework/recipes-config/polkit-rule-agl-app/files/50-agl-app.rules +++ b/meta-app-framework/recipes-config/polkit-rule-agl-app/files/50-agl-app.rules @@ -1,7 +1,7 @@ polkit.addRule(function(action, subject) { if (action.id == "org.freedesktop.systemd1.manage-units" && action.lookup("unit").indexOf("agl-app") == 0 && - subject.user == "agl-driver") { + subject.isInGroup("applaunchd")) { return polkit.Result.YES; } }); diff --git a/meta-app-framework/recipes-config/polkit-rule-agl-app/polkit-rule-agl-app.bb b/meta-app-framework/recipes-config/polkit-rule-agl-app/polkit-rule-agl-app.bb index 920bb86b3..57dda7787 100644 --- a/meta-app-framework/recipes-config/polkit-rule-agl-app/polkit-rule-agl-app.bb +++ b/meta-app-framework/recipes-config/polkit-rule-agl-app/polkit-rule-agl-app.bb @@ -6,11 +6,16 @@ SRC_URI = "file://50-agl-app.rules" DEPENDS += "polkit" -inherit features_check +inherit useradd features_check REQUIRED_DISTRO_FEATURES = "polkit" do_install() { - install -m 700 -d ${D}${sysconfdir}/polkit-1/rules.d - chown polkitd:root ${D}/${sysconfdir}/polkit-1/rules.d - install -m 0644 ${WORKDIR}/50-agl-app.rules ${D}${sysconfdir}/polkit-1/rules.d + install -m 700 -d ${D}${datadir}/polkit-1/rules.d + chown polkitd:root ${D}/${datadir}/polkit-1/rules.d + install -m 0644 ${WORKDIR}/50-agl-app.rules ${D}${datadir}/polkit-1/rules.d } + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM:${PN} += "--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 polkitd;" + +FILES:${PN} += "${datadir}/polkit-1/rules.d/*.rules" diff --git a/meta-app-framework/recipes-core/applaunchd/applaunchd/agl-app-flutter@.service b/meta-app-framework/recipes-core/applaunchd/applaunchd/agl-app-flutter@.service index c69c1862e..a9a2527e0 100644 --- a/meta-app-framework/recipes-core/applaunchd/applaunchd/agl-app-flutter@.service +++ b/meta-app-framework/recipes-core/applaunchd/applaunchd/agl-app-flutter@.service @@ -4,5 +4,9 @@ Description=%I [Service] Type=simple User=agl-driver +Environment=FLUTTER_VERSION=3.3.7 +Environment=FLUTTER_RUNTIME=release +EnvironmentFile=-/etc/default/flutter +EnvironmentFile=-/etc/default/%I Environment=XDG_RUNTIME_DIR=/run/user/1001/ -ExecStart=/usr/bin/flutter-auto --b=/usr/share/flutter/%I --xdg-shell-app-id=%I +ExecStart=/usr/bin/flutter-auto --b=/usr/share/flutter/%I/${FLUTTER_VERSION}/${FLUTTER_RUNTIME} --xdg-shell-app-id=%I diff --git a/meta-app-framework/recipes-core/applaunchd/applaunchd/agl-app-web@.service b/meta-app-framework/recipes-core/applaunchd/applaunchd/agl-app-web@.service index 3b736a5d2..e0353b6ae 100644 --- a/meta-app-framework/recipes-core/applaunchd/applaunchd/agl-app-web@.service +++ b/meta-app-framework/recipes-core/applaunchd/applaunchd/agl-app-web@.service @@ -4,7 +4,8 @@ Description=%I [Service] Type=simple User=agl-driver +EnvironmentFile=-/etc/default/WebAppMgr.env Environment=XDG_RUNTIME_DIR=/run/user/1001/ Environment=AGL_APP_WAM_DIR=%I -ExecStart=/usr/bin/WebAppMgr --appid=%I --app-install-dir=/usr/lib/wam_apps/${AGL_APP_WAM_DIR}/ +ExecStart=/usr/bin/WebAppMgrCli --appid=%I --app-install-dir=/usr/lib/wam_apps/${AGL_APP_WAM_DIR}/ diff --git a/meta-app-framework/recipes-core/applaunchd/applaunchd/applaunchd.service b/meta-app-framework/recipes-core/applaunchd/applaunchd/applaunchd.service new file mode 100644 index 000000000..73d36bd0c --- /dev/null +++ b/meta-app-framework/recipes-core/applaunchd/applaunchd/applaunchd.service @@ -0,0 +1,13 @@ +[Unit] +Wants=network.target polkit.service +After=network.target polkit.service + +[Service] +Type=notify +User=applaunchd +Environment=XDG_DATA_DIRS=/usr/share +ExecStart=/usr/bin/applaunchd +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/meta-app-framework/recipes-core/applaunchd/applaunchd_git.bb b/meta-app-framework/recipes-core/applaunchd/applaunchd_git.bb index e6439c3dd..c1bafad8e 100644 --- a/meta-app-framework/recipes-core/applaunchd/applaunchd_git.bb +++ b/meta-app-framework/recipes-core/applaunchd/applaunchd_git.bb @@ -8,6 +8,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=ae6497158920d9524cf208c09cc4c984" DEPENDS = " \ glib-2.0 \ glib-2.0-native \ + protobuf-native \ + grpc-native \ + grpc \ systemd \ " @@ -15,21 +18,34 @@ PV = "2.0+git${SRCPV}" SRC_URI = " \ git://gerrit.automotivelinux.org/gerrit/src/applaunchd;protocol=https;branch=${AGL_BRANCH} \ + file://applaunchd.service \ file://agl-app@.service \ file://agl-app-web@.service \ file://agl-app-flutter@.service \ file://no-network.conf \ file://private-tmp.conf \ " -SRCREV = "c675bafdf15cc19276bd8276c34f56404a5ecb62" +SRCREV = "c32fe42f40d0af8b31b6113a3140f52b83be7769" S = "${WORKDIR}/git" -inherit meson pkgconfig +inherit meson pkgconfig systemd useradd features_check + +REQUIRED_DISTRO_FEATURES = "systemd polkit" + +USERADD_PACKAGES = "${PN}" +USERADDEXTENSION = "useradd-staticids" +GROUPADD_PARAM:${PN} = "-g 1003 applaunchd ; " +USERADD_PARAM:${PN} = "\ + -g 1003 -u 1003 -o -d / -K PASS_MAX_DAYS=-1 applaunchd ; \ +" + +SYSTEMD_SERVICE:${PN} = "applaunchd.service" do_install:append() { # Install generic template for all agl-app services install -d ${D}${systemd_system_unitdir} + install -m 644 ${WORKDIR}/applaunchd.service ${D}${systemd_system_unitdir}/ install -m 644 ${WORKDIR}/agl-app@.service ${D}${systemd_system_unitdir}/ install -m 644 ${WORKDIR}/agl-app-web@.service ${D}${systemd_system_unitdir}/ install -m 644 ${WORKDIR}/agl-app-flutter@.service ${D}${systemd_system_unitdir}/ @@ -42,7 +58,7 @@ do_install:append() { PACKAGE_BEFORE_PN += "${PN}-template-agl-app ${PN}-template-agl-app-web ${PN}-template-agl-app-flutter" -FILES:${PN} += "${systemd_system_unitdir} ${datadir}/dbus-1/" +FILES:${PN} += "${systemd_system_unitdir}" FILES:${PN}-template-agl-app = "${systemd_system_unitdir}/agl-app@.service" @@ -51,7 +67,7 @@ FILES:${PN}-template-agl-app-web = "${systemd_system_unitdir}/agl-app-web@.servi FILES:${PN}-template-agl-app-flutter = "${systemd_system_unitdir}/agl-app-flutter@.service" RDEPENDS:${PN} += " \ - agl-session \ + agl-users \ polkit-rule-agl-app \ " diff --git a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init.bbappend b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init.bbappend deleted file mode 100644 index 70cbaabe2..000000000 --- a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init.bbappend +++ /dev/null @@ -1 +0,0 @@ -require ${@bb.utils.contains('AGL_FEATURES', 'agl-app-fw', 'agl-compositor-init_agl-app-fw.inc', '', d)} diff --git a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf deleted file mode 100644 index 66778a91b..000000000 --- a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -ConditionPathExists=/dev/tty7 - -[Service] -Environment=XDG_SESSION_TYPE=wayland -TTYPath=/dev/tty7 -TTYReset=yes -TTYVHangup=yes -TTYVTDisallocate=yes -UtmpIdentifier=tty7 -UtmpMode=user diff --git a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service.in b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service.in deleted file mode 100644 index fd56c7c3e..000000000 --- a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service.in +++ /dev/null @@ -1,29 +0,0 @@ -# -# Weston must be built with systemd support, and your weston.ini must load -# the plugin systemd-notify.so. - -[Unit] -Description=agl-compositor, a Wayland compositor, as a systemd user service -Documentation=https://docs.automotivelinux.org/en/master/#5_Component_Documentation/1_agl-compositor/ - -# Activate using a systemd socket -Requires=agl-compositor.socket -After=agl-compositor.socket - -# Since we are part of the agl session, make sure we are started before -# it is complete. -Before=agl-session.target - -[Service] -Type=notify -EnvironmentFile=-/etc/default/agl-compositor -ExecStart=/usr/bin/agl-compositor @AGL_COMPOSITOR_ARGS@ - -TimeoutStartSec=60 -WatchdogSec=20 - -StandardOutput=journal -StandardError=journal - -[Install] -WantedBy=agl-session.target diff --git a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket deleted file mode 100644 index ef9769ff7..000000000 --- a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket +++ /dev/null @@ -1,10 +0,0 @@ -# -# Weston must be built with systemd support, and your weston.ini must load -# the plugin systemd-notify.so. - -[Unit] -Description=agl-compositor, a Wayland compositor, as a systemd user service -Documentation=https://docs.automotivelinux.org/en/master/#5_Component_Documentation/1_agl-compositor/ - -[Socket] -ListenStream=%t/wayland-0 diff --git a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init_agl-app-fw.inc b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init_agl-app-fw.inc deleted file mode 100644 index b97a537d5..000000000 --- a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init_agl-app-fw.inc +++ /dev/null @@ -1,47 +0,0 @@ -FILESEXTRAPATHS:prepend := "${THISDIR}/agl-compositor-init:" - -SRC_URI = " \ - file://agl-compositor.conf \ - file://agl-compositor.service.in \ - file://agl-compositor.socket \ - " - -# Reset systemd services list -SYSTEMD_SERVICE:${PN} = "" - -do_install() { - # Process ".in" files - files=agl-compositor.service.in - for f in ${files}; do - g=${f%.in} - if [ "${f}" != "${g}" ]; then - sed -e "s,@AGL_COMPOSITOR_ARGS@,${AGL_COMPOSITOR_ARGS},g" \ - ${WORKDIR}/${f} > ${WORKDIR}/${g} - fi - done - - install -d ${D}${systemd_system_unitdir}/agl-session@agl-driver.service.d - install -m 0644 ${WORKDIR}/agl-compositor.conf \ - ${D}${systemd_system_unitdir}/agl-session@agl-driver.service.d/agl-compositor.conf - - install -D -p -m0644 ${WORKDIR}/agl-compositor.service ${D}${systemd_user_unitdir}/agl-compositor.service - install -D -p -m0644 ${WORKDIR}/agl-compositor.socket ${D}${systemd_user_unitdir}/agl-compositor.socket - - # Enable the compositor as part of the user session - install -d ${D}${systemd_user_unitdir}/agl-session.target.wants - ln -s ../agl-compositor.service ${D}${systemd_user_unitdir}/agl-session.target.wants/agl-compositor.service -} - -FILES:${PN} = "\ - ${systemd_system_unitdir} \ - ${systemd_user_unitdir} \ -" - -RDEPENDS:${PN} = " \ - agl-compositor \ - agl-shell-activator \ - agl-session \ - weston-ini \ -" - -RCONFLICTS:${PN} = "weston-init" diff --git a/meta-app-framework/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-app-framework/recipes-graphics/wayland/weston-ini-conf.bbappend deleted file mode 100644 index 699275fe8..000000000 --- a/meta-app-framework/recipes-graphics/wayland/weston-ini-conf.bbappend +++ /dev/null @@ -1 +0,0 @@ -require ${@bb.utils.contains('AGL_FEATURES', 'agl-app-fw', 'weston-ini-conf_agl-app-fw.inc', '', d)} diff --git a/meta-app-framework/recipes-graphics/wayland/weston-ini-conf_agl-app-fw.inc b/meta-app-framework/recipes-graphics/wayland/weston-ini-conf_agl-app-fw.inc deleted file mode 100644 index 25213a9f1..000000000 --- a/meta-app-framework/recipes-graphics/wayland/weston-ini-conf_agl-app-fw.inc +++ /dev/null @@ -1,3 +0,0 @@ -RDEPENDS:${PN} = "" -RDEPENDS:${PN}-landscape = "" -RDEPENDS:${PN}-landscape-inverted = "" diff --git a/meta-app-framework/scripts/run-yocto-check-layer.sh b/meta-app-framework/scripts/run-yocto-check-layer.sh index 62377d34e..cbe35ed8d 100755 --- a/meta-app-framework/scripts/run-yocto-check-layer.sh +++ b/meta-app-framework/scripts/run-yocto-check-layer.sh @@ -19,19 +19,25 @@ AGL_FEATURES ?= "" AGL_EXTRA_IMAGE_FSTYPES ?= "" # important settings imported from poky-agl.conf -# we do not import -DISTRO_FEATURES:append = " systemd" +# we cannot import the distro config right away +# as the initial values are poky only till the layer +# is added in + +AGL_DEFAULT_DISTRO_FEATURES := "usrmerge largefile opengl wayland pam bluetooth bluez5 3g polkit" +DISTRO_FEATURES:append := " systemd wayland pam \${AGL_DEFAULT_DISTRO_FEATURES}" DISTRO_FEATURES_BACKFILL_CONSIDERED:append = " sysvinit" VIRTUAL-RUNTIME_init_manager = "systemd" EOF - -yocto-check-layer \ +yocto-check-layer --no-auto-dependency \ --dependency \ $AGLROOT/meta-agl/meta-agl-core \ + $AGLROOT/external/meta-openembedded/meta-oe \ -- \ $AGLROOT/meta-agl/meta-app-framework [ $? = 0 ] && rm -rf ${TMPROOT}/testbuild-ycl + +exit 0 |