From 1c7d6584a7811b7785ae5c1e378f14b5ba0971cf Mon Sep 17 00:00:00 2001 From: takeshi_hoshina Date: Mon, 2 Nov 2020 11:07:33 +0900 Subject: basesystem-jj recipes --- meta-agl/.gitreview | 5 - meta-agl/LICENSE | 20 + meta-agl/LICENSE.GPL-2.0-only | 288 ++ meta-agl/LICENSE.MIT | 25 + meta-agl/README.md | 136 +- .../conf/include/agl-basesystem-base.inc | 2 +- meta-agl/meta-agl-basesystem/conf/layer.conf | 2 +- .../kernel-module-evklib-1.0.0/evk_lib.c | 36 + ...l_error-remover-gettid-inline-declaration.patch | 25 + .../ns-commonlibrary/ns-commonlibrary_1.0.0.bb | 5 +- meta-agl/meta-agl-bsp/LICENSE | 20 + meta-agl/meta-agl-bsp/LICENSE.GPL-2.0-only | 288 ++ meta-agl/meta-agl-bsp/LICENSE.MIT | 25 + .../classes/sdcard_image-socfpga.bbclass | 182 -- meta-agl/meta-agl-bsp/conf/include/agl_bbe.inc | 2 +- .../meta-agl-bsp/conf/include/agl_beaglebone.inc | 2 - meta-agl/meta-agl-bsp/conf/include/agl_cubox-i.inc | 3 - .../meta-agl-bsp/conf/include/agl_cyclone5.inc | 4 - .../meta-agl-bsp/conf/include/agl_dra7xx-evm.inc | 2 - meta-agl/meta-agl-bsp/conf/include/agl_ebisu.inc | 2 +- .../conf/include/agl_h3-salvator-x-nogfx.inc | 10 + .../conf/include/agl_h3-salvator-x.inc | 12 +- .../meta-agl-bsp/conf/include/agl_h3ulcb-nogfx.inc | 2 +- meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb.inc | 2 +- meta-agl/meta-agl-bsp/conf/include/agl_hsdk.inc | 1 - .../conf/include/agl_imx6qdlsabreauto.inc | 2 - .../conf/include/agl_imx8mqevk-common.inc | 19 + .../conf/include/agl_imx8mqevk-viv.inc | 1 + .../meta-agl-bsp/conf/include/agl_imx8mqevk.inc | 23 + .../conf/include/agl_intel-corei7-64.inc | 32 - .../conf/include/agl_m3-salvator-x-nogfx.inc | 10 + .../conf/include/agl_m3-salvator-x.inc | 9 + .../meta-agl-bsp/conf/include/agl_m3ulcb-nogfx.inc | 6 +- meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb.inc | 5 +- .../meta-agl-bsp/conf/include/agl_nitrogen6x.inc | 2 - .../meta-agl-bsp/conf/include/agl_qemux86-64.inc | 15 +- .../meta-agl-bsp/conf/include/agl_raspberrypi3.inc | 40 +- .../meta-agl-bsp/conf/include/agl_raspberrypi4.inc | 28 + .../meta-agl-bsp/conf/include/agl_rcar-nogfx.inc | 9 + meta-agl/meta-agl-bsp/conf/include/agl_rcar.inc | 50 + .../meta-agl-bsp/conf/include/agl_ulcb-nogfx.inc | 10 - meta-agl/meta-agl-bsp/conf/include/agl_ulcb.inc | 41 - meta-agl/meta-agl-bsp/conf/layer.conf | 2 +- .../conf/machine/include/rpi4-base.inc | 125 - .../meta-agl-bsp/conf/machine/raspberrypi4.conf | 37 - .../mesa/files/0001-kmsro-add-imx-dcss.patch | 34 + .../recipes-graphics/mesa/mesa_%.bbappend | 10 + .../recipes-graphics/wayland/weston-init.bbappend | 1 - .../recipes-kernel/linux/files/imx8mq-evkb.cfg | 1 + .../0001-enable-mhdp-with-etnaviv.patch | 23 + .../linux-fslc-imx/0002-dts-enable-etnaviv.patch | 23 + ...-fix-TS-cache-flushing-on-GPUs-with-BLT-e.patch | 151 + ...ed-Fix-passing-zero-to-PTR_ERR-warning-v2.patch | 50 + .../linux/linux-fslc-imx/etnaviv.cfg | 4 + .../recipes-kernel/linux/linux-fslc-imx_%.bbappend | 31 +- .../qt5/qtbase/0014-Add-IMX-GPU-support.patch | 17 - .../recipes-qt/qt5/qtbase_%.bbappend | 5 - .../wayland/weston-ini-conf.bbappend | 3 - .../linux-firmware/linux-firmware_git.bbappend | 0 .../linux/files/extra-graphic-devices.cfg | 40 - .../recipes-kernel/linux/files/fix_branch.scc | 3 - .../meta-intel/recipes-kernel/linux/files/lava.cfg | 3 - .../recipes-kernel/linux/files/net-devices.cfg | 2 - .../recipes-kernel/linux/files/security-tpm.cfg | 3 - .../recipes-kernel/linux/files/startup.nsh | 1 - .../recipes-kernel/linux/files/upsquare.cfg | 4 - .../recipes-kernel/linux/files/usb-devices.cfg | 82 - .../recipes-kernel/linux/linux-intel_%.bbappend | 1 - .../linux/linux-intel_4.19%.bbappend | 28 - .../aws-iot-device-sdk-embedded-c.bb | 40 + .../files/Makefile.aws | 62 + .../files/aws_iot_config.h | 58 + .../files/awsiotsdk.pc | 27 + .../azure-iot-sdk-c/azure-iot-sdk-c_%.bbappend | 5 + .../azure-macro-utils-c_%.bbappend | 1 + .../recipes-azure/umock-c/umock-c_%.bbappend | 1 + .../linux/linux-linaro-qcomlt_%.bbappend | 3 + .../linux/linux-linaro-qcomlt_4.14.bbappend | 3 - .../bootfiles/bcm2835-bootfiles.bbappend | 12 - .../recipes-bsp/bootfiles/bootfiles.bbappend | 1 + .../recipes-bsp/bootfiles/rpi-config_git.bbappend | 35 +- .../recipes-bsp/rpi-u-boot-scr/files/boot_xen.cmd | 45 + .../rpi-u-boot-scr/rpi-u-boot-scr.bbappend | 18 + ...dd-serial-and-revision-to-the-dev-2019.07.patch | 82 - ...onfigs-rpi4-Add-defconfigs-for-rpi4-32-64.patch | 104 - .../0002-ARM-bcm283x-Add-BCM283x_BASE-define.patch | 105 - ...-bcm283x-Define-configs-for-RaspberryPi-4.patch | 108 - ...-rpi-Add-entry-for-Raspberry-Pi-4-model-B.patch | 33 - ...-Include-definition-for-additional-emmc-c.patch | 30 - ...2835_sdhci-Add-support-for-bcm2711-device.patch | 53 - .../0007-rpi-Add-memory-map-for-bcm2838.patch | 62 - .../recipes-bsp/u-boot/u-boot-common.inc | 15 - .../recipes-bsp/u-boot/u-boot-fw-utils_2019.07.bb | 34 - .../u-boot/u-boot-fw-utils_2019.07.bbappend | 2 - .../recipes-bsp/u-boot/u-boot-rpi4-2019.07.inc | 12 - .../recipes-bsp/u-boot/u-boot-tools_2019.07.bb | 67 - .../meta-raspberrypi/recipes-bsp/u-boot/u-boot.inc | 333 --- .../recipes-bsp/u-boot/u-boot_2019.07.bb | 4 - .../recipes-bsp/u-boot/u-boot_2019.07.bbappend | 10 - ...-check-for-all-linux-host_os-combinations.patch | 42 - ...2-meson.build-make-TLS-GLX-optional-again.patch | 52 - ...0003-Allow-enable-DRI-without-DRI-drivers.patch | 46 - .../recipes-graphics/mesa/libglu_9.0.1.bb | 30 - .../0001-mesa-demos-Add-missing-data-files.patch | 624 ----- ...llow-to-disable-demos-which-require-GLEW-.patch | 377 --- ...4-Use-DEMOS_DATA_DIR-to-locate-data-files.patch | 234 -- .../0007-Install-few-more-test-programs.patch | 43 - ...dd-few-missing-.glsl-.vert-.frag-files-to.patch | 99 - ...glsl-perf-Install-.glsl-.vert-.frag-files.patch | 71 - ...OpenVG-demos-with-single-frame-need-eglSw.patch | 44 - .../0013-only-build-GLX-demos-if-needed.patch | 62 - .../recipes-graphics/mesa/mesa-demos_8.4.0.bb | 59 - .../recipes-graphics/mesa/mesa-gl_19.1.6.bb | 10 - .../recipes-graphics/mesa/mesa.inc | 267 -- .../recipes-graphics/mesa/mesa_%.bbappend | 2 - .../recipes-graphics/mesa/mesa_19.1.6.bb | 20 - .../recipes-graphics/userland/userland_%.bbappend | 4 - .../wayland/weston-ini-conf.bbappend | 4 - .../create-combined-dtb_1.0.0.bb | 3 +- ...55-sdio.txt-Follow-raspbian-change-for-bo.patch | 39 - .../linux-firmware-rpidistro_%.bbappend | 10 - .../files/0002-Disable-DMA-in-sdhci-driver.patch | 25 + .../files/0003-Fix-PCIe-in-dom0-for-RPi4.patch | 31 + .../recipes-kernel/linux/files/rpi-kernel-misc.cfg | 1 - .../recipes-kernel/linux/files/xen-be.cfg | 50 + .../linux/linux-raspberrypi/disable_kprobes.cfg | 1 - .../recipes-kernel/linux/linux-raspberrypi4.inc | 140 - .../linux/linux-raspberrypi_%.bbappend | 13 +- .../linux/linux-raspberrypi_4.14%.bbappend | 1 - .../recipes-kernel/linux/linux-raspberrypi_4.19.bb | 16 - .../linux/linux-raspberrypi_4.19.bbappend | 18 + .../recipes-bsp/arm-trusted-firmware | 1 + .../cogent-symlinks/recipes-bsp/si-tools | 1 + .../cogent-symlinks/recipes-bsp/ti-bt | 1 + .../cogent-symlinks/recipes-bsp/ti-bt-firmware | 1 + .../cogent-symlinks/recipes-bsp/u-boot | 1 + .../cogent-symlinks/recipes-graphics/cairo | 1 + .../cogent-symlinks/recipes-kernel/linux | 1 + .../cogent-symlinks/recipes-multimedia/gstreamer | 1 + .../meta-agl-bsp/meta-rcar-gen3-adas/conf/NOTES | 74 + .../conf/include/rcar-gen3-adas.inc | 13 + .../meta-rcar-gen3-adas/conf/layer.conf | 67 +- .../recipes-bsp/alsa-state/alsa-state.bbappend | 3 + .../recipes-bsp/si-tools/si-tools.bbappend | 20 + .../ti-bt-firmware/ti-bt-firmware_git.bbappend | 6 + ...ble-and-add-sound-hardware-abstraction_kf.patch | 58 + .../recipes-kernel/linux/linux-renesas_%.bbappend | 4 - .../gstvspfilter-h3ulcb_r8a7795.conf | 2 - .../gstvspfilter-m3ulcb_r8a7796.conf | 2 - .../gstreamer1.0-plugin-vspfilter_1.0.1.bbappend | 3 - .../meta-rcar-gen3/include/checksum_control.inc | 25 + .../include/checksum_control_files.inc | 15 + .../recipes-bsp/alsa-state/alsa-state.bbappend | 5 +- .../recipes-bsp/alsa-state/alsa-state/asound.state | 10 +- .../bootfiles/files/uEnv-ota-h3-salvator-x.txt | 18 + .../bootfiles/files/uEnv-ota-h3ulcb.txt | 2 +- .../bootfiles/files/uEnv-ota-m3-salvator-x.txt | 18 + .../bootfiles/files/uEnv-ota-m3ulcb.txt | 2 +- .../recipes-bsp/bootfiles/renesas-ota-bootfiles.bb | 7 +- ...ure_storage-ta-Add-a-missing-include-file.patch | 29 + .../recipes-bsp/optee/optee-examples_git.bb | 61 + .../recipes-bsp/optee/optee-os_git.bbappend | 7 + .../optee/optee-test/optee_xtest_fix.diff | 13 + .../recipes-bsp/optee/optee-test_git.bb | 55 + .../optee/optee-user-app-template_git.bb | 57 + .../gles-module/checksum_control.inc | 1 + .../gles-module/checksum_control_files.inc | 1 + .../gles-module/gles-user-module.bbappend | 1 + .../wayland/weston-ini-conf.bbappend | 5 +- .../wayland/weston-ini-conf/ebisu_output.cfg | 9 +- .../wayland/weston-ini-conf/kingfisher_output.cfg | 1 - .../wayland/weston-ini-conf/salvator-x_output.cfg | 12 + .../recipes-graphics/wayland/weston_%.bbappend | 1 - .../kernel-module-gles/checksum_control.inc | 1 + .../kernel-module-gles/checksum_control_files.inc | 1 + .../kernel-module-gles/kernel-module-gles.bbappend | 2 + .../kernel-module-uvcs/checksum_control.inc | 1 + .../kernel-module-uvcs/checksum_control_files.inc | 1 + .../kernel-module-uvcs-drv.bbappend | 2 + ...enable-and-add-sound-hardware-abstraction.patch | 44 - .../linux/files/r8a7796-m3ulcb-xen.dts | 91 + .../recipes-kernel/linux/files/xen-be.cfg | 1 + .../recipes-kernel/linux/linux-renesas_%.bbappend | 13 +- .../omx-module/checksum_control.inc | 1 + .../omx-module/checksum_control_files.inc | 1 + .../omx-module/omx-user-module.bbappend | 4 + .../meta-rcar-gen3/scripts/setup_mm_packages.sh | 8 +- .../wayland/weston-ini-conf.bbappend | 3 - .../recipes-kernel/linux-yocto_%.bbappend | 1 + .../recipes-kernel/linux/linux-arc_%.bbappend | 1 - ...eston-clients-typo-in-simple-dmabuf-egl.c.patch | 29 - ...v-seat-restrict-udev-enumeration-to-card0.patch | 37 - .../0002-Weston-Allow-visual_id-to-be-0.patch | 31 - ...virtual-keyboard-display-issue-for-QT5-ap.patch | 39 - ...virtual-keyboard-display-issue-for-QT5-ap.patch | 41 + .../0004-Weston-Fix-touch-screen-crash-issue.patch | 36 - .../0004-weston-Fix-touch-screen-crash-issue.patch | 39 + .../0005-weston-drm-fix-dual-display-issue.patch | 79 + .../meta-ti/recipes-arago/weston/weston_%.bbappend | 25 - .../recipes-arago/weston/weston_8.0.0.bbappend | 13 + .../0004-Change-Max-Device-Count-To-16.patch | 25 +- .../recipes-graphics/opencv/opencv_3.%.bbappend | 5 - .../recipes-graphics/opencv/opencv_4.%.bbappend | 5 + .../wayland/wayland-protocols_1.17.bb | 24 - .../recipes-graphics/wayland/weston-ini-conf.bb | 2 - .../wayland/weston-ini-conf.bbappend | 9 +- .../wayland/weston-ini-conf/core.cfg | 3 +- .../wayland/weston-ini-conf/id-agent.cfg | 3 - .../wayland/weston-ini-conf/ivishell.cfg | 3 - .../wayland/weston-ini-conf/remote-output.cfg | 5 + .../wayland/weston-ini-conf/virtualoutput.cfg | 5 - .../wayland/weston/0001-make-error-portable.patch | 78 - ...ch-Provide-a-default-version-that-doesn-t.patch | 173 -- .../recipes-graphics/wayland/weston/weston.desktop | 9 - .../recipes-graphics/wayland/weston/weston.png | Bin 2383 -> 0 bytes .../wayland/weston/xwayland.weston-start | 7 - .../recipes-graphics/wayland/weston_6.0.0.bb | 111 - ...n-smack_known_web-label-for-kernel-thread.patch | 49 - .../recipes-kernel/linux/linux-agl-4.14.inc | 1 + .../recipes-kernel/linux/linux-agl-4.19.inc | 5 + .../recipes-kernel/linux/linux-agl-4.9.inc | 8 - .../recipes-kernel/linux/linux-agl.inc | 48 +- .../recipes-kernel/linux/linux/ath9k_htc.cfg | 4 - .../recipes-kernel/linux/linux/can-bus.cfg | 1 + .../recipes-kernel/linux/linux/systemtap.cfg | 9 + .../recipes-kernel/linux/linux/wifi.cfg | 6 + .../linux/linux/x86-extra-graphic-devices.cfg | 40 + .../recipes-kernel/linux/linux/x86-net-devices.cfg | 3 + .../linux/linux/x86-security-tpm.cfg | 3 + .../recipes-kernel/linux/linux/x86-upsquare.cfg | 11 + .../recipes-kernel/linux/linux/x86-usb-devices.cfg | 82 + .../recipes-kernel/linux/linux/xen_domu.cfg | 25 + .../0007-WIP-Initial-LAVA-support.patch | 56 +- .../ptest-runner/ptest-runner_2.%.bbappend | 4 + .../ptest-runner/ptest-runner_2.2.bbappend | 4 - .../vboxguestdrivers/vboxguestdrivers_%.bbappend | 1 - ...-1GB-lmitation-workaround-XEN-tries-to-al.patch | 28 + .../recipes-extended/xen/xen-mkimage-rpi4.bb | 29 + .../recipes-extended/xen/xen-tools_git.bbappend | 11 + .../recipes-extended/xen/xen_git.bbappend | 18 + .../meta-agl-bsp/wic/systemd-joule-bootdisk.wks | 12 - meta-agl/meta-agl-distro/LICENSE | 20 + meta-agl/meta-agl-distro/LICENSE.GPL-2.0-only | 288 ++ meta-agl/meta-agl-distro/LICENSE.MIT | 25 + .../conf/distro/include/x86_64-tune.inc | 2 +- meta-agl/meta-agl-distro/conf/distro/poky-agl.conf | 51 +- meta-agl/meta-agl-distro/conf/layer.conf | 2 +- meta-agl/meta-agl-profile-cluster-qt5/LICENSE | 20 + .../LICENSE.GPL-2.0-only | 288 ++ meta-agl/meta-agl-profile-cluster-qt5/LICENSE.MIT | 25 + .../meta-agl-profile-cluster-qt5/conf/layer.conf | 2 +- .../images/agl-image-cluster-qt5.inc | 2 +- .../recipes-qt/qt5/qtbase_%.bbappend | 10 +- meta-agl/meta-agl-profile-cluster/LICENSE | 20 + .../meta-agl-profile-cluster/LICENSE.GPL-2.0-only | 288 ++ meta-agl/meta-agl-profile-cluster/LICENSE.MIT | 25 + meta-agl/meta-agl-profile-cluster/conf/layer.conf | 2 +- .../recipes-platform/images/agl-image-cluster.inc | 2 +- meta-agl/meta-agl-profile-core/LICENSE | 20 + .../meta-agl-profile-core/LICENSE.GPL-2.0-only | 288 ++ meta-agl/meta-agl-profile-core/LICENSE.MIT | 25 + .../conf/include/agl-devel.inc | 7 +- .../conf/include/agl-pulseaudio.inc | 1 - .../conf/include/agl-sign-wgts.inc | 3 + meta-agl/meta-agl-profile-core/conf/layer.conf | 2 +- .../agl-service-can-low-level_git.bb | 4 + .../agl-service-data-persistence_git.bb | 4 +- .../agl-service-identity-agent_git.bb | 2 +- .../agl-service-network/agl-service-network_git.bb | 8 +- .../agl-service-steering-wheel_0.1.bb | 14 - .../agl-service-unicens/agl-service-unicens_git.bb | 2 +- .../high-level-viwi-service.bb | 19 - ...t-notification-status-on-incoming-message.patch | 26 - .../bluez5/bluez5/bluetooth.service | 21 + .../bluez5/bluez5/obex.service | 10 + .../recipes-connectivity/bluez5/bluez5_%.bbappend | 7 +- .../recipes-connectivity/connman/connman.inc | 216 -- ...us-issues-which-cause-problems-under-musl.patch | 362 --- ...vice-stop-systemd-resolved-when-we-use-co.patch | 29 - ...ange-visibility-to-default-for-debug-symb.patch | 35 - ...resolve-musl-does-not-implement-res_ninit.patch | 85 - .../recipes-connectivity/connman/connman/connman | 83 - .../connman/connman/no-version-scripts.patch | 27 - .../recipes-connectivity/connman/connman_1.36.bb | 16 - .../recipes-connectivity/libnfc/libnfc_git.bb | 18 - .../recipes-connectivity/neardal/neardal_0.14.bb | 7 +- .../recipes-connectivity/rtl-sdr/rtl-sdr_0.5.3.bb | 2 +- .../recipes-core/glibc/.appends.core | 0 .../glibc/glibc/arm/local-arm-futex.diff | 22 - .../recipes-core/glibc/glibc_2.2%.bbappend | 3 - .../recipes-core/psplash/files/psplash-anim | 11 - .../psplash/files/psplash-quit.service | 11 - .../psplash/files/psplash-start.service | 12 - .../recipes-core/psplash/psplash_git.bbappend | 22 +- .../recipes-core/systemd/systemd-conf_%.bbappend | 4 + .../systemd/0001-fix-udevd-seclabel-parsing.patch | 34 + ...twork-add-CAN-Termination-tristate-option.patch | 97 - ...twork-add-CAN-Termination-tristate-option.patch | 107 + .../recipes-core/systemd/systemd_%.bbappend | 3 +- .../cmake-apps-module/cmake-apps-module_git.bb | 2 +- .../packagegroups/packagegroup-agl-core-devel.bb | 4 +- .../python/python3-asyncssh_2.3.0.bb | 15 + .../python/python3-pytest-dependency_0.5.1.bb | 12 + .../python/python3-pytest-reverse_1.0.1.bb | 12 + ...0001-most-aim-network-backport-Kernel-API.patch | 43 - ...1-handle-snd_pcm_lib_mmap_vmalloc-removal.patch | 22 +- .../files/0012-Fix-build-with-5.4-kernel.patch | 68 + .../recipes-kernel/most/most.bb | 2 +- .../recipes-kernel/most/most.bbappend | 22 +- .../pulseaudio/agl-audio-plugin_0.1.bb | 28 - ...01-install-files-for-a-module-development.patch | 70 - ...ume-ramp-additions-to-the-low-level-infra.patch | 564 ---- ...-ramp-adding-volume-ramping-to-sink-input.patch | 189 -- ...put-Code-cleanup-regarding-volume-ramping.patch | 62 - ...volume-Add-support-for-volume-ramp-factor.patch | 299 -- ...nput-Remove-pa_sink_input_set_volume_ramp.patch | 63 - .../pulseaudio-12.2/enable-ofono-hfp-backend.patch | 11 - .../pulseaudio/pulseaudio_%.bbappend | 29 - .../pulseaudio/pulseaudio_12.2.bbappend | 15 - .../images/agl-image-minimal-crosssdk.bb | 19 +- .../images/agl-image-minimal-crosssdk.inc | 18 + .../packagegroups/packagegroup-agl-core-boot.bb | 1 - .../packagegroup-agl-core-services.bb | 8 +- .../0001-replace-krb5-config-with-pkg-config.patch | 44 - .../recipes-support/curl/curl_7.66.0.bb | 80 - .../libmicrohttpd/libmicrohttpd_0.9.63.bb | 28 - .../recipes-support/nghttp2/nghttp2_1.39.1.bb | 15 - .../recipes-support/opencv/opencv_3.%.bbappend | 1 - .../recipes-support/opencv/opencv_4.%.bbappend | 1 + .../recipes-support/udisks/files/99-udisks2.rules | 5 + .../recipes-support/udisks/files/automount.service | 2 +- .../udisks/files/org.freedesktop.UDisks.conf | 32 - .../recipes-support/udisks/files/udisks.service | 11 - .../recipes-support/udisks/udisks2_%.bbappend | 26 + .../recipes-support/udisks/udisks_1.0.5.bbappend | 28 - .../recipes-test/afb-test/afb-test_git.bb | 4 +- .../recipes-test/fontconfig/fontconfig_%.bbappend | 9 +- .../recipes-test/freetype/freetype_2.%.bbappend | 34 + .../recipes-test/freetype/freetype_2.9.1.bbappend | 35 - .../recipes-test/pyagl/pyagl_git.bb | 29 + .../conf/layer.conf | 12 + .../wayland/weston-ini-conf.bbappend | 12 + .../wayland/weston-ini-conf/hdmi-a-1-180.cfg | 4 + .../wayland/weston-ini-conf/virtual-landscape.cfg | 3 + .../images/agl-image-graphical-html5.bb | 10 + .../images/agl-image-graphical-html5.inc | 9 + .../packagegroups/packagegroup-agl-appfw-html5.bb | 18 + .../packagegroup-agl-profile-graphical-html5.bb | 23 + .../chromium/chromium-browser-service.bb | 19 + .../chromium/chromium68/v8-qemu-wrapper.patch | 40 + .../recipes-wam/chromium/chromium68_git.bb | 404 +++ .../recipes-wam/chromium/gn-utils.inc | 157 ++ .../recipes-wam/wam/files/WebAppMgr.env | 202 ++ .../recipes-wam/wam/files/WebAppMgr@.service | 37 + .../recipes-wam/wam/files/trunc-webapp-roles.patch | 56 + .../recipes-wam/wam/wam_git.bb | 51 + meta-agl/meta-agl-profile-graphical-qt5/LICENSE | 20 + .../LICENSE.GPL-2.0-only | 288 ++ .../meta-agl-profile-graphical-qt5/LICENSE.MIT | 25 + .../meta-agl-profile-graphical-qt5/conf/layer.conf | 2 +- .../recipes-devtools/libqtappfw/libqtappfw_git.bb | 2 +- .../images/agl-image-graphical-qt5-crosssdk.bb | 39 +- .../images/agl-image-graphical-qt5-crosssdk.inc | 14 + .../images/agl-image-graphical-qt5.bb | 5 - .../images/agl-image-graphical-qt5.inc | 8 +- .../packagegroup-qt5-toolchain-target.bbappend | 5 - .../qlibwindowmanager/qlibwindowmanager_git.bb | 14 - .../recipes-qt/qt5/qtlocation_%.bbappend | 14 + .../recipes-qt/qt5/qtwayland-config/qtwayland | 12 + .../recipes-qt/qt5/qtwayland-config_1.0.0.bb | 21 + .../recipes-qt/qt5/qtwayland_%.bbappend | 1 - .../recipes-qt/qtaglextras/qtaglextras_git.bb | 28 - meta-agl/meta-agl-profile-graphical/LICENSE | 20 + .../LICENSE.GPL-2.0-only | 288 ++ meta-agl/meta-agl-profile-graphical/LICENSE.MIT | 25 + .../classes/agl-graphical.bbclass | 5 +- .../meta-agl-profile-graphical/conf/layer.conf | 2 +- .../agl-service-homescreen_git.bb | 2 +- .../agl-service-taskmanager.bb | 1 - .../agl-service-windowmanager_git.bb | 33 - .../files/weston-ready.conf | 4 - .../agl-desktop-config/agl-desktop-config_0.1.bb | 21 - .../agl-desktop-config/files/user-weston-term.path | 8 - .../files/user-weston-term.service | 12 - .../libwindowmanager/libwindowmanager_git.bb | 16 - .../recipes-graphics/runxdg/runxdg_git.bb | 16 - .../recipes-graphics/wayland/agl-compositor_git.bb | 10 +- .../0002-ivi-id-agent-added-ivi-id-agent.patch | 6 +- .../0006-fix-plugin-registry-include.patch | 13 + .../wayland/wayland-ivi-extension_git.bb | 1 + .../0001-Change-socket-mode-add-rw-for-group.patch | 14 +- ...ver-Fix-fake-Address-already-in-use-error.patch | 35 - .../recipes-graphics/wayland/wayland_%.bbappend | 1 - .../recipes-graphics/wayland/weston-init.bbappend | 41 +- .../wayland/weston-init/weston.conf.in | 21 +- .../wayland/weston-init/zz-dri.rules.in | 2 +- .../wayland/weston-init/zz-input.rules | 1 - .../wayland/weston-init/zz-input.rules.in | 1 + .../wayland/weston-init/zz-tty.rules.in | 2 +- .../wayland/weston-ready/weston-ready.service | 4 +- ...llow-regular-users-to-launch-Weston_2.0.0.patch | 39 - ...llow-regular-users-to-launch-Weston_7.0.0.patch | 51 + ...g-parser-Export-get_full_path-and-destroy.patch | 36 - ...-rework-goto-labels-to-avoid-memory-leaks.patch | 57 - ...-Expose-weston_output_damage-in-libweston.patch | 30 + ...shell-Fix-crash-due-no-transmitter-screen.patch | 2 +- .../weston/0002-ivi-shell-removed-assert.patch | 11 - ...-ivi-shell-introduction-of-IVI_INVALID_ID.patch | 20 - ...face-added-interface-to-change-surface-id.patch | 73 - ...ain-change-remoting-initialization-timing.patch | 40 + ...yout-introcuded-configure_desktop_changed.patch | 74 - ...t-introcuded-surface_create_and_configure.patch | 117 - ...inked-libweston-desktop-and-added-structs.patch | 74 - ...ayout-use-libweston-desktop-api-for-views.patch | 30 - ...dded-libweston-desktop-api_implementation.patch | 166 -- ...ivi-shell-remove-surface_destroy_listener.patch | 24 - ...l-create-weston-desktop-in_wet_shell_init.patch | 30 - ...r-register-for-desktop_surface_configured.patch | 133 - ...simple-egl-remove-ivi-application-support.patch | 165 -- ...simple-shm-remove-ivi-application-support.patch | 107 - ...dow-client-remove-ivi-application-support.patch | 130 - ...mpositor-add-output-type-to-weston_output.patch | 254 -- ...tor-drm-introduce-drm_get_dmafd_from_view.patch | 109 - ...-get-stride-from-drm_get_dma_fd_from_view.patch | 59 - .../recipes-graphics/wayland/weston/smack-weston | 8 + .../wayland/weston/use-XDG_RUNTIMESHARE_DIR.patch | 47 - .../recipes-graphics/wayland/weston_%.bbappend | 4 - .../recipes-graphics/wayland/weston_5.0.0.bbappend | 27 - .../recipes-graphics/wayland/weston_6.0.0.bbappend | 10 - .../recipes-graphics/wayland/weston_8.0.%.bbappend | 30 + ...-Install-wayland-header-from-gstwayland-l.patch | 28 + .../0001-install-wayland.h.patch | 33 - .../gstreamer1.0-plugins-bad_1.14.%.bbappend | 2 - .../gstreamer1.0-plugins-bad_1.16.%.bbappend | 2 + .../recipes-platform/images/agl-image-weston.inc | 2 +- .../packagegroup-agl-graphical-services.bb | 6 +- .../packagegroup-agl-graphical-weston.bb | 2 - .../security-manager/security-manager_%.bbappend | 6 + meta-agl/meta-agl-profile-hud/LICENSE | 20 + meta-agl/meta-agl-profile-hud/LICENSE.GPL-2.0-only | 288 ++ meta-agl/meta-agl-profile-hud/LICENSE.MIT | 25 + meta-agl/meta-agl-profile-hud/conf/layer.conf | 2 +- meta-agl/meta-agl-profile-telematics/LICENSE | 20 + .../LICENSE.GPL-2.0-only | 288 ++ meta-agl/meta-agl-profile-telematics/LICENSE.MIT | 25 + .../meta-agl-profile-telematics/conf/layer.conf | 2 +- .../images/agl-image-telematics.inc | 2 +- meta-agl/meta-agl.md | 22 - meta-agl/meta-agl/conf/layer.conf | 2 +- meta-agl/meta-app-framework/LICENSE | 20 + meta-agl/meta-app-framework/LICENSE.GPL-2.0-only | 288 ++ meta-agl/meta-app-framework/LICENSE.MIT | 25 + meta-agl/meta-app-framework/classes/aglwgt.bbclass | 198 +- .../conf/include/agl-appfw-smack.inc | 1 + meta-agl/meta-app-framework/conf/layer.conf | 2 +- .../recipes-core/af-binder/af-binder_git.inc | 2 +- .../recipes-core/af-main/af-main_git.bb | 8 +- .../recipes-core/af-main/af-main_git.inc | 7 +- .../recipes-core/af-main/nativesdk-af-main_git.bb | 1 + .../nss-localuser/nss-localuser_0.1.bb | 4 +- .../recipes-security/xmlsec1/xmlsec1_1.%.bbappend | 4 +- .../recipes-support/libzip/libzip_%.bbappend | 1 + .../recipes-support/libzip/libzip_1.1.1.bb | 32 - meta-agl/meta-netboot/LICENSE | 20 + meta-agl/meta-netboot/LICENSE.GPL-2.0-only | 288 ++ meta-agl/meta-netboot/LICENSE.MIT | 25 + meta-agl/meta-netboot/README | 2 +- meta-agl/meta-netboot/conf/layer.conf | 2 +- .../recipes-core/initramfs-netboot/files/init.sh | 2 +- .../meta-pipewire/conf/include/agl-pipewire.inc | 3 + meta-agl/meta-pipewire/conf/layer.conf | 12 + ...-gstreamer-helper-application-for-interco.patch | 517 ++++ .../bluez-alsa/bluealsa-gst-helper@.service | 18 + .../bluez-alsa/bluez-alsa_git.bbappend | 35 + .../packagegroups/packagegroup-pipewire.bb | 17 + .../agl-service-audiomixer_git.bb | 17 + .../pipewire/pipewire-conf-agl/client.env | 10 + .../pipewire/pipewire-conf-agl/pipewire.conf.in | 17 + .../pipewire/pipewire-conf-agl/server.env | 12 + .../pipewire/pipewire-conf-agl_git.bb | 43 + .../recipes-multimedia/pipewire/pipewire.inc | 120 + ...t-version-check-to-require-meson-0.47-not.patch | 30 + .../0002-arm-build-with-mno-unaligned-access.patch | 30 + ...nt-new-pwaudio-src-sink-elements-based-on.patch | 1280 +++++++++ ...t-always-assume-that-output-ports-are-NOT.patch | 35 + ...005-module-access-add-same-sec-label-mode.patch | 94 + ...ll-reuse_buffers-when-resetting-the-state.patch | 30 + ...lsa-Set-period_size-depending-on-hardware.patch | 35 + ...add-warning-in-case-of-partial-read-write.patch | 80 + ...9-alsa-adjust-delay-depending-on-hardware.patch | 64 + .../pipewire/pipewire/pipewire@.service | 24 + .../pipewire/pipewire/pipewire@.socket | 19 + .../pipewire/pipewire/smack-pipewire | 8 + .../recipes-multimedia/pipewire/pipewire_git.bb | 20 + .../pipewire/pipewire_git.bbappend | 30 + .../00-audio-sink.endpoint | 10 + .../00-audio-source.endpoint | 10 + .../00-default-input-audio.endpoint-link | 7 + .../00-default-output-audio.endpoint-link | 7 + .../00-stream-input-audio.endpoint | 9 + .../00-stream-output-audio.endpoint | 9 + .../01-hw00-audio-sink.endpoint | 12 + .../01-hw00-audio-source.endpoint | 12 + .../30-ak4613-audio-sink.endpoint | 12 + .../30-ak4613-audio-source.endpoint | 12 + .../30-dra7xx-audio-sink.endpoint | 12 + .../30-dra7xx-audio-source.endpoint | 12 + .../30-imx8mq-audio-sink.endpoint | 12 + .../30-rcarsound-audio-sink.endpoint | 12 + .../30-rcarsound-audio-source.endpoint | 12 + .../30-rpi3-audio-sink.endpoint | 13 + .../40-fiberdyne-amp.endpoint | 12 + .../40-microchip-mic.endpoint | 12 + .../70-usb-audio-sink.endpoint | 12 + .../70-usb-audio-source.endpoint | 12 + .../bluealsa-input-audio.endpoint-link | 11 + .../bluealsa-output-audio.endpoint-link | 11 + .../wireplumber-board-config-agl/capture.streams | 3 + .../wireplumber-board-config-agl/playback.streams | 31 + .../wireplumber-board-config-agl/wireplumber.conf | 30 + .../wireplumber-board-config-agl_git.bb | 58 + ...-Build-cpptoml-without-a-cmake-subproject.patch | 28 + .../wireplumber/wireplumber_git.bb | 46 + .../recipes-security/cynagora/cynagora_%.bbappend | 5 + .../security-manager/security-manager_%.bbappend | 4 + meta-agl/meta-security/README.md | 2 +- meta-agl/meta-security/conf/layer.conf | 2 +- ...on-of-Cynara-asynchronous-security-checks.patch | 2309 +++++++++++++++ ...sage-dispatching-when-send-rule-result-is.patch | 967 +++++++ ...ailability-of-policy-results-for-broadcas.patch | 1095 ++++++++ ...d-own-rule-result-unavailability-handling.patch | 1505 ++++++++++ ...m-Cynara-runtime-policy-checks-by-default.patch | 180 ++ .../0006-Fix-SIGSEGV-on-disconnections.patch | 109 + .../0007-Switch-from-cynara-to-cynagora.patch | 1048 +++++++ .../dbus-cynagora/dbus_1.12.16.bbappend | 15 + ...on-of-Cynara-asynchronous-security-checks.patch | 2232 --------------- ...sage-dispatching-when-send-rule-result-is.patch | 949 ------- ...ailability-of-policy-results-for-broadcas.patch | 1082 ------- ...d-own-rule-result-unavailability-handling.patch | 1493 ---------- ...m-Cynara-runtime-policy-checks-by-default.patch | 175 -- .../dbus-cynara/0006-Fix-gcc-8-warnings.patch | 134 - .../0007-Fix-SIGSEGV-on-disconnections.patch | 109 - .../recipes-core/dbus-cynara/dbus_1.12.10.bbappend | 15 - .../recipes-core/systemd/systemd_2%.bbappend | 40 + .../recipes-core/systemd/systemd_239.bbappend | 40 - .../0001-lib-i386_table.h-add-new-syscall.patch | 42 + ...ubstitue-functions-for-strndupa-rawmemchr.patch | 133 + .../Fixed-swig-host-contamination-issue.patch | 57 + .../audit/add-system-call-table-for-ARM.patch | 46 - .../audit/audit/audit-for-cross-compiling.patch | 2938 -------------------- .../audit/audit/audit-python-configure.patch | 27 - .../audit/audit/audit-python.patch | 31 - .../recipes-security/audit/audit/auditd | 2 +- .../audit/audit/disable-ldap.patch | 59 - .../audit/audit/fix-swig-host-contamination.patch | 48 - .../recipes-security/audit/audit_2.3.2.bb | 102 - .../recipes-security/audit/audit_2.8.5.bb | 106 + .../recipes-security/cynagora/cynagora_2.0.bb | 2 +- .../keyutils/keyutils-arm-remove-m32-m64.patch | 19 - .../keyutils/keyutils_fix_library_install.patch | 30 - .../keyutils/keyutils_fix_x86-64_cflags.patch | 13 - .../keyutils/keyutils_fix_x86_cflags.patch | 13 - .../recipes-security/keyutils/keyutils_1.5.8.bb | 44 - .../security-manager/security-manager.inc | 2 +- .../recipes-security/smacknet/smacknet.bb | 2 +- .../recipes-security/xmlsec1/xmlsec1_%.bbappend | 3 - meta-agl/scripts/ias_image_app | 191 -- meta-agl/scripts/mkabl-agl.sh | 507 ---- meta-agl/scripts/mkefi-agl.sh | 531 ---- meta-agl/templates/base/99_local.conf.inc | 14 + meta-agl/templates/base/conf-notes.txt | 67 +- meta-agl/templates/base/local.conf.sample | 138 +- .../feature/agl-archiver/.50_FEATURE.md.swp | Bin 12288 -> 0 bytes .../feature/agl-archiver/50_local.conf.inc | 2 + .../agl-ci-change-features-nogfx/included.dep | 2 +- .../feature/agl-ci-change-features/included.dep | 2 +- .../templates/feature/agl-ci/99_local.conf.inc | 3 + .../feature/agl-compositor/50_local.conf.inc | 15 - .../README_feature_agl-compositor.md | 13 - .../templates/feature/agl-egvirt/50_local.conf.inc | 9 - .../agl-egvirt/README_feature_agl-egvirt.md | 9 - .../feature/agl-pipewire/50_bblayers.conf.inc | 7 + .../feature/agl-pipewire/50_local.conf.inc | 2 + .../agl-pipewire/README_feature_agl-pipewire.md | 9 + .../50_bblayers.conf.inc | 6 + .../agl-profile-graphical-html5/50_local.conf.inc | 3 + .../README_feature_agl-profile-graphical-html5.md | 8 + .../agl-profile-graphical-html5/included.dep | 1 + .../templates/feature/agl-ptest/90_local.conf.inc | 2 +- .../feature/agl-sign-wgts/50_local.conf.inc | 2 + .../agl-sign-wgts/README_feature_agl-sign-wgts.md | 8 + .../feature/agl-sota/50_bblayers.conf.inc | 3 - .../templates/feature/agl-sota/50_local.conf.inc | 10 +- .../feature/agl-virt-guest-xen/50_local.conf.inc | 3 + .../feature/agl-weston-remoting/50_local.conf.inc | 1 + .../README_feature_agl-weston-remoting.md | 9 + .../feature/agl-weston-remoting/included.dep | 1 + .../templates/machine/bbe/50_bblayers.conf.inc | 1 + .../templates/machine/bbe/README_machine_bbe.md | 13 +- .../machine/beaglebone/50_bblayers.conf.inc | 5 +- .../machine/dra7xx-evm/50_bblayers.conf.inc | 5 +- .../machine/dragonboard-410c/50_bblayers.conf.inc | 2 +- .../templates/machine/ebisu/50_bblayers.conf.inc | 2 +- meta-agl/templates/machine/ebisu/50_local.conf.inc | 3 - meta-agl/templates/machine/ebisu/50_setup.sh | 4 +- .../machine/h3-salvator-x/50_bblayers.conf.inc | 2 +- .../h3-salvator-x/README_machine_h3-salvator-x.md | 10 +- .../machine/h3ulcb-kf/50_bblayers.conf.inc | 4 + .../templates/machine/h3ulcb-kf/50_local.conf.inc | 7 + meta-agl/templates/machine/h3ulcb-kf/50_setup.sh | 10 + .../machine/h3ulcb-kf/README_machine_h3ulcb-kf.md | 12 + .../machine/h3ulcb-nogfx/50_bblayers.conf.inc | 3 +- .../machine/h3ulcb-nogfx/50_local.conf.inc | 4 - .../h3ulcb-nogfx/README_machine_h3ulcb-nogfx.md | 8 +- .../templates/machine/h3ulcb/50_bblayers.conf.inc | 3 +- .../templates/machine/h3ulcb/50_local.conf.inc | 3 - .../machine/h3ulcb/README_machine_h3ulcb.md | 8 +- .../machine/imx8mqevk-viv/40_bblayers.conf.inc | 5 + .../machine/imx8mqevk-viv/50_local.conf.inc | 3 + .../templates/machine/imx8mqevk-viv/50_setup.sh | 2 + .../imx8mqevk-viv/README_machine_imx8mqevk-viv.md | 9 + .../machine/imx8mqevk/40_bblayers.conf.inc | 5 + .../templates/machine/imx8mqevk/50_local.conf.inc | 3 + meta-agl/templates/machine/imx8mqevk/50_setup.sh | 2 + .../machine/imx8mqevk/README_machine_imx8mqevk.md | 13 + meta-agl/templates/machine/intel-corei7-64 | 1 + .../machine/intel-corei7-64/50_bblayers.conf.inc | 1 - .../machine/intel-corei7-64/50_local.conf.inc | 3 - .../README_machine_intel-corei7-64.md | 9 - .../machine/m3-salvator-x/50_bblayers.conf.inc | 3 + .../machine/m3-salvator-x/50_local.conf.inc | 4 + .../templates/machine/m3-salvator-x/50_setup.sh | 10 + .../m3-salvator-x/README_machine_m3-salvator-x.md | 11 + .../machine/m3ulcb-kf/50_bblayers.conf.inc | 4 + .../templates/machine/m3ulcb-kf/50_local.conf.inc | 6 + meta-agl/templates/machine/m3ulcb-kf/50_setup.sh | 10 + .../machine/m3ulcb-kf/README_machine_m3ulcb-kf.md | 12 + .../machine/m3ulcb-nogfx/50_bblayers.conf.inc | 3 +- .../machine/m3ulcb-nogfx/50_local.conf.inc | 3 - .../m3ulcb-nogfx/README_machine_m3ulcb-nogfx.md | 8 +- .../templates/machine/m3ulcb/50_bblayers.conf.inc | 3 +- .../templates/machine/m3ulcb/50_local.conf.inc | 3 - .../machine/m3ulcb/README_machine_m3ulcb.md | 8 +- .../machine/raspberrypi4/50_local.conf.inc | 10 +- 644 files changed, 19348 insertions(+), 21265 deletions(-) delete mode 100644 meta-agl/.gitreview create mode 100644 meta-agl/LICENSE create mode 100644 meta-agl/LICENSE.GPL-2.0-only create mode 100644 meta-agl/LICENSE.MIT mode change 100644 => 120000 meta-agl/README.md create mode 100644 meta-agl/meta-agl-basesystem/recipes-graphics/ns-commonlibrary/files/0001-cl_error-remover-gettid-inline-declaration.patch create mode 100644 meta-agl/meta-agl-bsp/LICENSE create mode 100644 meta-agl/meta-agl-bsp/LICENSE.GPL-2.0-only create mode 100644 meta-agl/meta-agl-bsp/LICENSE.MIT delete mode 100644 meta-agl/meta-agl-bsp/classes/sdcard_image-socfpga.bbclass create mode 100644 meta-agl/meta-agl-bsp/conf/include/agl_h3-salvator-x-nogfx.inc create mode 100644 meta-agl/meta-agl-bsp/conf/include/agl_imx8mqevk-common.inc create mode 100644 meta-agl/meta-agl-bsp/conf/include/agl_imx8mqevk-viv.inc create mode 100644 meta-agl/meta-agl-bsp/conf/include/agl_imx8mqevk.inc delete mode 100644 meta-agl/meta-agl-bsp/conf/include/agl_intel-corei7-64.inc create mode 100644 meta-agl/meta-agl-bsp/conf/include/agl_m3-salvator-x-nogfx.inc create mode 100644 meta-agl/meta-agl-bsp/conf/include/agl_m3-salvator-x.inc create mode 100644 meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi4.inc create mode 100644 meta-agl/meta-agl-bsp/conf/include/agl_rcar-nogfx.inc create mode 100644 meta-agl/meta-agl-bsp/conf/include/agl_rcar.inc delete mode 100644 meta-agl/meta-agl-bsp/conf/include/agl_ulcb-nogfx.inc delete mode 100644 meta-agl/meta-agl-bsp/conf/include/agl_ulcb.inc delete mode 100644 meta-agl/meta-agl-bsp/conf/machine/include/rpi4-base.inc delete mode 100644 meta-agl/meta-agl-bsp/conf/machine/raspberrypi4.conf create mode 100644 meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-graphics/mesa/files/0001-kmsro-add-imx-dcss.patch create mode 100644 meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-graphics/mesa/mesa_%.bbappend delete mode 100644 meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-init.bbappend create mode 100644 meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/imx8mq-evkb.cfg create mode 100644 meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0001-enable-mhdp-with-etnaviv.patch create mode 100644 meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0002-dts-enable-etnaviv.patch create mode 100644 meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0003-drm-etnaviv-fix-TS-cache-flushing-on-GPUs-with-BLT-e.patch create mode 100644 meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0004-drm-sched-Fix-passing-zero-to-PTR_ERR-warning-v2.patch create mode 100644 meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/etnaviv.cfg delete mode 100644 meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase/0014-Add-IMX-GPU-support.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase_%.bbappend delete mode 100644 meta-agl/meta-agl-bsp/meta-intel/recipes-graphics/wayland/weston-ini-conf.bbappend delete mode 100644 meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux-firmware/linux-firmware_git.bbappend delete mode 100644 meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/extra-graphic-devices.cfg delete mode 100644 meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/fix_branch.scc delete mode 100644 meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/lava.cfg delete mode 100644 meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/net-devices.cfg delete mode 100644 meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/security-tpm.cfg delete mode 100644 meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/startup.nsh delete mode 100644 meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/upsquare.cfg delete mode 100644 meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/usb-devices.cfg delete mode 100644 meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-intel_%.bbappend delete mode 100644 meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-intel_4.19%.bbappend create mode 100644 meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-aws/aws-iot-device-sdk-embedded-c/aws-iot-device-sdk-embedded-c.bb create mode 100644 meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-aws/aws-iot-device-sdk-embedded-c/files/Makefile.aws create mode 100644 meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-aws/aws-iot-device-sdk-embedded-c/files/aws_iot_config.h create mode 100644 meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-aws/aws-iot-device-sdk-embedded-c/files/awsiotsdk.pc create mode 100644 meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-azure/azure-iot-sdk-c/azure-iot-sdk-c_%.bbappend create mode 100644 meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-azure/azure-macro-utils-c/azure-macro-utils-c_%.bbappend create mode 100644 meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-azure/umock-c/umock-c_%.bbappend create mode 100644 meta-agl/meta-agl-bsp/meta-qcom/recipes-kernel/linux/linux-linaro-qcomlt_%.bbappend delete mode 100644 meta-agl/meta-agl-bsp/meta-qcom/recipes-kernel/linux/linux-linaro-qcomlt_4.14.bbappend delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend create mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/bootfiles.bbappend create mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot_xen.cmd create mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev-2019.07.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0001-configs-rpi4-Add-defconfigs-for-rpi4-32-64.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0002-ARM-bcm283x-Add-BCM283x_BASE-define.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0003-arm-mach-bcm283x-Define-configs-for-RaspberryPi-4.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0004-rpi-Add-entry-for-Raspberry-Pi-4-model-B.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0005-arm-bcm283x-Include-definition-for-additional-emmc-c.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0006-mmc-bcm2835_sdhci-Add-support-for-bcm2711-device.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0007-rpi-Add-memory-map-for-bcm2838.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-common.inc delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-fw-utils_2019.07.bb delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-fw-utils_2019.07.bbappend delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-rpi4-2019.07.inc delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-tools_2019.07.bb delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot.inc delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bb delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bbappend delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0002-meson.build-make-TLS-GLX-optional-again.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0003-Allow-enable-DRI-without-DRI-drivers.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/libglu_9.0.1.bb delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0012-mesa-demos-OpenVG-demos-with-single-frame-need-eglSw.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0013-only-build-GLX-demos-if-needed.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos_8.4.0.bb delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-gl_19.1.6.bb delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa.inc delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_%.bbappend delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_19.1.6.bb delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/userland/userland_%.bbappend delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro/0001-brcmfmac43455-sdio.txt-Follow-raspbian-change-for-bo.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro_%.bbappend create mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/0002-Disable-DMA-in-sdhci-driver.patch create mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/0003-Fix-PCIe-in-dom0-for-RPi4.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/rpi-kernel-misc.cfg create mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/xen-be.cfg delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/disable_kprobes.cfg delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi4.inc delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.14%.bbappend delete mode 100644 meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bb create mode 120000 meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/arm-trusted-firmware create mode 120000 meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/si-tools create mode 120000 meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt create mode 120000 meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt-firmware create mode 120000 meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/u-boot create mode 120000 meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-graphics/cairo create mode 120000 meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-kernel/linux create mode 120000 meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-multimedia/gstreamer create mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/NOTES create mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/alsa-state/alsa-state.bbappend create mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt-firmware/ti-bt-firmware_git.bbappend create mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0004-ADSP-enable-and-add-sound-hardware-abstraction_kf.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter/gstvspfilter-h3ulcb_r8a7795.conf delete mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter/gstvspfilter-m3ulcb_r8a7796.conf delete mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter_1.0.1.bbappend create mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3/include/checksum_control.inc create mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3/include/checksum_control_files.inc create mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3-salvator-x.txt create mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3-salvator-x.txt create mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples/0001-secure_storage-ta-Add-a-missing-include-file.patch create mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples_git.bb create mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os_git.bbappend create mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test/optee_xtest_fix.diff create mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test_git.bb create mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-user-app-template_git.bb create mode 120000 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control.inc create mode 120000 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control_files.inc create mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module.bbappend create mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/salvator-x_output.cfg delete mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend create mode 120000 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control.inc create mode 120000 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control_files.inc create mode 120000 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control.inc create mode 120000 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control_files.inc create mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/r8a7796-m3ulcb-xen.dts create mode 100644 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/xen-be.cfg create mode 120000 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control.inc create mode 120000 meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control_files.inc create mode 100644 meta-agl/meta-agl-bsp/meta-synopsys/recipes-kernel/linux-yocto_%.bbappend delete mode 100644 meta-agl/meta-agl-bsp/meta-synopsys/recipes-kernel/linux/linux-arc_%.bbappend delete mode 100644 meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-FIX-weston-clients-typo-in-simple-dmabuf-egl.c.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-udev-seat-restrict-udev-enumeration-to-card0.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0002-Weston-Allow-visual_id-to-be-0.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0003-Weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch create mode 100644 meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0003-weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0004-Weston-Fix-touch-screen-crash-issue.patch create mode 100644 meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0004-weston-Fix-touch-screen-crash-issue.patch create mode 100644 meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0005-weston-drm-fix-dual-display-issue.patch delete mode 100644 meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston_%.bbappend create mode 100644 meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston_8.0.0.bbappend delete mode 100644 meta-agl/meta-agl-bsp/recipes-graphics/opencv/opencv_3.%.bbappend create mode 100644 meta-agl/meta-agl-bsp/recipes-graphics/opencv/opencv_4.%.bbappend delete mode 100644 meta-agl/meta-agl-bsp/recipes-graphics/wayland/wayland-protocols_1.17.bb delete mode 100644 meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/id-agent.cfg delete mode 100644 meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/ivishell.cfg create mode 100644 meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/remote-output.cfg delete mode 100644 meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/virtualoutput.cfg delete mode 100644 meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/0001-make-error-portable.patch delete mode 100644 meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch delete mode 100644 meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/weston.desktop delete mode 100644 meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/weston.png delete mode 100644 meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/xwayland.weston-start delete mode 100644 meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston_6.0.0.bb delete mode 100644 meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-4.9/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch create mode 100644 meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl-4.19.inc delete mode 100644 meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl-4.9.inc delete mode 100644 meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/ath9k_htc.cfg create mode 100644 meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/systemtap.cfg create mode 100644 meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/wifi.cfg create mode 100644 meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/x86-extra-graphic-devices.cfg create mode 100644 meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/x86-net-devices.cfg create mode 100644 meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/x86-security-tpm.cfg create mode 100644 meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/x86-upsquare.cfg create mode 100644 meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/x86-usb-devices.cfg create mode 100644 meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/xen_domu.cfg create mode 100644 meta-agl/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner_2.%.bbappend delete mode 100644 meta-agl/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner_2.2.bbappend delete mode 100644 meta-agl/meta-agl-bsp/recipes-support/vboxguestdrivers/vboxguestdrivers_%.bbappend create mode 100644 meta-agl/meta-agl-bsp/virtualization-layer/recipes-extended/xen/files/0001-XEN-on-RPi4-1GB-lmitation-workaround-XEN-tries-to-al.patch create mode 100644 meta-agl/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-mkimage-rpi4.bb create mode 100644 meta-agl/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-tools_git.bbappend create mode 100644 meta-agl/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen_git.bbappend delete mode 100644 meta-agl/meta-agl-bsp/wic/systemd-joule-bootdisk.wks create mode 100644 meta-agl/meta-agl-distro/LICENSE create mode 100644 meta-agl/meta-agl-distro/LICENSE.GPL-2.0-only create mode 100644 meta-agl/meta-agl-distro/LICENSE.MIT create mode 100644 meta-agl/meta-agl-profile-cluster-qt5/LICENSE create mode 100644 meta-agl/meta-agl-profile-cluster-qt5/LICENSE.GPL-2.0-only create mode 100644 meta-agl/meta-agl-profile-cluster-qt5/LICENSE.MIT create mode 100644 meta-agl/meta-agl-profile-cluster/LICENSE create mode 100644 meta-agl/meta-agl-profile-cluster/LICENSE.GPL-2.0-only create mode 100644 meta-agl/meta-agl-profile-cluster/LICENSE.MIT create mode 100644 meta-agl/meta-agl-profile-core/LICENSE create mode 100644 meta-agl/meta-agl-profile-core/LICENSE.GPL-2.0-only create mode 100644 meta-agl/meta-agl-profile-core/LICENSE.MIT delete mode 100644 meta-agl/meta-agl-profile-core/conf/include/agl-pulseaudio.inc create mode 100644 meta-agl/meta-agl-profile-core/conf/include/agl-sign-wgts.inc delete mode 100644 meta-agl/meta-agl-profile-core/recipes-apis/agl-service-steering-wheel/agl-service-steering-wheel_0.1.bb delete mode 100644 meta-agl/meta-agl-profile-core/recipes-apis/high-level-viwi-service/high-level-viwi-service.bb delete mode 100644 meta-agl/meta-agl-profile-core/recipes-connectivity/bluez5/bluez5/0001-obex-report-notification-status-on-incoming-message.patch create mode 100644 meta-agl/meta-agl-profile-core/recipes-connectivity/bluez5/bluez5/bluetooth.service create mode 100644 meta-agl/meta-agl-profile-core/recipes-connectivity/bluez5/bluez5/obex.service delete mode 100644 meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman.inc delete mode 100644 meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/0001-Fix-various-issues-which-cause-problems-under-musl.patch delete mode 100644 meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/0001-connman.service-stop-systemd-resolved-when-we-use-co.patch delete mode 100644 meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch delete mode 100644 meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/0002-resolve-musl-does-not-implement-res_ninit.patch delete mode 100644 meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/connman delete mode 100644 meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/no-version-scripts.patch delete mode 100644 meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman_1.36.bb delete mode 100644 meta-agl/meta-agl-profile-core/recipes-connectivity/libnfc/libnfc_git.bb delete mode 100644 meta-agl/meta-agl-profile-core/recipes-core/glibc/.appends.core delete mode 100644 meta-agl/meta-agl-profile-core/recipes-core/glibc/glibc/arm/local-arm-futex.diff delete mode 100644 meta-agl/meta-agl-profile-core/recipes-core/glibc/glibc_2.2%.bbappend delete mode 100755 meta-agl/meta-agl-profile-core/recipes-core/psplash/files/psplash-anim delete mode 100644 meta-agl/meta-agl-profile-core/recipes-core/psplash/files/psplash-quit.service delete mode 100644 meta-agl/meta-agl-profile-core/recipes-core/psplash/files/psplash-start.service create mode 100644 meta-agl/meta-agl-profile-core/recipes-core/systemd/systemd-conf_%.bbappend create mode 100644 meta-agl/meta-agl-profile-core/recipes-core/systemd/systemd/0001-fix-udevd-seclabel-parsing.patch delete mode 100644 meta-agl/meta-agl-profile-core/recipes-core/systemd/systemd/0001-network-add-CAN-Termination-tristate-option.patch create mode 100644 meta-agl/meta-agl-profile-core/recipes-core/systemd/systemd/0002-network-add-CAN-Termination-tristate-option.patch create mode 100644 meta-agl/meta-agl-profile-core/recipes-devtools/python/python3-asyncssh_2.3.0.bb create mode 100644 meta-agl/meta-agl-profile-core/recipes-devtools/python/python3-pytest-dependency_0.5.1.bb create mode 100644 meta-agl/meta-agl-profile-core/recipes-devtools/python/python3-pytest-reverse_1.0.1.bb delete mode 100644 meta-agl/meta-agl-profile-core/recipes-kernel/most/files/0001-most-aim-network-backport-Kernel-API.patch create mode 100644 meta-agl/meta-agl-profile-core/recipes-kernel/most/files/0012-Fix-build-with-5.4-kernel.patch delete mode 100644 meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/agl-audio-plugin_0.1.bb delete mode 100644 meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0001-install-files-for-a-module-development.patch delete mode 100644 meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0002-volume-ramp-additions-to-the-low-level-infra.patch delete mode 100644 meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0003-volume-ramp-adding-volume-ramping-to-sink-input.patch delete mode 100644 meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0004-sink-input-Code-cleanup-regarding-volume-ramping.patch delete mode 100644 meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0005-sink-input-volume-Add-support-for-volume-ramp-factor.patch delete mode 100644 meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0006-sink-input-Remove-pa_sink_input_set_volume_ramp.patch delete mode 100644 meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/enable-ofono-hfp-backend.patch delete mode 100644 meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend delete mode 100644 meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio_12.2.bbappend mode change 100755 => 100644 meta-agl/meta-agl-profile-core/recipes-platform/images/agl-image-minimal-crosssdk.bb create mode 100644 meta-agl/meta-agl-profile-core/recipes-platform/images/agl-image-minimal-crosssdk.inc delete mode 100644 meta-agl/meta-agl-profile-core/recipes-support/curl/curl/0001-replace-krb5-config-with-pkg-config.patch delete mode 100644 meta-agl/meta-agl-profile-core/recipes-support/curl/curl_7.66.0.bb delete mode 100644 meta-agl/meta-agl-profile-core/recipes-support/libmicrohttpd/libmicrohttpd_0.9.63.bb delete mode 100644 meta-agl/meta-agl-profile-core/recipes-support/nghttp2/nghttp2_1.39.1.bb delete mode 100644 meta-agl/meta-agl-profile-core/recipes-support/opencv/opencv_3.%.bbappend create mode 100644 meta-agl/meta-agl-profile-core/recipes-support/opencv/opencv_4.%.bbappend create mode 100644 meta-agl/meta-agl-profile-core/recipes-support/udisks/files/99-udisks2.rules delete mode 100644 meta-agl/meta-agl-profile-core/recipes-support/udisks/files/org.freedesktop.UDisks.conf delete mode 100644 meta-agl/meta-agl-profile-core/recipes-support/udisks/files/udisks.service create mode 100644 meta-agl/meta-agl-profile-core/recipes-support/udisks/udisks2_%.bbappend delete mode 100644 meta-agl/meta-agl-profile-core/recipes-support/udisks/udisks_1.0.5.bbappend create mode 100644 meta-agl/meta-agl-profile-core/recipes-test/freetype/freetype_2.%.bbappend delete mode 100644 meta-agl/meta-agl-profile-core/recipes-test/freetype/freetype_2.9.1.bbappend create mode 100644 meta-agl/meta-agl-profile-core/recipes-test/pyagl/pyagl_git.bb create mode 100644 meta-agl/meta-agl-profile-graphical-html5/conf/layer.conf create mode 100644 meta-agl/meta-agl-profile-graphical-html5/recipes-graphics/wayland/weston-ini-conf.bbappend create mode 100644 meta-agl/meta-agl-profile-graphical-html5/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-180.cfg create mode 100644 meta-agl/meta-agl-profile-graphical-html5/recipes-graphics/wayland/weston-ini-conf/virtual-landscape.cfg create mode 100644 meta-agl/meta-agl-profile-graphical-html5/recipes-platform/images/agl-image-graphical-html5.bb create mode 100644 meta-agl/meta-agl-profile-graphical-html5/recipes-platform/images/agl-image-graphical-html5.inc create mode 100644 meta-agl/meta-agl-profile-graphical-html5/recipes-platform/packagegroups/packagegroup-agl-appfw-html5.bb create mode 100644 meta-agl/meta-agl-profile-graphical-html5/recipes-platform/packagegroups/packagegroup-agl-profile-graphical-html5.bb create mode 100644 meta-agl/meta-agl-profile-graphical-html5/recipes-wam/chromium/chromium-browser-service.bb create mode 100644 meta-agl/meta-agl-profile-graphical-html5/recipes-wam/chromium/chromium68/v8-qemu-wrapper.patch create mode 100644 meta-agl/meta-agl-profile-graphical-html5/recipes-wam/chromium/chromium68_git.bb create mode 100644 meta-agl/meta-agl-profile-graphical-html5/recipes-wam/chromium/gn-utils.inc create mode 100644 meta-agl/meta-agl-profile-graphical-html5/recipes-wam/wam/files/WebAppMgr.env create mode 100644 meta-agl/meta-agl-profile-graphical-html5/recipes-wam/wam/files/WebAppMgr@.service create mode 100644 meta-agl/meta-agl-profile-graphical-html5/recipes-wam/wam/files/trunc-webapp-roles.patch create mode 100644 meta-agl/meta-agl-profile-graphical-html5/recipes-wam/wam/wam_git.bb create mode 100644 meta-agl/meta-agl-profile-graphical-qt5/LICENSE create mode 100644 meta-agl/meta-agl-profile-graphical-qt5/LICENSE.GPL-2.0-only create mode 100644 meta-agl/meta-agl-profile-graphical-qt5/LICENSE.MIT create mode 100644 meta-agl/meta-agl-profile-graphical-qt5/recipes-platform/images/agl-image-graphical-qt5-crosssdk.inc delete mode 100644 meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qlibwindowmanager/qlibwindowmanager_git.bb create mode 100644 meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtlocation_%.bbappend create mode 100644 meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtwayland-config/qtwayland create mode 100644 meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtwayland-config_1.0.0.bb delete mode 100644 meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qtaglextras/qtaglextras_git.bb create mode 100644 meta-agl/meta-agl-profile-graphical/LICENSE create mode 100644 meta-agl/meta-agl-profile-graphical/LICENSE.GPL-2.0-only create mode 100644 meta-agl/meta-agl-profile-graphical/LICENSE.MIT delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-apis/agl-service-windowmanager/agl-service-windowmanager_git.bb delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-apis/agl-service-windowmanager/files/weston-ready.conf delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/agl-desktop-config_0.1.bb delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/files/user-weston-term.path delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/files/user-weston-term.service delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/libwindowmanager/libwindowmanager_git.bb delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/runxdg/runxdg_git.bb create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0006-fix-plugin-registry-include.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0002-server-Fix-fake-Address-already-in-use-error.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/zz-input.rules create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/zz-input.rules.in delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston_2.0.0.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston_7.0.0.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-config-parser-Export-get_full_path-and-destroy.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-ivi-shell-rework-goto-labels-to-avoid-memory-leaks.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-libweston-Expose-weston_output_damage-in-libweston.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0002-ivi-shell-removed-assert.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0003-ivi-shell-introduction-of-IVI_INVALID_ID.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0004-layout-interface-added-interface-to-change-surface-id.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0004-main-change-remoting-initialization-timing.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0005-ivi-layout-introcuded-configure_desktop_changed.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0006-ivi-layout-introcuded-surface_create_and_configure.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0007-ivi-shell-linked-libweston-desktop-and-added-structs.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0008-ivi-layout-use-libweston-desktop-api-for-views.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0009-ivi-shell-added-libweston-desktop-api_implementation.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0010-ivi-shell-remove-surface_destroy_listener.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0011-ivi-shell-create-weston-desktop-in_wet_shell_init.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0012-hmi-controller-register-for-desktop_surface_configured.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0013-simple-egl-remove-ivi-application-support.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0014-simple-shm-remove-ivi-application-support.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0015-window-client-remove-ivi-application-support.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0016-compositor-add-output-type-to-weston_output.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0017-compositor-drm-introduce-drm_get_dmafd_from_view.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0018-compositor-drm-get-stride-from-drm_get_dma_fd_from_view.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/smack-weston delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/use-XDG_RUNTIMESHARE_DIR.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_%.bbappend delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_5.0.0.bbappend delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_6.0.0.bbappend create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_8.0.%.bbappend create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad/0001-gst-wayland-Install-wayland-header-from-gstwayland-l.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad/0001-install-wayland.h.patch delete mode 100644 meta-agl/meta-agl-profile-graphical/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad_1.14.%.bbappend create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad_1.16.%.bbappend create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-security/security-manager/security-manager_%.bbappend create mode 100644 meta-agl/meta-agl-profile-hud/LICENSE create mode 100644 meta-agl/meta-agl-profile-hud/LICENSE.GPL-2.0-only create mode 100644 meta-agl/meta-agl-profile-hud/LICENSE.MIT create mode 100644 meta-agl/meta-agl-profile-telematics/LICENSE create mode 100644 meta-agl/meta-agl-profile-telematics/LICENSE.GPL-2.0-only create mode 100644 meta-agl/meta-agl-profile-telematics/LICENSE.MIT create mode 100644 meta-agl/meta-app-framework/LICENSE create mode 100644 meta-agl/meta-app-framework/LICENSE.GPL-2.0-only create mode 100644 meta-agl/meta-app-framework/LICENSE.MIT create mode 100644 meta-agl/meta-app-framework/recipes-support/libzip/libzip_%.bbappend delete mode 100644 meta-agl/meta-app-framework/recipes-support/libzip/libzip_1.1.1.bb create mode 100644 meta-agl/meta-netboot/LICENSE create mode 100644 meta-agl/meta-netboot/LICENSE.GPL-2.0-only create mode 100644 meta-agl/meta-netboot/LICENSE.MIT create mode 100644 meta-agl/meta-pipewire/conf/include/agl-pipewire.inc create mode 100644 meta-agl/meta-pipewire/conf/layer.conf create mode 100644 meta-agl/meta-pipewire/recipes-connectivity/bluez-alsa/bluez-alsa/0001-utils-add-a-gstreamer-helper-application-for-interco.patch create mode 100644 meta-agl/meta-pipewire/recipes-connectivity/bluez-alsa/bluez-alsa/bluealsa-gst-helper@.service create mode 100644 meta-agl/meta-pipewire/recipes-connectivity/bluez-alsa/bluez-alsa_git.bbappend create mode 100644 meta-agl/meta-pipewire/recipes-core/packagegroups/packagegroup-pipewire.bb create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/agl-service-audiomixer/agl-service-audiomixer_git.bb create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire-conf-agl/client.env create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire-conf-agl/pipewire.conf.in create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire-conf-agl/server.env create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire-conf-agl_git.bb create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire.inc create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-meson-revert-version-check-to-require-meson-0.47-not.patch create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-arm-build-with-mno-unaligned-access.patch create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0003-gst-Implement-new-pwaudio-src-sink-elements-based-on.patch create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0004-audioconvert-always-assume-that-output-ports-are-NOT.patch create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0005-module-access-add-same-sec-label-mode.patch create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0006-alsa-pcm-call-reuse_buffers-when-resetting-the-state.patch create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0007-alsa-Set-period_size-depending-on-hardware.patch create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0008-alsa-add-warning-in-case-of-partial-read-write.patch create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0009-alsa-adjust-delay-depending-on-hardware.patch create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/pipewire@.service create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/pipewire@.socket create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/smack-pipewire create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire_git.bb create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire_git.bbappend create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-audio-sink.endpoint create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-audio-source.endpoint create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-default-input-audio.endpoint-link create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-default-output-audio.endpoint-link create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-stream-input-audio.endpoint create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-stream-output-audio.endpoint create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/01-hw00-audio-sink.endpoint create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/01-hw00-audio-source.endpoint create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-ak4613-audio-sink.endpoint create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-ak4613-audio-source.endpoint create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-dra7xx-audio-sink.endpoint create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-dra7xx-audio-source.endpoint create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-imx8mq-audio-sink.endpoint create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-rcarsound-audio-sink.endpoint create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-rcarsound-audio-source.endpoint create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-rpi3-audio-sink.endpoint create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/40-fiberdyne-amp.endpoint create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/40-microchip-mic.endpoint create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/70-usb-audio-sink.endpoint create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/70-usb-audio-source.endpoint create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/bluealsa-input-audio.endpoint-link create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/bluealsa-output-audio.endpoint-link create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/capture.streams create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/playback.streams create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/wireplumber.conf create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl_git.bb create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-Build-cpptoml-without-a-cmake-subproject.patch create mode 100644 meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb create mode 100644 meta-agl/meta-pipewire/recipes-security/cynagora/cynagora_%.bbappend create mode 100644 meta-agl/meta-pipewire/recipes-security/security-manager/security-manager_%.bbappend create mode 100644 meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0001-Integration-of-Cynara-asynchronous-security-checks.patch create mode 100644 meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0002-Disable-message-dispatching-when-send-rule-result-is.patch create mode 100644 meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0003-Handle-unavailability-of-policy-results-for-broadcas.patch create mode 100644 meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0004-Add-own-rule-result-unavailability-handling.patch create mode 100644 meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0005-Perform-Cynara-runtime-policy-checks-by-default.patch create mode 100644 meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0006-Fix-SIGSEGV-on-disconnections.patch create mode 100644 meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0007-Switch-from-cynara-to-cynagora.patch create mode 100644 meta-agl/meta-security/recipes-core/dbus-cynagora/dbus_1.12.16.bbappend delete mode 100644 meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0001-Integration-of-Cynara-asynchronous-security-checks.patch delete mode 100644 meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0002-Disable-message-dispatching-when-send-rule-result-is.patch delete mode 100644 meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0003-Handle-unavailability-of-policy-results-for-broadcas.patch delete mode 100644 meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0004-Add-own-rule-result-unavailability-handling.patch delete mode 100644 meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0005-Perform-Cynara-runtime-policy-checks-by-default.patch delete mode 100644 meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0006-Fix-gcc-8-warnings.patch delete mode 100644 meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0007-Fix-SIGSEGV-on-disconnections.patch delete mode 100644 meta-agl/meta-security/recipes-core/dbus-cynara/dbus_1.12.10.bbappend create mode 100644 meta-agl/meta-security/recipes-core/systemd/systemd_2%.bbappend delete mode 100644 meta-agl/meta-security/recipes-core/systemd/systemd_239.bbappend create mode 100644 meta-agl/meta-security/recipes-security/audit/audit/0001-lib-i386_table.h-add-new-syscall.patch create mode 100644 meta-agl/meta-security/recipes-security/audit/audit/Add-substitue-functions-for-strndupa-rawmemchr.patch create mode 100644 meta-agl/meta-security/recipes-security/audit/audit/Fixed-swig-host-contamination-issue.patch delete mode 100644 meta-agl/meta-security/recipes-security/audit/audit/add-system-call-table-for-ARM.patch delete mode 100644 meta-agl/meta-security/recipes-security/audit/audit/audit-for-cross-compiling.patch delete mode 100644 meta-agl/meta-security/recipes-security/audit/audit/audit-python-configure.patch delete mode 100644 meta-agl/meta-security/recipes-security/audit/audit/audit-python.patch delete mode 100644 meta-agl/meta-security/recipes-security/audit/audit/disable-ldap.patch delete mode 100644 meta-agl/meta-security/recipes-security/audit/audit/fix-swig-host-contamination.patch delete mode 100644 meta-agl/meta-security/recipes-security/audit/audit_2.3.2.bb create mode 100644 meta-agl/meta-security/recipes-security/audit/audit_2.8.5.bb delete mode 100644 meta-agl/meta-security/recipes-security/keyutils/keyutils/keyutils-arm-remove-m32-m64.patch delete mode 100644 meta-agl/meta-security/recipes-security/keyutils/keyutils/keyutils_fix_library_install.patch delete mode 100644 meta-agl/meta-security/recipes-security/keyutils/keyutils/keyutils_fix_x86-64_cflags.patch delete mode 100644 meta-agl/meta-security/recipes-security/keyutils/keyutils/keyutils_fix_x86_cflags.patch delete mode 100644 meta-agl/meta-security/recipes-security/keyutils/keyutils_1.5.8.bb delete mode 100644 meta-agl/meta-security/recipes-security/xmlsec1/xmlsec1_%.bbappend delete mode 100755 meta-agl/scripts/ias_image_app delete mode 100755 meta-agl/scripts/mkabl-agl.sh delete mode 100755 meta-agl/scripts/mkefi-agl.sh delete mode 100644 meta-agl/templates/feature/agl-archiver/.50_FEATURE.md.swp delete mode 100644 meta-agl/templates/feature/agl-compositor/50_local.conf.inc delete mode 100644 meta-agl/templates/feature/agl-compositor/README_feature_agl-compositor.md delete mode 100644 meta-agl/templates/feature/agl-egvirt/50_local.conf.inc delete mode 100644 meta-agl/templates/feature/agl-egvirt/README_feature_agl-egvirt.md create mode 100644 meta-agl/templates/feature/agl-pipewire/50_bblayers.conf.inc create mode 100644 meta-agl/templates/feature/agl-pipewire/50_local.conf.inc create mode 100644 meta-agl/templates/feature/agl-pipewire/README_feature_agl-pipewire.md create mode 100644 meta-agl/templates/feature/agl-profile-graphical-html5/50_bblayers.conf.inc create mode 100644 meta-agl/templates/feature/agl-profile-graphical-html5/50_local.conf.inc create mode 100644 meta-agl/templates/feature/agl-profile-graphical-html5/README_feature_agl-profile-graphical-html5.md create mode 100644 meta-agl/templates/feature/agl-profile-graphical-html5/included.dep create mode 100644 meta-agl/templates/feature/agl-sign-wgts/50_local.conf.inc create mode 100644 meta-agl/templates/feature/agl-sign-wgts/README_feature_agl-sign-wgts.md create mode 100644 meta-agl/templates/feature/agl-virt-guest-xen/50_local.conf.inc create mode 100644 meta-agl/templates/feature/agl-weston-remoting/50_local.conf.inc create mode 100644 meta-agl/templates/feature/agl-weston-remoting/README_feature_agl-weston-remoting.md create mode 100644 meta-agl/templates/feature/agl-weston-remoting/included.dep create mode 100644 meta-agl/templates/machine/h3ulcb-kf/50_bblayers.conf.inc create mode 100644 meta-agl/templates/machine/h3ulcb-kf/50_local.conf.inc create mode 100644 meta-agl/templates/machine/h3ulcb-kf/50_setup.sh create mode 100644 meta-agl/templates/machine/h3ulcb-kf/README_machine_h3ulcb-kf.md create mode 100644 meta-agl/templates/machine/imx8mqevk-viv/40_bblayers.conf.inc create mode 100644 meta-agl/templates/machine/imx8mqevk-viv/50_local.conf.inc create mode 100644 meta-agl/templates/machine/imx8mqevk-viv/50_setup.sh create mode 100644 meta-agl/templates/machine/imx8mqevk-viv/README_machine_imx8mqevk-viv.md create mode 100644 meta-agl/templates/machine/imx8mqevk/40_bblayers.conf.inc create mode 100644 meta-agl/templates/machine/imx8mqevk/50_local.conf.inc create mode 100644 meta-agl/templates/machine/imx8mqevk/50_setup.sh create mode 100644 meta-agl/templates/machine/imx8mqevk/README_machine_imx8mqevk.md create mode 120000 meta-agl/templates/machine/intel-corei7-64 delete mode 100644 meta-agl/templates/machine/intel-corei7-64/50_bblayers.conf.inc delete mode 100644 meta-agl/templates/machine/intel-corei7-64/50_local.conf.inc delete mode 100644 meta-agl/templates/machine/intel-corei7-64/README_machine_intel-corei7-64.md create mode 100644 meta-agl/templates/machine/m3-salvator-x/50_bblayers.conf.inc create mode 100644 meta-agl/templates/machine/m3-salvator-x/50_local.conf.inc create mode 100644 meta-agl/templates/machine/m3-salvator-x/50_setup.sh create mode 100644 meta-agl/templates/machine/m3-salvator-x/README_machine_m3-salvator-x.md create mode 100644 meta-agl/templates/machine/m3ulcb-kf/50_bblayers.conf.inc create mode 100644 meta-agl/templates/machine/m3ulcb-kf/50_local.conf.inc create mode 100644 meta-agl/templates/machine/m3ulcb-kf/50_setup.sh create mode 100644 meta-agl/templates/machine/m3ulcb-kf/README_machine_m3ulcb-kf.md (limited to 'meta-agl') diff --git a/meta-agl/.gitreview b/meta-agl/.gitreview deleted file mode 100644 index 55b3adba..00000000 --- a/meta-agl/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.automotivelinux.org -port=29418 -project=AGL/meta-agl -defaultbranch=icefish diff --git a/meta-agl/LICENSE b/meta-agl/LICENSE new file mode 100644 index 00000000..e8758f89 --- /dev/null +++ b/meta-agl/LICENSE @@ -0,0 +1,20 @@ +Different components of the AGL layers are under different licenses (a mix +of MIT and GPLv2). See LICENSE.GPL-2.0-only and LICENSE.MIT for further +details of the individual licenses. + +All metadata (e.g. .bb, .bbappend, .bbclass, .inc, templates/* and similar) +is MIT licensed unless otherwise stated. +Source code included in tree for individual recipes (e.g. patches) are under +the LICENSE stated in the associated recipe (.bb file) unless otherwise stated. + +License information for any other files (scripts) is either explicitly stated +or defaults to GPL version 2 only. + +Individual files can contain the following style tags instead of the full +license text to identify their license: + + SPDX-License-Identifier: GPL-2.0-only + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/LICENSE.GPL-2.0-only b/meta-agl/LICENSE.GPL-2.0-only new file mode 100644 index 00000000..5db3c0a2 --- /dev/null +++ b/meta-agl/LICENSE.GPL-2.0-only @@ -0,0 +1,288 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: GPL-2.0-only + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/LICENSE.MIT b/meta-agl/LICENSE.MIT new file mode 100644 index 00000000..a6919eb7 --- /dev/null +++ b/meta-agl/LICENSE.MIT @@ -0,0 +1,25 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/README.md b/meta-agl/README.md deleted file mode 100644 index 9967f084..00000000 --- a/meta-agl/README.md +++ /dev/null @@ -1,135 +0,0 @@ -# 'meta-agl' layer - -See README-AGL.md for general information about Automotive Grade Linux. - -## meta-agl, the core layer for Automotive Grade Linux Distribution - -AGL is creating an automotive specific Linux distribution that unifies -the software that has been written in a number of places already, -such as GENIVI and Tizen IVI. - -The layer 'meta-agl' provides a minimal set of software -to boot system of AGL Distribution. 'meta-agl' is the minimal -core which is used build AGL profiles on top of it. - -Especially there is no reference UI included which is part of 'meta-agl-demo'. - -Additional components like the security framework are part of 'meta-agl-extra'. - -The AGL community appreciates feedback, ideas, suggestion, bugs and -documentation just as much as code. Please join the irc conversation -at the #automotive channel on irc.freenode.net and our mailing list. - -For infomation for subscribing to the mailing list - [automotive-discussions](http://lists.linuxfoundation.org/mailman/listinfo/automotive-discussions) -For information about AGL Distribution, see the - [AGL Distribution](https://wiki.automotivelinux.org/agl-distro) -For information abount Getting started with AGL - [here](https://wiki.automotivelinux.org/start/getting-started) -For information about contributing to the AGL Distro - [here](https://wiki.automotivelinux.org/agl-distro/contributing) - -## Quick start guide - -See README-AGL.md - -## 'meta-agl' Layer Dependencies - -* poky - > URI: git://git.yoctoproject.org/poky - > branch : jethro - > tested revision: 40376446904ae3529be41737fed9a0b650ed167d - -* meta-openembedded - > URI: git://git.openembedded.org/meta-openembedded - > layer : meta-openembedded - > branch : jethro - > tested revision: 8ab04afbffb4bc5184cfe0655049de6f44269990 - -Specifically out of meta-openembedded these sub-layers are used: - -* meta-openembedded/meta-oe -* meta-openembedded/meta-multimedia -* meta-openembedded/meta-networking -* meta-openembedded/meta-python - -## Layers - -There are 5 layers in top-level `meta-agl`. - -* `meta-agl/meta-ivi-common`\ - `meta-ivi-common` is a layer which contains common packages to AGL - Distribution and other platforms for In-Vehicle Infotainment system. -* `meta-agl/meta-agl`\ - `meta-agl` is a layer which contains AGL common and middleware packages. -* `meta-agl/meta-agl-bsp`\ - `meta-agl-bsp` is a layer which contains required packages to boot AGL - distribution on an emulated machine(QEMU). -* `meta-agl/meta-netboot`\ - `meta-netboot` contains the netboot initrd support recipes. This is needed - in case of booting over the network as NFS does not support the securitylabels. - -## Packagegroups - -AGL package group design: - -* packagegroup-agl-image-minimal - - packagegroup-agl-core-automotive.bb - packagegroup-agl-core-connectivity.bb - packagegroup-agl-core-graphics.bb - packagegroup-agl-core-kernel.bb - packagegroup-agl-core-multimedia.bb - packagegroup-agl-core-navi-lbs.bb - packagegroup-agl-core-os-commonlibs.bb - packagegroup-agl-core-security.bb - packagegroup-agl-core-speech-services.bb - -These are for making image ``agl-image-minimal`` which is small image just -capable of allowing a device to boot. - -Subsystem should maintain packagegroup-agl-core-[subsystem].bb which should -hold sufficient packages to build ``agl-image-minimal``. - -* packagegroup-agl-image-ivi - - packagegroup-agl-ivi-automotive.bb - packagegroup-agl-ivi-connectivity.bb - packagegroup-agl-ivi-graphics.bb - packagegroup-agl-ivi-kernel.bb - packagegroup-agl-ivi-multimedia.bb - packagegroup-agl-ivi-navi-lbs.bb - packagegroup-agl-ivi-os-commonlibs.bb - packagegroup-agl-ivi-security.bb - packagegroup-agl-ivi-speech-services.bb - -These are for making image ``agl-image-ivi`` which is baseline for the profiles -of AGL distro. 'Baseline' means Service Layer and Operating System Layer defined -in AGL Spec v1.0. - -* packagegroup-agl-test.bb - -Additional tools used in QA tests (for agl-image*-qa). - -* packagegroup-ivi-common* - - packagegroup-ivi-common-core-automotive.bb - packagegroup-ivi-common-core.bb - packagegroup-ivi-common-core-connectivity.bb - packagegroup-ivi-common-core-graphics.bb - packagegroup-ivi-common-core-kernel.bb - packagegroup-ivi-common-core-multimedia.bb - packagegroup-ivi-common-core-navi-lbs.bb - packagegroup-ivi-common-core-os-commonlibs.bb - packagegroup-ivi-common-core-security.bb - packagegroup-ivi-common-core-speech-services.bb - packagegroup-ivi-common-test.bb - -These are for picking up some packages from upstreams like GENIVI/Tizen/Others. -The layer of ``meta-ivi-common`` has no image to build, all packagegroups are -aggregated to ``packagegroup-ivi-common-core' and it is included by images, -``agl-image-ivi.bb`` and ``agl-demo-platform.bb``. - -## Supported Machines - -See [docs.automotivelinux.org](http://docs.automotivelinux.org) diff --git a/meta-agl/README.md b/meta-agl/README.md new file mode 120000 index 00000000..7c9cc95e --- /dev/null +++ b/meta-agl/README.md @@ -0,0 +1 @@ +meta-agl.md \ No newline at end of file diff --git a/meta-agl/meta-agl-basesystem/conf/include/agl-basesystem-base.inc b/meta-agl/meta-agl-basesystem/conf/include/agl-basesystem-base.inc index 876baaa5..5274ab59 100644 --- a/meta-agl/meta-agl-basesystem/conf/include/agl-basesystem-base.inc +++ b/meta-agl/meta-agl-basesystem/conf/include/agl-basesystem-base.inc @@ -1,7 +1,7 @@ # AGL specific package configuration # # Add systemd configuration -DISTRO_FEATURES_append = " systemd ${DISTRO_FEATURES_LIBC}" +DISTRO_FEATURES_append = " systemd " #VIRTUAL-RUNTIME_init_manager = "systemd" TOOLCHAIN_HOST_TASK_append += " nativesdk-os-rpclibrary-tool nativesdk-perl-module-app-cpan nativesdk-perl-module-json-pp" diff --git a/meta-agl/meta-agl-basesystem/conf/layer.conf b/meta-agl/meta-agl-basesystem/conf/layer.conf index 4052619f..af4e930b 100644 --- a/meta-agl/meta-agl-basesystem/conf/layer.conf +++ b/meta-agl/meta-agl-basesystem/conf/layer.conf @@ -13,4 +13,4 @@ BBFILE_PRIORITY_agl-basesystem = "70" # for agl-basefiles recipe HOSTTOOLS += "xpath xmllint" -LAYERSERIES_COMPAT_agl-basesystem = "thud" +LAYERSERIES_COMPAT_agl-basesystem = "thud dunfell" diff --git a/meta-agl/meta-agl-basesystem/recipes-core/kernel-module-evklib/kernel-module-evklib-1.0.0/evk_lib.c b/meta-agl/meta-agl-basesystem/recipes-core/kernel-module-evklib/kernel-module-evklib-1.0.0/evk_lib.c index d5c1718e..3a7c9af8 100644 --- a/meta-agl/meta-agl-basesystem/recipes-core/kernel-module-evklib/kernel-module-evklib-1.0.0/evk_lib.c +++ b/meta-agl/meta-agl-basesystem/recipes-core/kernel-module-evklib/kernel-module-evklib-1.0.0/evk_lib.c @@ -1286,7 +1286,11 @@ evk_ioctl(struct file *filp, unsigned int cmd, break; case EVK_IOC_CREATE_MESSAGE_QUEUE: +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)) + if (access_ok(arg, sizeof(mesq))) { /* pgr0039 */ +#else if (access_ok(VERIFY_READ, arg, sizeof(mesq))) { /* pgr0039 */ +#endif if (copy_from_user(&mesq, (EV_Flag *)arg, sizeof(mesq))) { ret = -EFAULT; break; @@ -1300,7 +1304,11 @@ evk_ioctl(struct file *filp, unsigned int cmd, break; case EVK_IOC_ALLOC_FLAG_ID: +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)) + if (access_ok(arg, sizeof(queueID))) { /* pgr0039 */ +#else if (access_ok(VERIFY_WRITE, arg, sizeof(queueID))) { /* pgr0039 */ +#endif evk_alloc_flagID(&queueID); if (put_user(queueID, (EV_ID *)arg)) { /* pgr0039 */ ret = -EFAULT; @@ -1313,7 +1321,11 @@ evk_ioctl(struct file *filp, unsigned int cmd, break; case EVK_IOC_ALLOC_FLAG64_ID: +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)) + if (access_ok(arg, sizeof(queueID))) { /* pgr0039 */ +#else if (access_ok(VERIFY_WRITE, arg, sizeof(queueID))) { /* pgr0039 */ +#endif evk_alloc_flag64ID(&queueID); if (put_user(queueID, (EV_ID *)arg)) { /* pgr0039 */ ret = -EFAULT; @@ -1326,7 +1338,11 @@ evk_ioctl(struct file *filp, unsigned int cmd, break; case EVK_IOC_ALLOC_QUEUE_ID: +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)) + if (access_ok(arg, sizeof(queueID))) { /* pgr0039 */ +#else if (access_ok(VERIFY_WRITE, arg, sizeof(queueID))) { /* pgr0039 */ +#endif evk_alloc_queueID(&queueID); if (put_user(queueID, (EV_ID *)arg)) { /* pgr0039 */ ret = -EFAULT; @@ -1344,7 +1360,11 @@ evk_ioctl(struct file *filp, unsigned int cmd, break; case EVK_IOC_STORE_FLAG: +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)) + if (access_ok(arg, sizeof(EV_Flag))) { /* pgr0039 */ +#else if (access_ok(VERIFY_READ, arg, sizeof(EV_Flag))) { /* pgr0039 */ +#endif ret = evk_store_flag((EV_Flag *)arg, evk_mem_user); } else { ret = -EFAULT; @@ -1352,7 +1372,11 @@ evk_ioctl(struct file *filp, unsigned int cmd, break; case EVK_IOC_STORE_FLAG64: +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)) + if (access_ok(arg, sizeof(EV_Flag64))) { /* pgr0039 */ +#else if (access_ok(VERIFY_READ, arg, sizeof(EV_Flag64))) { /* pgr0039 */ +#endif ret = evk_store_flag64((EV_Flag64 *)arg, evk_mem_user); } else { ret = -EFAULT; @@ -1360,7 +1384,11 @@ evk_ioctl(struct file *filp, unsigned int cmd, break; case EVK_IOC_STORE_MESSAGE: +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)) + if (access_ok(arg, sizeof(EV_Message))) { /* pgr0039 */ +#else if (access_ok(VERIFY_READ, arg, sizeof(EV_Message))) { /* pgr0039 */ +#endif ret = evk_store_message((EV_Message *)arg, evk_mem_user); } else { ret = -EFAULT; @@ -1388,7 +1416,11 @@ evk_ioctl(struct file *filp, unsigned int cmd, peek_only = 0; wait = 0; get_event: +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)) + if (access_ok(arg, sizeof(EV_Event))) { /* pgr0039 */ +#else if (access_ok(VERIFY_WRITE, arg, sizeof(EV_Event))) { /* pgr0039 */ +#endif ret = evk_get_event((EV_Event *)arg, peek_only, wait, evk_mem_user); } else { ret = -EFAULT; @@ -1403,7 +1435,11 @@ evk_ioctl(struct file *filp, unsigned int cmd, case EVK_IOC_GET_NEXT_EVENT: peek_only = 0; get_next: +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)) + if (access_ok(arg, sizeof(EVK_Next_Event_Query))) { /* pgr0039 */ +#else if (access_ok(VERIFY_WRITE, arg, sizeof(EVK_Next_Event_Query))) { /* pgr0039 */ +#endif ret = evk_get_next_event((EVK_Next_Event_Query *)arg, peek_only); } else { ret = -EFAULT; diff --git a/meta-agl/meta-agl-basesystem/recipes-graphics/ns-commonlibrary/files/0001-cl_error-remover-gettid-inline-declaration.patch b/meta-agl/meta-agl-basesystem/recipes-graphics/ns-commonlibrary/files/0001-cl_error-remover-gettid-inline-declaration.patch new file mode 100644 index 00000000..de0540c7 --- /dev/null +++ b/meta-agl/meta-agl-basesystem/recipes-graphics/ns-commonlibrary/files/0001-cl_error-remover-gettid-inline-declaration.patch @@ -0,0 +1,25 @@ +From 43656b137f48c4db566cc288f8cabc0f1af6aa4c Mon Sep 17 00:00:00 2001 +From: Harunobu Kurokawa +Date: Wed, 28 Oct 2020 04:27:09 +0900 +Subject: [PATCH] cl_error: remover gettid inline declaration + +gettid is multiple decdeclaration in cl_error +--- + common_library/client/include/cl_error.h | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/common_library/client/include/cl_error.h b/common_library/client/include/cl_error.h +index 84bf64e..1441262 100644 +--- a/common_library/client/include/cl_error.h ++++ b/common_library/client/include/cl_error.h +@@ -21,10 +21,6 @@ + #include + #include + +-static inline int gettid(void) { // NOLINT(readability/nolint) +- return (int)syscall(__NR_gettid); // NOLINT(readability/casting) +-} +- + #define _num_to_str(num) #num + #define num_to_str(num) _num_to_str(num) + #define CL_PERROR(msg) \ diff --git a/meta-agl/meta-agl-basesystem/recipes-graphics/ns-commonlibrary/ns-commonlibrary_1.0.0.bb b/meta-agl/meta-agl-basesystem/recipes-graphics/ns-commonlibrary/ns-commonlibrary_1.0.0.bb index 3d7da9b8..06b17d5c 100644 --- a/meta-agl/meta-agl-basesystem/recipes-graphics/ns-commonlibrary/ns-commonlibrary_1.0.0.bb +++ b/meta-agl/meta-agl-basesystem/recipes-graphics/ns-commonlibrary/ns-commonlibrary_1.0.0.bb @@ -10,9 +10,12 @@ FILES_${PN} += " \ " FILES_${PN}-dev += "/usr/agl/include/*" -SRC_URI = "git://gerrit.automotivelinux.org/gerrit/staging/toyota.git;protocol=https;branch=sandbox/ToshikazuOhiwa/ns-commonlibrary" +SRC_URI = "git://gerrit.automotivelinux.org/gerrit/staging/toyota.git;protocol=https;branch=sandbox/ToshikazuOhiwa/ns-commonlibrary \ + file://0001-cl_error-remover-gettid-inline-declaration.patch \ + " SRCREV = "${AUTOREV}" + PV = "1.0.0+gitr${SRCPV}" S = "${WORKDIR}/git" diff --git a/meta-agl/meta-agl-bsp/LICENSE b/meta-agl/meta-agl-bsp/LICENSE new file mode 100644 index 00000000..e8758f89 --- /dev/null +++ b/meta-agl/meta-agl-bsp/LICENSE @@ -0,0 +1,20 @@ +Different components of the AGL layers are under different licenses (a mix +of MIT and GPLv2). See LICENSE.GPL-2.0-only and LICENSE.MIT for further +details of the individual licenses. + +All metadata (e.g. .bb, .bbappend, .bbclass, .inc, templates/* and similar) +is MIT licensed unless otherwise stated. +Source code included in tree for individual recipes (e.g. patches) are under +the LICENSE stated in the associated recipe (.bb file) unless otherwise stated. + +License information for any other files (scripts) is either explicitly stated +or defaults to GPL version 2 only. + +Individual files can contain the following style tags instead of the full +license text to identify their license: + + SPDX-License-Identifier: GPL-2.0-only + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-bsp/LICENSE.GPL-2.0-only b/meta-agl/meta-agl-bsp/LICENSE.GPL-2.0-only new file mode 100644 index 00000000..5db3c0a2 --- /dev/null +++ b/meta-agl/meta-agl-bsp/LICENSE.GPL-2.0-only @@ -0,0 +1,288 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: GPL-2.0-only + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-bsp/LICENSE.MIT b/meta-agl/meta-agl-bsp/LICENSE.MIT new file mode 100644 index 00000000..a6919eb7 --- /dev/null +++ b/meta-agl/meta-agl-bsp/LICENSE.MIT @@ -0,0 +1,25 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-bsp/classes/sdcard_image-socfpga.bbclass b/meta-agl/meta-agl-bsp/classes/sdcard_image-socfpga.bbclass deleted file mode 100644 index 2967063e..00000000 --- a/meta-agl/meta-agl-bsp/classes/sdcard_image-socfpga.bbclass +++ /dev/null @@ -1,182 +0,0 @@ -inherit image_types - -# Create an sdcard image suitable for the atlas board -# This is copied from the raspberrypi and freescale sdcard classes - -# Disk layout -# 0 -> 8*1024 - reserverd -# 8*1024 -> 32*1024 - -# 32*1024 -> 1024*1024 - -# 1024*1024 -> BOOT_SPACE - bootloader and kernel in Part 3 -# BOOT_SPACE*1024 -> FAT_SPACE - - - -# This image depends on the rootfs image -IMAGE_TYPEDEP_socfpga-sdimg = "${SDIMG_ROOTFS_TYPE}" - -# Boot partition volume id -BOOTDD_VOLUME_ID ?= "${MACHINE}" - -# Boot partition size [in KiB] -> size 2M for A10 -BOOT_SPACE ?= "2048" - -# Fat partition size -FAT_SPACE ?= "102400" - -# uBoot ENV offset -SDIMG_UBOOT_ENV_OFFSET ?= "512" -ENV_BASE_NAME ??= "${UBOOT_CONFIG}" - -# Boot partition begin at sector 1024 -# This is required as for c5/a5 mainline uboot hard codes the location -# of the uboot image in the sdcard to 0xa00 sector -IMAGE_ROOTFS_ALIGNMENT = "1024" - -# ROOTFS_SIZE_MOD ?= "524288" -ROOTFS_SIZE_MOD ?= "16384" - -# Use an uncompressed ext3 by default as rootfs -SDIMG_ROOTFS_TYPE = "ext3" -SDIMG_ROOTFS = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.${SDIMG_ROOTFS_TYPE}" - - -do_image_socfpga_sdimg[depends] += " \ - coreutils-native:do_populate_sysroot \ - parted-native:do_populate_sysroot \ - mtools-native:do_populate_sysroot \ - dosfstools-native:do_populate_sysroot \ - virtual/kernel:do_deploy \ - virtual/bootloader:do_deploy \ - " - -rootfs[depends] += "virtual/kernel:do_deploy" - -# SD card image name -SDIMG = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.socfpga-sdimg" - -IMAGEDATESTAMP = "${@time.strftime('%Y.%m.%d',time.gmtime())}" - -# After uboot v2016.05 the boot partition number was changed from 3 to 1 so as a -# result we need 2 different functions for creating the boot partitions just to -# change the partition creation order - -SOCFPGA_SDIMG_PARTITION_COMMAND ?= "generate_sdcard_partitions" - -generate_sdcard_partitions () { - - # Create partition table - parted -s ${SDIMG} mklabel msdos - # P1: Fat partition - parted -s ${SDIMG} unit KiB mkpart primary fat32 $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED}) $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED} \+ ${FAT_SPACE_ALIGNED}) - # set fat partition as bootable for distroboot - parted -s ${SDIMG} set 1 boot on - # P2: Linux FS partition - parted -s ${SDIMG} unit KiB mkpart primary $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED} \+ ${FAT_SPACE_ALIGNED}) $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED} \+ ${FAT_SPACE_ALIGNED} \+ ${ROOTFS_SIZE_ALIGNED}) - # P3: A2 partition for bootloader - parted -s ${SDIMG} unit KiB mkpart primary ${IMAGE_ROOTFS_ALIGNMENT} $(expr ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT}) - - # set part 3 to type a2 for spl / uboot image - # 446 to partition table, 16 bytes per entry, 4 byte offset to partition type - echo -ne "\xa2" | dd of=${SDIMG} bs=1 count=1 seek=$(expr 446 + 16 + 16 + 4) conv=notrunc && sync && sync - - # Create a vfat image with boot files - FAT_BLOCKS=$(LC_ALL=C parted -s ${SDIMG} unit b print | awk '/ 1 / { print substr($4, 1, length($4 -1)) / 512 /2 }') - rm -f ${WORKDIR}/fat.img - mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/fat.img $FAT_BLOCKS - -} - -IMAGE_CMD_socfpga-sdimg () { - - # Align partitions - BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE} + ${IMAGE_ROOTFS_ALIGNMENT} - 1) - BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE_ALIGNED} - ${BOOT_SPACE_ALIGNED} % ${IMAGE_ROOTFS_ALIGNMENT}) - FAT_SPACE_ALIGNED=$(expr ${FAT_SPACE} + ${IMAGE_ROOTFS_ALIGNMENT} - 1) - FAT_SPACE_ALIGNED=$(expr ${FAT_SPACE_ALIGNED} - ${FAT_SPACE_ALIGNED} % ${IMAGE_ROOTFS_ALIGNMENT}) - - ROOTFS_SIZE_ALIGNED=$(expr ${ROOTFS_SIZE} \+ ${ROOTFS_SIZE_MOD}) - ROOTFS_SIZE_ALIGNED=$(expr ${ROOTFS_SIZE_ALIGNED} \- ${ROOTFS_SIZE_ALIGNED} \% ${ROOTFS_SIZE_MOD}) - - SDIMG_SIZE=$(expr ${IMAGE_ROOTFS_ALIGNMENT} + ${BOOT_SPACE_ALIGNED} + ${FAT_SPACE_ALIGNED} + ${ROOTFS_SIZE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT}) - - # Initialize sdcard image file - dd if=/dev/zero of=${SDIMG} bs=1 count=0 seek=$(expr 1024 \* ${SDIMG_SIZE}) && sync && sync - - # Create partition table - ${SOCFPGA_SDIMG_PARTITION_COMMAND} - - # Copy kernel image - mcopy -i ${WORKDIR}/fat.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin ::/${KERNEL_IMAGETYPE} - - # Copy boot scripts - if [ -e "${DEPLOY_DIR_IMAGE}/${MACHINE}.scr" ] - then - mcopy -i ${WORKDIR}/fat.img -s ${DEPLOY_DIR_IMAGE}/${MACHINE}.scr ::/u-boot.scr - fi - - # Copy device tree file - if test -n "${KERNEL_DEVICETREE}"; then - for DTS_FILE in ${KERNEL_DEVICETREE}; do - DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'` - if [ -e "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb" ]; then - kernel_bin="`readlink ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin`" - kernel_bin_for_dtb="`readlink ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb | sed "s,$DTS_BASE_NAME,${MACHINE},g;s,\.dtb$,.bin,g"`" - if [ $kernel_bin = $kernel_bin_for_dtb ]; then - mcopy -i ${WORKDIR}/fat.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb ::/${DTS_BASE_NAME}.dtb - fi - fi - done - fi - - # copy extlinux stuff - if [ "${UBOOT_EXTLINUX}" = "1" ] - then - if [ -e "${DEPLOY_DIR_IMAGE}/extlinux.conf" ] - then - rm -Rf ${WORKDIR}/extlinux - mkdir ${WORKDIR}/extlinux - cp ${DEPLOY_DIR_IMAGE}/extlinux.conf ${WORKDIR}/extlinux/ - mcopy -i ${WORKDIR}/fat.img -s ${WORKDIR}/extlinux ::/ - fi - - fi - - # copy any files listed as extra files - if test -n "${SOCFPGA_SDIMG_EXTRA_FILES}"; then - for EXTRA_FILE in ${SOCFPGA_SDIMG_EXTRA_FILES}; do - if [ -e "${DEPLOY_DIR_IMAGE}/${EXTRA_FILE}" ]; then - mcopy -i ${WORKDIR}/fat.img -s ${DEPLOY_DIR_IMAGE}/${EXTRA_FILE} ::/${EXTRA_FILE} - fi - done - fi - - # Add stamp file - echo "${IMAGE_NAME}-${IMAGEDATESTAMP}" > ${WORKDIR}/image-version-info - mcopy -i ${WORKDIR}/fat.img -v ${WORKDIR}//image-version-info :: - - # Burn Partitions - dd if=${WORKDIR}/fat.img of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync - # If SDIMG_ROOTFS_TYPE is a .xz file use xzcat - if echo "${SDIMG_ROOTFS_TYPE}" | egrep -q "*\.xz" - then - xzcat ${SDIMG_ROOTFS} | dd of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + 1024 \* ${FAT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync - else - dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + 1024 \* ${FAT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync - fi - - if [ -e "${DEPLOY_DIR_IMAGE}/${SPL_BINARY}-${UBOOT_CONFIG}" ] - then - dd if=${DEPLOY_DIR_IMAGE}/${SPL_BINARY}-${UBOOT_CONFIG} of=${SDIMG} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync - elif [ -e "${DEPLOY_DIR_IMAGE}/${SPL_BINARY}" ] - then - dd if=${DEPLOY_DIR_IMAGE}/${SPL_BINARY} of=${SDIMG} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync - else - bbfatal "${SPL_BINARY} does not exist." - fi - - if [ -e "${DEPLOY_DIR_IMAGE}/u-boot-env-${ENV_BASE_NAME}.bin" ]; then - dd if=${DEPLOY_DIR_IMAGE}/u-boot-env-${ENV_BASE_NAME}.bin of=${SDIMG} conv=notrunc bs=1 seek=${SDIMG_UBOOT_ENV_OFFSET} && sync && sync - fi - -} diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_bbe.inc b/meta-agl/meta-agl-bsp/conf/include/agl_bbe.inc index 5dc81709..5c28bea2 100644 --- a/meta-agl/meta-agl-bsp/conf/include/agl_bbe.inc +++ b/meta-agl/meta-agl-bsp/conf/include/agl_bbe.inc @@ -1,7 +1,7 @@ # This config is for the Sancloud BBE, adapted from the config provider for the # standard Beaglebone -AGL_DEFAULT_IMAGE_FSTYPES = "tar.xz wic.xz wic.bmap" +#AGL_DEFAULT_IMAGE_FSTYPES += "tar.xz" CORE_IMAGE_EXTRA_INSTALL += "packagegroup-machine-base" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_beaglebone.inc b/meta-agl/meta-agl-bsp/conf/include/agl_beaglebone.inc index 1917ff45..cfd189df 100644 --- a/meta-agl/meta-agl-bsp/conf/include/agl_beaglebone.inc +++ b/meta-agl/meta-agl-bsp/conf/include/agl_beaglebone.inc @@ -38,5 +38,3 @@ SECURITY_CFLAGS_pn-libatasmart = "" SECURITY_LDFLAGS_pn-libatasmart = "" WKS_FILE = "sdimage-bootpart-uuid.wks" - -AGL_EXTRA_IMAGE_FSTYPES = "wic.xz wic.bmap wic.xz.sha256sum" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_cubox-i.inc b/meta-agl/meta-agl-bsp/conf/include/agl_cubox-i.inc index b43ef47c..46464325 100644 --- a/meta-agl/meta-agl-bsp/conf/include/agl_cubox-i.inc +++ b/meta-agl/meta-agl-bsp/conf/include/agl_cubox-i.inc @@ -22,6 +22,3 @@ BBMASK = "meta-freescale/recipes-graphics/wayland/weston-init" # Set CMA size large enough to work with AGL UBOOT_EXTLINUX_KERNEL_ARGS_append = " cma=512M" - -# Generate WIC image also -AGL_EXTRA_IMAGE_FSTYPES = "wic.xz wic.bmap wic.xz.sha256sum" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_cyclone5.inc b/meta-agl/meta-agl-bsp/conf/include/agl_cyclone5.inc index 1eaf0ae6..7ebd4090 100644 --- a/meta-agl/meta-agl-bsp/conf/include/agl_cyclone5.inc +++ b/meta-agl/meta-agl-bsp/conf/include/agl_cyclone5.inc @@ -3,9 +3,5 @@ OSTREE_BOOTLOADER ?= "u-boot" # DEFAULTTUNE for cortex-a9 DISTRO_FEATURES_append = " agl-medium-arm-compiler" - -# Add the custom rpi-sdimg output format -AGL_EXTRA_IMAGE_FSTYPES = "wic.xz" - # Use the AGL default ext4.xz to generate the rpi-sdimg SDIMG_ROOTFS_TYPE = "ext4.xz" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_dra7xx-evm.inc b/meta-agl/meta-agl-bsp/conf/include/agl_dra7xx-evm.inc index 2e7741a5..ccc8feb9 100644 --- a/meta-agl/meta-agl-bsp/conf/include/agl_dra7xx-evm.inc +++ b/meta-agl/meta-agl-bsp/conf/include/agl_dra7xx-evm.inc @@ -40,5 +40,3 @@ IMAGE_INSTALL_append = " \ do_image_wic[depends] += "mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot" WKS_FILE = "sdimage-bootpart-uuid.wks" IMAGE_BOOT_FILES = "MLO u-boot.img uEnv.txt" - -AGL_EXTRA_IMAGE_FSTYPES = "wic.xz wic.bmap wic.xz.sha256sum" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_ebisu.inc b/meta-agl/meta-agl-bsp/conf/include/agl_ebisu.inc index f7a73723..2ac93adf 100644 --- a/meta-agl/meta-agl-bsp/conf/include/agl_ebisu.inc +++ b/meta-agl/meta-agl-bsp/conf/include/agl_ebisu.inc @@ -1,4 +1,4 @@ -require conf/include/agl_ulcb.inc +require conf/include/agl_rcar.inc SOC_FAMILY = "r8a77990" BOARD_NAME = "ebisu" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_h3-salvator-x-nogfx.inc b/meta-agl/meta-agl-bsp/conf/include/agl_h3-salvator-x-nogfx.inc new file mode 100644 index 00000000..c1202635 --- /dev/null +++ b/meta-agl/meta-agl-bsp/conf/include/agl_h3-salvator-x-nogfx.inc @@ -0,0 +1,10 @@ +require conf/include/agl_rcar-nogfx.inc +SOC_FAMILY = "r8a7795" +BOARD_NAME = "h3-salvator-x" + +DTB_SUFFIX = "r8a7795-salvator-xs" + +# Mask graphic Pkgs +BBMASK += "gles-user-module|kernel-module-gles|wayland-kms|libgbm" +# Mask MMP recipes +BBMASK += "kernel-module-uvcs-drv|omx-user-module" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_h3-salvator-x.inc b/meta-agl/meta-agl-bsp/conf/include/agl_h3-salvator-x.inc index 74036111..d338a566 100644 --- a/meta-agl/meta-agl-bsp/conf/include/agl_h3-salvator-x.inc +++ b/meta-agl/meta-agl-bsp/conf/include/agl_h3-salvator-x.inc @@ -1,3 +1,9 @@ -# The H3-based (as opposed to the M3-based version) salvator-x needs a different -# MACHINE but otherwise uses the same config as the H3. -require conf/include/agl_h3ulcb.inc +require conf/include/agl_rcar.inc +SOC_FAMILY = "r8a7795" +BOARD_NAME = "h3-salvator-x" + +DTB_SUFFIX = "r8a7795-salvator-xs" + +IMAGE_INSTALL_append_rcar-gen3 = " \ + kernel-module-vspmif \ +" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb-nogfx.inc b/meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb-nogfx.inc index cee2acc3..25755d24 100644 --- a/meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb-nogfx.inc +++ b/meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb-nogfx.inc @@ -1,4 +1,4 @@ -require conf/include/agl_ulcb-nogfx.inc +require conf/include/agl_rcar-nogfx.inc SOC_FAMILY = "r8a7795" BOARD_NAME = "h3ulcb" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb.inc b/meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb.inc index 00c2a70a..eb3836ab 100644 --- a/meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb.inc +++ b/meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb.inc @@ -1,4 +1,4 @@ -require conf/include/agl_ulcb.inc +require conf/include/agl_rcar.inc SOC_FAMILY = "r8a7795" BOARD_NAME = "h3ulcb" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_hsdk.inc b/meta-agl/meta-agl-bsp/conf/include/agl_hsdk.inc index 5967f237..075cea53 100644 --- a/meta-agl/meta-agl-bsp/conf/include/agl_hsdk.inc +++ b/meta-agl/meta-agl-bsp/conf/include/agl_hsdk.inc @@ -1,5 +1,4 @@ KERNEL_IMAGETYPE = "uImage" WKS_FILE = "sdimage-hsdk.wks" -AGL_EXTRA_IMAGE_FSTYPES = "wic.xz" IMAGE_BOOT_FILES = "uImage uboot.env" IMAGE_INSTALL_append = " kernel-modules" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_imx6qdlsabreauto.inc b/meta-agl/meta-agl-bsp/conf/include/agl_imx6qdlsabreauto.inc index b5691778..0d8c6f23 100644 --- a/meta-agl/meta-agl-bsp/conf/include/agl_imx6qdlsabreauto.inc +++ b/meta-agl/meta-agl-bsp/conf/include/agl_imx6qdlsabreauto.inc @@ -16,6 +16,4 @@ BBMASK = "meta-freescale/recipes-graphics/wayland/weston-init" # Set CMA size large enough to work with AGL UBOOT_EXTLINUX_KERNEL_ARGS_append = " cma=512M" -# Generate WIC image also -AGL_EXTRA_IMAGE_FSTYPES = "wic.xz wic.bmap wic.xz.sha256sum" AGL_DEFAULT_INITRAMFS_FSTYPES := "" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_imx8mqevk-common.inc b/meta-agl/meta-agl-bsp/conf/include/agl_imx8mqevk-common.inc new file mode 100644 index 00000000..50567583 --- /dev/null +++ b/meta-agl/meta-agl-bsp/conf/include/agl_imx8mqevk-common.inc @@ -0,0 +1,19 @@ +DISTRO_FEATURES_append = " agl-medium-arm-compiler" + +# Force use of the community supported LTS kernel instead of the +# default linux-imx +IMX_DEFAULT_KERNEL_imx8mqevk = "linux-fslc-imx" + +# For EVKB wifi support +MACHINE_FEATURES_append = " bcm4356" + +# Disable meta-freescale package architecure mangling, as it causes +# issues with AGL's explicit setting of DEFAULTTUNE. +INHERIT_remove = "fsl-dynamic-packagearch" +MACHINE_SOCARCH = "${TUNE_PKGARCH}" + +# Disable the meta-freescale weston-init bbappend as it conflicts +# with AGL's. +BBMASK = "meta-freescale/recipes-graphics/wayland/weston-init" + +AGL_DEFAULT_INITRAMFS_FSTYPES := "" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_imx8mqevk-viv.inc b/meta-agl/meta-agl-bsp/conf/include/agl_imx8mqevk-viv.inc new file mode 100644 index 00000000..8227f5c0 --- /dev/null +++ b/meta-agl/meta-agl-bsp/conf/include/agl_imx8mqevk-viv.inc @@ -0,0 +1 @@ +include agl_imx8mqevk-common.inc diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_imx8mqevk.inc b/meta-agl/meta-agl-bsp/conf/include/agl_imx8mqevk.inc new file mode 100644 index 00000000..88c06336 --- /dev/null +++ b/meta-agl/meta-agl-bsp/conf/include/agl_imx8mqevk.inc @@ -0,0 +1,23 @@ +include agl_imx8mqevk-common.inc + +# NOTE: currently not using IMX_DEFAULT_BSP = "mainline", as it +# requires more changes than this approach of disabling +# Vivante. + +# Add our own over-ride for use in a few recipes where there is +# conflicting Vivante vs etnaviv configuration. +MACHINEOVERRIDES .= ":etnaviv" + +# Knock out Vivante overrides +MACHINEOVERRIDES_EXTENDER_mx8mq_forcevariable = "" +PREFERRED_VERSION_weston_mx8 = "8.0.0" +PREFERRED_VERSION_wayland-protocols_mx8 = "1.20" +PREFERRED_VERSION_libdrm_mx8 = "2.4.100" + +CORE_IMAGE_EXTRA_INSTALL += "libdrm-etnaviv" + +PREFERRED_VERSION_gstreamer1.0_mx8 = "1.16.2" +PREFERRED_VERSION_gstreamer1.0-plugins-base_mx8 = "1.16.2" +PREFERRED_VERSION_gstreamer1.0-plugins-good_mx8 = "1.16.2" +PREFERRED_VERSION_gstreamer1.0-plugins-bad_mx8 = "1.16.2" +PREFERRED_VERSION_gstreamer1.0-plugins-ugly_mx8 = "1.16.2" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_intel-corei7-64.inc b/meta-agl/meta-agl-bsp/conf/include/agl_intel-corei7-64.inc deleted file mode 100644 index 68398371..00000000 --- a/meta-agl/meta-agl-bsp/conf/include/agl_intel-corei7-64.inc +++ /dev/null @@ -1,32 +0,0 @@ -# Enable Libvaapi for HW accelerated video support -# -IMAGE_INSTALL_append = " \ - libva \ - intel-vaapi-driver \ - gstreamer1.0-vaapi" - -AGL_EXTRA_IMAGE_FSTYPES = "wic.xz wic.bmap wic.xz.sha256sum ext4 wic.vmdk" -INITRD_LIVE = "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE_LIVE}-${MACHINE}.ext4.gz" - -# Modify this file under meta-agl-bsp/meta-intel/wic to change the -# kernel command line, including to change the screen resolution. -WKS_FILE = "systemd-intel-corei7-64-bootdisk.wks" - -PREFERRED_VERSION_linux-intel ?= "4.19%" -PREFERRED_VERSION_linux-intel-rt ?= "4.19%" - -SERIAL_CONSOLES_remove = "115200;ttyS2" - -# -# To avoid corrupt boot screen by systemd message, you can use serial -# console separated from VGA console or disable all boot messages by -# kernel command line. -# -# Configuration for serial console -QB_KERNEL_CMDLINE_APPEND_append = " console=ttyS0,115200n8" -# -# All boot message will be off -QB_KERNEL_CMDLINE_APPEND_append = " quiet" -# -# Force the virtio video device as 'vmware' doesn't always work -QB_OPT_APPEND_append = " -vga virtio" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_m3-salvator-x-nogfx.inc b/meta-agl/meta-agl-bsp/conf/include/agl_m3-salvator-x-nogfx.inc new file mode 100644 index 00000000..7f124806 --- /dev/null +++ b/meta-agl/meta-agl-bsp/conf/include/agl_m3-salvator-x-nogfx.inc @@ -0,0 +1,10 @@ +require conf/include/agl_rcar-nogfx.inc +SOC_FAMILY = "r8a7796" +BOARD_NAME = "m3-salvator-x" + +DTB_SUFFIX = "r8a7796-salvator-xs" + +# Mask graphic Pkgs +BBMASK += "gles-user-module|kernel-module-gles|wayland-kms|libgbm" +# Mask MMP recipes +BBMASK += "kernel-module-uvcs-drv|omx-user-module" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_m3-salvator-x.inc b/meta-agl/meta-agl-bsp/conf/include/agl_m3-salvator-x.inc new file mode 100644 index 00000000..5dcb5373 --- /dev/null +++ b/meta-agl/meta-agl-bsp/conf/include/agl_m3-salvator-x.inc @@ -0,0 +1,9 @@ +require conf/include/agl_rcar.inc +SOC_FAMILY = "r8a7796" +BOARD_NAME = "m3-salvator-x" + +DTB_SUFFIX = "r8a7796-salvator-xs" + +IMAGE_INSTALL_append_rcar-gen3 = " \ + kernel-module-vspmif \ +" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb-nogfx.inc b/meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb-nogfx.inc index a5789c32..5092c4bc 100644 --- a/meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb-nogfx.inc +++ b/meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb-nogfx.inc @@ -1,4 +1,4 @@ -require conf/include/agl_ulcb-nogfx.inc +require conf/include/agl_rcar-nogfx.inc SOC_FAMILY = "r8a7796" BOARD_NAME = "m3ulcb" @@ -8,3 +8,7 @@ DTB_SUFFIX = "r8a7796-m3ulcb" BBMASK += "gles-user-module|kernel-module-gles|wayland-kms|libgbm" # Mask MMP recipes BBMASK += "kernel-module-uvcs-drv|omx-user-module" + +DISTRO_FEATURES_append = "${@bb.utils.contains('AGL_XEN_WANTED', '1', ' xen', '', d)}" +IMAGE_INSTALL_append = "${@bb.utils.contains('AGL_XEN_WANTED', '1', ' xen-base xen-mkimage', '', d)}" + diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb.inc b/meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb.inc index 7a1d6add..b845e8c3 100644 --- a/meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb.inc +++ b/meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb.inc @@ -1,5 +1,8 @@ -require conf/include/agl_ulcb.inc +require conf/include/agl_rcar.inc SOC_FAMILY = "r8a7796" BOARD_NAME = "m3ulcb" DTB_SUFFIX = "r8a7796-m3ulcb" + +DISTRO_FEATURES_append = "${@bb.utils.contains('AGL_XEN_WANTED', '1', ' xen', '', d)}" +IMAGE_INSTALL_append = "${@bb.utils.contains('AGL_XEN_WANTED', '1', ' xen-base xen-mkimage', '', d)}" \ No newline at end of file diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_nitrogen6x.inc b/meta-agl/meta-agl-bsp/conf/include/agl_nitrogen6x.inc index 5864354b..77eb9734 100644 --- a/meta-agl/meta-agl-bsp/conf/include/agl_nitrogen6x.inc +++ b/meta-agl/meta-agl-bsp/conf/include/agl_nitrogen6x.inc @@ -16,7 +16,5 @@ BBMASK = "meta-freescale/recipes-graphics/wayland/weston-init" # Set CMA size large enough to work with AGL UBOOT_EXTLINUX_KERNEL_ARGS_append = " cma=512M" -# Generate WIC image also #WKS_FILE = "imx-uboot.wks" -AGL_EXTRA_IMAGE_FSTYPES = "wic.xz wic.bmap wic.xz.sha256sum" AGL_DEFAULT_INITRAMFS_FSTYPES := "" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_qemux86-64.inc b/meta-agl/meta-agl-bsp/conf/include/agl_qemux86-64.inc index 11295c7e..3915a5e4 100644 --- a/meta-agl/meta-agl-bsp/conf/include/agl_qemux86-64.inc +++ b/meta-agl/meta-agl-bsp/conf/include/agl_qemux86-64.inc @@ -20,8 +20,21 @@ QB_KERNEL_CMDLINE_APPEND_append = " quiet" # Build updatable image. Only takes effect when sota.bbclass is inherited DISTRO_FEATURES_append = " sota" +# Add firmware required by Up^2 board and default Intel mPCIe wifi card +# sold by upshop.org +MACHINE_EXTRA_RRECOMMENDS_append = " \ + linux-firmware-i915 \ + linux-firmware-rtl8168 \ + linux-firmware-ibt-hw-37-8 \ + linux-firmware-iwlwifi-7265d \ + wireless-regdb-static \ +" + # Image support -AGL_EXTRA_IMAGE_FSTYPES = "ext4 wic.vmdk wic.xz wic.bmap" +# NOTE: wic.{xz,bmap} are here since qemu targets override +# AGL_DEFAULT_IMAGE_FSTYPES to not include them, but for Intel +# we actually do want them for use on physical hardware. +AGL_EXTRA_IMAGE_FSTYPES = "wic.xz wic.bmap ${@bb.utils.contains('DISTRO_FEATURES', 'AGLCI', 'wic.vmdk.xz', 'wic.vmdk', d)}" IMAGE_BOOT_FILES_sota = "u-boot-qemux86-64.rom" # Root device diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi3.inc b/meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi3.inc index 94dc5ace..a4989b79 100644 --- a/meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi3.inc +++ b/meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi3.inc @@ -1,32 +1,20 @@ # Maximum memory allowed to be assigned -GPU_MEM = "128" +GPU_MEM = "256" -ENABLE_CMA = "1" # Add CMA to the kernel arguments for SOTA OSTREE_KERNEL_ARGS_sota_append = " cma=256M" -CMA_LWM = "16" -CMA_HWM = "32" -MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2" +#MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2" -# The correct config for a Raspberry Pi 3 in 32bit mode -UBOOT_MACHINE = "rpi_3_32b_config" +# use u-boot always +RPI_USE_U_BOOT = "1" -KERNEL_IMAGETYPE = "uImage" - -PREFERRED_VERSION_linux-raspberrypi = "4.19%" -RPI_KERNEL_DEVICETREE_remove_raspberrypi3 = "bcm2708-rpi-0-w.dtb" -RPI_KERNEL_DEVICETREE_OVERLAYS_remove_raspberrypi3 = "overlays/lirc-rpi.dtbo" -RPI_KERNEL_DEVICETREE_OVERLAYS_append_raspberrypi3 = " overlays/vc4-fkms-v3d.dtbo" - -# Set appropriate version of Mesa for Raspberry Pi 3 and 4 -PREFERRED_VERSION_mesa = "19.1%" +#RPI_KERNEL_DEVICETREE_remove_raspberrypi3 = "bcm2708-rpi-0-w.dtb" +#RPI_KERNEL_DEVICETREE_OVERLAYS_remove_raspberrypi3 = "overlays/lirc-rpi.dtbo" +#RPI_KERNEL_DEVICETREE_OVERLAYS_append_raspberrypi3 = " overlays/vc4-fkms-v3d.dtbo" MACHINE_FEATURES += "vc4graphics" -# Switch to firmware KMS to support the official DSI touchscreen display -VC4DTBO = "vc4-fkms-v3d" - # For libomxil #LICENSE_FLAGS_WHITELIST = "commercial" @@ -37,17 +25,3 @@ IMAGE_FEATURES_remove = "splash" # Build updatable image. Only takes effect when sota.bbclass is inherited DISTRO_FEATURES_append = " sota" - -# Create WIC images to write to SD cards. -WKS_FILE = "sdimage-raspberrypi.wks" -AGL_EXTRA_IMAGE_FSTYPES = "wic.xz wic.bmap wic.xz.sha256sum" -IMAGE_BOOT_FILES = "bcm2835-bootfiles/* \ - ${@make_dtb_boot_files(d)} \ - ${@bb.utils.contains('KERNEL_IMAGETYPE', 'uImage', \ - '${KERNEL_IMAGETYPE} u-boot.bin;${SDIMG_KERNELIMAGE} boot.scr', \ - '${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}', d)} \ - " -do_image_wic[depends] += " \ - bcm2835-bootfiles:do_deploy \ - ${@bb.utils.contains('KERNEL_IMAGETYPE', 'uImage', 'u-boot:do_deploy', '',d)} \ - " diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi4.inc b/meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi4.inc new file mode 100644 index 00000000..ae302aae --- /dev/null +++ b/meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi4.inc @@ -0,0 +1,28 @@ +# Maximum memory allowed to be assigned +GPU_MEM = "256" + +# Add CMA to the kernel arguments for SOTA +OSTREE_KERNEL_ARGS_sota_append = " cma=256M" + +# use u-boot always +RPI_USE_U_BOOT = "1" + +# For libomxil +#LICENSE_FLAGS_WHITELIST = "commercial" + +IMAGE_INSTALL_append = " kernel-modules linux-firmware-rpidistro-bcm43430 linux-firmware-rpidistro-bcm43455 create-combined-dtb " + +# Psplash causes crash on first boot on RPi +IMAGE_FEATURES_remove = "splash" + +# Build updatable image. Only takes effect when sota.bbclass is inherited +DISTRO_FEATURES_append = " sota" + +# Add xen build, if the xen feature activated +DISTRO_FEATURES_append = " ${@bb.utils.contains('AGL_XEN_WANTED', '1', ' xen', '', d)}" + +# add xen-tools to build +IMAGE_INSTALL_append = " ${@bb.utils.contains('AGL_XEN_WANTED', '1', 'xen-tools xen-mkimage-rpi4', '', d)}" + +# Add xen-raspberry binary to boot files +IMAGE_BOOT_FILES_append = " ${@bb.utils.contains('AGL_XEN_WANTED','1', 'xen-${MACHINE}', '',d)}" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_rcar-nogfx.inc b/meta-agl/meta-agl-bsp/conf/include/agl_rcar-nogfx.inc new file mode 100644 index 00000000..a7fabfac --- /dev/null +++ b/meta-agl/meta-agl-bsp/conf/include/agl_rcar-nogfx.inc @@ -0,0 +1,9 @@ +DISTRO_FEATURES_append = " sota" + +OSTREE_KERNEL = "Image" +IMAGE_BOOT_FILES_sota = "renesas-ota-bootfiles/* ${DTB_SUFFIX}.dtb" +OSTREE_BOOTLOADER ?= "u-boot" + +WKS_FILE = "singlepart-noloader.wks" + +RENESAS_DATADIR = "/usr" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_rcar.inc b/meta-agl/meta-agl-bsp/conf/include/agl_rcar.inc new file mode 100644 index 00000000..dd64ae77 --- /dev/null +++ b/meta-agl/meta-agl-bsp/conf/include/agl_rcar.inc @@ -0,0 +1,50 @@ +require conf/include/agl_rcar-nogfx.inc + +# Enable AGL virtualization features +MACHINE_FEATURES_append = " agl-egvirt" + +# Enable Gfx Pkgs +MACHINE_FEATURES_append = " gsx" +MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2" + +# for Wayland/Weston +PREFERRED_PROVIDER_virtual/libgles1 = "" +PREFERRED_PROVIDER_virtual/libgles2 = "virtual-gles-user-module" +PREFERRED_PROVIDER_virtual/egl = "virtual-gles-user-module" +PREFERRED_PROVIDER_virtual/libgl = "" +PREFERRED_PROVIDER_virtual/mesa = "mesa" +PREFERRED_PROVIDER_libgbm = "libgbm" +PREFERRED_RPROVIDER_libgbm-dev = "libgbm" + +PREFERRED_RPROVIDER_libomxil = "omx-user-module" +PREFERRED_PROVIDER_virtual/libomxil = "omx-user-module" + +# Add for gstreamer plugins ugly +LICENSE_FLAGS_WHITELIST = "commercial" + +MACHINE_FEATURES_append = " multimedia" + +DISTRO_FEATURES_append = " use_eva_pkg" + +#DISTRO_FEATURES_append = " h265dec_lib mpeg2dec_lib" +DISTRO_FEATURES_append = " h264dec_lib h264enc_lib aaclcdec_lib aaclcdec_mdw" + +# Mask out meta-renesas-rcar-gen3's tweaks to weston-init, as they do +# not seem necessary for anything in AGL, and the addition of +# dbus.service and multi-user.target dependencies to the weston systemd +# unit that is done is problematic with respect to potentially blocking +# weston if any user units like application framework "platform" +# services fail. They also likely affect boot up speed with respect to +# getting weston started. There is no clear rationale expressed in the +# meta-renesas-rcar-gen3 commit history for the extra dependencies, and +# testing shows no issues on H3ULCB when not having them. +BBMASK += "meta-rcar-gen3/recipes-graphics/wayland/weston-init.bbappend" + +IMAGE_INSTALL_append_rcar-gen3 = " \ + kernel-devicetree \ + kernel-module-pvrsrvkm \ + kernel-module-vsp2 \ + kernel-module-vspm \ + kernel-module-vspm-if \ + omx-user-module \ +" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_ulcb-nogfx.inc b/meta-agl/meta-agl-bsp/conf/include/agl_ulcb-nogfx.inc deleted file mode 100644 index 8d97996f..00000000 --- a/meta-agl/meta-agl-bsp/conf/include/agl_ulcb-nogfx.inc +++ /dev/null @@ -1,10 +0,0 @@ -DISTRO_FEATURES_append = " sota" - -OSTREE_KERNEL = "Image" -IMAGE_BOOT_FILES_sota = "renesas-ota-bootfiles/* Image-${DTB_SUFFIX}.dtb" -OSTREE_BOOTLOADER ?= "u-boot" - -WKS_FILE = "singlepart-noloader.wks" -AGL_EXTRA_IMAGE_FSTYPES = "wic.xz wic.bmap wic.xz.sha256sum" - -RENESAS_DATADIR = "/usr" diff --git a/meta-agl/meta-agl-bsp/conf/include/agl_ulcb.inc b/meta-agl/meta-agl-bsp/conf/include/agl_ulcb.inc deleted file mode 100644 index d71a6941..00000000 --- a/meta-agl/meta-agl-bsp/conf/include/agl_ulcb.inc +++ /dev/null @@ -1,41 +0,0 @@ -require conf/include/agl_ulcb-nogfx.inc - -# Enable AGL virtualization features -MACHINE_FEATURES_append = " agl-egvirt" - -# for Wayland/Weston weston-laucher -DISTRO_FEATURES_append = " pam" - -# Enable Gfx Pkgs -MACHINE_FEATURES_append = " gsx" -MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2" - -# for Wayland/Weston -PREFERRED_PROVIDER_virtual/libgles1 = "" -PREFERRED_PROVIDER_virtual/libgles2 = "virtual-gles-user-module" -PREFERRED_PROVIDER_virtual/egl = "virtual-gles-user-module" -PREFERRED_PROVIDER_virtual/libgl = "" -PREFERRED_PROVIDER_virtual/mesa = "mesa" -PREFERRED_PROVIDER_libgbm = "libgbm" -PREFERRED_RPROVIDER_libgbm-dev = "libgbm" - -PREFERRED_RPROVIDER_libomxil = "omx-user-module" - -# Add for gstreamer plugins ugly -LICENSE_FLAGS_WHITELIST = "commercial" - -MACHINE_FEATURES_append = " multimedia" - -DISTRO_FEATURES_append = " use_eva_pkg" - -#DISTRO_FEATURES_append = " h265dec_lib mpeg2dec_lib" -DISTRO_FEATURES_append = " h264dec_lib h264enc_lib aaclcdec_lib aaclcdec_mdw" - -IMAGE_INSTALL_append_rcar-gen3 = " \ - kernel-devicetree \ - kernel-module-pvrsrvkm \ - kernel-module-vsp2 \ - kernel-module-vspm \ - kernel-module-vspm-if \ - omx-user-module \ -" diff --git a/meta-agl/meta-agl-bsp/conf/layer.conf b/meta-agl/meta-agl-bsp/conf/layer.conf index 35bf8112..2a999ddd 100644 --- a/meta-agl/meta-agl-bsp/conf/layer.conf +++ b/meta-agl/meta-agl-bsp/conf/layer.conf @@ -23,4 +23,4 @@ BBFILE_COLLECTIONS += "aglbsp" BBFILE_PATTERN_aglbsp = "^${LAYERDIR}/" BBFILE_PRIORITY_aglbsp = "60" -LAYERSERIES_COMPAT_aglbsp = "thud" +LAYERSERIES_COMPAT_aglbsp = "dunfell" diff --git a/meta-agl/meta-agl-bsp/conf/machine/include/rpi4-base.inc b/meta-agl/meta-agl-bsp/conf/machine/include/rpi4-base.inc deleted file mode 100644 index a19d0f88..00000000 --- a/meta-agl/meta-agl-bsp/conf/machine/include/rpi4-base.inc +++ /dev/null @@ -1,125 +0,0 @@ -include conf/machine/include/rpi-default-settings.inc -include conf/machine/include/rpi-default-versions.inc -include conf/machine/include/rpi-default-providers.inc - -SOC_FAMILY = "rpi" -include conf/machine/include/soc-family.inc - -IMAGE_FSTYPES ?= "tar.bz2 ext3 rpi-sdimg" -WKS_FILE ?= "sdimage-raspberrypi.wks" - -XSERVER = " \ - xserver-xorg \ - ${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "xserver-xorg-extension-glx", "", d)} \ - ${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "xf86-video-modesetting", "xf86-video-fbdev", d)} \ - " - -RPI_KERNEL_DEVICETREE_OVERLAYS ?= " \ - overlays/at86rf233.dtbo \ - overlays/dwc2.dtbo \ - overlays/gpio-key.dtbo \ - overlays/hifiberry-amp.dtbo \ - overlays/hifiberry-dac.dtbo \ - overlays/hifiberry-dacplus.dtbo \ - overlays/hifiberry-digi.dtbo \ - overlays/i2c-rtc.dtbo \ - overlays/iqaudio-dac.dtbo \ - overlays/iqaudio-dacplus.dtbo \ - overlays/mcp2515-can0.dtbo \ - overlays/pi3-disable-bt.dtbo \ - overlays/pi3-miniuart-bt.dtbo \ - overlays/pitft22.dtbo \ - overlays/pitft28-resistive.dtbo \ - overlays/pitft35-resistive.dtbo \ - overlays/pps-gpio.dtbo \ - overlays/rpi-ft5406.dtbo \ - overlays/rpi-poe.dtbo \ - overlays/vc4-kms-v3d.dtbo \ - overlays/vc4-fkms-v3d.dtbo \ - overlays/w1-gpio-pullup.dtbo \ - overlays/w1-gpio.dtbo \ - " - -RPI_KERNEL_DEVICETREE ?= " \ - bcm2708-rpi-zero-w.dtb \ - bcm2708-rpi-b.dtb \ - bcm2708-rpi-b-plus.dtb \ - bcm2709-rpi-2-b.dtb \ - bcm2710-rpi-3-b.dtb \ - bcm2710-rpi-3-b-plus.dtb \ - bcm2711-rpi-4-b.dtb \ - bcm2708-rpi-cm.dtb \ - bcm2710-rpi-cm3.dtb \ - " - -KERNEL_DEVICETREE ?= " \ - ${RPI_KERNEL_DEVICETREE} \ - ${RPI_KERNEL_DEVICETREE_OVERLAYS} \ - " - -# Different dtb and dtbo files are needed for Raspberry Pi 4 -# (64-bit) if feature agl-sota is enabled. -KERNEL_DEVICETREE_raspberrypi4_sota = " broadcom/bcm2711-rpi-4-b.dtb overlays/vc4-fkms-v3d.dtbo overlays/uart0-rpi4.dtbo" - -# By default: -# -# * When u-boot is disabled use the "Image" format which can be directly loaded -# by the rpi firmware. -# -# * When u-boot is enabled use the "uImage" format and the "bootm" command -# within u-boot to load the kernel. -KERNEL_BOOTCMD ??= "bootm" -KERNEL_IMAGETYPE_UBOOT ??= "uImage" -KERNEL_IMAGETYPE_DIRECT ??= "zImage" -KERNEL_IMAGETYPE ?= "${@bb.utils.contains('RPI_USE_U_BOOT', '1', \ - '${KERNEL_IMAGETYPE_UBOOT}', '${KERNEL_IMAGETYPE_DIRECT}', d)}" - -MACHINE_FEATURES += "apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio ${@bb.utils.contains('DISABLE_VC4GRAPHICS', '1', '', 'vc4graphics', d)}" - -# Raspberry Pi has no hardware clock -MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc" - -MACHINE_EXTRA_RRECOMMENDS += " kernel-modules udev-rules-rpi" - -# Set Raspberrypi splash image -SPLASH = "psplash-raspberrypi" - -def make_dtb_boot_files(d): - # Generate IMAGE_BOOT_FILES entries for device tree files listed in - # KERNEL_DEVICETREE. - alldtbs = d.getVar('KERNEL_DEVICETREE') - imgtyp = d.getVar('KERNEL_IMAGETYPE') - - def transform(dtb): - base = os.path.basename(dtb) - if dtb.endswith('dtb'): - # eg: whatever/bcm2708-rpi-b.dtb has: - # DEPLOYDIR file: bcm2708-rpi-b.dtb - # destination: bcm2708-rpi-b.dtb - return base - elif dtb.endswith('dtbo'): - # overlay dtb: - # eg: overlays/hifiberry-amp.dtbo has: - # DEPLOYDIR file: hifiberry-amp.dtbo - # destination: overlays/hifiberry-amp.dtbo - return '{};{}'.format(base, dtb) - - return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb]) - - -IMAGE_BOOT_FILES ?= "bcm2835-bootfiles/* \ - ${@make_dtb_boot_files(d)} \ - ${@bb.utils.contains('RPI_USE_U_BOOT', '1', \ - '${KERNEL_IMAGETYPE} u-boot.bin;${SDIMG_KERNELIMAGE} boot.scr', \ - '${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}', d)} \ - " -do_image_wic[depends] += " \ - bcm2835-bootfiles:do_deploy \ - ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \ - " - -do_image_wic[recrdeps] = "do_build" - -# The kernel image is installed into the FAT32 boot partition and does not need -# to also be installed into the rootfs. -RDEPENDS_${KERNEL_PACKAGE_NAME}-base = "" diff --git a/meta-agl/meta-agl-bsp/conf/machine/raspberrypi4.conf b/meta-agl/meta-agl-bsp/conf/machine/raspberrypi4.conf deleted file mode 100644 index a09d881d..00000000 --- a/meta-agl/meta-agl-bsp/conf/machine/raspberrypi4.conf +++ /dev/null @@ -1,37 +0,0 @@ -#@TYPE: Machine -#@NAME: RaspberryPi 4 Development Board (64bit) -#@DESCRIPTION: Machine configuration for the RaspberryPi 4 in 64 bits mode - -MACHINEOVERRIDES = "raspberrypi4:${MACHINE}" - -MACHINE_EXTRA_RRECOMMENDS += "\ - linux-firmware-rpidistro-bcm43455 \ - bluez-firmware-rpidistro-bcm4345c0-hcd \ - pi-bluetooth \ -" - -require conf/machine/include/arm/arch-arm64.inc -include conf/machine/include/rpi4-base.inc - -RPI_KERNEL_DEVICETREE = " \ - broadcom/bcm2711-rpi-4-b.dtb \ -" - -SDIMG_KERNELIMAGE ?= "kernel8.img" -SERIAL_CONSOLES ?= "115200;ttyS0" - -MACHINE_FEATURES_append = " vc4graphics" -UBOOT_MACHINE = "rpi_4_config" - -VC4DTBO ?= "vc4-fkms-v3d" - -# When u-boot is enabled we need to use the "Image" format and the "booti" -# command to load the kernel -KERNEL_IMAGETYPE_UBOOT ?= "Image" -# "zImage" not supported on arm64 and ".gz" images not supported by bootloader yet -KERNEL_IMAGETYPE_DIRECT ?= "Image" -KERNEL_BOOTCMD ?= "booti" - -RPI_EXTRA_CONFIG ?= "\n# Force arm in 64bit mode. See: https://github.com/raspberrypi/firmware/issues/1193.\narm_64bit=1" - -ARMSTUB ?= "armstub8-gic.bin" diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-graphics/mesa/files/0001-kmsro-add-imx-dcss.patch b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-graphics/mesa/files/0001-kmsro-add-imx-dcss.patch new file mode 100644 index 00000000..7f7ab912 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-graphics/mesa/files/0001-kmsro-add-imx-dcss.patch @@ -0,0 +1,34 @@ +Add i.MX8MQ DCSS kmsro support + +Add required dummy entry for NXP's i.MX8MQ DCSS display controller DRM +driver to the kmsro configuration so that the loader will not think it +is a GPU. + +Upstream-Status: pending +Signed-off-by: Scott Murray +--- + +diff --git a/src/gallium/targets/dri/meson.build b/src/gallium/targets/dri/meson.build +index ae25a21..17379c7 100644 +--- a/src/gallium/targets/dri/meson.build ++++ b/src/gallium/targets/dri/meson.build +@@ -72,6 +72,7 @@ foreach d : [[with_gallium_kmsro, [ + 'hx8357d_dri.so', + 'ili9225_dri.so', + 'ili9341_dri.so', ++ 'imx-dcss_dri.so', + 'imx-drm_dri.so', + 'ingenic-drm_dri.so', + 'mcde_dri.so', +diff --git a/src/gallium/targets/dri/target.c b/src/gallium/targets/dri/target.c +index f71f690..41c5c75 100644 +--- a/src/gallium/targets/dri/target.c ++++ b/src/gallium/targets/dri/target.c +@@ -97,6 +97,7 @@ DEFINE_LOADER_DRM_ENTRYPOINT(exynos) + DEFINE_LOADER_DRM_ENTRYPOINT(hx8357d) + DEFINE_LOADER_DRM_ENTRYPOINT(ili9225) + DEFINE_LOADER_DRM_ENTRYPOINT(ili9341) ++DEFINE_LOADER_DRM_ENTRYPOINT(imx_dcss) + DEFINE_LOADER_DRM_ENTRYPOINT(imx_drm) + DEFINE_LOADER_DRM_ENTRYPOINT(ingenic_drm) + DEFINE_LOADER_DRM_ENTRYPOINT(mcde) diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-graphics/mesa/mesa_%.bbappend b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-graphics/mesa/mesa_%.bbappend new file mode 100644 index 00000000..636b75c5 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-graphics/mesa/mesa_%.bbappend @@ -0,0 +1,10 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI += "file://0001-kmsro-add-imx-dcss.patch" + +# These over-rides should use "use-mainline-bsp" instead when that +# becomes more workable for i.MX8 in upstream meta-freescale. + +USE_OSMESA_ONLY_etnaviv = "no" + +PACKAGECONFIG_append_etnaviv = " gallium etnaviv kmsro" diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-init.bbappend b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-init.bbappend deleted file mode 100644 index 2e1c950e..00000000 --- a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-init.bbappend +++ /dev/null @@ -1 +0,0 @@ -WESTONARGS_append_imxgpu3d = " --use-gl" diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/imx8mq-evkb.cfg b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/imx8mq-evkb.cfg new file mode 100644 index 00000000..92915921 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/imx8mq-evkb.cfg @@ -0,0 +1 @@ +CONFIG_BRCMSMAC=m diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0001-enable-mhdp-with-etnaviv.patch b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0001-enable-mhdp-with-etnaviv.patch new file mode 100644 index 00000000..23ca0475 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0001-enable-mhdp-with-etnaviv.patch @@ -0,0 +1,23 @@ +Tweak MHDP driver Kconfig so it can be enabled with etnaviv + +The MHDP driver is needed for using HDMI on the i.MX8MQ EVK, tweak its +Kconfig entry so that it can be enabled when using etnaviv, not just +Vivante. + +Upstream-Status: pending +Signed-off-by: Scott Murray +--- + +diff --git a/drivers/gpu/drm/imx/Kconfig b/drivers/gpu/drm/imx/Kconfig +index 63d5f1b532ee..a18ba56aa218 100644 +--- a/drivers/gpu/drm/imx/Kconfig ++++ b/drivers/gpu/drm/imx/Kconfig +@@ -85,7 +85,7 @@ config DRM_IMX_CDNS_MHDP + select DRM_CDNS_DP + select DRM_CDNS_HDMI + select DRM_CDNS_AUDIO +- depends on DRM_IMX ++ depends on DRM_IMX || DRM_ETNAVIV + help + Choose this if you want to use HDMI on i.MX8. + diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0002-dts-enable-etnaviv.patch b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0002-dts-enable-etnaviv.patch new file mode 100644 index 00000000..4ce9b9d3 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0002-dts-enable-etnaviv.patch @@ -0,0 +1,23 @@ +Enable etnaviv support in i.MX8MQ EVK devicetree + +Some further investigation is required into how to manage this upstream +in meta-freescale, as it is not required for the i.MX6 platforms AFAIK. + +Upstream-Status: pending + +Signed-off-by: Scott Murray +--- + +diff --git a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts +index f2a7e4069a0d..c0b6c5052656 100755 +--- a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts ++++ b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts +@@ -1074,7 +1074,7 @@ + status = "okay"; + }; + +-&gpu3d { ++&gpu { + status = "okay"; + }; + diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0003-drm-etnaviv-fix-TS-cache-flushing-on-GPUs-with-BLT-e.patch b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0003-drm-etnaviv-fix-TS-cache-flushing-on-GPUs-with-BLT-e.patch new file mode 100644 index 00000000..d7a1f85b --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0003-drm-etnaviv-fix-TS-cache-flushing-on-GPUs-with-BLT-e.patch @@ -0,0 +1,151 @@ +From f232d9ec029ce3e2543b05213e2979e01e503408 Mon Sep 17 00:00:00 2001 +From: Lucas Stach +Date: Wed, 26 Feb 2020 16:27:08 +0100 +Subject: [PATCH] drm/etnaviv: fix TS cache flushing on GPUs with BLT engine + +As seen in the Vivante kernel driver, most GPUs with the BLT engine have +a broken TS cache flush. The workaround is to temporarily set the BLT +command to CLEAR_IMAGE, without actually executing the clear. Apparently +this state change is enough to trigger the required TS cache flush. As +the BLT engine is completely asychronous, we also need a few more stall +states to synchronize the flush with the frontend. + +Root-caused-by: Jonathan Marek +Signed-off-by: Lucas Stach +--- + drivers/gpu/drm/etnaviv/etnaviv_buffer.c | 60 ++++++++++++++++++++++-- + drivers/gpu/drm/etnaviv/state_blt.xml.h | 2 + + 2 files changed, 57 insertions(+), 5 deletions(-) + +diff --git a/drivers/gpu/drm/etnaviv/etnaviv_buffer.c b/drivers/gpu/drm/etnaviv/etnaviv_buffer.c +index 32d9fac587f9..76d38561c910 100644 +--- a/drivers/gpu/drm/etnaviv/etnaviv_buffer.c ++++ b/drivers/gpu/drm/etnaviv/etnaviv_buffer.c +@@ -12,6 +12,7 @@ + + #include "common.xml.h" + #include "state.xml.h" ++#include "state_blt.xml.h" + #include "state_hi.xml.h" + #include "state_3d.xml.h" + #include "cmdstream.xml.h" +@@ -233,6 +234,8 @@ void etnaviv_buffer_end(struct etnaviv_gpu *gpu) + struct etnaviv_cmdbuf *buffer = &gpu->buffer; + unsigned int waitlink_offset = buffer->user_size - 16; + u32 link_target, flush = 0; ++ bool has_blt = !!(gpu->identity.minor_features5 & ++ chipMinorFeatures5_BLT_ENGINE); + + lockdep_assert_held(&gpu->lock); + +@@ -248,16 +251,38 @@ void etnaviv_buffer_end(struct etnaviv_gpu *gpu) + if (flush) { + unsigned int dwords = 7; + ++ if (has_blt) ++ dwords += 10; ++ + link_target = etnaviv_buffer_reserve(gpu, buffer, dwords); + + CMD_SEM(buffer, SYNC_RECIPIENT_FE, SYNC_RECIPIENT_PE); + CMD_STALL(buffer, SYNC_RECIPIENT_FE, SYNC_RECIPIENT_PE); ++ if (has_blt) { ++ CMD_LOAD_STATE(buffer, VIVS_BLT_ENABLE, 0x1); ++ CMD_SEM(buffer, SYNC_RECIPIENT_FE, SYNC_RECIPIENT_BLT); ++ CMD_STALL(buffer, SYNC_RECIPIENT_FE, SYNC_RECIPIENT_BLT); ++ CMD_LOAD_STATE(buffer, VIVS_BLT_ENABLE, 0x0); ++ } + CMD_LOAD_STATE(buffer, VIVS_GL_FLUSH_CACHE, flush); +- if (gpu->exec_state == ETNA_PIPE_3D) +- CMD_LOAD_STATE(buffer, VIVS_TS_FLUSH_CACHE, +- VIVS_TS_FLUSH_CACHE_FLUSH); ++ if (gpu->exec_state == ETNA_PIPE_3D) { ++ if (has_blt) { ++ CMD_LOAD_STATE(buffer, VIVS_BLT_ENABLE, 0x1); ++ CMD_LOAD_STATE(buffer, VIVS_BLT_SET_COMMAND, 0x1); ++ CMD_LOAD_STATE(buffer, VIVS_BLT_ENABLE, 0x0); ++ } else { ++ CMD_LOAD_STATE(buffer, VIVS_TS_FLUSH_CACHE, ++ VIVS_TS_FLUSH_CACHE_FLUSH); ++ } ++ } + CMD_SEM(buffer, SYNC_RECIPIENT_FE, SYNC_RECIPIENT_PE); + CMD_STALL(buffer, SYNC_RECIPIENT_FE, SYNC_RECIPIENT_PE); ++ if (has_blt) { ++ CMD_LOAD_STATE(buffer, VIVS_BLT_ENABLE, 0x1); ++ CMD_SEM(buffer, SYNC_RECIPIENT_FE, SYNC_RECIPIENT_BLT); ++ CMD_STALL(buffer, SYNC_RECIPIENT_FE, SYNC_RECIPIENT_BLT); ++ CMD_LOAD_STATE(buffer, VIVS_BLT_ENABLE, 0x0); ++ } + CMD_END(buffer); + + etnaviv_buffer_replace_wait(buffer, waitlink_offset, +@@ -323,6 +348,8 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, u32 exec_state, + bool switch_mmu_context = gpu->mmu_context != mmu_context; + unsigned int new_flush_seq = READ_ONCE(gpu->mmu_context->flush_seq); + bool need_flush = switch_mmu_context || gpu->flush_seq != new_flush_seq; ++ bool has_blt = !!(gpu->identity.minor_features5 & ++ chipMinorFeatures5_BLT_ENGINE); + + lockdep_assert_held(&gpu->lock); + +@@ -433,6 +460,15 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, u32 exec_state, + * 2 semaphore stall + 1 event + 1 wait + 1 link. + */ + return_dwords = 7; ++ ++ /* ++ * When the BLT engine is present we need 6 more dwords in the return ++ * target: 3 enable/flush/disable + 4 enable/semaphore stall/disable, ++ * but we don't need the normal TS flush state. ++ */ ++ if (has_blt) ++ return_dwords += 6; ++ + return_target = etnaviv_buffer_reserve(gpu, buffer, return_dwords); + CMD_LINK(cmdbuf, return_dwords, return_target); + +@@ -447,11 +483,25 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, u32 exec_state, + CMD_LOAD_STATE(buffer, VIVS_GL_FLUSH_CACHE, + VIVS_GL_FLUSH_CACHE_DEPTH | + VIVS_GL_FLUSH_CACHE_COLOR); +- CMD_LOAD_STATE(buffer, VIVS_TS_FLUSH_CACHE, +- VIVS_TS_FLUSH_CACHE_FLUSH); ++ if (has_blt) { ++ CMD_LOAD_STATE(buffer, VIVS_BLT_ENABLE, 0x1); ++ CMD_LOAD_STATE(buffer, VIVS_BLT_SET_COMMAND, 0x1); ++ CMD_LOAD_STATE(buffer, VIVS_BLT_ENABLE, 0x0); ++ } else { ++ CMD_LOAD_STATE(buffer, VIVS_TS_FLUSH_CACHE, ++ VIVS_TS_FLUSH_CACHE_FLUSH); ++ } + } + CMD_SEM(buffer, SYNC_RECIPIENT_FE, SYNC_RECIPIENT_PE); + CMD_STALL(buffer, SYNC_RECIPIENT_FE, SYNC_RECIPIENT_PE); ++ ++ if (has_blt) { ++ CMD_LOAD_STATE(buffer, VIVS_BLT_ENABLE, 0x1); ++ CMD_SEM(buffer, SYNC_RECIPIENT_FE, SYNC_RECIPIENT_BLT); ++ CMD_STALL(buffer, SYNC_RECIPIENT_FE, SYNC_RECIPIENT_BLT); ++ CMD_LOAD_STATE(buffer, VIVS_BLT_ENABLE, 0x0); ++ } ++ + CMD_LOAD_STATE(buffer, VIVS_GL_EVENT, VIVS_GL_EVENT_EVENT_ID(event) | + VIVS_GL_EVENT_FROM_PE); + CMD_WAIT(buffer); +diff --git a/drivers/gpu/drm/etnaviv/state_blt.xml.h b/drivers/gpu/drm/etnaviv/state_blt.xml.h +index daae55995def..0e8bcf9dcc93 100644 +--- a/drivers/gpu/drm/etnaviv/state_blt.xml.h ++++ b/drivers/gpu/drm/etnaviv/state_blt.xml.h +@@ -46,6 +46,8 @@ DEALINGS IN THE SOFTWARE. + + /* This is a cut-down version of the state_blt.xml.h file */ + ++#define VIVS_BLT_SET_COMMAND 0x000140ac ++ + #define VIVS_BLT_ENABLE 0x000140b8 + #define VIVS_BLT_ENABLE_ENABLE 0x00000001 + +-- +2.20.1 + diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0004-drm-sched-Fix-passing-zero-to-PTR_ERR-warning-v2.patch b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0004-drm-sched-Fix-passing-zero-to-PTR_ERR-warning-v2.patch new file mode 100644 index 00000000..8c141a0f --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0004-drm-sched-Fix-passing-zero-to-PTR_ERR-warning-v2.patch @@ -0,0 +1,50 @@ +From d7c5782acd354bdb5ed0fa10e1e397eaed558390 Mon Sep 17 00:00:00 2001 +From: Andrey Grodzovsky +Date: Tue, 29 Oct 2019 11:03:05 -0400 +Subject: [PATCH] drm/sched: Fix passing zero to 'PTR_ERR' warning v2 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fix a static code checker warning. + +v2: Drop PTR_ERR_OR_ZERO. + +Signed-off-by: Andrey Grodzovsky +Reviewed-by: Emily Deng +Reviewed-by: Christian König +Signed-off-by: Alex Deucher +--- + drivers/gpu/drm/scheduler/sched_main.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c +index 2af64459b3d7..fbb6446c4f69 100644 +--- a/drivers/gpu/drm/scheduler/sched_main.c ++++ b/drivers/gpu/drm/scheduler/sched_main.c +@@ -496,8 +496,10 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched) + fence = sched->ops->run_job(s_job); + + if (IS_ERR_OR_NULL(fence)) { ++ if (IS_ERR(fence)) ++ dma_fence_set_error(&s_fence->finished, PTR_ERR(fence)); ++ + s_job->s_fence->parent = NULL; +- dma_fence_set_error(&s_fence->finished, PTR_ERR(fence)); + } else { + s_job->s_fence->parent = fence; + } +@@ -746,8 +748,9 @@ static int drm_sched_main(void *param) + r); + dma_fence_put(fence); + } else { ++ if (IS_ERR(fence)) ++ dma_fence_set_error(&s_fence->finished, PTR_ERR(fence)); + +- dma_fence_set_error(&s_fence->finished, PTR_ERR(fence)); + drm_sched_process_job(NULL, &sched_job->cb); + } + +-- +2.20.1 + diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/etnaviv.cfg b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/etnaviv.cfg new file mode 100644 index 00000000..35602c6d --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/etnaviv.cfg @@ -0,0 +1,4 @@ +CONFIG_DRM_IMX=n +CONFIG_DRM_IMX_CDNS_MHDP=y +CONFIG_DRM_ROCKCHIP=n +CONFIG_DRM_ETNAVIV=y diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend index 54159823..4dc51369 100644 --- a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend +++ b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend @@ -1,7 +1,17 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:${THISDIR}/files:" require recipes-kernel/linux/linux-agl.inc +# These patches and the configuration fragment below will need to be +# revisited if/when using IMX_DEFAULT_BSP = "mainline" with i.MX8 +# becomes more feasible with upstream meta-freescale. +SRC_URI_append_etnaviv = " \ + file://0001-enable-mhdp-with-etnaviv.patch \ + file://0002-dts-enable-etnaviv.patch \ + file://0003-drm-etnaviv-fix-TS-cache-flushing-on-GPUs-with-BLT-e.patch \ + file://0004-drm-sched-Fix-passing-zero-to-PTR_ERR-warning-v2.patch \ +" + # Make sure these are enabled so that AGL configurations work SRC_URI_append = " file://tmpfs.cfg" KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/tmpfs.cfg" @@ -10,14 +20,19 @@ KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/namespace.cfg" SRC_URI_append = " file://cgroup.cfg" KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/cgroup.cfg" -#------------------------------------------------------------------------- -# smack patches for handling bluetooth - -SRC_URI_append_with-lsm-smack = "\ - file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \ -" - # Support for CFG80211 subsystem SRC_URI_append = " file://cfg80211.cfg" KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/cfg80211.cfg" +# Support for i.MX8MQ EVKB (e.g. Broadcom wifi) +SRC_URI_append_imx8mqevk = " file://imx8mq-evkb.cfg" +KERNEL_CONFIG_FRAGMENTS_append_imx8mqevk = " ${WORKDIR}/imx8mq-evkb.cfg" + +# Build in etnaviv if required +SRC_URI_append_etnaviv = " file://etnaviv.cfg" +KERNEL_CONFIG_FRAGMENTS_append_etnaviv = " ${WORKDIR}/etnaviv.cfg" + +# Turn off a couple of things enabled by default by Freescale +# (lock debugging and userspace firmware loader fallback) +SRC_URI_append = " file://fixups.cfg" +KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/fixups.cfg" diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase/0014-Add-IMX-GPU-support.patch b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase/0014-Add-IMX-GPU-support.patch deleted file mode 100644 index 8489b6f3..00000000 --- a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase/0014-Add-IMX-GPU-support.patch +++ /dev/null @@ -1,17 +0,0 @@ -Index: git/mkspecs/linux-oe-g++/qmake.conf -=================================================================== ---- git.orig/mkspecs/linux-oe-g++/qmake.conf 2016-12-14 16:51:48.468955533 -0600 -+++ git/mkspecs/linux-oe-g++/qmake.conf 2016-12-14 17:03:17.000000000 -0600 -@@ -39,5 +39,12 @@ isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG - - include(../oe-device-extra.pri) - -+QMAKE_CFLAGS += -DLINUX=1 -DEGL_API_FB=1 -+QMAKE_CXXFLAGS += -DLINUX=1 -DEGL_API_FB=1 -+ -+QMAKE_LIBS_EGL += -lEGL -+QMAKE_LIBS_OPENGL_ES2 += -lEGL -lGLESv2 -+QMAKE_LIBS_OPENVG += -lEGL -lOpenVG -+ - load(device_config) - load(qt_config) diff --git a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase_%.bbappend b/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase_%.bbappend deleted file mode 100644 index c4afc30e..00000000 --- a/meta-agl/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase_%.bbappend +++ /dev/null @@ -1,5 +0,0 @@ - -# Fixing Qt5.8 build breaks by overriding original patches with ours -# This will be fixed in the latest meta-freescale upstream -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl/meta-agl-bsp/meta-intel/recipes-graphics/wayland/weston-ini-conf.bbappend deleted file mode 100644 index 00767197..00000000 --- a/meta-agl/meta-agl-bsp/meta-intel/recipes-graphics/wayland/weston-ini-conf.bbappend +++ /dev/null @@ -1,3 +0,0 @@ -# Select a different rotation for our default panel. -SRC_URI_remove = "file://hdmi-a-1-270.cfg" -SRC_URI += "file://hdmi-a-1-90.cfg" diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux-firmware/linux-firmware_git.bbappend b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux-firmware/linux-firmware_git.bbappend deleted file mode 100644 index e69de29b..00000000 diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/extra-graphic-devices.cfg b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/extra-graphic-devices.cfg deleted file mode 100644 index d2b64de6..00000000 --- a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/extra-graphic-devices.cfg +++ /dev/null @@ -1,40 +0,0 @@ -CONFIG_MWIFIEX_PCIE=m -CONFIG_MWIFIEX_USB=m -CONFIG_RSI_91X=m -CONFIG_RSI_DEBUGFS=y -CONFIG_RSI_SDIO=m -CONFIG_RSI_USB=m -CONFIG_DRM_RADEON=m -CONFIG_DRM_RADEON_USERPTR=y -CONFIG_DRM_NOUVEAU=m -CONFIG_NOUVEAU_DEBUG=5 -CONFIG_NOUVEAU_DEBUG_DEFAULT=3 -CONFIG_DRM_NOUVEAU_BACKLIGHT=y -CONFIG_DRM_VGEM=m -CONFIG_DRM_VMWGFX=m -CONFIG_DRM_VMWGFX_FBCON=y -CONFIG_DRM_GMA500=m -CONFIG_DRM_GMA600=y -CONFIG_DRM_GMA3600=y -CONFIG_DRM_UDL=m -CONFIG_FB_DEFERRED_IO=y -CONFIG_FB_BACKLIGHT=y -CONFIG_IRQ_BYPASS_MANAGER=m -CONFIG_ACPI_WMI=m -CONFIG_MXM_WMI=m -CONFIG_SCHED_INFO=y -CONFIG_HAVE_KVM_IRQCHIP=y -CONFIG_HAVE_KVM_IRQFD=y -CONFIG_HAVE_KVM_IRQ_ROUTING=y -CONFIG_HAVE_KVM_EVENTFD=y -CONFIG_KVM_MMIO=y -CONFIG_KVM_ASYNC_PF=y -CONFIG_HAVE_KVM_MSI=y -CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y -CONFIG_KVM_VFIO=y -CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y -CONFIG_KVM_COMPAT=y -CONFIG_HAVE_KVM_IRQ_BYPASS=y -CONFIG_KVM=m -CONFIG_KVM_INTEL=m -CONFIG_CRC7=m diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/fix_branch.scc b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/fix_branch.scc deleted file mode 100644 index d94108d9..00000000 --- a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/fix_branch.scc +++ /dev/null @@ -1,3 +0,0 @@ - -branch bxt-rebase -mark patching start diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/lava.cfg b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/lava.cfg deleted file mode 100644 index 4dcf4036..00000000 --- a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/lava.cfg +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_NBD=y -CONFIG_BLK_DEV_INITRD=y diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/net-devices.cfg b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/net-devices.cfg deleted file mode 100644 index ab88cedc..00000000 --- a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/net-devices.cfg +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_IGB=y -CONFIG_R8169=y diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/security-tpm.cfg b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/security-tpm.cfg deleted file mode 100644 index b66b1b9b..00000000 --- a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/security-tpm.cfg +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_TCG_TPM=y -CONFIG_TCG_TIS=y -CONFIG_TCG_CRB=y diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/startup.nsh b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/startup.nsh deleted file mode 100644 index 33746243..00000000 --- a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/startup.nsh +++ /dev/null @@ -1 +0,0 @@ -fs0:EFI\BOOT\BOOTx64.EFI diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/upsquare.cfg b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/upsquare.cfg deleted file mode 100644 index 7be178bf..00000000 --- a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/upsquare.cfg +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG_MFD_CORE=y -CONFIG_MFD_INTEL_LPSS=y -CONFIG_MFD_INTEL_LPSS_ACPI=y -CONFIG_MFD_INTEL_LPSS_PCI=y diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/usb-devices.cfg b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/usb-devices.cfg deleted file mode 100644 index 19c57796..00000000 --- a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/usb-devices.cfg +++ /dev/null @@ -1,82 +0,0 @@ -CONFIG_BT_QCA=m -CONFIG_BT_HCIBTSDIO=m -CONFIG_BT_HCIUART=m -CONFIG_BT_HCIUART_BCSP=y -CONFIG_BT_HCIUART_ATH3K=y -CONFIG_BT_HCIUART_LL=y -CONFIG_BT_HCIUART_3WIRE=y -CONFIG_BT_HCIUART_BCM=y -CONFIG_BT_HCIUART_QCA=y -CONFIG_BT_HCIBCM203X=m -CONFIG_BT_HCIBPA10X=m -CONFIG_BT_HCIBFUSB=m -CONFIG_BT_HCIVHCI=m -CONFIG_BT_MRVL=m -CONFIG_BT_MRVL_SDIO=m -CONFIG_BT_ATH3K=m -CONFIG_WIRELESS_EXT=y -CONFIG_WEXT_SPY=y -CONFIG_WEXT_PRIV=y -CONFIG_CFG80211_WEXT_EXPORT=y -CONFIG_LIB80211=m -CONFIG_LIB80211_CRYPT_WEP=m -CONFIG_LIB80211_CRYPT_CCMP=m -CONFIG_LIB80211_CRYPT_TKIP=m -# CONFIG_LIB80211_DEBUG is not set -CONFIG_VHOST_NET=m -CONFIG_VHOST_RING=m -CONFIG_VHOST=m -CONFIG_MICROCHIP_PHY=m -CONFIG_USB_CATC=m -CONFIG_USB_KAWETH=m -CONFIG_USB_PEGASUS=m -CONFIG_USB_RTL8152=m -CONFIG_USB_LAN78XX=m -CONFIG_USB_NET_SR9800=m -CONFIG_USB_NET_RNDIS_HOST=m -CONFIG_USB_HSO=m -CONFIG_USB_IPHETH=m -CONFIG_USB_ZD1201=m -CONFIG_USB_NET_RNDIS_WLAN=m -CONFIG_RTL8180=m -CONFIG_RTL8187=m -CONFIG_RTL8187_LEDS=y -CONFIG_MWL8K=m -# CONFIG_B43_BUSES_BCMA_AND_SSB is not set -# CONFIG_B43_BUSES_BCMA is not set -# CONFIG_B43_BUSES_SSB is not set -CONFIG_BRCMFMAC_PROTO_MSGBUF=y -CONFIG_BRCMFMAC_PCIE=y -CONFIG_IPW2100=m -CONFIG_IPW2100_MONITOR=y -CONFIG_IPW2100_DEBUG=y -CONFIG_IPW2200=m -CONFIG_IPW2200_MONITOR=y -CONFIG_IPW2200_RADIOTAP=y -CONFIG_IPW2200_PROMISCUOUS=y -CONFIG_IPW2200_QOS=y -CONFIG_IPW2200_DEBUG=y -CONFIG_LIBIPW=m -CONFIG_LIBIPW_DEBUG=y -CONFIG_LIBERTAS=m -CONFIG_LIBERTAS_USB=m -CONFIG_LIBERTAS_SDIO=m -CONFIG_LIBERTAS_SPI=m -# CONFIG_LIBERTAS_DEBUG is not set -# CONFIG_LIBERTAS_MESH is not set -CONFIG_RTL8XXXU=m -CONFIG_RTL8XXXU_UNTESTED=y -CONFIG_WLAN_VENDOR_TI=y -CONFIG_WL1251=m -# CONFIG_WL1251_SPI is not set -# CONFIG_WL1251_SDIO is not set -CONFIG_WL12XX=m -CONFIG_WL18XX=m -CONFIG_WLCORE=m -CONFIG_WLCORE_SPI=m -CONFIG_WLCORE_SDIO=m -CONFIG_WILINK_PLATFORM_DATA=y -CONFIG_ZD1211RW=m -CONFIG_ZD1211RW_DEBUG=y -CONFIG_MWIFIEX=m -# CONFIG_MWIFIEX_SDIO is not set diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-intel_%.bbappend b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-intel_%.bbappend deleted file mode 100644 index 88ac94b1..00000000 --- a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-intel_%.bbappend +++ /dev/null @@ -1 +0,0 @@ -require recipes-kernel/linux/linux-agl.inc diff --git a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-intel_4.19%.bbappend b/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-intel_4.19%.bbappend deleted file mode 100644 index 9827b3e7..00000000 --- a/meta-agl/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-intel_4.19%.bbappend +++ /dev/null @@ -1,28 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -# adding most supported USB Bluetooth, Wifi, and Ethernet devices -SRC_URI_append = " file://usb-devices.cfg" -KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/usb-devices.cfg" - -# adding support for other graphic cards to work on more PC HW -SRC_URI_append = " file://extra-graphic-devices.cfg" -KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/extra-graphic-devices.cfg" - -# adding internal network in kernel for network boot -SRC_URI_append = " file://net-devices.cfg" -KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/net-devices.cfg" - -# adding specific driver needed by the upsquare board -SRC_URI_append = " file://upsquare.cfg" -KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/upsquare.cfg" - -# adding CONFIG needed by LAVA and NBD -SRC_URI_append = " file://lava.cfg" -KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/lava.cfg" - -# Ensure we have a startup.nsh file -SRC_URI_append = " file://startup.nsh" - -do_deploy_append() { - install -m 0755 ${WORKDIR}/startup.nsh ${DEPLOYDIR}/ -} diff --git a/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-aws/aws-iot-device-sdk-embedded-c/aws-iot-device-sdk-embedded-c.bb b/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-aws/aws-iot-device-sdk-embedded-c/aws-iot-device-sdk-embedded-c.bb new file mode 100644 index 00000000..a3f67004 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-aws/aws-iot-device-sdk-embedded-c/aws-iot-device-sdk-embedded-c.bb @@ -0,0 +1,40 @@ +DESCRIPTION = "AWS IoT device SDK for embedded C" +AUTHOR = "AWS" +HOMEPAGE = "https://github.com/aws/aws-iot-device-sdk-embedded-C" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=acc7a1bf87c055789657b148939e4b40" + +SRC_URI = "\ + git://github.com/aws/aws-iot-device-sdk-embedded-C.git;protocol=https \ + file://Makefile.aws \ + file://aws_iot_config.h \ + file://awsiotsdk.pc \ +" +SRCREV = "d039f075e1cc2a2a7fc20edc6868f328d8d36b2f" + +S = "${WORKDIR}/git" +B = "${WORKDIR}/build" + +DEPENDS = "mbedtls" +RDEPENDS_${PN} += "mbedtls" + +do_configure_prepend() { + cp ${WORKDIR}/Makefile.aws ${S}/src + cp ${WORKDIR}/aws_iot_config.h ${S}/include + cp ${WORKDIR}/awsiotsdk.pc ${S} +} + +do_compile() { + cd ${S}/src + oe_runmake -f ./Makefile.aws DESTDIR=${D} all +} + +do_install() { + cd ${S}/src + oe_runmake -f ./Makefile.aws DESTDIR=${D} install +} + +BBCLASSEXTEND = "native nativesdk" + +ALLOW_EMPTY_${PN} = "1" + diff --git a/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-aws/aws-iot-device-sdk-embedded-c/files/Makefile.aws b/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-aws/aws-iot-device-sdk-embedded-c/files/Makefile.aws new file mode 100644 index 00000000..d4f18c0f --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-aws/aws-iot-device-sdk-embedded-c/files/Makefile.aws @@ -0,0 +1,62 @@ +########################################################################### +# Copyright 2020 MERA +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +########################################################################### + +# Generated library name +NAME := awsiotsdk + +SRC = . +AWS_SDK_DIR = $(SRC)/.. +PLATFORM_DIR = $(AWS_SDK_DIR)/platform/linux/mbedtls +PLATFORM_COMMON_DIR = $(AWS_SDK_DIR)/platform/linux/common +AWS_INSTALL_HEADERS_DIR = /usr/include/awsiotsdk + + +CFLAGS += -I $(AWS_SDK_DIR)/include +CFLAGS += -I $(AWS_SDK_DIR)/external_libs/jsmn +CFLAGS += -I $(PLATFORM_COMMON_DIR) +CFLAGS += -I $(PLATFORM_DIR) +CFLAGS += -DENABLE_IOT_DEBUG -DENABLE_IOT_INFO -DENABLE_IOT_WARN -DENABLE_IOT_ERROR + + +# Source to compile +SRCS += $(wildcard $(SRC)/*.c) +SRCS += $(wildcard $(AWS_SDK_DIR)/external_libs/jsmn/*.c) +SRCS += $(wildcard $(PLATFORM_DIR)/*.c) +SRCS += $(wildcard $(PLATFORM_COMMON_DIR)/*.c) + +OBJS = $(SRCS:.c=.o) + + +.PHONY: all +all: lib$(NAME).a + +lib$(NAME).a: $(OBJS) + $(AR) -rcs $@ $(OBJS) + +.PHONY: install +install: lib$(NAME).a + install -D -m 0644 lib$(NAME).a $(DESTDIR)/usr/lib/lib$(NAME).a + install -d $(DESTDIR)$(AWS_INSTALL_HEADERS_DIR) + install -m 0644 $(AWS_SDK_DIR)/include/*.h $(DESTDIR)$(AWS_INSTALL_HEADERS_DIR)/ + install -m 0644 $(AWS_SDK_DIR)/external_libs/jsmn/*.h $(DESTDIR)$(AWS_INSTALL_HEADERS_DIR)/ + install -m 0644 $(PLATFORM_COMMON_DIR)/*.h $(DESTDIR)$(AWS_INSTALL_HEADERS_DIR)/ + install -m 0644 $(PLATFORM_DIR)/*.h $(DESTDIR)$(AWS_INSTALL_HEADERS_DIR)/ + install -d $(DESTDIR)/usr/lib/pkgconfig + install -m 0644 ../awsiotsdk.pc $(DESTDIR)/usr/lib/pkgconfig/ + +.PHONY: clean +clean: + -rm -f lib$(NAME).a $(OBJS) diff --git a/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-aws/aws-iot-device-sdk-embedded-c/files/aws_iot_config.h b/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-aws/aws-iot-device-sdk-embedded-c/files/aws_iot_config.h new file mode 100644 index 00000000..e0118933 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-aws/aws-iot-device-sdk-embedded-c/files/aws_iot_config.h @@ -0,0 +1,58 @@ +/* + * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/** + * @file aws_iot_config.h + * @brief AWS IoT specific configuration file + */ + +#ifndef AWS_IOT_CONFIG_H_ +#define AWS_IOT_CONFIG_H_ + +// Get from console +// ================================================= +#define AWS_IOT_MQTT_HOST "" ///< Customer specific MQTT HOST. The same will be used for Thing Shadow +#define AWS_IOT_MQTT_PORT 443 ///< default port for MQTT/S +#define AWS_IOT_MQTT_CLIENT_ID "" ///< MQTT client ID should be unique for every device +#define AWS_IOT_MY_THING_NAME "" ///< Thing Name of the Shadow this device is associated with +#define AWS_IOT_ROOT_CA_FILENAME "" ///< Root CA file name +#define AWS_IOT_CERTIFICATE_FILENAME "" ///< device signed certificate file name +#define AWS_IOT_PRIVATE_KEY_FILENAME "" ///< Device private key filename +// ================================================= + +// MQTT PubSub +#define AWS_IOT_MQTT_TX_BUF_LEN 10240 ///< Any time a message is sent out through the MQTT layer. The message is copied into this buffer anytime a publish is done. This will also be used in the case of Thing Shadow +#define AWS_IOT_MQTT_RX_BUF_LEN 10240 ///< Any message that comes into the device should be less than this buffer size. If a received message is bigger than this buffer size the message will be dropped. +#define AWS_IOT_MQTT_NUM_SUBSCRIBE_HANDLERS 5 ///< Maximum number of topic filters the MQTT client can handle at any given time. This should be increased appropriately when using Thing Shadow + +// Thing Shadow specific configs +#define SHADOW_MAX_SIZE_OF_RX_BUFFER (AWS_IOT_MQTT_RX_BUF_LEN+1) ///< Maximum size of the SHADOW buffer to store the received Shadow message, including terminating NULL byte. +#define MAX_SIZE_OF_UNIQUE_CLIENT_ID_BYTES 80 ///< Maximum size of the Unique Client Id. For More info on the Client Id refer \ref response "Acknowledgments" +#define MAX_SIZE_CLIENT_ID_WITH_SEQUENCE MAX_SIZE_OF_UNIQUE_CLIENT_ID_BYTES + 10 ///< This is size of the extra sequence number that will be appended to the Unique client Id +#define MAX_SIZE_CLIENT_TOKEN_CLIENT_SEQUENCE MAX_SIZE_CLIENT_ID_WITH_SEQUENCE + 20 ///< This is size of the the total clientToken key and value pair in the JSON +#define MAX_ACKS_TO_COMEIN_AT_ANY_GIVEN_TIME 10 ///< At Any given time we will wait for this many responses. This will correlate to the rate at which the shadow actions are requested +#define MAX_THINGNAME_HANDLED_AT_ANY_GIVEN_TIME 10 ///< We could perform shadow action on any thing Name and this is maximum Thing Names we can act on at any given time +#define MAX_JSON_TOKEN_EXPECTED 120 ///< These are the max tokens that is expected to be in the Shadow JSON document. Include the metadata that gets published +#define MAX_SHADOW_TOPIC_LENGTH_WITHOUT_THINGNAME 60 ///< All shadow actions have to be published or subscribed to a topic which is of the format $aws/things/{thingName}/shadow/update/accepted. This refers to the size of the topic without the Thing Name +#define MAX_SIZE_OF_THING_NAME 30 ///< The Thing Name should not be bigger than this value. Modify this if the Thing Name needs to be bigger +#define MAX_SHADOW_TOPIC_LENGTH_BYTES MAX_SHADOW_TOPIC_LENGTH_WITHOUT_THINGNAME + MAX_SIZE_OF_THING_NAME ///< This size includes the length of topic with Thing Name + +// Auto Reconnect specific config +#define AWS_IOT_MQTT_MIN_RECONNECT_WAIT_INTERVAL 1000 ///< Minimum time before the First reconnect attempt is made as part of the exponential back-off algorithm +#define AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL 128000 ///< Maximum time interval after which exponential back-off will stop attempting to reconnect. + +#define DISABLE_METRICS true ///< Disable the collection of metrics by setting this to true + +#endif /* AWS_IOT_CONFIG_H_ */ diff --git a/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-aws/aws-iot-device-sdk-embedded-c/files/awsiotsdk.pc b/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-aws/aws-iot-device-sdk-embedded-c/files/awsiotsdk.pc new file mode 100644 index 00000000..f8384993 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-aws/aws-iot-device-sdk-embedded-c/files/awsiotsdk.pc @@ -0,0 +1,27 @@ +########################################################################### +# Copyright 2020 MERA +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +########################################################################### + +prefix=/usr +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include/awsiotsdk + +Name: AWS IoT Device SDK for Embedded C +Description: AWS IoT SDK compiled into library (includes mbedTLS and jsmn code) +Version: 3.0.1 + +Cflags: -I${includedir} -DENABLE_IOT_DEBUG -DENABLE_IOT_INFO -DENABLE_IOT_WARN -DENABLE_IOT_ERROR +Libs: -L${libdir} -lawsiotsdk -lmbedtls -lmbedcrypto -lmbedx509 diff --git a/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-azure/azure-iot-sdk-c/azure-iot-sdk-c_%.bbappend b/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-azure/azure-iot-sdk-c/azure-iot-sdk-c_%.bbappend new file mode 100644 index 00000000..ecd5fe2f --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-azure/azure-iot-sdk-c/azure-iot-sdk-c_%.bbappend @@ -0,0 +1,5 @@ +# Disable the amqp transport, due to linking error in meta-iot repository for amqp +# symbols from amqp code are not included in the libiothub_client.so + +# NOTE: amqp is not used by AGL in IoT context at the moment +PACKAGECONFIG_remove = "amqp" diff --git a/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-azure/azure-macro-utils-c/azure-macro-utils-c_%.bbappend b/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-azure/azure-macro-utils-c/azure-macro-utils-c_%.bbappend new file mode 100644 index 00000000..afe3e9cd --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-azure/azure-macro-utils-c/azure-macro-utils-c_%.bbappend @@ -0,0 +1 @@ +ALLOW_EMPTY_${PN} = "1" diff --git a/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-azure/umock-c/umock-c_%.bbappend b/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-azure/umock-c/umock-c_%.bbappend new file mode 100644 index 00000000..afe3e9cd --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-iot-cloud/recipes-azure/umock-c/umock-c_%.bbappend @@ -0,0 +1 @@ +ALLOW_EMPTY_${PN} = "1" diff --git a/meta-agl/meta-agl-bsp/meta-qcom/recipes-kernel/linux/linux-linaro-qcomlt_%.bbappend b/meta-agl/meta-agl-bsp/meta-qcom/recipes-kernel/linux/linux-linaro-qcomlt_%.bbappend new file mode 100644 index 00000000..0b2b99d4 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-qcom/recipes-kernel/linux/linux-linaro-qcomlt_%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +require recipes-kernel/linux/linux-agl.inc diff --git a/meta-agl/meta-agl-bsp/meta-qcom/recipes-kernel/linux/linux-linaro-qcomlt_4.14.bbappend b/meta-agl/meta-agl-bsp/meta-qcom/recipes-kernel/linux/linux-linaro-qcomlt_4.14.bbappend deleted file mode 100644 index 0b2b99d4..00000000 --- a/meta-agl/meta-agl-bsp/meta-qcom/recipes-kernel/linux/linux-linaro-qcomlt_4.14.bbappend +++ /dev/null @@ -1,3 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -require recipes-kernel/linux/linux-agl.inc diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend deleted file mode 100644 index fc1ba88c..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend +++ /dev/null @@ -1,12 +0,0 @@ -RDEPENDS_${PN}_append_sota += " u-boot-otascript" - -RPIFW_DATE = "20191021" -SRCREV = "ed238d3329e39a68bde03bbc2dfc293c0c3dc93a" -RPIFW_SRC_URI = "https://github.com/raspberrypi/firmware/archive/${SRCREV}.tar.gz" -RPIFW_S = "${WORKDIR}/firmware-${SRCREV}" - -SRC_URI = "${RPIFW_SRC_URI}" -SRC_URI[md5sum] = "d18066531018a972ed927a6cc136cfff" -SRC_URI[sha256sum] = "82048cf88f4f50f7cf83e34d93923ceb5147885761d33ee5f4dc980b4a7a426a" - -PV = "${RPIFW_DATE}" diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/bootfiles.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/bootfiles.bbappend new file mode 100644 index 00000000..adb19c09 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/bootfiles.bbappend @@ -0,0 +1 @@ +RDEPENDS_${PN}_append_sota += " u-boot-otascript" diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend index 5eecff6f..bbab3df4 100644 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend +++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend @@ -1,47 +1,52 @@ DISABLE_OVERSCAN = "1" +TOTAL_BOARD_MEM = "3072" do_deploy_append_raspberrypi4() { # ENABLE CAN if [ "${ENABLE_CAN}" = "1" ]; then - echo "# Enable CAN" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt - echo "dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "# Enable CAN" >>${DEPLOYDIR}/bootfiles/config.txt + echo "dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25" >>${DEPLOYDIR}/bootfiles/config.txt fi # Handle setup with armstub file if [ -n "${ARMSTUB}" ]; then - echo "\n# ARM stub configuration" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt - echo "armstub=${ARMSTUB}" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "\n# ARM stub configuration" >> ${DEPLOYDIR}/bootfiles/config.txt + echo "armstub=${ARMSTUB}" >> ${DEPLOYDIR}/bootfiles/config.txt case "${ARMSTUB}" in *-gic.bin) - echo "enable_gic=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "enable_gic=1" >> ${DEPLOYDIR}/bootfiles/config.txt ;; esac fi + + if [ "${AGL_XEN_WANTED}" = "1" ]; then + echo "total_mem=${TOTAL_BOARD_MEM}" >> ${DEPLOYDIR}/bootfiles/config.txt + fi } do_deploy_append() { if [ "${ENABLE_CMA}" = "1" ] && [ -n "${CMA_LWM}" ]; then - sed -i '/#cma_lwm/ c\cma_lwm=${CMA_LWM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + sed -i '/#cma_lwm/ c\cma_lwm=${CMA_LWM}' ${DEPLOYDIR}/bootfiles/config.txt fi if [ "${ENABLE_CMA}" = "1" ] && [ -n "${CMA_HWM}" ]; then - sed -i '/#cma_hwm/ c\cma_hwm=${CMA_HWM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + sed -i '/#cma_hwm/ c\cma_hwm=${CMA_HWM}' ${DEPLOYDIR}/bootfiles/config.txt fi - echo "avoid_warnings=2" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt - echo "mask_gpu_interrupt0=0x400" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt - echo "dtoverlay=vc4-kms-v3d-overlay,cma-256" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt - echo "dtoverlay=rpi-ft5406-overlay" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt - echo "dtparam=audio=on" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "avoid_warnings=2" >> ${DEPLOYDIR}/bootfiles/config.txt + echo "mask_gpu_interrupt0=0x400" >> ${DEPLOYDIR}/bootfiles/config.txt + echo "dtoverlay=vc4-kms-v3d-overlay,cma-256" >> ${DEPLOYDIR}/bootfiles/config.txt + echo "dtoverlay=rpi-ft5406-overlay" >> ${DEPLOYDIR}/bootfiles/config.txt + echo "dtparam=audio=on" >> ${DEPLOYDIR}/bootfiles/config.txt } do_deploy_append_raspberrypi4() { - echo -e "\n[pi4]" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt - echo "max_framebuffers=2" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo -e "\n[pi4]" >> ${DEPLOYDIR}/bootfiles/config.txt + echo "max_framebuffers=2" >> ${DEPLOYDIR}/bootfiles/config.txt } do_deploy_append_sota() { - echo "device_tree_address=0x0c800000" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "device_tree_address=0x0c800000" >> ${DEPLOYDIR}/bootfiles/config.txt } ENABLE_UART_raspberrypi3 = "1" diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot_xen.cmd b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot_xen.cmd new file mode 100644 index 00000000..24cfb165 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot_xen.cmd @@ -0,0 +1,45 @@ +# +# SPDX-License-Identifier: MIT +# +# Copyright (c) 2020, MERA +# +# Author: Leonid Lazarev +# +# Xen Boot Script +# +# https://www.raspberrypi.org/documentation/configuration/device-tree.md +# We do not set fdt_addr, because device tree initially is loaded by raspberry pi firmware loader and the particular +# modification are performed. The prepared DTS is propagated to u-boot and this prepared device tree has to be reused. + +setenv kernel_addr_r 0x00480000 # 16M +setenv xen_addr_r 0x00200000 # 2M + +# Load xen to ${xen_addr_r}. +fatload mmc 0:1 ${xen_addr_r} /xen-@@MACHINE@@ + +#configure dom0 +fdt addr ${fdt_addr} + +#read prepared bootargs, rapsberry pi prepared initial list of the parameters for loading +fdt get value bootargs /chosen bootargs +fdt resize 8192 + +# add device type for raspberry +fdt set pcie0 device_type "pci" + +fdt chosen +fdt set /chosen \#address-cells <1> +fdt set /chosen \#size-cells <1> + +# Load Linux Image to ${kernel_addr_r} +fatload mmc 0:1 ${kernel_addr_r} /@@KERNEL_IMAGETYPE@@ + +# we load dom0 with 1512 MB of memory +fdt mknod /chosen dom0 +fdt set /chosen xen,xen-bootargs "console=dtuart dtuart=/soc/serial@7e215040 sync_console dom0_mem=1512M bootscrub=0" +fdt set /chosen xen,dom0-bootargs "${bootargs}" + +fdt set /chosen/dom0 compatible "xen,linux-zimage", "xen,multiboot-module" +fdt set /chosen/dom0 reg <${kernel_addr_r} 0x${filesize} > + +@@KERNEL_BOOTCMD@@ ${xen_addr_r} - ${fdt_addr} diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend new file mode 100644 index 00000000..2437d9a8 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend @@ -0,0 +1,18 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI_append =" \ + ${@bb.utils.contains('AGL_XEN_WANTED','1',' file://boot_xen.cmd','',d)} \ +" + +do_compile_append() { + + # if xen feature is activated we overwirte the boot script with xen specific one + if [ "${AGL_XEN_WANTED}" = "1" ]; then + sed -e 's/@@KERNEL_IMAGETYPE@@/${KERNEL_IMAGETYPE}/' \ + -e 's/@@KERNEL_BOOTCMD@@/${KERNEL_BOOTCMD}/' \ + -e 's/@@MACHINE@@/${MACHINE}/' \ + "${WORKDIR}/boot_xen.cmd" > "${WORKDIR}/boot.cmd" + + mkimage -A arm -T script -C none -n "Boot script" -d "${WORKDIR}/boot.cmd" boot.scr + fi +} \ No newline at end of file diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev-2019.07.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev-2019.07.patch deleted file mode 100644 index 964cdb7a..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev-2019.07.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 86cc911aaa958fedf2ea9cb04b4af17f5357815d Mon Sep 17 00:00:00 2001 -From: Anton Gerasimov -Date: Fri, 1 Feb 2019 14:39:48 +0100 -Subject: [PATCH] board: raspberrypi: add serial and revision to the device - tree - -Raspberry Pi bootloader adds this node to fdt, but if u-boot script -doesn't reuse the tree provided by it, this information is lost. - -Revision and serial are displayed in /proc/cpuinfo after boot. - -Signed-off-by: Anton Gerasimov ---- - board/raspberrypi/rpi/rpi.c | 31 +++++++++++++++++++++++++++++-- - 1 file changed, 29 insertions(+), 2 deletions(-) - -diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c -index 35f5939552..114178397e 100644 ---- a/board/raspberrypi/rpi/rpi.c -+++ b/board/raspberrypi/rpi/rpi.c -@@ -241,6 +241,8 @@ static uint32_t rev_scheme; - static uint32_t rev_type; - static const struct rpi_model *model; - -+uint64_t serial; -+ - #ifdef CONFIG_ARM64 - static struct mm_region bcm2837_mem_map[] = { - { -@@ -384,8 +386,8 @@ static void set_serial_number(void) - return; - } - -- snprintf(serial_string, sizeof(serial_string), "%016llx", -- msg->get_board_serial.body.resp.serial); -+ serial = msg->get_board_serial.body.resp.serial; -+ snprintf(serial_string, sizeof(serial_string), "%016llx", serial); - env_set("serial#", serial_string); - } - -@@ -478,6 +480,29 @@ void *board_fdt_blob_setup(void) - return (void *)fw_dtb_pointer; - } - -+static int ft_add_revision_info(void *blob) { -+ int off; -+ int ret; -+ -+ off = fdt_subnode_offset(blob, 0, "system"); -+ -+ if (off < 0) { -+ off = fdt_add_subnode(blob, 0, "system"); -+ if (off < 0) -+ return -1; -+ } -+ -+ ret = fdt_setprop_u64(blob, off, "linux,serial", serial); -+ if (ret < 0) -+ return -1; -+ -+ ret = fdt_setprop_u32(blob, off, "linux,revision", revision); -+ if (ret < 0) -+ return -1; -+ -+ return 0; -+} -+ - int ft_board_setup(void *blob, bd_t *bd) - { - /* -@@ -487,6 +512,8 @@ int ft_board_setup(void *blob, bd_t *bd) - */ - lcd_dt_simplefb_add_node(blob); - -+ ft_add_revision_info(blob); -+ - #ifdef CONFIG_EFI_LOADER - /* Reserve the spin table */ - efi_add_memory_map(0, 1, EFI_RESERVED_MEMORY_TYPE, 0); --- -2.17.1 - diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0001-configs-rpi4-Add-defconfigs-for-rpi4-32-64.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0001-configs-rpi4-Add-defconfigs-for-rpi4-32-64.patch deleted file mode 100644 index 391b26a1..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0001-configs-rpi4-Add-defconfigs-for-rpi4-32-64.patch +++ /dev/null @@ -1,104 +0,0 @@ -From 5bf85d04b440ce874310e701abded823dc1864bc Mon Sep 17 00:00:00 2001 -From: Andrei Gherzan -Date: Wed, 17 Jul 2019 15:32:11 +0100 -Subject: [PATCH 1/7] configs: rpi4: Add defconfigs for rpi4 (32/64) - -This defines a minimum defconfig for each of the two Raspberry Pi 4 -variants. One notable difference is that we don't have a embedded dt for -this board given that the fw supplies us with one which we can reuse. -Furthermore, the ram size is not queryable through mbox interface as the -maximum reported size is 1G. The fw patches the dt with the right -memory configuration and uboot uses it as it is. We avoid u-boot -touching this configuration by making sure CONFIG_ARCH_FIXUP_FDT_MEMORY -is deactivated. - -Signed-off-by: Andrei Gherzan -Upstream-status: Pending ---- - configs/rpi_4_32b_defconfig | 33 +++++++++++++++++++++++++++++++++ - configs/rpi_4_defconfig | 33 +++++++++++++++++++++++++++++++++ - 2 files changed, 66 insertions(+) - create mode 100644 configs/rpi_4_32b_defconfig - create mode 100644 configs/rpi_4_defconfig - -diff --git a/configs/rpi_4_32b_defconfig b/configs/rpi_4_32b_defconfig -new file mode 100644 -index 0000000000..a31a617a5f ---- /dev/null -+++ b/configs/rpi_4_32b_defconfig -@@ -0,0 +1,33 @@ -+CONFIG_ARM=y -+CONFIG_ARCH_BCM283X=y -+CONFIG_SYS_TEXT_BASE=0x00008000 -+CONFIG_TARGET_RPI_4_32B=y -+CONFIG_SYS_MALLOC_F_LEN=0x2000 -+CONFIG_DISTRO_DEFAULTS=y -+CONFIG_NR_DRAM_BANKS=1 -+# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set -+CONFIG_OF_BOARD=y -+CONFIG_OF_BOARD_SETUP=y -+CONFIG_MISC_INIT_R=y -+# CONFIG_DISPLAY_CPUINFO is not set -+# CONFIG_DISPLAY_BOARDINFO is not set -+CONFIG_SYS_PROMPT="U-Boot> " -+# CONFIG_CMD_FLASH is not set -+CONFIG_CMD_GPIO=y -+CONFIG_CMD_MMC=y -+CONFIG_CMD_FS_UUID=y -+CONFIG_ENV_FAT_INTERFACE="mmc" -+CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" -+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y -+CONFIG_DM_KEYBOARD=y -+CONFIG_DM_MMC=y -+CONFIG_MMC_SDHCI=y -+CONFIG_MMC_SDHCI_BCM2835=y -+CONFIG_PINCTRL=y -+# CONFIG_PINCTRL_GENERIC is not set -+# CONFIG_REQUIRE_SERIAL_CONSOLE is not set -+CONFIG_DM_VIDEO=y -+CONFIG_SYS_WHITE_ON_BLACK=y -+CONFIG_CONSOLE_SCROLL_LINES=10 -+CONFIG_PHYS_TO_BUS=y -+CONFIG_OF_LIBFDT_OVERLAY=y -diff --git a/configs/rpi_4_defconfig b/configs/rpi_4_defconfig -new file mode 100644 -index 0000000000..da8c960a2a ---- /dev/null -+++ b/configs/rpi_4_defconfig -@@ -0,0 +1,33 @@ -+CONFIG_ARM=y -+CONFIG_ARCH_BCM283X=y -+CONFIG_SYS_TEXT_BASE=0x00080000 -+CONFIG_TARGET_RPI_4=y -+CONFIG_SYS_MALLOC_F_LEN=0x2000 -+CONFIG_DISTRO_DEFAULTS=y -+CONFIG_NR_DRAM_BANKS=1 -+# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set -+CONFIG_OF_BOARD=y -+CONFIG_OF_BOARD_SETUP=y -+CONFIG_MISC_INIT_R=y -+# CONFIG_DISPLAY_CPUINFO is not set -+# CONFIG_DISPLAY_BOARDINFO is not set -+CONFIG_SYS_PROMPT="U-Boot> " -+# CONFIG_CMD_FLASH is not set -+CONFIG_CMD_GPIO=y -+CONFIG_CMD_MMC=y -+CONFIG_CMD_FS_UUID=y -+CONFIG_ENV_FAT_INTERFACE="mmc" -+CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" -+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y -+CONFIG_DM_KEYBOARD=y -+CONFIG_DM_MMC=y -+CONFIG_MMC_SDHCI=y -+CONFIG_MMC_SDHCI_BCM2835=y -+CONFIG_PINCTRL=y -+# CONFIG_PINCTRL_GENERIC is not set -+# CONFIG_REQUIRE_SERIAL_CONSOLE is not set -+CONFIG_DM_VIDEO=y -+CONFIG_SYS_WHITE_ON_BLACK=y -+CONFIG_CONSOLE_SCROLL_LINES=10 -+CONFIG_PHYS_TO_BUS=y -+CONFIG_OF_LIBFDT_OVERLAY=y --- -2.22.0 - diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0002-ARM-bcm283x-Add-BCM283x_BASE-define.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0002-ARM-bcm283x-Add-BCM283x_BASE-define.patch deleted file mode 100644 index fcf91a6a..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0002-ARM-bcm283x-Add-BCM283x_BASE-define.patch +++ /dev/null @@ -1,105 +0,0 @@ -From df2aa4c6be33b468adc09de337a055556d1f37fb Mon Sep 17 00:00:00 2001 -From: Matthias Brugger -Date: Fri, 12 Jul 2019 18:20:53 +0200 -Subject: [PATCH 2/7] ARM: bcm283x: Add BCM283x_BASE define - -Devices of bcm283x have different base address, depending if they are on -bcm2835 or bcm2836/7. Use BCM283x_BASE depending on the SoC you want to -build and only add the offset in the header files. - -Signed-off-by: Matthias Brugger -Signed-off-by: Andrei Gherzan -Upstream-status: Pending ---- - arch/arm/mach-bcm283x/Kconfig | 5 +++++ - arch/arm/mach-bcm283x/include/mach/mbox.h | 6 +----- - arch/arm/mach-bcm283x/include/mach/sdhci.h | 6 +----- - arch/arm/mach-bcm283x/include/mach/timer.h | 6 +----- - arch/arm/mach-bcm283x/include/mach/wdog.h | 6 +----- - 5 files changed, 9 insertions(+), 20 deletions(-) - -diff --git a/arch/arm/mach-bcm283x/Kconfig b/arch/arm/mach-bcm283x/Kconfig -index 3eb5a9a897..8e69914a83 100644 ---- a/arch/arm/mach-bcm283x/Kconfig -+++ b/arch/arm/mach-bcm283x/Kconfig -@@ -141,4 +141,9 @@ config SYS_SOC - config SYS_CONFIG_NAME - default "rpi" - -+config BCM283x_BASE -+ hex -+ default "0x20000000" if BCM2835 -+ default "0x3f000000" if BCM2836 || BCM2837 -+ - endmenu -diff --git a/arch/arm/mach-bcm283x/include/mach/mbox.h b/arch/arm/mach-bcm283x/include/mach/mbox.h -index e3a893e49c..e44c7577da 100644 ---- a/arch/arm/mach-bcm283x/include/mach/mbox.h -+++ b/arch/arm/mach-bcm283x/include/mach/mbox.h -@@ -37,11 +37,7 @@ - - /* Raw mailbox HW */ - --#ifndef CONFIG_BCM2835 --#define BCM2835_MBOX_PHYSADDR 0x3f00b880 --#else --#define BCM2835_MBOX_PHYSADDR 0x2000b880 --#endif -+#define BCM2835_MBOX_PHYSADDR (CONFIG_BCM283x_BASE + 0x0000b880) - - struct bcm2835_mbox_regs { - u32 read; -diff --git a/arch/arm/mach-bcm283x/include/mach/sdhci.h b/arch/arm/mach-bcm283x/include/mach/sdhci.h -index 5cb6ec3340..b443c379d8 100644 ---- a/arch/arm/mach-bcm283x/include/mach/sdhci.h -+++ b/arch/arm/mach-bcm283x/include/mach/sdhci.h -@@ -6,11 +6,7 @@ - #ifndef _BCM2835_SDHCI_H_ - #define _BCM2835_SDHCI_H_ - --#ifndef CONFIG_BCM2835 --#define BCM2835_SDHCI_BASE 0x3f300000 --#else --#define BCM2835_SDHCI_BASE 0x20300000 --#endif -+#define BCM2835_SDHCI_BASE (CONFIG_BCM283x_BASE + 0x00300000) - - int bcm2835_sdhci_init(u32 regbase, u32 emmc_freq); - -diff --git a/arch/arm/mach-bcm283x/include/mach/timer.h b/arch/arm/mach-bcm283x/include/mach/timer.h -index 56b0c356bb..014355e759 100644 ---- a/arch/arm/mach-bcm283x/include/mach/timer.h -+++ b/arch/arm/mach-bcm283x/include/mach/timer.h -@@ -6,11 +6,7 @@ - #ifndef _BCM2835_TIMER_H - #define _BCM2835_TIMER_H - --#ifndef CONFIG_BCM2835 --#define BCM2835_TIMER_PHYSADDR 0x3f003000 --#else --#define BCM2835_TIMER_PHYSADDR 0x20003000 --#endif -+#define BCM2835_TIMER_PHYSADDR (CONFIG_BCM283x_BASE + 0x00003000) - - #define BCM2835_TIMER_CS_M3 (1 << 3) - #define BCM2835_TIMER_CS_M2 (1 << 2) -diff --git a/arch/arm/mach-bcm283x/include/mach/wdog.h b/arch/arm/mach-bcm283x/include/mach/wdog.h -index 99c88e5df7..00b5e06c3a 100644 ---- a/arch/arm/mach-bcm283x/include/mach/wdog.h -+++ b/arch/arm/mach-bcm283x/include/mach/wdog.h -@@ -6,11 +6,7 @@ - #ifndef _BCM2835_WDOG_H - #define _BCM2835_WDOG_H - --#ifndef CONFIG_BCM2835 --#define BCM2835_WDOG_PHYSADDR 0x3f100000 --#else --#define BCM2835_WDOG_PHYSADDR 0x20100000 --#endif -+#define BCM2835_WDOG_PHYSADDR (CONFIG_BCM283x_BASE + 0x00100000) - - struct bcm2835_wdog_regs { - u32 unknown0[7]; --- -2.22.0 - diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0003-arm-mach-bcm283x-Define-configs-for-RaspberryPi-4.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0003-arm-mach-bcm283x-Define-configs-for-RaspberryPi-4.patch deleted file mode 100644 index 029cac49..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0003-arm-mach-bcm283x-Define-configs-for-RaspberryPi-4.patch +++ /dev/null @@ -1,108 +0,0 @@ -From c03f551cab8fe38de8f0e1781f0e2e339419b003 Mon Sep 17 00:00:00 2001 -From: Andrei Gherzan -Date: Wed, 17 Jul 2019 15:33:01 +0100 -Subject: [PATCH 3/7] arm: mach-bcm283x: Define configs for RaspberryPi 4 - -Define two target configs for Raspberry Pi 4 (32 and 64bit) and the -corresponding BCM2838* configs. - -Be aware of the current limitation in firmware which requires an -explicit configuration to force the arm in 64bit mode when the -respective target is used. - -Signed-off-by: Andrei Gherzan -Signed-off-by: Matthias Brugger -Upstream-status: Pending ---- - arch/arm/mach-bcm283x/Kconfig | 62 +++++++++++++++++++++++++++++++++++ - 1 file changed, 62 insertions(+) - -diff --git a/arch/arm/mach-bcm283x/Kconfig b/arch/arm/mach-bcm283x/Kconfig -index 8e69914a83..09a5b42bbb 100644 ---- a/arch/arm/mach-bcm283x/Kconfig -+++ b/arch/arm/mach-bcm283x/Kconfig -@@ -26,6 +26,23 @@ config BCM2837_64B - select BCM2837 - select ARM64 - -+config BCM2838 -+ bool "Broadcom BCM2838 SoC support" -+ depends on ARCH_BCM283X -+ -+config BCM2838_32B -+ bool "Broadcom BCM2838 SoC 32-bit support" -+ depends on ARCH_BCM283X -+ select BCM2838 -+ select ARMV7_LPAE -+ select CPU_V7A -+ -+config BCM2838_64B -+ bool "Broadcom BCM2838 SoC 64-bit support" -+ depends on ARCH_BCM283X -+ select BCM2838 -+ select ARM64 -+ - menu "Broadcom BCM283X family" - depends on ARCH_BCM283X - -@@ -127,6 +144,50 @@ config TARGET_RPI_3 - This option creates a build targeting the ARMv8/AArch64 ISA. - select BCM2837_64B - -+config TARGET_RPI_4_32B -+ bool "Raspberry Pi 4 32-bit build" -+ help -+ Support for all BCM2838-based Raspberry Pi variants, such as -+ the RPi 4 model B, in AArch32 (32-bit) mode. -+ -+ This option assumes the VideoCore firmware is configured to use the -+ mini UART (rather than PL011) for the serial console. This is the -+ default on the RPi 4. To enable the UART console, the following non- -+ default option must be present in config.txt: enable_uart=1. This is -+ required for U-Boot to operate correctly, even if you only care -+ about the HDMI/usbkbd console. -+ -+ Due to hardware incompatibilities, this can't be used with -+ BCM283/5/6/7. -+ -+ This option creates a build targeting the ARMv7/AArch32 ISA. -+ select BCM2838_32B -+ -+config TARGET_RPI_4 -+ bool "Raspberry Pi 4 64-bit build" -+ help -+ Support for all BCM2838-based Raspberry Pi variants, such as -+ the RPi 4 model B, in AArch64 (64-bit) mode. -+ -+ This option assumes the VideoCore firmware is configured to use the -+ mini UART (rather than PL011) for the serial console. This is the -+ default on the RPi 4. To enable the UART console, the following non- -+ default option must be present in config.txt: enable_uart=1. This is -+ required for U-Boot to operate correctly, even if you only care -+ about the HDMI/usbkbd console. -+ -+ Due to hardware incompatibilities, this can't be used with -+ BCM283/5/6/7. -+ -+ Also, due to a bug in firmware, switching to 64bit mode doesn't -+ happen automatically based on the kernel's image filename. See -+ https://github.com/raspberrypi/firmware/issues/1193 for more details. -+ Until that is resolved, the configuration (config.txt) needs to -+ explicitly set: arm_64bit=1. -+ -+ This option creates a build targeting the ARMv8/AArch64 ISA. -+ select BCM2838_64B -+ - endchoice - - config SYS_BOARD -@@ -145,5 +206,6 @@ config BCM283x_BASE - hex - default "0x20000000" if BCM2835 - default "0x3f000000" if BCM2836 || BCM2837 -+ default "0xfe000000" if BCM2838 - - endmenu --- -2.22.0 - diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0004-rpi-Add-entry-for-Raspberry-Pi-4-model-B.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0004-rpi-Add-entry-for-Raspberry-Pi-4-model-B.patch deleted file mode 100644 index 7309d2b2..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0004-rpi-Add-entry-for-Raspberry-Pi-4-model-B.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 12fbbd5bc12e225b19d3b4cb193a1bf3d9fa752a Mon Sep 17 00:00:00 2001 -From: Andrei Gherzan -Date: Wed, 17 Jul 2019 15:34:18 +0100 -Subject: [PATCH 4/7] rpi: Add entry for Raspberry Pi 4 model B - -The Raspebrry Pi 4 uses the new revision code scheme as documented by -the foundation. This change adds an entry for this board as well. - -Signed-off-by: Andrei Gherzan -Upstream-status: Pending ---- - board/raspberrypi/rpi/rpi.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c -index 617c892dde..92c6534da6 100644 ---- a/board/raspberrypi/rpi/rpi.c -+++ b/board/raspberrypi/rpi/rpi.c -@@ -148,6 +148,11 @@ static const struct rpi_model rpi_models_new_scheme[] = { - DTB_DIR "bcm2837-rpi-cm3.dtb", - false, - }, -+ [0x11] = { -+ "4 Model B", -+ DTB_DIR "bcm2838-rpi-4-b.dtb", -+ true, -+ }, - }; - - static const struct rpi_model rpi_models_old_scheme[] = { --- -2.22.0 - diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0005-arm-bcm283x-Include-definition-for-additional-emmc-c.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0005-arm-bcm283x-Include-definition-for-additional-emmc-c.patch deleted file mode 100644 index 44847e01..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0005-arm-bcm283x-Include-definition-for-additional-emmc-c.patch +++ /dev/null @@ -1,30 +0,0 @@ -From fd99a249e6faf234066a6b5da2ed34aaead3d6d9 Mon Sep 17 00:00:00 2001 -From: Andrei Gherzan -Date: Fri, 12 Jul 2019 11:26:10 +0100 -Subject: [PATCH 5/7] arm: bcm283x: Include definition for additional emmc - clock - -This clock has a different mbox ID so have this included in the relevant -header file. - -Signed-off-by: Andrei Gherzan -Upstream-status: Pending ---- - arch/arm/mach-bcm283x/include/mach/mbox.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/arch/arm/mach-bcm283x/include/mach/mbox.h b/arch/arm/mach-bcm283x/include/mach/mbox.h -index e44c7577da..f2a98acddd 100644 ---- a/arch/arm/mach-bcm283x/include/mach/mbox.h -+++ b/arch/arm/mach-bcm283x/include/mach/mbox.h -@@ -230,6 +230,7 @@ struct bcm2835_mbox_tag_set_power_state { - #define BCM2835_MBOX_CLOCK_ID_SDRAM 8 - #define BCM2835_MBOX_CLOCK_ID_PIXEL 9 - #define BCM2835_MBOX_CLOCK_ID_PWM 10 -+#define BCM2835_MBOX_CLOCK_ID_EMMC2 12 - - struct bcm2835_mbox_tag_get_clock_rate { - struct bcm2835_mbox_tag_hdr tag_hdr; --- -2.22.0 - diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0006-mmc-bcm2835_sdhci-Add-support-for-bcm2711-device.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0006-mmc-bcm2835_sdhci-Add-support-for-bcm2711-device.patch deleted file mode 100644 index d9de5c42..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0006-mmc-bcm2835_sdhci-Add-support-for-bcm2711-device.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 1f42758fe69648340cfae6cae98e667b88923cf6 Mon Sep 17 00:00:00 2001 -From: Matthias Brugger -Date: Wed, 10 Jul 2019 13:24:36 +0200 -Subject: [PATCH 6/7] mmc: bcm2835_sdhci: Add support for bcm2711 device - -The bcm2711 has two emmc controller. The difference is the clocks -they use. Add support for the second emmc contoller. - -Signed-off-by: Matthias Brugger -Signed-off-by: Andrei Gherzan -Upstream-status: Pending ---- - drivers/mmc/bcm2835_sdhci.c | 12 ++++++++++-- - 1 file changed, 10 insertions(+), 2 deletions(-) - -diff --git a/drivers/mmc/bcm2835_sdhci.c b/drivers/mmc/bcm2835_sdhci.c -index 08bddd410e..e68dec3be7 100644 ---- a/drivers/mmc/bcm2835_sdhci.c -+++ b/drivers/mmc/bcm2835_sdhci.c -@@ -178,12 +178,13 @@ static int bcm2835_sdhci_probe(struct udevice *dev) - fdt_addr_t base; - int emmc_freq; - int ret; -+ int clock_id = (int)dev_get_driver_data(dev); - - base = devfdt_get_addr(dev); - if (base == FDT_ADDR_T_NONE) - return -EINVAL; - -- ret = bcm2835_get_mmc_clock(BCM2835_MBOX_CLOCK_ID_EMMC); -+ ret = bcm2835_get_mmc_clock(clock_id); - if (ret < 0) { - debug("%s: Failed to set MMC clock (err=%d)\n", __func__, ret); - return ret; -@@ -228,7 +229,14 @@ static int bcm2835_sdhci_probe(struct udevice *dev) - } - - static const struct udevice_id bcm2835_sdhci_match[] = { -- { .compatible = "brcm,bcm2835-sdhci" }, -+ { -+ .compatible = "brcm,bcm2835-sdhci", -+ .data = BCM2835_MBOX_CLOCK_ID_EMMC -+ }, -+ { -+ .compatible = "brcm,bcm2711-emmc2", -+ .data = BCM2835_MBOX_CLOCK_ID_EMMC2 -+ }, - { /* sentinel */ } - }; - --- -2.22.0 - diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0007-rpi-Add-memory-map-for-bcm2838.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0007-rpi-Add-memory-map-for-bcm2838.patch deleted file mode 100644 index 1d23d9f9..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-2019.07/0007-rpi-Add-memory-map-for-bcm2838.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 76b656349a6786fa81cf69ac7762c31675cd567e Mon Sep 17 00:00:00 2001 -From: Andrei Gherzan -Date: Fri, 12 Jul 2019 14:27:31 +0100 -Subject: [PATCH 7/7] rpi: Add memory map for bcm2838 - -Define the memory map for the BCM2838 based on the dt configuration -available in the Raspberry Pi kernel fork. - -Signed-off-by: Andrei Gherzan -Upstream-status: Pending ---- - board/raspberrypi/rpi/rpi.c | 27 ++++++++++++++++++++++++--- - 1 file changed, 24 insertions(+), 3 deletions(-) - -diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c -index 92c6534da6..bddf2a578d 100644 ---- a/board/raspberrypi/rpi/rpi.c -+++ b/board/raspberrypi/rpi/rpi.c -@@ -249,7 +249,8 @@ static uint32_t rev_type; - static const struct rpi_model *model; - - #ifdef CONFIG_ARM64 --static struct mm_region bcm2837_mem_map[] = { -+#ifndef CONFIG_BCM2838 -+static struct mm_region bcm283x_mem_map[] = { - { - .virt = 0x00000000UL, - .phys = 0x00000000UL, -@@ -268,8 +269,28 @@ static struct mm_region bcm2837_mem_map[] = { - 0, - } - }; -- --struct mm_region *mem_map = bcm2837_mem_map; -+#else -+static struct mm_region bcm283x_mem_map[] = { -+ { -+ .virt = 0x00000000UL, -+ .phys = 0x00000000UL, -+ .size = 0xfe000000UL, -+ .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | -+ PTE_BLOCK_INNER_SHARE -+ }, { -+ .virt = 0xfe000000UL, -+ .phys = 0xfe000000UL, -+ .size = 0x01800000UL, -+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | -+ PTE_BLOCK_NON_SHARE | -+ PTE_BLOCK_PXN | PTE_BLOCK_UXN -+ }, { -+ /* List terminator */ -+ 0, -+ } -+}; -+#endif -+struct mm_region *mem_map = bcm283x_mem_map; - #endif - - int dram_init(void) --- -2.22.0 - diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-common.inc b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-common.inc deleted file mode 100644 index ad043dbc..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-common.inc +++ /dev/null @@ -1,15 +0,0 @@ -HOMEPAGE = "http://www.denx.de/wiki/U-Boot/WebHome" -SECTION = "bootloaders" -DEPENDS += "flex-native bison-native" - -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://Licenses/README;md5=30503fd321432fc713238f582193b78e" -PE = "1" - -# We use the revision in order to avoid having to fetch it from the -# repo during parse -SRCREV = "e5aee22e4be75e75a854ab64503fc80598bc2004" - -SRC_URI = "git://git.denx.de/u-boot.git" - -S = "${WORKDIR}/git" diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-fw-utils_2019.07.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-fw-utils_2019.07.bb deleted file mode 100644 index b5ce5684..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-fw-utils_2019.07.bb +++ /dev/null @@ -1,34 +0,0 @@ -require u-boot-common.inc - -SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities" -DEPENDS += "mtd-utils" - -INSANE_SKIP_${PN} = "already-stripped" -EXTRA_OEMAKE_class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" V=1' -EXTRA_OEMAKE_class-cross = 'HOSTCC="${CC} ${CFLAGS} ${LDFLAGS}" V=1' - -inherit uboot-config - -do_compile () { - oe_runmake ${UBOOT_MACHINE} - oe_runmake envtools -} - -do_install () { - install -d ${D}${base_sbindir} - install -d ${D}${sysconfdir} - install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv - install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv - install -m 0644 ${S}/tools/env/fw_env.config ${D}${sysconfdir}/fw_env.config -} - -do_install_class-cross () { - install -d ${D}${bindir_cross} - install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv - install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_setenv -} - -SYSROOT_DIRS_append_class-cross = " ${bindir_cross}" - -PACKAGE_ARCH = "${MACHINE_ARCH}" -BBCLASSEXTEND = "cross" diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-fw-utils_2019.07.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-fw-utils_2019.07.bbappend deleted file mode 100644 index 3daf157d..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-fw-utils_2019.07.bbappend +++ /dev/null @@ -1,2 +0,0 @@ -# Apply the same patches for rpi4 as u-boot recipe -require u-boot-rpi4-${PV}.inc diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-rpi4-2019.07.inc b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-rpi4-2019.07.inc deleted file mode 100644 index 2ce55a2b..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-rpi4-2019.07.inc +++ /dev/null @@ -1,12 +0,0 @@ -FILESEXTRAPATHS_prepend_raspberrypi4 := "${THISDIR}/u-boot-2019.07:" -UBOOT_RPI4_SUPPORT_PATCHES = " \ - file://0001-configs-rpi4-Add-defconfigs-for-rpi4-32-64.patch \ - file://0002-ARM-bcm283x-Add-BCM283x_BASE-define.patch \ - file://0003-arm-mach-bcm283x-Define-configs-for-RaspberryPi-4.patch \ - file://0004-rpi-Add-entry-for-Raspberry-Pi-4-model-B.patch \ - file://0005-arm-bcm283x-Include-definition-for-additional-emmc-c.patch \ - file://0006-mmc-bcm2835_sdhci-Add-support-for-bcm2711-device.patch \ - file://0007-rpi-Add-memory-map-for-bcm2838.patch \ -" - -SRC_URI_append_raspberrypi4 = "${UBOOT_RPI4_SUPPORT_PATCHES}" diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-tools_2019.07.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-tools_2019.07.bb deleted file mode 100644 index bede984e..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot-tools_2019.07.bb +++ /dev/null @@ -1,67 +0,0 @@ -require u-boot-common.inc - -SUMMARY = "U-Boot bootloader tools" -DEPENDS += "openssl" - -PROVIDES = "${MLPREFIX}u-boot-mkimage ${MLPREFIX}u-boot-mkenvimage" -PROVIDES_class-native = "u-boot-mkimage-native u-boot-mkenvimage-native" - -PACKAGES += "${PN}-mkimage ${PN}-mkenvimage" - -# Required for backward compatibility with "u-boot-mkimage-xxx.bb" -RPROVIDES_${PN}-mkimage = "u-boot-mkimage" -RREPLACES_${PN}-mkimage = "u-boot-mkimage" -RCONFLICTS_${PN}-mkimage = "u-boot-mkimage" - -EXTRA_OEMAKE_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' -EXTRA_OEMAKE_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' -EXTRA_OEMAKE_class-nativesdk = 'CROSS_COMPILE="${HOST_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' - -SED_CONFIG_EFI = '-e "s/CONFIG_EFI_LOADER=.*/# CONFIG_EFI_LOADER is not set/"' -SED_CONFIG_EFI_x86 = '' -SED_CONFIG_EFI_x86-64 = '' -SED_CONFIG_EFI_arm = '' -SED_CONFIG_EFI_armeb = '' -SED_CONFIG_EFI_aarch64 = '' - -do_compile () { - oe_runmake sandbox_defconfig - - # Disable CONFIG_CMD_LICENSE, license.h is not used by tools and - # generating it requires bin2header tool, which for target build - # is built with target tools and thus cannot be executed on host. - sed -i -e "s/CONFIG_CMD_LICENSE=.*/# CONFIG_CMD_LICENSE is not set/" ${SED_CONFIG_EFI} .config - - oe_runmake cross_tools NO_SDL=1 -} - -do_install () { - install -d ${D}${bindir} - - # mkimage - install -m 0755 tools/mkimage ${D}${bindir}/uboot-mkimage - ln -sf uboot-mkimage ${D}${bindir}/mkimage - - # mkenvimage - install -m 0755 tools/mkenvimage ${D}${bindir}/uboot-mkenvimage - ln -sf uboot-mkenvimage ${D}${bindir}/mkenvimage - - # dumpimage - install -m 0755 tools/dumpimage ${D}${bindir}/uboot-dumpimage - ln -sf uboot-dumpimage ${D}${bindir}/dumpimage - - # fit_check_sign - install -m 0755 tools/fit_check_sign ${D}${bindir}/uboot-fit_check_sign - ln -sf uboot-fit_check_sign ${D}${bindir}/fit_check_sign -} - -ALLOW_EMPTY_${PN} = "1" -FILES_${PN} = "" -FILES_${PN}-mkimage = "${bindir}/uboot-mkimage ${bindir}/mkimage ${bindir}/uboot-dumpimage ${bindir}/dumpimage ${bindir}/uboot-fit_check_sign ${bindir}/fit_check_sign" -FILES_${PN}-mkenvimage = "${bindir}/uboot-mkenvimage ${bindir}/mkenvimage" - -RDEPENDS_${PN}-mkimage += "dtc" -RDEPENDS_${PN} += "${PN}-mkimage ${PN}-mkenvimage" -RDEPENDS_${PN}_class-native = "" - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot.inc b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot.inc deleted file mode 100644 index 9a754fd0..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot.inc +++ /dev/null @@ -1,333 +0,0 @@ -SUMMARY = "Universal Boot Loader for embedded devices" -PROVIDES = "virtual/bootloader" - -B = "${WORKDIR}/build" - -PACKAGE_ARCH = "${MACHINE_ARCH}" - -DEPENDS += "kern-tools-native" - -inherit uboot-config uboot-extlinux-config uboot-sign deploy cml1 - -DEPENDS += "swig-native python-native" - -EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" V=1' -EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"' -EXTRA_OEMAKE += 'PYTHON2=nativepython STAGING_INCDIR=${STAGING_INCDIR_NATIVE} STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}' - -PACKAGECONFIG ??= "openssl" -# u-boot will compile its own tools during the build, with specific -# configurations (aka when CONFIG_FIT_SIGNATURE is enabled) openssl is needed as -# a host build dependency. -PACKAGECONFIG[openssl] = ",,openssl-native" - -# Allow setting an additional version string that will be picked up by the -# u-boot build system and appended to the u-boot version. If the .scmversion -# file already exists it will not be overwritten. -UBOOT_LOCALVERSION ?= "" - -# Some versions of u-boot use .bin and others use .img. By default use .bin -# but enable individual recipes to change this value. -UBOOT_SUFFIX ??= "bin" -UBOOT_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.${UBOOT_SUFFIX}" -UBOOT_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_SUFFIX}" -UBOOT_MAKE_TARGET ?= "all" - -# Output the ELF generated. Some platforms can use the ELF file and directly -# load it (JTAG booting, QEMU) additionally the ELF can be used for debugging -# purposes. -UBOOT_ELF ?= "" -UBOOT_ELF_SUFFIX ?= "elf" -UBOOT_ELF_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}" -UBOOT_ELF_BINARY ?= "u-boot.${UBOOT_ELF_SUFFIX}" -UBOOT_ELF_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_ELF_SUFFIX}" - -# Some versions of u-boot build an SPL (Second Program Loader) image that -# should be packaged along with the u-boot binary as well as placed in the -# deploy directory. For those versions they can set the following variables -# to allow packaging the SPL. -SPL_BINARY ?= "" -SPL_BINARYNAME ?= "${@os.path.basename(d.getVar("SPL_BINARY"))}" -SPL_IMAGE ?= "${SPL_BINARYNAME}-${MACHINE}-${PV}-${PR}" -SPL_SYMLINK ?= "${SPL_BINARYNAME}-${MACHINE}" - -# Additional environment variables or a script can be installed alongside -# u-boot to be used automatically on boot. This file, typically 'uEnv.txt' -# or 'boot.scr', should be packaged along with u-boot as well as placed in the -# deploy directory. Machine configurations needing one of these files should -# include it in the SRC_URI and set the UBOOT_ENV parameter. -UBOOT_ENV_SUFFIX ?= "txt" -UBOOT_ENV ?= "" -UBOOT_ENV_BINARY ?= "${UBOOT_ENV}.${UBOOT_ENV_SUFFIX}" -UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${PV}-${PR}.${UBOOT_ENV_SUFFIX}" -UBOOT_ENV_SYMLINK ?= "${UBOOT_ENV}-${MACHINE}.${UBOOT_ENV_SUFFIX}" - -# U-Boot EXTLINUX variables. U-Boot searches for /boot/extlinux/extlinux.conf -# to find EXTLINUX conf file. -UBOOT_EXTLINUX_INSTALL_DIR ?= "/boot/extlinux" -UBOOT_EXTLINUX_CONF_NAME ?= "extlinux.conf" -UBOOT_EXTLINUX_SYMLINK ?= "${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}-${PR}" - -# returns all the elements from the src uri that are .cfg files -def find_cfgs(d): - sources=src_patches(d, True) - sources_list=[] - for s in sources: - if s.endswith('.cfg'): - sources_list.append(s) - - return sources_list - -do_configure () { - if [ -z "${UBOOT_CONFIG}" ]; then - if [ -n "${UBOOT_MACHINE}" ]; then - oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE} - else - oe_runmake -C ${S} O=${B} oldconfig - fi - merge_config.sh -m .config ${@" ".join(find_cfgs(d))} - cml1_do_configure - fi -} - -do_compile () { - if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then - sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' ${S}/config.mk - fi - - unset LDFLAGS - unset CFLAGS - unset CPPFLAGS - - if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ] - then - echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion - echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion - fi - - if [ -n "${UBOOT_CONFIG}" ] - then - unset i j k - for config in ${UBOOT_MACHINE}; do - i=$(expr $i + 1); - for type in ${UBOOT_CONFIG}; do - j=$(expr $j + 1); - if [ $j -eq $i ] - then - oe_runmake -C ${S} O=${B}/${config} ${config} - oe_runmake -C ${S} O=${B}/${config} ${UBOOT_MAKE_TARGET} - for binary in ${UBOOT_BINARIES}; do - k=$(expr $k + 1); - if [ $k -eq $i ]; then - cp ${B}/${config}/${binary} ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} - fi - done - unset k - fi - done - unset j - done - unset i - else - oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET} - fi - -} - -do_install () { - if [ -n "${UBOOT_CONFIG}" ] - then - for config in ${UBOOT_MACHINE}; do - i=$(expr $i + 1); - for type in ${UBOOT_CONFIG}; do - j=$(expr $j + 1); - if [ $j -eq $i ] - then - install -d ${D}/boot - install -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} - ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type} - ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY} - fi - done - unset j - done - unset i - else - install -d ${D}/boot - install -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE} - ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY} - fi - - if [ -n "${UBOOT_ELF}" ] - then - if [ -n "${UBOOT_CONFIG}" ] - then - for config in ${UBOOT_MACHINE}; do - i=$(expr $i + 1); - for type in ${UBOOT_CONFIG}; do - j=$(expr $j + 1); - if [ $j -eq $i ] - then - install -m 644 ${B}/${config}/${UBOOT_ELF} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} - ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type} - ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY} - fi - done - unset j - done - unset i - else - install -m 644 ${B}/${UBOOT_ELF} ${D}/boot/${UBOOT_ELF_IMAGE} - ln -sf ${UBOOT_ELF_IMAGE} ${D}/boot/${UBOOT_ELF_BINARY} - fi - fi - - if [ -e ${WORKDIR}/fw_env.config ] ; then - install -d ${D}${sysconfdir} - install -m 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config - fi - - if [ -n "${SPL_BINARY}" ] - then - if [ -n "${UBOOT_CONFIG}" ] - then - for config in ${UBOOT_MACHINE}; do - i=$(expr $i + 1); - for type in ${UBOOT_CONFIG}; do - j=$(expr $j + 1); - if [ $j -eq $i ] - then - install -m 644 ${B}/${config}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}-${type}-${PV}-${PR} - ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${D}/boot/${SPL_BINARYNAME}-${type} - ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${D}/boot/${SPL_BINARYNAME} - fi - done - unset j - done - unset i - else - install -m 644 ${B}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE} - ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARYNAME} - fi - fi - - if [ -n "${UBOOT_ENV}" ] - then - install -m 644 ${WORKDIR}/${UBOOT_ENV_BINARY} ${D}/boot/${UBOOT_ENV_IMAGE} - ln -sf ${UBOOT_ENV_IMAGE} ${D}/boot/${UBOOT_ENV_BINARY} - fi - - if [ "${UBOOT_EXTLINUX}" = "1" ] - then - install -Dm 0644 ${UBOOT_EXTLINUX_CONFIG} ${D}/${UBOOT_EXTLINUX_INSTALL_DIR}/${UBOOT_EXTLINUX_CONF_NAME} - fi - -} - -FILES_${PN} = "/boot ${sysconfdir} ${datadir}" - -do_deploy () { - if [ -n "${UBOOT_CONFIG}" ] - then - for config in ${UBOOT_MACHINE}; do - i=$(expr $i + 1); - for type in ${UBOOT_CONFIG}; do - j=$(expr $j + 1); - if [ $j -eq $i ] - then - install -d ${DEPLOYDIR} - install -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} - cd ${DEPLOYDIR} - ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type} - ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK} - ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}-${type} - ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY} - fi - done - unset j - done - unset i - else - install -d ${DEPLOYDIR} - install -m 644 ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE} - cd ${DEPLOYDIR} - rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK} - ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK} - ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY} - fi - - if [ -n "${UBOOT_ELF}" ] - then - if [ -n "${UBOOT_CONFIG}" ] - then - for config in ${UBOOT_MACHINE}; do - i=$(expr $i + 1); - for type in ${UBOOT_CONFIG}; do - j=$(expr $j + 1); - if [ $j -eq $i ] - then - install -m 644 ${B}/${config}/${UBOOT_ELF} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} - ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}-${type} - ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY} - ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}-${type} - ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK} - fi - done - unset j - done - unset i - else - install -m 644 ${B}/${UBOOT_ELF} ${DEPLOYDIR}/${UBOOT_ELF_IMAGE} - ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_BINARY} - ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK} - fi - fi - - - if [ -n "${SPL_BINARY}" ] - then - if [ -n "${UBOOT_CONFIG}" ] - then - for config in ${UBOOT_MACHINE}; do - i=$(expr $i + 1); - for type in ${UBOOT_CONFIG}; do - j=$(expr $j + 1); - if [ $j -eq $i ] - then - install -m 644 ${B}/${config}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}-${type}-${PV}-${PR} - rm -f ${DEPLOYDIR}/${SPL_BINARYNAME} ${DEPLOYDIR}/${SPL_SYMLINK}-${type} - ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_BINARYNAME}-${type} - ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_BINARYNAME} - ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_SYMLINK}-${type} - ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_SYMLINK} - fi - done - unset j - done - unset i - else - install -m 644 ${B}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE} - rm -f ${DEPLOYDIR}/${SPL_BINARYNAME} ${DEPLOYDIR}/${SPL_SYMLINK} - ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_BINARYNAME} - ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_SYMLINK} - fi - fi - - - if [ -n "${UBOOT_ENV}" ] - then - install -m 644 ${WORKDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_IMAGE} - rm -f ${DEPLOYDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK} - ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_BINARY} - ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK} - fi - - if [ "${UBOOT_EXTLINUX}" = "1" ] - then - install -m 644 ${UBOOT_EXTLINUX_CONFIG} ${DEPLOYDIR}/${UBOOT_EXTLINUX_SYMLINK} - ln -sf ${UBOOT_EXTLINUX_SYMLINK} ${DEPLOYDIR}/${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE} - ln -sf ${UBOOT_EXTLINUX_SYMLINK} ${DEPLOYDIR}/${UBOOT_EXTLINUX_CONF_NAME} - fi -} - -addtask deploy before do_build after do_compile diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bb deleted file mode 100644 index 02d67c0d..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bb +++ /dev/null @@ -1,4 +0,0 @@ -require u-boot-common.inc -require u-boot.inc - -DEPENDS += "bc-native dtc-native" diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bbappend deleted file mode 100644 index 6d89f5cb..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bbappend +++ /dev/null @@ -1,10 +0,0 @@ -# Apply the same patches for rpi4 as u-boot recipe -require u-boot-rpi4-${PV}.inc - -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -# Update the patch for u-boot 2019.07 -SRC_URI_remove_sota = "file://0001-board-raspberrypi-add-serial-and-revision-to-the-dev.patch" -SRC_URI_append_sota = "file://0001-board-raspberrypi-add-serial-and-revision-to-the-dev-2019.07.patch" - -DEPENDS_append_rpi = " rpi-u-boot-scr" diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch deleted file mode 100644 index 9fba5da4..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch +++ /dev/null @@ -1,42 +0,0 @@ -From ea966884e39aae9571c038fab55f3c1663d17850 Mon Sep 17 00:00:00 2001 -From: Fabio Berton -Date: Wed, 12 Jun 2019 13:40:20 -0300 -Subject: [PATCH] meson.build: check for all linux host_os combinations -Organization: O.S. Systems Software LTDA. - -Make sure that we are also looking for our host_os combinations like -linux-musl etc. when assuming support for DRM/KMS. - -Also delete a duplicate line. - -Upstream-Status: Pending - -Signed-off-by: Anuj Mittal -Signed-off-by: Fabio Berton -Signed-off-by: Otavio Salvador ---- - meson.build | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/meson.build b/meson.build -index 567a81afd6f..b33b430aed4 100644 ---- a/meson.build -+++ b/meson.build -@@ -107,7 +107,7 @@ with_any_opengl = with_opengl or with_gles1 or with_gles2 - # Only build shared_glapi if at least one OpenGL API is enabled - with_shared_glapi = get_option('shared-glapi') and with_any_opengl - --system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux'].contains(host_machine.system()) -+system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'dragonfly'].contains(host_machine.system()) or host_machine.system().startswith('linux') - - dri_drivers = get_option('dri-drivers') - if dri_drivers.contains('auto') -@@ -845,7 +845,7 @@ if cc.compiles('int foo(void) __attribute__((__noreturn__));', - endif - - # TODO: this is very incomplete --if ['linux', 'cygwin', 'gnu', 'gnu/kfreebsd'].contains(host_machine.system()) -+if ['cygwin', 'gnu', 'gnu/kfreebsd'].contains(host_machine.system()) or host_machine.system().startswith('linux') - pre_args += '-D_GNU_SOURCE' - endif - diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0002-meson.build-make-TLS-GLX-optional-again.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0002-meson.build-make-TLS-GLX-optional-again.patch deleted file mode 100644 index 641bacf1..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0002-meson.build-make-TLS-GLX-optional-again.patch +++ /dev/null @@ -1,52 +0,0 @@ -From cee8e48c5344124e5d84307cb0c48ee0c9b3e684 Mon Sep 17 00:00:00 2001 -From: Fabio Berton -Date: Wed, 12 Jun 2019 14:15:57 -0300 -Subject: [PATCH] meson.build: make TLS GLX optional again -Organization: O.S. Systems Software LTDA. - -This was optional with autotools, and needs to be disabled -when using musl C library, for instance. - -Upstream-Status: Pending - -Signed-off-by: Alexander Kanavin -Signed-off-by: Fabio Berton -Signed-off-by: Otavio Salvador ---- - meson.build | 4 +++- - meson_options.txt | 7 +++++++ - 2 files changed, 10 insertions(+), 1 deletion(-) - -diff --git a/meson.build b/meson.build -index b33b430aed4..0e50bb26c0a 100644 ---- a/meson.build -+++ b/meson.build -@@ -369,7 +369,9 @@ if with_egl and not (with_platform_drm or with_platform_surfaceless or with_plat - endif - endif - --pre_args += '-DGLX_USE_TLS' -+if get_option('glx-tls') -+ pre_args += '-DGLX_USE_TLS' -+endif - if with_glx != 'disabled' - if not (with_platform_x11 and with_any_opengl) - error('Cannot build GLX support without X11 platform support and at least one OpenGL API') -diff --git a/meson_options.txt b/meson_options.txt -index 1f72faabee8..fcd49efea27 100644 ---- a/meson_options.txt -+++ b/meson_options.txt -@@ -339,6 +339,13 @@ option( - value : true, - description : 'Enable direct rendering in GLX and EGL for DRI', - ) -+option( -+ 'glx-tls', -+ type : 'boolean', -+ value : true, -+ description : 'Enable TLS support in GLX', -+) -+ - option( - 'I-love-half-baked-turnips', - type : 'boolean', diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0003-Allow-enable-DRI-without-DRI-drivers.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0003-Allow-enable-DRI-without-DRI-drivers.patch deleted file mode 100644 index 3458c191..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/0003-Allow-enable-DRI-without-DRI-drivers.patch +++ /dev/null @@ -1,46 +0,0 @@ -From f1482e88c2295b9c7288f5b273335a8e18039de8 Mon Sep 17 00:00:00 2001 -From: Fabio Berton -Date: Wed, 12 Jun 2019 14:18:31 -0300 -Subject: [PATCH] Allow enable DRI without DRI drivers -Organization: O.S. Systems Software LTDA. - -Upstream-Status: Pending - -Signed-off-by: Andrei Gherzan -Signed-off-by: Fabio Berton -Signed-off-by: Otavio Salvador ---- - meson.build | 2 +- - meson_options.txt | 6 ++++++ - 2 files changed, 7 insertions(+), 1 deletion(-) - -diff --git a/meson.build b/meson.build -index 0e50bb26c0a..de065c290d6 100644 ---- a/meson.build -+++ b/meson.build -@@ -137,7 +137,7 @@ with_dri_r200 = dri_drivers.contains('r200') - with_dri_nouveau = dri_drivers.contains('nouveau') - with_dri_swrast = dri_drivers.contains('swrast') - --with_dri = dri_drivers.length() != 0 and dri_drivers != [''] -+with_dri = get_option('dri') or (_drivers.length() != 0 and _drivers != ['']) - - gallium_drivers = get_option('gallium-drivers') - if gallium_drivers.contains('auto') -diff --git a/meson_options.txt b/meson_options.txt -index fcd49efea27..0529200b3bb 100644 ---- a/meson_options.txt -+++ b/meson_options.txt -@@ -34,6 +34,12 @@ option( - choices : ['auto', 'true', 'false'], - description : 'enable support for dri3' - ) -+option( -+ 'dri', -+ type : 'boolean', -+ value : false, -+ description : 'enable support for dri' -+) - option( - 'dri-drivers', - type : 'array', diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/libglu_9.0.1.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/libglu_9.0.1.bb deleted file mode 100644 index 068fb19e..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/libglu_9.0.1.bb +++ /dev/null @@ -1,30 +0,0 @@ -SUMMARY = "The OpenGL utility toolkit" -DESCRIPTION = "GLU is a utility toolkit used with OpenGL implementations" - -HOMEPAGE = "http://mesa3d.org" -BUGTRACKER = "https://bugs.freedesktop.org" -SECTION = "x11" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://include/GL/glu.h;endline=29;md5=6b79c570f644363b356456e7d44471d9 \ - file://src/libtess/tess.c;endline=29;md5=6b79c570f644363b356456e7d44471d9" - -# Epoch as this used to be part of mesa -PE = "2" -PR = "0" - -SRC_URI = "https://mesa.freedesktop.org/archive/glu/glu-${PV}.tar.gz" - -SRC_URI[md5sum] = "5599a0e0a97335e10239d9165aced60d" -SRC_URI[sha256sum] = "f6f484cfcd51e489afe88031afdea1e173aa652697e4c19ddbcb8260579a10f7" - -S = "${WORKDIR}/glu-${PV}" - -DEPENDS = "virtual/libgl" - -inherit autotools pkgconfig distro_features_check - -# Requires libGL.so which is provided by mesa when x11 in DISTRO_FEATURES -REQUIRED_DISTRO_FEATURES = "x11 opengl" - -# Remove the mesa-glu dependency in mesa-glu-dev, as mesa-glu is empty -RDEPENDS_${PN}-dev = "" diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch deleted file mode 100644 index 93ee9c28..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch +++ /dev/null @@ -1,624 +0,0 @@ -From b695c3a3fa3f4cd48c13aa26542110de27075518 Mon Sep 17 00:00:00 2001 -From: Drew Moseley -Date: Mon, 12 May 2014 15:22:32 -0400 -Subject: [PATCH 1/9] mesa-demos: Add missing data files. - -Add some data files that are present in the git repository: - http://cgit.freedesktop.org/mesa/demos/tree/?id=mesa-demos-8.1.0 -but not in the release tarball - ftp://ftp.freedesktop.org/pub/mesa/demos/8.1.0/mesa-demos-8.1.0.tar.bz2 - -Upstream-Status: Backport -Signed-off-by: Drew Moseley -Signed-off-by: Martin Jansa ---- - src/fpglsl/depth-read.glsl | 4 + - src/fpglsl/infinite-loop.glsl | 7 + - src/glsl/CH11-bumpmaptex.frag | 47 +++++++ - src/glsl/blinking-teapot.frag | 31 +++++ - src/glsl/blinking-teapot.vert | 16 +++ - src/glsl/convolution.frag | 21 +++ - src/glsl/simplex-noise.glsl | 279 ++++++++++++++++++++++++++++++++++++++++ - src/glsl/skinning.vert | 24 ++++ - src/perf/glslstateschange1.frag | 19 +++ - src/perf/glslstateschange1.vert | 14 ++ - src/perf/glslstateschange2.frag | 17 +++ - src/perf/glslstateschange2.vert | 14 ++ - src/vpglsl/infinite-loop.glsl | 8 ++ - 13 files changed, 501 insertions(+) - create mode 100644 src/fpglsl/depth-read.glsl - create mode 100644 src/fpglsl/infinite-loop.glsl - create mode 100644 src/glsl/CH11-bumpmaptex.frag - create mode 100644 src/glsl/blinking-teapot.frag - create mode 100644 src/glsl/blinking-teapot.vert - create mode 100644 src/glsl/convolution.frag - create mode 100644 src/glsl/simplex-noise.glsl - create mode 100644 src/glsl/skinning.vert - create mode 100644 src/perf/glslstateschange1.frag - create mode 100644 src/perf/glslstateschange1.vert - create mode 100644 src/perf/glslstateschange2.frag - create mode 100644 src/perf/glslstateschange2.vert - create mode 100644 src/vpglsl/infinite-loop.glsl - -diff --git a/src/fpglsl/depth-read.glsl b/src/fpglsl/depth-read.glsl -new file mode 100644 -index 0000000..86d298e ---- /dev/null -+++ b/src/fpglsl/depth-read.glsl -@@ -0,0 +1,4 @@ -+void main() -+{ -+ gl_FragColor = gl_FragCoord.zzzz; -+} -diff --git a/src/fpglsl/infinite-loop.glsl b/src/fpglsl/infinite-loop.glsl -new file mode 100644 -index 0000000..c6dc6ee ---- /dev/null -+++ b/src/fpglsl/infinite-loop.glsl -@@ -0,0 +1,7 @@ -+void main() { -+ vec4 sum = vec4(0); -+ for (int i = 1; i != 2; i += 2) { -+ sum += vec4(0.1, 0.1, 0.1, 0.1); -+ } -+ gl_FragColor = sum; -+} -diff --git a/src/glsl/CH11-bumpmaptex.frag b/src/glsl/CH11-bumpmaptex.frag -new file mode 100644 -index 0000000..b5dabb4 ---- /dev/null -+++ b/src/glsl/CH11-bumpmaptex.frag -@@ -0,0 +1,47 @@ -+// -+// Fragment shader for procedural bumps -+// -+// Authors: John Kessenich, Randi Rost -+// -+// Copyright (c) 2002-2006 3Dlabs Inc. Ltd. -+// -+// See 3Dlabs-License.txt for license information -+// -+// Texture mapping/modulation added by Brian Paul -+// -+ -+varying vec3 LightDir; -+varying vec3 EyeDir; -+ -+uniform float BumpDensity; // = 16.0 -+uniform float BumpSize; // = 0.15 -+uniform float SpecularFactor; // = 0.5 -+ -+uniform sampler2D Tex; -+ -+void main() -+{ -+ vec3 ambient = vec3(0.25); -+ vec3 litColor; -+ vec2 c = BumpDensity * gl_TexCoord[0].st; -+ vec2 p = fract(c) - vec2(0.5); -+ -+ float d, f; -+ d = p.x * p.x + p.y * p.y; -+ f = inversesqrt(d + 1.0); -+ -+ if (d >= BumpSize) -+ { p = vec2(0.0); f = 1.0; } -+ -+ vec3 SurfaceColor = texture2D(Tex, gl_TexCoord[0].st).xyz; -+ -+ vec3 normDelta = vec3(p.x, p.y, 1.0) * f; -+ litColor = SurfaceColor * (ambient + max(dot(normDelta, LightDir), 0.0)); -+ vec3 reflectDir = reflect(LightDir, normDelta); -+ -+ float spec = max(dot(EyeDir, reflectDir), 0.0); -+ spec *= SpecularFactor; -+ litColor = min(litColor + spec, vec3(1.0)); -+ -+ gl_FragColor = vec4(litColor, 1.0); -+} -diff --git a/src/glsl/blinking-teapot.frag b/src/glsl/blinking-teapot.frag -new file mode 100644 -index 0000000..0db060b ---- /dev/null -+++ b/src/glsl/blinking-teapot.frag -@@ -0,0 +1,31 @@ -+#extension GL_ARB_uniform_buffer_object : enable -+ -+layout(std140) uniform colors0 -+{ -+ float DiffuseCool; -+ float DiffuseWarm; -+ vec3 SurfaceColor; -+ vec3 WarmColor; -+ vec3 CoolColor; -+ vec4 some[8]; -+}; -+ -+varying float NdotL; -+varying vec3 ReflectVec; -+varying vec3 ViewVec; -+ -+void main (void) -+{ -+ -+ vec3 kcool = min(CoolColor + DiffuseCool * SurfaceColor, 1.0); -+ vec3 kwarm = min(WarmColor + DiffuseWarm * SurfaceColor, 1.0); -+ vec3 kfinal = mix(kcool, kwarm, NdotL); -+ -+ vec3 nreflect = normalize(ReflectVec); -+ vec3 nview = normalize(ViewVec); -+ -+ float spec = max(dot(nreflect, nview), 0.0); -+ spec = pow(spec, 32.0); -+ -+ gl_FragColor = vec4 (min(kfinal + spec, 1.0), 1.0); -+} -diff --git a/src/glsl/blinking-teapot.vert b/src/glsl/blinking-teapot.vert -new file mode 100644 -index 0000000..397d733 ---- /dev/null -+++ b/src/glsl/blinking-teapot.vert -@@ -0,0 +1,16 @@ -+vec3 LightPosition = vec3(0.0, 10.0, 4.0); -+ -+varying float NdotL; -+varying vec3 ReflectVec; -+varying vec3 ViewVec; -+ -+void main(void) -+{ -+ vec3 ecPos = vec3 (gl_ModelViewMatrix * gl_Vertex); -+ vec3 tnorm = normalize(gl_NormalMatrix * gl_Normal); -+ vec3 lightVec = normalize(LightPosition - ecPos); -+ ReflectVec = normalize(reflect(-lightVec, tnorm)); -+ ViewVec = normalize(-ecPos); -+ NdotL = (dot(lightVec, tnorm) + 1.0) * 0.5; -+ gl_Position = ftransform(); -+} -diff --git a/src/glsl/convolution.frag b/src/glsl/convolution.frag -new file mode 100644 -index 0000000..e49b8ac ---- /dev/null -+++ b/src/glsl/convolution.frag -@@ -0,0 +1,21 @@ -+ -+const int KernelSize = 9; -+ -+//texture offsets -+uniform vec2 Offset[KernelSize]; -+//convolution kernel -+uniform vec4 KernelValue[KernelSize]; -+uniform sampler2D srcTex; -+uniform vec4 ScaleFactor; -+uniform vec4 BaseColor; -+ -+void main(void) -+{ -+ int i; -+ vec4 sum = vec4(0.0); -+ for (i = 0; i < KernelSize; ++i) { -+ vec4 tmp = texture2D(srcTex, gl_TexCoord[0].st + Offset[i]); -+ sum += tmp * KernelValue[i]; -+ } -+ gl_FragColor = sum * ScaleFactor + BaseColor; -+} -diff --git a/src/glsl/simplex-noise.glsl b/src/glsl/simplex-noise.glsl -new file mode 100644 -index 0000000..b6833cb ---- /dev/null -+++ b/src/glsl/simplex-noise.glsl -@@ -0,0 +1,279 @@ -+// -+// Description : Array and textureless GLSL 2D/3D/4D simplex -+// noise functions. -+// Author : Ian McEwan, Ashima Arts. -+// Maintainer : ijm -+// Lastmod : 20110223 -+// License : Copyright (C) 2011 Ashima Arts. All rights reserved. -+// Distributed under the Artistic License 2.0; See LICENCE file. -+// -+ -+#define NORMALIZE_GRADIENTS -+#undef USE_CIRCLE -+#define COLLAPSE_SORTNET -+ -+float permute(float x0,vec3 p) { -+ float x1 = mod(x0 * p.y, p.x); -+ return floor( mod( (x1 + p.z) *x0, p.x )); -+ } -+vec2 permute(vec2 x0,vec3 p) { -+ vec2 x1 = mod(x0 * p.y, p.x); -+ return floor( mod( (x1 + p.z) *x0, p.x )); -+ } -+vec3 permute(vec3 x0,vec3 p) { -+ vec3 x1 = mod(x0 * p.y, p.x); -+ return floor( mod( (x1 + p.z) *x0, p.x )); -+ } -+vec4 permute(vec4 x0,vec3 p) { -+ vec4 x1 = mod(x0 * p.y, p.x); -+ return floor( mod( (x1 + p.z) *x0, p.x )); -+ } -+ -+uniform vec4 pParam; -+// Example -+// const vec4 pParam = vec4( 17.* 17., 34., 1., 7.); -+ -+float taylorInvSqrt(float r) -+ { -+ return ( 0.83666002653408 + 0.7*0.85373472095314 - 0.85373472095314 * r ); -+ } -+ -+float simplexNoise2(vec2 v) -+ { -+ const vec2 C = vec2(0.211324865405187134, // (3.0-sqrt(3.0))/6.; -+ 0.366025403784438597); // 0.5*(sqrt(3.0)-1.); -+ const vec3 D = vec3( 0., 0.5, 2.0) * 3.14159265358979312; -+// First corner -+ vec2 i = floor(v + dot(v, C.yy) ); -+ vec2 x0 = v - i + dot(i, C.xx); -+ -+// Other corners -+ vec2 i1 = (x0.x > x0.y) ? vec2(1.,0.) : vec2(0.,1.) ; -+ -+ // x0 = x0 - 0. + 0. * C -+ vec2 x1 = x0 - i1 + 1. * C.xx ; -+ vec2 x2 = x0 - 1. + 2. * C.xx ; -+ -+// Permutations -+ i = mod(i, pParam.x); -+ vec3 p = permute( permute( -+ i.y + vec3(0., i1.y, 1. ), pParam.xyz) -+ + i.x + vec3(0., i1.x, 1. ), pParam.xyz); -+ -+#ifndef USE_CIRCLE -+// ( N points uniformly over a line, mapped onto a diamond.) -+ vec3 x = fract(p / pParam.w) ; -+ vec3 h = 0.5 - abs(x) ; -+ -+ vec3 sx = vec3(lessThan(x,D.xxx)) *2. -1.; -+ vec3 sh = vec3(lessThan(h,D.xxx)); -+ -+ vec3 a0 = x + sx*sh; -+ vec2 p0 = vec2(a0.x,h.x); -+ vec2 p1 = vec2(a0.y,h.y); -+ vec2 p2 = vec2(a0.z,h.z); -+ -+#ifdef NORMALISE_GRADIENTS -+ p0 *= taylorInvSqrt(dot(p0,p0)); -+ p1 *= taylorInvSqrt(dot(p1,p1)); -+ p2 *= taylorInvSqrt(dot(p2,p2)); -+#endif -+ -+ vec3 g = 2.0 * vec3( dot(p0, x0), dot(p1, x1), dot(p2, x2) ); -+#else -+// N points around a unit circle. -+ vec3 phi = D.z * mod(p,pParam.w) /pParam.w ; -+ vec4 a0 = sin(phi.xxyy+D.xyxy); -+ vec2 a1 = sin(phi.zz +D.xy); -+ vec3 g = vec3( dot(a0.xy, x0), dot(a0.zw, x1), dot(a1.xy, x2) ); -+#endif -+// mix -+ vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.); -+ m = m*m ; -+ return 1.66666* 70.*dot(m*m, g); -+ } -+ -+float simplexNoise3(vec3 v) -+ { -+ const vec2 C = vec2(1./6. , 1./3. ) ; -+ const vec4 D = vec4(0., 0.5, 1.0, 2.0); -+ -+// First corner -+ vec3 i = floor(v + dot(v, C.yyy) ); -+ vec3 x0 = v - i + dot(i, C.xxx) ; -+ -+// Other corners -+#ifdef COLLAPSE_SORTNET -+ vec3 g = vec3( greaterThan( x0.xyz, x0.yzx) ); -+ vec3 l = vec3( lessThanEqual( x0.xyz, x0.yzx) ); -+ -+ vec3 i1 = g.xyz * l.zxy; -+ vec3 i2 = max( g.xyz, l.zxy); -+#else -+// Keeping this clean - let the compiler optimize. -+ vec3 q1; -+ q1.x = max(x0.x, x0.y); -+ q1.y = min(x0.x, x0.y); -+ q1.z = x0.z; -+ -+ vec3 q2; -+ q2.x = max(q1.x,q1.z); -+ q2.z = min(q1.x,q1.z); -+ q2.y = q1.y; -+ -+ vec3 q3; -+ q3.y = max(q2.y, q2.z); -+ q3.z = min(q2.y, q2.z); -+ q3.x = q2.x; -+ -+ vec3 i1 = vec3(equal(q3.xxx, x0)); -+ vec3 i2 = i1 + vec3(equal(q3.yyy, x0)); -+#endif -+ -+ // x0 = x0 - 0. + 0. * C -+ vec3 x1 = x0 - i1 + 1. * C.xxx; -+ vec3 x2 = x0 - i2 + 2. * C.xxx; -+ vec3 x3 = x0 - 1. + 3. * C.xxx; -+ -+// Permutations -+ i = mod(i, pParam.x ); -+ vec4 p = permute( permute( permute( -+ i.z + vec4(0., i1.z, i2.z, 1. ), pParam.xyz) -+ + i.y + vec4(0., i1.y, i2.y, 1. ), pParam.xyz) -+ + i.x + vec4(0., i1.x, i2.x, 1. ), pParam.xyz); -+ -+// Gradients -+// ( N*N points uniformly over a square, mapped onto a octohedron.) -+ float n_ = 1.0/pParam.w ; -+ vec3 ns = n_ * D.wyz - D.xzx ; -+ -+ vec4 j = p - pParam.w*pParam.w*floor(p * ns.z *ns.z); // mod(p,N*N) -+ -+ vec4 x_ = floor(j * ns.z) ; -+ vec4 y_ = floor(j - pParam.w * x_ ) ; // mod(j,N) -+ -+ vec4 x = x_ *ns.x + ns.yyyy; -+ vec4 y = y_ *ns.x + ns.yyyy; -+ vec4 h = 1. - abs(x) - abs(y); -+ -+ vec4 b0 = vec4( x.xy, y.xy ); -+ vec4 b1 = vec4( x.zw, y.zw ); -+ -+ vec4 s0 = vec4(lessThan(b0,D.xxxx)) *2. -1.; -+ vec4 s1 = vec4(lessThan(b1,D.xxxx)) *2. -1.; -+ vec4 sh = vec4(lessThan(h, D.xxxx)); -+ -+ vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; -+ vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; -+ -+ vec3 p0 = vec3(a0.xy,h.x); -+ vec3 p1 = vec3(a0.zw,h.y); -+ vec3 p2 = vec3(a1.xy,h.z); -+ vec3 p3 = vec3(a1.zw,h.w); -+ -+#ifdef NORMALISE_GRADIENTS -+ p0 *= taylorInvSqrt(dot(p0,p0)); -+ p1 *= taylorInvSqrt(dot(p1,p1)); -+ p2 *= taylorInvSqrt(dot(p2,p2)); -+ p3 *= taylorInvSqrt(dot(p3,p3)); -+#endif -+ -+// Mix -+ vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.); -+ m = m * m; -+//used to be 64. -+ return 48.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), -+ dot(p2,x2), dot(p3,x3) ) ); -+ } -+ -+vec4 grad4(float j, vec4 ip) -+ { -+ const vec4 ones = vec4(1.,1.,1.,-1.); -+ vec4 p,s; -+ -+ p.xyz = floor( fract (vec3(j) * ip.xyz) *pParam.w) * ip.z -1.0; -+ p.w = 1.5 - dot(abs(p.xyz), ones.xyz); -+ s = vec4(lessThan(p,vec4(0.))); -+ p.xyz = p.xyz + (s.xyz*2.-1.) * s.www; -+ -+ return p; -+ } -+ -+float simplexNoise4(vec4 v) -+ { -+ const vec2 C = vec2( 0.138196601125010504, // (5 - sqrt(5))/20 G4 -+ 0.309016994374947451); // (sqrt(5) - 1)/4 F4 -+// First corner -+ vec4 i = floor(v + dot(v, C.yyyy) ); -+ vec4 x0 = v - i + dot(i, C.xxxx); -+ -+// Other corners -+ -+// Force existance of strict total ordering in sort. -+ vec4 q0 = floor(x0 * 1024.0) + vec4( 0., 1./4., 2./4. , 3./4.); -+ vec4 q1; -+ q1.xy = max(q0.xy,q0.zw); // x:z y:w -+ q1.zw = min(q0.xy,q0.zw); -+ -+ vec4 q2; -+ q2.xz = max(q1.xz,q1.yw); // x:y z:w -+ q2.yw = min(q1.xz,q1.yw); -+ -+ vec4 q3; -+ q3.y = max(q2.y,q2.z); // y:z -+ q3.z = min(q2.y,q2.z); -+ q3.xw = q2.xw; -+ -+ vec4 i1 = vec4(lessThanEqual(q3.xxxx, q0)); -+ vec4 i2 = vec4(lessThanEqual(q3.yyyy, q0)); -+ vec4 i3 = vec4(lessThanEqual(q3.zzzz, q0)); -+ -+ // x0 = x0 - 0. + 0. * C -+ vec4 x1 = x0 - i1 + 1. * C.xxxx; -+ vec4 x2 = x0 - i2 + 2. * C.xxxx; -+ vec4 x3 = x0 - i3 + 3. * C.xxxx; -+ vec4 x4 = x0 - 1. + 4. * C.xxxx; -+ -+// Permutations -+ i = mod(i, pParam.x ); -+ float j0 = permute( permute( permute( permute ( -+ i.w, pParam.xyz) + i.z, pParam.xyz) -+ + i.y, pParam.xyz) + i.x, pParam.xyz); -+ vec4 j1 = permute( permute( permute( permute ( -+ i.w + vec4(i1.w, i2.w, i3.w, 1. ), pParam.xyz) -+ + i.z + vec4(i1.z, i2.z, i3.z, 1. ), pParam.xyz) -+ + i.y + vec4(i1.y, i2.y, i3.y, 1. ), pParam.xyz) -+ + i.x + vec4(i1.x, i2.x, i3.x, 1. ), pParam.xyz); -+// Gradients -+// ( N*N*N points uniformly over a cube, mapped onto a 4-octohedron.) -+ vec4 ip = pParam ; -+ ip.xy *= pParam.w ; -+ ip.x *= pParam.w ; -+ ip = vec4(1.,1.,1.,2.) / ip ; -+ -+ vec4 p0 = grad4(j0, ip); -+ vec4 p1 = grad4(j1.x, ip); -+ vec4 p2 = grad4(j1.y, ip); -+ vec4 p3 = grad4(j1.z, ip); -+ vec4 p4 = grad4(j1.w, ip); -+ -+#ifdef NORMALISE_GRADIENTS -+ p0 *= taylorInvSqrt(dot(p0,p0)); -+ p1 *= taylorInvSqrt(dot(p1,p1)); -+ p2 *= taylorInvSqrt(dot(p2,p2)); -+ p3 *= taylorInvSqrt(dot(p3,p3)); -+ p4 *= taylorInvSqrt(dot(p4,p4)); -+#endif -+ -+// Mix -+ vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.); -+ vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.); -+ m0 = m0 * m0; -+ m1 = m1 * m1; -+ return 32. * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 ))) -+ + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ; -+ -+ } -+ -+ -+ -diff --git a/src/glsl/skinning.vert b/src/glsl/skinning.vert -new file mode 100644 -index 0000000..28970ee ---- /dev/null -+++ b/src/glsl/skinning.vert -@@ -0,0 +1,24 @@ -+// Vertex weighting/blendin shader -+// Brian Paul -+// 4 Nov 2008 -+ -+uniform mat4 mat0, mat1; -+attribute float weight; -+ -+void main() -+{ -+ // simple diffuse shading -+ // Note that we should really transform the normal vector along with -+ // the postion below... someday. -+ vec3 lightVec = vec3(0, 0, 1); -+ vec3 norm = gl_NormalMatrix * gl_Normal; -+ float dot = 0.2 + max(0.0, dot(norm, lightVec)); -+ gl_FrontColor = vec4(dot); -+ -+ // compute sum of weighted transformations -+ vec4 pos0 = mat0 * gl_Vertex; -+ vec4 pos1 = mat1 * gl_Vertex; -+ vec4 pos = mix(pos0, pos1, weight); -+ -+ gl_Position = gl_ModelViewProjectionMatrix * pos; -+} -diff --git a/src/perf/glslstateschange1.frag b/src/perf/glslstateschange1.frag -new file mode 100644 -index 0000000..0839436 ---- /dev/null -+++ b/src/perf/glslstateschange1.frag -@@ -0,0 +1,19 @@ -+// Multi-texture fragment shader -+// Brian Paul -+ -+// Composite second texture over first. -+// We're assuming the 2nd texture has a meaningful alpha channel. -+ -+uniform sampler2D tex1; -+uniform sampler2D tex2; -+uniform vec4 UniV1; -+uniform vec4 UniV2; -+ -+void main() -+{ -+ vec4 t3; -+ vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy); -+ vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy); -+ t3 = mix(t1, t2, t2.w); -+ gl_FragColor = t3 + UniV1 + UniV2; -+} -diff --git a/src/perf/glslstateschange1.vert b/src/perf/glslstateschange1.vert -new file mode 100644 -index 0000000..cef50db ---- /dev/null -+++ b/src/perf/glslstateschange1.vert -@@ -0,0 +1,14 @@ -+// Multi-texture vertex shader -+// Brian Paul -+ -+ -+attribute vec4 TexCoord0, TexCoord1; -+attribute vec4 VertCoord; -+ -+void main() -+{ -+ gl_TexCoord[0] = TexCoord0; -+ gl_TexCoord[1] = TexCoord1; -+ // note: may use gl_Vertex or VertCoord here for testing: -+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; -+} -diff --git a/src/perf/glslstateschange2.frag b/src/perf/glslstateschange2.frag -new file mode 100644 -index 0000000..0df0319 ---- /dev/null -+++ b/src/perf/glslstateschange2.frag -@@ -0,0 +1,17 @@ -+// Multi-texture fragment shader -+// Brian Paul -+ -+// Composite second texture over first. -+// We're assuming the 2nd texture has a meaningful alpha channel. -+ -+uniform sampler2D tex1; -+uniform sampler2D tex2; -+uniform vec4 UniV1; -+uniform vec4 UniV2; -+ -+void main() -+{ -+ vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy); -+ vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy); -+ gl_FragColor = t1 + t2 + UniV1 + UniV2; -+} -diff --git a/src/perf/glslstateschange2.vert b/src/perf/glslstateschange2.vert -new file mode 100644 -index 0000000..cef50db ---- /dev/null -+++ b/src/perf/glslstateschange2.vert -@@ -0,0 +1,14 @@ -+// Multi-texture vertex shader -+// Brian Paul -+ -+ -+attribute vec4 TexCoord0, TexCoord1; -+attribute vec4 VertCoord; -+ -+void main() -+{ -+ gl_TexCoord[0] = TexCoord0; -+ gl_TexCoord[1] = TexCoord1; -+ // note: may use gl_Vertex or VertCoord here for testing: -+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; -+} -diff --git a/src/vpglsl/infinite-loop.glsl b/src/vpglsl/infinite-loop.glsl -new file mode 100644 -index 0000000..bc7ae4b ---- /dev/null -+++ b/src/vpglsl/infinite-loop.glsl -@@ -0,0 +1,8 @@ -+void main() { -+ gl_Position = gl_Vertex; -+ vec4 sum = vec4(0); -+ for (int i = 1; i != 2; i += 2) { -+ sum += vec4(0.1, 0.1, 0.1, 0.1); -+ } -+ gl_FrontColor = sum; -+} --- -2.0.0 - diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch deleted file mode 100644 index f6b59a11..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch +++ /dev/null @@ -1,377 +0,0 @@ -From 779438770bedf3d53e6ad8f7cd6889b7f50daf3b Mon Sep 17 00:00:00 2001 -From: Martin Jansa -Date: Wed, 9 Jul 2014 14:23:41 +0200 -Subject: [PATCH] configure: Allow to disable demos which require GLEW or GLU - -* in some systems without X11 support we don't have GLEW, but - mesa-demos are still useful - -Upstream-Status: Pending - -Signed-off-by: Martin Jansa - -Port to 8.3.0 -Signed-off-by: Jussi Kukkonen ---- - configure.ac | 49 ++++++++++++++++++++--------- - src/Makefile.am | 18 ++++++++--- - src/demos/Makefile.am | 73 ++++++++++++++++++++++++------------------- - src/egl/Makefile.am | 8 +++-- - src/egl/opengles1/Makefile.am | 10 ++++-- - src/egl/opengles2/Makefile.am | 29 ++++++++--------- - 6 files changed, 117 insertions(+), 70 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 0525b09..28834cd 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -93,25 +93,44 @@ AC_EGREP_HEADER([glutInitContextProfile], - [AC_DEFINE(HAVE_FREEGLUT)], - []) - --dnl Check for GLEW --PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4]) --DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS" --DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS" -+AC_ARG_ENABLE([glew], -+ [AS_HELP_STRING([--enable-glew], -+ [build demos which require glew @<:@default=yes@:>@])], -+ [enable_glew="$enableval"], -+ [enable_glew=yes] -+) -+ -+if test "x$enable_glew" = xyes; then -+ dnl Check for GLEW -+ PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4], [glew_enabled=yes], [glew_enabled=no]) -+ DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS" -+ DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS" -+fi - - # LIBS was set by AC_CHECK_LIB above - LIBS="" - --PKG_CHECK_MODULES(GLU, [glu], [], -- [AC_CHECK_HEADER([GL/glu.h], -- [], -- AC_MSG_ERROR([GLU not found])) -- AC_CHECK_LIB([GLU], -- [gluBeginCurve], -- [GLU_LIBS=-lGLU], -- AC_MSG_ERROR([GLU required])) ]) -+AC_ARG_ENABLE([glu], -+ [AS_HELP_STRING([--enable-glu], -+ [build demos which require glu @<:@default=yes@:>@])], -+ [enable_glu="$enableval"], -+ [enable_glu=yes] -+) - --DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS" --DEMO_LIBS="$DEMO_LIBS $GLU_LIBS" -+if test "x$enable_glu" = xyes; then -+ PKG_CHECK_MODULES(GLU, [glu], [glu_enabled=yes], -+ [AC_CHECK_HEADER([GL/glu.h], -+ [], -+ AC_MSG_ERROR([GLU not found])) -+ AC_CHECK_LIB([GLU], -+ [gluBeginCurve], -+ [GLU_LIBS=-lGLU -+ glu_enabled=yes], -+ AC_MSG_ERROR([GLU required])) ]) -+ -+ DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS" -+ DEMO_LIBS="$DEMO_LIBS $GLU_LIBS" -+fi - - AC_ARG_ENABLE([egl], - [AS_HELP_STRING([--enable-egl], -@@ -304,6 +323,8 @@ AC_SUBST([WAYLAND_CFLAGS]) - AC_SUBST([WAYLAND_LIBS]) - - -+AM_CONDITIONAL(HAVE_GLU, test "x$glu_enabled" = "xyes") -+AM_CONDITIONAL(HAVE_GLEW, test "x$glew_enabled" = "xyes") - AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes") - AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes") - AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes") -diff --git a/src/Makefile.am b/src/Makefile.am -index 1647d64..8b89dee 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -22,15 +22,19 @@ - # Authors: - # Eric Anholt - -+if HAVE_GLEW -+UTIL = util -+endif -+ - SUBDIRS = \ -- util \ -+ $(UTIL) \ - data \ - demos \ - egl \ - fp \ - fpglsl \ - glsl \ -- gs \ -+ gs \ - objviewer \ - osdemos \ - perf \ -@@ -40,8 +44,12 @@ SUBDIRS = \ - slang \ - tests \ - tools \ -- trivial \ -- vp \ -- vpglsl \ - wgl \ - xdemos -+ -+if HAVE_GLEW -+SUBDIRS += \ -+ vp \ -+ vpglsl \ -+ trivial -+endif -diff --git a/src/demos/Makefile.am b/src/demos/Makefile.am -index 41603fa..ab1e3ab 100644 ---- a/src/demos/Makefile.am -+++ b/src/demos/Makefile.am -@@ -30,91 +30,100 @@ AM_LDFLAGS = \ - $(DEMO_LIBS) \ - $(GLUT_LIBS) - -+bin_PROGRAMS = -+ - if HAVE_GLUT --bin_PROGRAMS = \ -+if HAVE_GLEW -+bin_PROGRAMS += \ - arbfplight \ - arbfslight \ - arbocclude \ - arbocclude2 \ -- bounce \ -- clearspd \ - copypix \ - cubemap \ - cuberender \ - dinoshade \ -- dissolve \ -- drawpix \ - engine \ - fbo_firecube \ - fbotexture \ -- fire \ - fogcoord \ - fplight \ - fslight \ -+ gloss \ -+ isosurf \ -+ multiarb \ -+ paltex \ -+ pointblast \ -+ projtex \ -+ shadowtex \ -+ spriteblast \ -+ stex3d \ -+ textures \ -+ vao_demo \ -+ winpos -+ -+copypix_LDADD = ../util/libutil.la -+cubemap_LDADD = ../util/libutil.la -+cuberender_LDADD = ../util/libutil.la -+engine_LDADD = ../util/libutil.la -+fbo_firecube_LDADD = ../util/libutil.la -+gloss_LDADD = ../util/libutil.la -+isosurf_LDADD = ../util/libutil.la -+multiarb_LDADD = ../util/libutil.la -+projtex_LDADD = ../util/libutil.la -+textures_LDADD = ../util/libutil.la -+winpos_LDADD = ../util/libutil.la -+endif -+ -+if HAVE_GLU -+bin_PROGRAMS += \ -+ bounce \ -+ clearspd \ -+ dissolve \ -+ drawpix \ -+ fire \ - gamma \ - gearbox \ - gears \ - geartrain \ - glinfo \ -- gloss \ - gltestperf \ - ipers \ -- isosurf \ - lodbias \ - morph3d \ -- multiarb \ -- paltex \ - pixeltest \ -- pointblast \ -- projtex \ - ray \ - readpix \ - reflect \ - renormal \ -- shadowtex \ - singlebuffer \ - spectex \ -- spriteblast \ -- stex3d \ - teapot \ - terrain \ - tessdemo \ - texcyl \ - texenv \ -- textures \ - trispd \ - tunnel2 \ -- tunnel \ -- vao_demo \ -- winpos --endif -+ tunnel - - tunnel_SOURCES = \ - tunnel.c \ - tunneldat.h - --copypix_LDADD = ../util/libutil.la --cubemap_LDADD = ../util/libutil.la --cuberender_LDADD = ../util/libutil.la --drawpix_LDADD = ../util/libutil.la - dissolve_LDADD = ../util/libutil.la --engine_LDADD = ../util/libutil.la --fbo_firecube_LDADD = ../util/libutil.la -+drawpix_LDADD = ../util/libutil.la - fire_LDADD = ../util/libutil.la --gloss_LDADD = ../util/libutil.la - ipers_LDADD = ../util/libutil.la --isosurf_LDADD = ../util/libutil.la - lodbias_LDADD = ../util/libutil.la --multiarb_LDADD = ../util/libutil.la --projtex_LDADD = ../util/libutil.la - readpix_LDADD = ../util/libutil.la - reflect_LDADD = ../util/libutil.la - teapot_LDADD = ../util/libutil.la - texcyl_LDADD = ../util/libutil.la --textures_LDADD = ../util/libutil.la - tunnel_LDADD = ../util/libutil.la - tunnel2_LDADD = ../util/libutil.la --winpos_LDADD = ../util/libutil.la -+endif -+endif - - EXTRA_DIST = \ - README -diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am -index d64a49e..4fe1ca8 100644 ---- a/src/egl/Makefile.am -+++ b/src/egl/Makefile.am -@@ -24,8 +24,12 @@ - - SUBDIRS = \ - eglut \ -- opengl \ -- openvg \ - opengles1 \ - opengles2 \ - oes_vg -+ -+if HAVE_GLU -+SUBDIRS += \ -+ opengl \ -+ openvg -+endif -diff --git a/src/egl/opengles1/Makefile.am b/src/egl/opengles1/Makefile.am -index fa397c2..21853e8 100644 ---- a/src/egl/opengles1/Makefile.am -+++ b/src/egl/opengles1/Makefile.am -@@ -36,9 +36,12 @@ AM_LDFLAGS = \ - $(EGL_LIBS) \ - -lm - -+noinst_PROGRAMS = -+ - if HAVE_EGL - if HAVE_GLESV1 --noinst_PROGRAMS = \ -+if HAVE_X11 -+bin_PROGRAMS = \ - bindtex \ - clear \ - drawtex_x11 \ -@@ -52,8 +55,6 @@ noinst_PROGRAMS = \ - torus_x11 \ - tri_x11 \ - two_win --endif --endif - - bindtex_LDADD = $(X11_LIBS) - es1_info_LDADD = $(X11_LIBS) -@@ -76,3 +77,6 @@ drawtex_x11_LDADD = ../eglut/libeglut_x11.la - gears_x11_LDADD = ../eglut/libeglut_x11.la - torus_x11_LDADD = ../eglut/libeglut_x11.la - tri_x11_LDADD = ../eglut/libeglut_x11.la -+endif -+endif -+endif -diff --git a/src/egl/opengles2/Makefile.am b/src/egl/opengles2/Makefile.am -index b80ba50..17f8d49 100644 ---- a/src/egl/opengles2/Makefile.am -+++ b/src/egl/opengles2/Makefile.am -@@ -33,27 +33,28 @@ AM_LDFLAGS = \ - $(EGL_LIBS) \ - -lm - -+bin_PROGRAMS = -+ - if HAVE_EGL - if HAVE_GLESV2 --bin_PROGRAMS = --if HAVE_X11 --bin_PROGRAMS += \ -- es2_info \ -- es2gears_x11 \ -- es2tri --endif - if HAVE_WAYLAND - bin_PROGRAMS += es2gears_wayland --endif --endif -+ -+es2gears_wayland_SOURCES = es2gears.c -+es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la - endif - --es2_info_LDADD = $(X11_LIBS) --es2tri_LDADD = $(X11_LIBS) -+if HAVE_X11 -+bin_PROGRAMS += \ -+ es2tri \ -+ es2_info \ -+ es2gears_x11 - -+es2_info_LDADD = $(X11_LIBS) - es2gears_x11_SOURCES = es2gears.c -- - es2gears_x11_LDADD = ../eglut/libeglut_x11.la -+es2tri_LDADD = $(X11_LIBS) -+endif -+endif -+endif - --es2gears_wayland_SOURCES = es2gears.c --es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la --- -2.1.4 - diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch deleted file mode 100644 index f77b97f3..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch +++ /dev/null @@ -1,234 +0,0 @@ -From 5e10108d76a59abac21c7e540bcfd2ddaccca2cb Mon Sep 17 00:00:00 2001 -From: Drew Moseley -Date: Fri, 9 May 2014 11:50:24 -0400 -Subject: [PATCH 4/9] Use DEMOS_DATA_DIR to locate data files - -Upstream-Status: Submitted [https://bugs.freedesktop.org/show_bug.cgi?id=78496] -Signed-off-by: Drew Moseley ---- - src/glsl/bezier.c | 2 +- - src/glsl/blinking-teapot.c | 4 ++-- - src/glsl/brick.c | 4 ++-- - src/glsl/bump.c | 6 +++--- - src/glsl/convolutions.c | 2 +- - src/glsl/mandelbrot.c | 4 ++-- - src/glsl/multitex.c | 4 ++-- - src/glsl/simplex-noise.c | 2 +- - src/glsl/skinning.c | 4 ++-- - src/glsl/texdemo1.c | 8 ++++---- - src/glsl/toyball.c | 4 ++-- - src/objviewer/objview.c | 12 ++++++------ - src/perf/glslstateschange.c | 8 ++++---- - 13 files changed, 32 insertions(+), 32 deletions(-) - -diff --git a/src/glsl/bezier.c b/src/glsl/bezier.c -index 0b56bc1..e01603d 100644 ---- a/src/glsl/bezier.c -+++ b/src/glsl/bezier.c -@@ -13,7 +13,7 @@ - #include "glut_wrap.h" - #include "shaderutil.h" - --static const char *filename = "bezier.geom"; -+static const char *filename = DEMOS_DATA_DIR "bezier.geom"; - - static GLuint fragShader; - static GLuint vertShader; -diff --git a/src/glsl/blinking-teapot.c b/src/glsl/blinking-teapot.c -index e3bf24d..7662b1f 100644 ---- a/src/glsl/blinking-teapot.c -+++ b/src/glsl/blinking-teapot.c -@@ -63,8 +63,8 @@ init_opengl (void) - exit(1); - } - -- vshad_id = CompileShaderFile (GL_VERTEX_SHADER, "blinking-teapot.vert"); -- fshad_id = CompileShaderFile (GL_FRAGMENT_SHADER, "blinking-teapot.frag"); -+ vshad_id = CompileShaderFile (GL_VERTEX_SHADER, DEMOS_DATA_DIR "blinking-teapot.vert"); -+ fshad_id = CompileShaderFile (GL_FRAGMENT_SHADER, DEMOS_DATA_DIR "blinking-teapot.frag"); - prog_id = LinkShaders (vshad_id, fshad_id); - - UseProgram (prog_id); -diff --git a/src/glsl/brick.c b/src/glsl/brick.c -index 3021856..fe5f190 100644 ---- a/src/glsl/brick.c -+++ b/src/glsl/brick.c -@@ -14,8 +14,8 @@ - #include "shaderutil.h" - - --static char *FragProgFile = "CH06-brick.frag"; --static char *VertProgFile = "CH06-brick.vert"; -+static char *FragProgFile = DEMOS_DATA_DIR "CH06-brick.frag"; -+static char *VertProgFile = DEMOS_DATA_DIR "CH06-brick.vert"; - - /* program/shader objects */ - static GLuint fragShader; -diff --git a/src/glsl/bump.c b/src/glsl/bump.c -index 59f62cd..3a1b20a 100644 ---- a/src/glsl/bump.c -+++ b/src/glsl/bump.c -@@ -15,9 +15,9 @@ - #include "readtex.h" - - --static char *FragProgFile = "CH11-bumpmap.frag"; --static char *FragTexProgFile = "CH11-bumpmaptex.frag"; --static char *VertProgFile = "CH11-bumpmap.vert"; -+static char *FragProgFile = DEMOS_DATA_DIR "CH11-bumpmap.frag"; -+static char *FragTexProgFile = DEMOS_DATA_DIR "CH11-bumpmaptex.frag"; -+static char *VertProgFile = DEMOS_DATA_DIR "CH11-bumpmap.vert"; - static char *TextureFile = DEMOS_DATA_DIR "tile.rgb"; - - /* program/shader objects */ -diff --git a/src/glsl/convolutions.c b/src/glsl/convolutions.c -index a120cfe..9312f00 100644 ---- a/src/glsl/convolutions.c -+++ b/src/glsl/convolutions.c -@@ -340,7 +340,7 @@ static void init(void) - - menuInit(); - readTexture(textureLocation); -- createProgram("convolution.vert", "convolution.frag"); -+ createProgram(DEMOS_DATA_DIR "convolution.vert", DEMOS_DATA_DIR "convolution.frag"); - - glEnable(GL_TEXTURE_2D); - glClearColor(1.0, 1.0, 1.0, 1.0); -diff --git a/src/glsl/mandelbrot.c b/src/glsl/mandelbrot.c -index 31ede1d..ab34a0f 100644 ---- a/src/glsl/mandelbrot.c -+++ b/src/glsl/mandelbrot.c -@@ -14,8 +14,8 @@ - #include "shaderutil.h" - - --static char *FragProgFile = "CH18-mandel.frag"; --static char *VertProgFile = "CH18-mandel.vert"; -+static char *FragProgFile = DEMOS_DATA_DIR "CH18-mandel.frag"; -+static char *VertProgFile = DEMOS_DATA_DIR "CH18-mandel.vert"; - - /* program/shader objects */ - static GLuint fragShader; -diff --git a/src/glsl/multitex.c b/src/glsl/multitex.c -index 262ea50..546bd27 100644 ---- a/src/glsl/multitex.c -+++ b/src/glsl/multitex.c -@@ -35,8 +35,8 @@ - - static const char *Demo = "multitex"; - --static const char *VertFile = "multitex.vert"; --static const char *FragFile = "multitex.frag"; -+static const char *VertFile = DEMOS_DATA_DIR "multitex.vert"; -+static const char *FragFile = DEMOS_DATA_DIR "multitex.frag"; - - static const char *TexFiles[2] = - { -diff --git a/src/glsl/simplex-noise.c b/src/glsl/simplex-noise.c -index 13fdd5d..885f01e 100644 ---- a/src/glsl/simplex-noise.c -+++ b/src/glsl/simplex-noise.c -@@ -169,7 +169,7 @@ SpecialKey(int key, int x, int y) - static void - Init(void) - { -- const char *filename = "simplex-noise.glsl"; -+ const char *filename = DEMOS_DATA_DIR "simplex-noise.glsl"; - char noiseText[10000]; - FILE *f; - int len; -diff --git a/src/glsl/skinning.c b/src/glsl/skinning.c -index bf38d77..536d475 100644 ---- a/src/glsl/skinning.c -+++ b/src/glsl/skinning.c -@@ -20,8 +20,8 @@ - #define M_PI 3.1415926535 - #endif - --static char *FragProgFile = "skinning.frag"; --static char *VertProgFile = "skinning.vert"; -+static char *FragProgFile = DEMOS_DATA_DIR "skinning.frag"; -+static char *VertProgFile = DEMOS_DATA_DIR "skinning.vert"; - - /* program/shader objects */ - static GLuint fragShader; -diff --git a/src/glsl/texdemo1.c b/src/glsl/texdemo1.c -index 6cde239..a082342 100644 ---- a/src/glsl/texdemo1.c -+++ b/src/glsl/texdemo1.c -@@ -35,11 +35,11 @@ - - static const char *Demo = "texdemo1"; - --static const char *ReflectVertFile = "reflect.vert"; --static const char *CubeFragFile = "cubemap.frag"; -+static const char *ReflectVertFile = DEMOS_DATA_DIR "reflect.vert"; -+static const char *CubeFragFile = DEMOS_DATA_DIR "cubemap.frag"; - --static const char *SimpleVertFile = "simple.vert"; --static const char *SimpleTexFragFile = "shadowtex.frag"; -+static const char *SimpleVertFile = DEMOS_DATA_DIR "simple.vert"; -+static const char *SimpleTexFragFile = DEMOS_DATA_DIR "shadowtex.frag"; - - static const char *GroundImage = DEMOS_DATA_DIR "tile.rgb"; - -diff --git a/src/glsl/toyball.c b/src/glsl/toyball.c -index 5f27951..4e7e832 100644 ---- a/src/glsl/toyball.c -+++ b/src/glsl/toyball.c -@@ -14,8 +14,8 @@ - #include "shaderutil.h" - - --static char *FragProgFile = "CH11-toyball.frag"; --static char *VertProgFile = "CH11-toyball.vert"; -+static char *FragProgFile = DEMOS_DATA_DIR "CH11-toyball.frag"; -+static char *VertProgFile = DEMOS_DATA_DIR "CH11-toyball.vert"; - - /* program/shader objects */ - static GLuint fragShader; -diff --git a/src/objviewer/objview.c b/src/objviewer/objview.c -index 6def726..78a6acf 100644 ---- a/src/objviewer/objview.c -+++ b/src/objviewer/objview.c -@@ -162,12 +162,12 @@ init_model(void) - static void - init_skybox(void) - { -- SkyboxTex = LoadSkyBoxCubeTexture("alpine_east.rgb", -- "alpine_west.rgb", -- "alpine_up.rgb", -- "alpine_down.rgb", -- "alpine_south.rgb", -- "alpine_north.rgb"); -+ SkyboxTex = LoadSkyBoxCubeTexture(DEMOS_DATA_DIR "alpine_east.rgb", -+ DEMOS_DATA_DIR "alpine_west.rgb", -+ DEMOS_DATA_DIR "alpine_up.rgb", -+ DEMOS_DATA_DIR "alpine_down.rgb", -+ DEMOS_DATA_DIR "alpine_south.rgb", -+ DEMOS_DATA_DIR "alpine_north.rgb"); - glmSpecularTexture(Model, SkyboxTex); - } - -diff --git a/src/perf/glslstateschange.c b/src/perf/glslstateschange.c -index 7422b78..dbf8332 100644 ---- a/src/perf/glslstateschange.c -+++ b/src/perf/glslstateschange.c -@@ -33,10 +33,10 @@ - #include "glmain.h" - #include "common.h" - --static const char *VertFile1 = "glslstateschange1.vert"; --static const char *FragFile1 = "glslstateschange1.frag"; --static const char *VertFile2 = "glslstateschange2.vert"; --static const char *FragFile2 = "glslstateschange2.frag"; -+static const char *VertFile1 = DEMOS_DATA_DIR "glslstateschange1.vert"; -+static const char *FragFile1 = DEMOS_DATA_DIR "glslstateschange1.frag"; -+static const char *VertFile2 = DEMOS_DATA_DIR "glslstateschange2.vert"; -+static const char *FragFile2 = DEMOS_DATA_DIR "glslstateschange2.frag"; - static struct uniform_info Uniforms1[] = { - { "tex1", 1, GL_SAMPLER_2D, { 0, 0, 0, 0 }, -1 }, - { "tex2", 1, GL_SAMPLER_2D, { 1, 0, 0, 0 }, -1 }, --- -2.0.0 - diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch deleted file mode 100644 index b27d9eaf..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 2e0367a941445a862ab99c54ec85d1357d0f73c0 Mon Sep 17 00:00:00 2001 -From: Martin Jansa -Date: Thu, 10 Jul 2014 14:30:52 +0200 -Subject: [PATCH] Install few more test programs - -Upstream-Status: Pending - -Signed-off-by: Martin Jansa - -Signed-off-by: Jussi Kukkonen - ---- - src/egl/opengl/Makefile.am | 3 +-- - src/egl/openvg/Makefile.am | 2 +- - 2 files changed, 2 insertions(+), 3 deletions(-) - -diff --git a/src/egl/opengl/Makefile.am b/src/egl/opengl/Makefile.am -index 6d184ff6..ab09d028 100644 ---- a/src/egl/opengl/Makefile.am -+++ b/src/egl/opengl/Makefile.am -@@ -57,8 +57,7 @@ endif - - if HAVE_EGL - bin_PROGRAMS = \ -- eglinfo --noinst_PROGRAMS = \ -+ eglinfo \ - peglgears \ - $(EGL_DRM_DEMOS) \ - $(EGL_X11_DEMOS) \ -diff --git a/src/egl/openvg/Makefile.am b/src/egl/openvg/Makefile.am -index b0f1212f..5fd1cf83 100644 ---- a/src/egl/openvg/Makefile.am -+++ b/src/egl/openvg/Makefile.am -@@ -49,7 +49,7 @@ endif - - if HAVE_EGL - if HAVE_VG --noinst_PROGRAMS = \ -+bin_PROGRAMS = \ - $(EGL_X11_DEMOS) - endif - endif diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch deleted file mode 100644 index a6d16817..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch +++ /dev/null @@ -1,99 +0,0 @@ -From 894add34c2b5e6b4ccc78996bf681d7ec7bc9e36 Mon Sep 17 00:00:00 2001 -From: Martin Jansa -Date: Thu, 10 Jul 2014 14:29:27 +0200 -Subject: [PATCH] glsl, perf: Add few missing .glsl, .vert, .frag files to - EXTRA_DATA - -Upstream-Status: Pending - -Signed-off-by: Martin Jansa - ---- - src/fpglsl/Makefile.am | 2 ++ - src/glsl/Makefile.am | 10 ++++++++-- - src/perf/Makefile.am | 6 ++++++ - src/vpglsl/Makefile.am | 1 + - 4 files changed, 17 insertions(+), 2 deletions(-) - -diff --git a/src/fpglsl/Makefile.am b/src/fpglsl/Makefile.am -index 47c1039f..fd43c919 100644 ---- a/src/fpglsl/Makefile.am -+++ b/src/fpglsl/Makefile.am -@@ -39,10 +39,12 @@ noinst_PROGRAMS = \ - endif - - EXTRA_DIST = \ -+ depth-read.glsl \ - dowhile2.glsl \ - dowhile.glsl \ - forbreak.glsl \ - for.glsl \ -+ infinite-loop.glsl \ - mov.glsl \ - mov-imm.glsl \ - simpleif.glsl \ -diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am -index 4faa8dbf..079a29d8 100644 ---- a/src/glsl/Makefile.am -+++ b/src/glsl/Makefile.am -@@ -37,7 +37,7 @@ AM_LDFLAGS = \ - if HAVE_GLUT - bin_PROGRAMS = \ - array \ -- bezier \ -+ bezier \ - bitmap \ - brick \ - bump \ -@@ -123,12 +123,16 @@ EXTRA_DIST = \ - CH06-brick.vert \ - CH11-bumpmap.frag \ - CH11-bumpmap.vert \ -+ CH11-bumpmaptex.frag \ - CH11-toyball.frag \ - CH11-toyball.vert \ - CH18-mandel.frag \ - CH18-mandel.vert \ -- bezier.geom \ -+ bezier.geom \ - brick.shtest \ -+ blinking-teapot.frag \ -+ blinking-teapot.vert \ -+ convolution.frag \ - convolution.vert \ - cubemap.frag \ - mandelbrot.shtest \ -@@ -138,5 +142,7 @@ EXTRA_DIST = \ - reflect.vert \ - shadowtex.frag \ - simple.vert \ -+ simplex-noise.glsl \ - skinning.frag \ -+ skinning.vert \ - toyball.shtest -diff --git a/src/perf/Makefile.am b/src/perf/Makefile.am -index f0031fea..60069396 100644 ---- a/src/perf/Makefile.am -+++ b/src/perf/Makefile.am -@@ -59,3 +59,9 @@ endif - - glslstateschange_LDADD = libperf.la ../util/libutil.la - glsl_compile_time_LDADD = ../util/libutil.la -+ -+EXTRA_DIST = \ -+ glslstateschange1.frag \ -+ glslstateschange1.vert \ -+ glslstateschange2.frag \ -+ glslstateschange2.vert -diff --git a/src/vpglsl/Makefile.am b/src/vpglsl/Makefile.am -index 4a85ed40..48b08f48 100644 ---- a/src/vpglsl/Makefile.am -+++ b/src/vpglsl/Makefile.am -@@ -44,6 +44,7 @@ EXTRA_DIST = \ - func2.glsl \ - ifelse.glsl \ - if.glsl \ -+ infinite-loop.glsl \ - mov.glsl \ - nestedifs.glsl \ - nestedswizzle.glsl \ diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch deleted file mode 100644 index 8a98ba60..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 477ab6d90a17d8e4d3935be6ce8b8e154db0e3e5 Mon Sep 17 00:00:00 2001 -From: Martin Jansa -Date: Thu, 10 Jul 2014 14:48:12 +0200 -Subject: [PATCH] glsl, perf: Install .glsl, .vert, .frag files - -Upstream-Status: Pending -Signed-off-by: Martin Jansa - ---- - src/fpglsl/Makefile.am | 3 ++- - src/glsl/Makefile.am | 3 ++- - src/perf/Makefile.am | 3 ++- - src/vpglsl/Makefile.am | 3 ++- - 4 files changed, 8 insertions(+), 4 deletions(-) - -diff --git a/src/fpglsl/Makefile.am b/src/fpglsl/Makefile.am -index fd43c919..2bf51de4 100644 ---- a/src/fpglsl/Makefile.am -+++ b/src/fpglsl/Makefile.am -@@ -38,7 +38,8 @@ noinst_PROGRAMS = \ - fp-tri - endif - --EXTRA_DIST = \ -+demosdatadir=$(datadir)/$(PACKAGE)/ -+dist_demosdata_DATA= \ - depth-read.glsl \ - dowhile2.glsl \ - dowhile.glsl \ -diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am -index 079a29d8..f66ec299 100644 ---- a/src/glsl/Makefile.am -+++ b/src/glsl/Makefile.am -@@ -118,7 +118,8 @@ vert_or_frag_only_LDADD = ../util/libutil.la - vert_tex_LDADD = ../util/libutil.la - vsraytrace_LDADD = ../util/libutil.la - --EXTRA_DIST = \ -+demosdatadir=$(datadir)/$(PACKAGE)/ -+dist_demosdata_DATA= \ - CH06-brick.frag \ - CH06-brick.vert \ - CH11-bumpmap.frag \ -diff --git a/src/perf/Makefile.am b/src/perf/Makefile.am -index 60069396..469bdf45 100644 ---- a/src/perf/Makefile.am -+++ b/src/perf/Makefile.am -@@ -60,7 +60,8 @@ endif - glslstateschange_LDADD = libperf.la ../util/libutil.la - glsl_compile_time_LDADD = ../util/libutil.la - --EXTRA_DIST = \ -+demosdatadir=$(datadir)/$(PACKAGE)/ -+dist_demosdata_DATA= \ - glslstateschange1.frag \ - glslstateschange1.vert \ - glslstateschange2.frag \ -diff --git a/src/vpglsl/Makefile.am b/src/vpglsl/Makefile.am -index 48b08f48..55268675 100644 ---- a/src/vpglsl/Makefile.am -+++ b/src/vpglsl/Makefile.am -@@ -38,7 +38,8 @@ noinst_PROGRAMS = \ - vp-tris - endif - --EXTRA_DIST = \ -+demosdatadir=$(datadir)/$(PACKAGE)/ -+dist_demosdata_DATA= \ - for.glsl \ - func.glsl \ - func2.glsl \ diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0012-mesa-demos-OpenVG-demos-with-single-frame-need-eglSw.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0012-mesa-demos-OpenVG-demos-with-single-frame-need-eglSw.patch deleted file mode 100644 index c6876474..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0012-mesa-demos-OpenVG-demos-with-single-frame-need-eglSw.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 3aa84c47e88a4c38446ce1323abf6f2c77389104 Mon Sep 17 00:00:00 2001 -From: Prabhu -Date: Mon, 16 Nov 2015 17:09:32 -0600 -Subject: [PATCH] mesa-demos: OpenVG demos with single frame need eglSwapBuffer - -sp and text demos rendering single frame. to display the -single frame rendered needed a eglSwapBuffer to diplay to window. -Hence added eglutPostRedisplay to display the frame - -Upstream-Status: Pending - -Signed-off-by: Prabhu ---- - src/egl/openvg/sp.c | 1 + - src/egl/openvg/text.c | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/src/egl/openvg/sp.c b/src/egl/openvg/sp.c -index a20c0a3..468e91e 100644 ---- a/src/egl/openvg/sp.c -+++ b/src/egl/openvg/sp.c -@@ -500,6 +500,7 @@ draw(void) - } - - vgFlush(); -+ eglutPostRedisplay(); - } - - -diff --git a/src/egl/openvg/text.c b/src/egl/openvg/text.c -index f5c6de8..492581c 100644 ---- a/src/egl/openvg/text.c -+++ b/src/egl/openvg/text.c -@@ -360,6 +360,7 @@ display(void) - { - vgClear(0, 0, width, height); - glyph_string_draw(10.0, 10.0); -+ eglutPostRedisplay(); - } - - --- -2.5.1 - diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0013-only-build-GLX-demos-if-needed.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0013-only-build-GLX-demos-if-needed.patch deleted file mode 100644 index e7be4dfb..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0013-only-build-GLX-demos-if-needed.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 322af294390a7f4e1524c5a79312be6cbebce988 Mon Sep 17 00:00:00 2001 -From: Awais Belal -Date: Wed, 11 Nov 2015 17:22:12 +0500 -Subject: [PATCH] only build GLX demos if needed - -There are platforms that default to EGL only configurations -in which case the GLX applications are not required -at all. Allow the user to control generation of these -demos as needed through a configure switch. - -Signed-off-by: Awais Belal -Upstream-Status: Pending ---- - configure.ac | 9 +++++++++ - src/Makefile.am | 6 +++++- - 2 files changed, 14 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index f8ec7e3..1a4d96d 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -132,6 +132,11 @@ if test "x$enable_glu" = xyes; then - DEMO_LIBS="$DEMO_LIBS $GLU_LIBS" - fi - -+AC_ARG_ENABLE([glx-demos], -+ [AS_HELP_STRING([--enable-glx-demos], -+ [enable GLX demos @<:@default=auto@:>@])], -+ [glx_demos_enabled="$enableval"], -+ [glx_demos_enabled=yes]) - AC_ARG_ENABLE([egl], - [AS_HELP_STRING([--enable-egl], - [enable EGL library @<:@default=auto@:>@])], -@@ -325,6 +333,7 @@ AC_SUBST([WAYLAND_LIBS]) - - AM_CONDITIONAL(HAVE_GLU, test "x$glu_enabled" = "xyes") - AM_CONDITIONAL(HAVE_GLEW, test "x$glew_enabled" = "xyes") -+AM_CONDITIONAL(HAVE_GLX, test "x$glx_demos_enabled" = "xyes") - AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes") - AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes") - AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes") -diff --git a/src/Makefile.am b/src/Makefile.am -index 8b89dee..a4d7e8f 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -44,8 +44,12 @@ SUBDIRS = \ - slang \ - tests \ - tools \ -- wgl \ -+ wgl -+ -+if HAVE_GLX -+SUBDIRS += \ - xdemos -+endif - - if HAVE_GLEW - SUBDIRS += \ --- -1.9.1 - diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos_8.4.0.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos_8.4.0.bb deleted file mode 100644 index 129a47df..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos_8.4.0.bb +++ /dev/null @@ -1,59 +0,0 @@ -SUMMARY = "Mesa demo applications" -DESCRIPTION = "This package includes the demonstration application, such as glxgears. \ -These applications can be used for Mesa validation and benchmarking." -HOMEPAGE = "http://mesa3d.org" -BUGTRACKER = "https://bugs.freedesktop.org" -SECTION = "x11" - -LICENSE = "MIT & PD" -LIC_FILES_CHKSUM = "file://src/xdemos/glxgears.c;beginline=1;endline=20;md5=914225785450eff644a86c871d3ae00e \ - file://src/xdemos/glxdemo.c;beginline=1;endline=8;md5=b01d5ab1aee94d35b7efaa2ef48e1a06" - -SRC_URI = "https://mesa.freedesktop.org/archive/demos/${BPN}-${PV}.tar.bz2 \ - file://0001-mesa-demos-Add-missing-data-files.patch \ - file://0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch \ - file://0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch \ - file://0007-Install-few-more-test-programs.patch \ - file://0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch \ - file://0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch \ - file://0012-mesa-demos-OpenVG-demos-with-single-frame-need-eglSw.patch \ - file://0013-only-build-GLX-demos-if-needed.patch \ - " -SRC_URI[md5sum] = "6b65a02622765522176d00f553086fa3" -SRC_URI[sha256sum] = "01e99c94a0184e63e796728af89bfac559795fb2a0d6f506fa900455ca5fff7d" - -inherit autotools pkgconfig distro_features_check -# depends on virtual/egl, virtual/libgl ... -REQUIRED_DISTRO_FEATURES = "opengl x11" - -PACKAGECONFIG ?= "drm osmesa freetype2 gbm egl gles1 gles2 \ - x11 glew glu glx" - -# The Wayland code doesn't work with Wayland 1.0, so disable it for now -#${@bb.utils.filter('DISTRO_FEATURES', 'wayland', d)}" - -EXTRA_OECONF = "--with-system-data-files" - -PACKAGECONFIG[drm] = "--enable-libdrm,--disable-libdrm,libdrm" -PACKAGECONFIG[egl] = "--enable-egl,--disable-egl,virtual/egl" -PACKAGECONFIG[freetype2] = "--enable-freetype2,--disable-freetype2,freetype" -PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm,virtual/libgl" -PACKAGECONFIG[gles1] = "--enable-gles1,--disable-gles1,virtual/libgles1" -PACKAGECONFIG[gles2] = "--enable-gles2,--disable-gles2,virtual/libgles2" -PACKAGECONFIG[glut] = "--with-glut=${STAGING_EXECPREFIXDIR},--without-glut,freeglut" -PACKAGECONFIG[osmesa] = "--enable-osmesa,--disable-osmesa," -PACKAGECONFIG[vg] = "--enable-vg,--disable-vg,virtual/libopenvg" -PACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,virtual/libgl wayland" -PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11" -PACKAGECONFIG[glew] = "--enable-glew,--disable-glew,glew" -PACKAGECONFIG[glu] = "--enable-glu,--disable-glu,virtual/libgl" -PACKAGECONFIG[glx] = "--enable-glx-demos,--disable-glx-demos" - -do_install_append() { - # it can be completely empty when all PACKAGECONFIG options are disabled - rmdir --ignore-fail-on-non-empty ${D}${bindir} - - if [ -f ${D}${bindir}/clear ]; then - mv ${D}${bindir}/clear ${D}${bindir}/clear.mesa-demos - fi -} diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-gl_19.1.6.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-gl_19.1.6.bb deleted file mode 100644 index d4b1c1c4..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-gl_19.1.6.bb +++ /dev/null @@ -1,10 +0,0 @@ -require mesa_${PV}.bb - -SUMMARY += " (OpenGL only, no EGL/GLES)" - -PROVIDES = "virtual/libgl virtual/mesa" - -S = "${WORKDIR}/mesa-${PV}" - -PACKAGECONFIG ??= "opengl dri ${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" -PACKAGECONFIG_class-target = "opengl dri ${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa.inc b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa.inc deleted file mode 100644 index 54b7618f..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa.inc +++ /dev/null @@ -1,267 +0,0 @@ -SUMMARY = "A free implementation of the OpenGL API" -DESCRIPTION = "Mesa is an open-source implementation of the OpenGL specification - \ -a system for rendering interactive 3D graphics. \ -A variety of device drivers allows Mesa to be used in many different environments \ -ranging from software emulation to complete hardware acceleration for modern GPUs. \ -Mesa is used as part of the overall Direct Rendering Infrastructure and X.org \ -environment." - -HOMEPAGE = "http://mesa3d.org" -BUGTRACKER = "https://bugs.freedesktop.org" -SECTION = "x11" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://docs/license.html;md5=725f991a1cc322aa7a0cd3a2016621c4" - -PE = "2" - -DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native gettext-native" -EXTRANATIVEPATH += "chrpath-native" -PROVIDES = " \ - ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \ - ${@bb.utils.contains('PACKAGECONFIG', 'gles', 'virtual/libgles1 virtual/libgles2', '', d)} \ - ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'virtual/egl', '', d)} \ - ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'virtual/libgbm', '', d)} \ - virtual/mesa \ - " - -inherit meson pkgconfig python3native gettext distro_features_check - -# Unset these to stop python trying to report the target Python setup -_PYTHON_SYSCONFIGDATA_NAME[unexport] = "1" -STAGING_INCDIR[unexport] = "1" -STAGING_LIBDIR[unexport] = "1" - -BBCLASSEXTEND = "native nativesdk" - -ANY_OF_DISTRO_FEATURES_class-target = "opengl vulkan" - -PLATFORMS ??= "${@bb.utils.filter('PACKAGECONFIG', 'x11 wayland', d)} \ - ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'drm', '', d)} \ - surfaceless" - -export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm${MESA_LLVM_RELEASE}/llvm-config" -export YOCTO_ALTERNATE_MULTILIB_NAME = "${base_libdir}" -export LLVM_CONFIG = "${STAGING_BINDIR_NATIVE}/llvm-config${MESA_LLVM_RELEASE}" -export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}" - -MESA_LLVM_RELEASE ?= "${LLVMVERSION}" - -EXTRA_OEMESON = " \ - -Dshared-glapi=true \ - -Dgallium-opencl=disabled \ - -Dglx-read-only-text=true \ - -Dplatforms='${@",".join("${PLATFORMS}".split())}' \ -" - -PACKAGECONFIG_class-target ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland vulkan', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl egl gles gbm dri gallium', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11 dri3', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'x11 vulkan', 'dri3', '', d)} \ - glx-tls \ - " -PACKAGECONFIG_class-native ?= "gbm dri egl opengl glx-tls" -PACKAGECONFIG_class-nativesdk ?= "gbm dri egl opengl glx-tls" - -PACKAGECONFIG_remove_libc-musl = "glx-tls" - -# "gbm" requires "dri", "opengl" -PACKAGECONFIG[gbm] = "-Dgbm=true,-Dgbm=false" - -X11_DEPS = "xorgproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes xrandr" -# "x11" requires "opengl" -PACKAGECONFIG[x11] = ",-Dglx=disabled,${X11_DEPS}" -PACKAGECONFIG[glx-tls] = "-Dglx-tls=true, -Dglx-tls=false" -PACKAGECONFIG[xvmc] = "-Dgallium-xvmc=true,-Dgallium-xvmc=false,libxvmc" -PACKAGECONFIG[wayland] = ",,wayland-native wayland libdrm wayland-protocols" - -DRIDRIVERS_class-native = "swrast" -DRIDRIVERS_class-nativesdk = "swrast" -DRIDRIVERS_append_x86_class-target = ",r100,r200,nouveau,i965,i915" -DRIDRIVERS_append_x86-64_class-target = ",r100,r200,nouveau,i965,i915" -# "dri" requires "opengl" -PACKAGECONFIG[dri] = "-Ddri=true -Ddri-drivers=${DRIDRIVERS}, -Ddri=false -Ddri-drivers='', xorgproto libdrm" -PACKAGECONFIG[dri3] = "-Ddri3=true, -Ddri3=false, xorgproto libxshmfence" - -# Vulkan drivers need dri3 enabled -# radeon could be enabled as well but requires gallium-llvm with llvm >= 3.9 -VULKAN_DRIVERS = "" -VULKAN_DRIVERS_append_x86_class-target = ",intel" -VULKAN_DRIVERS_append_x86-64_class-target = ",intel" -PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${VULKAN_DRIVERS}, -Dvulkan-drivers=''," - -PACKAGECONFIG[opengl] = "-Dopengl=true, -Dopengl=false" - -# "gles" requires "opengl" -PACKAGECONFIG[gles] = "-Dgles1=true -Dgles2=true, -Dgles1=false -Dgles2=false" - -# "egl" requires "dri", "opengl" -PACKAGECONFIG[egl] = "-Degl=true, -Degl=false" - -PACKAGECONFIG[etnaviv] = "" -PACKAGECONFIG[kmsro] = "" -PACKAGECONFIG[vc4] = "" -PACKAGECONFIG[v3d] = "" - -GALLIUMDRIVERS = "swrast" -# gallium swrast was found to crash Xorg on startup in x32 qemu -GALLIUMDRIVERS_x86-x32 = "" - -GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}" -GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'kmsro', ',kmsro', '', d)}" -GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'vc4', ',vc4', '', d)}" -GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'v3d', ',v3d', '', d)}" - -# radeonsi requires LLVM -GALLIUMDRIVERS_LLVM33 = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',radeonsi', '', d)}" -GALLIUMDRIVERS_LLVM33_ENABLED = "${@oe.utils.version_less_or_equal('MESA_LLVM_RELEASE', '3.2', False, len('${GALLIUMDRIVERS_LLVM33}') > 0, d)}" -GALLIUMDRIVERS_LLVM = "r300,svga,nouveau${@',${GALLIUMDRIVERS_LLVM33}' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}" - -PACKAGECONFIG[r600] = "" - -GALLIUMDRIVERS_append = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}" -GALLIUMDRIVERS_append = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',r600', '', d)}" -GALLIUMDRIVERS_append = ",virgl" - -PACKAGECONFIG[gallium] = "-Dgallium-drivers=${GALLIUMDRIVERS}, -Dgallium-drivers=''" -PACKAGECONFIG[gallium-llvm] = "-Dllvm=true -Dshared-llvm=true, -Dllvm=false, llvm${MESA_LLVM_RELEASE} llvm-native \ - ${@'elfutils' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}" -PACKAGECONFIG[xa] = "-Dgallium-xa=true, -Dgallium-xa=false" - -PACKAGECONFIG[lima] = "" -GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'lima', ',lima', '', d)}" - -PACKAGECONFIG[panfrost] = "" -GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'panfrost', ',panfrost', '', d)}" - -OSMESA = "${@bb.utils.contains('PACKAGECONFIG', 'gallium', 'gallium', 'classic', d)}" -PACKAGECONFIG[osmesa] = "-Dosmesa=${OSMESA},-Dosmesa=none" - -PACKAGECONFIG[unwind] = "-Dlibunwind=true,-Dlibunwind=false,libunwind" - -# mesa tries to run cross-built gen_matypes on build machine to get struct size information -EXTRA_OEMESON_append = " -Dasm=false" - -# llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2) -FULL_OPTIMIZATION_append = " -fno-omit-frame-pointer" - -CFLAGS_append_armv5 = " -DMISSING_64BIT_ATOMICS" - -# Remove the mesa dependency on mesa-dev, as mesa is empty -RDEPENDS_${PN}-dev = "" - -# Add dependency so that GLES3 header don't need to be added manually -RDEPENDS_libgles2-mesa-dev += "libgles3-mesa-dev" - -PACKAGES =+ "libegl-mesa libegl-mesa-dev \ - libosmesa libosmesa-dev \ - libgl-mesa libgl-mesa-dev \ - libglapi libglapi-dev \ - libgbm libgbm-dev \ - libgles1-mesa libgles1-mesa-dev \ - libgles2-mesa libgles2-mesa-dev \ - libgles3-mesa libgles3-mesa-dev \ - libxatracker libxatracker-dev \ - mesa-megadriver mesa-vulkan-drivers \ - " - -do_install_append () { - # Drivers never need libtool .la files - rm -f ${D}${libdir}/dri/*.la - rm -f ${D}${libdir}/egl/*.la - rm -f ${D}${libdir}/gallium-pipe/*.la - rm -f ${D}${libdir}/gbm/*.la - - # it was packaged in libdricore9.1.3-1 and preventing upgrades when debian.bbclass was used - chrpath --delete ${D}${libdir}/dri/*_dri.so || true - - # libwayland-egl has been moved to wayland 1.15+ - rm -f ${D}${libdir}/libwayland-egl* - rm -f ${D}${libdir}/pkgconfig/wayland-egl.pc -} - -# For the packages that make up the OpenGL interfaces, inject variables so that -# they don't get Debian-renamed (which would remove the -mesa suffix), and -# RPROVIDEs/RCONFLICTs on the generic libgl name. -python __anonymous() { - pkgconfig = (d.getVar('PACKAGECONFIG') or "").split() - for p in (("egl", "libegl", "libegl1"), - ("dri", "libgl", "libgl1"), - ("gles", "libgles1", "libglesv1-cm1"), - ("gles", "libgles2", "libglesv2-2"), - ("gles", "libgles3",)): - if not p[0] in pkgconfig: - continue - fullp = p[1] + "-mesa" - pkgs = " ".join(p[1:]) - d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1") - d.appendVar("RREPLACES_" + fullp, pkgs) - d.appendVar("RPROVIDES_" + fullp, pkgs) - d.appendVar("RCONFLICTS_" + fullp, pkgs) - - d.appendVar("RRECOMMENDS_" + fullp, " mesa-megadriver") - - # For -dev, the first element is both the Debian and original name - fullp += "-dev" - pkgs = p[1] + "-dev" - d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1") - d.appendVar("RREPLACES_" + fullp, pkgs) - d.appendVar("RPROVIDES_" + fullp, pkgs) - d.appendVar("RCONFLICTS_" + fullp, pkgs) -} - -python mesa_populate_packages() { - pkgs = ['mesa', 'mesa-dev', 'mesa-dbg'] - for pkg in pkgs: - d.setVar("RPROVIDES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1)) - d.setVar("RCONFLICTS_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1)) - d.setVar("RREPLACES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1)) - - import re - dri_drivers_root = oe.path.join(d.getVar('PKGD'), d.getVar('libdir'), "dri") - if os.path.isdir(dri_drivers_root): - dri_pkgs = os.listdir(dri_drivers_root) - lib_name = d.expand("${MLPREFIX}mesa-megadriver") - for p in dri_pkgs: - m = re.match(r'^(.*)_dri\.so$', p) - if m: - pkg_name = " ${MLPREFIX}mesa-driver-%s" % legitimize_package_name(m.group(1)) - d.appendVar("RPROVIDES_%s" % lib_name, pkg_name) - d.appendVar("RCONFLICTS_%s" % lib_name, pkg_name) - d.appendVar("RREPLACES_%s" % lib_name, pkg_name) - - pipe_drivers_root = os.path.join(d.getVar('libdir'), "gallium-pipe") - do_split_packages(d, pipe_drivers_root, r'^pipe_(.*)\.so$', 'mesa-driver-pipe-%s', 'Mesa %s pipe driver', extra_depends='') -} - -PACKAGESPLITFUNCS_prepend = "mesa_populate_packages " - -PACKAGES_DYNAMIC += "^mesa-driver-.*" - -FILES_mesa-megadriver = "${libdir}/dri/* ${datadir}/drirc.d/00-mesa-defaults.conf" -FILES_mesa-vulkan-drivers = "${libdir}/libvulkan_*.so ${datadir}/vulkan" -FILES_libegl-mesa = "${libdir}/libEGL.so.*" -FILES_libgbm = "${libdir}/libgbm.so.*" -FILES_libgles1-mesa = "${libdir}/libGLESv1*.so.*" -FILES_libgles2-mesa = "${libdir}/libGLESv2.so.*" -FILES_libgl-mesa = "${libdir}/libGL.so.*" -FILES_libglapi = "${libdir}/libglapi.so.*" -FILES_libosmesa = "${libdir}/libOSMesa.so.*" -FILES_libxatracker = "${libdir}/libxatracker.so.*" - -FILES_${PN}-dev = "${libdir}/pkgconfig/dri.pc ${includedir}/vulkan" -FILES_libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc" -FILES_libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h" -FILES_libgl-mesa-dev = "${libdir}/libGL.* ${includedir}/GL ${libdir}/pkgconfig/gl.pc" -FILES_libglapi-dev = "${libdir}/libglapi.*" -FILES_libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc" -FILES_libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc" -FILES_libgles3-mesa-dev = "${includedir}/GLES3" -FILES_libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir}/pkgconfig/osmesa.pc" -FILES_libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \ - ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \ - ${libdir}/pkgconfig/xatracker.pc" - -# Fix upgrade path from mesa to mesa-megadriver -RREPLACES_mesa-megadriver = "mesa" -RCONFLICTS_mesa-megadriver = "mesa" -RPROVIDES_mesa-megadriver = "mesa" diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_%.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_%.bbappend deleted file mode 100644 index 58aea6c0..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_%.bbappend +++ /dev/null @@ -1,2 +0,0 @@ -# enable ludicrous speed for GFX on rpi4 -PACKAGECONFIG_append_class-target = " v3d kmsro" diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_19.1.6.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_19.1.6.bb deleted file mode 100644 index 19221e9e..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_19.1.6.bb +++ /dev/null @@ -1,20 +0,0 @@ -require ${BPN}.inc - -SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \ - file://0001-meson.build-check-for-all-linux-host_os-combinations.patch \ - file://0002-meson.build-make-TLS-GLX-optional-again.patch \ - file://0003-Allow-enable-DRI-without-DRI-drivers.patch \ - " - -SRC_URI[md5sum] = "7dbb40b8d10e89bee0a5bfc85350647b" -SRC_URI[sha256sum] = "2a369b7b48545c6486e7e44913ad022daca097c8bd937bf30dcf3f17a94d3496" - -UPSTREAM_CHECK_GITTAGREGEX = "mesa-(?P\d+(\.\d+)+)" - -#because we cannot rely on the fact that all apps will use pkgconfig, -#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER -do_install_append() { - if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then - sed -i -e 's/^#if defined(MESA_EGL_NO_X11_HEADERS)$/#if defined(MESA_EGL_NO_X11_HEADERS) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h - fi -} diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/userland/userland_%.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/userland/userland_%.bbappend deleted file mode 100644 index d4c74ef4..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/userland/userland_%.bbappend +++ /dev/null @@ -1,4 +0,0 @@ -# FIXME: Temporary fix that can be removed once commit 752db52 gets backported -# from master to thud branch of meta-raspberrypi -RDEPENDS_${PN}_remove = "libegl1" -RDEPENDS_${PN} += "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "libegl-mesa", "", d)}" diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf.bbappend index dd01c4e5..33dfd6a2 100644 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf.bbappend +++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf.bbappend @@ -1,7 +1,3 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += "file://dsi.cfg" - -# Reduce the screen resolution to HD Ready (720p) -SRC_URI_remove = "file://hdmi-a-1-270.cfg" -SRC_URI_append = " file://hdmi-a-1-270-720p.cfg" diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/create-combined-dtb/create-combined-dtb_1.0.0.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/create-combined-dtb/create-combined-dtb_1.0.0.bb index c82e6fd2..c365715f 100644 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/create-combined-dtb/create-combined-dtb_1.0.0.bb +++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/create-combined-dtb/create-combined-dtb_1.0.0.bb @@ -22,7 +22,8 @@ do_compile () { if [ -f "${DEPLOY_DIR_IMAGE}/bcm2710-rpi-3-b.dtb" ]; then fdtoverlay -v -i ${DEPLOY_DIR_IMAGE}/bcm2710-rpi-3-b.dtb -o bcm2710-rpi-3-b+vc4+ft5406.dtb ${DEPLOY_DIR_IMAGE}/rpi-ft5406.dtbo ${DEPLOY_DIR_IMAGE}/${VC4DTBO}.dtbo fi - if [ -f "${DEPLOY_DIR_IMAGE}/bcm2711-rpi-4-b.dtb" ]; then + # NOTE: meta-updater currently disables rpi-ft5406.dtbo on rpi4, so need to check if it is present + if [ -f "${DEPLOY_DIR_IMAGE}/bcm2711-rpi-4-b.dtb" -a -f "${DEPLOY_DIR_IMAGE}/rpi-ft5406.dtbo" ]; then fdtoverlay -v -i ${DEPLOY_DIR_IMAGE}/bcm2711-rpi-4-b.dtb -o bcm2711-rpi-4-b+vc4+ft5406.dtb ${DEPLOY_DIR_IMAGE}/rpi-ft5406.dtbo ${DEPLOY_DIR_IMAGE}/${VC4DTBO}.dtbo fi diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro/0001-brcmfmac43455-sdio.txt-Follow-raspbian-change-for-bo.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro/0001-brcmfmac43455-sdio.txt-Follow-raspbian-change-for-bo.patch deleted file mode 100644 index 1ad0fd1b..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro/0001-brcmfmac43455-sdio.txt-Follow-raspbian-change-for-bo.patch +++ /dev/null @@ -1,39 +0,0 @@ -From c9d4f263131cb8e62597e0a296968b5cdbfe0019 Mon Sep 17 00:00:00 2001 -From: Andrei Gherzan -Date: Thu, 27 Jun 2019 20:49:10 +0100 -Subject: [PATCH] brcmfmac43455-sdio.txt: Follow raspbian change for - boardflags3 - -Without this change the WiFi interface on RPi4 never comes up. Also the -upstream repository doesn't include this change. It is only (as far as I -know) part of the raspberrypi deb repository with the following -changelog: - -firmware-nonfree (1:20190114-1+rpt2) buster; urgency=medium - * Update brcmfmac43455-sdio.txt - - Update boardflags3 - -- Serge Schneider Thu, 18 Apr 2019 14:35:34 -+0100 - -Upstream-status: Pending -Signed-off-by: Andrei Gherzan ---- - brcm/brcmfmac43455-sdio.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/brcm/brcmfmac43455-sdio.txt b/brcm/brcmfmac43455-sdio.txt -index 54d9321..6801286 100644 ---- a/brcm/brcmfmac43455-sdio.txt -+++ b/brcm/brcmfmac43455-sdio.txt -@@ -21,7 +21,7 @@ btc_mode=1 - # bit1 for btcoex - boardflags=0x00480201 - boardflags2=0x40800000 --boardflags3=0x48200100 -+boardflags3=0x44200100 - phycal_tempdelta=15 - rxchain=1 - txchain=1 --- -2.17.1 - diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro_%.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro_%.bbappend deleted file mode 100644 index 30c18fb0..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro_%.bbappend +++ /dev/null @@ -1,10 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -SRC_URI += "file://0001-brcmfmac43455-sdio.txt-Follow-raspbian-change-for-bo.patch" - -do_unpack_append() { - bb.build.exec_func('do_clean_pc', d) -} -do_clean_pc() { - rm -rf ${S}/.pc -} diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/0002-Disable-DMA-in-sdhci-driver.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/0002-Disable-DMA-in-sdhci-driver.patch new file mode 100644 index 00000000..04a8733f --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/0002-Disable-DMA-in-sdhci-driver.patch @@ -0,0 +1,25 @@ +From 758bc9b917469bc4e527dc3aae821c91cbc3d426 Mon Sep 17 00:00:00 2001 +From: Stewart Hildebrand +Date: Thu, 18 Jul 2019 00:01:27 -0400 +Subject: [PATCH 2/4] Disable DMA in sdhci driver + +--- + drivers/mmc/host/sdhci-iproc.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c +index 983cddce9..150f7bfc8 100644 +--- a/drivers/mmc/host/sdhci-iproc.c ++++ b/drivers/mmc/host/sdhci-iproc.c +@@ -252,6 +252,8 @@ static const struct sdhci_iproc_data bcm2835_data = { + + static const struct sdhci_pltfm_data sdhci_bcm2838_pltfm_data = { + .ops = &sdhci_iproc_32only_ops, ++ .quirks = SDHCI_QUIRK_BROKEN_DMA | ++ SDHCI_QUIRK_BROKEN_ADMA, + }; + + static const struct sdhci_iproc_data bcm2838_data = { +-- +2.17.1 + diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/0003-Fix-PCIe-in-dom0-for-RPi4.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/0003-Fix-PCIe-in-dom0-for-RPi4.patch new file mode 100644 index 00000000..835f36da --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/0003-Fix-PCIe-in-dom0-for-RPi4.patch @@ -0,0 +1,31 @@ +From 77765c2a47ce43911b8fe7b09f037c9bc13008ca Mon Sep 17 00:00:00 2001 +From: Jeff Kubascik +Date: Tue, 30 Jul 2019 08:49:56 -0400 +Subject: [PATCH 3/4] Fix PCIe in dom0 for RPi4 + +There is an issue where the Broadcom PCIe driver and Xen swiotlb layer +invoke each other's dma alloc function recursively until the stack blows +up. The cause appears to be due to arch_setup_dma_ops being called +more than once for the device, possibly through of_dma_configure, and +screwing up the dma_ops pointers. This patch adds a check to make sure +that the xen_dma_ops are applied only once for a device. +--- + arch/arm64/mm/dma-mapping.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c +index d3a5bb16f..243a3b9be 100644 +--- a/arch/arm64/mm/dma-mapping.c ++++ b/arch/arm64/mm/dma-mapping.c +@@ -895,7 +895,7 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, + __iommu_setup_dma_ops(dev, dma_base, size, iommu); + + #ifdef CONFIG_XEN +- if (xen_initial_domain()) { ++ if (!dev->archdata.dev_dma_ops && xen_initial_domain()) { + dev->archdata.dev_dma_ops = dev->dma_ops; + dev->dma_ops = xen_dma_ops; + } +-- +2.17.1 + diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/rpi-kernel-misc.cfg b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/rpi-kernel-misc.cfg deleted file mode 100644 index 07b14371..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/rpi-kernel-misc.cfg +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SENSORS_RPI_POE_FAN=m diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/xen-be.cfg b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/xen-be.cfg new file mode 100644 index 00000000..36f39018 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/xen-be.cfg @@ -0,0 +1,50 @@ +# global stuff - these enable us to allow some +# of the not so generic stuff below for xen +CONFIG_PARAVIRT=y +CONFIG_NET=y +CONFIG_NET_CORE=y +CONFIG_NETDEVICES=y +CONFIG_BLOCK=y +CONFIG_WATCHDOG=y +CONFIG_TARGET_CORE=y +CONFIG_SCSI=y +CONFIG_FB=y +CONFIG_INPUT_MISC=y +CONFIG_MEMORY_HOTPLUG=y +CONFIG_TTY=y +# Technically not required but otherwise produces +# pretty useless systems starting from allnoconfig +# You want TCP/IP and ELF binaries right? +CONFIG_INET=y +CONFIG_BINFMT_ELF=y +# generic config +CONFIG_XEN=y +CONFIG_XEN_DOM0=y +# backend drivers +CONFIG_XEN_BACKEND=y +CONFIG_XEN_BLKDEV_BACKEND=m +CONFIG_XEN_NETDEV_BACKEND=m +CONFIG_HVC_XEN=y +CONFIG_XEN_WDT=m +CONFIG_XEN_SCSI_BACKEND=m +# frontend drivers +CONFIG_XEN_FBDEV_FRONTEND=m +CONFIG_HVC_XEN_FRONTEND=y +CONFIG_INPUT_XEN_KBDDEV_FRONTEND=m +CONFIG_XEN_SCSI_FRONTEND=m +# others +CONFIG_XEN_BALLOON=y +CONFIG_XEN_SCRUB_PAGES=y +CONFIG_XEN_DEV_EVTCHN=m +CONFIG_XEN_BLKDEV_FRONTEND=m +CONFIG_XEN_NETDEV_FRONTEND=m +CONFIG_XENFS=m +CONFIG_XEN_COMPAT_XENFS=y +CONFIG_XEN_SYS_HYPERVISOR=y +CONFIG_XEN_XENBUS_FRONTEND=y +CONFIG_XEN_GNTDEV=m +CONFIG_XEN_GRANT_DEV_ALLOC=m +CONFIG_SWIOTLB_XEN=y +CONFIG_XEN_PRIVCMD=m +CONFIG_DEBUG_INFO=y +CONFIG_FRAME_POINTER=y diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/disable_kprobes.cfg b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/disable_kprobes.cfg deleted file mode 100644 index 4a67a7e6..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/disable_kprobes.cfg +++ /dev/null @@ -1 +0,0 @@ -CONFIG_KPROBES=n diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi4.inc b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi4.inc deleted file mode 100644 index ea7f7783..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi4.inc +++ /dev/null @@ -1,140 +0,0 @@ -DESCRIPTION = "Linux Kernel for Raspberry Pi" -SECTION = "kernel" -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" - -COMPATIBLE_MACHINE = "^rpi$" - -PE = "1" -PV = "${LINUX_VERSION}+git${SRCPV}" - -inherit kernel siteinfo -require recipes-kernel/linux/linux-yocto.inc - -SRC_URI += "file://rpi-kernel-misc.cfg" - -KCONFIG_MODE = "--alldefconfig" -KBUILD_DEFCONFIG_raspberrypi0-wifi ?= "bcmrpi_defconfig" -KBUILD_DEFCONFIG_raspberrypi ?= "bcmrpi_defconfig" -KBUILD_DEFCONFIG_raspberrypi2 ?= "bcm2709_defconfig" -KBUILD_DEFCONFIG_raspberrypi3 ?= "bcm2709_defconfig" -KBUILD_DEFCONFIG_raspberrypi3-64 ?= "bcmrpi3_defconfig" -KBUILD_DEFCONFIG_raspberrypi4 ?= "bcm2711_defconfig" -KBUILD_DEFCONFIG_raspberrypi4-64 ?= "bcm2711_defconfig" - -# CMDLINE for raspberrypi -SERIAL = "${@oe.utils.conditional("ENABLE_UART", "1", "console=serial0,115200", "", d)}" -CMDLINE ?= "dwc_otg.lpm_enable=0 ${SERIAL} root=/dev/mmcblk0p2 rootfstype=ext4 rootwait" - -# Add the kernel debugger over console kernel command line option if enabled -CMDLINE_append = ' ${@oe.utils.conditional("ENABLE_KGDB", "1", "kgdboc=serial0,115200", "", d)}' - -# Disable rpi logo on boot -CMDLINE_append += ' ${@oe.utils.conditional("DISABLE_RPI_BOOT_LOGO", "1", "logo.nologo", "", d)}' - -# You can define CMDLINE_DEBUG as "debug" in your local.conf or distro.conf -# to enable kernel debugging. -CMDLINE_DEBUG ?= "" -CMDLINE_append = " ${CMDLINE_DEBUG}" - -KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains("MACHINE_FEATURES", "pitft28r", "stmpe-ts", "", d)}" - -# A LOADADDR is needed when building a uImage format kernel. This value is not -# set by default in rpi-4.8.y and later branches so we need to provide it -# manually. This value unused if KERNEL_IMAGETYPE is not uImage. -KERNEL_EXTRA_ARGS += "LOADADDR=0x00008000" - -# Set a variable in .configure -# $1 - Configure variable to be set -# $2 - value [n/y/value] -kernel_configure_variable() { - # Remove the config - CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;" - if test "$2" = "n" - then - echo "# CONFIG_$1 is not set" >> ${B}/.config - else - echo "CONFIG_$1=$2" >> ${B}/.config - fi -} - -config_setup() { - # From kernel.bbclass. Unfortunately, this is needed to support builds that - # use devtool. The reason is as follows: - # - # - In devtool builds, externalsrc.bbclass gets inherited and sets a list of - # SRCTREECOVEREDTASKS, which don't get run because they affect the source - # tree and, when using devtool, we want the developer's changes to be the - # single source of truth. kernel-yocto.bbclass adds do_kernel_configme to - # SRCTREECOVEREDTASKS, so it doesn't run in a devtool build., In a normal - # non-devtool build, do_kernel_configme creates ${B}.config. - # - # - Normally (e.g. in linux-yocto), it would be OK that do_kernel_configme - # doesn't run, because the first few lines of do_configure in kernel.bbclass - # populate ${B}.config from either ${S}.config (if it exists) for custom - # developer changes, or otherwise from ${WORDIR}/defconfig. - # - # - In linux-raspberrypi, we add do_configure_prepend, which tweaks - # ${B}.config. Since this runs *before* the kernel.bbclass do_configure, - # ${B}.config doesn't yet exist and we hit an error. Thus we need to move - # the logic from do_configure up to before our do_configure_prepend. Because - # we are copying only a portion of do_configure and not the whole thing, - # there is no clean way to do it using OE functionality, so we just - # copy-and-paste. - if [ "${S}" != "${B}" ] && [ -f "${S}/.config" ] && [ ! -f "${B}/.config" ]; then - mv "${S}/.config" "${B}/.config" - fi - - # Copy defconfig to .config if .config does not exist. This allows - # recipes to manage the .config themselves in do_configure_prepend(). - if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then - cp "${WORKDIR}/defconfig" "${B}/.config" - fi -} - -do_configure_prepend() { - config_setup - - mv -f ${B}/.config ${B}/.config.patched - CONF_SED_SCRIPT="" - - # Localversion - kernel_configure_variable LOCALVERSION "\"\"" - - if [ "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then - kernel_configure_variable OVERLAY_FS y - kernel_configure_variable SQUASHFS y - kernel_configure_variable UBIFS_FS y - fi - - # Activate the configuration options for VC4 - VC4GRAPHICS="${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "1", "0", d)}" - if [ "${VC4GRAPHICS}" = "1" ]; then - kernel_configure_variable I2C_BCM2835 y - kernel_configure_variable DRM y - kernel_configure_variable DRM_FBDEV_EMULATION y - kernel_configure_variable DRM_VC4 y - fi - - # Keep this the last line - # Remove all modified configs and add the rest to .config - sed -e "${CONF_SED_SCRIPT}" < '${B}/.config.patched' >> '${B}/.config' - rm -f ${B}/.config.patched -} - -do_compile_append() { - if [ "${SITEINFO_BITS}" = "64" ]; then - cc_extra=$(get_cc_option) - oe_runmake dtbs CC="${KERNEL_CC} $cc_extra " LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} - fi -} - -do_deploy_append() { - # Deploy cmdline.txt - install -d ${DEPLOYDIR}/bcm2835-bootfiles - PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}" - if [ ${PITFT} = "1" ]; then - PITFT_PARAMS="fbcon=map:10 fbcon=font:VGA8x8" - fi - echo "${CMDLINE}${PITFT_PARAMS}" > ${DEPLOYDIR}/bcm2835-bootfiles/cmdline.txt -} diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend index c12cd6c5..f78e0b5e 100644 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend +++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend @@ -2,14 +2,21 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" require recipes-kernel/linux/linux-agl.inc -# NOTE: Kprobes need to be disabled until linux-raspberrypi gets updated -# to newer than 4.14.104 to avoid lttng-modules failing to build. SRC_URI_append = "\ ${@oe.utils.conditional('USE_FAYTECH_MONITOR', '1', 'file://0002-faytech-fix-rpi.patch', '', d)} \ - file://disable_kprobes.cfg \ " +#take in account that linux under xen should use the hvc0 console +SERIAL_OPTION = "${@bb.utils.contains('AGL_XEN_WANTED','1','hvc0','115200;ttyS0',d)}" +SERIAL = "${@oe.utils.conditional("ENABLE_UART", "1", "console=${SERIAL_OPTION}", "", d)}" CMDLINE_DEBUG = "" + +#XEN related option +CMDLINE_append = ' ${@bb.utils.contains('AGL_XEN_WANTED','1','clk_ignore_unused','',d)}' + +#workaround for crash during brcmfmac loading. Disable it at this moment +CMDLINE_append = ' ${@bb.utils.contains('AGL_XEN_WANTED','1','modprobe.blacklist=brcmfmac','',d)}' + CMDLINE_append = " usbhid.mousepoll=0" # Add options to allow CMA to operate diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.14%.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.14%.bbappend deleted file mode 100644 index ba11890b..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.14%.bbappend +++ /dev/null @@ -1 +0,0 @@ -require recipes-kernel/linux/linux-agl-4.14.inc diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bb deleted file mode 100644 index c1df2274..00000000 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bb +++ /dev/null @@ -1,16 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/linux-raspberrypi:" - -LINUX_VERSION ?= "4.19.80" -LINUX_RPI_BRANCH ?= "rpi-4.19.y" - -SRCREV = "3492a1b003494535eb1b17aa7f258469036b1de7" -SRC_URI = " \ - git://github.com/raspberrypi/linux.git;protocol=git;branch=${LINUX_RPI_BRANCH} \ - " -SRC_URI_append_raspberrypi4-64 = " file://rpi4-64-kernel-misc.cfg" - -require linux-raspberrypi4.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" - -KERNEL_EXTRA_ARGS_append_rpi = " DTC_FLAGS='-@ -H epapr'" diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bbappend index 35a09b02..7f17f0c3 100644 --- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bbappend +++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bbappend @@ -1,2 +1,20 @@ +require recipes-kernel/linux/linux-agl-4.19.inc + ENABLE_UART_raspberrypi4 = "1" +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + + +# For Xen + +SRC_URI_append =" \ + ${@bb.utils.contains('AGL_XEN_WANTED','1','file://0002-Disable-DMA-in-sdhci-driver.patch','',d)} \ +" + +SRC_URI_append =" \ + ${@bb.utils.contains('AGL_XEN_WANTED','1','file://0003-Fix-PCIe-in-dom0-for-RPi4.patch','',d)} \ +" + +SRC_URI_append = " \ + ${@bb.utils.contains('AGL_XEN_WANTED','1','file://xen-be.cfg','',d)} \ +" diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/arm-trusted-firmware b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/arm-trusted-firmware new file mode 120000 index 00000000..133ef491 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/arm-trusted-firmware @@ -0,0 +1 @@ +../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-bsp/arm-trusted-firmware/ \ No newline at end of file diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/si-tools b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/si-tools new file mode 120000 index 00000000..9065d9e9 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/si-tools @@ -0,0 +1 @@ +../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-bsp/si-tools/ \ No newline at end of file diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt new file mode 120000 index 00000000..13ea60b9 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt @@ -0,0 +1 @@ +../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-bsp/ti-bt \ No newline at end of file diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt-firmware b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt-firmware new file mode 120000 index 00000000..b6dd6691 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt-firmware @@ -0,0 +1 @@ +../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-bsp/ti-bt-firmware/ \ No newline at end of file diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/u-boot b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/u-boot new file mode 120000 index 00000000..857cd50d --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/u-boot @@ -0,0 +1 @@ +../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-bsp/u-boot/ \ No newline at end of file diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-graphics/cairo b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-graphics/cairo new file mode 120000 index 00000000..cc44ec53 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-graphics/cairo @@ -0,0 +1 @@ +../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-graphics/cairo/ \ No newline at end of file diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-kernel/linux b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-kernel/linux new file mode 120000 index 00000000..4feae94d --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-kernel/linux @@ -0,0 +1 @@ +../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-kernel/linux \ No newline at end of file diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-multimedia/gstreamer b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-multimedia/gstreamer new file mode 120000 index 00000000..ef3ed76f --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-multimedia/gstreamer @@ -0,0 +1 @@ +../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/ \ No newline at end of file diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/NOTES b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/NOTES new file mode 100644 index 00000000..f9cb5b1e --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/NOTES @@ -0,0 +1,74 @@ +#### These are notes for future reference + +# TODO: follow-up patch: Need to do other mechanism for package inclusion +# TODO2: include or leave-out the kernel modules packages + +# E.g. MACHINE_FEATURE. Should *not* be in layer.conf !! +# Radio packages +#IMAGE_INSTALL_append_rcar-gen3 += " \ +# si-tools \ +# si-init \ +# linux-firmware-wl18xx \ +# ti-bt \ +# ti-bt-firmware \ +# bluez5 \ +# bluez5-testtools \ +# ofono \ +# ofono-tests \ +#" +# E.g. MACHINE_FEATURE +#IMAGE_INSTALL_append_r8a7797 += " \ +# kernel-module-uio-imp \ +# kernel-module-cmemdrv \ +# udev-rules-cvlib \ +#" +# E.g. MACHINE_FEATURE +#IMAGE_INSTALL_append_r8a7798 += " \ +# kernel-module-uio-imp \ +# kernel-module-cmemdrv \ +# udev-rules-cvlib \ +#" +# This is a special use case. Should be enabled by user. +#DISTRO_FEATURES_append = " surroundview " + + +#### BBMASK +# not required for AGL +BBMASK += "/meta-rcar-gen3-adas/recipes-benchmark/" + +# Do not interfer with the distro configuration +BBMASK += "/meta-rcar-gen3-adas/recipes-connectivity/bluez/" + +# We do not need the network config done here +BBMASK += "/meta-rcar-gen3-adas/recipes-core/systemd/" + +# These changes are applied unconditionally when the layer is present. +# These are not required for AGL +BBMASK += "/meta-rcar-gen3-adas/recipes-core/images/" +BBMASK += "/meta-rcar-gen3-adas/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend" + +# Upstream does have this change already, so this is not required. +# poky/meta/classes/cmake.bbclass: -DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 +BBMASK += "/meta-rcar-gen3-adas/recipes-devtools/cmake/" + +# Upstream has a more recent valgrind (3.15.0 vs 3.12.0) +BBMASK += "/meta-rcar-gen3-adas/recipes-devtools/valgrind/" + +# This is already part of upstream and no bbappend is required +BBMASK += "/meta-rcar-gen3-adas/recipes-devtools/gcc/" + +# libpng in upstream already enabled neon +# poky/meta/recipes-multimedia/libpng/libpng_1.6.37.bb:EXTRA_OECONF_append_class-target = " ${@bb.utils.contains("TUNE_FEATURES", "neon", "--enable-arm-neon=on", "--enable-arm-neon=off" ,d)}" +BBMASK += "/meta-rcar-gen3-adas/recipes-graphics/libpng/" + +# opencv in upstream is newer +BBMASK += "/meta-rcar-gen3-adas/recipes-graphics/opencv/" + +# unclear patch status +BBMASK += "/meta-rcar-gen3-adas/recipes-graphics/wayland/" + +# not required in AGL +BBMASK += "/meta-rcar-gen3-adas/recipes-multimedia/pulseaudio/" + +# not required in AGL +BBMASK += "/meta-rcar-gen3-adas/recipes-support/" diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc index 9295739b..5fc4dcef 100644 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc @@ -3,3 +3,16 @@ #PACKAGE_EXTRA_ARCHS_append = " kingfisher" PREFERRED_RPROVIDER_virtual/gpsd-conf ?= "gpsd-kingfisher-conf" + +IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-kf${IMAGE_VERSION_SUFFIX}" +IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}-kf" +TOOLCHAIN_OUTPUTNAME = "${SDK_NAME}-kf-toolchain-${SDK_VERSION}" + +# Radio packages +IMAGE_INSTALL_append_rcar-gen3 += " \ + si-tools \ + si-init \ + linux-firmware-wl18xx \ + ti-bt \ + ti-bt-firmware \ +" diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/layer.conf b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/layer.conf index 796d9268..75bfcfcc 100644 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/layer.conf +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/layer.conf @@ -2,72 +2,17 @@ BBPATH .= ":${LAYERDIR}" # We have a recipes directory, add to BBFILES +# 1) the first directory symlinks necessary files out of the cogent repo +# 2) the 2nd directory is our local glue and appends BBFILES += " \ - ${LAYERDIR}/../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-*/*/*.bb \ - ${LAYERDIR}/../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-*/*/*.bbappend \ + ${LAYERDIR}/cogent-symlinks/recipes-*/*/*.bb \ + ${LAYERDIR}/cogent-symlinks/recipes-*/*/*.bbappend \ ${LAYERDIR}/recipes-*/*/*.bb \ ${LAYERDIR}/recipes-*/*/*.bbappend \ " BBFILE_COLLECTIONS += "rcar-gen3-cogent" -BBFILE_PATTERN_rcar-gen3-cogent := "^${LAYERDIR}/../../../bsp/meta-rcar/meta-rcar-gen3-adas/" +BBFILE_PATTERN_rcar-gen3-cogent := "^${LAYERDIR}/" BBFILE_PRIORITY_rcar-gen3-cogent = "7" -LAYERSERIES_COMPAT_rcar-gen3-cogent = "thud" - -# Custom packages -IMAGE_INSTALL_append_rcar-gen3 = " \ - can-utils \ - libsocketcan \ - spidev-dbg spidev-test \ - e2fsprogs \ - e2fsprogs-tune2fs \ - ethtool \ - pciutils \ - usbutils \ - mtd-utils \ - capture \ - v4l2-fw \ - iperf3 \ - bonnie++ \ - lmbench \ - eglibc-utils \ - mm-init \ - iio-utils \ - most-tools \ -" - -# Radio packages -IMAGE_INSTALL_append_rcar-gen3 += " \ - si-tools \ - si-init \ - linux-firmware-wl18xx \ - ti-bt \ - ti-bt-firmware \ - bluez5 \ - bluez5-testtools \ - ofono \ - ofono-tests \ -" - -# IMP -IMAGE_INSTALL_append_r8a7797 += " \ - kernel-module-uio-imp \ - kernel-module-cmemdrv \ - udev-rules-cvlib \ -" - -IMAGE_INSTALL_append_r8a7798 += " \ - kernel-module-uio-imp \ - kernel-module-cmemdrv \ - udev-rules-cvlib \ -" - -DISTRO_FEATURES_append = " surroundview " -DISTRO_FEATURES_append = " bluetooth" - - -BBMASK += "/meta-rcar-gen3-adas/recipes-core/systemd/" -BBMASK += "/meta-rcar-gen3-adas/recipes-graphics/opencv/" -BBMASK += "/meta-rcar-gen3-adas/recipes-devtools/valgrind/" - +LAYERSERIES_COMPAT_rcar-gen3-cogent = "dunfell" diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/alsa-state/alsa-state.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/alsa-state/alsa-state.bbappend new file mode 100644 index 00000000..4cb3a211 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/alsa-state/alsa-state.bbappend @@ -0,0 +1,3 @@ +do_configure_append () { + sed -i 's/state.rcarsound\ {/state.ak4613\ {/g' ${WORKDIR}/asound.state +} diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-tools.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-tools.bbappend index 7a459314..98c66737 100644 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-tools.bbappend +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-tools.bbappend @@ -6,3 +6,23 @@ SRC_URI += " \ EXTRA_OEMAKE_append = " 'LDFLAGS=${LDFLAGS}'" +do_install() { + install -d ${D}${bindir} + install -d ${D}${nonarch_base_libdir}/firmware/radio/ + + install -m 755 si_ctl ${D}${bindir} + install -m 755 si_flash ${D}${bindir} + for file in ${SCRIPTS}; do + install -m 755 ${S}/scripts/$file ${D}${bindir} + sed -e 's,^\(SI_ARGS\s*=\s*\).*,\1"/dev/i2c-12 0x65",' -i ${D}${bindir}/$file + done + + for file in ${FIRMWARE}; do + install -m 644 ${S}/firmware/$file ${D}${nonarch_base_libdir}/firmware/radio/ + done +} + +FILES_${PN} = " \ + ${bindir} \ + ${nonarch_base_libdir}/firmware/radio \ +" diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt-firmware/ti-bt-firmware_git.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt-firmware/ti-bt-firmware_git.bbappend new file mode 100644 index 00000000..e29e54e4 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt-firmware/ti-bt-firmware_git.bbappend @@ -0,0 +1,6 @@ +do_install() { + install -d ${D}${nonarch_base_libdir}/firmware/ti-connectivity/ + cp *.bts ${D}${nonarch_base_libdir}/firmware/ti-connectivity/ +} + +FILES_${PN} = "${nonarch_base_libdir}/firmware/ti-connectivity/*" diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0004-ADSP-enable-and-add-sound-hardware-abstraction_kf.patch b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0004-ADSP-enable-and-add-sound-hardware-abstraction_kf.patch new file mode 100644 index 00000000..92f5af88 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0004-ADSP-enable-and-add-sound-hardware-abstraction_kf.patch @@ -0,0 +1,58 @@ +The ADSP on Renesas SoCs required a reserved memory area to become +enabled, and this needs to be done manually. + +This patch adds sound hardware abstraction information for the m3ulcb +and m3ulcb-kf (kingfisher) device trees. This is helpful on-board the +ADSP for dynamically determining sound hardware at runtime, allowing +single binaries to be used between the two boards. + +Future work will incorporate the h3ulcb and Salvator boards into the +abstraction. + +Signed-off-by: Ronan Le Martret +Signed-off-by: Mark Farrugia +--- +diff --git a/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-kf.dts b/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-kf.dts +index de2390f009e7..4ccfa8315d17 100644 +--- a/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-kf.dts ++++ b/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-kf.dts +@@ -15,6 +15,39 @@ + "renesas,r8a7796"; + }; + ++ ++&adsp { ++ ++ /* ADSP playback setting for pcm3168 */ ++ adsp_playback0: adsp,playback { ++ mode = "tdm"; ++ clock-mode = "master"; ++ bus-width = <24>; ++ ssi = <3>; ++ bus-if = <0>; ++ channels = <8>; ++ pin-share-ssi = <4>; ++ }; ++ ++ /* ADSP capture setting for pcm3168 */ ++ adsp_capture0: adsp,capture { ++ mode = "tdm"; ++ clock-mode = "slave"; ++ bus-width = <24>; ++ ssi = <4>; ++ bus-if = <0>; ++ channels = <8>; ++ pin-share-ssi = <3>; ++ }; ++ ++ adsp,ports { ++ port@0 { ++ playback = <&adsp_playback0>; ++ capture = <&adsp_capture0>; ++ }; ++ }; ++}; ++ + &du { + ports { + port@0 { diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas_%.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas_%.bbappend index 72a4a78e..36e0caf3 100644 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas_%.bbappend +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas_%.bbappend @@ -5,10 +5,6 @@ SRC_URI_append_ulcb = " \ file://disable_most.cfg \ " -SRC_URI_remove_ulcb = " \ - file://0113-arm64-dts-ulcb-kf-increase-SDIO-frequency-for-WLAN-c.patch \ -" - KERNEL_DEVICETREE_remove_h3ulcb = " \ renesas/r8a7795-es1-h3ulcb-view.dtb \ renesas/r8a7795-es1-h3ulcb-had-alfa.dtb \ diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter/gstvspfilter-h3ulcb_r8a7795.conf b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter/gstvspfilter-h3ulcb_r8a7795.conf deleted file mode 100644 index f0c47231..00000000 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter/gstvspfilter-h3ulcb_r8a7795.conf +++ /dev/null @@ -1,2 +0,0 @@ -input-device-name=/dev/video16 -output-device-name=/dev/video17 diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter/gstvspfilter-m3ulcb_r8a7796.conf b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter/gstvspfilter-m3ulcb_r8a7796.conf deleted file mode 100644 index 25a3fa1e..00000000 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter/gstvspfilter-m3ulcb_r8a7796.conf +++ /dev/null @@ -1,2 +0,0 @@ -input-device-name=/dev/video8 -output-device-name=/dev/video9 diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter_1.0.1.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter_1.0.1.bbappend deleted file mode 100644 index e77b58e0..00000000 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/gstreamer1.0-plugin-vspfilter_1.0.1.bbappend +++ /dev/null @@ -1,3 +0,0 @@ -COMPATIBLE_MACHINE = "r8a7795|r8a7796" - -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/include/checksum_control.inc b/meta-agl/meta-agl-bsp/meta-rcar-gen3/include/checksum_control.inc new file mode 100644 index 00000000..3e2bf8f1 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/include/checksum_control.inc @@ -0,0 +1,25 @@ +require checksum_control_files.inc + +python do_checksum_control() { + to_check_dico = d.getVarFlags("CTL_CHECKSUM") + if to_check_dico is None: + return 0 + + src_uri = (d.getVar('SRC_URI') or "").split() + for s in src_uri: + c_source=os.path.basename(s) + bb.note("Check source: %s " % (c_source)) + if c_source in to_check_dico: + f_data = bb.fetch2.FetchData(s, d, True) + f_data.setup_localpath(d) + if os.path.exists(f_data.localpath): + mdr5_sum=bb.utils.md5_file(f_data.localpath) + mdr5_ctl=to_check_dico[c_source] + if mdr5_sum != mdr5_ctl: + bb.fatal( "File %s hash should be %s but %s find, please update your driver files." % (c_source, mdr5_ctl, mdr5_sum)) +} + +do_checksum_control[doc] = "Do a checksum of the archives source files" +do_checksum_control[vardeps] = "CTL_CHECKSUM" + +addtask do_checksum_control before do_unpack after do_fetch diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/include/checksum_control_files.inc b/meta-agl/meta-agl-bsp/meta-rcar-gen3/include/checksum_control_files.inc new file mode 100644 index 00000000..ba4de527 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/include/checksum_control_files.inc @@ -0,0 +1,15 @@ +CTL_CHECKSUM[r8a77951_linux_gsx_binaries_gles.tar.bz2]="72e8973c497a4f8c3a149911df2e56cb" +CTL_CHECKSUM[r8a77960_linux_gsx_binaries_gles.tar.bz2]="194fd35daab3a26b37b9c79078a4719a" +CTL_CHECKSUM[GSX_KM_H3.tar.bz2]="ab1ee4534a1d4b1852478dc6d8fa5eb9" +CTL_CHECKSUM[GSX_KM_M3.tar.bz2]="531b91b53ad7ffaf13e33aec2d499278" +CTL_CHECKSUM[RCG3VUDRL4101ZDO.tar.bz2]="43a8921d5c2a257ccc0bf491c737f5be" +CTL_CHECKSUM[EVARTM0AC0000XCMCTL30SL41C.tar.bz2]="3714b73b8cc317372a22a8335c74e103" +CTL_CHECKSUM[EVARTM0AC0000XV264D30SL41C.tar.bz2]="efcbb6493f61d714b64f6340503fa1d3" +CTL_CHECKSUM[EVARTM0AC0000XV264E30SL41C.tar.bz2]="8b0480bcee569b53438ed79d166630fa" +CTL_CHECKSUM[EVARTM0AC0000XVCMND30SL41C.tar.bz2]="691889ccf3bc295bdfdb5cf90d90bcaf" +CTL_CHECKSUM[EVARTM0AC0000XVCMNE30SL41C.tar.bz2]="9dd7c067632385a5b071f96204766ac1" +CTL_CHECKSUM[RTM0AC0000ADAACMZ1SL41C.tar.gz]="4e0bb98feeb1e309a2ec12c201bc16aa" +CTL_CHECKSUM[RTM0AC0000AEAACMZ1SL41C.tar.gz]="414c5fc22bcf848b5a6eee3812874611" +CTL_CHECKSUM[RTM0AC0000XAAACD30SL41C.tar.gz]="e44c10bd24372fc70013c2498c6869d3" +CTL_CHECKSUM[RTM0AC0000XAAACE30SL41C.tar.gz]="1611375916d9e17cff19c34b83300c83" +CTL_CHECKSUM[RTM0AC0000XACMND30SL41C.tar.gz]="6229f43b2260d194f663bceed16ca273" diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state.bbappend index 642a71e4..44c2a2b9 100644 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state.bbappend +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state.bbappend @@ -1,9 +1,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -COMPATIBLE_MACHINE = "(m3ulcb|h3ulcb|ebisu)" +COMPATIBLE_MACHINE = "(salvator-x|m3ulcb|h3ulcb|ebisu)" PACKAGE_ARCH = "${MACHINE_ARCH}" -do_configure_append_ebisu () { - sed -i 's/state.ak4613\ {/state.rcarsound\ {/g' ${WORKDIR}/asound.state -} diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state/asound.state b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state/asound.state index 12353942..ef010821 100644 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state/asound.state +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state/asound.state @@ -1,4 +1,4 @@ -state.ak4613 { +state.rcarsound { control.1 { iface MIXER name 'Digital Playback Volume1' @@ -98,8 +98,8 @@ state.ak4613 { control.7 { iface MIXER name 'DVC Out Playback Volume' - value.0 1677721 - value.1 1677721 + value.0 1677647 + value.1 1677647 comment { access 'read write' type INTEGER @@ -220,8 +220,8 @@ state.ak4613 { control.14 { iface MIXER name 'DVC In Capture Volume' - value.0 838861 - value.1 838861 + value.0 838870 + value.1 838870 comment { access 'read write' type INTEGER diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3-salvator-x.txt b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3-salvator-x.txt new file mode 100644 index 00000000..9a8dc560 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3-salvator-x.txt @@ -0,0 +1,18 @@ +bootkaddr=0x49090000 +bootdaddr=0x48000000 +bootiaddr=0x5C3F9520 + +bootargs_console=console=ttySC0,115200 ignore_loglevel +bootargs_extra=rw rootfstype=ext4 rootwait rootdelay=2 +bootargs_root=ostree_root=/dev/mmcblk1p2 root=/dev/ram0 ramdisk_size=16384 + +bootmmc=0:1 +rootmmc=0:2 + +booteload_sd=ext4load mmc ${rootmmc} ${bootkaddr} boot/loader/uEnv.txt; env import -t ${bootkaddr} ${filesize} +bootkload_sd=ext4load mmc ${rootmmc} ${bootkaddr} boot/${kernel_image} +bootiload_sd=ext4load mmc ${rootmmc} ${bootiaddr} boot/${ramdisk_image}; setenv ramdisk_size ${filesize} +bootdload_sd=fatload mmc ${bootmmc} ${bootdaddr} r8a7795-salvator-xs.dtb + +bootcmd=run booteload_sd; setenv bootargs ${bootargs} ${bootargs_console} ${bootargs_root} ${bootargs_extra}; run bootkload_sd; run bootiload_sd; run bootdload_sd; booti ${bootkaddr} ${bootiaddr}:${ramdisk_size} ${bootdaddr} + diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3ulcb.txt b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3ulcb.txt index ff86b4e8..a08cc7d9 100644 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3ulcb.txt +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3ulcb.txt @@ -12,7 +12,7 @@ rootmmc=0:2 booteload_sd=ext4load mmc ${rootmmc} ${bootkaddr} boot/loader/uEnv.txt; env import -t ${bootkaddr} ${filesize} bootkload_sd=ext4load mmc ${rootmmc} ${bootkaddr} boot/${kernel_image} bootiload_sd=ext4load mmc ${rootmmc} ${bootiaddr} boot/${ramdisk_image}; setenv ramdisk_size ${filesize} -bootdload_sd=fatload mmc ${bootmmc} ${bootdaddr} Image-r8a7795-h3ulcb.dtb +bootdload_sd=fatload mmc ${bootmmc} ${bootdaddr} r8a7795-h3ulcb.dtb bootcmd=run booteload_sd; setenv bootargs ${bootargs} ${bootargs_console} ${bootargs_root} ${bootargs_extra}; run bootkload_sd; run bootiload_sd; run bootdload_sd; booti ${bootkaddr} ${bootiaddr}:${ramdisk_size} ${bootdaddr} diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3-salvator-x.txt b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3-salvator-x.txt new file mode 100644 index 00000000..7b76e1ef --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3-salvator-x.txt @@ -0,0 +1,18 @@ +bootkaddr=0x49090000 +bootdaddr=0x48000000 +bootiaddr=0x5C3F9520 + +bootargs_console=console=ttySC0,115200 ignore_loglevel +bootargs_extra=rw rootfstype=ext4 rootwait rootdelay=2 +bootargs_root=ostree_root=/dev/mmcblk1p2 root=/dev/ram0 ramdisk_size=16384 + +bootmmc=0:1 +rootmmc=0:2 + +booteload_sd=ext4load mmc ${rootmmc} ${bootkaddr} boot/loader/uEnv.txt; env import -t ${bootkaddr} ${filesize} +bootkload_sd=ext4load mmc ${rootmmc} ${bootkaddr} boot/${kernel_image} +bootiload_sd=ext4load mmc ${rootmmc} ${bootiaddr} boot/${ramdisk_image}; setenv ramdisk_size ${filesize} +bootdload_sd=fatload mmc ${bootmmc} ${bootdaddr} r8a7796-salvator-xs.dtb + +bootcmd=run booteload_sd; setenv bootargs ${bootargs} ${bootargs_console} ${bootargs_root} ${bootargs_extra}; run bootkload_sd; run bootiload_sd; run bootdload_sd; booti ${bootkaddr} ${bootiaddr}:${ramdisk_size} ${bootdaddr} + diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3ulcb.txt b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3ulcb.txt index 64f83330..979014a2 100644 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3ulcb.txt +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3ulcb.txt @@ -12,7 +12,7 @@ rootmmc=0:2 booteload_sd=ext4load mmc ${rootmmc} ${bootkaddr} boot/loader/uEnv.txt; env import -t ${bootkaddr} ${filesize} bootkload_sd=ext4load mmc ${rootmmc} ${bootkaddr} boot/${kernel_image} bootiload_sd=ext4load mmc ${rootmmc} ${bootiaddr} boot/${ramdisk_image}; setenv ramdisk_size ${filesize} -bootdload_sd=fatload mmc ${bootmmc} ${bootdaddr} Image-r8a7796-m3ulcb.dtb +bootdload_sd=fatload mmc ${bootmmc} ${bootdaddr} r8a7796-m3ulcb.dtb bootcmd=run booteload_sd; setenv bootargs ${bootargs} ${bootargs_console} ${bootargs_root} ${bootargs_extra}; run bootkload_sd; run bootiload_sd; run bootdload_sd; booti ${bootkaddr} ${bootiaddr}:${ramdisk_size} ${bootdaddr} diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/renesas-ota-bootfiles.bb b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/renesas-ota-bootfiles.bb index db08f3f4..4007e7f9 100644 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/renesas-ota-bootfiles.bb +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/renesas-ota-bootfiles.bb @@ -4,13 +4,14 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384 inherit deploy -COMPATIBLE_MACHINE = "(m3ulcb|h3ulcb|ebisu)" +COMPATIBLE_MACHINE = "(salvator-x|m3ulcb|h3ulcb|ebisu)" S = "${WORKDIR}" SRC_URI_append_sota = "file://uEnv-ota-m3ulcb.txt \ - file://uEnv-ota-h3ulcb.txt" - + file://uEnv-ota-h3ulcb.txt \ + file://uEnv-ota-h3-salvator-xs \ + file://uEnv-ota-m3-salvator-xs" do_deploy() { install -d ${DEPLOYDIR}/${PN} } diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples/0001-secure_storage-ta-Add-a-missing-include-file.patch b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples/0001-secure_storage-ta-Add-a-missing-include-file.patch new file mode 100644 index 00000000..7627a066 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples/0001-secure_storage-ta-Add-a-missing-include-file.patch @@ -0,0 +1,29 @@ +From be7079678aeb1503e0f681d977c47c44fd7b4f8c Mon Sep 17 00:00:00 2001 +From: Pierre Marzin +Date: Mon, 19 Aug 2019 09:33:17 +0000 +Subject: [PATCH] secure_storage: ta: Add a missing include file + +The commit 9890a50d3c26b377dcb27f5db680018e15a5a3de fix a size type by +using a format macro contant 'PRIu32' into a printf. This needs the +inttypes.h header file to build correctly with aarch64-linux-gnu-gcc. + +Signed-off-by: Pierre Marzin +--- + secure_storage/ta/secure_storage_ta.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/secure_storage/ta/secure_storage_ta.c b/secure_storage/ta/secure_storage_ta.c +index 3ccc12d..cfdfbb6 100644 +--- a/secure_storage/ta/secure_storage_ta.c ++++ b/secure_storage/ta/secure_storage_ta.c +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + + static TEE_Result delete_object(uint32_t param_types, TEE_Param params[4]) + { +-- +2.11.0 + diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples_git.bb b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples_git.bb new file mode 100644 index 00000000..440fe8fd --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples_git.bb @@ -0,0 +1,61 @@ +SUMMARY = "OP-TEE examples" + +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=cd95ab417e23b94f381dafc453d70c30" + + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +inherit python3native + +PV = "3.6.0+git${SRCPV}" + +SRCREV = "292da2fd8db0176e0e96989268c63ef9ab910a6c" + +SRC_URI = " \ + git://github.com/linaro-swg/optee_examples;branch=master;name=master \ + file://0001-secure_storage-ta-Add-a-missing-include-file.patch \ +" + +COMPATIBLE_MACHINE = "(salvator-x|h3ulcb|m3ulcb|m3nulcb|ebisu)" +PLATFORM = "rcar" + +DEPENDS = "optee-os optee-client python-pycrypto-native" + +CFLAGS += "-Wno-extra -Wno-error=format" +TARGET_CFLAGS += "-Wno-extra -Wno-error=format" + +TARGET_CC_ARCH += "${LDFLAGS}" +INSANE_SKIP_${PN} = "ldflags" + +TA_DEV_KIT_DIR = "${STAGING_DIR_TARGET}/usr/share/optee/export-ta_arm64" + +OPTEE_CLIENT_EXPORT = "${STAGING_DIR_TARGET}/usr" + +TEEC_EXPORT = "${STAGING_DIR_TARGET}/usr" + +S = "${WORKDIR}/git" +EXTRA_OEMAKE = "\ + TEEC_EXPORT=${TEEC_EXPORT} \ + OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \ + TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \ + HOST_CROSS_COMPILE=${TARGET_PREFIX} \ + TA_CROSS_COMPILE=${TARGET_PREFIX} \ + PLATFORM=${PLATFORM} \ + V=1 \ + " + +do_compile() { + oe_runmake +} + +do_install () { + mkdir -p ${D}${nonarch_base_libdir}/optee_armtz + mkdir -p ${D}${bindir} + install -D -p -m0755 ${S}/out/ca/* ${D}${bindir} + install -D -p -m0444 ${S}/out/ta/* ${D}${nonarch_base_libdir}/optee_armtz + mkdir -p ${D}${includedir} + cp ${S}/hello_world/ta/include/* ${D}${includedir} +} + +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/" diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os_git.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os_git.bbappend new file mode 100644 index 00000000..77eeab9f --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os_git.bbappend @@ -0,0 +1,7 @@ +do_install() { + install -d ${D}/usr/share/optee + cp -r ${S}/out/arm-plat-${PLATFORM}/export-ta_arm64 ${D}/usr/share/optee +} + +FILES_${PN}-staticdev += "${datadir}/optee/export-ta_arm64/lib/*.a" +FILES_${PN}-dev += "${datadir}/optee/export-ta_arm64" diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test/optee_xtest_fix.diff b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test/optee_xtest_fix.diff new file mode 100644 index 00000000..5067086f --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test/optee_xtest_fix.diff @@ -0,0 +1,13 @@ +diff --git a/host/xtest/regression_6000.c b/host/xtest/regression_6000.c +index 336ea14..2379e43 100644 +--- a/host/xtest/regression_6000.c ++++ b/host/xtest/regression_6000.c +@@ -82,6 +82,8 @@ static uint32_t fs_id_for_tee_storage_private(void) + return TEE_STORAGE_PRIVATE_REE; + #elif defined(CFG_RPMB_FS) + return TEE_STORAGE_PRIVATE_RPMB; ++#else ++ return TEE_STORAGE_PRIVATE; + #endif + } + diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test_git.bb b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test_git.bb new file mode 100644 index 00000000..80a22b89 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test_git.bb @@ -0,0 +1,55 @@ +DESCRIPTION = "OP-TEE TEST" + +LICENSE = "GPLv2 & BSD-2-Clause" +LIC_FILES_CHKSUM = "file://${S}/host/LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +inherit python3native + +PV = "3.1.0+git${SRCPV}" + +SRCREV = "45218eb59b006ad20cc7610904f291dd85157a43" + +SRC_URI = " \ + git://github.com/OP-TEE/optee_test.git;branch=master;name=master \ + file://optee_xtest_fix.diff \ +" + +COMPATIBLE_MACHINE = "(salvator-x|h3ulcb|m3ulcb|m3nulcb|ebisu)" +PLATFORM = "rcar" + +DEPENDS = "optee-os optee-client python3-pycrypto-native" + +export CROSS_COMPILE64="${TARGET_PREFIX}" + +# Let the Makefile handle setting up the flags as it is a standalone application +LD[unexport] = "1" +LDFLAGS[unexport] = "1" +export CCcore="${CC}" +export LDcore="${LD}" +libdir[unexport] = "1" + +CFLAGS += "-Wno-extra -Wno-error=stringop-overflow -Wno-error=array-bounds" +TARGET_CFLAGS += "-Wno-extra -Wno-error=stringop-overflow -Wno-error=array-bounds" + +TARGET_CC_ARCH += "${LDFLAGS}" +INSANE_SKIP_${PN} = "ldflags" + +S = "${WORKDIR}/git" +EXTRA_OEMAKE = "-e MAKEFLAGS=" + +do_compile() { + oe_runmake CROSS_COMPILE=${CROSS_COMPILE64} PLATFORM=${PLATFORM} OPTEE_CLIENT_EXPORT=${STAGING_DIR_TARGET}/usr --no-builtin-variables TA_DEV_KIT_DIR="${STAGING_DIR_TARGET}/usr/share/optee/export-ta_arm64" +} + +do_install () { + install -D -p -m0755 ${S}/out/xtest/xtest ${D}${bindir}/xtest + + # install path should match the value set in optee-client/tee-supplicant + # default TEEC_LOAD_PATH is /lib + mkdir -p ${D}${nonarch_base_libdir}/optee_armtz/ + install -D -p -m0444 ${S}/out/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/ +} + +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/" diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-user-app-template_git.bb b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-user-app-template_git.bb new file mode 100644 index 00000000..d66060b0 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-user-app-template_git.bb @@ -0,0 +1,57 @@ +SUMMARY = "OP-TEE user_app_template" + +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=cd95ab417e23b94f381dafc453d70c30" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +inherit python3native + +PV = "0.1+git${SRCPV}" + +SRCREV = "0.1" + +SRC_URI = " \ + git://github.com/iotbzh/optee_user_app_template;branch=master \ +" + +COMPATIBLE_MACHINE = "(salvator-x|h3ulcb|m3ulcb|m3nulcb|ebisu)" +PLATFORM = "rcar" + +DEPENDS = "optee-os optee-client python-pycrypto-native" + +CFLAGS += "-Wno-extra -Wno-error=format" +TARGET_CFLAGS += "-Wno-extra -Wno-error=format" + +TARGET_CC_ARCH += "${LDFLAGS}" +INSANE_SKIP_${PN} = "ldflags" + +TA_DEV_KIT_DIR = "${STAGING_DIR_TARGET}/usr/share/optee/export-ta_arm64" + +OPTEE_CLIENT_EXPORT = "${STAGING_DIR_TARGET}/usr" + +TEEC_EXPORT = "${STAGING_DIR_TARGET}/usr" + +S = "${WORKDIR}/git" +EXTRA_OEMAKE = "\ + TEEC_EXPORT=${TEEC_EXPORT} \ + OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \ + TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \ + HOST_CROSS_COMPILE=${TARGET_PREFIX} \ + TA_CROSS_COMPILE=${TARGET_PREFIX} \ + PLATFORM=${PLATFORM} \ + V=1 \ + " + +do_compile() { + oe_runmake +} + +do_install () { + mkdir -p ${D}${nonarch_base_libdir}/optee_armtz + mkdir -p ${D}${bindir} + install -D -p -m0755 ${S}/out/ca/* ${D}${bindir} + install -D -p -m0444 ${S}/out/ta/* ${D}${nonarch_base_libdir}/optee_armtz +} + +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/" diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control.inc b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control.inc new file mode 120000 index 00000000..8c7e36ff --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control.inc @@ -0,0 +1 @@ +../../include/checksum_control.inc \ No newline at end of file diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control_files.inc b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control_files.inc new file mode 120000 index 00000000..ff4e9a89 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control_files.inc @@ -0,0 +1 @@ +../../include/checksum_control_files.inc \ No newline at end of file diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module.bbappend new file mode 100644 index 00000000..b902fc9b --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module.bbappend @@ -0,0 +1 @@ +require checksum_control.inc diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf.bbappend index 198f83f1..44615c33 100644 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf.bbappend +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf.bbappend @@ -1,7 +1,8 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -SRC_URI += "file://kingfisher_output.cfg" -SRC_URI_append_ebisu += "file://ebisu_output.cfg" +SRC_URI_append_ulcb = " file://kingfisher_output.cfg" +SRC_URI_append_ebisu = " file://ebisu_output.cfg" +SRC_URI_append_salvator-x = " file://salvator-x_output.cfg" do_configure() { echo repaint-window=34 >> ${WORKDIR}/core.cfg diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/ebisu_output.cfg b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/ebisu_output.cfg index 618f04e7..2bca54f0 100644 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/ebisu_output.cfg +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/ebisu_output.cfg @@ -1,4 +1,11 @@ [output] -name=VGA-1 +name=HDMI-A-2 +mode=off + +[output] +name=LVDS-1 mode=off +[output] +name=VGA-1 +mode=off diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/kingfisher_output.cfg b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/kingfisher_output.cfg index a194a4a4..99fde306 100644 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/kingfisher_output.cfg +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/kingfisher_output.cfg @@ -5,4 +5,3 @@ mode=off [output] name=LVDS-1 mode=off - diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/salvator-x_output.cfg b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/salvator-x_output.cfg new file mode 100644 index 00000000..7359e6ec --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/salvator-x_output.cfg @@ -0,0 +1,12 @@ +[output] +name=HDMI-A-2 +mode=off + +[output] +name=LVDS-1 +mode=off + +[output] +name=VGA-1 +mode=off + diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend deleted file mode 100644 index 38590dcd..00000000 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend +++ /dev/null @@ -1 +0,0 @@ -DEPENDS_append_ulcb = " gstreamer1.0-plugins-base" diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control.inc b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control.inc new file mode 120000 index 00000000..8c7e36ff --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control.inc @@ -0,0 +1 @@ +../../include/checksum_control.inc \ No newline at end of file diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control_files.inc b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control_files.inc new file mode 120000 index 00000000..ff4e9a89 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control_files.inc @@ -0,0 +1 @@ +../../include/checksum_control_files.inc \ No newline at end of file diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/kernel-module-gles.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/kernel-module-gles.bbappend index 8a4176fc..7d28d912 100644 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/kernel-module-gles.bbappend +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/kernel-module-gles.bbappend @@ -1,3 +1,5 @@ +require checksum_control.inc + module_do_compile_prepend() { cd ${S}/build/linux/config/compilers cp aarch64-poky-linux.mk ${TARGET_SYS}.mk diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control.inc b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control.inc new file mode 120000 index 00000000..8c7e36ff --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control.inc @@ -0,0 +1 @@ +../../include/checksum_control.inc \ No newline at end of file diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control_files.inc b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control_files.inc new file mode 120000 index 00000000..ff4e9a89 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control_files.inc @@ -0,0 +1 @@ +../../include/checksum_control_files.inc \ No newline at end of file diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/kernel-module-uvcs-drv.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/kernel-module-uvcs-drv.bbappend index f1450747..1fa00a85 100644 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/kernel-module-uvcs-drv.bbappend +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/kernel-module-uvcs-drv.bbappend @@ -1 +1,3 @@ +require checksum_control.inc + KERNEL_MODULE_AUTOLOAD = "uvcs_drv" diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-ADSP-enable-and-add-sound-hardware-abstraction.patch b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-ADSP-enable-and-add-sound-hardware-abstraction.patch index 966b006a..e8ea125e 100644 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-ADSP-enable-and-add-sound-hardware-abstraction.patch +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-ADSP-enable-and-add-sound-hardware-abstraction.patch @@ -12,50 +12,6 @@ abstraction. Signed-off-by: Ronan Le Martret Signed-off-by: Mark Farrugia --- -diff --git a/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-kf.dts b/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-kf.dts -index de2390f009e7..4ccfa8315d17 100644 ---- a/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-kf.dts -+++ b/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-kf.dts -@@ -15,6 +15,39 @@ - "renesas,r8a7796"; - }; - -+ -+&adsp { -+ -+ /* ADSP playback setting for pcm3168 */ -+ adsp_playback0: adsp,playback { -+ mode = "tdm"; -+ clock-mode = "master"; -+ bus-width = <24>; -+ ssi = <3>; -+ bus-if = <0>; -+ channels = <8>; -+ pin-share-ssi = <4>; -+ }; -+ -+ /* ADSP capture setting for pcm3168 */ -+ adsp_capture0: adsp,capture { -+ mode = "tdm"; -+ clock-mode = "slave"; -+ bus-width = <24>; -+ ssi = <4>; -+ bus-if = <0>; -+ channels = <8>; -+ pin-share-ssi = <3>; -+ }; -+ -+ adsp,ports { -+ port@0 { -+ playback = <&adsp_playback0>; -+ capture = <&adsp_capture0>; -+ }; -+ }; -+}; -+ - &du { - ports { - port@0 { diff --git a/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb.dts b/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb.dts index 1cd64c1b3b31..71e59da3528d 100644 --- a/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb.dts diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/r8a7796-m3ulcb-xen.dts b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/r8a7796-m3ulcb-xen.dts new file mode 100644 index 00000000..7940b102 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/r8a7796-m3ulcb-xen.dts @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Device Tree Source for the M3ULCB (R-Car Starter Kit Pro) board + * + * Copyright (C) 2016-2018 Renesas Electronics Corp. + * Copyright (C) 2016 Cogent Embedded, Inc. + */ + +/dts-v1/; +#include "r8a7796.dtsi" +#include "ulcb.dtsi" + +/ { + model = "Renesas M3ULCB board based on r8a7796"; + compatible = "renesas,m3ulcb", "renesas,r8a7796"; + + + chosen { + /delete-property/ bootargs; + xen,xen-bootargs = "dom0_mem=752M console=dtuart dtuart=serial0 dom0_max_vcpus=4"; + xen,dom0-bootargs = "console=hvc0 clk_ignore_unused root=/dev/mmcblk1p2 rw rootwait ignore_loglevel cma=32M earlyprintk"; + + #address-cells = <2>; + #size-cells = <2>; + modules { + module@0 { + compatible = "xen,linux-zimage", + "xen,multiboot-module"; + reg = <0x0 0x7a000000 0x0 0x02000000>; + }; + }; + }; + + cpus { + idle-states { + /delete-node/ cpu-sleep-1; + }; + }; + + memory@48000000 { + device_type = "memory"; + /* first 128MB is reserved for secure area. */ + reg = <0x0 0x48000000 0x0 0x38000000>, <0x6 0x00000000 0x0 0x40000000>; + }; + + vspm_if { + compatible = "renesas,vspm_if"; + }; + + versaclock5_out3: versaclk-3 { + compatible = "fixed-clock"; + #clock-cells = <0>; + /* Initial value of versaclock out3 */ + clock-frequency = <33000000>; + }; +}; + +&a53_0 { + /delete-property/ cpu-idle-states; +}; + +&a53_1 { + /delete-property/ cpu-idle-states; +}; + +&a53_2 { + /delete-property/ cpu-idle-states; +}; + +&a53_3 { + /delete-property/ cpu-idle-states; +}; + +&du { + clocks = <&cpg CPG_MOD 724>, + <&cpg CPG_MOD 723>, + <&cpg CPG_MOD 722>, + <&versaclock5 1>, + <&versaclock5_out3>, + <&versaclock5 2>; + clock-names = "du.0", "du.1", "du.2", + "dclkin.0", "dclkin.1", "dclkin.2"; +}; + +&vspb { + status = "okay"; +}; + +&vspi0 { + status = "okay"; +}; diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/xen-be.cfg b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/xen-be.cfg new file mode 100644 index 00000000..c9fc6d75 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/xen-be.cfg @@ -0,0 +1 @@ +CONFIG_XEN_BLKDEV_BACKEND=y diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_%.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_%.bbappend index e72dc3df..12054df8 100644 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_%.bbappend +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_%.bbappend @@ -6,6 +6,17 @@ SRC_URI_append = " file://namespace_fix.cfg \ " # Add ADSP patch to enable and add sound hardware abstraction -SRC_URI_append_ulcb = " \ +SRC_URI_append = " \ file://0004-ADSP-enable-and-add-sound-hardware-abstraction.patch \ " + +# For Xen +SRC_URI_append = " \ + ${@bb.utils.contains('AGL_XEN_WANTED','1','file://xen-be.cfg','',d)} \ +" +SRC_URI_append_m3ulcb = " \ + ${@bb.utils.contains('AGL_XEN_WANTED','1','file://r8a7796-m3ulcb-xen.dts;subdir=git/arch/${ARCH}/boot/dts/renesas','',d)} \ +" +KERNEL_DEVICETREE_append_m3ulcb = " \ + ${@bb.utils.contains('AGL_XEN_WANTED','1','renesas/r8a7796-m3ulcb-xen.dtb','',d)} \ +" diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control.inc b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control.inc new file mode 120000 index 00000000..8c7e36ff --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control.inc @@ -0,0 +1 @@ +../../include/checksum_control.inc \ No newline at end of file diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control_files.inc b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control_files.inc new file mode 120000 index 00000000..ff4e9a89 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control_files.inc @@ -0,0 +1 @@ +../../include/checksum_control_files.inc \ No newline at end of file diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/omx-user-module.bbappend b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/omx-user-module.bbappend index b35c614c..a712aaa9 100644 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/omx-user-module.bbappend +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/omx-user-module.bbappend @@ -1,3 +1,7 @@ +require checksum_control.inc + +PROVIDES += "virtual/libomxil" + setup_build_tree() { for omxmc in ${OMX_COMMON_SRC} ${OMX_VIDEO_DEC_COMMON_SRC} ${OMX_VIDEO_ENC_COMMON_SRC} do diff --git a/meta-agl/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh b/meta-agl/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh index 2fc3d9f1..7fd940b9 100644 --- a/meta-agl/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh +++ b/meta-agl/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh @@ -1,9 +1,9 @@ #!/bin/bash -ZIP_1="R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-weston5-20190802.zip" -ZIP_2="R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-weston5-20191021.zip" +ZIP_1="R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-weston8-20191206.zip" +ZIP_2="R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-weston8-20191021.zip" -COPY_SCRIPT="$METADIR/bsp/meta-renesas-rcar-gen3/meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh" +COPY_SCRIPT="$METADIR/bsp/meta-renesas/meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh" test -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs && source ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs DOWNLOAD_DIR=${XDG_DOWNLOAD_DIR:-$HOME/Downloads} @@ -70,7 +70,7 @@ function copy_mm_packages() { fi if [ -f $COPY_SCRIPT ]; then - cd $METADIR/bsp/meta-renesas-rcar-gen3/ + cd $METADIR/bsp/meta-renesas/ $COPY_SCRIPT -d -f $EXTRACT_DIR cd .. else diff --git a/meta-agl/meta-agl-bsp/meta-sancloud/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl/meta-agl-bsp/meta-sancloud/recipes-graphics/wayland/weston-ini-conf.bbappend index e737b540..f2a27ba3 100644 --- a/meta-agl/meta-agl-bsp/meta-sancloud/recipes-graphics/wayland/weston-ini-conf.bbappend +++ b/meta-agl/meta-agl-bsp/meta-sancloud/recipes-graphics/wayland/weston-ini-conf.bbappend @@ -1,6 +1,3 @@ do_configure_append_bbe() { echo 'gbm-format=rgb565' >> ${WORKDIR}/core.cfg - if [[ -e "${WORKDIR}/hdmi-a-1-270.cfg" ]]; then - echo 'mode=1280x720' >> ${WORKDIR}/hdmi-a-1-270.cfg - fi } diff --git a/meta-agl/meta-agl-bsp/meta-synopsys/recipes-kernel/linux-yocto_%.bbappend b/meta-agl/meta-agl-bsp/meta-synopsys/recipes-kernel/linux-yocto_%.bbappend new file mode 100644 index 00000000..88ac94b1 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-synopsys/recipes-kernel/linux-yocto_%.bbappend @@ -0,0 +1 @@ +require recipes-kernel/linux/linux-agl.inc diff --git a/meta-agl/meta-agl-bsp/meta-synopsys/recipes-kernel/linux/linux-arc_%.bbappend b/meta-agl/meta-agl-bsp/meta-synopsys/recipes-kernel/linux/linux-arc_%.bbappend deleted file mode 100644 index 88ac94b1..00000000 --- a/meta-agl/meta-agl-bsp/meta-synopsys/recipes-kernel/linux/linux-arc_%.bbappend +++ /dev/null @@ -1 +0,0 @@ -require recipes-kernel/linux/linux-agl.inc diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-FIX-weston-clients-typo-in-simple-dmabuf-egl.c.patch b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-FIX-weston-clients-typo-in-simple-dmabuf-egl.c.patch deleted file mode 100644 index 7801bdd5..00000000 --- a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-FIX-weston-clients-typo-in-simple-dmabuf-egl.c.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 53d7c243ba0baa052081735b8effff4e2679ce65 Mon Sep 17 00:00:00 2001 -From: Kamal Pandey -Date: Thu, 4 Apr 2019 19:45:45 +0530 -Subject: [PATCH] FIX: weston: clients: typo in simple-dmabuf-egl.c - -Fix variable EGL_NO_IMAGE to EGL_NO_IMAGE_KHR in -clients/simple-dmabuf-egl.c - -Signed-off-by: Kamal Pandey ---- - clients/simple-dmabuf-egl.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/clients/simple-dmabuf-egl.c b/clients/simple-dmabuf-egl.c -index 75d880e08..2d99c4709 100644 ---- a/clients/simple-dmabuf-egl.c -+++ b/clients/simple-dmabuf-egl.c -@@ -293,7 +293,7 @@ create_fbo_for_buffer(struct display *display, struct buffer *buffer) - EGL_NO_CONTEXT, - EGL_LINUX_DMA_BUF_EXT, - NULL, attribs); -- if (buffer->egl_image == EGL_NO_IMAGE) { -+ if (buffer->egl_image == EGL_NO_IMAGE_KHR) { - fprintf(stderr, "EGLImageKHR creation failed\n"); - return false; - } --- -2.21.0 - diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-udev-seat-restrict-udev-enumeration-to-card0.patch b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-udev-seat-restrict-udev-enumeration-to-card0.patch deleted file mode 100644 index 45d4ec7d..00000000 --- a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-udev-seat-restrict-udev-enumeration-to-card0.patch +++ /dev/null @@ -1,37 +0,0 @@ -From e8e7a9f7dfa164a75fdbdca87622a2e13334478a Mon Sep 17 00:00:00 2001 -From: Anand Balagopalakrishnan -Date: Sat, 23 Jan 2016 22:48:07 +0530 -Subject: [PATCH 1/1] udev-seat: restrict udev enumeration to card0 - -In case of separate GPU and Display devices as found in embedded systems, we -could have modeset node and render node controlled by different drivers. -There is a distinct possibility that udev enumeration returns the DRM device -corresponding to render node as the primary DRM device. - -Obviously, modeset operations cannot be done on the GPU DRM device. - -Restrict the udev enumeration to card0 and ensure that DRM device corresponding -to display is returned as the primary DRM device. - -Upstream-Status: Pending - -Signed-off-by: Anand Balagopalakrishnan ---- - libweston/compositor-drm.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c -index 6777bf8..59c2cc5 100644 ---- a/libweston/compositor-drm.c -+++ b/libweston/compositor-drm.c -@@ -2827,7 +2827,7 @@ find_primary_gpu(struct drm_backend *b, const char *seat) - - e = udev_enumerate_new(b->udev); - udev_enumerate_add_match_subsystem(e, "drm"); -- udev_enumerate_add_match_sysname(e, "card[0-9]*"); -+ udev_enumerate_add_match_sysname(e, "card0"); - - udev_enumerate_scan_devices(e); - drm_device = NULL; --- -1.7.9.5 diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0002-Weston-Allow-visual_id-to-be-0.patch b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0002-Weston-Allow-visual_id-to-be-0.patch deleted file mode 100644 index b7f467b4..00000000 --- a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0002-Weston-Allow-visual_id-to-be-0.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 5b5de6a814b43ca023a92b85b407b3d061dbc64f Mon Sep 17 00:00:00 2001 -From: Eric Ruei -Date: Thu, 9 Mar 2017 14:32:24 -0500 -Subject: [PATCH 2/4] Weston: Allow visual_id to be 0 - -The inquiry of visual id from egl API eglGetConfigAttrib(EGL_NATIVE_VISUAL_ID) -is an optional feature. The visual id will be set to 0 if this feature is -not supported. Therefore, the return condition @function match_config_to_visual() -should be (id == visual_id || id == 0) instead of (id == visual_id) - -Signed-off-by: Eric Ruei ---- - libweston/gl-renderer.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c -index 23c0cd7..4c1f170 100644 ---- a/libweston/gl-renderer.c -+++ b/libweston/gl-renderer.c -@@ -2462,7 +2462,7 @@ match_config_to_visual(EGLDisplay egl_display, - &id)) - continue; - -- if (id == visual_id) -+ if (id == visual_id || id == 0) - return i; - } - --- -1.9.1 - diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0003-Weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0003-Weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch deleted file mode 100644 index 126d4ed3..00000000 --- a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0003-Weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 0d15218ced5bf2e6f3d05758f0f5f21c2a0303f2 Mon Sep 17 00:00:00 2001 -From: Eric Ruei -Date: Thu, 9 Mar 2017 14:33:08 -0500 -Subject: [PATCH 3/4] Weston: Fix virtual keyboard display issue for QT5 - application - -The virtual keyboard does pop up as expected, however, it will never hide -even when the application is terminated. This problem is due to the order -of the text APIs( text_input_activate and test_input_show_input_panel) are -invoked in QT5 and a potential bug of the API implementation. The virtual -keyboard works as expected if the test_input_show_input_panel() is invoked -prior to the test_input_activate() as most of the weston sample applications -do. However, the problem will show up if that order is reversed and the reason -why is that the current_panel is not set in this case and hence this panel -cannot be hidden. - -It is required to set the current_panel to the text_input when the input_panel -becomes visible at the first time. - -Updated for weston 5.0.0 by Scott Murray . - -Signed-off-by: Eric Ruei -Signed-off-by: Scott Murray ---- - compositor/text-backend.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/compositor/text-backend.c b/compositor/text-backend.c -index 664c36f7..b610dfb1 100644 ---- a/compositor/text-backend.c -+++ b/compositor/text-backend.c -@@ -349,6 +349,7 @@ text_input_show_input_panel(struct wl_client *client, - text_input->surface); - wl_signal_emit(&ec->update_input_panel_signal, - &text_input->cursor_rectangle); -+ text_input->manager->current_text_input = text_input; - } - } - diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0003-weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0003-weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch new file mode 100644 index 00000000..32901db9 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0003-weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch @@ -0,0 +1,41 @@ +From 8034bc1862bbebb332e91917c6458ef8efb5b54e Mon Sep 17 00:00:00 2001 +From: Eric Ruei +Date: Fri, 8 Mar 2019 18:49:07 -0500 +Subject: [PATCH] weston: Fix virtual keyboard display issue for QT5 + application + +The virtual keyboard does pop up as expected, however, it will never hide +even when the application is terminated. This problem is due to the order +of the text APIs( text_input_activate and test_input_show_input_panel) are +invoked in QT5 and a potential bug of the API implementation. The virtual +keyboard works as expected if the test_input_show_input_panel() is invoked +prior to the test_input_activate() as most of the weston sample applications +do. However, the problem will show up if that order is reversed and the reason +why is that the current_panel is not set in this case and hence this panel +cannot be hidden. + +It is required to set the current_panel to the text_input when the input_panel +becomes visible at the first time. + +Upstream status: Pending + +Signed-off-by: Eric Ruei +--- + compositor/text-backend.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/compositor/text-backend.c b/compositor/text-backend.c +index 664c36f..b610dfb 100644 +--- a/compositor/text-backend.c ++++ b/compositor/text-backend.c +@@ -349,6 +349,7 @@ text_input_show_input_panel(struct wl_client *client, + text_input->surface); + wl_signal_emit(&ec->update_input_panel_signal, + &text_input->cursor_rectangle); ++ text_input->manager->current_text_input = text_input; + } + } + +-- +1.9.1 + diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0004-Weston-Fix-touch-screen-crash-issue.patch b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0004-Weston-Fix-touch-screen-crash-issue.patch deleted file mode 100644 index ba20551e..00000000 --- a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0004-Weston-Fix-touch-screen-crash-issue.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 8958bf21960a475d2933e688d0da9a0d2186d509 Mon Sep 17 00:00:00 2001 -From: Eric Ruei -Date: Thu, 9 Mar 2017 14:34:18 -0500 -Subject: [PATCH 4/4] Weston: Fix touch screen crash issue - -Touch screen operation causes the weston to crash with segment fault sometimes. -The crash occurs when the coordinate (x,y) passed to the weston input module -is outside the view window, hence the weston compositor is not able to pick -up a display view and there is no code to detect this condition at function -notify_touch(). - -Signed-off-by: Eric Ruei ---- - libweston/input.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/libweston/input.c b/libweston/input.c -index 8fe898c..0f72d23 100644 ---- a/libweston/input.c -+++ b/libweston/input.c -@@ -1848,6 +1848,12 @@ notify_touch(struct weston_seat *seat, uint32_t time, int touch_id, - * until all touch points are up again. */ - if (touch->num_tp == 1) { - ev = weston_compositor_pick_view(ec, x, y, &sx, &sy); -+ if (!ev) -+ { -+ weston_log("notify_touch: weston_compositor_pick_view(%d, %d) failed to find a view!\n", -+ wl_fixed_to_int(x), wl_fixed_to_int(y)); -+ return; -+ } - weston_touch_set_focus(touch, ev); - } else if (!touch->focus) { - /* Unexpected condition: We have non-initial touch but --- -1.9.1 - diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0004-weston-Fix-touch-screen-crash-issue.patch b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0004-weston-Fix-touch-screen-crash-issue.patch new file mode 100644 index 00000000..4849d5b6 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0004-weston-Fix-touch-screen-crash-issue.patch @@ -0,0 +1,39 @@ +From 60250e9dc57fe56148c8a24bba107bce8a873fb4 Mon Sep 17 00:00:00 2001 +From: Karthik Ramanan +Date: Mon, 12 Mar 2018 10:56:28 +0530 +Subject: [PATCH 4/4] weston: Fix touch screen crash issue + +Touch screen operation causes the weston to crash with segment fault sometimes. +The crash occurs when the coordinate (x,y) passed to the weston input module +is outside the view window, hence the weston compositor is not able to pick +up a display view and there is no code to detect this condition at function +notify_touch(). + +Upstream status: pending + +Signed-off-by: Eric Ruei +Signed-off-by: Karthik Ramanan +--- + libweston/input.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/libweston/input.c b/libweston/input.c +index 4fedc55..bcb2f28 100644 +--- a/libweston/input.c ++++ b/libweston/input.c +@@ -2185,6 +2185,12 @@ notify_touch(struct weston_seat *seat, uint32_t time, int touch_id, + * until all touch points are up again. */ + if (touch->num_tp == 1) { + ev = weston_compositor_pick_view(ec, x, y, &sx, &sy); ++ if (!ev) ++ { ++ weston_log("notify_touch: weston_compositor_pick_view(%d, %d) failed to find a view!\n", ++ wl_fixed_to_int(x), wl_fixed_to_int(y)); ++ return; ++ } + weston_touch_set_focus(touch, ev); + } else if (!touch->focus) { + /* Unexpected condition: We have non-initial touch but +-- +1.9.1 + diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0005-weston-drm-fix-dual-display-issue.patch b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0005-weston-drm-fix-dual-display-issue.patch new file mode 100644 index 00000000..9b06b81b --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0005-weston-drm-fix-dual-display-issue.patch @@ -0,0 +1,79 @@ +From db6f5ce008d9b8a4cc7db71659ce1d21d3d7f97f Mon Sep 17 00:00:00 2001 +From: Eric Ruei +Date: Tue, 26 Mar 2019 13:32:31 -0400 +Subject: [PATCH 3/3] weston: drm: fix dual display issue + +This patch fixes the dual display issue by enhancing the primary plane +search algorithm to keep the plane which is connected to the crtc of +the output because the direct switching of active planes is not allowed. + +Upstream status: Pending + +Signed-off-by: Eric Ruei +--- + libweston/compositor-drm.c | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c +index 3891176..fa694c3 100644 +--- a/libweston/compositor-drm.c ++++ b/libweston/compositor-drm.c +@@ -428,6 +428,7 @@ struct drm_plane { + + uint32_t possible_crtcs; + uint32_t plane_id; ++ uint32_t crtc_id; + uint32_t count_formats; + + struct drm_property_info props[WDRM_PLANE__COUNT]; +@@ -4073,6 +4074,7 @@ drm_plane_create(struct drm_backend *b, const drmModePlane *kplane, + if (kplane) { + plane->possible_crtcs = kplane->possible_crtcs; + plane->plane_id = kplane->plane_id; ++ plane->crtc_id = kplane->crtc_id; + + props = drmModeObjectGetProperties(b->drm.fd, kplane->plane_id, + DRM_MODE_OBJECT_PLANE); +@@ -4097,6 +4099,7 @@ drm_plane_create(struct drm_backend *b, const drmModePlane *kplane, + else { + plane->possible_crtcs = (1 << output->pipe); + plane->plane_id = 0; ++ plane->crtc_id = 0; + plane->count_formats = 1; + plane->formats[0].format = format; + plane->type = type; +@@ -4157,6 +4160,7 @@ drm_output_find_special_plane(struct drm_backend *b, struct drm_output *output, + enum wdrm_plane_type type) + { + struct drm_plane *plane; ++ struct drm_plane *plane2 = NULL; /* secondary plane */ + + if (!b->universal_planes) { + uint32_t format; +@@ -4204,11 +4208,22 @@ drm_output_find_special_plane(struct drm_backend *b, struct drm_output *output, + if (found_elsewhere) + continue; + ++ /* The output should keep the primary plane connected to its ++ * crtc since the direct switching of active plane is not ++ * allowed. */ ++ if ((type == WDRM_PLANE_TYPE_PRIMARY) && ++ (plane->crtc_id != output->crtc_id)) { ++ if (plane->crtc_id == 0) { ++ plane->possible_crtcs = (1 << output->pipe); ++ plane2 = plane; ++ } ++ continue; ++ } + plane->possible_crtcs = (1 << output->pipe); + return plane; + } + +- return NULL; ++ return plane2; + } + + /** +-- +1.9.1 + diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston_%.bbappend b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston_%.bbappend deleted file mode 100644 index 718d6f86..00000000 --- a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston_%.bbappend +++ /dev/null @@ -1,25 +0,0 @@ -# When configured for fbdev compositor, make it the default -PACKAGECONFIG[fbdev] = "--enable-fbdev-compositor WESTON_NATIVE_BACKEND="fbdev-backend.so",--disable-fbdev-compositor,udev mtdev" -PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm udev virtual/libgbm mtdev" - -PR_append = ".agl_arago_23" - -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -RDEPENDS_${PN} += "weston-conf" - -####################### F I X M E ########################## -DISABLED_SRC_URI += " \ - file://0001-Add-soc-performance-monitor-utilites.patch \ -" -####################### F I X M E ########################## - -SRC_URI += " \ - file://0001-FIX-weston-clients-typo-in-simple-dmabuf-egl.c.patch \ - file://0002-Weston-Allow-visual_id-to-be-0.patch \ - file://0003-Weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch \ - file://0004-Weston-Fix-touch-screen-crash-issue.patch \ -" - - -RDEPENDS_${PN}_remove = "weston-conf" diff --git a/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston_8.0.0.bbappend b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston_8.0.0.bbappend new file mode 100644 index 00000000..21c912a6 --- /dev/null +++ b/meta-agl/meta-agl-bsp/meta-ti/recipes-arago/weston/weston_8.0.0.bbappend @@ -0,0 +1,13 @@ +PACKAGECONFIG[kms] = "-Dbackend-drm=true,-Dbackend-drm=false,drm udev virtual/libgbm mtdev" + +PR_append = ".arago2" + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +# file://0005-weston-drm-fix-dual-display-issue.patch +SRC_URI += " \ + file://0003-weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch \ + file://0004-weston-Fix-touch-screen-crash-issue.patch \ +" + +INHIBIT_PACKAGE_STRIP = "1" diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/opencv/opencv/0004-Change-Max-Device-Count-To-16.patch b/meta-agl/meta-agl-bsp/recipes-graphics/opencv/opencv/0004-Change-Max-Device-Count-To-16.patch index fb574847..2ad367c8 100644 --- a/meta-agl/meta-agl-bsp/recipes-graphics/opencv/opencv/0004-Change-Max-Device-Count-To-16.patch +++ b/meta-agl/meta-agl-bsp/recipes-graphics/opencv/opencv/0004-Change-Max-Device-Count-To-16.patch @@ -1,26 +1,13 @@ -diff --git a/modules/videoio/src/cap_libv4l.cpp b/modules/videoio/src/cap_libv4l.cpp -index d82ad43..a3929a6 100644 ---- a/modules/videoio/src/cap_libv4l.cpp -+++ b/modules/videoio/src/cap_libv4l.cpp -@@ -271,7 +271,7 @@ make & enjoy! - #define DEFAULT_V4L_HEIGHT 480 - - #define CHANNEL_NUMBER 1 --#define MAX_CAMERAS 8 -+#define MAX_CAMERAS 16 - - - // default and maximum number of V4L buffers, not including last, 'special' buffer diff --git a/modules/videoio/src/cap_v4l.cpp b/modules/videoio/src/cap_v4l.cpp -index 37d93cd..6b4321c 100644 +index c36a619a56..0040e4574e 100644 --- a/modules/videoio/src/cap_v4l.cpp +++ b/modules/videoio/src/cap_v4l.cpp -@@ -241,7 +241,7 @@ make & enjoy! +@@ -256,7 +256,7 @@ make & enjoy! + #define DEFAULT_V4L_HEIGHT 480 #define DEFAULT_V4L_FPS 30 - - #define CHANNEL_NUMBER 1 + -#define MAX_CAMERAS 8 +#define MAX_CAMERAS 16 - - + // default and maximum number of V4L buffers, not including last, 'special' buffer + #define MAX_V4L_BUFFERS 10 diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/opencv/opencv_3.%.bbappend b/meta-agl/meta-agl-bsp/recipes-graphics/opencv/opencv_3.%.bbappend deleted file mode 100644 index 8a68b064..00000000 --- a/meta-agl/meta-agl-bsp/recipes-graphics/opencv/opencv_3.%.bbappend +++ /dev/null @@ -1,5 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -SRC_URI += " \ - file://0004-Change-Max-Device-Count-To-16.patch \ - " diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/opencv/opencv_4.%.bbappend b/meta-agl/meta-agl-bsp/recipes-graphics/opencv/opencv_4.%.bbappend new file mode 100644 index 00000000..8a68b064 --- /dev/null +++ b/meta-agl/meta-agl-bsp/recipes-graphics/opencv/opencv_4.%.bbappend @@ -0,0 +1,5 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += " \ + file://0004-Change-Max-Device-Count-To-16.patch \ + " diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/wayland-protocols_1.17.bb b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/wayland-protocols_1.17.bb deleted file mode 100644 index ee9e3d43..00000000 --- a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/wayland-protocols_1.17.bb +++ /dev/null @@ -1,24 +0,0 @@ -SUMMARY = "Collection of additional Wayland protocols" -DESCRIPTION = "Wayland protocols that add functionality not \ -available in the Wayland core protocol. Such protocols either add \ -completely new functionality, or extend the functionality of some other \ -protocol either in Wayland core, or some other protocol in \ -wayland-protocols." -HOMEPAGE = "http://wayland.freedesktop.org" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://COPYING;md5=c7b12b6702da38ca028ace54aae3d484 \ - file://stable/presentation-time/presentation-time.xml;endline=26;md5=4646cd7d9edc9fa55db941f2d3a7dc53" - -SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ - " -SRC_URI[md5sum] = "e0b523ff162e30bab46be1d65d527683" -SRC_URI[sha256sum] = "6b1485951fdcd36a960c870c46f28b03a3e5121fb46246916333ed07f78c98c5" -SRC_URI[md5sum] = "55ddd5fdb02b73b9de9559aaec267315" -SRC_URI[sha256sum] = "df1319cf9705643aea9fd16f9056f4e5b2471bd10c0cc3713d4a4cdc23d6812f" - -UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html" - -inherit allarch autotools pkgconfig - -PACKAGES = "${PN}" -FILES_${PN} += "${datadir}/pkgconfig/wayland-protocols.pc" diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bb b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bb index 4628f96f..14fbd027 100644 --- a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bb +++ b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bb @@ -3,8 +3,6 @@ LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" SRC_URI = "file://core.cfg \ - file://ivishell.cfg \ - file://id-agent.cfg \ file://shell.cfg \ file://hdmi-a-1-270.cfg \ " diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bbappend index 00cd35b3..671fa171 100644 --- a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bbappend +++ b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bbappend @@ -2,11 +2,4 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" PACKAGE_ARCH = "${MACHINE_ARCH}" -SRC_URI += "${@bb.utils.contains("DISTRO_FEATURES", "gst-record", "file://virtualoutput.cfg", "",d)}" - -do_configure_append() { - if ${@bb.utils.contains('DISTRO_FEATURES', 'gst-record', 'true', 'false', d)}; then - echo virtual=1 >> ${WORKDIR}/core.cfg - fi -} - +SRC_URI += "${@bb.utils.contains("DISTRO_FEATURES", "weston-remoting", "file://remote-output.cfg", "",d)}" diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/core.cfg b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/core.cfg index eb5d470e..90774ed7 100644 --- a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/core.cfg +++ b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/core.cfg @@ -1,5 +1,4 @@ [core] -shell=ivi-shell.so backend=drm-backend.so require-input=false -modules=systemd-notify.so,ivi-controller.so +modules=systemd-notify.so diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/id-agent.cfg b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/id-agent.cfg deleted file mode 100644 index c8529925..00000000 --- a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/id-agent.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[desktop-app-default] -default-surface-id=2000000 -default-surface-id-max=2001000 diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/ivishell.cfg b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/ivishell.cfg deleted file mode 100644 index d0bcb833..00000000 --- a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/ivishell.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[ivi-shell] -ivi-input-module=ivi-input-controller.so -ivi-id-agent-module=ivi-id-agent.so diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/remote-output.cfg b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/remote-output.cfg new file mode 100644 index 00000000..f69a2e09 --- /dev/null +++ b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/remote-output.cfg @@ -0,0 +1,5 @@ +[remote-output] +name=remote-1 +mode=640x720@30 +host=192.168.20.99 +port=5005 diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/virtualoutput.cfg b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/virtualoutput.cfg deleted file mode 100644 index f69a2e09..00000000 --- a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf/virtualoutput.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[remote-output] -name=remote-1 -mode=640x720@30 -host=192.168.20.99 -port=5005 diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/0001-make-error-portable.patch b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/0001-make-error-portable.patch deleted file mode 100644 index 0eb3d95a..00000000 --- a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/0001-make-error-portable.patch +++ /dev/null @@ -1,78 +0,0 @@ -From c4677e155736062e75687f1a655732c8902e912b Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Fri, 29 May 2015 20:56:00 -0700 -Subject: [PATCH] make error() portable - -error() is not posix but gnu extension so may not be available on all -kind of systemsi e.g. musl. - -Upstream-Status: Submitted - -Signed-off-by: Khem Raj - ---- - configure.ac | 2 ++ - libweston/weston-error.h | 20 ++++++++++++++++++++ - libweston/weston-launch.c | 2 +- - 3 files changed, 23 insertions(+), 1 deletion(-) - create mode 100644 libweston/weston-error.h - -diff --git a/configure.ac b/configure.ac -index c05ad01..6da6e04 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -126,6 +126,8 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[], - [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile weston")], - [[#include ]]) - -+AC_CHECK_HEADERS([error.h]) -+ - AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate]) - - # check for libdrm as a build-time dependency only -diff --git a/libweston/weston-error.h b/libweston/weston-error.h -new file mode 100644 -index 0000000..2089d02 ---- /dev/null -+++ b/libweston/weston-error.h -@@ -0,0 +1,20 @@ -+#ifndef _WESTON_ERROR_H -+#define _WESTON_ERROR_H -+ -+#if defined(HAVE_ERROR_H) -+#include -+#else -+#include -+#include -+#define _weston_error(S, E, F, ...) do { \ -+ if (E) \ -+ err(S, F ": %s", ##__VA_ARGS__, strerror(E)); \ -+ else \ -+ err(S, F, ##__VA_ARGS__); \ -+} while(0) -+ -+#define error _weston_error -+#endif -+ -+#endif -+ -diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c -index bf73e0d..9064439 100644 ---- a/libweston/weston-launch.c -+++ b/libweston/weston-launch.c -@@ -33,7 +33,6 @@ - #include - #include - --#include - #include - - #include -@@ -59,6 +58,7 @@ - #endif - - #include "weston-launch.h" -+#include "weston-error.h" - - #define DRM_MAJOR 226 - diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch deleted file mode 100644 index d648538b..00000000 --- a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch +++ /dev/null @@ -1,173 +0,0 @@ -From b98b9dbda902225cdd972b5bff6a641c36cc7e90 Mon Sep 17 00:00:00 2001 -From: Tom Hochstein -Date: Wed, 22 Feb 2017 15:53:30 +0200 -Subject: [PATCH] weston-launch: Provide a default version that doesn't require PAM - -weston-launch requires PAM for starting weston as a non-root user. - -Since starting weston as root is a valid use case by itself, if -PAM is not available, provide a default version of weston-launch -without non-root-user support. - -Upstream-Status: Pending - -Signed-off-by: Tom Hochstein -Signed-off-by: Jussi Kukkonen -Signed-off-by: Denys Dmytriyenko - ---- - configure.ac | 9 +++++++-- - libweston/weston-launch.c | 20 ++++++++++++++++++++ - 2 files changed, 27 insertions(+), 2 deletions(-) - -diff --git a/configure.ac b/configure.ac -index dc9c802..48cf5cb 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -451,13 +451,17 @@ AC_ARG_ENABLE(resize-optimization, - AS_IF([test "x$enable_resize_optimization" = "xyes"], - [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])]) - -+AC_ARG_WITH(pam, -+ AS_HELP_STRING([--with-pam], [Use PAM]), -+ [use_pam=$withval], [use_pam=yes]) - AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes) - AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch = xyes) --if test x$enable_weston_launch = xyes; then -+if test x$enable_weston_launch = xyes -a x$use_pam = xyes; then - WESTON_SEARCH_LIBS([PAM], [pam], [pam_open_session], [have_pam=yes], [have_pam=no]) - if test x$have_pam = xno; then -- AC_ERROR([weston-launch requires pam]) -+ AC_ERROR([PAM support is explicitly requested, but libpam couldn't be found]) - fi -+ AC_DEFINE([HAVE_PAM], [1], [Define if PAM is available]) - fi - - AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes") -@@ -702,6 +706,7 @@ AC_MSG_RESULT([ - Enable developer documentation ${enable_devdocs} - - weston-launch utility ${enable_weston_launch} -+ PAM support ${use_pam} - systemd-login support ${have_systemd_login} - systemd notify support ${enable_systemd_notify} - -diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c -index 166bf3b..6fb9232 100644 ---- a/libweston/weston-launch.c -+++ b/libweston/weston-launch.c -@@ -51,7 +51,9 @@ - - #include - #include -+#ifdef HAVE_PAM - #include -+#endif - - #ifdef HAVE_SYSTEMD_LOGIN - #include -@@ -101,8 +103,10 @@ drmSetMaster(int drm_fd) - #endif - - struct weston_launch { -+#ifdef HAVE_PAM - struct pam_conv pc; - pam_handle_t *ph; -+#endif - int tty; - int ttynr; - int sock[2]; -@@ -189,6 +193,7 @@ weston_launch_allowed(struct weston_launch *wl) - return false; - } - -+#ifdef HAVE_PAM - static int - pam_conversation_fn(int msg_count, - const struct pam_message **messages, -@@ -229,6 +234,7 @@ setup_pam(struct weston_launch *wl) - - return 0; - } -+#endif - - static int - setup_launcher_socket(struct weston_launch *wl) -@@ -422,6 +428,7 @@ quit(struct weston_launch *wl, int status) - close(wl->signalfd); - close(wl->sock[0]); - -+#ifdef HAVE_PAM - if (wl->new_user) { - err = pam_close_session(wl->ph, 0); - if (err) -@@ -429,6 +436,7 @@ quit(struct weston_launch *wl, int status) - err, pam_strerror(wl->ph, err)); - pam_end(wl->ph, err); - } -+#endif - - if (ioctl(wl->tty, KDSKBMUTE, 0) && - ioctl(wl->tty, KDSKBMODE, wl->kb_mode)) -@@ -608,6 +616,7 @@ setup_session(struct weston_launch *wl, char **child_argv) - setenv("HOME", wl->pw->pw_dir, 1); - setenv("SHELL", wl->pw->pw_shell, 1); - -+#ifdef HAVE_PAM - env = pam_getenvlist(wl->ph); - if (env) { - for (i = 0; env[i]; ++i) { -@@ -616,6 +625,7 @@ setup_session(struct weston_launch *wl, char **child_argv) - } - free(env); - } -+#endif - - /* - * We open a new session, so it makes sense -@@ -683,8 +693,10 @@ static void - help(const char *name) - { - fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n", name); -+#ifdef HAVE_PAM - fprintf(stderr, " -u, --user Start session as specified username,\n" - " e.g. -u joe, requires root.\n"); -+#endif - fprintf(stderr, " -t, --tty Start session on alternative tty,\n" - " e.g. -t /dev/tty4, requires -u option.\n"); - fprintf(stderr, " -v, --verbose Be verbose\n"); -@@ -698,7 +710,9 @@ main(int argc, char *argv[]) - int i, c; - char *tty = NULL; - struct option opts[] = { -+#ifdef HAVE_PAM - { "user", required_argument, NULL, 'u' }, -+#endif - { "tty", required_argument, NULL, 't' }, - { "verbose", no_argument, NULL, 'v' }, - { "help", no_argument, NULL, 'h' }, -@@ -710,9 +724,13 @@ main(int argc, char *argv[]) - while ((c = getopt_long(argc, argv, "u:t:vh", opts, &i)) != -1) { - switch (c) { - case 'u': -+#ifdef HAVE_PAM - wl.new_user = optarg; - if (getuid() != 0) - error(1, 0, "Permission denied. -u allowed for root only"); -+#else -+ error(1, 0, "-u is unsupported in this weston-launch build"); -+#endif - break; - case 't': - tty = optarg; -@@ -753,8 +771,10 @@ main(int argc, char *argv[]) - if (setup_tty(&wl, tty) < 0) - exit(EXIT_FAILURE); - -+#ifdef HAVE_PAM - if (wl.new_user && setup_pam(&wl) < 0) - exit(EXIT_FAILURE); -+#endif - - if (setup_launcher_socket(&wl) < 0) - exit(EXIT_FAILURE); diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/weston.desktop b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/weston.desktop deleted file mode 100644 index 1086ae8b..00000000 --- a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/weston.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Type=Application -Name=Weston -Comment=Wayland Compostitor -Exec=weston -Icon=weston -Terminal=false -Categories=Utility; diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/weston.png b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/weston.png deleted file mode 100644 index ea8b7e0e..00000000 Binary files a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/weston.png and /dev/null differ diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/xwayland.weston-start b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/xwayland.weston-start deleted file mode 100644 index b483c97c..00000000 --- a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston/xwayland.weston-start +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -if type Xwayland >/dev/null 2>/dev/null; then - mkdir -p /tmp/.X11-unix - - add_weston_argument "--modules=xwayland.so" -fi diff --git a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston_6.0.0.bb b/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston_6.0.0.bb deleted file mode 100644 index ca554388..00000000 --- a/meta-agl/meta-agl-bsp/recipes-graphics/wayland/weston_6.0.0.bb +++ /dev/null @@ -1,111 +0,0 @@ -SUMMARY = "Weston, a Wayland compositor" -DESCRIPTION = "Weston is the reference implementation of a Wayland compositor" -HOMEPAGE = "http://wayland.freedesktop.org" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \ - file://libweston/compositor.c;endline=27;md5=6c53bbbd99273f4f7c4affa855c33c0a" - -SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ - file://weston.png \ - file://weston.desktop \ - file://0001-make-error-portable.patch \ - file://xwayland.weston-start \ - file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \ -" -SRC_URI[md5sum] = "752a04ce3c65af4884cfac4e57231bdb" -SRC_URI[sha256sum] = "15a23423bcfa45e31e1dedc0cd524ba71e2930df174fde9c99b71a537c4e4caf" -SRC_URI[md5sum] = "7c634e262f8a464a076c97fd50ad36b3" -SRC_URI[sha256sum] = "546323a90607b3bd7f48809ea9d76e64cd09718102f2deca6d95aa59a882e612" - -UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html" - -inherit autotools pkgconfig useradd distro_features_check -# depends on virtual/egl -REQUIRED_DISTRO_FEATURES = "opengl" - -DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0 jpeg" -DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native" - -WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}" - -EXTRA_OECONF = "--enable-setuid-install \ - --disable-rdp-compositor \ - --enable-autotools \ - " -PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \ - ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd x11', d)} \ - clients launch" -# -# Compositor choices -# -# Weston on KMS -PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm udev virtual/egl virtual/libgles2 virtual/libgbm mtdev" -# Weston on Wayland (nested Weston) -PACKAGECONFIG[wayland] = "--enable-wayland-compositor,--disable-wayland-compositor,virtual/egl virtual/libgles2" -# Weston on X11 -PACKAGECONFIG[x11] = "--enable-x11-compositor,--disable-x11-compositor,virtual/libx11 libxcb libxcb libxcursor cairo" -# Headless Weston -PACKAGECONFIG[headless] = "--enable-headless-compositor,--disable-headless-compositor" -# Weston on framebuffer -PACKAGECONFIG[fbdev] = "--enable-fbdev-compositor,--disable-fbdev-compositor,udev mtdev" -# weston-launch -PACKAGECONFIG[launch] = "--enable-weston-launch,--disable-weston-launch,drm" -# VA-API desktop recorder -PACKAGECONFIG[vaapi] = "--enable-vaapi-recorder,--disable-vaapi-recorder,libva" -# Weston with EGL support -PACKAGECONFIG[egl] = "--enable-egl --enable-simple-egl-clients,--disable-egl --disable-simple-egl-clients,virtual/egl" -# Weston with cairo glesv2 support -PACKAGECONFIG[cairo-glesv2] = "--with-cairo-glesv2,--with-cairo=image,cairo" -# Weston with lcms support -PACKAGECONFIG[lcms] = "--enable-lcms,--disable-lcms,lcms" -# Weston with webp support -PACKAGECONFIG[webp] = "--with-webp,--without-webp,libwebp" -# Weston with systemd-login support -PACKAGECONFIG[systemd] = "--enable-systemd-login,--disable-systemd-login,systemd dbus" -# Weston with Xwayland support (requires X11 and Wayland) -PACKAGECONFIG[xwayland] = "--enable-xwayland,--disable-xwayland" -# colord CMS support -PACKAGECONFIG[colord] = "--enable-colord,--disable-colord,colord" -# Clients support -PACKAGECONFIG[clients] = "--enable-clients --enable-simple-clients --enable-demo-clients-install,--disable-clients --disable-simple-clients" -# Weston with PAM support -PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam" - -do_install_append() { - # Weston doesn't need the .la files to load modules, so wipe them - rm -f ${D}/${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.la - - # If X11, ship a desktop file to launch it - if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then - install -d ${D}${datadir}/applications - install ${WORKDIR}/weston.desktop ${D}${datadir}/applications - - install -d ${D}${datadir}/icons/hicolor/48x48/apps - install ${WORKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps - fi - - if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then - install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland - fi -} - -PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '${PN}-xwayland', '', d)} \ - libweston-${WESTON_MAJOR_VERSION} ${PN}-examples" - -FILES_${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so ${datadir}" - -FILES_libweston-${WESTON_MAJOR_VERSION} = "${libdir}/lib*${SOLIBS} ${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.so" -SUMMARY_libweston-${WESTON_MAJOR_VERSION} = "Helper library for implementing 'wayland window managers'." - -FILES_${PN}-examples = "${bindir}/*" - -FILES_${PN}-xwayland = "${libdir}/libweston-${WESTON_MAJOR_VERSION}/xwayland.so" -RDEPENDS_${PN}-xwayland += "xserver-xorg-xwayland" - -RDEPENDS_${PN} += "xkeyboard-config" -RRECOMMENDS_${PN} = "weston-conf liberation-fonts" -RRECOMMENDS_${PN}-dev += "wayland-protocols" - -USERADD_PACKAGES = "${PN}" -GROUPADD_PARAM_${PN} = "--system weston-launch" diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-4.9/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-4.9/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch deleted file mode 100644 index a1eeac3d..00000000 --- a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-4.9/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch +++ /dev/null @@ -1,49 +0,0 @@ -From c8bbb0f916de54610513e376070aea531af19dd6 Mon Sep 17 00:00:00 2001 -From: jooseong lee -Date: Thu, 3 Nov 2016 10:55:43 +0100 -Subject: [PATCH 4/4] Smack: Assign smack_known_web label for kernel thread's -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Assign smack_known_web label for kernel thread's socket in the sk_alloc_security hook - -Creating struct sock by sk_alloc function in various kernel subsystems -like bluetooth dosen't call smack_socket_post_create(). In such case, -received sock label is the floor('_') label and makes access deny. - -Refers-to: https://review.tizen.org/gerrit/#/c/80717/4 - -Change-Id: I2e5c9359bfede84a988fd4d4d74cdb9dfdfc52d8 -Signed-off-by: jooseong lee -Signed-off-by: José Bollo ---- - security/smack/smack_lsm.c | 12 ++++++++++-- - 1 file changed, 10 insertions(+), 2 deletions(-) - -diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c -index cf8a93f..21651bc 100644 ---- a/security/smack/smack_lsm.c -+++ b/security/smack/smack_lsm.c -@@ -2321,8 +2321,16 @@ static int smack_sk_alloc_security(struct sock *sk, int family, gfp_t gfp_flags) - if (ssp == NULL) - return -ENOMEM; - -- ssp->smk_in = skp; -- ssp->smk_out = skp; -+ /* -+ * Sockets created by kernel threads receive web label. -+ */ -+ if (unlikely(current->flags & PF_KTHREAD)) { -+ ssp->smk_in = &smack_known_web; -+ ssp->smk_out = &smack_known_web; -+ } else { -+ ssp->smk_in = skp; -+ ssp->smk_out = skp; -+ } - ssp->smk_packet = NULL; - - sk->sk_security = ssp; --- -2.7.4 - diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl-4.14.inc b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl-4.14.inc index 8521b1d6..6d5c6702 100644 --- a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl-4.14.inc +++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl-4.14.inc @@ -10,4 +10,5 @@ SRC_URI_append_with-lsm-smack = "\ SRC_URI_append = "\ file://net-sch_generic-add-if_afp.h-header-to-get-ARPHRD_CA.patch \ + file://net-sch_generic-Use-pfifo_fast-as-fallback-scheduler.patch \ " diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl-4.19.inc b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl-4.19.inc new file mode 100644 index 00000000..da4e0c06 --- /dev/null +++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl-4.19.inc @@ -0,0 +1,5 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/linux-4.19:" + +SRC_URI_append = "\ + file://net-sch_generic-Use-pfifo_fast-as-fallback-scheduler.patch \ + " diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl-4.9.inc b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl-4.9.inc deleted file mode 100644 index c4ebf4d4..00000000 --- a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl-4.9.inc +++ /dev/null @@ -1,8 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/linux-4.9:" - -#------------------------------------------------------------------------- -# smack patches for handling bluetooth - -SRC_URI_append_with-lsm-smack = "\ - file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \ - " diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl.inc b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl.inc index 7e801e0a..9c3976aa 100644 --- a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl.inc +++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux-agl.inc @@ -2,12 +2,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/linux:" DEPENDS += "kern-tools-native" -# canbus qdisc pfifo change -SRC_URI_append = " file://net-sch_generic-Use-pfifo_fast-as-fallback-scheduler.patch" - -# bbe target has this upstream patch already -SRC_URI_remove_bbe = " file://net-sch_generic-Use-pfifo_fast-as-fallback-scheduler.patch" - # returns all the elements from the src uri that are .cfg files def find_cfgs(d): sources=src_patches(d, True) @@ -20,6 +14,9 @@ def find_cfgs(d): do_configure_append () { [ ! -f .config ] && cp -a ${WORKDIR}/defconfig .config + # Need to clear CONFIG_LSM for 5.1+ kernels to ensure it'll get + # regenerated to reflect configuration changes (e.g. SMACK). + sed -i '/^CONFIG_LSM/d' .config merge_config.sh -m .config ${@" ".join(find_cfgs(d))} yes '' | make oldconfig } @@ -36,10 +33,13 @@ SRC_URI_append = "\ file://drm.cfg \ file://btusb.cfg \ file://usbaudio.cfg \ - file://usbmodem.cfg \ - file://i2c-led.cfg \ - file://nfc.cfg \ - " + file://usbmodem.cfg \ + file://i2c-led.cfg \ + file://nfc.cfg \ + " + +SRC_URI_append = " ${@bb.utils.contains('AGL_XEN_GUEST_WANTED','1','file://xen_domu.cfg','',d)}" + KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/can-bus.cfg" # Enable support for usb video class for usb camera devices KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/uvc.cfg" @@ -58,15 +58,17 @@ KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/usbaudio.cfg" KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/i2c-led.cfg" # Enable NFC devices KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/nfc.cfg" +# Enable XEN support of the guest +KERNEL_CONFIG_FRAGMENTS_append = " ${@bb.utils.contains('AGL_XEN_GUEST_WANTED','1','${WORKDIR}/xen_domu.cfg','',d)}" # Enable required features for the agl-netboot feature SRC_URI_append_netboot = " file://nbd.cfg \ file://ramdisk.cfg" KERNEL_CONFIG_FRAGMENTS_append_netboot = " ${WORKDIR}/nbd.cfg ${WORKDIR}/ramdisk.cfg" -# Enable support for TP-Link TL-W722N USB Wifi adapter -SRC_URI_append = " file://ath9k_htc.cfg" -KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/ath9k_htc.cfg" +# Enable support for TP-Link TL-W722N USB Wifi adapter (rev 1 and 2) +SRC_URI_append = " file://wifi.cfg" +KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/wifi.cfg" # Enable support for RTLSDR SRC_URI_append = " file://rtl_sdr.cfg" @@ -79,6 +81,22 @@ OVERRIDES_prepend_qemux86-64 = "virtualmachine:" SRC_URI_append_virtualmachine = " file://vbox-vmware-sata.cfg" KERNEL_CONFIG_FRAGMENTS_append_virtualmachine = " ${WORKDIR}/vbox-vmware-sata.cfg" +# Extra configuration for using qemux86-64 image on physical hardware +SRC_URI_append_qemux86-64 = "\ + file://x86-extra-graphic-devices.cfg \ + file://x86-net-devices.cfg \ + file://x86-security-tpm.cfg \ + file://x86-usb-devices.cfg \ + file://x86-upsquare.cfg \ +" +KERNEL_CONFIG_FRAGMENTS_append_qemux86-64 = "\ + ${WORKDIR}/x86-extra-graphic-devices.cfg \ + ${WORKDIR}/x86-net-devices.cfg \ + ${WORKDIR}/x86-security-tpm.cfg \ + ${WORKDIR}/x86-usb-devices.cfg \ + ${WORKDIR}/x86-upsquare.cfg \ +" + # Enable support for smack KERNEL_CONFIG_FRAGMENTS_append_with-lsm-smack = "\ ${WORKDIR}/audit.cfg \ @@ -101,3 +119,7 @@ KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/rtc.cfg" # netfilter options SRC_URI_append = " file://netfilter.cfg" KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/netfilter.cfg" + +# Enable support for SystemTap +SRC_URI_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'agl-devel', 'file://systemtap.cfg', '', d)}" +KERNEL_CONFIG_FRAGMENTS_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'agl-devel', '${WORKDIR}/systemtap.cfg', '', d)}" diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/ath9k_htc.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/ath9k_htc.cfg deleted file mode 100644 index ff12e6da..00000000 --- a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/ath9k_htc.cfg +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG_CFG80211=m -CONFIG_MAC80211=m -CONFIG_WLAN_VENDOR_ATH=m -CONFIG_ATH9K_HTC=m diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/can-bus.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/can-bus.cfg index 57e25fc6..2f24b760 100644 --- a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/can-bus.cfg +++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/can-bus.cfg @@ -7,6 +7,7 @@ CONFIG_CAN=m CONFIG_CAN_RAW=m CONFIG_CAN_BCM=m CONFIG_CAN_GW=m +CONFIG_CAN_J1939=m # # CAN Device Drivers diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/systemtap.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/systemtap.cfg new file mode 100644 index 00000000..4886c27f --- /dev/null +++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/systemtap.cfg @@ -0,0 +1,9 @@ +CONFIG_KPROBES=y +CONFIG_UPROBES=y +CONFIG_UPROBE_EVENTS=y +CONFIG_FTRACE=y +CONFIG_KPROBE_EVENTS=y +CONFIG_RELAY=y +CONFIG_DEBUG_FS=y +CONFIG_DEBUG_INFO=y + diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/wifi.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/wifi.cfg new file mode 100644 index 00000000..00c2e06e --- /dev/null +++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/wifi.cfg @@ -0,0 +1,6 @@ +CONFIG_CFG80211=m +CONFIG_MAC80211=m +CONFIG_WLAN_VENDOR_ATH=m +CONFIG_ATH9K_HTC=m +CONFIG_STAGING=y +CONFIG_R8188EU=m diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/x86-extra-graphic-devices.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/x86-extra-graphic-devices.cfg new file mode 100644 index 00000000..d2b64de6 --- /dev/null +++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/x86-extra-graphic-devices.cfg @@ -0,0 +1,40 @@ +CONFIG_MWIFIEX_PCIE=m +CONFIG_MWIFIEX_USB=m +CONFIG_RSI_91X=m +CONFIG_RSI_DEBUGFS=y +CONFIG_RSI_SDIO=m +CONFIG_RSI_USB=m +CONFIG_DRM_RADEON=m +CONFIG_DRM_RADEON_USERPTR=y +CONFIG_DRM_NOUVEAU=m +CONFIG_NOUVEAU_DEBUG=5 +CONFIG_NOUVEAU_DEBUG_DEFAULT=3 +CONFIG_DRM_NOUVEAU_BACKLIGHT=y +CONFIG_DRM_VGEM=m +CONFIG_DRM_VMWGFX=m +CONFIG_DRM_VMWGFX_FBCON=y +CONFIG_DRM_GMA500=m +CONFIG_DRM_GMA600=y +CONFIG_DRM_GMA3600=y +CONFIG_DRM_UDL=m +CONFIG_FB_DEFERRED_IO=y +CONFIG_FB_BACKLIGHT=y +CONFIG_IRQ_BYPASS_MANAGER=m +CONFIG_ACPI_WMI=m +CONFIG_MXM_WMI=m +CONFIG_SCHED_INFO=y +CONFIG_HAVE_KVM_IRQCHIP=y +CONFIG_HAVE_KVM_IRQFD=y +CONFIG_HAVE_KVM_IRQ_ROUTING=y +CONFIG_HAVE_KVM_EVENTFD=y +CONFIG_KVM_MMIO=y +CONFIG_KVM_ASYNC_PF=y +CONFIG_HAVE_KVM_MSI=y +CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y +CONFIG_KVM_VFIO=y +CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y +CONFIG_KVM_COMPAT=y +CONFIG_HAVE_KVM_IRQ_BYPASS=y +CONFIG_KVM=m +CONFIG_KVM_INTEL=m +CONFIG_CRC7=m diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/x86-net-devices.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/x86-net-devices.cfg new file mode 100644 index 00000000..6c5b698a --- /dev/null +++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/x86-net-devices.cfg @@ -0,0 +1,3 @@ +CONFIG_IGB=y +CONFIG_IGB_DCA=y +CONFIG_R8169=y diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/x86-security-tpm.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/x86-security-tpm.cfg new file mode 100644 index 00000000..b66b1b9b --- /dev/null +++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/x86-security-tpm.cfg @@ -0,0 +1,3 @@ +CONFIG_TCG_TPM=y +CONFIG_TCG_TIS=y +CONFIG_TCG_CRB=y diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/x86-upsquare.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/x86-upsquare.cfg new file mode 100644 index 00000000..d2bed63f --- /dev/null +++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/x86-upsquare.cfg @@ -0,0 +1,11 @@ +CONFIG_X86_INTEL_LPSS=y +CONFIG_EXPERT=y +CONFIG_SERIAL_8250_DMA=y +CONFIG_SERIAL_8250_DW=y +CONFIG_MFD_CORE=y +CONFIG_MFD_INTEL_LPSS=y +CONFIG_MFD_INTEL_LPSS_ACPI=y +CONFIG_MFD_INTEL_LPSS_PCI=y +CONFIG_IWLWIFI=m +CONFIG_IWLMVM=m +CONFIG_IWLDVM=m diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/x86-usb-devices.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/x86-usb-devices.cfg new file mode 100644 index 00000000..19c57796 --- /dev/null +++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/x86-usb-devices.cfg @@ -0,0 +1,82 @@ +CONFIG_BT_QCA=m +CONFIG_BT_HCIBTSDIO=m +CONFIG_BT_HCIUART=m +CONFIG_BT_HCIUART_BCSP=y +CONFIG_BT_HCIUART_ATH3K=y +CONFIG_BT_HCIUART_LL=y +CONFIG_BT_HCIUART_3WIRE=y +CONFIG_BT_HCIUART_BCM=y +CONFIG_BT_HCIUART_QCA=y +CONFIG_BT_HCIBCM203X=m +CONFIG_BT_HCIBPA10X=m +CONFIG_BT_HCIBFUSB=m +CONFIG_BT_HCIVHCI=m +CONFIG_BT_MRVL=m +CONFIG_BT_MRVL_SDIO=m +CONFIG_BT_ATH3K=m +CONFIG_WIRELESS_EXT=y +CONFIG_WEXT_SPY=y +CONFIG_WEXT_PRIV=y +CONFIG_CFG80211_WEXT_EXPORT=y +CONFIG_LIB80211=m +CONFIG_LIB80211_CRYPT_WEP=m +CONFIG_LIB80211_CRYPT_CCMP=m +CONFIG_LIB80211_CRYPT_TKIP=m +# CONFIG_LIB80211_DEBUG is not set +CONFIG_VHOST_NET=m +CONFIG_VHOST_RING=m +CONFIG_VHOST=m +CONFIG_MICROCHIP_PHY=m +CONFIG_USB_CATC=m +CONFIG_USB_KAWETH=m +CONFIG_USB_PEGASUS=m +CONFIG_USB_RTL8152=m +CONFIG_USB_LAN78XX=m +CONFIG_USB_NET_SR9800=m +CONFIG_USB_NET_RNDIS_HOST=m +CONFIG_USB_HSO=m +CONFIG_USB_IPHETH=m +CONFIG_USB_ZD1201=m +CONFIG_USB_NET_RNDIS_WLAN=m +CONFIG_RTL8180=m +CONFIG_RTL8187=m +CONFIG_RTL8187_LEDS=y +CONFIG_MWL8K=m +# CONFIG_B43_BUSES_BCMA_AND_SSB is not set +# CONFIG_B43_BUSES_BCMA is not set +# CONFIG_B43_BUSES_SSB is not set +CONFIG_BRCMFMAC_PROTO_MSGBUF=y +CONFIG_BRCMFMAC_PCIE=y +CONFIG_IPW2100=m +CONFIG_IPW2100_MONITOR=y +CONFIG_IPW2100_DEBUG=y +CONFIG_IPW2200=m +CONFIG_IPW2200_MONITOR=y +CONFIG_IPW2200_RADIOTAP=y +CONFIG_IPW2200_PROMISCUOUS=y +CONFIG_IPW2200_QOS=y +CONFIG_IPW2200_DEBUG=y +CONFIG_LIBIPW=m +CONFIG_LIBIPW_DEBUG=y +CONFIG_LIBERTAS=m +CONFIG_LIBERTAS_USB=m +CONFIG_LIBERTAS_SDIO=m +CONFIG_LIBERTAS_SPI=m +# CONFIG_LIBERTAS_DEBUG is not set +# CONFIG_LIBERTAS_MESH is not set +CONFIG_RTL8XXXU=m +CONFIG_RTL8XXXU_UNTESTED=y +CONFIG_WLAN_VENDOR_TI=y +CONFIG_WL1251=m +# CONFIG_WL1251_SPI is not set +# CONFIG_WL1251_SDIO is not set +CONFIG_WL12XX=m +CONFIG_WL18XX=m +CONFIG_WLCORE=m +CONFIG_WLCORE_SPI=m +CONFIG_WLCORE_SDIO=m +CONFIG_WILINK_PLATFORM_DATA=y +CONFIG_ZD1211RW=m +CONFIG_ZD1211RW_DEBUG=y +CONFIG_MWIFIEX=m +# CONFIG_MWIFIEX_SDIO is not set diff --git a/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/xen_domu.cfg b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/xen_domu.cfg new file mode 100644 index 00000000..8bc59eb1 --- /dev/null +++ b/meta-agl/meta-agl-bsp/recipes-kernel/linux/linux/xen_domu.cfg @@ -0,0 +1,25 @@ +CONFIG_XEN=y +CONFIG_XEN_BLKDEV_FRONTEND=y +CONFIG_XEN_SCSI_FRONTEND=y +CONFIG_XEN_NETDEV_FRONTEND=y +CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y +CONFIG_HVC_XEN=y +CONFIG_HVC_XEN_FRONTEND=y +CONFIG_XEN_FBDEV_FRONTEND=y +CONFIG_MMC_SDHCI_XENON=y +CONFIG_XEN_BALLOON=y +CONFIG_XEN_SCRUB_PAGES_DEFAULT=y +CONFIG_XEN_DEV_EVTCHN=y +CONFIG_XEN_BACKEND=y +CONFIG_XENFS=y +CONFIG_XEN_COMPAT_XENFS=y +CONFIG_XEN_SYS_HYPERVISOR=y +CONFIG_XEN_XENBUS_FRONTEND=y +CONFIG_XEN_GNTDEV=y +CONFIG_XEN_GNTDEV_DMABUF=y +CONFIG_XEN_GRANT_DEV_ALLOC=y +CONFIG_XEN_GRANT_DMA_ALLOC=y +CONFIG_SWIOTLB_XEN=y +CONFIG_XEN_PVCALLS_FRONTEND=y +CONFIG_XEN_PRIVCMD=y +CONFIG_XEN_AUTO_XLATE=y \ No newline at end of file diff --git a/meta-agl/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0007-WIP-Initial-LAVA-support.patch b/meta-agl/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0007-WIP-Initial-LAVA-support.patch index 28c9c09b..6232c4fa 100644 --- a/meta-agl/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0007-WIP-Initial-LAVA-support.patch +++ b/meta-agl/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner/0007-WIP-Initial-LAVA-support.patch @@ -18,17 +18,12 @@ emitted to stdout: It is valid to have a measurement without units, but not units without a measurement. Signed-off-by: Tim Orling +[updated for ptest-runner 2.3.2] +Signed-off-by: Scott Murray --- - flags.h | 10 ++++++++++ - main.c | 9 ++++++++- - utils.c | 15 +++++++++++++++ - utils.h | 2 +- - 4 files changed, 34 insertions(+), 2 deletions(-) - create mode 100644 flags.h - diff --git a/flags.h b/flags.h new file mode 100644 -index 000000000000..0dac2234e0b4 +index 0000000..0dac223 --- /dev/null +++ b/flags.h @@ -0,0 +1,10 @@ @@ -43,18 +38,18 @@ index 000000000000..0dac2234e0b4 + +#endif /* __FLAGS_H__ */ diff --git a/main.c b/main.c -index 83600b7d1b31..92ced6926c3d 100644 +index 01d60f7..165370f 100644 --- a/main.c +++ b/main.c -@@ -36,6 +36,7 @@ +@@ -38,6 +38,7 @@ #endif #include "utils.h" +#include "flags.h" + #ifndef DEFAULT_DIRECTORY #define DEFAULT_DIRECTORY "/usr/lib" - #define DEFAULT_TIMEOUT 300 -@@ -70,8 +71,9 @@ main(int argc, char *argv[]) +@@ -74,8 +75,9 @@ main(int argc, char *argv[]) opts.timeout = DEFAULT_TIMEOUT; opts.ptests = NULL; opts.xml_filename = NULL; @@ -65,7 +60,7 @@ index 83600b7d1b31..92ced6926c3d 100644 switch (opt) { case 'd': free(opts.directory); -@@ -118,6 +120,11 @@ main(int argc, char *argv[]) +@@ -122,6 +124,11 @@ main(int argc, char *argv[]) opts.xml_filename = strdup(optarg); CHECK_ALLOCATION(opts.xml_filename, 1, 1); break; @@ -78,10 +73,10 @@ index 83600b7d1b31..92ced6926c3d 100644 print_usage(stdout, argv[0]); exit(1); diff --git a/utils.c b/utils.c -index ed2eff7900c1..0fd1da6aec92 100644 +index a8ba190..19f9efa 100644 --- a/utils.c +++ b/utils.c -@@ -39,6 +39,7 @@ +@@ -47,6 +47,7 @@ #include "ptest_list.h" #include "utils.h" @@ -89,30 +84,34 @@ index ed2eff7900c1..0fd1da6aec92 100644 #define GET_STIME_BUF_SIZE 1024 #define WAIT_CHILD_POLL_TIMEOUT_MS 200 -@@ -358,6 +359,7 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts, +@@ -439,6 +440,7 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts, fprintf(fp, "START: %s\n", progname); - PTEST_LIST_ITERATE_START(head, p); + PTEST_LIST_ITERATE_START(head, p) char *ptest_dir = strdup(p->run_ptest); + char *ptest = strdup(p->ptest); if (ptest_dir == NULL) { rc = -1; break; -@@ -376,6 +378,11 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts, +@@ -480,11 +482,15 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts, + int status; int fds[2]; fds[0] = pipefd_stdout[0]; fds[1] = pipefd_stderr[0]; FILE *fps[2]; fps[0] = fp; fps[1] = fp_stderr; - + char result[5]; // pass\0, fail\0, skip\0 -+ + + if (setpgid(child, pgid) == -1) { + fprintf(fp, "ERROR: setpgid() failed, %s\n", strerror(errno)); + } + + if (opts.flags & LAVA_SIGNAL_ENABLE) { + fprintf(stdout, "\n", ptest); + } - fprintf(fp, "%s\n", get_stime(stime, GET_STIME_BUF_SIZE)); + sttime = time(NULL); + fprintf(fp, "%s\n", get_stime(stime, GET_STIME_BUF_SIZE, sttime)); fprintf(fp, "BEGIN: %s\n", ptest_dir); - -@@ -389,6 +396,14 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts, +@@ -506,6 +512,14 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts, fprintf(fp, "END: %s\n", ptest_dir); - fprintf(fp, "%s\n", get_stime(stime, GET_STIME_BUF_SIZE)); + fprintf(fp, "%s\n", get_stime(stime, GET_STIME_BUF_SIZE, entime)); + if (opts.flags & LAVA_SIGNAL_ENABLE) { + if (status) + sprintf(result, "fail"); @@ -122,13 +121,13 @@ index ed2eff7900c1..0fd1da6aec92 100644 + fprintf(stdout, "\n", ptest, result); + } } - PTEST_LIST_ITERATE_END; + PTEST_LIST_ITERATE_END fprintf(fp, "STOP: %s\n", progname); diff --git a/utils.h b/utils.h -index ee85163ddfff..06d4c100d151 100644 +index aa53707..df11e24 100644 --- a/utils.h +++ b/utils.h -@@ -37,9 +37,9 @@ struct ptest_options { +@@ -39,9 +39,9 @@ struct ptest_options { int timeout; char **ptests; char *xml_filename; @@ -139,6 +138,3 @@ index ee85163ddfff..06d4c100d151 100644 extern void check_allocation1(void *, size_t, char *, int, int); extern struct ptest_list *get_available_ptests(const char *); extern int print_ptests(struct ptest_list *, FILE *); --- -2.11.0 - diff --git a/meta-agl/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner_2.%.bbappend b/meta-agl/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner_2.%.bbappend new file mode 100644 index 00000000..7a1d2a8f --- /dev/null +++ b/meta-agl/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner_2.%.bbappend @@ -0,0 +1,4 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://0007-WIP-Initial-LAVA-support.patch" + diff --git a/meta-agl/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner_2.2.bbappend b/meta-agl/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner_2.2.bbappend deleted file mode 100644 index 7a1d2a8f..00000000 --- a/meta-agl/meta-agl-bsp/recipes-support/ptest-runner/ptest-runner_2.2.bbappend +++ /dev/null @@ -1,4 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -SRC_URI += "file://0007-WIP-Initial-LAVA-support.patch" - diff --git a/meta-agl/meta-agl-bsp/recipes-support/vboxguestdrivers/vboxguestdrivers_%.bbappend b/meta-agl/meta-agl-bsp/recipes-support/vboxguestdrivers/vboxguestdrivers_%.bbappend deleted file mode 100644 index c87b36c1..00000000 --- a/meta-agl/meta-agl-bsp/recipes-support/vboxguestdrivers/vboxguestdrivers_%.bbappend +++ /dev/null @@ -1 +0,0 @@ -COMPATIBLE_MACHINE = "(qemux86|qemux86-64|intel-corei7-64)" diff --git a/meta-agl/meta-agl-bsp/virtualization-layer/recipes-extended/xen/files/0001-XEN-on-RPi4-1GB-lmitation-workaround-XEN-tries-to-al.patch b/meta-agl/meta-agl-bsp/virtualization-layer/recipes-extended/xen/files/0001-XEN-on-RPi4-1GB-lmitation-workaround-XEN-tries-to-al.patch new file mode 100644 index 00000000..d83c6525 --- /dev/null +++ b/meta-agl/meta-agl-bsp/virtualization-layer/recipes-extended/xen/files/0001-XEN-on-RPi4-1GB-lmitation-workaround-XEN-tries-to-al.patch @@ -0,0 +1,28 @@ +From 2701d65271686dff0cb39ab7da1e821f5dede61e Mon Sep 17 00:00:00 2001 +From: Leonid Lazarev +Date: Tue, 21 Apr 2020 17:28:16 +0300 +Subject: [PATCH] XEN on RPi4 1GB lmitation workaround: XEN tries to allocated + the memopry for dom0 within first 4GB, but for some reason raspberry pi only + allows to load kernel from 1st GB. Push XEN to allocate first bank for dom0 + from 1st GB + +--- + xen/arch/arm/domain_build.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c +index dd9c3b73ba..8501a8c8aa 100644 +--- a/xen/arch/arm/domain_build.c ++++ b/xen/arch/arm/domain_build.c +@@ -281,7 +281,7 @@ static void __init allocate_memory_11(struct domain *d, + */ + while ( order >= min_low_order ) + { +- for ( bits = order ; bits <= (lowmem ? 32 : PADDR_BITS); bits++ ) ++ for ( bits = order ; bits <= (lowmem ? 30 : PADDR_BITS); bits++ ) + { + pg = alloc_domheap_pages(d, order, MEMF_bits(bits)); + if ( pg != NULL ) +-- +2.17.1 + diff --git a/meta-agl/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-mkimage-rpi4.bb b/meta-agl/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-mkimage-rpi4.bb new file mode 100644 index 00000000..ae8fe71b --- /dev/null +++ b/meta-agl/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-mkimage-rpi4.bb @@ -0,0 +1,29 @@ +DESCRIPTION = "Xen hypervisor u-boot image" +LICENSE = "GPLv2" +SECTION = "console/tools" + +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" + + + +ALLOW_EMPTY_${PN} = "1" +FILES_${PN} = "" +S = "${WORKDIR}" + +DEPENDS = "u-boot-mkimage-native " + +# Only for aarch64 +COMPATIBLE_MACHINE = "(-)" +COMPATIBLE_MACHINE_aarch64 = "(.*)" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +do_configure[noexec] = "1" +do_deploy[noexec] = "1" + +do_compile[depends] += "xen:do_deploy" + +# Uboot compatible image +do_compile () { + uboot-mkimage -A arm64 -C none -T kernel -a 0x48080000 -e 0x48080000 -n "XEN" -d ${DEPLOY_DIR_IMAGE}/xen-${MACHINE} ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.uImage +} diff --git a/meta-agl/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-tools_git.bbappend b/meta-agl/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-tools_git.bbappend new file mode 100644 index 00000000..057f4564 --- /dev/null +++ b/meta-agl/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-tools_git.bbappend @@ -0,0 +1,11 @@ + +# make the package specific to the machine for now +PACKAGE_ARCH = "${MACHINE_ARCH}" + +# rpi4 +LIC_FILES_CHKSUM_raspberrypi4 = "file://COPYING;md5=4295d895d4b5ce9d070263d52f030e49" +XEN_REL_raspberrypi4 = "4.13" +SRCREV_raspberrypi4 = "721f2c323ca55c77857c93e7275b4a93a0e15e1f" +SRC_URI_raspberrypi4 = " \ + git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \ + " diff --git a/meta-agl/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen_git.bbappend b/meta-agl/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen_git.bbappend new file mode 100644 index 00000000..1b9aaf4c --- /dev/null +++ b/meta-agl/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen_git.bbappend @@ -0,0 +1,18 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +# make the package machine-specific +PACKAGE_ARCH = "${MACHINE_ARCH}" + +# rpi4 specifics +LIC_FILES_CHKSUM_raspberrypi4 = "file://COPYING;md5=4295d895d4b5ce9d070263d52f030e49" +XEN_REL_raspberrypi4 = "4.13" + +SRCREV_raspberrypi4 = "721f2c323ca55c77857c93e7275b4a93a0e15e1f" +SRC_URI_append_raspberrypi4 = " file://0001-XEN-on-RPi4-1GB-lmitation-workaround-XEN-tries-to-al.patch" + +#due to incorrect xen binary preparation in external library, we add additional deploy +do_deploy_append_raspberrypi4() { + if [ -f ${B}/xen/xen ]; then + install -m 0644 ${B}/xen/xen ${DEPLOYDIR}/xen-${MACHINE} + fi +} diff --git a/meta-agl/meta-agl-bsp/wic/systemd-joule-bootdisk.wks b/meta-agl/meta-agl-bsp/wic/systemd-joule-bootdisk.wks deleted file mode 100644 index a318e231..00000000 --- a/meta-agl/meta-agl-bsp/wic/systemd-joule-bootdisk.wks +++ /dev/null @@ -1,12 +0,0 @@ -# short-description: Custom EFI disk image with systemd-boot -# long-description: Creates a partitioned EFI disk image that the user -# can directly dd to boot media. The selected bootloader is systemd-boot -# and we do not have swap. We assume a Joule system and provide an -# appropriate kernel command line. - -part /boot --source bootimg-efi --sourceparams="loader=systemd-boot,initrd=microcode.cpio" --use-uuid --label msdos --active --align 1024 - -part / --source rootfs --fstype=ext4 --label platform --align 1024 --use-uuid - -# Modify the append line here as needed to suit the environment -bootloader --ptable gpt --timeout=5 --append="rootwait rootfstype=ext4 console=ttyS2,115200n8 console=tty0 video=efifb maxcpus=4 noxsave reboot=efi kmemleak=off" diff --git a/meta-agl/meta-agl-distro/LICENSE b/meta-agl/meta-agl-distro/LICENSE new file mode 100644 index 00000000..e8758f89 --- /dev/null +++ b/meta-agl/meta-agl-distro/LICENSE @@ -0,0 +1,20 @@ +Different components of the AGL layers are under different licenses (a mix +of MIT and GPLv2). See LICENSE.GPL-2.0-only and LICENSE.MIT for further +details of the individual licenses. + +All metadata (e.g. .bb, .bbappend, .bbclass, .inc, templates/* and similar) +is MIT licensed unless otherwise stated. +Source code included in tree for individual recipes (e.g. patches) are under +the LICENSE stated in the associated recipe (.bb file) unless otherwise stated. + +License information for any other files (scripts) is either explicitly stated +or defaults to GPL version 2 only. + +Individual files can contain the following style tags instead of the full +license text to identify their license: + + SPDX-License-Identifier: GPL-2.0-only + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-distro/LICENSE.GPL-2.0-only b/meta-agl/meta-agl-distro/LICENSE.GPL-2.0-only new file mode 100644 index 00000000..5db3c0a2 --- /dev/null +++ b/meta-agl/meta-agl-distro/LICENSE.GPL-2.0-only @@ -0,0 +1,288 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: GPL-2.0-only + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-distro/LICENSE.MIT b/meta-agl/meta-agl-distro/LICENSE.MIT new file mode 100644 index 00000000..a6919eb7 --- /dev/null +++ b/meta-agl/meta-agl-distro/LICENSE.MIT @@ -0,0 +1,25 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-distro/conf/distro/include/x86_64-tune.inc b/meta-agl/meta-agl-distro/conf/distro/include/x86_64-tune.inc index 2efeca04..9f2bdc86 100644 --- a/meta-agl/meta-agl-distro/conf/distro/include/x86_64-tune.inc +++ b/meta-agl/meta-agl-distro/conf/distro/include/x86_64-tune.inc @@ -52,4 +52,4 @@ QB_CPU_x86-64 = "-cpu qemu64,+ssse3,+sse4.1,+sse4.2,+popcnt" QB_CPU_KVM_x86-64 = "-cpu kvm64 -cpu qemu64,+ssse3,+sse4.1,+sse4.2,+popcnt" # Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy -QB_OPT_APPEND = "-vga vmware -show-cursor -usb -usbdevice tablet -device virtio-rng-pci" +QB_OPT_APPEND = "-vga vmware -show-cursor -usb -device usb-tablet -device virtio-rng-pci" diff --git a/meta-agl/meta-agl-distro/conf/distro/poky-agl.conf b/meta-agl/meta-agl-distro/conf/distro/poky-agl.conf index d1c580ea..42982944 100644 --- a/meta-agl/meta-agl-distro/conf/distro/poky-agl.conf +++ b/meta-agl/meta-agl-distro/conf/distro/poky-agl.conf @@ -6,9 +6,9 @@ DISTRO_NAME = "Automotive Grade Linux" # Release flags -DISTRO_CODENAME = "icefish" -AGL_BRANCH = "icefish" -AGLVERSION = "9.0.1" +DISTRO_CODENAME = "jellyfish" +AGL_BRANCH = "jellyfish" +AGLVERSION = "10.0.0" # switch devel/release #AGLRELEASETYPE ?= "agldevelopment" AGLRELEASETYPE ?= "aglrelease" @@ -26,6 +26,15 @@ DISTRO_BRANCH_VERSION_TAG = "${DISTRO_CODENAME}/${@'${DISTRO_VERSION}'.replace(' AGL_APP_REVISION_aglrelease := "refs/tags/${DISTRO_BRANCH_VERSION_TAG}" AGL_DEFAULT_REVISION_aglrelease := "refs/tags/${DISTRO_BRANCH_VERSION_TAG}" +# reproducible builds: +# enable the flag +BUILD_REPRODUCIBLE_BINARIES = "1" +# Set the desired timestamps +export SOURCE_DATE_EPOCH = "1593400000" +REPRODUCIBLE_TIMESTAMP_ROOTFS = "1593400000" +# inherit the class +INHERIT += "reproducible_build" + # SDK SDK_VENDOR = "-aglsdk" @@ -37,12 +46,12 @@ SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}" SDKPATH = "/opt/agl-sdk/${SDK_VERSION}-${DEFAULTTUNE}" -MAINTAINER = "AGL " +MAINTAINER = "AGL https://lists.automotivelinux.org/g/agl-dev-community" TARGET_VENDOR = "-agl" # Override these in poky based distros -AGL_DEFAULT_DISTRO_FEATURES = "largefile systemd opengl wayland pam bluetooth bluez5 3g" +AGL_DEFAULT_DISTRO_FEATURES = "largefile systemd opengl wayland pam bluetooth bluez5 3g polkit" POKY_DEFAULT_DISTRO_FEATURES := "${AGL_DEFAULT_DISTRO_FEATURES}" OVERRIDES .= ":${DISTRO_CODENAME}" @@ -94,14 +103,14 @@ DISTRO_FEATURES_APPEND = " " DISTRO_FEATURES_remove = "x11" DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit pulseaudio" -# Prefer GStreamer 1.14.x by default -PREFERRED_VERSION_gstreamer1.0 ?= "1.14.%" -PREFERRED_VERSION_gstreamer1.0-plugins-bad ?= "1.14.%" -PREFERRED_VERSION_gstreamer1.0-plugins-base ?= "1.14.%" -PREFERRED_VERSION_gstreamer1.0-plugins-good ?= "1.14.%" -PREFERRED_VERSION_gstreamer1.0-plugins-ugly ?= "1.14.%" -PREFERRED_VERSION_gstreamer1.0-libav ?= "1.14.%" -PREFERRED_VERSION_gstreamer1.0-omx ?= "1.14.%" +# Prefer GStreamer 1.16.x by default +PREFERRED_VERSION_gstreamer1.0 ?= "1.16.%" +PREFERRED_VERSION_gstreamer1.0-plugins-bad ?= "1.16.%" +PREFERRED_VERSION_gstreamer1.0-plugins-base ?= "1.16.%" +PREFERRED_VERSION_gstreamer1.0-plugins-good ?= "1.16.%" +PREFERRED_VERSION_gstreamer1.0-plugins-ugly ?= "1.16.%" +PREFERRED_VERSION_gstreamer1.0-libav ?= "1.16.%" +PREFERRED_VERSION_gstreamer1.0-omx ?= "1.16.%" # Prefer libjpeg-turbo PREFERRED_PROVIDER_jpeg = "libjpeg-turbo" @@ -141,8 +150,10 @@ QB_AUDIO_OPT = "-soundhw hda" AGL_EXTRA_IMAGE_FSTYPES ??= "" AGL_EXTRA_INITRAMFS_FSTYPES ??= "" # -# Default IMAGE FSTYPES compressed tarball + ext4.xz -AGL_DEFAULT_IMAGE_FSTYPES ?= "tar.xz ${@bb.utils.contains('DISTRO_FEATURES', 'AGLCI', 'ext4.xz', 'ext4', d)}" +# Default IMAGE FSTYPES wic.xz +AGL_DEFAULT_IMAGE_FSTYPES ?= "wic.xz wic.bmap wic.xz.sha256sum" +AGL_DEFAULT_IMAGE_FSTYPES_qemuall ?= "${@bb.utils.contains('DISTRO_FEATURES', 'AGLCI', 'ext4.xz', 'ext4', d)}" +AGL_DEFAULT_IMAGE_FSTYPES_append_netboot = " ${@bb.utils.contains('DISTRO_FEATURES', 'AGLCI', 'ext4.xz', 'ext4', d)}" AGL_DEFAULT_INITRAMFS_FSTYPES ?= "ext4.gz" # DEFAULT IMAGE_FSTYPES for AGL (no - BSPs should not set this) @@ -160,6 +171,10 @@ PACKAGE_FEED_BASE_PATHS = "rpm" PACKAGE_FEED_ARCHS = "" #${PACKAGE_ARCHS}" +# Complementary package definitions for agl-test-wgt and agl-devel-wgt +# image features +COMPLEMENTARY_GLOB[agl-test-wgt] = '*-test' +COMPLEMENTARY_GLOB[agl-devel-wgt] = '*-coverage *-debug' # Fix for rpm metadata clash between nativesdk-cmake and nativesdk-qtbase-tools # (revalidate after 2017-10-15, 2018-06-12: still required) @@ -175,3 +190,9 @@ PREFERRED_RPROVIDER_virtual/navigation ?= "ondemandnavi" # Set preferred provider for low-can device mapping configuration PREFERRED_RPROVIDER_virtual/low-can-dev-mapping ?= "dev-mapping" + +# Mask upstream meta-security bbappend that interferes with non-linux-yocto +# kernels due to the bug of having two wildcards, which bitbake does not +# support. Not having it is not an issue, since there is also explicit +# enabling of required security features done by meta-agl/meta-security. +BBMASK += "meta-security/recipes-kernel/linux/linux-%_5.%.bbappend" diff --git a/meta-agl/meta-agl-distro/conf/layer.conf b/meta-agl/meta-agl-distro/conf/layer.conf index 3c60fd4c..f8cf50c7 100644 --- a/meta-agl/meta-agl-distro/conf/layer.conf +++ b/meta-agl/meta-agl-distro/conf/layer.conf @@ -9,4 +9,4 @@ BBFILE_COLLECTIONS += "agl-distro" BBFILE_PATTERN_agl-distro = "^${LAYERDIR}/" BBFILE_PRIORITY_agl-distro = "70" -LAYERSERIES_COMPAT_agl-distro = "thud" +LAYERSERIES_COMPAT_agl-distro = "dunfell" diff --git a/meta-agl/meta-agl-profile-cluster-qt5/LICENSE b/meta-agl/meta-agl-profile-cluster-qt5/LICENSE new file mode 100644 index 00000000..e8758f89 --- /dev/null +++ b/meta-agl/meta-agl-profile-cluster-qt5/LICENSE @@ -0,0 +1,20 @@ +Different components of the AGL layers are under different licenses (a mix +of MIT and GPLv2). See LICENSE.GPL-2.0-only and LICENSE.MIT for further +details of the individual licenses. + +All metadata (e.g. .bb, .bbappend, .bbclass, .inc, templates/* and similar) +is MIT licensed unless otherwise stated. +Source code included in tree for individual recipes (e.g. patches) are under +the LICENSE stated in the associated recipe (.bb file) unless otherwise stated. + +License information for any other files (scripts) is either explicitly stated +or defaults to GPL version 2 only. + +Individual files can contain the following style tags instead of the full +license text to identify their license: + + SPDX-License-Identifier: GPL-2.0-only + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-cluster-qt5/LICENSE.GPL-2.0-only b/meta-agl/meta-agl-profile-cluster-qt5/LICENSE.GPL-2.0-only new file mode 100644 index 00000000..5db3c0a2 --- /dev/null +++ b/meta-agl/meta-agl-profile-cluster-qt5/LICENSE.GPL-2.0-only @@ -0,0 +1,288 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: GPL-2.0-only + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-cluster-qt5/LICENSE.MIT b/meta-agl/meta-agl-profile-cluster-qt5/LICENSE.MIT new file mode 100644 index 00000000..a6919eb7 --- /dev/null +++ b/meta-agl/meta-agl-profile-cluster-qt5/LICENSE.MIT @@ -0,0 +1,25 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-cluster-qt5/conf/layer.conf b/meta-agl/meta-agl-profile-cluster-qt5/conf/layer.conf index aa11e32d..6ed7d8ca 100644 --- a/meta-agl/meta-agl-profile-cluster-qt5/conf/layer.conf +++ b/meta-agl/meta-agl-profile-cluster-qt5/conf/layer.conf @@ -9,4 +9,4 @@ BBFILE_COLLECTIONS += "aglprofileclusterqt5" BBFILE_PATTERN_aglprofileclusterqt5 = "^${LAYERDIR}/" BBFILE_PRIORITY_aglprofileclusterqt5 = "70" -LAYERSERIES_COMPAT_aglprofileclusterqt5 = "thud" +LAYERSERIES_COMPAT_aglprofileclusterqt5 = "dunfell" diff --git a/meta-agl/meta-agl-profile-cluster-qt5/recipes-platform/images/agl-image-cluster-qt5.inc b/meta-agl/meta-agl-profile-cluster-qt5/recipes-platform/images/agl-image-cluster-qt5.inc index 9f9f530f..93826aa4 100644 --- a/meta-agl/meta-agl-profile-cluster-qt5/recipes-platform/images/agl-image-cluster-qt5.inc +++ b/meta-agl/meta-agl-profile-cluster-qt5/recipes-platform/images/agl-image-cluster-qt5.inc @@ -2,6 +2,6 @@ require recipes-platform/images/agl-image-boot.inc IMAGE_FEATURES += "splash package-management ssh-server-dropbear" -inherit distro_features_check +inherit features_check REQUIRED_DISTRO_FEATURES = "wayland" diff --git a/meta-agl/meta-agl-profile-cluster-qt5/recipes-qt/qt5/qtbase_%.bbappend b/meta-agl/meta-agl-profile-cluster-qt5/recipes-qt/qt5/qtbase_%.bbappend index 50db225c..e94ef03a 100644 --- a/meta-agl/meta-agl-profile-cluster-qt5/recipes-qt/qt5/qtbase_%.bbappend +++ b/meta-agl/meta-agl-profile-cluster-qt5/recipes-qt/qt5/qtbase_%.bbappend @@ -2,9 +2,11 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -SRC_URI += " file://0001-fixed-eglfs_kms-fails-to-build.patch \ - file://0002-fixed-invalid-conversion-from-EGLNativeDisplayType-to-void.patch \ - " +# FIXME: Disabled as they do not apply against 5.13.2, and it is +# unclear if they are still required for building dra7xx-evm, +# which fails for what looks like a different reason. +#SRC_URI += " file://0001-fixed-eglfs_kms-fails-to-build.patch \ +# file://0002-fixed-invalid-conversion-from-EGLNativeDisplayType-to-void.patch \ +# " PACKAGECONFIG_GL_append = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', ' eglfs kms gbm', '', d)}" diff --git a/meta-agl/meta-agl-profile-cluster/LICENSE b/meta-agl/meta-agl-profile-cluster/LICENSE new file mode 100644 index 00000000..e8758f89 --- /dev/null +++ b/meta-agl/meta-agl-profile-cluster/LICENSE @@ -0,0 +1,20 @@ +Different components of the AGL layers are under different licenses (a mix +of MIT and GPLv2). See LICENSE.GPL-2.0-only and LICENSE.MIT for further +details of the individual licenses. + +All metadata (e.g. .bb, .bbappend, .bbclass, .inc, templates/* and similar) +is MIT licensed unless otherwise stated. +Source code included in tree for individual recipes (e.g. patches) are under +the LICENSE stated in the associated recipe (.bb file) unless otherwise stated. + +License information for any other files (scripts) is either explicitly stated +or defaults to GPL version 2 only. + +Individual files can contain the following style tags instead of the full +license text to identify their license: + + SPDX-License-Identifier: GPL-2.0-only + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-cluster/LICENSE.GPL-2.0-only b/meta-agl/meta-agl-profile-cluster/LICENSE.GPL-2.0-only new file mode 100644 index 00000000..5db3c0a2 --- /dev/null +++ b/meta-agl/meta-agl-profile-cluster/LICENSE.GPL-2.0-only @@ -0,0 +1,288 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: GPL-2.0-only + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-cluster/LICENSE.MIT b/meta-agl/meta-agl-profile-cluster/LICENSE.MIT new file mode 100644 index 00000000..a6919eb7 --- /dev/null +++ b/meta-agl/meta-agl-profile-cluster/LICENSE.MIT @@ -0,0 +1,25 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-cluster/conf/layer.conf b/meta-agl/meta-agl-profile-cluster/conf/layer.conf index e15c3be4..e71e04c9 100644 --- a/meta-agl/meta-agl-profile-cluster/conf/layer.conf +++ b/meta-agl/meta-agl-profile-cluster/conf/layer.conf @@ -9,4 +9,4 @@ BBFILE_COLLECTIONS += "aglprofilecluster" BBFILE_PATTERN_aglprofilecluster = "^${LAYERDIR}/" BBFILE_PRIORITY_aglprofilecluster = "70" -LAYERSERIES_COMPAT_aglprofilecluster = "thud" +LAYERSERIES_COMPAT_aglprofilecluster = "dunfell" diff --git a/meta-agl/meta-agl-profile-cluster/recipes-platform/images/agl-image-cluster.inc b/meta-agl/meta-agl-profile-cluster/recipes-platform/images/agl-image-cluster.inc index 9f9f530f..93826aa4 100644 --- a/meta-agl/meta-agl-profile-cluster/recipes-platform/images/agl-image-cluster.inc +++ b/meta-agl/meta-agl-profile-cluster/recipes-platform/images/agl-image-cluster.inc @@ -2,6 +2,6 @@ require recipes-platform/images/agl-image-boot.inc IMAGE_FEATURES += "splash package-management ssh-server-dropbear" -inherit distro_features_check +inherit features_check REQUIRED_DISTRO_FEATURES = "wayland" diff --git a/meta-agl/meta-agl-profile-core/LICENSE b/meta-agl/meta-agl-profile-core/LICENSE new file mode 100644 index 00000000..e8758f89 --- /dev/null +++ b/meta-agl/meta-agl-profile-core/LICENSE @@ -0,0 +1,20 @@ +Different components of the AGL layers are under different licenses (a mix +of MIT and GPLv2). See LICENSE.GPL-2.0-only and LICENSE.MIT for further +details of the individual licenses. + +All metadata (e.g. .bb, .bbappend, .bbclass, .inc, templates/* and similar) +is MIT licensed unless otherwise stated. +Source code included in tree for individual recipes (e.g. patches) are under +the LICENSE stated in the associated recipe (.bb file) unless otherwise stated. + +License information for any other files (scripts) is either explicitly stated +or defaults to GPL version 2 only. + +Individual files can contain the following style tags instead of the full +license text to identify their license: + + SPDX-License-Identifier: GPL-2.0-only + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-core/LICENSE.GPL-2.0-only b/meta-agl/meta-agl-profile-core/LICENSE.GPL-2.0-only new file mode 100644 index 00000000..5db3c0a2 --- /dev/null +++ b/meta-agl/meta-agl-profile-core/LICENSE.GPL-2.0-only @@ -0,0 +1,288 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: GPL-2.0-only + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-core/LICENSE.MIT b/meta-agl/meta-agl-profile-core/LICENSE.MIT new file mode 100644 index 00000000..a6919eb7 --- /dev/null +++ b/meta-agl/meta-agl-profile-core/LICENSE.MIT @@ -0,0 +1,25 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-core/conf/include/agl-devel.inc b/meta-agl/meta-agl-profile-core/conf/include/agl-devel.inc index 2157f6f1..6ecd6a07 100644 --- a/meta-agl/meta-agl-profile-core/conf/include/agl-devel.inc +++ b/meta-agl/meta-agl-profile-core/conf/include/agl-devel.inc @@ -1,13 +1,16 @@ -IMAGE_FEATURES =+ "debug-tweaks eclipse-debug tools-debug tools-profile" +IMAGE_FEATURES =+ "debug-tweaks tools-debug tools-profile" IMAGE_INSTALL_append = " \ packagegroup-agl-core-devel \ " -IMAGE_INSTALL_append = "${@bb.utils.contains('IMAGE_FSTYPES', 'wic.vmdk', ' open-vm-tools vboxguestdrivers', '', d)}" +IMAGE_INSTALL_append = "${@bb.utils.contains_any('IMAGE_FSTYPES', 'wic.vmdk wic.vmdk.xz', ' open-vm-tools vboxguestdrivers', '', d)}" + # Install libdrm-test, including modetest, to images with GUI IMAGE_INSTALL_append = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', ' libdrm-tests', '', d)}" +IMAGE_FEATURES_append = " agl-devel-wgt" + # disable install of debug files in SDK # initial value: SDKIMAGE_FEATURES="dev-pkgs dbg-pkgs staticdev-pkgs" SDKIMAGE_FEATURES="dev-pkgs" diff --git a/meta-agl/meta-agl-profile-core/conf/include/agl-pulseaudio.inc b/meta-agl/meta-agl-profile-core/conf/include/agl-pulseaudio.inc deleted file mode 100644 index 69092ab9..00000000 --- a/meta-agl/meta-agl-profile-core/conf/include/agl-pulseaudio.inc +++ /dev/null @@ -1 +0,0 @@ -DISTRO_FEATURES_append = " pulseaudio" diff --git a/meta-agl/meta-agl-profile-core/conf/include/agl-sign-wgts.inc b/meta-agl/meta-agl-profile-core/conf/include/agl-sign-wgts.inc new file mode 100644 index 00000000..6e6674fd --- /dev/null +++ b/meta-agl/meta-agl-profile-core/conf/include/agl-sign-wgts.inc @@ -0,0 +1,3 @@ +# allows insertion of code or items specific to developement +OVERRIDES .= ":agl-sign-wgts" +DISTRO_FEATURES_append = " agl-sign-wgts" diff --git a/meta-agl/meta-agl-profile-core/conf/layer.conf b/meta-agl/meta-agl-profile-core/conf/layer.conf index 641b2286..fef746d7 100644 --- a/meta-agl/meta-agl-profile-core/conf/layer.conf +++ b/meta-agl/meta-agl-profile-core/conf/layer.conf @@ -9,4 +9,4 @@ BBFILE_COLLECTIONS += "aglprofilecore" BBFILE_PATTERN_aglprofilecore = "^${LAYERDIR}/" BBFILE_PRIORITY_aglprofilecore = "80" -LAYERSERIES_COMPAT_aglprofilecore = "thud" +LAYERSERIES_COMPAT_aglprofilecore = "dunfell" diff --git a/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-can-low-level/agl-service-can-low-level_git.bb b/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-can-low-level/agl-service-can-low-level_git.bb index d06cfd26..83f6c1e7 100644 --- a/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-can-low-level/agl-service-can-low-level_git.bb +++ b/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-can-low-level/agl-service-can-low-level_git.bb @@ -16,4 +16,8 @@ DEPENDS = "libafb-helpers libappcontroller" inherit cmake aglwgt pkgconfig ptest +# For now, just enable J1939 on the qemu platforms where we know the +# linux-yocto kernel is new enough (>= 5.4) and has the support enabled. +AGLWGT_CMAKE_CONFIGURE_ARGS_append_qemuall = " -DWITH_FEATURE_J1939=ON" + RDEPENDS_${PN} = "virtual/low-can-dev-mapping" diff --git a/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-data-persistence/agl-service-data-persistence_git.bb b/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-data-persistence/agl-service-data-persistence_git.bb index bb8caaad..569f0707 100644 --- a/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-data-persistence/agl-service-data-persistence_git.bb +++ b/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-data-persistence/agl-service-data-persistence_git.bb @@ -2,8 +2,8 @@ DESCRIPTION = "AGL low level user database binding" HOMEPAGE = "https://git.automotivelinux.org/apps/agl-service-data-persistence/" SECTION = "base" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://LICENSE;md5=8089a3c40cff9caffd1b9ba5aa3dfd67" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=ae6497158920d9524cf208c09cc4c984" SRC_URI = "git://gerrit.automotivelinux.org/gerrit/apps/agl-service-data-persistence;protocol=https;branch=${AGL_BRANCH}" SRCREV = "${AGL_APP_REVISION}" diff --git a/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-identity-agent/agl-service-identity-agent_git.bb b/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-identity-agent/agl-service-identity-agent_git.bb index 56e11832..f2474be7 100644 --- a/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-identity-agent/agl-service-identity-agent_git.bb +++ b/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-identity-agent/agl-service-identity-agent_git.bb @@ -3,7 +3,7 @@ HOMEPAGE = "https://gitlab.com/iotbzh/aia-binding" SECTION = "base" LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57" +LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" SRC_URI = "git://gerrit.automotivelinux.org/gerrit/apps/agl-service-identity-agent;protocol=https;branch=${AGL_BRANCH}" SRCREV = "${AGL_APP_REVISION}" diff --git a/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-network/agl-service-network_git.bb b/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-network/agl-service-network_git.bb index dbe9b3e9..c7fb72f2 100644 --- a/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-network/agl-service-network_git.bb +++ b/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-network/agl-service-network_git.bb @@ -14,12 +14,12 @@ S = "${WORKDIR}/git" DEPENDS = "glib-2.0 json-c" -FILES_${PN}-tools = "${sbindir}/agl-service-network-ctl" -PACKAGES = "${PN}-tools ${PN}-dbg ${PN}" +inherit cmake aglwgt pkgconfig do_install_append() { install -d ${D}${sbindir} - install -m 755 ${B}/test/agl-service-network-ctl ${D}${sbindir} + install -m 755 ${B}/build-release/test/agl-service-network-ctl ${D}${sbindir} } -inherit cmake aglwgt pkgconfig +FILES_${PN}-tools = "${sbindir}/agl-service-network-ctl" +PACKAGES_prepend = "${PN}-tools " diff --git a/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-steering-wheel/agl-service-steering-wheel_0.1.bb b/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-steering-wheel/agl-service-steering-wheel_0.1.bb deleted file mode 100644 index a34644ce..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-steering-wheel/agl-service-steering-wheel_0.1.bb +++ /dev/null @@ -1,14 +0,0 @@ -DESCRIPTION = "logitech g29 wheel service" -HOMEPAGE = "https://gerrit.automotivelinux.org/gerrit/#/admin/projects/apps/agl-service-steering-wheel" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE;md5=ae6497158920d9524cf208c09cc4c984" -SECTION = "apps" - -SRC_URI = "git://gerrit.automotivelinux.org/gerrit/apps/agl-service-steering-wheel;protocol=https;branch=${AGL_BRANCH}" -SRCREV = "6d5d619a059b5aeb76c2add9bc28d45bd31279e9" -PN = "agl-service-steering-wheel" -S = "${WORKDIR}/git" - -DEPENDS = "glib-2.0 af-binder" - -inherit cmake aglwgt diff --git a/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-unicens/agl-service-unicens_git.bb b/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-unicens/agl-service-unicens_git.bb index 0126c768..e7e25c74 100644 --- a/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-unicens/agl-service-unicens_git.bb +++ b/meta-agl/meta-agl-profile-core/recipes-apis/agl-service-unicens/agl-service-unicens_git.bb @@ -4,7 +4,7 @@ HOMEPAGE = "https://gerrit.automotivelinux.org/gerrit/#/admin/projects/apps/a SECTION = "apps" LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" +LIC_FILES_CHKSUM = "file://LICENSE;md5=89aea4e17d99a7cacdbeed46a0096b10" SRC_URI = "gitsm://gerrit.automotivelinux.org/gerrit/apps/agl-service-unicens;protocol=https;branch=${AGL_BRANCH}" SRCREV = "${AGL_APP_REVISION}" diff --git a/meta-agl/meta-agl-profile-core/recipes-apis/high-level-viwi-service/high-level-viwi-service.bb b/meta-agl/meta-agl-profile-core/recipes-apis/high-level-viwi-service/high-level-viwi-service.bb deleted file mode 100644 index b7dc38b5..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-apis/high-level-viwi-service/high-level-viwi-service.bb +++ /dev/null @@ -1,19 +0,0 @@ -SUMMARY = "High level ViWi service" -DESCRIPTION = "AGL High Level service using ViWi protocol to expose CAN API." -HOMEPAGE = "https://github.com/iotbzh/high-level-viwi-service" - -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE;md5=5de84541278ea4e62cacfdc0f890c459" - -SRC_URI = "gitsm://github.com/iotbzh/high-level-viwi-service.git;protocol=https" -SRCREV = "e9d304eb5ac99b3ba6b72022458f09fcd713b584" - -PV = "4.0+git${SRCPV}" -S = "${WORKDIR}/git" - -# Run-time dependencies -RDEPENDS_${PN} += "agl-service-can-low-level" - -inherit cmake aglwgt - -AGLWGT_AUTOINSTALL_${PN} := "0" diff --git a/meta-agl/meta-agl-profile-core/recipes-connectivity/bluez5/bluez5/0001-obex-report-notification-status-on-incoming-message.patch b/meta-agl/meta-agl-profile-core/recipes-connectivity/bluez5/bluez5/0001-obex-report-notification-status-on-incoming-message.patch deleted file mode 100644 index 44bae715..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-connectivity/bluez5/bluez5/0001-obex-report-notification-status-on-incoming-message.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0d85faf308285c6a1f77f01660a2ce0541bfa5b4 Mon Sep 17 00:00:00 2001 -From: Matt Ranostay -Date: Wed, 12 Jun 2019 17:04:00 -0700 -Subject: [PATCH] obex: report notification status on incoming message - -To match doc/obex.txt on incoming message notification the respective -Status field should be set. ---- - obexd/client/map.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/obexd/client/map.c b/obexd/client/map.c -index 550c5afb4..23be2d6b2 100644 ---- a/obexd/client/map.c -+++ b/obexd/client/map.c -@@ -1914,6 +1914,7 @@ static void map_handle_notification(struct map_event *event, void *user_data) - switch (event->type) { - case MAP_ET_NEW_MESSAGE: - map_handle_new_message(map, event); -+ map_handle_status_changed(map, event, "notification"); - break; - case MAP_ET_DELIVERY_SUCCESS: - map_handle_status_changed(map, event, "delivery-success"); --- -2.20.1 - diff --git a/meta-agl/meta-agl-profile-core/recipes-connectivity/bluez5/bluez5/bluetooth.service b/meta-agl/meta-agl-profile-core/recipes-connectivity/bluez5/bluez5/bluetooth.service new file mode 100644 index 00000000..8ae83bd4 --- /dev/null +++ b/meta-agl/meta-agl-profile-core/recipes-connectivity/bluez5/bluez5/bluetooth.service @@ -0,0 +1,21 @@ +[Unit] +Description=Bluetooth service +Documentation=man:bluetoothd(8) +ConditionPathIsDirectory=/sys/class/bluetooth + +[Service] +Type=dbus +BusName=org.bluez +ExecStartPre=-/usr/bin/hciconfig hci0 aclmtu 930:10 +ExecStart=/usr/libexec/bluetooth/bluetoothd +NotifyAccess=main +#WatchdogSec=10 +#Restart=on-failure +CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE +LimitNPROC=1 +ProtectHome=true +ProtectSystem=full + +[Install] +WantedBy=bluetooth.target +Alias=dbus-org.bluez.service diff --git a/meta-agl/meta-agl-profile-core/recipes-connectivity/bluez5/bluez5/obex.service b/meta-agl/meta-agl-profile-core/recipes-connectivity/bluez5/bluez5/obex.service new file mode 100644 index 00000000..87ffff6a --- /dev/null +++ b/meta-agl/meta-agl-profile-core/recipes-connectivity/bluez5/bluez5/obex.service @@ -0,0 +1,10 @@ +[Unit] +Description=Bluetooth OBEX service + +[Service] +Type=dbus +BusName=org.bluez.obex +ExecStart=/usr/libexec/bluetooth/obexd --root=/var/volatile/tmp + +[Install] +Alias=dbus-org.bluez.obex.service diff --git a/meta-agl/meta-agl-profile-core/recipes-connectivity/bluez5/bluez5_%.bbappend b/meta-agl/meta-agl-profile-core/recipes-connectivity/bluez5/bluez5_%.bbappend index 36fb3151..52ae30bc 100644 --- a/meta-agl/meta-agl-profile-core/recipes-connectivity/bluez5/bluez5_%.bbappend +++ b/meta-agl/meta-agl-profile-core/recipes-connectivity/bluez5/bluez5_%.bbappend @@ -2,7 +2,8 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" SRC_URI_append = " \ file://bluetooth.conf \ file://tmpdir.conf \ - file://0001-obex-report-notification-status-on-incoming-message.patch \ + file://obex.service \ + file://bluetooth.service \ " FILES_${PN} += "${systemd_user_unitdir}/obex.service.d/tmpdir.conf" @@ -12,8 +13,12 @@ do_install_append() { if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then mkdir -p ${D}${systemd_user_unitdir}/obex.service.d + + install -m 0644 ${WORKDIR}/obex.service ${D}${systemd_user_unitdir} install -m 0644 ${WORKDIR}/tmpdir.conf ${D}${systemd_user_unitdir}/obex.service.d/tmpdir.conf mkdir -p ${D}/etc/systemd/user ln -sf ${systemd_user_unitdir}/obex.service ${D}/etc/systemd/user/dbus-org.bluez.obex.service + mkdir -p ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/bluetooth.service ${D}${systemd_system_unitdir} fi } diff --git a/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman.inc b/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman.inc deleted file mode 100644 index 0a117e44..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman.inc +++ /dev/null @@ -1,216 +0,0 @@ -SUMMARY = "A daemon for managing internet connections within embedded devices" -DESCRIPTION = "The ConnMan project provides a daemon for managing \ -internet connections within embedded devices running the Linux \ -operating system. The Connection Manager is designed to be slim and \ -to use as few resources as possible, so it can be easily integrated. \ -It is a fully modular system that can be extended, through plug-ins, \ -to support all kinds of wired or wireless technologies. Also, \ -configuration methods, like DHCP and domain name resolving, are \ -implemented using plug-ins." -HOMEPAGE = "http://connman.net/" -BUGTRACKER = "https://01.org/jira/browse/CM" -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ - file://src/main.c;beginline=1;endline=20;md5=486a279a6ab0c8d152bcda3a5b5edc36" - -inherit autotools pkgconfig systemd update-rc.d bluetooth update-alternatives - -DEPENDS = "dbus glib-2.0 ppp readline" - -INC_PR = "r20" - -EXTRA_OECONF += "\ - ac_cv_path_WPASUPPLICANT=${sbindir}/wpa_supplicant \ - ac_cv_path_PPPD=${sbindir}/pppd \ - --enable-debug \ - --enable-loopback \ - --enable-ethernet \ - --enable-tools \ - --disable-polkit \ - --enable-client \ -" - -PACKAGECONFIG ??= "wispr \ - ${@bb.utils.filter('DISTRO_FEATURES', '3g systemd wifi', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \ - iptables \ -" - -# If you want ConnMan to support VPN, add following statement into -# local.conf or distro config -# PACKAGECONFIG_append_pn-connman = " openvpn vpnc l2tp pptp" - -PACKAGECONFIG[systemd] = "--with-systemdunitdir=${systemd_unitdir}/system/ --with-tmpfilesdir=${sysconfdir}/tmpfiles.d/,--with-systemdunitdir='' --with-tmpfilesdir=''" -PACKAGECONFIG[wifi] = "--enable-wifi, --disable-wifi, wpa-supplicant, wpa-supplicant" -PACKAGECONFIG[bluez] = "--enable-bluetooth, --disable-bluetooth, ${BLUEZ}, ${BLUEZ}" -PACKAGECONFIG[3g] = "--enable-ofono, --disable-ofono, ofono, ofono" -PACKAGECONFIG[tist] = "--enable-tist,--disable-tist," -PACKAGECONFIG[openvpn] = "--enable-openvpn --with-openvpn=${sbindir}/openvpn,--disable-openvpn,,openvpn" -PACKAGECONFIG[vpnc] = "--enable-vpnc --with-vpnc=${sbindir}/vpnc,--disable-vpnc,,vpnc" -PACKAGECONFIG[l2tp] = "--enable-l2tp --with-l2tp=${sbindir}/xl2tpd,--disable-l2tp,,xl2tpd" -PACKAGECONFIG[pptp] = "--enable-pptp --with-pptp=${sbindir}/pptp,--disable-pptp,,pptp-linux" -# WISPr support for logging into hotspots, requires TLS -PACKAGECONFIG[wispr] = "--enable-wispr,--disable-wispr,gnutls," -PACKAGECONFIG[nftables] = "--with-firewall=nftables ,,libmnl libnftnl,,kernel-module-nf-tables-ipv4 kernel-module-nft-chain-nat-ipv4 kernel-module-nft-chain-route-ipv4 kernel-module-nft-meta kernel-module-nft-masq-ipv4 kernel-module-nft-nat" -PACKAGECONFIG[iptables] = "--with-firewall=iptables ,,iptables,iptables" - -INITSCRIPT_NAME = "connman" -INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ." - -python __anonymous () { - systemd_packages = "${PN}" - pkgconfig = d.getVar('PACKAGECONFIG') - if ('openvpn' or 'vpnc' or 'l2tp' or 'pptp') in pkgconfig.split(): - systemd_packages += " ${PN}-vpn" - d.setVar('SYSTEMD_PACKAGES', systemd_packages) -} - -SYSTEMD_SERVICE_${PN} = "connman.service" -SYSTEMD_SERVICE_${PN}-vpn = "connman-vpn.service" -SYSTEMD_SERVICE_${PN}-wait-online = "connman-wait-online.service" - -ALTERNATIVE_PRIORITY = "100" -ALTERNATIVE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}" -ALTERNATIVE_TARGET[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv-conf.connman','',d)}" -ALTERNATIVE_LINK_NAME[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv.conf','',d)}" - -do_install_append() { - if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then - install -d ${D}${sysconfdir}/init.d - install -m 0755 ${WORKDIR}/connman ${D}${sysconfdir}/init.d/connman - sed -i s%@DATADIR@%${datadir}% ${D}${sysconfdir}/init.d/connman - fi - - install -d ${D}${bindir} - install -m 0755 ${B}/tools/*-test ${D}${bindir} - if [ -e ${B}/tools/wispr ]; then - install -m 0755 ${B}/tools/wispr ${D}${bindir} - fi - install -m 0755 ${B}/client/connmanctl ${D}${bindir} - - # We don't need to package an empty directory - rmdir --ignore-fail-on-non-empty ${D}${libdir}/connman/scripts - - # Automake 1.12 won't install empty directories, but we need the - # plugins directory to be present for ownership - mkdir -p ${D}${libdir}/connman/plugins - - # For read-only filesystem, do not create links during bootup - if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then - ln -sf ../run/connman/resolv.conf ${D}${sysconfdir}/resolv-conf.connman - fi -} - -# These used to be plugins, but now they are core -RPROVIDES_${PN} = "\ - connman-plugin-loopback \ - connman-plugin-ethernet \ - ${@bb.utils.contains('PACKAGECONFIG', 'bluetooth','connman-plugin-bluetooth', '', d)} \ - ${@bb.utils.contains('PACKAGECONFIG', 'wifi','connman-plugin-wifi', '', d)} \ - ${@bb.utils.contains('PACKAGECONFIG', '3g','connman-plugin-ofono', '', d)} \ - " - -RDEPENDS_${PN} = "\ - dbus \ - " - -PACKAGES_DYNAMIC += "^${PN}-plugin-.*" - -def add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, add_insane_skip): - plugintype = pkg.split( '-' )[-1] - if plugintype in depmap: - rdepends = map(lambda x: multilib_prefix + x, \ - depmap[plugintype].split()) - d.setVar("RDEPENDS_%s" % pkg, " ".join(rdepends)) - if add_insane_skip: - d.appendVar("INSANE_SKIP_%s" % pkg, "dev-so") - -python populate_packages_prepend() { - depmap = dict(pppd="ppp") - multilib_prefix = (d.getVar("MLPREFIX") or "") - - hook = lambda file,pkg,x,y,z: \ - add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, False) - plugin_dir = d.expand('${libdir}/connman/plugins/') - plugin_name = d.expand('${PN}-plugin-%s') - do_split_packages(d, plugin_dir, r'^(.*).so$', plugin_name, \ - '${PN} plugin for %s', extra_depends='', hook=hook, prepend=True ) - - hook = lambda file,pkg,x,y,z: \ - add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, True) - plugin_dir = d.expand('${libdir}/connman/plugins-vpn/') - plugin_name = d.expand('${PN}-plugin-vpn-%s') - do_split_packages(d, plugin_dir, r'^(.*).so$', plugin_name, \ - '${PN} VPN plugin for %s', extra_depends='', hook=hook, prepend=True ) -} - -PACKAGES =+ "${PN}-tools ${PN}-tests ${PN}-client" - -FILES_${PN}-tools = "${bindir}/wispr" -RDEPENDS_${PN}-tools ="${PN}" - -FILES_${PN}-tests = "${bindir}/*-test" - -FILES_${PN}-client = "${bindir}/connmanctl" -RDEPENDS_${PN}-client ="${PN}" - -FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*.so.* \ - ${libdir}/connman/plugins \ - ${sysconfdir} ${sharedstatedir} ${localstatedir} ${datadir} \ - ${base_bindir}/* ${base_sbindir}/* ${base_libdir}/*.so* ${datadir}/${PN} \ - ${datadir}/dbus-1/system-services/* \ - ${sysconfdir}/tmpfiles.d/connman_resolvconf.conf" - -FILES_${PN}-dev += "${libdir}/connman/*/*.la" - -PACKAGES =+ "${PN}-vpn ${PN}-wait-online" - -SUMMARY_${PN}-vpn = "A daemon for managing VPN connections within embedded devices" -DESCRIPTION_${PN}-vpn = "The ConnMan VPN provides a daemon for \ -managing VPN connections within embedded devices running the Linux \ -operating system. The connman-vpnd handles all the VPN connections \ -and starts/stops VPN client processes when necessary. The connman-vpnd \ -provides a DBus API for managing VPN connections. All the different \ -VPN technogies are implemented using plug-ins." -FILES_${PN}-vpn += "${sbindir}/connman-vpnd \ - ${sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf \ - ${datadir}/dbus-1/system-services/net.connman.vpn.service \ - ${systemd_unitdir}/system/connman-vpn.service" - -SUMMARY_${PN}-wait-online = "A program that will return once ConnMan has connected to a network" -DESCRIPTION_${PN}-wait-online = "A service that can be enabled so that \ -the system waits until a network connection is established." -FILES_${PN}-wait-online += "${sbindir}/connmand-wait-online \ - ${systemd_unitdir}/system/connman-wait-online.service" - -SUMMARY_${PN}-plugin-vpn-openvpn = "An OpenVPN plugin for ConnMan VPN" -DESCRIPTION_${PN}-plugin-vpn-openvpn = "The ConnMan OpenVPN plugin uses openvpn client \ -to create a VPN connection to OpenVPN server." -FILES_${PN}-plugin-vpn-openvpn += "${libdir}/connman/scripts/openvpn-script \ - ${libdir}/connman/plugins-vpn/openvpn.so" -RDEPENDS_${PN}-plugin-vpn-openvpn += "${PN}-vpn" -RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','openvpn','${PN}-plugin-vpn-openvpn', '', d)}" - -SUMMARY_${PN}-plugin-vpn-vpnc = "A vpnc plugin for ConnMan VPN" -DESCRIPTION_${PN}-plugin-vpn-vpnc = "The ConnMan vpnc plugin uses vpnc client \ -to create a VPN connection to Cisco3000 VPN Concentrator." -FILES_${PN}-plugin-vpn-vpnc += "${libdir}/connman/scripts/openconnect-script \ - ${libdir}/connman/plugins-vpn/vpnc.so" -RDEPENDS_${PN}-plugin-vpn-vpnc += "${PN}-vpn" -RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','vpnc','${PN}-plugin-vpn-vpnc', '', d)}" - -SUMMARY_${PN}-plugin-vpn-l2tp = "A L2TP plugin for ConnMan VPN" -DESCRIPTION_${PN}-plugin-vpn-l2tp = "The ConnMan L2TP plugin uses xl2tpd daemon \ -to create a VPN connection to L2TP server." -FILES_${PN}-plugin-vpn-l2tp += "${libdir}/connman/scripts/libppp-plugin.so* \ - ${libdir}/connman/plugins-vpn/l2tp.so" -RDEPENDS_${PN}-plugin-vpn-l2tp += "${PN}-vpn" -RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','l2tp','${PN}-plugin-vpn-l2tp', '', d)}" - -SUMMARY_${PN}-plugin-vpn-pptp = "A PPTP plugin for ConnMan VPN" -DESCRIPTION_${PN}-plugin-vpn-pptp = "The ConnMan PPTP plugin uses pptp-linux client \ -to create a VPN connection to PPTP server." -FILES_${PN}-plugin-vpn-pptp += "${libdir}/connman/scripts/libppp-plugin.so* \ - ${libdir}/connman/plugins-vpn/pptp.so" -RDEPENDS_${PN}-plugin-vpn-pptp += "${PN}-vpn" -RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','pptp','${PN}-plugin-vpn-pptp', '', d)}" diff --git a/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/0001-Fix-various-issues-which-cause-problems-under-musl.patch b/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/0001-Fix-various-issues-which-cause-problems-under-musl.patch deleted file mode 100644 index f344fea1..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/0001-Fix-various-issues-which-cause-problems-under-musl.patch +++ /dev/null @@ -1,362 +0,0 @@ -From 181ff3439783c6920f5211730672685a210c318f Mon Sep 17 00:00:00 2001 -From: Ross Burton -Date: Mon, 8 Oct 2018 22:12:56 +0200 -Subject: [PATCH] Fix various issues which cause problems under musl - -Instead of using #define _GNU_SOURCE in some source files which causes -problems when building with musl as more files need the define, simply -use AC_USE_SYSTEM_EXTENSIONS in configure.ac to get it defined globally. - -Signed-off-by: Ross Burton -Upstream-Status: Backport [bd1326ba7d68df38c5ccaafd2403a5fb30bd452b] ---- - configure.ac | 3 +++ - gdhcp/client.c | 1 - - gdhcp/common.h | 5 +++-- - gweb/gresolv.c | 1 + - plugins/tist.c | 1 - - plugins/wifi.c | 3 +-- - src/backtrace.c | 1 - - src/inet.c | 1 - - src/ippool.c | 1 - - src/iptables.c | 2 +- - src/log.c | 1 - - src/ntp.c | 1 - - src/resolver.c | 1 - - src/rfkill.c | 1 - - src/stats.c | 1 - - src/tethering.c | 2 -- - src/timezone.c | 1 - - tools/dhcp-test.c | 1 - - tools/dnsproxy-test.c | 1 + - tools/private-network-test.c | 2 +- - tools/stats-tool.c | 1 - - tools/tap-test.c | 3 +-- - tools/wispr.c | 1 - - vpn/plugins/vpn.c | 1 - - 24 files changed, 12 insertions(+), 25 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 39745f76..984126c2 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -20,6 +20,7 @@ AC_SUBST(abs_top_srcdir) - AC_SUBST(abs_top_builddir) - - AC_LANG_C -+AC_USE_SYSTEM_EXTENSIONS - - AC_PROG_CC - AM_PROG_CC_C_O -@@ -185,6 +186,8 @@ AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [ - AC_CHECK_HEADERS([execinfo.h]) - AM_CONDITIONAL([BACKTRACE], [test "${ac_cv_header_execinfo_h}" = "yes"]) - -+AC_CHECK_MEMBERS([struct in6_pktinfo.ipi6_addr], [], [], [[#include ]]) -+ - AC_CHECK_FUNC(signalfd, dummy=yes, - AC_MSG_ERROR(signalfd support is required)) - -diff --git a/gdhcp/client.c b/gdhcp/client.c -index 67357782..c7db76f0 100644 ---- a/gdhcp/client.c -+++ b/gdhcp/client.c -@@ -23,7 +23,6 @@ - #include - #endif - --#define _GNU_SOURCE - #include - #include - #include -diff --git a/gdhcp/common.h b/gdhcp/common.h -index 75abc183..6899499e 100644 ---- a/gdhcp/common.h -+++ b/gdhcp/common.h -@@ -19,6 +19,7 @@ - * - */ - -+#include - #include - #include - -@@ -170,8 +171,8 @@ static const uint8_t dhcp_option_lengths[] = { - [OPTION_U32] = 4, - }; - --/* already defined within netinet/in.h if using GNU compiler */ --#ifndef __USE_GNU -+/* already defined within netinet/in.h if using glibc or musl */ -+#ifndef HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR - struct in6_pktinfo { - struct in6_addr ipi6_addr; /* src/dst IPv6 address */ - unsigned int ipi6_ifindex; /* send/recv interface index */ -diff --git a/gweb/gresolv.c b/gweb/gresolv.c -index 81c79b6c..b06f8932 100644 ---- a/gweb/gresolv.c -+++ b/gweb/gresolv.c -@@ -29,6 +29,7 @@ - #include - #include - #include -+#include - #include - #include - #include -diff --git a/plugins/tist.c b/plugins/tist.c -index ad5ef79e..cc2800a1 100644 ---- a/plugins/tist.c -+++ b/plugins/tist.c -@@ -23,7 +23,6 @@ - #include - #endif - --#define _GNU_SOURCE - #include - #include - #include -diff --git a/plugins/wifi.c b/plugins/wifi.c -index dc08c6af..46e4cca4 100644 ---- a/plugins/wifi.c -+++ b/plugins/wifi.c -@@ -30,9 +30,8 @@ - #include - #include - #include --#include --#include - #include -+#include - - #ifndef IFF_LOWER_UP - #define IFF_LOWER_UP 0x10000 -diff --git a/src/backtrace.c b/src/backtrace.c -index e8d7f432..bede6698 100644 ---- a/src/backtrace.c -+++ b/src/backtrace.c -@@ -24,7 +24,6 @@ - #include - #endif - --#define _GNU_SOURCE - #include - #include - #include -diff --git a/src/inet.c b/src/inet.c -index a31372b5..a58ce7c1 100644 ---- a/src/inet.c -+++ b/src/inet.c -@@ -25,7 +25,6 @@ - #include - #endif - --#define _GNU_SOURCE - #include - #include - #include -diff --git a/src/ippool.c b/src/ippool.c -index cea1dccd..8a645da2 100644 ---- a/src/ippool.c -+++ b/src/ippool.c -@@ -28,7 +28,6 @@ - #include - #include - #include --#include - #include - - #include "connman.h" -diff --git a/src/iptables.c b/src/iptables.c -index f3670e77..469effed 100644 ---- a/src/iptables.c -+++ b/src/iptables.c -@@ -28,7 +28,7 @@ - #include - #include - #include --#include -+#include - #include - #include - #include -diff --git a/src/log.c b/src/log.c -index 9bae4a3d..f7e82e5d 100644 ---- a/src/log.c -+++ b/src/log.c -@@ -23,7 +23,6 @@ - #include - #endif - --#define _GNU_SOURCE - #include - #include - #include -diff --git a/src/ntp.c b/src/ntp.c -index 51ba9aac..724ca188 100644 ---- a/src/ntp.c -+++ b/src/ntp.c -@@ -23,7 +23,6 @@ - #include - #endif - --#define _GNU_SOURCE - #include - #include - #include -diff --git a/src/resolver.c b/src/resolver.c -index 76f0a8e1..10121aa5 100644 ---- a/src/resolver.c -+++ b/src/resolver.c -@@ -23,7 +23,6 @@ - #include - #endif - --#define _GNU_SOURCE - #include - #include - #include -diff --git a/src/rfkill.c b/src/rfkill.c -index d9bed4d2..b2514c41 100644 ---- a/src/rfkill.c -+++ b/src/rfkill.c -@@ -23,7 +23,6 @@ - #include - #endif - --#define _GNU_SOURCE - #include - #include - #include -diff --git a/src/stats.c b/src/stats.c -index 663bc382..c9ddc2e8 100644 ---- a/src/stats.c -+++ b/src/stats.c -@@ -23,7 +23,6 @@ - #include - #endif - --#define _GNU_SOURCE - #include - #include - #include -diff --git a/src/tethering.c b/src/tethering.c -index 4b202369..f3cb36f4 100644 ---- a/src/tethering.c -+++ b/src/tethering.c -@@ -34,8 +34,6 @@ - #include - #include - #include --#include --#include - #include - - #include "connman.h" -diff --git a/src/timezone.c b/src/timezone.c -index e346b11a..8e912670 100644 ---- a/src/timezone.c -+++ b/src/timezone.c -@@ -23,7 +23,6 @@ - #include - #endif - --#define _GNU_SOURCE - #include - #include - #include -diff --git a/tools/dhcp-test.c b/tools/dhcp-test.c -index c34e10a8..eae66fc2 100644 ---- a/tools/dhcp-test.c -+++ b/tools/dhcp-test.c -@@ -33,7 +33,6 @@ - #include - #include - #include --#include - - #include - -diff --git a/tools/dnsproxy-test.c b/tools/dnsproxy-test.c -index 551cae91..371e2e23 100644 ---- a/tools/dnsproxy-test.c -+++ b/tools/dnsproxy-test.c -@@ -24,6 +24,7 @@ - #endif - - #include -+#include - #include - #include - #include -diff --git a/tools/private-network-test.c b/tools/private-network-test.c -index 3dd115ba..2828bb30 100644 ---- a/tools/private-network-test.c -+++ b/tools/private-network-test.c -@@ -32,7 +32,7 @@ - #include - #include - #include --#include -+#include - #include - #include - -diff --git a/tools/stats-tool.c b/tools/stats-tool.c -index efa39de2..5695048f 100644 ---- a/tools/stats-tool.c -+++ b/tools/stats-tool.c -@@ -22,7 +22,6 @@ - #include - #endif - --#define _GNU_SOURCE - #include - #include - #include -diff --git a/tools/tap-test.c b/tools/tap-test.c -index fdc098aa..cb3ee622 100644 ---- a/tools/tap-test.c -+++ b/tools/tap-test.c -@@ -23,13 +23,12 @@ - #include - #endif - --#define _GNU_SOURCE - #include - #include - #include - #include - #include --#include -+#include - #include - - #include -diff --git a/tools/wispr.c b/tools/wispr.c -index d5f9341f..e56dfc16 100644 ---- a/tools/wispr.c -+++ b/tools/wispr.c -@@ -23,7 +23,6 @@ - #include - #endif - --#define _GNU_SOURCE - #include - #include - #include -diff --git a/vpn/plugins/vpn.c b/vpn/plugins/vpn.c -index 10548aaf..6e3f640c 100644 ---- a/vpn/plugins/vpn.c -+++ b/vpn/plugins/vpn.c -@@ -23,7 +23,6 @@ - #include - #endif - --#define _GNU_SOURCE - #include - #include - #include --- -2.17.1 - diff --git a/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/0001-connman.service-stop-systemd-resolved-when-we-use-co.patch b/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/0001-connman.service-stop-systemd-resolved-when-we-use-co.patch deleted file mode 100644 index 8e2e0bd0..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/0001-connman.service-stop-systemd-resolved-when-we-use-co.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 9f70b94ebf18f52c115634642652830fa77f27a1 Mon Sep 17 00:00:00 2001 -From: "Maxin B. John" -Date: Mon, 12 Jun 2017 16:52:39 +0300 -Subject: [PATCH] connman.service: stop systemd-resolved when we use connman - -Stop systemd-resolved service when we use connman as network manager. - -Upstream-Status: Inappropriate [configuration] - -Signed-off-by: Maxin B. John ---- - src/connman.service.in | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/connman.service.in b/src/connman.service.in -index 9f5c10f..dab48bc 100644 ---- a/src/connman.service.in -+++ b/src/connman.service.in -@@ -6,6 +6,7 @@ RequiresMountsFor=@localstatedir@/lib/connman - After=dbus.service network-pre.target systemd-sysusers.service - Before=network.target multi-user.target shutdown.target - Wants=network.target -+Conflicts=systemd-resolved.service - - [Service] - Type=dbus --- -2.4.0 - diff --git a/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch b/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch deleted file mode 100644 index e6f03e63..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 4ddaf78dad5a9ee4a0658235f71b75132192123e Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 7 Apr 2012 18:52:12 -0700 -Subject: [PATCH] plugin.h: Change visibility to default for debug symbols - -gold refuses to link in undefined weak symbols which -have hidden visibility - -Signed-off-by: Khem Raj - - -Upstream-Status: Pending ---- - include/plugin.h | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/include/plugin.h b/include/plugin.h -index 692a4e5..a9361c3 100644 ---- a/include/plugin.h -+++ b/include/plugin.h -@@ -89,9 +89,9 @@ struct connman_plugin_desc { - #else - #define CONNMAN_PLUGIN_DEFINE(name, description, version, priority, init, exit) \ - extern struct connman_debug_desc __start___debug[] \ -- __attribute__ ((weak, visibility("hidden"))); \ -+ __attribute__ ((weak, visibility("default"))); \ - extern struct connman_debug_desc __stop___debug[] \ -- __attribute__ ((weak, visibility("hidden"))); \ -+ __attribute__ ((weak, visibility("default"))); \ - extern struct connman_plugin_desc connman_plugin_desc \ - __attribute__ ((visibility("default"))); \ - struct connman_plugin_desc connman_plugin_desc = { \ --- -1.7.5.4 - diff --git a/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/0002-resolve-musl-does-not-implement-res_ninit.patch b/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/0002-resolve-musl-does-not-implement-res_ninit.patch deleted file mode 100644 index 639ccfa2..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/0002-resolve-musl-does-not-implement-res_ninit.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 10b0d16d04b811b1ccd1f9b0cfe757bce8d876a1 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 6 Apr 2015 23:02:21 -0700 -Subject: [PATCH 2/3] resolve: musl does not implement res_ninit - -ported from -http://git.alpinelinux.org/cgit/aports/plain/testing/connman/libresolv.patch - -Upstream-Status: Pending - -Signed-off-by: Khem Raj ---- - gweb/gresolv.c | 33 ++++++++++++--------------------- - 1 file changed, 12 insertions(+), 21 deletions(-) - -diff --git a/gweb/gresolv.c b/gweb/gresolv.c -index 5cf7a9a..3ad8e70 100644 ---- a/gweb/gresolv.c -+++ b/gweb/gresolv.c -@@ -36,6 +36,7 @@ - #include - #include - #include -+#include - - #include "gresolv.h" - -@@ -875,8 +875,6 @@ GResolv *g_resolv_new(int index) - resolv->index = index; - resolv->nameserver_list = NULL; - -- res_ninit(&resolv->res); -- - return resolv; - } - -@@ -916,8 +914,6 @@ void g_resolv_unref(GResolv *resolv) - - flush_nameservers(resolv); - -- res_nclose(&resolv->res); -- - g_free(resolv); - } - -@@ -1020,24 +1016,19 @@ guint g_resolv_lookup_hostname(GResolv *resolv, const char *hostname, - debug(resolv, "hostname %s", hostname); - - if (!resolv->nameserver_list) { -- int i; -- -- for (i = 0; i < resolv->res.nscount; i++) { -- char buf[100]; -- int family = resolv->res.nsaddr_list[i].sin_family; -- void *sa_addr = &resolv->res.nsaddr_list[i].sin_addr; -- -- if (family != AF_INET && -- resolv->res._u._ext.nsaddrs[i]) { -- family = AF_INET6; -- sa_addr = &resolv->res._u._ext.nsaddrs[i]->sin6_addr; -+ FILE *f = fopen("/etc/resolv.conf", "r"); -+ if (f) { -+ char line[256], *s; -+ int i; -+ while (fgets(line, sizeof(line), f)) { -+ if (strncmp(line, "nameserver", 10) || !isspace(line[10])) -+ continue; -+ for (s = &line[11]; isspace(s[0]); s++); -+ for (i = 0; s[i] && !isspace(s[i]); i++); -+ s[i] = 0; -+ g_resolv_add_nameserver(resolv, s, 53, 0); - } -- -- if (family != AF_INET && family != AF_INET6) -- continue; -- -- if (inet_ntop(family, sa_addr, buf, sizeof(buf))) -- g_resolv_add_nameserver(resolv, buf, 53, 0); -+ fclose(f); - } - - if (!resolv->nameserver_list) --- -2.5.1 - diff --git a/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/connman b/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/connman deleted file mode 100644 index c64fa0d7..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/connman +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh - -DAEMON=/usr/sbin/connmand -PIDFILE=/var/run/connmand.pid -DESC="Connection Manager" - -if [ -f /etc/default/connman ] ; then - . /etc/default/connman -fi - -set -e - -nfsroot=0 - -exec 9<&0 < /proc/mounts -while read dev mtpt fstype rest; do - if test $mtpt = "/" ; then - case $fstype in - nfs | nfs4) - nfsroot=1 - break - ;; - *) - ;; - esac - fi -done - -do_start() { - EXTRA_PARAM="" - if test $nfsroot -eq 1 ; then - NET_DEVS=`cat /proc/net/dev | sed -ne 's/^\([a-zA-Z0-9 ]*\):.*$/\1/p'` - NET_ADDR=`cat /proc/cmdline | sed -ne 's/^.*ip=\([^ :]*\).*$/\1/p'` - - if [ ! -z "$NET_ADDR" ]; then - if [ "$NET_ADDR" = dhcp ]; then - ethn=`ifconfig | grep "^eth" | sed -e "s/\(eth[0-9]\)\(.*\)/\1/"` - if [ ! -z "$ethn" ]; then - EXTRA_PARAM="-I $ethn" - fi - else - for i in $NET_DEVS; do - ADDR=`ifconfig $i | sed 's/addr://g' | sed -ne 's/^.*inet \([0-9.]*\) .*$/\1/p'` - if [ "$NET_ADDR" = "$ADDR" ]; then - EXTRA_PARAM="-I $i" - break - fi - done - fi - fi - fi - if [ -f @DATADIR@/connman/wired-setup ] ; then - . @DATADIR@/connman/wired-setup - fi - $DAEMON $EXTRA_PARAM -} - -do_stop() { - start-stop-daemon --stop --name connmand --quiet -} - -case "$1" in - start) - echo "Starting $DESC" - do_start - ;; - stop) - echo "Stopping $DESC" - do_stop - ;; - restart|force-reload) - echo "Restarting $DESC" - do_stop - sleep 1 - do_start - ;; - *) - echo "Usage: $0 {start|stop|restart|force-reload}" >&2 - exit 1 - ;; -esac - -exit 0 diff --git a/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/no-version-scripts.patch b/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/no-version-scripts.patch deleted file mode 100644 index e96e38bc..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman/no-version-scripts.patch +++ /dev/null @@ -1,27 +0,0 @@ -With binutils 2.27 on at least MIPS, connmand will crash on startup. This -appears to be due to the symbol visibilty scripts hiding symbols that stdio -looks up at runtime, resulting in it segfaulting. - -This certainly appears to be a bug in binutils 2.27 although the problem has -been known about for some time: - -https://sourceware.org/bugzilla/show_bug.cgi?id=17908 - -As the version scripts are only used to hide symbols from plugins we can safely -remove the scripts to work around the problem until binutils is fixed. - -Upstream-Status: Inappropriate -Signed-off-by: Ross Burton - -diff --git a/Makefile.am b/Makefile.am -index d70725c..76ae432 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -132,2 +132 @@ src_connmand_LDADD = gdbus/libgdbus-internal.la $(builtin_libadd) \ --src_connmand_LDFLAGS = -Wl,--export-dynamic \ -- -Wl,--version-script=$(srcdir)/src/connman.ver -+src_connmand_LDFLAGS = -Wl,--export-dynamic -@@ -166,2 +165 @@ vpn_connman_vpnd_LDADD = gdbus/libgdbus-internal.la $(builtin_vpn_libadd) \ --vpn_connman_vpnd_LDFLAGS = -Wl,--export-dynamic \ -- -Wl,--version-script=$(srcdir)/vpn/vpn.ver -+vpn_connman_vpnd_LDFLAGS = -Wl,--export-dynamic diff --git a/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman_1.36.bb b/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman_1.36.bb deleted file mode 100644 index 6e4dbdfd..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-connectivity/connman/connman_1.36.bb +++ /dev/null @@ -1,16 +0,0 @@ -require connman.inc - -SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \ - file://0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch \ - file://0001-connman.service-stop-systemd-resolved-when-we-use-co.patch \ - file://connman \ - file://no-version-scripts.patch \ - file://0001-Fix-various-issues-which-cause-problems-under-musl.patch \ -" - -SRC_URI_append_libc-musl = " file://0002-resolve-musl-does-not-implement-res_ninit.patch" - -SRC_URI[md5sum] = "dae77d9c904d2c223ae849e32079d57e" -SRC_URI[sha256sum] = "c789db41cc443fa41e661217ea321492ad59a004bebcd1aa013f3bc10a6e0074" - -RRECOMMENDS_${PN} = "connman-conf" diff --git a/meta-agl/meta-agl-profile-core/recipes-connectivity/libnfc/libnfc_git.bb b/meta-agl/meta-agl-profile-core/recipes-connectivity/libnfc/libnfc_git.bb deleted file mode 100644 index bd216f81..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-connectivity/libnfc/libnfc_git.bb +++ /dev/null @@ -1,18 +0,0 @@ -SUMMARY = "libnfc" -DESCRIPTION = "Platform independent Near Field Communication (NFC) library" -HOMEPAGE = "https://github.com/nfc-tools/libnfc" -SECTION = "apps" - -DEPENDS = "libusb" - -LICENSE = "LGPLv3" -LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=b52f2d57d10c4f7ee67a7eb9615d5d24" - -inherit cmake pkgconfig - -SRC_URI = "git://github.com/nfc-tools/libnfc;protocol=https;branch=master" -SRCREV = "2d4543673e9b76c02679ca8b89259659f1afd932" - -PV = "1.7.1+git${SRCPV}" -S = "${WORKDIR}/git" - diff --git a/meta-agl/meta-agl-profile-core/recipes-connectivity/neardal/neardal_0.14.bb b/meta-agl/meta-agl-profile-core/recipes-connectivity/neardal/neardal_0.14.bb index 8bec79e6..f8634c46 100644 --- a/meta-agl/meta-agl-profile-core/recipes-connectivity/neardal/neardal_0.14.bb +++ b/meta-agl/meta-agl-profile-core/recipes-connectivity/neardal/neardal_0.14.bb @@ -1,9 +1,10 @@ require neardal.inc -SRC_URI = "https://github.com/connectivity/neardal/archive/${PV}.tar.gz \ +SRC_URI = "git://github.com/connectivity/neardal.git;protocol=https \ file://ncl.patch \ file://0001-neardal-ncl-fix-segfault-on-help-page-being-displaye.patch \ file://0002-neardal-lib-fix-memory-corruption.patch \ " -SRC_URI[md5sum] = "3dbda58253ca30ee6a7a7573eaa68f40" -SRC_URI[sha256sum] = "157d320bd831d91a82203d9697d2d2a2cebdb515d6e1c4ce04fe8ef27d1da615" +SRCREV = "fe0fa79c94e9a0f1c2cfa1f58b3acc9bdc7d5e13" + +S = "${WORKDIR}/git" diff --git a/meta-agl/meta-agl-profile-core/recipes-connectivity/rtl-sdr/rtl-sdr_0.5.3.bb b/meta-agl/meta-agl-profile-core/recipes-connectivity/rtl-sdr/rtl-sdr_0.5.3.bb index de6da5e8..b442d9f4 100644 --- a/meta-agl/meta-agl-profile-core/recipes-connectivity/rtl-sdr/rtl-sdr_0.5.3.bb +++ b/meta-agl/meta-agl-profile-core/recipes-connectivity/rtl-sdr/rtl-sdr_0.5.3.bb @@ -22,7 +22,7 @@ do_configure_append() { # remove included temporary path from pc file due to pass-through of OE CFLAGS # debug-prefix-map # See: http://lists.openembedded.org/pipermail/openembedded-devel/2016-May/107456.html - sed -i -e "s# -fdebug-prefix-map=.*##g" librtlsdr.pc + sed -i -e "s# -fdebug-prefix-map=.*##g;s# -fmacro-prefix-map=.*##g" librtlsdr.pc } do_install_append() { diff --git a/meta-agl/meta-agl-profile-core/recipes-core/glibc/.appends.core b/meta-agl/meta-agl-profile-core/recipes-core/glibc/.appends.core deleted file mode 100644 index e69de29b..00000000 diff --git a/meta-agl/meta-agl-profile-core/recipes-core/glibc/glibc/arm/local-arm-futex.diff b/meta-agl/meta-agl-profile-core/recipes-core/glibc/glibc/arm/local-arm-futex.diff deleted file mode 100644 index 27d1144d..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-core/glibc/glibc/arm/local-arm-futex.diff +++ /dev/null @@ -1,22 +0,0 @@ -Description: Lie about futex_atomic_cmpxchg_inatomic kernel support. - In past versions of glibc, we incorrectly assumed all ARM kernels - in all configurations supported futex_atomic_cmpxchg_inatomic. This - was clearly a lie, however it was a lie that we relied on, because - the fallback implementation appears to not play nicely with certain - applications like pulseaudio. Restore the lie for kernels > 2.6.32 - and plug our ears and scream "LA LA LA" about how wrong this is. -Author: Adam Conrad -Bug-Ubuntu: https://launchpad.net/bugs/1436162 -Bug-Debian: https://bugs.debian.org/788799 -Last-Update: 2015-03-25 - ---- a/sysdeps/unix/sysv/linux/arm/kernel-features.h -+++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h -@@ -22,7 +22,7 @@ - /* The ARM kernel before 3.14.3 may or may not support - futex_atomic_cmpxchg_inatomic, depending on kernel - configuration. */ --#if __LINUX_KERNEL_VERSION < 0x030E03 -+#if __LINUX_KERNEL_VERSION < 0x020620 - # undef __ASSUME_SET_ROBUST_LIST - #endif diff --git a/meta-agl/meta-agl-profile-core/recipes-core/glibc/glibc_2.2%.bbappend b/meta-agl/meta-agl-profile-core/recipes-core/glibc/glibc_2.2%.bbappend deleted file mode 100644 index 0868a2c7..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-core/glibc/glibc_2.2%.bbappend +++ /dev/null @@ -1,3 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -SRC_URI_append_arm = " file://arm/local-arm-futex.diff " diff --git a/meta-agl/meta-agl-profile-core/recipes-core/psplash/files/psplash-anim b/meta-agl/meta-agl-profile-core/recipes-core/psplash/files/psplash-anim deleted file mode 100755 index ac9bf674..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-core/psplash/files/psplash-anim +++ /dev/null @@ -1,11 +0,0 @@ -#/bin/bash - -psplash-default "$@" & -sleep .2 -while :; do - for x in 0 1 2 3 4 5 6 7 8 9 10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 -1 -2 -3 -4 -5 -6 -7 -8 -9 10 9 8 7 6 5 4 3 2 1; do - psplash-write "PROGRESS ${x}0" || exit 0 - psplash-write "MSG $(journalctl -n1 -ocat)" || exit 0 - sleep .1 - done -done diff --git a/meta-agl/meta-agl-profile-core/recipes-core/psplash/files/psplash-quit.service b/meta-agl/meta-agl-profile-core/recipes-core/psplash/files/psplash-quit.service deleted file mode 100644 index 14bd4994..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-core/psplash/files/psplash-quit.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Terminate Psplash Boot Screen -After=psplash-start.service - -[Service] -Type=oneshot -ExecStart=/usr/bin/psplash-write QUIT -TimeoutSec=20 - -[Install] -WantedBy=multi-user.target diff --git a/meta-agl/meta-agl-profile-core/recipes-core/psplash/files/psplash-start.service b/meta-agl/meta-agl-profile-core/recipes-core/psplash/files/psplash-start.service deleted file mode 100644 index d3b6940d..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-core/psplash/files/psplash-start.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Start Psplash Boot Screen -Wants=systemd-vconsole-setup.service -After=systemd-vconsole-setup.service systemd-udev-trigger.service systemd-udevd.service -DefaultDependencies=no - -[Service] -ExecStartPre=/bin/sh -c "if [ -e /sys/class/graphics/fbcon/cursor_blink ]; then echo 0 > /sys/class/graphics/fbcon/cursor_blink; fi" -ExecStart=/bin/bash -c "/usr/bin/psplash-anim -n -a 90" - -[Install] -WantedBy=sysinit.target diff --git a/meta-agl/meta-agl-profile-core/recipes-core/psplash/psplash_git.bbappend b/meta-agl/meta-agl-profile-core/recipes-core/psplash/psplash_git.bbappend index bdc196b6..5a82fc87 100644 --- a/meta-agl/meta-agl-profile-core/recipes-core/psplash/psplash_git.bbappend +++ b/meta-agl/meta-agl-profile-core/recipes-core/psplash/psplash_git.bbappend @@ -1,27 +1,9 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:" -SRC_URI += "file://psplash-colors.h \ - file://psplash-start.service \ - file://psplash-quit.service \ - file://psplash-anim \ - " +SRC_URI += "file://psplash-colors.h" SPLASH_IMAGES="file://psplash-poky-img.h;outsuffix=default" -inherit systemd - -SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${PN}', '', d)}" -SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'psplash-start.service psplash-quit.service', '', d)}" - do_configure_append () { - cd ${S} - cp ../psplash-colors.h ./ -} - -do_install_append () { - if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then - install -d ${D}${systemd_unitdir}/system - install -m 644 ${WORKDIR}/*.service ${D}/${systemd_unitdir}/system - fi - install -m 755 ${WORKDIR}/psplash-anim ${D}/${bindir} + cp -f ${WORKDIR}/psplash-colors.h ${S} } diff --git a/meta-agl/meta-agl-profile-core/recipes-core/systemd/systemd-conf_%.bbappend b/meta-agl/meta-agl-profile-core/recipes-core/systemd/systemd-conf_%.bbappend new file mode 100644 index 00000000..6661eab6 --- /dev/null +++ b/meta-agl/meta-agl-profile-core/recipes-core/systemd/systemd-conf_%.bbappend @@ -0,0 +1,4 @@ +do_install_append() { + # Remove ethernet script deployed by upstream unconditionally (SPEC-3221) + rm -rf ${D}${systemd_unitdir}/network/80-wired.network || true +} \ No newline at end of file diff --git a/meta-agl/meta-agl-profile-core/recipes-core/systemd/systemd/0001-fix-udevd-seclabel-parsing.patch b/meta-agl/meta-agl-profile-core/recipes-core/systemd/systemd/0001-fix-udevd-seclabel-parsing.patch new file mode 100644 index 00000000..29165b58 --- /dev/null +++ b/meta-agl/meta-agl-profile-core/recipes-core/systemd/systemd/0001-fix-udevd-seclabel-parsing.patch @@ -0,0 +1,34 @@ +Fix udevd SECLABEL token parsing + +The udevd rules parsing rewrite in v243 broke SECLABEL parsing, +with the result being that udevd crashes when it parses a line +containing a SECLABEL token. Fix the handling of the attribute +of SECLABEL tokens when parsing, and add a check to prevent +crashes if the attribute is missing. + +Upstream-Status: Pending + +Signed-off-by: Scott Murray + +diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c +index efea16e5c5..3e757ccb06 100644 +--- a/src/udev/udev-rules.c ++++ b/src/udev/udev-rules.c +@@ -918,7 +918,7 @@ static int parse_token(UdevRules *rules, const char *key, char *attr, UdevRuleOp + op = OP_ASSIGN; + } + +- r = rule_line_add_token(rule_line, TK_A_SECLABEL, op, value, NULL); ++ r = rule_line_add_token(rule_line, TK_A_SECLABEL, op, value, attr); + } else if (streq(key, "RUN")) { + if (is_match || op == OP_REMOVE) + return log_token_invalid_op(rules, key); +@@ -1927,6 +1927,8 @@ static int udev_rule_apply_token_to_event( + _cleanup_free_ char *name = NULL, *label = NULL; + char label_str[UTIL_LINE_SIZE] = {}; + ++ if (!token->data) ++ break; + name = strdup((const char*) token->data); + if (!name) + return log_oom(); diff --git a/meta-agl/meta-agl-profile-core/recipes-core/systemd/systemd/0001-network-add-CAN-Termination-tristate-option.patch b/meta-agl/meta-agl-profile-core/recipes-core/systemd/systemd/0001-network-add-CAN-Termination-tristate-option.patch deleted file mode 100644 index 3bc7a8f2..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-core/systemd/systemd/0001-network-add-CAN-Termination-tristate-option.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 2885f0936d3069fba7bb0078897c98f50927875c Mon Sep 17 00:00:00 2001 -From: Matt Ranostay -Date: Wed, 19 Feb 2020 12:14:53 -0800 -Subject: [PATCH] network: add CAN Termination tristate option - -Upstream-Status: Submitted -Signed-off-by: Matt Ranostay ---- - src/libsystemd/sd-netlink/netlink-types.c | 1 + - src/network/networkd-link.c | 13 +++++++++++++ - src/network/networkd-network-gperf.gperf | 1 + - src/network/networkd-network.c | 1 + - src/network/networkd-network.h | 1 + - 5 files changed, 17 insertions(+) - -diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c -index c93fe9cb4c..0ce950d5af 100644 ---- a/src/libsystemd/sd-netlink/netlink-types.c -+++ b/src/libsystemd/sd-netlink/netlink-types.c -@@ -298,6 +298,7 @@ static const NLType rtnl_link_info_data_geneve_types[] = { - static const NLType rtnl_link_info_data_can_types[] = { - [IFLA_CAN_BITTIMING] = { .size = sizeof(struct can_bittiming) }, - [IFLA_CAN_RESTART_MS] = { .type = NETLINK_TYPE_U32 }, -+ [IFLA_CAN_TERMINATION] = { .type = NETLINK_TYPE_U16 }, - }; - - /* these strings must match the .kind entries in the kernel */ -diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c -index 4afcf843bd..af1c4ef55c 100644 ---- a/src/network/networkd-link.c -+++ b/src/network/networkd-link.c -@@ -27,6 +27,8 @@ - #include "util.h" - #include "virt.h" - -+#define CAN_TERMINATION_OHM_VALUE 120 -+ - static bool link_dhcp6_enabled(Link *link) { - assert(link); - -@@ -1938,6 +1940,17 @@ static int link_set_can(Link *link) { - return log_link_error_errno(link, r, "Could not append IFLA_CAN_RESTART_MS attribute: %m"); - } - -+ if (link->network->can_termination >= 0) { -+ -+ log_link_debug(link, "%sabling can-termination", link->network->can_termination ? "En" : "Dis"); -+ -+ r = sd_netlink_message_append_u16(m, IFLA_CAN_TERMINATION, -+ link->network->can_termination ? CAN_TERMINATION_OHM_VALUE : 0); -+ if (r < 0) -+ return log_link_error_errno(link, r, "Could not append IFLA_CAN_TERMINATION attribute: %m"); -+ -+ } -+ - r = sd_netlink_message_close_container(m); - if (r < 0) - return log_link_error_errno(link, r, "Failed to close netlink container: %m"); -diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf -index 6ad5257f79..2f6b42809f 100644 ---- a/src/network/networkd-network-gperf.gperf -+++ b/src/network/networkd-network-gperf.gperf -@@ -182,6 +182,7 @@ IPv6Prefix.PreferredLifetimeSec, config_parse_prefix_lifetime, - CAN.BitRate, config_parse_si_size, 0, offsetof(Network, can_bitrate) - CAN.SamplePoint, config_parse_permille, 0, offsetof(Network, can_sample_point) - CAN.RestartSec, config_parse_sec, 0, offsetof(Network, can_restart_us) -+CAN.Termination, config_parse_tristate, 0, offsetof(Network, can_termination) - /* backwards compatibility: do not add new entries to this section */ - Network.IPv4LL, config_parse_ipv4ll, 0, offsetof(Network, link_local) - DHCPv4.UseDNS, config_parse_bool, 0, offsetof(Network, dhcp_use_dns) -diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c -index 429aac5e6c..ded66f5f43 100644 ---- a/src/network/networkd-network.c -+++ b/src/network/networkd-network.c -@@ -248,6 +248,7 @@ static int network_load_one(Manager *manager, const char *filename) { - network->ipv6_accept_ra_use_dns = true; - network->ipv6_accept_ra_route_table = RT_TABLE_MAIN; - network->ipv6_mtu = 0; -+ network->can_termination = -1; - - dropin_dirname = strjoina(network->name, ".network.d"); - -diff --git a/src/network/networkd-network.h b/src/network/networkd-network.h -index 2d46d393ac..1178510107 100644 ---- a/src/network/networkd-network.h -+++ b/src/network/networkd-network.h -@@ -190,6 +190,7 @@ struct Network { - size_t can_bitrate; - unsigned can_sample_point; - usec_t can_restart_us; -+ int can_termination; - - AddressFamilyBoolean ip_forward; - bool ip_masquerade; --- -2.25.0 - diff --git a/meta-agl/meta-agl-profile-core/recipes-core/systemd/systemd/0002-network-add-CAN-Termination-tristate-option.patch b/meta-agl/meta-agl-profile-core/recipes-core/systemd/systemd/0002-network-add-CAN-Termination-tristate-option.patch new file mode 100644 index 00000000..feaff273 --- /dev/null +++ b/meta-agl/meta-agl-profile-core/recipes-core/systemd/systemd/0002-network-add-CAN-Termination-tristate-option.patch @@ -0,0 +1,107 @@ +From 1e6ffb3129340291027d2690631f62eb7d0e0a78 Mon Sep 17 00:00:00 2001 +From: Matt Ranostay +Date: Tue, 11 Feb 2020 18:13:45 -0800 +Subject: [PATCH] network: add CAN Termination tristate option + +Upstream-Status: Submitted +Signed-off-by: Matt Ranostay +--- + src/libsystemd/sd-netlink/netlink-types.c | 1 + + src/network/networkd-can.c | 13 +++++++++++++ + src/network/networkd-network-gperf.gperf | 1 + + src/network/networkd-network.c | 1 + + src/network/networkd-network.h | 1 + + test/fuzz/fuzz-network-parser/directives.network | 1 + + 6 files changed, 18 insertions(+) + +diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c +index a55460f034..96e211dcf0 100644 +--- a/src/libsystemd/sd-netlink/netlink-types.c ++++ b/src/libsystemd/sd-netlink/netlink-types.c +@@ -316,6 +316,7 @@ static const NLType rtnl_link_info_data_can_types[] = { + [IFLA_CAN_BITTIMING] = { .size = sizeof(struct can_bittiming) }, + [IFLA_CAN_RESTART_MS] = { .type = NETLINK_TYPE_U32 }, + [IFLA_CAN_CTRLMODE] = { .size = sizeof(struct can_ctrlmode) }, ++ [IFLA_CAN_TERMINATION] = { .type = NETLINK_TYPE_U16 }, + }; + + static const NLType rtnl_link_info_data_macsec_types[] = { +diff --git a/src/network/networkd-can.c b/src/network/networkd-can.c +index 5755df57bd..3abe8ae2ed 100644 +--- a/src/network/networkd-can.c ++++ b/src/network/networkd-can.c +@@ -9,6 +9,8 @@ + #include "networkd-manager.h" + #include "string-util.h" + ++#define CAN_TERMINATION_OHM_VALUE 120 ++ + static int link_up_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) { + int r; + +@@ -152,6 +154,17 @@ static int link_set_can(Link *link) { + return log_link_error_errno(link, r, "Could not append IFLA_CAN_CTRLMODE attribute: %m"); + } + ++ if (link->network->can_termination >= 0) { ++ ++ log_link_debug(link, "%sabling can-termination", link->network->can_termination ? "En" : "Dis"); ++ ++ r = sd_netlink_message_append_u16(m, IFLA_CAN_TERMINATION, ++ link->network->can_termination ? CAN_TERMINATION_OHM_VALUE : 0); ++ if (r < 0) ++ return log_link_error_errno(link, r, "Could not append IFLA_CAN_TERMINATION attribute: %m"); ++ ++ } ++ + r = sd_netlink_message_close_container(m); + if (r < 0) + return log_link_error_errno(link, r, "Failed to close netlink container: %m"); +diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf +index f7e68be181..b3df4f3960 100644 +--- a/src/network/networkd-network-gperf.gperf ++++ b/src/network/networkd-network-gperf.gperf +@@ -245,6 +245,7 @@ CAN.BitRate, config_parse_si_size, + CAN.SamplePoint, config_parse_permille, 0, offsetof(Network, can_sample_point) + CAN.RestartSec, config_parse_sec, 0, offsetof(Network, can_restart_us) + CAN.TripleSampling, config_parse_tristate, 0, offsetof(Network, can_triple_sampling) ++CAN.Termination, config_parse_tristate, 0, offsetof(Network, can_termination) + TrafficControlQueueingDiscipline.Parent, config_parse_tc_qdiscs_parent, 0, 0 + TrafficControlQueueingDiscipline.NetworkEmulatorDelaySec, config_parse_tc_network_emulator_delay, 0, 0 + TrafficControlQueueingDiscipline.NetworkEmulatorDelayJitterSec, config_parse_tc_network_emulator_delay, 0, 0 +diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c +index 6e443975f1..0ea5c05db7 100644 +--- a/src/network/networkd-network.c ++++ b/src/network/networkd-network.c +@@ -448,6 +448,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi + .keep_configuration = _KEEP_CONFIGURATION_INVALID, + + .can_triple_sampling = -1, ++ .can_termination = -1, + .ip_service_type = -1, + }; + +diff --git a/src/network/networkd-network.h b/src/network/networkd-network.h +index aa74bb4ae7..6a1f094156 100644 +--- a/src/network/networkd-network.h ++++ b/src/network/networkd-network.h +@@ -193,6 +193,7 @@ struct Network { + unsigned can_sample_point; + usec_t can_restart_us; + int can_triple_sampling; ++ int can_termination; + + AddressFamily ip_forward; + bool ip_masquerade; +diff --git a/test/fuzz/fuzz-network-parser/directives.network b/test/fuzz/fuzz-network-parser/directives.network +index 5bd80dece8..781269d960 100644 +--- a/test/fuzz/fuzz-network-parser/directives.network ++++ b/test/fuzz/fuzz-network-parser/directives.network +@@ -194,6 +194,7 @@ SamplePoint= + BitRate= + RestartSec= + TripleSampling= ++Termination= + [Address] + DuplicateAddressDetection= + AutoJoin= diff --git a/meta-agl/meta-agl-profile-core/recipes-core/systemd/systemd_%.bbappend b/meta-agl/meta-agl-profile-core/recipes-core/systemd/systemd_%.bbappend index 078c1411..242b3d39 100644 --- a/meta-agl/meta-agl-profile-core/recipes-core/systemd/systemd_%.bbappend +++ b/meta-agl/meta-agl-profile-core/recipes-core/systemd/systemd_%.bbappend @@ -1,9 +1,10 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += "\ + file://0001-fix-udevd-seclabel-parsing.patch \ + file://0002-network-add-CAN-Termination-tristate-option.patch \ file://e2fsck.conf \ file://canbus-can.network \ - file://0001-network-add-CAN-Termination-tristate-option.patch \ ${@bb.utils.contains('VIRTUAL-RUNTIME_net_manager','systemd','file://wired.network','',d)} \ " diff --git a/meta-agl/meta-agl-profile-core/recipes-devtools/cmake-apps-module/cmake-apps-module_git.bb b/meta-agl/meta-agl-profile-core/recipes-devtools/cmake-apps-module/cmake-apps-module_git.bb index 941b8033..ea3189dd 100644 --- a/meta-agl/meta-agl-profile-core/recipes-devtools/cmake-apps-module/cmake-apps-module_git.bb +++ b/meta-agl/meta-agl-profile-core/recipes-devtools/cmake-apps-module/cmake-apps-module_git.bb @@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7ca SECTION = "apps" SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/cmake-apps-module;protocol=https;branch=${AGL_BRANCH}" -SRCREV = "bd9e1c988ec7237964c466c65792d4c77960625e" +SRCREV = "a357a6af0cf515883dfa26fd2cb80ac055a491de" PV = "${AGLVERSION}" S = "${WORKDIR}/git" diff --git a/meta-agl/meta-agl-profile-core/recipes-devtools/packagegroups/packagegroup-agl-core-devel.bb b/meta-agl/meta-agl-profile-core/recipes-devtools/packagegroups/packagegroup-agl-core-devel.bb index 97ce254f..647a0a81 100644 --- a/meta-agl/meta-agl-profile-core/recipes-devtools/packagegroups/packagegroup-agl-core-devel.bb +++ b/meta-agl/meta-agl-profile-core/recipes-devtools/packagegroups/packagegroup-agl-core-devel.bb @@ -4,7 +4,6 @@ LICENSE = "MIT" inherit packagegroup RDEPENDS_${PN} = "\ - afb-test \ strace \ ldd \ less \ @@ -25,4 +24,7 @@ RDEPENDS_${PN} = "\ libxslt-bin \ agl-service-network-tools \ gcc-sanitizers \ + pciutils \ + pyagl \ + gcov \ " diff --git a/meta-agl/meta-agl-profile-core/recipes-devtools/python/python3-asyncssh_2.3.0.bb b/meta-agl/meta-agl-profile-core/recipes-devtools/python/python3-asyncssh_2.3.0.bb new file mode 100644 index 00000000..ab7e8afa --- /dev/null +++ b/meta-agl/meta-agl-profile-core/recipes-devtools/python/python3-asyncssh_2.3.0.bb @@ -0,0 +1,15 @@ +DESCRIPTION = "\ +AsyncSSH is a Python package which provides an asynchronous client and \ +server implementation of the SSHv2 protocol on top of the Python \ +asyncio framework." +HOMEPAGE = "https://github.com/ronf/asyncssh" +LICENSE = "EPL-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=d9fc0efef5228704e7f5b37f27192723" + +SRC_URI[sha256sum] = "44bda34c7123f00c3df95d24e2dc8d43c4d17b456fbb8c434ef4f4a7ebb5265e" + +inherit pypi setuptools3 + +RDEPENDS_${PN} += "${PYTHON_PN}-asyncio ${PYTHON_PN}-cryptography" + +BBCLASSEXTEND = "native" diff --git a/meta-agl/meta-agl-profile-core/recipes-devtools/python/python3-pytest-dependency_0.5.1.bb b/meta-agl/meta-agl-profile-core/recipes-devtools/python/python3-pytest-dependency_0.5.1.bb new file mode 100644 index 00000000..5ff2d4ec --- /dev/null +++ b/meta-agl/meta-agl-profile-core/recipes-devtools/python/python3-pytest-dependency_0.5.1.bb @@ -0,0 +1,12 @@ +DESCRIPTION = "pytest-dependency manages dependencies of tests." +HOMEPAGE = "https://github.com/RKrahl/pytest-dependency" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://README.rst;md5=35b9938ae48d25e6b8306232e98463dd" + +SRC_URI[sha256sum] = "c2a892906192663f85030a6ab91304e508e546cddfe557d692d61ec57a1d946b" + +inherit pypi setuptools3 + +DEPENDS += "${PYTHON_PN}-pytest-native" + +BBCLASSEXTEND = "native" diff --git a/meta-agl/meta-agl-profile-core/recipes-devtools/python/python3-pytest-reverse_1.0.1.bb b/meta-agl/meta-agl-profile-core/recipes-devtools/python/python3-pytest-reverse_1.0.1.bb new file mode 100644 index 00000000..5ed9b1d9 --- /dev/null +++ b/meta-agl/meta-agl-profile-core/recipes-devtools/python/python3-pytest-reverse_1.0.1.bb @@ -0,0 +1,12 @@ +DESCRIPTION = "pytest-reverse is a pytest plugin to reverse test order" +HOMEPAGE = "https://github.com/adamchainz/pytest-reverse" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=caf1f407ae86ecd57ab721dff94079b7" + +SRC_URI[sha256sum] = "40cbc47df8a262fed778e500f4d0b17d2d08ef8b9fbf899c0bab9488be192aac" + +inherit pypi setuptools3 + +DEPENDS += "${PYTHON_PN}-pytest-native" + +BBCLASSEXTEND = "native" diff --git a/meta-agl/meta-agl-profile-core/recipes-kernel/most/files/0001-most-aim-network-backport-Kernel-API.patch b/meta-agl/meta-agl-profile-core/recipes-kernel/most/files/0001-most-aim-network-backport-Kernel-API.patch deleted file mode 100644 index d43b132f..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-kernel/most/files/0001-most-aim-network-backport-Kernel-API.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 383ffadd33f484ab4aaeb14fa109b61143d27d58 Mon Sep 17 00:00:00 2001 -From: Christian Gromm -Date: Thu, 7 Jun 2018 12:15:38 +0200 -Subject: [PATCH] most: aim-network: backport Kernel API - -This patch replaces the function calls skb_put_data with memcpy. It is -needed to have the module compiled for kernels prior to 4.13. - -Signed-off-by: Christian Gromm ---- - aim-network/networking.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/aim-network/networking.c b/aim-network/networking.c -index 936f013..4c259c2 100644 ---- a/aim-network/networking.c -+++ b/aim-network/networking.c -@@ -470,11 +470,11 @@ static int aim_rx_data(struct mbo *mbo) - ether_addr_copy(skb_put(skb, ETH_ALEN), dev->dev_addr); - - /* src */ -- skb_put_data(skb, &zero, 4); -- skb_put_data(skb, buf + 5, 2); -+ memcpy(skb_put(skb, 4), &zero, 4); -+ memcpy(skb_put(skb, 2), buf + 5, 2); - - /* eth type */ -- skb_put_data(skb, buf + 10, 2); -+ memcpy(skb_put(skb, 2), buf + 10, 2); - - buf += MDP_HDR_LEN; - len -= MDP_HDR_LEN; -@@ -483,7 +483,7 @@ static int aim_rx_data(struct mbo *mbo) - len -= MEP_HDR_LEN; - } - -- skb_put_data(skb, buf, len); -+ memcpy(skb_put(skb, len), buf, len); - skb->protocol = eth_type_trans(skb, dev); - skb_len = skb->len; - if (netif_rx(skb) == NET_RX_SUCCESS) { --- -2.11.0 diff --git a/meta-agl/meta-agl-profile-core/recipes-kernel/most/files/0011-handle-snd_pcm_lib_mmap_vmalloc-removal.patch b/meta-agl/meta-agl-profile-core/recipes-kernel/most/files/0011-handle-snd_pcm_lib_mmap_vmalloc-removal.patch index 8f83dbab..d4383c4f 100644 --- a/meta-agl/meta-agl-profile-core/recipes-kernel/most/files/0011-handle-snd_pcm_lib_mmap_vmalloc-removal.patch +++ b/meta-agl/meta-agl-profile-core/recipes-kernel/most/files/0011-handle-snd_pcm_lib_mmap_vmalloc-removal.patch @@ -1,18 +1,30 @@ Handle snd_pcm_lib_mmap_vmalloc removal in 4.19 -Upstream-Status: Pending +Add .mmap field back to pcm_ops for kernels older than 4.19. + +Upstream-Status: Inappropriate Signed-off-by: Scott Murray -diff --git a/driver/aim-sound/sound.c b/driver/aim-sound/sound.c -index 6a290ff..4b3329b 100644 +diff --git a/aim-sound/sound.c b/aim-sound/sound.c +index 4b3329b..c0a26be 100644 --- a/aim-sound/sound.c +++ b/aim-sound/sound.c -@@ -463,7 +463,6 @@ static const struct snd_pcm_ops pcm_ops = { +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -463,6 +464,9 @@ static const struct snd_pcm_ops pcm_ops = { .trigger = pcm_trigger, .pointer = pcm_pointer, .page = snd_pcm_lib_get_vmalloc_page, -- .mmap = snd_pcm_lib_mmap_vmalloc, ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,19,0) ++ .mmap = snd_pcm_lib_mmap_vmalloc, ++#endif }; static int split_arg_list(char *buf, char **card_name, u16 *ch_num, diff --git a/meta-agl/meta-agl-profile-core/recipes-kernel/most/files/0012-Fix-build-with-5.4-kernel.patch b/meta-agl/meta-agl-profile-core/recipes-kernel/most/files/0012-Fix-build-with-5.4-kernel.patch new file mode 100644 index 00000000..02eca27d --- /dev/null +++ b/meta-agl/meta-agl-profile-core/recipes-kernel/most/files/0012-Fix-build-with-5.4-kernel.patch @@ -0,0 +1,68 @@ +From 877d7475413bb787deb07aa83bafac03efa399fa Mon Sep 17 00:00:00 2001 +From: Paul Barker +Date: Mon, 24 Feb 2020 14:58:52 +0000 +Subject: [PATCH] Fix build with 5.4 kernel + +Signed-off-by: Paul Barker +--- + driver/Makefile | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 281241d..609e692 100644 +--- a/Makefile ++++ b/Makefile +@@ -5,6 +5,7 @@ SRC := $(shell pwd) + obj-m := mostcore.o + mostcore-y := mostcore/core.o + CFLAGS_core.o := -I$(src)/include/ ++CFLAGS_mostcore/core.o := -I$(src)/include/ + + obj-m += default_conf.o + CFLAGL_default_conf.o := -I$(src)/include +@@ -12,33 +13,41 @@ CFLAGL_default_conf.o := -I$(src)/include + obj-m += aim_cdev.o + aim_cdev-y := aim-cdev/cdev.o + CFLAGS_cdev.o := -I$(src)/include/ ++CFLAGS_aim-cdev/cdev.o := -I$(src)/include/ + + obj-m += aim_network.o + aim_network-y := aim-network/networking.o + CFLAGS_networking.o := -I$(src)/include/ ++CFLAGS_aim-network/networking.o := -I$(src)/include/ + + obj-m += aim_sound.o + aim_sound-y := aim-sound/sound.o + CFLAGS_sound.o := -I$(src)/include/ ++CFLAGS_aim-sound/sound.o := -I$(src)/include/ + + obj-m += aim_v4l2.o + aim_v4l2-y := aim-v4l2/video.o + CFLAGS_video.o := -Idrivers/media/video -I$(src)/include/ ++CFLAGS_aim-v4l2/video.o := -Idrivers/media/video -I$(src)/include/ + + obj-m += hdm_i2c.o + hdm_i2c-y := hdm-i2c/hdm_i2c.o + CFLAGS_hdm_i2c.o := -I$(src)/include/ ++CFLAGS_hdm-i2c/hdm_i2c.o := -I$(src)/include/ + + ifdef CONFIG_OF + obj-m += hdm_dim2.o + hdm_dim2-y := hdm-dim2/dim2_hdm.o hdm-dim2/dim2_hal.o hdm-dim2/dim2_sysfs.o + CFLAGS_dim2_hdm.o := -I$(src)/include/ ++CFLAGS_hdm-dim2/dim2_hdm.o := -I$(src)/include/ ++CFLAGS_hdm-dim2/dim2_hal.o := -I$(src)/include/ ++CFLAGS_hdm-dim2/dim2_sysfs.o := -I$(src)/include/ + endif + + obj-m += hdm_usb.o + hdm_usb-y := hdm-usb/hdm_usb.o + CFLAGS_hdm_usb.o := -I$(src)/include/ +- ++CFLAGS_hdm-usb/hdm_usb.o := -I$(src)/include/ + + all: + $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules +-- +2.20.1 + diff --git a/meta-agl/meta-agl-profile-core/recipes-kernel/most/most.bb b/meta-agl/meta-agl-profile-core/recipes-kernel/most/most.bb index 4ec7e3c2..48959a6e 100644 --- a/meta-agl/meta-agl-profile-core/recipes-kernel/most/most.bb +++ b/meta-agl/meta-agl-profile-core/recipes-kernel/most/most.bb @@ -9,6 +9,6 @@ PV = "0.1" SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/most;protocol=https;branch=${AGL_BRANCH}" S = "${WORKDIR}/git/driver" -SRCREV = "dcc04c5efe2058a5796f45b7a99f1c53082dd2ca" +SRCREV = "e4dbbaf9e7652efaed0df3e0aab4464f5f228573" KERNEL_MODULE_AUTOLOAD += "aim_cdev aim_sound aim_network aim_v4l2 hdm_i2c hdm_dim2 hdm_usb mostcore" diff --git a/meta-agl/meta-agl-profile-core/recipes-kernel/most/most.bbappend b/meta-agl/meta-agl-profile-core/recipes-kernel/most/most.bbappend index 17ad0558..ad422eb5 100644 --- a/meta-agl/meta-agl-profile-core/recipes-kernel/most/most.bbappend +++ b/meta-agl/meta-agl-profile-core/recipes-kernel/most/most.bbappend @@ -1,21 +1,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:" -def prep_version (d) : - KV = d.getVar('KERNEL_VERSION', True) - if not KV : - return "4.12" - else: - return KV - -ORIG_KERN_VER = "${@prep_version(d)}" - -VANILLA_KERNEL_VERSION = "${@str(ORIG_KERN_VER.split("-")[0].split(".")[0]+ORIG_KERN_VER.split("-")[0].split(".")[1])}" - -APPLY = "${@str('no' if ${VANILLA_KERNEL_VERSION} > 412 else 'yes')}" -APPLY_419 = "${@str('no' if ${VANILLA_KERNEL_VERSION} < 419 else 'yes')}" - SRC_URI_append = " \ - file://0001-most-aim-network-backport-Kernel-API.patch;apply=${APPLY} \ file://0002-src-most-add-auto-conf-feature.patch \ file://0003-core-remove-kernel-log-for-MBO-status.patch \ file://0004-most-video-set-device_caps.patch \ @@ -25,7 +10,6 @@ SRC_URI_append = " \ file://0008-dim2-read-clock-speed-from-the-device-tree.patch \ file://0009-dim2-use-device-for-coherent-memory-allocation.patch \ file://0010-backport-usb-setup-timer.patch \ - file://0011-handle-snd_pcm_lib_mmap_vmalloc-removal.patch;apply=${APPLY_419} \ - " -# Make sure we can expose KERNEL_VERSION ... -do_patch[depends] += "virtual/kernel:do_populate_sysroot" + file://0011-handle-snd_pcm_lib_mmap_vmalloc-removal.patch \ + file://0012-Fix-build-with-5.4-kernel.patch \ +" diff --git a/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/agl-audio-plugin_0.1.bb b/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/agl-audio-plugin_0.1.bb deleted file mode 100644 index 633a3e24..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/agl-audio-plugin_0.1.bb +++ /dev/null @@ -1,28 +0,0 @@ -SUMMARY = "AGL Audio Policy Plugin" -DESCRIPTION = "AGL PulseAudio Routing plugin, forked from the Tizen IVI \ -PulseAudio Routing plugin, also known as module-murphy-ivi. This is a \ -stripped-down version of the former, not needing Murphy anymore and using \ -either a JSON configuration file or its own embedded configuration." -HOMEPAGE = "http://www.iot.bzh" - -LICENSE = "LGPL-2.1" -LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1" - -DEPENDS = "json-c pulseaudio" -RDEPENDS_${PN} = "pulseaudio-server pulseaudio-module-null-sink pulseaudio-module-loopback" - -SRCREV = "952d404e87ca6001e546fe9105bdb6760c468760" -SRC_URI = "git://gerrit.automotivelinux.org/gerrit/staging/agl-audio-plugin;protocol=https;branch=${AGL_BRANCH}" - -S = "${WORKDIR}/git" - -inherit cmake pkgconfig - -FULL_OPTIMIZATION = "-O1 -pipe ${DEBUG_FLAGS}" - -PULSE_PV="9.0" - -EXTRA_OECMAKE_append = " -DPULSE_PV:STRING=${PULSE_PV}" - -FILES_${PN} += "${libdir}/pulse-${PULSE_PV}/modules/* ${sysconfdir}/pulse/*" -FILES_${PN}-dbg += "${libdir}/pulse-${PULSE_PV}/modules/.debug/*" diff --git a/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0001-install-files-for-a-module-development.patch b/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0001-install-files-for-a-module-development.patch deleted file mode 100644 index f77249a2..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0001-install-files-for-a-module-development.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 53281e2d11f84e2dae0704e0167369710ee2cb30 Mon Sep 17 00:00:00 2001 -From: Yannick Gicquel -Date: Fri, 23 Sep 2016 14:26:03 +0200 -Subject: [PATCH 1/6] install files for a module development - -Signed-off-by: Yannick Gicquel ---- - -diff --git a/Makefile.am b/Makefile.am -index 275ceea..77dd7a5 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -54,7 +54,16 @@ dist_vapi_DATA = \ - vala/libpulse-simple.deps vala/libpulse-simple.vapi - - pkgconfigdir = $(libdir)/pkgconfig --pkgconfig_DATA = libpulse.pc libpulse-simple.pc -+pkgconfig_DATA = libpulse.pc libpulse-simple.pc pulseaudio-module-devel.pc -+ -+moduledev_DATA = pulsecore-config.h $(top_srcdir)/src/pulsecore/*.h -+moduledevdir = $(includedir)/pulsemodule/pulsecore -+ -+moduledevfilter_DATA = $(top_srcdir)/src/pulsecore/filter/*.h -+moduledevfilterdir = $(includedir)/pulsemodule/pulsecore/filter -+ -+moduledevinternal_DATA = src/pulse/internal.h src/pulse/client-conf.h src/pulse/fork-detect.h -+moduledevinternaldir = $(includedir)/pulsemodule/pulse - - if HAVE_GLIB20 - pkgconfig_DATA += \ -@@ -108,6 +117,9 @@ dist-hook: - check-daemon: - $(MAKE) -C src check-daemon - -+pulsecore-config.h: config.h -+ cp $< $@ -+ - .PHONY: homepage distcleancheck doxygen - - # see git-version-gen -diff --git a/configure.ac b/configure.ac -index c9c414f..87aa9b1 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1548,6 +1548,7 @@ man/pulse-client.conf.5.xml - man/default.pa.5.xml - man/pulse-cli-syntax.5.xml - man/start-pulseaudio-x11.1.xml -+pulseaudio-module-devel.pc - ]) - - AS_IF([test "x$HAVE_ESOUND" = "x1"], -diff --git a/pulseaudio-module-devel.pc.in b/pulseaudio-module-devel.pc.in -new file mode 100644 -index 0000000..85aadbc ---- /dev/null -+++ b/pulseaudio-module-devel.pc.in -@@ -0,0 +1,12 @@ -+prefix=@prefix@ -+exec_prefix=@exec_prefix@ -+libdir=@libdir@ -+includedir=@includedir@ -+modlibexecdir=@modlibexecdir@ -+ -+Name: pulseaudio-module-devel -+Description: PulseAudio Module Development Interface -+Version: @PACKAGE_VERSION@ -+Libs: -L${libdir} -L${libdir}/pulseaudio -L${modlibexecdir} -lpulsecommon-@PA_MAJORMINOR@ -lpulsecore-@PA_MAJORMINOR@ -lprotocol-native -+Libs.private: -+Cflags: -I${includedir}/pulsemodule -D_REENTRANT diff --git a/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0002-volume-ramp-additions-to-the-low-level-infra.patch b/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0002-volume-ramp-additions-to-the-low-level-infra.patch deleted file mode 100644 index 5b2da69c..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0002-volume-ramp-additions-to-the-low-level-infra.patch +++ /dev/null @@ -1,564 +0,0 @@ -From c28b5faa6745b525c11d1f54d8bf52386a90fcc1 Mon Sep 17 00:00:00 2001 -From: Sangchul Lee -Date: Sat, 27 Aug 2016 21:33:16 +0900 -Subject: [PATCH 2/6] volume ramp: additions to the low level infra - -The original patch is - - https://review.tizen.org/git/?p=platform/upstream/pulseaudio.git;a=commit;h=df1c4275ed79e0b708c75b92f9d247e0492bc1f0 - - by Jaska Uimonen helsinki.fi> - -Signed-off-by: Sangchul Lee - ---- - src/map-file | 4 + - src/pulse/def.h | 13 ++- - src/pulse/volume.c | 74 ++++++++++++- - src/pulse/volume.h | 33 ++++++ - src/pulsecore/mix.c | 310 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - src/pulsecore/mix.h | 27 +++++ - 6 files changed, 459 insertions(+), 2 deletions(-) - -diff --git a/src/map-file b/src/map-file -index 9b6cba2..946ab54 100644 ---- a/src/map-file -+++ b/src/map-file -@@ -138,6 +138,10 @@ pa_cvolume_max_mask; - pa_cvolume_merge; - pa_cvolume_min; - pa_cvolume_min_mask; -+pa_cvolume_ramp_equal; -+pa_cvolume_ramp_init; -+pa_cvolume_ramp_set; -+pa_cvolume_ramp_channel_ramp_set; - pa_cvolume_remap; - pa_cvolume_scale; - pa_cvolume_scale_mask; -diff --git a/src/pulse/def.h b/src/pulse/def.h -index 100df5b..b13eed7 100644 ---- a/src/pulse/def.h -+++ b/src/pulse/def.h -@@ -349,11 +349,15 @@ typedef enum pa_stream_flags { - * consider absolute when the sink is in flat volume mode, - * relative otherwise. \since 0.9.20 */ - -- PA_STREAM_PASSTHROUGH = 0x80000U -+ PA_STREAM_PASSTHROUGH = 0x80000U, - /**< Used to tag content that will be rendered by passthrough sinks. - * The data will be left as is and not reformatted, resampled. - * \since 1.0 */ - -+ PA_STREAM_START_RAMP_MUTED = 0x100000U -+ /**< Used to tag content that the stream will be started ramp volume -+ * muted so that you can nicely fade it in */ -+ - } pa_stream_flags_t; - - /** \cond fulldocs */ -@@ -382,6 +386,7 @@ typedef enum pa_stream_flags { - #define PA_STREAM_FAIL_ON_SUSPEND PA_STREAM_FAIL_ON_SUSPEND - #define PA_STREAM_RELATIVE_VOLUME PA_STREAM_RELATIVE_VOLUME - #define PA_STREAM_PASSTHROUGH PA_STREAM_PASSTHROUGH -+#define PA_STREAM_START_RAMP_MUTED PA_STREAM_START_RAMP_MUTED - - /** \endcond */ - -@@ -1070,6 +1075,12 @@ typedef enum pa_port_available { - /** \endcond */ - #endif - -+/** \cond fulldocs */ -+#define PA_VOLUMER_RAMP_TYPE_LINEAR PA_VOLUMER_RAMP_TYPE_LINEAR -+#define PA_VOLUMER_RAMP_TYPE_LOGARITHMIC PA_VOLUMER_RAMP_TYPE_LOGARITHMIC -+#define PA_VOLUMER_RAMP_TYPE_CUBIC PA_VOLUMER_RAMP_TYPE_CUBIC -+/** \endcond */ -+ - PA_C_DECL_END - - #endif -diff --git a/src/pulse/volume.c b/src/pulse/volume.c -index ead5415..83a1e05 100644 ---- a/src/pulse/volume.c -+++ b/src/pulse/volume.c -@@ -457,7 +457,10 @@ int pa_cvolume_channels_equal_to(const pa_cvolume *a, pa_volume_t v) { - unsigned c; - pa_assert(a); - -- pa_return_val_if_fail(pa_cvolume_valid(a), 0); -+ if (pa_cvolume_valid(a) == 0) -+ abort(); -+ -+ /* pa_return_val_if_fail(pa_cvolume_valid(a), 0); */ - pa_return_val_if_fail(PA_VOLUME_IS_VALID(v), 0); - - for (c = 0; c < a->channels; c++) -@@ -989,3 +992,72 @@ pa_cvolume* pa_cvolume_dec(pa_cvolume *v, pa_volume_t dec) { - - return pa_cvolume_scale(v, m); - } -+ -+int pa_cvolume_ramp_equal(const pa_cvolume_ramp *a, const pa_cvolume_ramp *b) { -+ int i; -+ pa_assert(a); -+ pa_assert(b); -+ -+ if (PA_UNLIKELY(a == b)) -+ return 1; -+ -+ if (a->channels != b->channels) -+ return 0; -+ -+ for (i = 0; i < a->channels; i++) { -+ if (a->ramps[i].type != b->ramps[i].type || -+ a->ramps[i].length != b->ramps[i].length || -+ a->ramps[i].target != b->ramps[i].target) -+ return 0; -+ } -+ -+ return 1; -+} -+ -+pa_cvolume_ramp* pa_cvolume_ramp_init(pa_cvolume_ramp *ramp) { -+ unsigned c; -+ -+ pa_assert(ramp); -+ -+ ramp->channels = 0; -+ -+ for (c = 0; c < PA_CHANNELS_MAX; c++) { -+ ramp->ramps[c].type = PA_VOLUME_RAMP_TYPE_LINEAR; -+ ramp->ramps[c].length = 0; -+ ramp->ramps[c].target = PA_VOLUME_INVALID; -+ } -+ -+ return ramp; -+} -+ -+pa_cvolume_ramp* pa_cvolume_ramp_set(pa_cvolume_ramp *ramp, unsigned channels, pa_volume_ramp_type_t type, long time, pa_volume_t vol) { -+ int i; -+ -+ pa_assert(ramp); -+ pa_assert(channels > 0); -+ pa_assert(time >= 0); -+ pa_assert(channels <= PA_CHANNELS_MAX); -+ -+ ramp->channels = (uint8_t) channels; -+ -+ for (i = 0; i < ramp->channels; i++) { -+ ramp->ramps[i].type = type; -+ ramp->ramps[i].length = time; -+ ramp->ramps[i].target = PA_CLAMP_VOLUME(vol); -+ } -+ -+ return ramp; -+} -+ -+pa_cvolume_ramp* pa_cvolume_ramp_channel_ramp_set(pa_cvolume_ramp *ramp, unsigned channel, pa_volume_ramp_type_t type, long time, pa_volume_t vol) { -+ -+ pa_assert(ramp); -+ pa_assert(channel <= ramp->channels); -+ pa_assert(time >= 0); -+ -+ ramp->ramps[channel].type = type; -+ ramp->ramps[channel].length = time; -+ ramp->ramps[channel].target = PA_CLAMP_VOLUME(vol); -+ -+ return ramp; -+} -diff --git a/src/pulse/volume.h b/src/pulse/volume.h -index 2503c3f..0b74833 100644 ---- a/src/pulse/volume.h -+++ b/src/pulse/volume.h -@@ -437,6 +437,39 @@ pa_cvolume* pa_cvolume_inc(pa_cvolume *v, pa_volume_t inc); - * the channels are kept. Returns \a v, or NULL on error. \since 0.9.16 */ - pa_cvolume* pa_cvolume_dec(pa_cvolume *v, pa_volume_t dec); - -+/** Volume ramp type -+*/ -+typedef enum pa_volume_ramp_type { -+ PA_VOLUME_RAMP_TYPE_LINEAR = 0, /**< linear */ -+ PA_VOLUME_RAMP_TYPE_LOGARITHMIC = 1, /**< logarithmic */ -+ PA_VOLUME_RAMP_TYPE_CUBIC = 2, -+} pa_volume_ramp_type_t; -+ -+/** A structure encapsulating a volume ramp */ -+typedef struct pa_volume_ramp_t { -+ pa_volume_ramp_type_t type; -+ long length; -+ pa_volume_t target; -+} pa_volume_ramp_t; -+ -+/** A structure encapsulating a multichannel volume ramp */ -+typedef struct pa_cvolume_ramp { -+ uint8_t channels; -+ pa_volume_ramp_t ramps[PA_CHANNELS_MAX]; -+} pa_cvolume_ramp; -+ -+/** Return non-zero when *a == *b */ -+int pa_cvolume_ramp_equal(const pa_cvolume_ramp *a, const pa_cvolume_ramp *b); -+ -+/** Init volume ramp struct */ -+pa_cvolume_ramp* pa_cvolume_ramp_init(pa_cvolume_ramp *ramp); -+ -+/** Set first n channels of ramp struct to certain value */ -+pa_cvolume_ramp* pa_cvolume_ramp_set(pa_cvolume_ramp *ramp, unsigned channel, pa_volume_ramp_type_t type, long time, pa_volume_t vol); -+ -+/** Set individual channel in the channel struct */ -+pa_cvolume_ramp* pa_cvolume_ramp_channel_ramp_set(pa_cvolume_ramp *ramp, unsigned channel, pa_volume_ramp_type_t type, long time, pa_volume_t vol); -+ - PA_C_DECL_END - - #endif -diff --git a/src/pulsecore/mix.c b/src/pulsecore/mix.c -index 59622d7..1e4cc1e 100644 ---- a/src/pulsecore/mix.c -+++ b/src/pulsecore/mix.c -@@ -724,3 +724,313 @@ void pa_volume_memchunk( - - pa_memblock_release(c->memblock); - } -+ -+static void calc_linear_integer_volume_no_mapping(int32_t linear[], float volume[], unsigned nchannels) { -+ unsigned channel, padding; -+ -+ pa_assert(linear); -+ pa_assert(volume); -+ -+ for (channel = 0; channel < nchannels; channel++) -+ linear[channel] = (int32_t) lrint(volume[channel] * 0x10000U); -+ -+ for (padding = 0; padding < VOLUME_PADDING; padding++, channel++) -+ linear[channel] = linear[padding]; -+} -+ -+static void calc_linear_float_volume_no_mapping(float linear[], float volume[], unsigned nchannels) { -+ unsigned channel, padding; -+ -+ pa_assert(linear); -+ pa_assert(volume); -+ -+ for (channel = 0; channel < nchannels; channel++) -+ linear[channel] = volume[channel]; -+ -+ for (padding = 0; padding < VOLUME_PADDING; padding++, channel++) -+ linear[channel] = linear[padding]; -+} -+ -+typedef void (*pa_calc_volume_no_mapping_func_t) (void *volumes, float *volume, int channels); -+ -+static const pa_calc_volume_no_mapping_func_t calc_volume_table_no_mapping[] = { -+ [PA_SAMPLE_U8] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping, -+ [PA_SAMPLE_ALAW] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping, -+ [PA_SAMPLE_ULAW] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping, -+ [PA_SAMPLE_S16LE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping, -+ [PA_SAMPLE_S16BE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping, -+ [PA_SAMPLE_FLOAT32LE] = (pa_calc_volume_no_mapping_func_t) calc_linear_float_volume_no_mapping, -+ [PA_SAMPLE_FLOAT32BE] = (pa_calc_volume_no_mapping_func_t) calc_linear_float_volume_no_mapping, -+ [PA_SAMPLE_S32LE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping, -+ [PA_SAMPLE_S32BE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping, -+ [PA_SAMPLE_S24LE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping, -+ [PA_SAMPLE_S24BE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping, -+ [PA_SAMPLE_S24_32LE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping, -+ [PA_SAMPLE_S24_32BE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping -+}; -+ -+static const unsigned format_sample_size_table[] = { -+ [PA_SAMPLE_U8] = 1, -+ [PA_SAMPLE_ALAW] = 1, -+ [PA_SAMPLE_ULAW] = 1, -+ [PA_SAMPLE_S16LE] = 2, -+ [PA_SAMPLE_S16BE] = 2, -+ [PA_SAMPLE_FLOAT32LE] = 4, -+ [PA_SAMPLE_FLOAT32BE] = 4, -+ [PA_SAMPLE_S32LE] = 4, -+ [PA_SAMPLE_S32BE] = 4, -+ [PA_SAMPLE_S24LE] = 3, -+ [PA_SAMPLE_S24BE] = 3, -+ [PA_SAMPLE_S24_32LE] = 4, -+ [PA_SAMPLE_S24_32BE] = 4 -+}; -+ -+static float calc_volume_ramp_linear(pa_volume_ramp_int_t *ramp) { -+ pa_assert(ramp); -+ pa_assert(ramp->length > 0); -+ -+ /* basic linear interpolation */ -+ return ramp->start + (ramp->length - ramp->left) * (ramp->end - ramp->start) / (float) ramp->length; -+} -+ -+static float calc_volume_ramp_logarithmic(pa_volume_ramp_int_t *ramp) { -+ float x_val, s, e; -+ long temp; -+ -+ pa_assert(ramp); -+ pa_assert(ramp->length > 0); -+ -+ if (ramp->end > ramp->start) { -+ temp = ramp->left; -+ s = ramp->end; -+ e = ramp->start; -+ } else { -+ temp = ramp->length - ramp->left; -+ s = ramp->start; -+ e = ramp->end; -+ } -+ -+ x_val = temp == 0 ? 0.0 : powf(temp, 10); -+ -+ /* base 10 logarithmic interpolation */ -+ return s + x_val * (e - s) / powf(ramp->length, 10); -+} -+ -+static float calc_volume_ramp_cubic(pa_volume_ramp_int_t *ramp) { -+ float x_val, s, e; -+ long temp; -+ -+ pa_assert(ramp); -+ pa_assert(ramp->length > 0); -+ -+ if (ramp->end > ramp->start) { -+ temp = ramp->left; -+ s = ramp->end; -+ e = ramp->start; -+ } else { -+ temp = ramp->length - ramp->left; -+ s = ramp->start; -+ e = ramp->end; -+ } -+ -+ x_val = temp == 0 ? 0.0 : cbrtf(temp); -+ -+ /* cubic interpolation */ -+ return s + x_val * (e - s) / cbrtf(ramp->length); -+} -+ -+typedef float (*pa_calc_volume_ramp_func_t) (pa_volume_ramp_int_t *); -+ -+static const pa_calc_volume_ramp_func_t calc_volume_ramp_table[] = { -+ [PA_VOLUME_RAMP_TYPE_LINEAR] = (pa_calc_volume_ramp_func_t) calc_volume_ramp_linear, -+ [PA_VOLUME_RAMP_TYPE_LOGARITHMIC] = (pa_calc_volume_ramp_func_t) calc_volume_ramp_logarithmic, -+ [PA_VOLUME_RAMP_TYPE_CUBIC] = (pa_calc_volume_ramp_func_t) calc_volume_ramp_cubic -+}; -+ -+static void calc_volume_ramps(pa_cvolume_ramp_int *ram, float *vol) -+{ -+ int i; -+ -+ for (i = 0; i < ram->channels; i++) { -+ if (ram->ramps[i].left <= 0) { -+ if (ram->ramps[i].target == PA_VOLUME_NORM) { -+ vol[i] = 1.0; -+ } -+ } else { -+ vol[i] = ram->ramps[i].curr = calc_volume_ramp_table[ram->ramps[i].type] (&ram->ramps[i]); -+ ram->ramps[i].left--; -+ } -+ } -+} -+ -+void pa_volume_ramp_memchunk( -+ pa_memchunk *c, -+ const pa_sample_spec *spec, -+ pa_cvolume_ramp_int *ramp) { -+ -+ void *ptr; -+ volume_val linear[PA_CHANNELS_MAX + VOLUME_PADDING]; -+ float vol[PA_CHANNELS_MAX + VOLUME_PADDING]; -+ pa_do_volume_func_t do_volume; -+ long length_in_frames; -+ int i; -+ -+ pa_assert(c); -+ pa_assert(spec); -+ pa_assert(pa_frame_aligned(c->length, spec)); -+ pa_assert(ramp); -+ -+ length_in_frames = c->length / format_sample_size_table[spec->format] / spec->channels; -+ -+ if (pa_memblock_is_silence(c->memblock)) { -+ for (i = 0; i < ramp->channels; i++) { -+ if (ramp->ramps[i].length > 0) -+ ramp->ramps[i].length -= length_in_frames; -+ } -+ return; -+ } -+ -+ if (spec->format < 0 || spec->format >= PA_SAMPLE_MAX) { -+ pa_log_warn("Unable to change volume of format"); -+ return; -+ } -+ -+ do_volume = pa_get_volume_func(spec->format); -+ pa_assert(do_volume); -+ -+ ptr = (uint8_t*) pa_memblock_acquire(c->memblock) + c->index; -+ -+ for (i = 0; i < length_in_frames; i++) { -+ calc_volume_ramps(ramp, vol); -+ calc_volume_table_no_mapping[spec->format] ((void *)linear, vol, spec->channels); -+ -+ /* we only process one frame per iteration */ -+ do_volume (ptr, (void *)linear, spec->channels, format_sample_size_table[spec->format] * spec->channels); -+ -+ /* pa_log_debug("1: %d 2: %d", linear[0], linear[1]); */ -+ -+ ptr = (uint8_t*)ptr + format_sample_size_table[spec->format] * spec->channels; -+ } -+ -+ pa_memblock_release(c->memblock); -+} -+ -+pa_cvolume_ramp_int* pa_cvolume_ramp_convert(const pa_cvolume_ramp *src, pa_cvolume_ramp_int *dst, int sample_rate) { -+ -+ int i, j, channels, remaining_channels; -+ float temp; -+ -+ if (dst->channels < src->channels) { -+ channels = dst->channels; -+ remaining_channels = 0; -+ } -+ else { -+ channels = src->channels; -+ remaining_channels = dst->channels; -+ } -+ -+ for (i = 0; i < channels; i++) { -+ dst->ramps[i].type = src->ramps[i].type; -+ /* ms to samples */ -+ dst->ramps[i].length = src->ramps[i].length * sample_rate / 1000; -+ dst->ramps[i].left = dst->ramps[i].length; -+ dst->ramps[i].start = dst->ramps[i].end; -+ dst->ramps[i].target = src->ramps[i].target; -+ /* scale to pulse internal mapping so that when ramp is over there's no glitch in volume */ -+ temp = src->ramps[i].target / (float)0x10000U; -+ dst->ramps[i].end = temp * temp * temp; -+ } -+ -+ j = i; -+ -+ for (i--; j < remaining_channels; j++) { -+ dst->ramps[j].type = dst->ramps[i].type; -+ dst->ramps[j].length = dst->ramps[i].length; -+ dst->ramps[j].left = dst->ramps[i].left; -+ dst->ramps[j].start = dst->ramps[i].start; -+ dst->ramps[j].target = dst->ramps[i].target; -+ dst->ramps[j].end = dst->ramps[i].end; -+ } -+ -+ return dst; -+} -+ -+bool pa_cvolume_ramp_active(pa_cvolume_ramp_int *ramp) { -+ int i; -+ -+ for (i = 0; i < ramp->channels; i++) { -+ if (ramp->ramps[i].left > 0) -+ return true; -+ } -+ -+ return false; -+} -+ -+bool pa_cvolume_ramp_target_active(pa_cvolume_ramp_int *ramp) { -+ int i; -+ -+ for (i = 0; i < ramp->channels; i++) { -+ if (ramp->ramps[i].target != PA_VOLUME_NORM) -+ return true; -+ } -+ -+ return false; -+} -+ -+pa_cvolume * pa_cvolume_ramp_get_targets(pa_cvolume_ramp_int *ramp, pa_cvolume *volume) { -+ int i = 0; -+ -+ volume->channels = ramp->channels; -+ -+ for (i = 0; i < ramp->channels; i++) -+ volume->values[i] = ramp->ramps[i].target; -+ -+ return volume; -+} -+ -+pa_cvolume_ramp_int* pa_cvolume_ramp_start_from(pa_cvolume_ramp_int *src, pa_cvolume_ramp_int *dst) { -+ int i; -+ -+ for (i = 0; i < src->channels; i++) { -+ /* if new vols are invalid, copy old ramp i.e. no effect */ -+ if (dst->ramps[i].target == PA_VOLUME_INVALID) -+ dst->ramps[i] = src->ramps[i]; -+ /* if there's some old ramp still left */ -+ else if (src->ramps[i].left > 0) -+ dst->ramps[i].start = src->ramps[i].curr; -+ } -+ -+ return dst; -+} -+ -+pa_cvolume_ramp_int* pa_cvolume_ramp_int_init(pa_cvolume_ramp_int *src, pa_volume_t vol, int channels) { -+ int i; -+ float temp; -+ -+ src->channels = channels; -+ -+ for (i = 0; i < channels; i++) { -+ src->ramps[i].type = PA_VOLUME_RAMP_TYPE_LINEAR; -+ src->ramps[i].length = 0; -+ src->ramps[i].left = 0; -+ if (vol == PA_VOLUME_NORM) { -+ src->ramps[i].start = 1.0; -+ src->ramps[i].end = 1.0; -+ src->ramps[i].curr = 1.0; -+ } -+ else if (vol == PA_VOLUME_MUTED) { -+ src->ramps[i].start = 0.0; -+ src->ramps[i].end = 0.0; -+ src->ramps[i].curr = 0.0; -+ } -+ else { -+ temp = vol / (float)0x10000U; -+ src->ramps[i].start = temp * temp * temp; -+ src->ramps[i].end = src->ramps[i].start; -+ src->ramps[i].curr = src->ramps[i].start; -+ } -+ src->ramps[i].target = vol; -+ } -+ -+ return src; -+} -diff --git a/src/pulsecore/mix.h b/src/pulsecore/mix.h -index 8102bcd..0f86b6f 100644 ---- a/src/pulsecore/mix.h -+++ b/src/pulsecore/mix.h -@@ -59,4 +59,31 @@ void pa_volume_memchunk( - const pa_sample_spec *spec, - const pa_cvolume *volume); - -+typedef struct pa_volume_ramp_int_t { -+ pa_volume_ramp_type_t type; -+ long length; -+ long left; -+ float start; -+ float end; -+ float curr; -+ pa_volume_t target; -+} pa_volume_ramp_int_t; -+ -+typedef struct pa_cvolume_ramp_int { -+ uint8_t channels; -+ pa_volume_ramp_int_t ramps[PA_CHANNELS_MAX]; -+} pa_cvolume_ramp_int; -+ -+pa_cvolume_ramp_int* pa_cvolume_ramp_convert(const pa_cvolume_ramp *src, pa_cvolume_ramp_int *dst, int sample_rate); -+bool pa_cvolume_ramp_active(pa_cvolume_ramp_int *ramp); -+bool pa_cvolume_ramp_target_active(pa_cvolume_ramp_int *ramp); -+pa_cvolume_ramp_int* pa_cvolume_ramp_start_from(pa_cvolume_ramp_int *src, pa_cvolume_ramp_int *dst); -+pa_cvolume_ramp_int* pa_cvolume_ramp_int_init(pa_cvolume_ramp_int *src, pa_volume_t vol, int channels); -+pa_cvolume * pa_cvolume_ramp_get_targets(pa_cvolume_ramp_int *ramp, pa_cvolume *volume); -+ -+void pa_volume_ramp_memchunk( -+ pa_memchunk *c, -+ const pa_sample_spec *spec, -+ pa_cvolume_ramp_int *ramp); -+ - #endif diff --git a/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0003-volume-ramp-adding-volume-ramping-to-sink-input.patch b/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0003-volume-ramp-adding-volume-ramping-to-sink-input.patch deleted file mode 100644 index eb485ca7..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0003-volume-ramp-adding-volume-ramping-to-sink-input.patch +++ /dev/null @@ -1,189 +0,0 @@ -From e4469df7c69316b49cad93dd288badc98fa1cad5 Mon Sep 17 00:00:00 2001 -From: Sangchul Lee -Date: Sat, 27 Aug 2016 21:33:17 +0900 -Subject: [PATCH 3/6] volume ramp: adding volume ramping to sink-input - -The original patch is - - https://review.tizen.org/git/?p=platform/upstream/pulseaudio.git;a=commit;h=98042248fd67ce0ab3807c5c472c0d5d8b0f99d3 - - by Jaska Uimonen helsinki.fi> - -Signed-off-by: Sangchul Lee ---- - src/pulsecore/sink-input.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++ - src/pulsecore/sink-input.h | 11 ++++++++- - 2 files changed, 71 insertions(+), 1 deletion(-) - -diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c -index 8ec63b5..cc8953f 100644 ---- a/src/pulsecore/sink-input.c -+++ b/src/pulsecore/sink-input.c -@@ -526,6 +526,11 @@ int pa_sink_input_new( - reset_callbacks(i); - i->userdata = NULL; - -+ if (data->flags & PA_SINK_INPUT_START_RAMP_MUTED) -+ pa_cvolume_ramp_int_init(&i->ramp, PA_VOLUME_MUTED, data->sample_spec.channels); -+ else -+ pa_cvolume_ramp_int_init(&i->ramp, PA_VOLUME_NORM, data->sample_spec.channels); -+ - i->thread_info.state = i->state; - i->thread_info.attached = false; - pa_atomic_store(&i->thread_info.drained, 1); -@@ -542,6 +547,8 @@ int pa_sink_input_new( - i->thread_info.playing_for = 0; - i->thread_info.direct_outputs = pa_hashmap_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func); - -+ i->thread_info.ramp = i->ramp; -+ - pa_assert_se(pa_idxset_put(core->sink_inputs, i, &i->index) == 0); - pa_assert_se(pa_idxset_put(i->sink->inputs, pa_sink_input_ref(i), NULL) == 0); - -@@ -923,6 +930,8 @@ void pa_sink_input_peek(pa_sink_input *i, size_t slength /* in sink bytes */, pa - while (tchunk.length > 0) { - pa_memchunk wchunk; - bool nvfs = need_volume_factor_sink; -+ pa_cvolume target; -+ pa_bool_t tmp; - - wchunk = tchunk; - pa_memblock_ref(wchunk.memblock); -@@ -959,6 +968,16 @@ void pa_sink_input_peek(pa_sink_input *i, size_t slength /* in sink bytes */, pa - pa_volume_memchunk(&wchunk, &i->sink->sample_spec, &i->volume_factor_sink); - } - -+ /* check for possible volume ramp */ -+ if (pa_cvolume_ramp_active(&i->thread_info.ramp)) { -+ pa_memchunk_make_writable(&wchunk, 0); -+ pa_volume_ramp_memchunk(&wchunk, &i->sink->sample_spec, &(i->thread_info.ramp)); -+ } else if ((tmp = pa_cvolume_ramp_target_active(&(i->thread_info.ramp)))) { -+ pa_memchunk_make_writable(&wchunk, 0); -+ pa_cvolume_ramp_get_targets(&i->thread_info.ramp, &target); -+ pa_volume_memchunk(&wchunk, &i->sink->sample_spec, &target); -+ } -+ - pa_memblockq_push_align(i->thread_info.render_memblockq, &wchunk); - } else { - pa_memchunk rchunk; -@@ -975,6 +994,16 @@ void pa_sink_input_peek(pa_sink_input *i, size_t slength /* in sink bytes */, pa - pa_volume_memchunk(&rchunk, &i->sink->sample_spec, &i->volume_factor_sink); - } - -+ /* check for possible volume ramp */ -+ if (pa_cvolume_ramp_active(&(i->thread_info.ramp))) { -+ pa_memchunk_make_writable(&rchunk, 0); -+ pa_volume_ramp_memchunk(&rchunk, &i->sink->sample_spec, &(i->thread_info.ramp)); -+ } else if (pa_cvolume_ramp_target_active(&(i->thread_info.ramp))) { -+ pa_memchunk_make_writable(&rchunk, 0); -+ pa_cvolume_ramp_get_targets(&i->thread_info.ramp, &target); -+ pa_volume_memchunk(&rchunk, &i->sink->sample_spec, &target); -+ } -+ - pa_memblockq_push_align(i->thread_info.render_memblockq, &rchunk); - pa_memblock_unref(rchunk.memblock); - } -@@ -1339,6 +1368,31 @@ int pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key) { - return 0; - } - -+/* Called from main thread */ -+void pa_sink_input_set_volume_ramp( -+ pa_sink_input *i, -+ const pa_cvolume_ramp *ramp, -+ pa_bool_t send_msg, -+ pa_bool_t save) { -+ -+ pa_sink_input_assert_ref(i); -+ pa_assert_ctl_context(); -+ pa_assert(PA_SINK_INPUT_IS_LINKED(i->state)); -+ pa_assert(ramp); -+ -+ pa_cvolume_ramp_convert(ramp, &i->ramp, i->sample_spec.rate); -+ -+ pa_log_debug("setting volume ramp with target vol:%d and length:%ld", -+ i->ramp.ramps[0].target, -+ i->ramp.ramps[0].length); -+ -+ -+ /* This tells the sink that volume ramp changed */ -+ if (send_msg) -+ pa_assert_se(pa_asyncmsgq_send(i->sink->asyncmsgq, PA_MSGOBJECT(i), PA_SINK_INPUT_MESSAGE_SET_VOLUME_RAMP, -+ NULL, 0, NULL) == 0); -+} -+ - /* Called from main context */ - static void set_real_ratio(pa_sink_input *i, const pa_cvolume *v) { - pa_sink_input_assert_ref(i); -@@ -1932,6 +1986,13 @@ int pa_sink_input_process_msg(pa_msgobject *o, int code, void *userdata, int64_t - } - return 0; - -+ case PA_SINK_INPUT_MESSAGE_SET_VOLUME_RAMP: -+ /* we have ongoing ramp where we take current start values */ -+ pa_cvolume_ramp_start_from(&i->thread_info.ramp, &i->ramp); -+ i->thread_info.ramp = i->ramp; -+ pa_sink_input_request_rewind(i, 0, true, false, false); -+ return 0; -+ - case PA_SINK_INPUT_MESSAGE_SET_SOFT_MUTE: - if (i->thread_info.muted != i->muted) { - i->thread_info.muted = i->muted; -diff --git a/src/pulsecore/sink-input.h b/src/pulsecore/sink-input.h -index 86deab2..6e1b211 100644 ---- a/src/pulsecore/sink-input.h -+++ b/src/pulsecore/sink-input.h -@@ -32,6 +32,7 @@ - #include - #include - #include -+#include - - typedef enum pa_sink_input_state { - PA_SINK_INPUT_INIT, /*< The stream is not active yet, because pa_sink_input_put() has not been called yet */ -@@ -58,7 +59,8 @@ typedef enum pa_sink_input_flags { - PA_SINK_INPUT_DONT_INHIBIT_AUTO_SUSPEND = 256, - PA_SINK_INPUT_NO_CREATE_ON_SUSPEND = 512, - PA_SINK_INPUT_KILL_ON_SUSPEND = 1024, -- PA_SINK_INPUT_PASSTHROUGH = 2048 -+ PA_SINK_INPUT_PASSTHROUGH = 2048, -+ PA_SINK_INPUT_START_RAMP_MUTED = 4096, - } pa_sink_input_flags_t; - - struct pa_sink_input { -@@ -121,6 +123,9 @@ struct pa_sink_input { - * this.*/ - bool save_sink:1, save_volume:1, save_muted:1; - -+ /* for volume ramps */ -+ pa_cvolume_ramp_int ramp; -+ - pa_resample_method_t requested_resample_method, actual_resample_method; - - /* Returns the chunk of audio data and drops it from the -@@ -249,6 +254,8 @@ struct pa_sink_input { - pa_usec_t requested_sink_latency; - - pa_hashmap *direct_outputs; -+ -+ pa_cvolume_ramp_int ramp; - } thread_info; - - void *userdata; -@@ -265,6 +272,7 @@ enum { - PA_SINK_INPUT_MESSAGE_SET_STATE, - PA_SINK_INPUT_MESSAGE_SET_REQUESTED_LATENCY, - PA_SINK_INPUT_MESSAGE_GET_REQUESTED_LATENCY, -+ PA_SINK_INPUT_MESSAGE_SET_VOLUME_RAMP, - PA_SINK_INPUT_MESSAGE_MAX - }; - -@@ -370,6 +378,7 @@ void pa_sink_input_set_volume(pa_sink_input *i, const pa_cvolume *volume, bool s - void pa_sink_input_add_volume_factor(pa_sink_input *i, const char *key, const pa_cvolume *volume_factor); - int pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key); - pa_cvolume *pa_sink_input_get_volume(pa_sink_input *i, pa_cvolume *volume, bool absolute); -+void pa_sink_input_set_volume_ramp(pa_sink_input *i, const pa_cvolume_ramp *ramp, pa_bool_t send_msg, pa_bool_t save); - - void pa_sink_input_set_mute(pa_sink_input *i, bool mute, bool save); - --- -1.9.1 - diff --git a/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0004-sink-input-Code-cleanup-regarding-volume-ramping.patch b/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0004-sink-input-Code-cleanup-regarding-volume-ramping.patch deleted file mode 100644 index 64d7b141..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0004-sink-input-Code-cleanup-regarding-volume-ramping.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 49d8943b151a73be3dd726561a720c0f4bfdccac Mon Sep 17 00:00:00 2001 -From: Sangchul Lee -Date: Sat, 27 Aug 2016 21:33:18 +0900 -Subject: [PATCH 4/6] sink-input: Code cleanup regarding volume ramping - -Remove unused parameter of pa_sink_input_set_volume_ramp(). -Use bool instead of pa_bool_t. - -Signed-off-by: Sangchul Lee ---- - src/pulsecore/sink-input.c | 7 ++----- - src/pulsecore/sink-input.h | 2 +- - 2 files changed, 3 insertions(+), 6 deletions(-) - -diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c -index cc8953f..e1968e0 100644 ---- a/src/pulsecore/sink-input.c -+++ b/src/pulsecore/sink-input.c -@@ -931,7 +931,6 @@ void pa_sink_input_peek(pa_sink_input *i, size_t slength /* in sink bytes */, pa - pa_memchunk wchunk; - bool nvfs = need_volume_factor_sink; - pa_cvolume target; -- pa_bool_t tmp; - - wchunk = tchunk; - pa_memblock_ref(wchunk.memblock); -@@ -972,7 +971,7 @@ void pa_sink_input_peek(pa_sink_input *i, size_t slength /* in sink bytes */, pa - if (pa_cvolume_ramp_active(&i->thread_info.ramp)) { - pa_memchunk_make_writable(&wchunk, 0); - pa_volume_ramp_memchunk(&wchunk, &i->sink->sample_spec, &(i->thread_info.ramp)); -- } else if ((tmp = pa_cvolume_ramp_target_active(&(i->thread_info.ramp)))) { -+ } else if ((pa_cvolume_ramp_target_active(&(i->thread_info.ramp)))) { - pa_memchunk_make_writable(&wchunk, 0); - pa_cvolume_ramp_get_targets(&i->thread_info.ramp, &target); - pa_volume_memchunk(&wchunk, &i->sink->sample_spec, &target); -@@ -1372,9 +1371,7 @@ int pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key) { - void pa_sink_input_set_volume_ramp( - pa_sink_input *i, - const pa_cvolume_ramp *ramp, -- pa_bool_t send_msg, -- pa_bool_t save) { -- -+ bool send_msg) { - pa_sink_input_assert_ref(i); - pa_assert_ctl_context(); - pa_assert(PA_SINK_INPUT_IS_LINKED(i->state)); -diff --git a/src/pulsecore/sink-input.h b/src/pulsecore/sink-input.h -index 6e1b211..92f61c3 100644 ---- a/src/pulsecore/sink-input.h -+++ b/src/pulsecore/sink-input.h -@@ -378,7 +378,7 @@ void pa_sink_input_set_volume(pa_sink_input *i, const pa_cvolume *volume, bool s - void pa_sink_input_add_volume_factor(pa_sink_input *i, const char *key, const pa_cvolume *volume_factor); - int pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key); - pa_cvolume *pa_sink_input_get_volume(pa_sink_input *i, pa_cvolume *volume, bool absolute); --void pa_sink_input_set_volume_ramp(pa_sink_input *i, const pa_cvolume_ramp *ramp, pa_bool_t send_msg, pa_bool_t save); -+void pa_sink_input_set_volume_ramp(pa_sink_input *i, const pa_cvolume_ramp *ramp, bool send_msg); - - void pa_sink_input_set_mute(pa_sink_input *i, bool mute, bool save); - --- -1.9.1 - diff --git a/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0005-sink-input-volume-Add-support-for-volume-ramp-factor.patch b/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0005-sink-input-volume-Add-support-for-volume-ramp-factor.patch deleted file mode 100644 index e371b7ec..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0005-sink-input-volume-Add-support-for-volume-ramp-factor.patch +++ /dev/null @@ -1,299 +0,0 @@ -From a98e78ccc4f12d6efad2832a09202651e2a8b6cd Mon Sep 17 00:00:00 2001 -From: Sangchul Lee -Date: Sat, 27 Aug 2016 21:33:19 +0900 -Subject: [PATCH 5/6] sink-input, volume: Add support for volume ramp factor - -Previously, using pa_sink_input_set_volume_ramp() is hard to manage -if there are several callers. These new volume ramp factor APIs make it -easy for caller to use and to set more than one volume ramp factor. -New volume ramp factor will be applied by the multiplication of the other -ramp factors that have been already set. - -APIs are added as below. - - pa_sink_input_add_volume_ramp_factor() - - pa_sink_input_remove_volume_ramp_factor() - - pa_cvolume_ramp_compatible() - - pa_sw_cvolume_ramp_multiply() - - pa_cvolume_ramp_valid() - -Signed-off-by: Sangchul Lee ---- - src/map-file | 3 ++ - src/pulse/volume.c | 44 ++++++++++++++++++ - src/pulse/volume.h | 9 ++++ - src/pulsecore/sink-input.c | 108 +++++++++++++++++++++++++++++++++++++++++++++ - src/pulsecore/sink-input.h | 5 +++ - 5 files changed, 169 insertions(+) - -diff --git a/src/map-file b/src/map-file -index ef9b57d..7577c14 100644 ---- a/src/map-file -+++ b/src/map-file -@@ -142,6 +142,8 @@ pa_cvolume_ramp_equal; - pa_cvolume_ramp_init; - pa_cvolume_ramp_set; - pa_cvolume_ramp_channel_ramp_set; -+pa_cvolume_ramp_compatible; -+pa_cvolume_ramp_valid; - pa_cvolume_remap; - pa_cvolume_scale; - pa_cvolume_scale_mask; -@@ -344,6 +346,7 @@ pa_sw_cvolume_divide_scalar; - pa_sw_cvolume_multiply; - pa_sw_cvolume_multiply_scalar; - pa_sw_cvolume_snprint_dB; -+pa_sw_cvolume_ramp_multiply; - pa_sw_volume_divide; - pa_sw_volume_from_dB; - pa_sw_volume_from_linear; -diff --git a/src/pulse/volume.c b/src/pulse/volume.c -index 85072c1..8d99150 100644 ---- a/src/pulse/volume.c -+++ b/src/pulse/volume.c -@@ -1049,3 +1049,47 @@ pa_cvolume_ramp* pa_cvolume_ramp_channel_ramp_set(pa_cvolume_ramp *ramp, unsigne - - return ramp; - } -+ -+int pa_cvolume_ramp_compatible(const pa_cvolume_ramp *ramp, const pa_sample_spec *ss) { -+ -+ pa_assert(ramp); -+ pa_assert(ss); -+ -+ pa_return_val_if_fail(pa_cvolume_ramp_valid(ramp), 0); -+ pa_return_val_if_fail(pa_sample_spec_valid(ss), 0); -+ -+ return ramp->channels == ss->channels; -+} -+ -+pa_cvolume_ramp *pa_sw_cvolume_ramp_multiply(pa_cvolume_ramp *dest, const pa_cvolume_ramp *a, const pa_cvolume_ramp *b) { -+ unsigned i; -+ -+ pa_assert(dest); -+ pa_assert(a); -+ pa_assert(b); -+ -+ pa_return_val_if_fail(pa_cvolume_ramp_valid(a), NULL); -+ pa_return_val_if_fail(pa_cvolume_ramp_valid(b), NULL); -+ -+ for (i = 0; i < a->channels && i < b->channels; i++) -+ dest->ramps[i].target = pa_sw_volume_multiply(a->ramps[i].target, b->ramps[i].target); -+ -+ dest->channels = (uint8_t) i; -+ -+ return dest; -+} -+ -+int pa_cvolume_ramp_valid(const pa_cvolume_ramp *ramp) { -+ unsigned c; -+ -+ pa_assert(ramp); -+ -+ if (!pa_channels_valid(ramp->channels)) -+ return 0; -+ -+ for (c = 0; c < ramp->channels; c++) -+ if (!PA_VOLUME_IS_VALID(ramp->ramps[c].target)) -+ return 0; -+ -+ return 1; -+} -diff --git a/src/pulse/volume.h b/src/pulse/volume.h -index 2ae3451..65fcb08 100644 ---- a/src/pulse/volume.h -+++ b/src/pulse/volume.h -@@ -458,12 +458,21 @@ int pa_cvolume_ramp_equal(const pa_cvolume_ramp *a, const pa_cvolume_ramp *b); - /** Init volume ramp struct */ - pa_cvolume_ramp* pa_cvolume_ramp_init(pa_cvolume_ramp *ramp); - -+/** Set the volume ramp of the first n channels to PA_VOLUME_NORM */ -+#define pa_cvolume_ramp_reset(a, n, t, l) pa_cvolume_ramp_set((a), (n), (t), (l), PA_VOLUME_NORM) -+ - /** Set first n channels of ramp struct to certain value */ - pa_cvolume_ramp* pa_cvolume_ramp_set(pa_cvolume_ramp *ramp, unsigned channel, pa_volume_ramp_type_t type, long time, pa_volume_t vol); - - /** Set individual channel in the channel struct */ - pa_cvolume_ramp* pa_cvolume_ramp_channel_ramp_set(pa_cvolume_ramp *ramp, unsigned channel, pa_volume_ramp_type_t type, long time, pa_volume_t vol); - -+int pa_cvolume_ramp_compatible(const pa_cvolume_ramp *ramp, const pa_sample_spec *ss); -+ -+int pa_cvolume_ramp_valid(const pa_cvolume_ramp *ramp); -+ -+pa_cvolume_ramp *pa_sw_cvolume_ramp_multiply(pa_cvolume_ramp *dest, const pa_cvolume_ramp *a, const pa_cvolume_ramp *b); -+ - PA_C_DECL_END - - #endif -diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c -index e1968e0..6f89aa1 100644 ---- a/src/pulsecore/sink-input.c -+++ b/src/pulsecore/sink-input.c -@@ -53,6 +53,11 @@ struct volume_factor_entry { - pa_cvolume volume; - }; - -+struct volume_ramp_factor_entry { -+ char *key; -+ pa_cvolume_ramp ramp; -+}; -+ - static struct volume_factor_entry *volume_factor_entry_new(const char *key, const pa_cvolume *volume) { - struct volume_factor_entry *entry; - -@@ -83,6 +88,37 @@ static void volume_factor_from_hashmap(pa_cvolume *v, pa_hashmap *items, uint8_t - pa_sw_cvolume_multiply(v, v, &entry->volume); - } - -+static struct volume_ramp_factor_entry *volume_ramp_factor_entry_new(const char *key, const pa_cvolume_ramp *ramp) { -+ struct volume_ramp_factor_entry *entry; -+ -+ pa_assert(key); -+ pa_assert(ramp); -+ -+ entry = pa_xnew(struct volume_ramp_factor_entry, 1); -+ entry->key = pa_xstrdup(key); -+ -+ entry->ramp = *ramp; -+ -+ return entry; -+} -+ -+static void volume_ramp_factor_entry_free(struct volume_ramp_factor_entry *ramp_entry) { -+ pa_assert(ramp_entry); -+ -+ pa_xfree(ramp_entry->key); -+ pa_xfree(ramp_entry); -+} -+ -+static void volume_ramp_factor_from_hashmap(pa_cvolume_ramp *r, pa_hashmap *items, uint8_t channels, pa_volume_ramp_type_t type, long length) { -+ struct volume_ramp_factor_entry *entry; -+ void *state = NULL; -+ -+ pa_cvolume_ramp_reset(r, channels, type, length); -+ PA_HASHMAP_FOREACH(entry, items, state) -+ pa_sw_cvolume_ramp_multiply(r, r, &entry->ramp); -+ -+} -+ - static void sink_input_free(pa_object *o); - static void set_real_ratio(pa_sink_input *i, const pa_cvolume *v); - -@@ -500,6 +536,8 @@ int pa_sink_input_new( - i->volume_factor_sink_items = data->volume_factor_sink_items; - data->volume_factor_sink_items = NULL; - volume_factor_from_hashmap(&i->volume_factor_sink, i->volume_factor_sink_items, i->sink->sample_spec.channels); -+ i->ramp_factor_items = pa_hashmap_new_full(pa_idxset_string_hash_func, pa_idxset_string_compare_func, NULL, -+ (pa_free_cb_t) volume_ramp_factor_entry_free); - - i->real_ratio = i->reference_ratio = data->volume; - pa_cvolume_reset(&i->soft_volume, i->sample_spec.channels); -@@ -764,6 +802,9 @@ static void sink_input_free(pa_object *o) { - if (i->volume_factor_sink_items) - pa_hashmap_free(i->volume_factor_sink_items); - -+ if (i->ramp_factor_items) -+ pa_hashmap_free(i->ramp_factor_items); -+ - pa_xfree(i->driver); - pa_xfree(i); - } -@@ -1367,6 +1408,73 @@ int pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key) { - return 0; - } - -+void pa_sink_input_add_volume_ramp_factor(pa_sink_input *i, const char *key, const pa_cvolume_ramp *ramp_factor, bool send_msg) { -+ struct volume_ramp_factor_entry *r; -+ -+ pa_sink_input_assert_ref(i); -+ pa_assert_ctl_context(); -+ pa_assert(PA_SINK_INPUT_IS_LINKED(i->state)); -+ pa_assert(ramp_factor); -+ pa_assert(key); -+ pa_assert(pa_cvolume_ramp_valid(ramp_factor)); -+ pa_assert(ramp_factor->channels == 1 || pa_cvolume_ramp_compatible(ramp_factor, &i->sample_spec)); -+ -+ r = volume_ramp_factor_entry_new(key, ramp_factor); -+ if (!pa_cvolume_ramp_compatible(ramp_factor, &i->sample_spec)) -+ pa_cvolume_ramp_set(&r->ramp, i->sample_spec.channels, ramp_factor->ramps[0].type, ramp_factor->ramps[0].length, ramp_factor->ramps[0].target); -+ -+ pa_assert_se(pa_hashmap_put(i->ramp_factor_items, r->key, r) >= 0); -+ if (pa_hashmap_size(i->ramp_factor_items) == 1) -+ pa_cvolume_ramp_set(&i->ramp_factor, i->sample_spec.channels, r->ramp.ramps[0].type, r->ramp.ramps[0].length, r->ramp.ramps[0].target); -+ else -+ pa_sw_cvolume_ramp_multiply(&i->ramp_factor, &i->ramp_factor, &r->ramp); -+ -+ pa_cvolume_ramp_convert(&i->ramp_factor, &i->ramp, i->sample_spec.rate); -+ -+ if (send_msg) -+ pa_assert_se(pa_asyncmsgq_send(i->sink->asyncmsgq, PA_MSGOBJECT(i), PA_SINK_INPUT_MESSAGE_SET_VOLUME_RAMP, NULL, 0, NULL) == 0); -+ -+ return 0; -+} -+ -+/* Returns 0 if an entry was removed and -1 if no entry for the given key was -+ * found. */ -+int pa_sink_input_remove_volume_ramp_factor(pa_sink_input *i, const char *key, bool send_msg) { -+ struct volume_ramp_factor_entry *r; -+ -+ pa_sink_input_assert_ref(i); -+ pa_assert(key); -+ pa_assert_ctl_context(); -+ pa_assert(PA_SINK_INPUT_IS_LINKED(i->state)); -+ -+ r = pa_hashmap_remove(i->ramp_factor_items, key); -+ if (!r) -+ return -1; -+ -+ switch (pa_hashmap_size(i->ramp_factor_items)) { -+ case 0: -+ pa_cvolume_ramp_reset(&i->ramp_factor, i->sample_spec.channels, r->ramp.ramps[0].type, r->ramp.ramps[0].length); -+ break; -+ case 1: { -+ struct volume_ramp_factor_entry *rf; -+ rf = pa_hashmap_first(i->ramp_factor_items); -+ pa_cvolume_ramp_set(&i->ramp_factor, i->sample_spec.channels, r->ramp.ramps[0].type, r->ramp.ramps[0].length, rf->ramp.ramps[0].target); -+ break; -+ } -+ default: -+ volume_ramp_factor_from_hashmap(&i->ramp_factor, i->ramp_factor_items, i->ramp_factor.channels, i->ramp_factor.ramps[0].type, i->ramp_factor.ramps[0].length); -+ } -+ -+ volume_ramp_factor_entry_free(r); -+ -+ pa_cvolume_ramp_convert(&i->ramp_factor, &i->ramp, i->sample_spec.rate); -+ -+ if (send_msg) -+ pa_assert_se(pa_asyncmsgq_send(i->sink->asyncmsgq, PA_MSGOBJECT(i), PA_SINK_INPUT_MESSAGE_SET_VOLUME_RAMP, NULL, 0, NULL) == 0); -+ -+ return 0; -+} -+ - /* Called from main thread */ - void pa_sink_input_set_volume_ramp( - pa_sink_input *i, -diff --git a/src/pulsecore/sink-input.h b/src/pulsecore/sink-input.h -index 92f61c3..5430d53 100644 ---- a/src/pulsecore/sink-input.h -+++ b/src/pulsecore/sink-input.h -@@ -113,6 +113,9 @@ struct pa_sink_input { - pa_cvolume volume_factor_sink; /* A second volume factor in format of the sink this stream is connected to. */ - pa_hashmap *volume_factor_sink_items; - -+ pa_cvolume_ramp ramp_factor; -+ pa_hashmap *ramp_factor_items; -+ - bool volume_writable:1; - - bool muted:1; -@@ -379,6 +382,8 @@ void pa_sink_input_add_volume_factor(pa_sink_input *i, const char *key, const pa - int pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key); - pa_cvolume *pa_sink_input_get_volume(pa_sink_input *i, pa_cvolume *volume, bool absolute); - void pa_sink_input_set_volume_ramp(pa_sink_input *i, const pa_cvolume_ramp *ramp, bool send_msg); -+void pa_sink_input_add_volume_ramp_factor(pa_sink_input *i, const char *key, const pa_cvolume_ramp *ramp_factor, bool send_msg); -+int pa_sink_input_remove_volume_ramp_factor(pa_sink_input *i, const char *key, bool send_msg); - - void pa_sink_input_set_mute(pa_sink_input *i, bool mute, bool save); - --- -1.9.1 - diff --git a/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0006-sink-input-Remove-pa_sink_input_set_volume_ramp.patch b/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0006-sink-input-Remove-pa_sink_input_set_volume_ramp.patch deleted file mode 100644 index 50110bd1..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/0006-sink-input-Remove-pa_sink_input_set_volume_ramp.patch +++ /dev/null @@ -1,63 +0,0 @@ -From ac9a99505fd768b66dd92e9091e80b576cabc00d Mon Sep 17 00:00:00 2001 -From: Sangchul Lee -Date: Sat, 27 Aug 2016 21:33:20 +0900 -Subject: [PATCH 6/6] sink-input: Remove pa_sink_input_set_volume_ramp() - -Please use pa_sink_input_add_volume_ramp_factor() or -pa_sink_input_remove_volume_ramp_factor() instead of it. - -Signed-off-by: Sangchul Lee ---- - src/pulsecore/sink-input.c | 23 ----------------------- - src/pulsecore/sink-input.h | 1 - - 2 files changed, 24 deletions(-) - -diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c -index 6f89aa1..4c7c568 100644 ---- a/src/pulsecore/sink-input.c -+++ b/src/pulsecore/sink-input.c -@@ -1475,29 +1475,6 @@ int pa_sink_input_remove_volume_ramp_factor(pa_sink_input *i, const char *key, b - return 0; - } - --/* Called from main thread */ --void pa_sink_input_set_volume_ramp( -- pa_sink_input *i, -- const pa_cvolume_ramp *ramp, -- bool send_msg) { -- pa_sink_input_assert_ref(i); -- pa_assert_ctl_context(); -- pa_assert(PA_SINK_INPUT_IS_LINKED(i->state)); -- pa_assert(ramp); -- -- pa_cvolume_ramp_convert(ramp, &i->ramp, i->sample_spec.rate); -- -- pa_log_debug("setting volume ramp with target vol:%d and length:%ld", -- i->ramp.ramps[0].target, -- i->ramp.ramps[0].length); -- -- -- /* This tells the sink that volume ramp changed */ -- if (send_msg) -- pa_assert_se(pa_asyncmsgq_send(i->sink->asyncmsgq, PA_MSGOBJECT(i), PA_SINK_INPUT_MESSAGE_SET_VOLUME_RAMP, -- NULL, 0, NULL) == 0); --} -- - /* Called from main context */ - static void set_real_ratio(pa_sink_input *i, const pa_cvolume *v) { - pa_sink_input_assert_ref(i); -diff --git a/src/pulsecore/sink-input.h b/src/pulsecore/sink-input.h -index 5430d53..5fef3d5 100644 ---- a/src/pulsecore/sink-input.h -+++ b/src/pulsecore/sink-input.h -@@ -381,7 +381,6 @@ void pa_sink_input_set_volume(pa_sink_input *i, const pa_cvolume *volume, bool s - void pa_sink_input_add_volume_factor(pa_sink_input *i, const char *key, const pa_cvolume *volume_factor); - int pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key); - pa_cvolume *pa_sink_input_get_volume(pa_sink_input *i, pa_cvolume *volume, bool absolute); --void pa_sink_input_set_volume_ramp(pa_sink_input *i, const pa_cvolume_ramp *ramp, bool send_msg); - void pa_sink_input_add_volume_ramp_factor(pa_sink_input *i, const char *key, const pa_cvolume_ramp *ramp_factor, bool send_msg); - int pa_sink_input_remove_volume_ramp_factor(pa_sink_input *i, const char *key, bool send_msg); - --- -1.9.1 - diff --git a/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/enable-ofono-hfp-backend.patch b/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/enable-ofono-hfp-backend.patch deleted file mode 100644 index 85b1ae03..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio-12.2/enable-ofono-hfp-backend.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- pulseaudio-9.0/src/daemon/default.pa.in.orig 2017-05-17 17:26:20.415369638 +0000 -+++ pulseaudio-9.0/src/daemon/default.pa.in 2017-05-17 17:26:49.995316383 +0000 -@@ -82,7 +82,7 @@ - .endif - - .ifexists module-bluetooth-discover@PA_SOEXT@ --load-module module-bluetooth-discover -+load-module module-bluetooth-discover headset=ofono - .endif - ])dnl - diff --git a/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend b/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend deleted file mode 100644 index 6d7347d9..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend +++ /dev/null @@ -1,29 +0,0 @@ -FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" - -inherit systemd - -do_install_append() { - # Install pulseaudio systemd service - if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then - install -m 644 -p -D ${WORKDIR}/build/src/pulseaudio.service ${D}${systemd_user_unitdir}/pulseaudio.service - install -m 644 -p -D ${WORKDIR}/pulseaudio-${PV}/src/daemon/systemd/user/pulseaudio.socket ${D}${systemd_user_unitdir}/pulseaudio.socket - - # Execute these manually on behalf of systemctl script (from systemd-systemctl-native.bb) - # because it does not support systemd's user mode. - install -d ${D}${systemd_user_unitdir}/sockets.target.wants/ - ln -sf ${systemd_user_unitdir}/pulseaudio.socket ${D}${systemd_user_unitdir}/sockets.target.wants/ - - install -d ${D}${systemd_user_unitdir}/default.target.wants/ - ln -sf ${systemd_user_unitdir}/pulseaudio.service ${D}${systemd_user_unitdir}/default.target.wants/ - fi - mkdir -p ${D}/${bindir} - install -m 755 -p -D ${WORKDIR}/build/src/.libs/pacat ${D}/${bindir}/ -} - -FILES_${PN}-server += " \ - ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/pulseaudio.socket', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/sockets.target.wants/pulseaudio.socket', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/pulseaudio.service', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/default.target.wants/pulseaudio.service', '', d)} \ -" - diff --git a/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio_12.2.bbappend b/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio_12.2.bbappend deleted file mode 100644 index 74610040..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-multimedia/pulseaudio/pulseaudio_12.2.bbappend +++ /dev/null @@ -1,15 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}-${PV}:" - -SRC_URI += " \ - file://0001-install-files-for-a-module-development.patch \ - file://0002-volume-ramp-additions-to-the-low-level-infra.patch \ - file://0003-volume-ramp-adding-volume-ramping-to-sink-input.patch \ - file://0004-sink-input-Code-cleanup-regarding-volume-ramping.patch \ - file://0005-sink-input-volume-Add-support-for-volume-ramp-factor.patch \ - file://0006-sink-input-Remove-pa_sink_input_set_volume_ramp.patch;apply=no \ - file://enable-ofono-hfp-backend.patch \ -" - -PACKAGES =+ " pulseaudio-module-dev" - -FILES_pulseaudio-module-dev = "${includedir}/pulsemodule/* ${libdir}/pkgconfig/pulseaudio-module-devel.pc" diff --git a/meta-agl/meta-agl-profile-core/recipes-platform/images/agl-image-minimal-crosssdk.bb b/meta-agl/meta-agl-profile-core/recipes-platform/images/agl-image-minimal-crosssdk.bb old mode 100755 new mode 100644 index 27c1ee6d..8c5aae1b --- a/meta-agl/meta-agl-profile-core/recipes-platform/images/agl-image-minimal-crosssdk.bb +++ b/meta-agl/meta-agl-profile-core/recipes-platform/images/agl-image-minimal-crosssdk.bb @@ -8,23 +8,7 @@ require agl-image-minimal.bb LICENSE = "MIT" -IMAGE_FEATURES_append = " dev-pkgs" -IMAGE_INSTALL_append = " kernel-dev kernel-devsrc" - -# required dependencies for app and test builds -# also in the minimal image (SPEC-1678) -TOOLCHAIN_HOST_TASK += " \ - nativesdk-lua \ - " - -# required dependencies for app and test builds -# also in the minimal image (SPEC-1678) -TOOLCHAIN_TARGET_TASK += " \ - lua-dev \ - lua-staticdev \ - libafb-helpers-staticdev \ - libappcontroller-staticdev \ - " +require agl-image-minimal-crosssdk.inc inherit populate_sdk @@ -32,4 +16,3 @@ inherit populate_sdk # Both exec "createrepo" on the same directory, and so one of them # can failed (randomly). addtask do_populate_sdk after do_rootfs - diff --git a/meta-agl/meta-agl-profile-core/recipes-platform/images/agl-image-minimal-crosssdk.inc b/meta-agl/meta-agl-profile-core/recipes-platform/images/agl-image-minimal-crosssdk.inc new file mode 100644 index 00000000..71812943 --- /dev/null +++ b/meta-agl/meta-agl-profile-core/recipes-platform/images/agl-image-minimal-crosssdk.inc @@ -0,0 +1,18 @@ +IMAGE_FEATURES_append = " dev-pkgs" +IMAGE_INSTALL_append = " kernel-dev kernel-devsrc" + +# Always include the test widgets +IMAGE_FEATURES_append = " agl-test-wgt" + +# Required dependencies for app and test builds +TOOLCHAIN_HOST_TASK += " \ + nativesdk-lua \ + " + +# Required dependencies for app and test builds +TOOLCHAIN_TARGET_TASK += " \ + lua-dev \ + lua-staticdev \ + libafb-helpers-staticdev \ + libappcontroller-staticdev \ + " diff --git a/meta-agl/meta-agl-profile-core/recipes-platform/packagegroups/packagegroup-agl-core-boot.bb b/meta-agl/meta-agl-profile-core/recipes-platform/packagegroups/packagegroup-agl-core-boot.bb index 690dc9e1..1633fedd 100644 --- a/meta-agl/meta-agl-profile-core/recipes-platform/packagegroups/packagegroup-agl-core-boot.bb +++ b/meta-agl/meta-agl-profile-core/recipes-platform/packagegroups/packagegroup-agl-core-boot.bb @@ -34,7 +34,6 @@ RDEPENDS_${PN} = "\ base-files \ base-passwd \ busybox \ - distro-build-manifest \ rng-tools \ run-agl-postinsts \ ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "${SYSVINIT_SCRIPTS}", "", d)} \ diff --git a/meta-agl/meta-agl-profile-core/recipes-platform/packagegroups/packagegroup-agl-core-services.bb b/meta-agl/meta-agl-profile-core/recipes-platform/packagegroups/packagegroup-agl-core-services.bb index b6f8f07c..2fd31d14 100644 --- a/meta-agl/meta-agl-profile-core/recipes-platform/packagegroups/packagegroup-agl-core-services.bb +++ b/meta-agl/meta-agl-profile-core/recipes-platform/packagegroups/packagegroup-agl-core-services.bb @@ -7,10 +7,8 @@ PACKAGES = "\ packagegroup-agl-core-services \ " -ALLOW_EMPTY_${PN} = "1" - RDEPENDS_${PN} += "\ -agl-service-data-persistence \ -agl-service-network \ -agl-service-platform-info \ + agl-service-data-persistence \ + agl-service-network \ + agl-service-platform-info \ " diff --git a/meta-agl/meta-agl-profile-core/recipes-support/curl/curl/0001-replace-krb5-config-with-pkg-config.patch b/meta-agl/meta-agl-profile-core/recipes-support/curl/curl/0001-replace-krb5-config-with-pkg-config.patch deleted file mode 100644 index a7db1b3c..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-support/curl/curl/0001-replace-krb5-config-with-pkg-config.patch +++ /dev/null @@ -1,44 +0,0 @@ -From ed70f0623708b8a6c1f58a5d243d87c5ff45b24d Mon Sep 17 00:00:00 2001 -From: Roy Li -Date: Tue, 26 Apr 2016 13:13:01 +0800 -Subject: [PATCH] replace krb5-config with pkg-config - -Upstream-Status: Pending - -Signed-off-by: Roy Li - ---- - configure.ac | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 5569a26..56b0380 100755 ---- a/configure.ac -+++ b/configure.ac -@@ -1290,7 +1290,7 @@ AC_ARG_WITH(gssapi, - fi - ]) - --: ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"} -+KRB5CONFIG=`which pkg-config` - - save_CPPFLAGS="$CPPFLAGS" - AC_MSG_CHECKING([if GSS-API support is requested]) -@@ -1301,7 +1301,7 @@ if test x"$want_gss" = xyes; then - if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then - GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi` - elif test -f "$KRB5CONFIG"; then -- GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi` -+ GSSAPI_INCS=`$KRB5CONFIG --cflags mit-krb5-gssapi` - elif test "$GSSAPI_ROOT" != "yes"; then - GSSAPI_INCS="-I$GSSAPI_ROOT/include" - fi -@@ -1394,7 +1394,7 @@ if test x"$want_gss" = xyes; then - elif test -f "$KRB5CONFIG"; then - dnl krb5-config doesn't have --libs-only-L or similar, put everything - dnl into LIBS -- gss_libs=`$KRB5CONFIG --libs gssapi` -+ gss_libs=`$KRB5CONFIG --libs mit-krb5-gssapi` - LIBS="$gss_libs $LIBS" - else - case $host in diff --git a/meta-agl/meta-agl-profile-core/recipes-support/curl/curl_7.66.0.bb b/meta-agl/meta-agl-profile-core/recipes-support/curl/curl_7.66.0.bb deleted file mode 100644 index d1975f24..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-support/curl/curl_7.66.0.bb +++ /dev/null @@ -1,80 +0,0 @@ -SUMMARY = "Command line tool and library for client-side URL transfers" -HOMEPAGE = "http://curl.haxx.se/" -BUGTRACKER = "http://curl.haxx.se/mail/list.cgi?list=curl-tracker" -SECTION = "console/network" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://COPYING;md5=be5d9e1419c4363f4b32037a2d3b7ffa" - -SRC_URI = "http://curl.haxx.se/download/curl-${PV}.tar.bz2 \ - file://0001-replace-krb5-config-with-pkg-config.patch \ -" - -SRC_URI[md5sum] = "c238aa394e3aa47ca4fcb0491774149f" -SRC_URI[sha256sum] = "6618234e0235c420a21f4cb4c2dd0badde76e6139668739085a70c4e2fe7a141" - -CVE_PRODUCT = "curl libcurl" -inherit autotools pkgconfig binconfig multilib_header - -PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} gnutls libidn proxy threaded-resolver verbose zlib" -PACKAGECONFIG_class-native = "ipv6 proxy ssl threaded-resolver verbose zlib" -PACKAGECONFIG_class-nativesdk = "ipv6 proxy ssl threaded-resolver verbose zlib" - -# 'ares' and 'threaded-resolver' are mutually exclusive -PACKAGECONFIG[ares] = "--enable-ares,--disable-ares,c-ares" -PACKAGECONFIG[brotli] = "--with-brotli,--without-brotli,brotli" -PACKAGECONFIG[builtinmanual] = "--enable-manual,--disable-manual" -PACKAGECONFIG[dict] = "--enable-dict,--disable-dict," -PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls" -PACKAGECONFIG[gopher] = "--enable-gopher,--disable-gopher," -PACKAGECONFIG[imap] = "--enable-imap,--disable-imap," -PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," -PACKAGECONFIG[krb5] = "--with-gssapi,--without-gssapi,krb5" -PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap," -PACKAGECONFIG[ldaps] = "--enable-ldaps,--disable-ldaps," -PACKAGECONFIG[libidn] = "--with-libidn2,--without-libidn2,libidn2" -PACKAGECONFIG[libssh2] = "--with-libssh2,--without-libssh2,libssh2" -PACKAGECONFIG[mbedtls] = "--with-mbedtls=${STAGING_DIR_TARGET},--without-mbedtls,mbedtls" -PACKAGECONFIG[nghttp2] = "--with-nghttp2,--without-nghttp2,nghttp2" -PACKAGECONFIG[pop3] = "--enable-pop3,--disable-pop3," -PACKAGECONFIG[proxy] = "--enable-proxy,--disable-proxy," -PACKAGECONFIG[rtmpdump] = "--with-librtmp,--without-librtmp,rtmpdump" -PACKAGECONFIG[rtsp] = "--enable-rtsp,--disable-rtsp," -PACKAGECONFIG[smb] = "--enable-smb,--disable-smb," -PACKAGECONFIG[smtp] = "--enable-smtp,--disable-smtp," -PACKAGECONFIG[ssl] = "--with-ssl --with-random=/dev/urandom,--without-ssl,openssl" -PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss" -PACKAGECONFIG[telnet] = "--enable-telnet,--disable-telnet," -PACKAGECONFIG[tftp] = "--enable-tftp,--disable-tftp," -PACKAGECONFIG[threaded-resolver] = "--enable-threaded-resolver,--disable-threaded-resolver" -PACKAGECONFIG[verbose] = "--enable-verbose,--disable-verbose" -PACKAGECONFIG[zlib] = "--with-zlib=${STAGING_LIBDIR}/../,--without-zlib,zlib" - -EXTRA_OECONF = " \ - --disable-libcurl-option \ - --disable-ntlm-wb \ - --enable-crypto-auth \ - --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt \ - --without-libmetalink \ - --without-libpsl \ -" - -do_install_append_class-target() { - # cleanup buildpaths from curl-config - sed -i \ - -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ - -e 's,--with-libtool-sysroot=${STAGING_DIR_TARGET},,g' \ - -e 's|${DEBUG_PREFIX_MAP}||g' \ - ${D}${bindir}/curl-config -} - -PACKAGES =+ "lib${BPN}" - -FILES_lib${BPN} = "${libdir}/lib*.so.*" -RRECOMMENDS_lib${BPN} += "ca-certificates" - -FILES_${PN} += "${datadir}/zsh" - -inherit multilib_script -MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/curl-config" - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-agl/meta-agl-profile-core/recipes-support/libmicrohttpd/libmicrohttpd_0.9.63.bb b/meta-agl/meta-agl-profile-core/recipes-support/libmicrohttpd/libmicrohttpd_0.9.63.bb deleted file mode 100644 index ab6f681d..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-support/libmicrohttpd/libmicrohttpd_0.9.63.bb +++ /dev/null @@ -1,28 +0,0 @@ -DESCRIPTION = "A small C library that is supposed to make it easy to run an HTTP server as part of another application" -HOMEPAGE = "http://www.gnu.org/software/libmicrohttpd/" -LICENSE = "LGPL-2.1+" -LIC_FILES_CHKSUM = "file://COPYING;md5=9331186f4f80db7da0e724bdd6554ee5" -SECTION = "net" -DEPENDS = "file" - -SRC_URI = "http://ftp.gnu.org/gnu/libmicrohttpd/${BPN}-${PV}.tar.gz" -SRC_URI[md5sum] = "1c10de049608fca46941cbc790e3ab00" -SRC_URI[sha256sum] = "37c36f1be177f0e37ef181a645cd3baac1000bd322a01c2eff70f3cc8c91749c" - -inherit autotools lib_package pkgconfig gettext - -CFLAGS += "-pthread -D_REENTRANT" - -EXTRA_OECONF += "--disable-static --with-gnutls=${STAGING_LIBDIR}/../" - -PACKAGECONFIG ?= "curl https" -PACKAGECONFIG_append_class-target = "\ - ${@bb.utils.filter('DISTRO_FEATURES', 'largefile', d)} \ -" -PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,," -PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl," -PACKAGECONFIG[https] = "--enable-https,--disable-https,libgcrypt gnutls," - -do_compile_append() { - sed -i s:-L${STAGING_LIBDIR}::g libmicrohttpd.pc -} diff --git a/meta-agl/meta-agl-profile-core/recipes-support/nghttp2/nghttp2_1.39.1.bb b/meta-agl/meta-agl-profile-core/recipes-support/nghttp2/nghttp2_1.39.1.bb deleted file mode 100644 index 6077daf7..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-support/nghttp2/nghttp2_1.39.1.bb +++ /dev/null @@ -1,15 +0,0 @@ -SUMMARY = "HTTP/2 C Library and tools" -HOMEPAGE = "https://nghttp2.org/" -SECTION = "libs" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://COPYING;md5=764abdf30b2eadd37ce47dcbce0ea1ec" - -+UPSTREAM_CHECK_URI = "https://github.com/nghttp2/nghttp2/releases" - -SRC_URI = "https://github.com/nghttp2/nghttp2/releases/download/v${PV}/nghttp2-${PV}.tar.xz" -SRC_URI[md5sum] = "02b015cb178c46f27dd87228e33db35f" -SRC_URI[sha256sum] = "679160766401f474731fd60c3aca095f88451e3cc4709b72306e4c34cf981448" - -DEPENDS = "libxml2 openssl zlib jansson cunit c-ares" - -inherit cmake pythonnative python-dir diff --git a/meta-agl/meta-agl-profile-core/recipes-support/opencv/opencv_3.%.bbappend b/meta-agl/meta-agl-profile-core/recipes-support/opencv/opencv_3.%.bbappend deleted file mode 100644 index 8656abf0..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-support/opencv/opencv_3.%.bbappend +++ /dev/null @@ -1 +0,0 @@ -PACKAGECONFIG ?= "jpeg png v4l libv4l gstreamer" diff --git a/meta-agl/meta-agl-profile-core/recipes-support/opencv/opencv_4.%.bbappend b/meta-agl/meta-agl-profile-core/recipes-support/opencv/opencv_4.%.bbappend new file mode 100644 index 00000000..8656abf0 --- /dev/null +++ b/meta-agl/meta-agl-profile-core/recipes-support/opencv/opencv_4.%.bbappend @@ -0,0 +1 @@ +PACKAGECONFIG ?= "jpeg png v4l libv4l gstreamer" diff --git a/meta-agl/meta-agl-profile-core/recipes-support/udisks/files/99-udisks2.rules b/meta-agl/meta-agl-profile-core/recipes-support/udisks/files/99-udisks2.rules new file mode 100644 index 00000000..996e4343 --- /dev/null +++ b/meta-agl/meta-agl-profile-core/recipes-support/udisks/files/99-udisks2.rules @@ -0,0 +1,5 @@ +# UDISKS_FILESYSTEM_SHARED +# ==1: mount filesystem to a shared directory (/media/VolumeName) +# ==0: mount filesystem to a private directory (/run/media/$USER/VolumeName) +# See udisks(8) +ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{UDISKS_FILESYSTEM_SHARED}="1" diff --git a/meta-agl/meta-agl-profile-core/recipes-support/udisks/files/automount.service b/meta-agl/meta-agl-profile-core/recipes-support/udisks/files/automount.service index 64c36e76..b1651519 100644 --- a/meta-agl/meta-agl-profile-core/recipes-support/udisks/files/automount.service +++ b/meta-agl/meta-agl-profile-core/recipes-support/udisks/files/automount.service @@ -1,6 +1,6 @@ [Unit] Description=Automount Disk Manager -After=udisks.service +After=udisks2.service [Service] ExecStart=/usr/libexec/automount.sh diff --git a/meta-agl/meta-agl-profile-core/recipes-support/udisks/files/org.freedesktop.UDisks.conf b/meta-agl/meta-agl-profile-core/recipes-support/udisks/files/org.freedesktop.UDisks.conf deleted file mode 100644 index 0098b94e..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-support/udisks/files/org.freedesktop.UDisks.conf +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/meta-agl/meta-agl-profile-core/recipes-support/udisks/files/udisks.service b/meta-agl/meta-agl-profile-core/recipes-support/udisks/files/udisks.service deleted file mode 100644 index 4bd55844..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-support/udisks/files/udisks.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Disk Manager (legacy version) -Documentation=man:udisks(7) - -[Service] -Type=dbus -BusName=org.freedesktop.UDisks -ExecStart=/usr/libexec/udisks-daemon --no-debug - -[Install] -WantedBy=multi-user.target diff --git a/meta-agl/meta-agl-profile-core/recipes-support/udisks/udisks2_%.bbappend b/meta-agl/meta-agl-profile-core/recipes-support/udisks/udisks2_%.bbappend new file mode 100644 index 00000000..34756f48 --- /dev/null +++ b/meta-agl/meta-agl-profile-core/recipes-support/udisks/udisks2_%.bbappend @@ -0,0 +1,26 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI += "file://automount.service \ + file://automount.sh \ + file://99-udisks2.rules \ +" + +SYSTEMD_AUTO_ENABLE = "enable" +SYSTEMD_SERVICE_${PN} += "automount.service" + +do_install_append () { + sed -i 's/^WantedBy=.*/WantedBy=multi-user.target/' ${D}${systemd_unitdir}/system/udisks2.service + + install -d ${D}${base_libdir}/systemd/system + install -m 0644 ${WORKDIR}/automount.service ${D}${systemd_unitdir}/system + + install -d ${D}${libexecdir} + install -m 0755 ${WORKDIR}/automount.sh ${D}${libexecdir}/automount.sh + + install -d ${D}${sysconfdir}/udev/rules.d + install -m 0644 ${WORKDIR}/99-udisks2.rules ${D}${sysconfdir}/udev/rules.d +} + +FILES_${PN} += "${base_libdir}/systemd/system/automount.service \ + ${libexecdir}/automount.sh \ +" diff --git a/meta-agl/meta-agl-profile-core/recipes-support/udisks/udisks_1.0.5.bbappend b/meta-agl/meta-agl-profile-core/recipes-support/udisks/udisks_1.0.5.bbappend deleted file mode 100644 index d55a167a..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-support/udisks/udisks_1.0.5.bbappend +++ /dev/null @@ -1,28 +0,0 @@ -SRC_URI += "file://org.freedesktop.UDisks.conf \ - file://udisks.service \ - file://automount.service \ - file://automount.sh \ - " -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -FILES_${PN} += "${base_libdir}/systemd/system/automount.service \ - ${base_libdir}/systemd/system/udisks.service \ - ${libexecdir}/automount.sh \ - " - -SYSTEMD_AUTO_ENABLE = "enable" -SYSTEMD_SERVICE_${PN} = "udisks.service automount.service" - -do_install_append () { - install -d ${D}${sysconfdir}/dbus-1/system.d - install -m 644 ${WORKDIR}/org.freedesktop.UDisks.conf ${D}${sysconfdir}/dbus-1/system.d/ - - install -d ${D}${base_libdir}/systemd/system - install -m 0644 ${WORKDIR}/udisks.service ${D}${base_libdir}/systemd/system - - install -d ${D}${base_libdir}/systemd/system - install -m 0644 ${WORKDIR}/automount.service ${D}${base_libdir}/systemd/system - - install -d ${D}${libexecdir} - install -m 0755 ${WORKDIR}/automount.sh ${D}${libexecdir}/automount.sh -} diff --git a/meta-agl/meta-agl-profile-core/recipes-test/afb-test/afb-test_git.bb b/meta-agl/meta-agl-profile-core/recipes-test/afb-test/afb-test_git.bb index fc1874aa..5246abb0 100644 --- a/meta-agl/meta-agl-profile-core/recipes-test/afb-test/afb-test_git.bb +++ b/meta-agl/meta-agl-profile-core/recipes-test/afb-test/afb-test_git.bb @@ -3,11 +3,11 @@ DESCRIPTION = "This make testing binding running with Application Framework bind easier by simply test verb return as well as event reception." HOMEPAGE = "https://gerrit.automotivelinux.org/gerrit/#/admin/projects/apps/app-afb-test" LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" +LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" SECTION = "apps" SRC_URI = "git://gerrit.automotivelinux.org/gerrit/apps/app-afb-test;protocol=https;branch=${AGL_BRANCH}" -SRCREV = "4d0948a2eeb60522b773d058f63418fd640d78c5" +SRCREV = "${AGL_APP_REVISION}" DEPENDS += "lua libafb-helpers libappcontroller" RDEPENDS_${PN} += "lua bash jq" diff --git a/meta-agl/meta-agl-profile-core/recipes-test/fontconfig/fontconfig_%.bbappend b/meta-agl/meta-agl-profile-core/recipes-test/fontconfig/fontconfig_%.bbappend index c4bebdc1..e8ce1ab7 100644 --- a/meta-agl/meta-agl-profile-core/recipes-test/fontconfig/fontconfig_%.bbappend +++ b/meta-agl/meta-agl-profile-core/recipes-test/fontconfig/fontconfig_%.bbappend @@ -1,16 +1,17 @@ -PACKAGES =+ "fontconfig-test" - do_install_append() { install -m 755 -d ${D}/${datadir}/fontconfig-test install -m 755 ${S}/test/run-test.sh ${D}/${datadir}/fontconfig-test/ - sed -i -e "s/FCLIST=\.\.\/fc\-list\/fc\-list/FCLIST=\/usr\/bin\/fc\-list/g" -e "s/FCCACHE=\.\.\/fc\-cache\/fc\-cache/FCCACHE=\/usr\/bin\/fc\-cache/g" ${D}/${datadir}/fontconfig-test/run-test.sh + sed -i -e "s#^FCLIST=\.\./fc-list/fc-list#FCLIST=/usr/bin/fc-list#g" -e "s#^FCCACHE=\.\./fc-cache/fc-cache#FCCACHE=/usr/bin/fc-cache#g" ${D}/${datadir}/fontconfig-test/run-test.sh - for x in 4x6.pcf 8x16.pcf out.expected fonts.conf.in; do + install -m 644 ${B}/test/out.expected ${D}/${datadir}/fontconfig-test/ + for x in 4x6.pcf 8x16.pcf fonts.conf.in; do install -m 644 ${S}/test/$x ${D}/${datadir}/fontconfig-test/ done } +PACKAGES =+ "fontconfig-test" + DEBIAN_NOAUTONAME_fontconfig-test = "1" FILES_fontconfig-test = "${datadir}/fontconfig-test/*" diff --git a/meta-agl/meta-agl-profile-core/recipes-test/freetype/freetype_2.%.bbappend b/meta-agl/meta-agl-profile-core/recipes-test/freetype/freetype_2.%.bbappend new file mode 100644 index 00000000..6aa1eabc --- /dev/null +++ b/meta-agl/meta-agl-profile-core/recipes-test/freetype/freetype_2.%.bbappend @@ -0,0 +1,34 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI =+ "${SOURCEFORGE_MIRROR}/freetype/freetype-demos/${PV}/ft2demos-${PV}.tar.gz;name=ft2demos \ + file://0001-Makefile-dont-build-gfx-demos.patch;patchdir=../ft2demos-${PV} \ + file://0001-ft2demos-Makefile-Do-not-hardcode-libtool-path.patch;patchdir=../ft2demos-${PV} \ + " +SRC_URI[ft2demos.md5sum] = "c376adf4782bac9b9ac8e427884752d2" +SRC_URI[ft2demos.sha256sum] = "5e9e94a2db9d1a945293a1644a502f6664a2173a454d4a55b19695e2e2f4a0bc" + +PACKAGES =+ "${PN}-demos" + +B = "${S}" + +do_compile_append () { + oe_runmake -C ${WORKDIR}/ft2demos-${PV} TOP_DIR=${WORKDIR}/${BPN}-${PV}/ +} + +do_install_append () { + install -d -m 0755 ${D}/${bindir} + for x in ftbench ftdump ftlint ftvalid ttdebug; do + install -m 0755 ${WORKDIR}/ft2demos-${PV}/bin/.libs/$x ${D}/${bindir} + done +} + +FILES_${PN}-demos = "\ + ${bindir}/ftbench \ + ${bindir}/ftdump \ + ${bindir}/ftlint \ + ${bindir}/ftvalid \ + ${bindir}/ttdebug \ +" + +# enable pixmap/libpng support to allow color emojis +PACKAGECONFIG_append = " pixmap" diff --git a/meta-agl/meta-agl-profile-core/recipes-test/freetype/freetype_2.9.1.bbappend b/meta-agl/meta-agl-profile-core/recipes-test/freetype/freetype_2.9.1.bbappend deleted file mode 100644 index 19499e2b..00000000 --- a/meta-agl/meta-agl-profile-core/recipes-test/freetype/freetype_2.9.1.bbappend +++ /dev/null @@ -1,35 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -SRC_URI =+ "${SOURCEFORGE_MIRROR}/freetype/ft2demos-${PV}.tar.bz2;name=ft2demos \ - file://0001-Makefile-dont-build-gfx-demos.patch;patchdir=../ft2demos-${PV} \ - file://0001-ft2demos-Makefile-Do-not-hardcode-libtool-path.patch;patchdir=../ft2demos-${PV} \ - " -SRC_URI[ft2demos.md5sum] = "178827156d90e07bce8f354c9565d84b" -SRC_URI[ft2demos.sha256sum] = "806eb6363ee5963174a6740f9b7893377912165899c2c1f6372c422aab818c6a" - -PACKAGES =+ "${PN}-demos" - -B = "${S}" - -do_compile_append () { - - oe_runmake -C ${WORKDIR}/ft2demos-${PV} TOP_DIR=${WORKDIR}/${BPN}-${PV}/ -} - -do_install_append () { - install -d -m 0755 ${D}/${bindir} - for x in ftbench ftdump ftlint ftvalid ttdebug; do - install -m 0755 ${WORKDIR}/ft2demos-${PV}/bin/.libs/$x ${D}/${bindir} - done -} - -FILES_${PN}-demos = "\ - ${bindir}/ftbench \ - ${bindir}/ftdump \ - ${bindir}/ftlint \ - ${bindir}/ftvalid \ - ${bindir}/ttdebug \ -" - -# enable pixmap/libpng support to allow color emojis -PACKAGECONFIG_append = " pixmap" diff --git a/meta-agl/meta-agl-profile-core/recipes-test/pyagl/pyagl_git.bb b/meta-agl/meta-agl-profile-core/recipes-test/pyagl/pyagl_git.bb new file mode 100644 index 00000000..db6f7dee --- /dev/null +++ b/meta-agl/meta-agl-profile-core/recipes-test/pyagl/pyagl_git.bb @@ -0,0 +1,29 @@ +SUMMARY = "Python bindings and tests for Automotive Grade Linux services" +HOMEPAGE = "https://gerrit.automotivelinux.org/gerrit/#/admin/projects/src/pyagl" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=ae6497158920d9524cf208c09cc4c984" + +SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/pyagl;protocol=https;branch=${AGL_BRANCH}" +SRCREV = "bc241e850fa1d2ceeb76acd9bac8733868392baa" +PV = "${AGL_BRANCH}+git${SRCPV}" + +S = "${WORKDIR}/git" + +inherit setuptools3 + +RDEPENDS_${PN} += " \ + python3-asyncio \ + python3-asyncssh \ + python3-core \ + python3-json \ + python3-logging \ + python3-math \ + python3-parse \ + python3-pprint \ + python3-pytest \ + python3-pytest-asyncio \ + python3-pytest-dependency \ + python3-pytest-reverse \ + python3-typing \ + python3-websockets \ +" diff --git a/meta-agl/meta-agl-profile-graphical-html5/conf/layer.conf b/meta-agl/meta-agl-profile-graphical-html5/conf/layer.conf new file mode 100644 index 00000000..d499dd17 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-html5/conf/layer.conf @@ -0,0 +1,12 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have recipes-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "html5-framework" +BBFILE_PATTERN_html5-framework = "^${LAYERDIR}/" +BBFILE_PRIORITY_html5-framework = "80" + +LAYERSERIES_COMPAT_html5-framework = "dunfell" diff --git a/meta-agl/meta-agl-profile-graphical-html5/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl/meta-agl-profile-graphical-html5/recipes-graphics/wayland/weston-ini-conf.bbappend new file mode 100644 index 00000000..2c5201aa --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-html5/recipes-graphics/wayland/weston-ini-conf.bbappend @@ -0,0 +1,12 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI_remove = " \ + file://hdmi-a-1-270.cfg \ + file://hdmi-a-1-90.cfg \ + file://virtual.cfg \ +" + +SRC_URI += " \ + file://hdmi-a-1-180.cfg \ + file://virtual-landscape.cfg \ +" diff --git a/meta-agl/meta-agl-profile-graphical-html5/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-180.cfg b/meta-agl/meta-agl-profile-graphical-html5/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-180.cfg new file mode 100644 index 00000000..59e2c2db --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-html5/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-180.cfg @@ -0,0 +1,4 @@ +# A display is connected to HDMI-A-1 +[output] +name=HDMI-A-1 +transform=0 diff --git a/meta-agl/meta-agl-profile-graphical-html5/recipes-graphics/wayland/weston-ini-conf/virtual-landscape.cfg b/meta-agl/meta-agl-profile-graphical-html5/recipes-graphics/wayland/weston-ini-conf/virtual-landscape.cfg new file mode 100644 index 00000000..d6925363 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-html5/recipes-graphics/wayland/weston-ini-conf/virtual-landscape.cfg @@ -0,0 +1,3 @@ +[output] +name=Virtual-1 +mode=1920x1080 diff --git a/meta-agl/meta-agl-profile-graphical-html5/recipes-platform/images/agl-image-graphical-html5.bb b/meta-agl/meta-agl-profile-graphical-html5/recipes-platform/images/agl-image-graphical-html5.bb new file mode 100644 index 00000000..0ec6829e --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-html5/recipes-platform/images/agl-image-graphical-html5.bb @@ -0,0 +1,10 @@ +SUMMARY = "An image containing all packages required to run web applications" + +require agl-image-graphical-html5.inc + +LICENSE = "MIT" + +IMAGE_INSTALL_append = "\ + packagegroup-agl-profile-graphical-html5 \ + " + diff --git a/meta-agl/meta-agl-profile-graphical-html5/recipes-platform/images/agl-image-graphical-html5.inc b/meta-agl/meta-agl-profile-graphical-html5/recipes-platform/images/agl-image-graphical-html5.inc new file mode 100644 index 00000000..e943b990 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-html5/recipes-platform/images/agl-image-graphical-html5.inc @@ -0,0 +1,9 @@ +require recipes-platform/images/agl-image-minimal.inc + +IMAGE_FEATURES += "splash" + +IMAGE_FEATURES += "${@bb.utils.contains('DISTRO_FEATURES', 'agl-devel', 'ssh-server-dropbear' , '', d)}" + +inherit features_check + +REQUIRED_DISTRO_FEATURES = "wayland" diff --git a/meta-agl/meta-agl-profile-graphical-html5/recipes-platform/packagegroups/packagegroup-agl-appfw-html5.bb b/meta-agl/meta-agl-profile-graphical-html5/recipes-platform/packagegroups/packagegroup-agl-appfw-html5.bb new file mode 100644 index 00000000..cc9ed3d6 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-html5/recipes-platform/packagegroups/packagegroup-agl-appfw-html5.bb @@ -0,0 +1,18 @@ +SUMMARY = "AGL web runtime packages" +DESCRIPTION = "Specific packages for the AGL web runtime (minus profile-graphical)" + +LICENSE = "MIT" + +inherit packagegroup + +PACKAGES = "\ + packagegroup-agl-appfw-html5 \ + " + +ALLOW_EMPTY_${PN} = "1" + +# add packages for WAM +RDEPENDS_${PN} += " \ + chromium-browser-service \ + wam \ + " diff --git a/meta-agl/meta-agl-profile-graphical-html5/recipes-platform/packagegroups/packagegroup-agl-profile-graphical-html5.bb b/meta-agl/meta-agl-profile-graphical-html5/recipes-platform/packagegroups/packagegroup-agl-profile-graphical-html5.bb new file mode 100644 index 00000000..20275014 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-html5/recipes-platform/packagegroups/packagegroup-agl-profile-graphical-html5.bb @@ -0,0 +1,23 @@ +SUMMARY = "AGL web runtime profile" +DESCRIPTION = "The full set of packages required for AGL web runtime" +LICENSE = "MIT" + +inherit packagegroup + +PACKAGES = "\ + packagegroup-agl-profile-graphical-html5 \ + profile-graphical-html5 \ + " + +ALLOW_EMPTY_${PN} = "1" + +RDEPENDS_${PN} += "\ + packagegroup-agl-profile-graphical \ + packagegroup-agl-appfw-html5 \ +" + +RDEPENDS_${PN} += "\ + agl-login-manager \ + " + +RDEPENDS_profile-graphical-html5 = "${PN}" diff --git a/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/chromium/chromium-browser-service.bb b/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/chromium/chromium-browser-service.bb new file mode 100644 index 00000000..90242d79 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/chromium/chromium-browser-service.bb @@ -0,0 +1,19 @@ +SUMMARY = "Chromium browser widget" +DESCRIPTION = "Wgt packaging for running chromium installed browser" +HOMEPAGE = "https://webosose.org" +SECTION = "apps" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +SRC_URI = "git://gerrit.automotivelinux.org/gerrit/apps/chromium;protocol=https;branch=${AGL_BRANCH}" +SRCREV = "${AGL_APP_REVISION}" + +PV = "1.0+git${SRCPV}" +S = "${WORKDIR}/git" + +#build-time dependencies +DEPENDS += "af-binder af-main-native chromium68" + +inherit cmake aglwgt + +RDEPENDS_${PN} += "chromium68-browser" diff --git a/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/chromium/chromium68/v8-qemu-wrapper.patch b/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/chromium/chromium68/v8-qemu-wrapper.patch new file mode 100644 index 00000000..485766b0 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/chromium/chromium68/v8-qemu-wrapper.patch @@ -0,0 +1,40 @@ +Upstream-Status: Inappropriate [embedder specific] + +The patch below makes the V8 binaries run during the build be invoked through +QEMU, as they are built for the target. + +Signed-off-by: Raphael Kubo da Costa +Signed-off-by: Maksim Sisov + +Index: git/src/tools/v8_context_snapshot/BUILD.gn +=================================================================== +--- git.orig/src/tools/v8_context_snapshot/BUILD.gn ++++ git/src/tools/v8_context_snapshot/BUILD.gn +@@ -62,6 +62,7 @@ if (use_v8_context_snapshot) { + output_path = rebase_path(output_file, root_build_dir) + + args = [ ++ "./v8-qemu-wrapper.sh", + "./" + rebase_path( + get_label_info( + ":v8_context_snapshot_generator($v8_snapshot_toolchain)", +Index: git/src/v8/BUILD.gn +=================================================================== +--- git.orig/src/v8/BUILD.gn ++++ git/src/v8/BUILD.gn +@@ -900,6 +900,7 @@ action("run_torque") { + } + + args = [ ++ "./v8-qemu-wrapper.sh", + "./" + rebase_path(get_label_info(":torque($v8_torque_toolchain)", + "root_out_dir") + "/torque", + root_build_dir), +@@ -977,6 +978,7 @@ template("run_mksnapshot") { + data = [] + + args = [ ++ "./v8-qemu-wrapper.sh", + "./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)", + "root_out_dir") + "/mksnapshot", + root_build_dir), diff --git a/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/chromium/chromium68_git.bb b/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/chromium/chromium68_git.bb new file mode 100644 index 00000000..4f545c14 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/chromium/chromium68_git.bb @@ -0,0 +1,404 @@ +# Copyright (c) 2018 LG Electronics, Inc. + +SUMMARY = "Chromium webruntime for webOS" +AUTHOR = "Lokesh Kumar Goel " +SECTION = "webos/apps" +LICENSE = "Apache-2.0 & BSD-3-Clause & LGPL-2.0 & LGPL-2.1" +LIC_FILES_CHKSUM = "\ + file://src/LICENSE;md5=0fca02217a5d49a14dfe2d11837bb34d \ + file://src/third_party/blink/renderer/core/LICENSE-LGPL-2;md5=36357ffde2b64ae177b2494445b79d21 \ + file://src/third_party/blink/renderer/core/LICENSE-LGPL-2.1;md5=a778a33ef338abbaf8b8a7c36b6eec80 \ +" + +require gn-utils.inc + +inherit gettext qemu pythonnative + +DEPENDS = "virtual/gettext wayland wayland-native pixman freetype glib-2.0 fontconfig openssl pango cairo icu libxkbcommon libexif dbus pciutils udev libcap alsa-lib virtual/egl elfutils-native libdrm atk gperf-native gconf nss nss-native nspr nspr-native bison-native qemu-native" + +PROVIDES = "${BROWSER_APPLICATION}" + +SRC_URI = "\ + git://github.com/igalia/${BPN};branch=WIP@39.agl.compositor;protocol=https;rev=${SRCREV_chromium68};name=chromium68 \ + git://github.com/webosose/v8;destsuffix=git/src/v8;rev=${SRCREV_v8};name=v8 \ + file://v8-qemu-wrapper.patch \ +" +SRCREV_chromium68 = "61e96d1ee5dfc2461697457d287bf922d8a03d9a" +SRCREV_v8 = "1e3af71f1ff3735e8a5b639c48dfca63a7b8a647" + +# we don't include SRCPV in PV, so we have to manually include SRCREVs in do_fetch vardeps +do_fetch[vardeps] += "SRCREV_v8" +SRCREV_FORMAT = "main_v8" + +S = "${WORKDIR}/git" + +SRC_DIR = "${S}/src" +OUT_DIR = "${WORKDIR}/build" +BUILD_TYPE = "Release" + +B = "${OUT_DIR}/${BUILD_TYPE}" + +WEBRUNTIME_BUILD_TARGET = "webos:weboswebruntime" +BROWSER_APP_BUILD_TARGET = "chrome" +BROWSER_APPLICATION = "chromium68-browser" +BROWSER_APPLICATION_DIR = "/opt/chromium68" + +TARGET = "${WEBRUNTIME_BUILD_TARGET} ${BROWSER_APP_BUILD_TARGET}" + +# Skip do_install_append of webos_system_bus. It is not compatible with this component. +WEBOS_SYSTEM_BUS_FILES_LOCATION = "${S}/files/sysbus" + +PACKAGECONFIG ?= "jumbo use-upstream-wayland" + +# Options to enable debug-webcore build. +# Add the following line to local.conf (or local.dev.inc) to enable them: +# PACKAGECONFIG_append_pn-chromium68 = " debug-webcore" +# Other debug options are controlled by sections later in this file +PACKAGECONFIG[debug-webcore] = "remove_webcore_debug_symbols=false,remove_webcore_debug_symbols=true" + +# Set a default value for jumbo file merge of 8. This should be good for build +# servers and workstations with a big number of cores. In case build is +# happening in a machine with less cores but still enough RAM a good value could +# be 50. +JUMBO_FILE_MERGE_LIMIT="8" +PACKAGECONFIG[jumbo] = "use_jumbo_build=true jumbo_file_merge_limit=${JUMBO_FILE_MERGE_LIMIT}, use_jumbo_build=false" + +PACKAGECONFIG[lttng] = "use_lttng=true,use_lttng=false,lttng-ust,lttng-tools lttng-modules babeltrace" + +# Chromium can use v4l2 device for hardware accelerated video decoding on such boards as Renesas R-car M3, for example. +# In case of R-car m3, additional patches are required for gstreamer and v4l2apps. +# See https://github.com/igel-oss/meta-browser-hwdecode/tree/igalia-chromium71. +PACKAGECONFIG[use-linux-v4l2] = "use_v4l2_codec=true use_v4lplugin=true use_linux_v4l2_only=true" + +PACKAGECONFIG[use-upstream-wayland] = " \ + ozone_platform_wayland_external=false ozone_platform_wayland=true \ + use_system_minigbm=true, \ + ozone_platform_wayland_external=true ozone_platform_wayland=false \ +" + +GN_ARGS = "\ + enable_memorymanager_webapi=false\ + ffmpeg_branding=\"Chrome\"\ + host_os=\"linux\"\ + ozone_auto_platforms=false\ + proprietary_codecs=true\ + target_os=\"linux\"\ + treat_warnings_as_errors=false\ + is_agl=true\ + use_cbe=true\ + is_chrome_cbe=true\ + use_cups=false\ + use_custom_libcxx=false\ + use_kerberos=false\ + use_neva_media=false\ + use_ozone=true\ + use_xkbcommon=true\ + use_pmlog=false\ + use_system_debugger_abort=true\ + use_webos_gpu_info_collector=false\ + ${PACKAGECONFIG_CONFARGS}\ +" + +# From Chromium's BUILDCONFIG.gn: +# Set to enable the official build level of optimization. This has nothing +# to do with branding, but enables an additional level of optimization above +# release (!is_debug). This might be better expressed as a tri-state +# (debug, release, official) but for historical reasons there are two +# separate flags. +# See also: https://groups.google.com/a/chromium.org/d/msg/chromium-dev/hkcb6AOX5gE/PPT1ukWoBwAJ +GN_ARGS += "is_debug=false is_official_build=true" + +# is_cfi default value is true for x86-64 builds with is_official_build=true. +# As of M63, we explicitly need to set it to false, otherwise we fail the +# following assertion in //build/config/sanitizers/sanitizers.gni: +# assert(!is_cfi || is_clang, +# "is_cfi requires setting is_clang = true in 'gn args'") +GN_ARGS += "is_cfi=false" + +# By default, passing is_official_build=true to GN causes its symbol_level +# variable to be set to "2". This means the compiler will be passed "-g2" and +# we will end up with a very large chrome binary (around 5Gb as of M58) +# regardless of whether DEBUG_BUILD has been set or not. In addition, binutils, +# file and other utilities are unable to read a 32-bit binary this size, which +# causes it not to be stripped. +# The solution is two-fold: +# 1. Make sure -g is not passed on 32-bit architectures via DEBUG_FLAGS. -g is +# the same as -g2. -g1 generates an 800MB binary, which is a lot more +# manageable. +# 2. Explicitly pass symbol_level=0 to GN. This causes -g0 to be passed +# instead, so that if DEBUG_BUILD is not set GN will not create a huge debug +# binary anyway. Since our compiler flags are passed after GN's, -g0 does +# not cause any issues if DEBUG_BUILD is set, as -g1 will be passed later. +DEBUG_FLAGS_remove_arm = "-g" +DEBUG_FLAGS_append_arm = "-g1" +DEBUG_FLAGS_remove_x86 = "-g" +DEBUG_FLAGS_append_x86 = "-g1" +GN_ARGS += "symbol_level=0" + +# We do not want to use Chromium's own Debian-based sysroots, it is easier to +# just let Chromium's build system assume we are not using a sysroot at all and +# let Yocto handle everything. +GN_ARGS += "use_sysroot=false" + +# Toolchains we will use for the build. We need to point to the toolchain file +# we've created, set the right target architecture and make sure we are not +# using Chromium's toolchain (bundled clang, bundled binutils etc). +GN_ARGS += "\ + custom_toolchain=\"//build/toolchain/yocto:yocto_target\" \ + gold_path=\"\" \ + host_toolchain=\"//build/toolchain/yocto:yocto_native\" \ + is_clang=${@is_default_cc_clang(d)} \ + clang_base_path=\"${@clang_install_path(d)}\" \ + clang_use_chrome_plugins=false \ + linux_use_bundled_binutils=false \ + target_cpu=\"${@gn_target_arch_name(d)}\" \ + v8_snapshot_toolchain=\"//build/toolchain/yocto:yocto_target\" \ +" + +# ARM builds need special additional flags (see ${S}/build/config/arm.gni). +# If we do not pass |arm_arch| and friends to GN, it will deduce a value that +# will then conflict with TUNE_CCARGS and CC. +# Note that as of M61 in some corner cases parts of the build system disable +# the "compiler_arm_fpu" GN config, whereas -mfpu is always passed via ${CC}. +# We might want to rework that if there are issues in the future. +def get_compiler_flag(params, param_name, d): + """Given a sequence of compiler arguments in |params|, returns the value of + an option |param_name| or an empty string if the option is not present.""" + for param in params: + if param.startswith(param_name): + return param.split('=')[1] + return '' + +ARM_FLOAT_ABI = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'hard', 'softfp', d)}" +ARM_FPU = "${@get_compiler_flag(d.getVar('TUNE_CCARGS').split(), '-mfpu', d)}" +ARM_TUNE = "${@get_compiler_flag(d.getVar('TUNE_CCARGS').split(), '-mcpu', d)}" +ARM_VERSION_aarch64 = "8" +ARM_VERSION_armv7a = "7" +ARM_VERSION_armv7ve = "7" +ARM_VERSION_armv6 = "6" + +# GN computes and defaults to it automatically where needed +# forcing it from cmdline breaks build on places where it ends up +# overriding what GN wants +TUNE_CCARGS_remove = "-mthumb" + +GN_ARGS_append_arm = " \ + arm_float_abi=\"${ARM_FLOAT_ABI}\" \ + arm_fpu=\"${ARM_FPU}\" \ + arm_tune=\"${ARM_TUNE}\" \ + arm_version=${ARM_VERSION} \ +" +# tcmalloc's atomicops-internals-arm-v6plus.h uses the "dmb" instruction that +# is not available on (some?) ARMv6 models, which causes the build to fail. +GN_ARGS_append_armv6 += 'use_allocator="none"' +# The WebRTC code fails to build on ARMv6 when NEON is enabled. +# https://bugs.chromium.org/p/webrtc/issues/detail?id=6574 +GN_ARGS_append_armv6 += 'arm_use_neon=false' + +# Disable glibc shims on musl +# tcmalloc does not play well with musl as of M62 (and possibly earlier). +# https://github.com/gperftools/gperftools/issues/693 +GN_ARGS_append_libc-musl = ' use_allocator_shim=false' + +# V8's JIT infrastructure requires binaries such as mksnapshot and +# mkpeephole to be run in the host during the build. However, these +# binaries must have the same bit-width as the target (e.g. a x86_64 +# host targeting ARMv6 needs to produce a 32-bit binary). Instead of +# depending on a third Yocto toolchain, we just build those binaries +# for the target and run them on the host with QEMU. +python do_create_v8_qemu_wrapper () { + """Creates a small wrapper that invokes QEMU to run some target V8 binaries + on the host.""" + qemu_libdirs = [d.expand('${STAGING_DIR_HOST}${libdir}'), + d.expand('${STAGING_DIR_HOST}${base_libdir}')] + qemu_cmd = qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST', True), + qemu_libdirs) + wrapper_path = d.expand('${B}/v8-qemu-wrapper.sh') + with open(wrapper_path, 'w') as wrapper_file: + wrapper_file.write("""#!/bin/sh + +# This file has been generated automatically. +# It invokes QEMU to run binaries built for the target in the host during the +# build process. + +%s "$@" +""" % qemu_cmd) + os.chmod(wrapper_path, 0o755) +} +do_create_v8_qemu_wrapper[dirs] = "${B}" +addtask create_v8_qemu_wrapper after do_patch before do_configure + +python do_write_toolchain_file () { + """Writes a BUILD.gn file for Yocto detailing its toolchains.""" + toolchain_dir = d.expand("${S}/src/build/toolchain/yocto") + bb.utils.mkdirhier(toolchain_dir) + toolchain_file = os.path.join(toolchain_dir, "BUILD.gn") + write_toolchain_file(d, toolchain_file) +} +addtask write_toolchain_file after do_patch before do_configure + +# More options to speed up the build +GN_ARGS += "\ + enable_nacl=false\ + disable_ftp_support=true\ + enable_print_preview=false\ + enable_remoting=false\ + use_glib=true\ + use_gnome_keyring=false\ + use_pulseaudio=false\ +" + +# Respect ld-is-gold in DISTRO_FEATURES when enabling gold +# Similar patch applied in meta-browser +# http://patchwork.openembedded.org/patch/77755/ +EXTRA_OEGN_GOLD = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', 'use_gold=true', 'use_gold=false', d)}" +GN_ARGS += "${EXTRA_OEGN_GOLD}" + +# Doesn't build for armv[45]* +COMPATIBLE_MACHINE = "(-)" +COMPATIBLE_MACHINE_aarch64 = "(.*)" +COMPATIBLE_MACHINE_armv6 = "(.*)" +COMPATIBLE_MACHINE_armv7a = "(.*)" +COMPATIBLE_MACHINE_armv7ve = "(.*)" +COMPATIBLE_MACHINE_x86 = "(.*)" +COMPATIBLE_MACHINE_x86-64 = "(.*)" + +#CHROMIUM_PLUGINS_PATH = "${libdir}" +CBE_DATA_PATH = "${libdir}/cbe" +CBE_DATA_LOCALES_PATH = "${CBE_DATA_PATH}/locales" + +# The text relocations are intentional -- see comments in [GF-52468] +# TODO: check if we need INSANE_SKIP on ldflags +INSANE_SKIP_${PN} = "textrel ldflags" + + +do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+" +do_compile() { + if [ ! -f ${OUT_DIR}/${BUILD_TYPE}/build.ninja ]; then + do_configure + fi + + export PATH="${S}/depot_tools:$PATH" + ${S}/depot_tools/ninja -v -C ${OUT_DIR}/${BUILD_TYPE} ${TARGET} +} + +do_configure() { + configure_env +} + +configure_env() { + export GYP_CHROMIUM_NO_ACTION=1 + export PATH="${S}/depot_tools:$PATH" + + GN_ARGS="${GN_ARGS}" + echo GN_ARGS is ${GN_ARGS} + echo BUILD_TARGETS are ${TARGET} + cd ${SRC_DIR} + gn gen ${OUT_DIR}/${BUILD_TYPE} --args="${GN_ARGS}" +} + +WINDOW_SIZE ?= "1920,1080" + +configure_browser_settings() { + USER_AGENT="Mozilla/5.0 (Linux; NetCast; U) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/${CHROMIUM_VERSION} Safari/537.31" + echo "${USER_AGENT}" > ${D_DIR}/user_agent_conf + #We can replace below WINDOW_SIZE values from build configuration if available + #echo "${WINDOW_SIZE}" > ${D_DIR}/window_size_conf +} + +install_chromium_browser() { + D_DIR=${D}${BROWSER_APPLICATION_DIR} + install -d ${D_DIR} + + # Install browser files + if [ -e "${SRC_DIR}/webos/install" ]; then + cd ${OUT_DIR}/${BUILD_TYPE} + xargs --arg-file=${SRC_DIR}/webos/install/default_browser/binary.list cp -R --no-dereference --preserve=mode,links -v --target-directory=${D_DIR} + cd ${SRC_DIR} + xargs --arg-file=${SRC_DIR}/webos/install/default_browser/runtime.list cp -R --no-dereference --preserve=mode,links -v --target-directory=${D_DIR} + fi + + # AGL does not have PMLOG + sed -i.bak s/PmLogCtl.*// ${D_DIR}/run_webbrowser + + # To execute chromium in JAILER, Security Part needs permissions change + # run_webbrowser: Script file for launching chromium + chmod -v 755 ${D_DIR}/chrome + chmod -v 755 ${D_DIR}/kill_webbrowser + chmod -v 755 ${D_DIR}/run_webbrowser + + configure_browser_settings +} + +install_webruntime() { + install -d ${D}${libdir} + install -d ${D}${includedir}/${BPN} + install -d ${D}${CBE_DATA_PATH} + install -d ${D}${CBE_DATA_LOCALES_PATH} + + # Install webos webview files + if [ -e "${SRC_DIR}/webos/install" ]; then + cd ${SRC_DIR} + xargs --arg-file=${SRC_DIR}/webos/install/weboswebruntime/staging_inc.list cp --parents --target-directory=${D}${includedir}/${BPN} + + cd ${OUT_DIR}/${BUILD_TYPE} + + cp libcbe.so ${D}${libdir}/ + if [ "${WEBOS_LTTNG_ENABLED}" = "1" ]; then + # use bindir if building non-cbe + cp libchromium_lttng_provider.so ${D}${libdir}/ + fi + xargs --arg-file=${SRC_DIR}/webos/install/weboswebruntime/binary.list cp --parents --target-directory=${D}${CBE_DATA_PATH} + cat ${SRC_DIR}/webos/install/weboswebruntime/data_locales.list | xargs -I{} install -m 755 -p {} ${D}${CBE_DATA_LOCALES_PATH} + fi + + # move this to separate mksnapshot-cross recipe once we figure out how to build just cross mksnapshot from chromium repository + install -d ${D}${bindir_cross} + gzip -c ${OUT_DIR}/${BUILD_TYPE}/${MKSNAPSHOT_PATH}mksnapshot > ${D}${bindir_cross}/${HOST_SYS}-mksnapshot.gz +} + +do_install() { + install_webruntime + install_chromium_browser +} + +WEBOS_SYSTEM_BUS_DIRS_LEGACY_BROWSER_APPLICATION = " \ + ${webos_sysbus_prvservicesdir}/${BROWSER_APPLICATION}.service \ + ${webos_sysbus_pubservicesdir}/${BROWSER_APPLICATION}.service \ + ${webos_sysbus_prvrolesdir}/${BROWSER_APPLICATION}.json \ + ${webos_sysbus_pubrolesdir}/${BROWSER_APPLICATION}.json \ +" + +SYSROOT_DIRS_append = " ${bindir_cross}" + +PACKAGES_prepend = " \ + ${PN}-cross-mksnapshot \ + ${BROWSER_APPLICATION} \ +" + +FILES_${BROWSER_APPLICATION} += " \ + ${BROWSER_APPLICATION_DIR} \ + ${WEBOS_SYSTEM_BUS_DIRS_LEGACY_BROWSER_APPLICATION} \ +" + +RDEPENDS_${BROWSER_APPLICATION} += "${PN}" + +VIRTUAL-RUNTIME_gpu-libs ?= "" +RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_gpu-libs}" + +# The text relocations are intentional -- see comments in [GF-52468] +# TODO: check if we need INSANE_SKIP on ldflags +INSANE_SKIP_${BROWSER_APPLICATION} += "libdir ldflags textrel" + +FILES_${PN} = " \ + ${libdir}/*.so \ + ${CBE_DATA_PATH}/* \ + ${libdir}/${BPN}/*.so \ + ${WEBOS_SYSTEM_BUS_DIRS} \ +" + +FILES_${PN}-dev = " \ + ${includedir} \ +" + +FILES_${PN}-cross-mksnapshot = "${bindir_cross}/${HOST_SYS}-mksnapshot.gz" diff --git a/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/chromium/gn-utils.inc b/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/chromium/gn-utils.inc new file mode 100644 index 00000000..0fd55a63 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/chromium/gn-utils.inc @@ -0,0 +1,157 @@ +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +# GN host architecture helpers. +# +# BUILD_ARCH's value corresponds to what uname returns as the machine name. +# The mapping in gn_host_arch_name() tries to match several possible values +# returned by the Linux kernel in uname(2) into the corresponding values GN +# understands. +def gn_host_arch_name(d): + """Returns a GN architecture name corresponding to the build host's machine + architecture.""" + import re + arch_translations = { + r'aarch64.*': 'arm64', + r'arm.*': 'arm', + r'i[3456]86$': 'x86', + r'x86_64$': 'x64', + } + build_arch = d.getVar("BUILD_ARCH") + for arch_regexp, gn_arch_name in arch_translations.items(): + if re.match(arch_regexp, build_arch): + return gn_arch_name + bb.fatal('Unsuported BUILD_ARCH value: "%s"' % build_arch) + +# GN target architecture helpers. +# +# Determining the target architecture is more difficult, as there are many +# different values we can use on the Yocto side (e.g. TUNE_ARCH, TARGET_ARCH, +# MACHINEOVERRIDES etc). What we do is define the mapping with regular, +# non-Python variables with overrides that are generic enough (i.e. "x86" +# instead of "i586") and then use gn_target_arch_name() to return the right +# value with some validation. +GN_TARGET_ARCH_NAME_aarch64 = "arm64" +GN_TARGET_ARCH_NAME_arm = "arm" +GN_TARGET_ARCH_NAME_x86 = "x86" +GN_TARGET_ARCH_NAME_x86-64 = "x64" + +BUILD_CC_toolchain-clang = "clang" +BUILD_CXX_toolchain-clang = "clang++" +BUILD_LD_toolchain-clang = "clang" + +# knob for clang, when using meta-clang to provide clang and case where +# clang happens to be default compiler for OE we should let it use clang +def is_default_cc_clang(d): + """Return true if clang is default cross compiler.""" + toolchain = d.getVar("TOOLCHAIN") + overrides = d.getVar("OVERRIDES") + if toolchain == "clang" and "toolchain-clang" in overrides.split(":"): + return "true" + return "false" + +def clang_install_path(d): + """Return clang compiler install path.""" + return d.getVar("STAGING_BINDIR_NATIVE") + +def gn_target_arch_name(d): + """Returns a GN architecture name corresponding to the target machine's + architecture.""" + name = d.getVar("GN_TARGET_ARCH_NAME") + if name is None: + bb.fatal('Unsupported target architecture. A valid override for the ' + 'GN_TARGET_ARCH_NAME variable could not be found.') + return name + +def write_toolchain_file(d, file_path): + """Creates a complete GN toolchain file in |file_path|.""" + import string + gcc_toolchain_tmpl = string.Template( + 'gcc_toolchain("${toolchain_name}") {\n' + ' cc = "${cc}"\n' + ' cxx = "${cxx}"\n' + ' ar = "${ar}"\n' + ' ld = cxx # GN expects a compiler, not a linker.\n' + ' nm = "${nm}"\n' + ' readelf = "${readelf}"\n' + ' extra_cflags = "${extra_cflags}"\n' + ' extra_cppflags = "${extra_cppflags}"\n' + ' extra_cxxflags = "${extra_cxxflags}"\n' + ' extra_ldflags = "${extra_ldflags}"\n' + ' toolchain_args = {\n' + ' current_cpu = "${current_cpu}"\n' + ' current_os = "linux"\n' + ' is_clang = false\n' + ' }\n' + '}\n' + ) + clang_toolchain_tmpl = string.Template( + 'clang_toolchain("clang_${toolchain_name}") {\n' + ' extra_cflags = "${extra_cflags}"\n' + ' extra_cppflags = "${extra_cppflags}"\n' + ' extra_cxxflags = "${extra_cxxflags}"\n' + ' extra_ldflags = "${extra_ldflags}"\n' + ' toolchain_args = {\n' + ' current_cpu = "${current_cpu}"\n' + ' current_os = "linux"\n' + ' is_clang = true\n' + ' use_gold = true\n' + ' }\n' + '}\n' + ) + + native_toolchain = { + 'toolchain_name': 'yocto_native', + 'current_cpu': gn_host_arch_name(d), + 'cc': d.expand('${BUILD_CC}'), + 'cxx': d.expand('${BUILD_CXX}'), + 'ar': d.expand('${BUILD_AR}'), + 'nm': d.expand('${BUILD_NM}'), + 'readelf': d.expand('${BUILD_PREFIX}readelf'), + 'extra_cflags': d.expand('${BUILD_CFLAGS}'), + 'extra_cppflags': d.expand('${BUILD_CPPFLAGS}'), + 'extra_cxxflags': d.expand('${BUILD_CXXFLAGS}'), + 'extra_ldflags': d.expand('${BUILD_LDFLAGS}'), + } + target_toolchain = { + 'toolchain_name': 'yocto_target', + 'current_cpu': gn_target_arch_name(d), + 'cc': d.expand('${CC}'), + 'cxx': d.expand('${CXX}'), + 'ar': d.expand('${AR}'), + 'nm': d.expand('${NM}'), + 'readelf': d.expand('${TARGET_PREFIX}readelf'), + 'extra_cflags': d.expand('${TARGET_CFLAGS}'), + 'extra_cppflags': d.expand('${TARGET_CPPFLAGS}'), + 'extra_cxxflags': d.expand('${TARGET_CXXFLAGS}'), + 'extra_ldflags': d.expand('${TARGET_LDFLAGS}'), + 'strip': '', + } + + with open(file_path, 'w') as toolchain_file: + toolchain_file.write( + '# This file has been generated automatically.\n' + '\n' + 'import("//build/config/sysroot.gni")\n' + 'import("//build/toolchain/gcc_toolchain.gni")\n' + '\n' + ) + toolchain_file.write(gcc_toolchain_tmpl.substitute(native_toolchain)) + toolchain_file.write(gcc_toolchain_tmpl.substitute(target_toolchain)) + toolchain_file.write(clang_toolchain_tmpl.substitute(native_toolchain)) + toolchain_file.write(clang_toolchain_tmpl.substitute(target_toolchain)) diff --git a/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/wam/files/WebAppMgr.env b/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/wam/files/WebAppMgr.env new file mode 100644 index 00000000..c8ddc517 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/wam/files/WebAppMgr.env @@ -0,0 +1,202 @@ +##### AGL: not set in WebAppMgr@.service +#XDG_SESSION_ID="c2" + +##### AGL: set by WebAppMgr@.service (depends on user) +#XDG_RUNTIME_DIR="/run/user/%i" + +# Set wam executable file path +HOOK_SEGV=NO +WAM_EXE_PATH="/usr/bin/WebAppMgr" + +# Set wam name for user-agent +WAM_NAME="WebAppManager" + +# Only allow UTF8 encoding for luna-service messages. +LS_ENABLE_UTF8=1 + +# Set effective userid and groupid +#WAM_UID="wam" +#WAM_GID="compositor" + +# Set location of error page (will follow localization rules based on this path) +#WAM_ERROR_PAGE="file:///usr/share/localization/wam/loaderror.html" + +# suspending javascript execution delay for page visibility +WAM_SUSPEND_DELAY_IN_MS=250 + +#if [ -e "etc/wam/make_shm.sh" ] ; then +# /etc/wam/make_shm.sh +#fi + +# Set user data directory for WebAppMgr +##### AGL: set by WebAppMgr@.service (depends on user) +#WAM_DATA_PATH="/home/%i/wamdata" + +# ensure that wam data directories exist +#mkdir -p ${WAM_DATA_PATH} + +# set directories permission +#chown ${WAM_UID}:${WAM_GID} ${WAM_DATA_PATH} + +# setup 50 Mb maximum for ApplicationCache +WAM_APPCACHE_MAXSIZE=52428800 + +# setup 10 Mb maximum for ApplicationCache per domain +WAM_APPCACHE_DOMAINLIMIT=10485760 + +# setup 50 Mb maximum for DiskCache +WAM_DISKCACHE_MAXSIZE=52428800 + +# setup 256 Kb maximum for resource buffer allocation +WAM_RESOURCE_BUFFER_MAX_ALLOC_SIZE=262144 + +# setup 1 Mb for resource buffer +WAM_RESOURCE_BUFFER_SIZE=1048576 + +# setup 200 seconds for watchdog timeout of render process +WATCHDOG_RENDER_TIMEOUT=200 + +# setup nubmer of raster threads to 1 +BLINK_NUM_RASTER_THREADS=2 + +# use default tile width if not sed by recipe +#if [ "$BLINK_NUM_RASTER_THREADS" = "WEBOS${BLINK_NUM_RASTER_THREADS#WEBOS}" ]; then +BLINK_NUM_RASTER_THREADS=1 +#fi + +# setup 6 Mb maximum for the program GPU cache +GPU_PROGRAM_CACHE_SIZE=6144 + +# disable using enyo system app specfic optimization +# currently used optimizations : inline caching off +#USE_SYSTEM_APP_OPTIMIZATION="0" + +# Set location of NaCl modules +#CHROMIUM_PATH="/usr/palm/applications/com.lge.app.chromium" +#NACL_PLUGIN=${CHROMIUM_PATH}"/libppGoogleNaClPluginChrome.so" +#NACL_IRT_LIBRARY=${CHROMIUM_PATH}"/nacl_irt_arm.nexe" +#NACL_HELPER=${CHROMIUM_PATH}"/nacl_helper" +#NACL_HELPER_BOOTSTRAP=${CHROMIUM_PATH}"/nacl_helper_bootstrap" + +# Set location of NPAPI plugins for all Apps including default Apps +# This is for the flash plugin of Signage, webOS TV doesn't use it. +#PRIVILEGED_PLUGIN_PATH="" + +# Set location of NPAPI plugins for NetCast Apps +# NetCast Apps should access only the plugins in this path +#NETCAST_PLUGIN_PATH="/usr/lib/BrowserPlugins" + +# Set location of NPAPI plugins for HbbTV app. +#HBBTV_PLUGIN_PATH="/usr/lib/HbbtvPlugins" + +# Set InetTV player stored path +#INETTV_HTML_PLAYER_PATH="/usr/share/inettv/inettv_player/index.html" + +# Set location of extra libraries +#CDM_LIB_PATH="/usr/lib" + +# Set location of all NPAPI plugins +NPAPI_PLUGIN_PATH=${HBBTV_PLUGIN_PATH}":"${NETCAST_PLUGIN_PATH}":"${PRIVILEGED_PLUGIN_PATH} + +#if [ -e "etc/wam/make_shm.sh" ] ; then +# /etc/wam/make_shm.sh +#fi + +# setup 8 Mb minimum codecache capacity +JSC_minGlobalCodeCacheCapacity=8388608 + +# Enable more explicit logging of timing with regards to rendering +# export WAM2_ENABLE_DEBUG_RENDER_TIMING=1 + +# enable Web Inspector and Tellurium if in developer mode +TELLURIUM_NUB_PATH=/usr/palm/tellurium/telluriumnub.js +ENABLE_INSPECTOR=1 + +# Enable cursor by default +ENABLE_CURSOR_BY_DEFAULT=1 + +# Enable launch optimization +ENABLE_LAUNCH_OPTIMIZATION=1 + +# Set the duration(seconds) passed from last network activity (e.g. FMP Detector) +# If set to a positive value, adjust a custom timeout for a network stable timer in FMPDetector +NETWORK_STABLE_TIMEOUT=3 + +# please keep it in alphabetical order +#WAM_EXTRA_FLAGS="" +#WAM_JS_FLAGS="" +#WAM_COMMON_SWITCHES=" \ +# --application-cache-domain-limit=$WAM_APPCACHE_DOMAINLIMIT \ +# --application-cache-size=$WAM_APPCACHE_MAXSIZE \ +# --browser-subprocess-path=$WAM_EXE_PATH \ +# --disable-direct-npapi-requests \ +# --disable-extensions \ +# --disable-low-res-tiling \ +# --disable-new-video-renderer \ +# --disk-cache-size=$WAM_DISKCACHE_MAXSIZE \ +# --enable-aggressive-release-policy \ +# --enable-accelerated-plugin-rendering \ +# --accelerated-plugin-rendering-blacklist=device;drmAgent;sound;service \ +# --enable-gpu-rasterization \ +# --disable-gpu-rasterization-for-first-frame \ +# --enable-key-event-throttling \ +# --enable-threaded-compositing \ +# --enable-watchdog \ +# --hide-selection-handles \ +# --ignore-gpu-blacklist \ +# --ignore-netif=p2p \ +# --in-process-gpu \ +# --max-unused-resource-memory-usage-percentage=0 \ +# --network-stable-timeout=$NETWORK_STABLE_TIMEOUT \ +# --noerrdialogs \ +# --num-raster-threads=$BLINK_NUM_RASTER_THREADS \ +# --ozone-platform=wayland \ +# --remote-debugging-port=9998 \ +# --resource-buffer-max-allocation-size=$WAM_RESOURCE_BUFFER_MAX_ALLOC_SIZE \ +# --resource-buffer-size=$WAM_RESOURCE_BUFFER_SIZE \ +# --touch-events=disabled \ +# --ui-disable-opaque-shader-program \ +# --user-agent-suffix=SmartTV \ +# --user-data-dir=$WAM_DATA_PATH \ +# --enable-devtools-experiments \ +# --webos-wam \ " + +#WAM_LITE_SWITCHES=" --in-process-zygote " + +#export WAM_WEBOS_LITE=NO +#if [ "${WAM_WEBOS_LITE}" = "YES" ] ; then +# export WAM_SWITCHES=${WAM_COMMON_SWITCHES}${WAM_LITE_SWITCHES} +# export SKIA_FONT_CACHE_SIZE=1 +# export SKIA_IMAGE_CACHE_SIZE=40 +# export SKIA_BACKGROUND_FONT_CACHE_SIZE=0 +#else +# export WAM_SWITCHES=${WAM_COMMON_SWITCHES} +# export SKIA_FONT_CACHE_SIZE=8 +# export SKIA_IMAGE_CACHE_SIZE=80 +# export SKIA_BACKGROUND_FONT_CACHE_SIZE=512 +#fi + +#export WAM_EXTRA_SKIA_CACHE_SWITCHES=" \ +# --skia-font-cache-size-mb=$SKIA_FONT_CACHE_SIZE \ +# --skia-image-cache-size-mb=$SKIA_IMAGE_CACHE_SIZE \ +# --skia-background-font-cache-size-kb=$SKIA_BACKGROUND_FONT_CACHE_SIZE \ +# " + +#export WAM_EXTRA_GPU_TUNING_SWITCHES=" \ +# --gpu-program-cache-size-kb=$GPU_PROGRAM_CACHE_SIZE \ +# " +#export WAM_WATCHDOG_RENDER_TIMEOUT_SWITCHES=" \ +# --watchdog-render-timeout=$WATCHDOG_RENDER_TIMEOUT \ +# " + +#WEBOS_LOAD_ACCESSIBILITY_PLUGIN=1 + +#WAM_V8_CODE_CACHE_SWITCHES=" --enable-local-resource-code-cache --disallow-code-cache-from-file-uris-with-query-string " + +# Load any special configuration from plugins +#if [ -e "/etc/wam/plugins/conf.sh" ] ; then +# . /etc/wam/plugins/conf.sh || true +#fi + +#exec $WAM_EXE_PATH $WAM_SWITCHES $WAM_EXTRA_SKIA_CACHE_SWITCHES $WAM_EXTRA_GPU_TUNING_SWITCHES $WAM_WATCHDOG_RENDER_TIMEOUT_SWITCHES $WAM_EXTRA_FLAGS $WAM_V8_CODE_CACHE_SWITCHES --js-flags="$WAM_JS_FLAGS" + diff --git a/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/wam/files/WebAppMgr@.service b/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/wam/files/WebAppMgr@.service new file mode 100644 index 00000000..a855bf9f --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/wam/files/WebAppMgr@.service @@ -0,0 +1,37 @@ +# @@@LICENSE +# +# Copyright (c) 2017-2018 LG Electronics, Inc. +# +# Confidential computer software. Valid license from LG required for +# possession, use or copying. Consistent with FAR 12.211 and 12.212, +# Commercial Computer Software, Computer Software Documentation, and +# Technical Data for Commercial Items are licensed to the U.S. Government +# under vendor's standard commercial license. +# +# LICENSE@@@ + +[Unit] +Description="WebAppMgr is responsible for running web apps and manage their lifecycle" +After=afm-service-homescreen-service--0.1--main@%i.service weston@display.service +Wants=afm-service-homescreen-service--0.1--main@%i.service +BindsTo=weston@display.service + +[Service] +Type=simple +User=%i +Slice=user-%i.slice +SmackProcessLabel=System +SupplementaryGroups=audio display +UMask=0077 +CapabilityBoundingSet= +OOMScoreAdjust=-1000 +EnvironmentFile=-/etc/default/WebAppMgr.env +Environment=XDG_RUNTIME_DIR=/run/user/%i +Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%i/bus +Environment=WAM_DATA_PATH="/home/%i/wamdata" +ExecStart=/usr/bin/WebAppMgr --no-sandbox --in-process-gpu --remote-debugging-port=9998 --user-data-dir="/home/%i/wamdata" --webos-wam +Restart=on-failure +RestartSec=50 + +[Install] +WantedBy=default.target diff --git a/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/wam/files/trunc-webapp-roles.patch b/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/wam/files/trunc-webapp-roles.patch new file mode 100644 index 00000000..829abe07 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/wam/files/trunc-webapp-roles.patch @@ -0,0 +1,56 @@ +From f31e93261f34abaa3dcdc4959963f5b5a8983002 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jan-Simon=20M=C3=B6ller?= +Date: Thu, 25 Jun 2020 19:47:24 +0200 +Subject: [PATCH] Set webapp roles that are max 12 characters long. + +From: =?UTF-8?q?Jacobo=20Aragunde=20P=C3=A9rez?= + +This is a workaround for SPEC-3127. To prevent repeated roles as much +as possible, I'm using the appid as a basis instead of "Webapp-" + +host + port, which has many chances to be redundant in the first 12 +chars. + +Bug-AGL: SPEC-3127 + +--- + src/agl/WebRuntimeAGL.cpp | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +diff --git a/src/agl/WebRuntimeAGL.cpp b/src/agl/WebRuntimeAGL.cpp +index aed928b..efd2ee4 100644 +--- a/src/agl/WebRuntimeAGL.cpp ++++ b/src/agl/WebRuntimeAGL.cpp +@@ -274,7 +274,6 @@ int WebAppLauncherRuntime::run(int argc, const char** argv) { + + m_id = getAppId(args); + m_url = getAppUrl(args); +- m_role = "WebApp"; + + setup_signals(); + +@@ -326,15 +325,9 @@ bool WebAppLauncherRuntime::init() { + if (n != std::string::npos) { + std::string sport = authority.substr(n+1); + m_host = authority.substr(0, n); +- m_role.push_back('-'); +- m_role.append(m_host); +- m_role.push_back('-'); +- m_role.append(sport); + m_port = stringTo(sport); + } else { + m_host = authority; +- m_role.push_back('-'); +- m_role.append(m_host); + } + } + +@@ -375,6 +368,9 @@ bool WebAppLauncherRuntime::init() { + m_role = "homescreen"; + else if (m_id.rfind("webapps-homescreen", 0) == 0) + m_role = "homescreen"; ++ else { ++ m_role = m_id.substr(0,12); ++ } + + LOG_DEBUG("id=[%s], name=[%s], role=[%s], url=[%s], host=[%s], port=%d, token=[%s], width=[%s], height[%s], surface_type[%d], panel_type[%d]", + m_id.c_str(), m_name.c_str(), m_role.c_str(), m_url.c_str(), diff --git a/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/wam/wam_git.bb b/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/wam/wam_git.bb new file mode 100644 index 00000000..d50a14fa --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-html5/recipes-wam/wam/wam_git.bb @@ -0,0 +1,51 @@ +SUMMARY = "WAM" +AUTHOR = "Jani Hautakangas " +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +inherit cmake + +DEPENDS = "glib-2.0 jsoncpp boost chromium68 wayland-ivi-extension libhomescreen" + +EXTRA_OECMAKE = "\ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=${prefix} \ + -DPLATFORM_NAME=${@'${DISTRO}'.upper().replace('-', '_')} \ + -DCHROMIUM_SRC_DIR=${STAGING_INCDIR}/chromium68" + +PR="r0" + +PROVIDES += "virtual/webruntime" +RPROVIDES_${PN} += "virtual/webruntime" + +SRC_URI = "\ + git://github.com/igalia/${BPN}.git;branch=WIP@6.agl.compositor;protocol=https \ + file://WebAppMgr@.service \ + file://WebAppMgr.env \ + file://trunc-webapp-roles.patch \ +" +S = "${WORKDIR}/git" +SRCREV = "bd650046b688eb1593ae68c16ba3912837507d08" + +do_install_append() { + install -d ${D}${sysconfdir}/wam + install -v -m 644 ${S}/files/launch/security_policy.conf ${D}${sysconfdir}/wam/security_policy.conf + install -d ${D}${systemd_system_unitdir} + install -v -m 644 ${WORKDIR}/WebAppMgr@.service ${D}${systemd_system_unitdir}/WebAppMgr@.service + install -d ${D}${sysconfdir}/default/ + install -v -m 644 ${WORKDIR}/WebAppMgr.env ${D}${sysconfdir}/default/WebAppMgr.env + ln -snf WebAppMgr ${D}${bindir}/web-runtime + install -d ${D}${systemd_system_unitdir}/afm-user-session@.target.wants + ln -sf ../WebAppMgr@.service ${D}${systemd_system_unitdir}/afm-user-session@.target.wants/ +} + +FILES_${PN} += "${sysconfdir}/init ${sysconfdir}/wam ${libdir}/webappmanager/plugins/*.so ${systemd_system_unitdir}" + +CXXFLAGS_append_agl-devel = " -DAGL_DEVEL" + +do_install_append_agl-devel() { + # Enable remote inspector and dev mode + install -d ${D}${localstatedir}/agl-devel/preferences + touch ${D}${localstatedir}/agl-devel/preferences/debug_system_apps + touch ${D}${localstatedir}/agl-devel/preferences/devmode_enabled +} diff --git a/meta-agl/meta-agl-profile-graphical-qt5/LICENSE b/meta-agl/meta-agl-profile-graphical-qt5/LICENSE new file mode 100644 index 00000000..e8758f89 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-qt5/LICENSE @@ -0,0 +1,20 @@ +Different components of the AGL layers are under different licenses (a mix +of MIT and GPLv2). See LICENSE.GPL-2.0-only and LICENSE.MIT for further +details of the individual licenses. + +All metadata (e.g. .bb, .bbappend, .bbclass, .inc, templates/* and similar) +is MIT licensed unless otherwise stated. +Source code included in tree for individual recipes (e.g. patches) are under +the LICENSE stated in the associated recipe (.bb file) unless otherwise stated. + +License information for any other files (scripts) is either explicitly stated +or defaults to GPL version 2 only. + +Individual files can contain the following style tags instead of the full +license text to identify their license: + + SPDX-License-Identifier: GPL-2.0-only + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-graphical-qt5/LICENSE.GPL-2.0-only b/meta-agl/meta-agl-profile-graphical-qt5/LICENSE.GPL-2.0-only new file mode 100644 index 00000000..5db3c0a2 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-qt5/LICENSE.GPL-2.0-only @@ -0,0 +1,288 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: GPL-2.0-only + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-graphical-qt5/LICENSE.MIT b/meta-agl/meta-agl-profile-graphical-qt5/LICENSE.MIT new file mode 100644 index 00000000..a6919eb7 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-qt5/LICENSE.MIT @@ -0,0 +1,25 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-graphical-qt5/conf/layer.conf b/meta-agl/meta-agl-profile-graphical-qt5/conf/layer.conf index d73b8aa6..ef39630d 100644 --- a/meta-agl/meta-agl-profile-graphical-qt5/conf/layer.conf +++ b/meta-agl/meta-agl-profile-graphical-qt5/conf/layer.conf @@ -9,4 +9,4 @@ BBFILE_COLLECTIONS += "aglprofilegraphicalqt5" BBFILE_PATTERN_aglprofilegraphicalqt5 = "^${LAYERDIR}/" BBFILE_PRIORITY_aglprofilegraphicalqt5 = "70" -LAYERSERIES_COMPAT_aglprofilegraphicalqt5 = "thud" +LAYERSERIES_COMPAT_aglprofilegraphicalqt5 = "dunfell" diff --git a/meta-agl/meta-agl-profile-graphical-qt5/recipes-devtools/libqtappfw/libqtappfw_git.bb b/meta-agl/meta-agl-profile-graphical-qt5/recipes-devtools/libqtappfw/libqtappfw_git.bb index f4d85d75..dd270d04 100644 --- a/meta-agl/meta-agl-profile-graphical-qt5/recipes-devtools/libqtappfw/libqtappfw_git.bb +++ b/meta-agl/meta-agl-profile-graphical-qt5/recipes-devtools/libqtappfw/libqtappfw_git.bb @@ -13,7 +13,7 @@ DEPENDS += "qtbase qtdeclarative qtwebsockets" inherit cmake_qt5 SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/libqtappfw;protocol=https;branch=${AGL_BRANCH}" -SRCREV = "cd1a7f3bcbaef1e9c23549f472bce4ae42b2afad" +SRCREV = "fe20f1b029f67dee1f790ade7a9114086f2abd38" S = "${WORKDIR}/git/" # PV needs to be modified with SRCPV to work AUTOREV correctly diff --git a/meta-agl/meta-agl-profile-graphical-qt5/recipes-platform/images/agl-image-graphical-qt5-crosssdk.bb b/meta-agl/meta-agl-profile-graphical-qt5/recipes-platform/images/agl-image-graphical-qt5-crosssdk.bb index cfc465e6..5147ea44 100755 --- a/meta-agl/meta-agl-profile-graphical-qt5/recipes-platform/images/agl-image-graphical-qt5-crosssdk.bb +++ b/meta-agl/meta-agl-profile-graphical-qt5/recipes-platform/images/agl-image-graphical-qt5-crosssdk.bb @@ -8,8 +8,7 @@ require agl-image-graphical-qt5.bb LICENSE = "MIT" -IMAGE_FEATURES_append = " dev-pkgs" -IMAGE_INSTALL_append = " kernel-dev kernel-devsrc" +require agl-image-graphical-qt5-crosssdk.inc inherit populate_sdk populate_sdk_qt5 @@ -17,39 +16,3 @@ inherit populate_sdk populate_sdk_qt5 # Both exec "createrepo" on the same directory, and so one of them # can failed (randomly). addtask do_populate_sdk after do_rootfs - -# native tools to support Chromium build inside SDK (SPEC-942) -TOOLCHAIN_HOST_TASK += " \ - nativesdk-gn \ - nativesdk-ninja \ - nativesdk-gperf \ - nativesdk-zlib \ - nativesdk-xz \ - nativesdk-nspr-dev \ - nativesdk-nss-dev \ - nativesdk-lua \ - " - -# required dependencies for Chromium build inside SDK (SPEC-942) -TOOLCHAIN_TARGET_TASK += " \ - pciutils-dev \ - ${@bb.utils.contains('DISTRO_FEATURES', 'pipewire', 'pipewire-dev wireplumber-dev', '', d)} \ - cairo-dev \ - nss-dev \ - cups-dev \ - gconf-dev \ - libexif-dev \ - pango-dev \ - libdrm-dev \ - lua-dev \ - lua-staticdev \ - ${@bb.utils.contains('LICENSE_FLAGS_WHITELIST', 'commercial', 'ffmpeg-dev', '', d)} \ - " - -# Add wayland-scanner to SDK (SPEC-945) -# Use TOOLCHAIN_HOST_TASK instead of adding to the packagegroup -# wayland-scanner is in nativesdk-wayland-dev ! -# option: add also nativesdk-qtwayland-tools -TOOLCHAIN_HOST_TASK_append = " nativesdk-wayland nativesdk-wayland-dev" - -TOOLCHAIN_HOST_TASK_append = " nativesdk-perl-modules " diff --git a/meta-agl/meta-agl-profile-graphical-qt5/recipes-platform/images/agl-image-graphical-qt5-crosssdk.inc b/meta-agl/meta-agl-profile-graphical-qt5/recipes-platform/images/agl-image-graphical-qt5-crosssdk.inc new file mode 100644 index 00000000..f43bb07d --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-qt5/recipes-platform/images/agl-image-graphical-qt5-crosssdk.inc @@ -0,0 +1,14 @@ +require recipes-platform/images/agl-image-minimal-crosssdk.inc + +TOOLCHAIN_TARGET_TASK += "libafb-helpers-qt-staticdev" + +# Add wayland-scanner to SDK (SPEC-945) +# Use TOOLCHAIN_HOST_TASK instead of adding to the packagegroup +# wayland-scanner is in nativesdk-wayland-dev ! +# option: add also nativesdk-qtwayland-tools +TOOLCHAIN_HOST_TASK_append = " nativesdk-wayland nativesdk-wayland-dev" + +TOOLCHAIN_HOST_TASK_append = " nativesdk-perl-modules " + +# Add qtwaylandscanner to the SDK +TOOLCHAIN_HOST_TASK_append = " nativesdk-qtwayland-tools " diff --git a/meta-agl/meta-agl-profile-graphical-qt5/recipes-platform/images/agl-image-graphical-qt5.bb b/meta-agl/meta-agl-profile-graphical-qt5/recipes-platform/images/agl-image-graphical-qt5.bb index 35989819..bcfd724f 100644 --- a/meta-agl/meta-agl-profile-graphical-qt5/recipes-platform/images/agl-image-graphical-qt5.bb +++ b/meta-agl/meta-agl-profile-graphical-qt5/recipes-platform/images/agl-image-graphical-qt5.bb @@ -3,8 +3,3 @@ SUMMARY = "A very basic Wayland image with a terminal" require agl-image-graphical-qt5.inc LICENSE = "MIT" - -IMAGE_INSTALL_append = "\ - packagegroup-agl-image-weston \ - " - diff --git a/meta-agl/meta-agl-profile-graphical-qt5/recipes-platform/images/agl-image-graphical-qt5.inc b/meta-agl/meta-agl-profile-graphical-qt5/recipes-platform/images/agl-image-graphical-qt5.inc index ed1634fc..114d06a0 100644 --- a/meta-agl/meta-agl-profile-graphical-qt5/recipes-platform/images/agl-image-graphical-qt5.inc +++ b/meta-agl/meta-agl-profile-graphical-qt5/recipes-platform/images/agl-image-graphical-qt5.inc @@ -1,7 +1 @@ -require recipes-platform/images/agl-image-minimal.inc - -IMAGE_FEATURES += "splash package-management ssh-server-dropbear" - -inherit distro_features_check - -REQUIRED_DISTRO_FEATURES = "wayland" +require recipes-platform/images/agl-image-weston.inc diff --git a/meta-agl/meta-agl-profile-graphical-qt5/recipes-platform/packagegroups/packagegroup-qt5-toolchain-target.bbappend b/meta-agl/meta-agl-profile-graphical-qt5/recipes-platform/packagegroups/packagegroup-qt5-toolchain-target.bbappend index 300227e1..08afa6c7 100644 --- a/meta-agl/meta-agl-profile-graphical-qt5/recipes-platform/packagegroups/packagegroup-qt5-toolchain-target.bbappend +++ b/meta-agl/meta-agl-profile-graphical-qt5/recipes-platform/packagegroups/packagegroup-qt5-toolchain-target.bbappend @@ -16,8 +16,3 @@ RDEPENDS_${PN}_remove = " \ qtwebkit-mkspecs \ qtwebkit-qmlplugins \ " - -# add QtAGLExtras -RDEPENDS_${PN} += " \ - ${@bb.utils.contains("DISTRO_FEATURES", "agl-hmi-framework", " qtaglextras-dev qtaglextras-mkspecs", "",d)} \ -" diff --git a/meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qlibwindowmanager/qlibwindowmanager_git.bb b/meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qlibwindowmanager/qlibwindowmanager_git.bb deleted file mode 100644 index 883ab82d..00000000 --- a/meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qlibwindowmanager/qlibwindowmanager_git.bb +++ /dev/null @@ -1,14 +0,0 @@ -SUMMARY = "A wrapper library of libwindowmanager for Qt Application in AGL" -SECTION = "graphics" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93" - -DEPENDS = "qtbase libwindowmanager" -RDEPENDS_${PN} = "libwindowmanager" - -inherit qmake5 - -SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/libqtwindowmanager.git;protocol=https;branch=${AGL_BRANCH}" -SRCREV = "3ff07151af5040842dd1e56d8312ee39cc50f533" -S = "${WORKDIR}/git" -PV = "1.0+git${SRCPV}" diff --git a/meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtlocation_%.bbappend b/meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtlocation_%.bbappend new file mode 100644 index 00000000..bcda6a1e --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtlocation_%.bbappend @@ -0,0 +1,14 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += "\ + file://0001-mapbox-update-API-url-to-match-new-schema.patch \ + " + +# Need to explicitly enable the various plugins +PACKAGECONFIG += " \ + geoservices_osm \ + geoservices_here \ + geoservices_itemsoverlay \ + geoservices_mapbox \ + geoservices_mapboxgl \ +" diff --git a/meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtwayland-config/qtwayland b/meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtwayland-config/qtwayland new file mode 100644 index 00000000..a371c6c4 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtwayland-config/qtwayland @@ -0,0 +1,12 @@ +QT_WAYLAND_SHELL_INTEGRATION=@QT_WAYLAND_DEFAULT_SHELL@ +# The following might be necessary when multiple/split surfaces are created. +# Without this, QtWayland will sometimes maintain the same/old size even if the +# split surface is destroyed. +# We keep it disabled by default as it causes an additional repaint of the +# surface until the compositor sends a configure event to scale the window to +# the actual area. Typical windows will, by default, have an initial size set +# by qtwayland when starting-up (without an explicit size specified by the +# application). +# Note that QtWayland will only test the presence of the environment variable +# so it will be enabled even if set to 0 +# QT_WAYLAND_RESIZE_AFTER_SWAP=1 diff --git a/meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtwayland-config_1.0.0.bb b/meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtwayland-config_1.0.0.bb new file mode 100644 index 00000000..ae7c956d --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtwayland-config_1.0.0.bb @@ -0,0 +1,21 @@ +SUMMARY = "QtWayland config file." +DESCRIPTION = "Config file for qtwayland." +SECTION = "apps" +LICENSE = "MIT" + +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI = "file://qtwayland" + +inherit allarch + +QTWAYLAND_DEFAULT_SHELL ?= "xdg-shell" + +do_compile[noexec] = "1" + +do_install () { + install -D -m 644 ${WORKDIR}/qtwayland ${D}${sysconfdir}/afm/unit.env.d/qtwayland + sed -i -e 's/@QT_WAYLAND_DEFAULT_SHELL@/${QTWAYLAND_DEFAULT_SHELL}/' ${D}${sysconfdir}/afm/unit.env.d/qtwayland +} + +RPROVIDES_${PN} += "virtual/qtwayland-config" diff --git a/meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtwayland_%.bbappend b/meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtwayland_%.bbappend index 33874cf4..2f6072ac 100644 --- a/meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtwayland_%.bbappend +++ b/meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtwayland_%.bbappend @@ -24,4 +24,3 @@ SRC_URI_append = "\ file://0010-Added-manifest-file-according-to-smack-3-domain-mode.patch \ " -SRC_URI_append = " file://0099_qtwayland_no_evdev.patch " diff --git a/meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qtaglextras/qtaglextras_git.bb b/meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qtaglextras/qtaglextras_git.bb deleted file mode 100644 index 84925a93..00000000 --- a/meta-agl/meta-agl-profile-graphical-qt5/recipes-qt/qtaglextras/qtaglextras_git.bb +++ /dev/null @@ -1,28 +0,0 @@ -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57" - -DEPENDS += "qtbase qtdeclarative qtquickcontrols2 qlibwindowmanager libhomescreen" - -SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/qtaglextras;protocol=https;branch=${AGL_BRANCH}" -SRCREV = "a4d7197d3ccc411b98666a75126534849141acde" - -PV = "5.8.0+git${SRCPV}" -S = "${WORKDIR}/git/" - -inherit qmake5 - -PACKAGES += "${PN}-mkspecs" - -FILES_${PN}-mkspecs = "\ - ${OE_QMAKE_PATH_QT_ARCHDATA}/mkspecs \ -" - -FILES_${PN}-dev += " \ - ${OE_QMAKE_PATH_LIBS}/lib*${SOLIBSDEV} \ - ${OE_QMAKE_PATH_LIBS}/pkgconfig \ - ${OE_QMAKE_PATH_LIBS}/cmake/* \ - ${OE_QMAKE_PATH_LIBS}/*.prl \ - ${OE_QMAKE_PATH_LIBS}/*.la \ - ${OE_QMAKE_PATH_DATA}/* \ - ${OE_QMAKE_PATH_HEADERS}/* \ -" diff --git a/meta-agl/meta-agl-profile-graphical/LICENSE b/meta-agl/meta-agl-profile-graphical/LICENSE new file mode 100644 index 00000000..e8758f89 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/LICENSE @@ -0,0 +1,20 @@ +Different components of the AGL layers are under different licenses (a mix +of MIT and GPLv2). See LICENSE.GPL-2.0-only and LICENSE.MIT for further +details of the individual licenses. + +All metadata (e.g. .bb, .bbappend, .bbclass, .inc, templates/* and similar) +is MIT licensed unless otherwise stated. +Source code included in tree for individual recipes (e.g. patches) are under +the LICENSE stated in the associated recipe (.bb file) unless otherwise stated. + +License information for any other files (scripts) is either explicitly stated +or defaults to GPL version 2 only. + +Individual files can contain the following style tags instead of the full +license text to identify their license: + + SPDX-License-Identifier: GPL-2.0-only + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-graphical/LICENSE.GPL-2.0-only b/meta-agl/meta-agl-profile-graphical/LICENSE.GPL-2.0-only new file mode 100644 index 00000000..5db3c0a2 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/LICENSE.GPL-2.0-only @@ -0,0 +1,288 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: GPL-2.0-only + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-graphical/LICENSE.MIT b/meta-agl/meta-agl-profile-graphical/LICENSE.MIT new file mode 100644 index 00000000..a6919eb7 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/LICENSE.MIT @@ -0,0 +1,25 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-graphical/classes/agl-graphical.bbclass b/meta-agl/meta-agl-profile-graphical/classes/agl-graphical.bbclass index e99a441b..65106db1 100644 --- a/meta-agl/meta-agl-profile-graphical/classes/agl-graphical.bbclass +++ b/meta-agl/meta-agl-profile-graphical/classes/agl-graphical.bbclass @@ -1,7 +1,6 @@ -WESTONTTY ??= "1" WESTONUSER ??= "display" WESTONGROUP ??= "display" -WESTONARGS ?= "--idle-time=0 --tty=${WESTONTTY}" -WESTONLAUNCHARGS ??= "--tty /dev/tty${WESTONTTY} --user ${WESTONUSER}" +WESTONARGS ?= "--idle-time=0 --tty=7" +WESTONLAUNCHARGS ??= "--tty /dev/tty7 --user ${WESTONUSER}" DISPLAY_XDG_RUNTIME_DIR ??= "/run/platform/${WESTONUSER}" diff --git a/meta-agl/meta-agl-profile-graphical/conf/layer.conf b/meta-agl/meta-agl-profile-graphical/conf/layer.conf index a857b0c3..0a6efea7 100644 --- a/meta-agl/meta-agl-profile-graphical/conf/layer.conf +++ b/meta-agl/meta-agl-profile-graphical/conf/layer.conf @@ -9,4 +9,4 @@ BBFILE_COLLECTIONS += "aglprofilegraphical" BBFILE_PATTERN_aglprofilegraphical = "^${LAYERDIR}/" BBFILE_PRIORITY_aglprofilegraphical = "70" -LAYERSERIES_COMPAT_aglprofilegraphical = "thud" +LAYERSERIES_COMPAT_aglprofilegraphical = "dunfell" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-apis/agl-service-homescreen/agl-service-homescreen_git.bb b/meta-agl/meta-agl-profile-graphical/recipes-apis/agl-service-homescreen/agl-service-homescreen_git.bb index 6b250f83..7d2661bc 100644 --- a/meta-agl/meta-agl-profile-graphical/recipes-apis/agl-service-homescreen/agl-service-homescreen_git.bb +++ b/meta-agl/meta-agl-profile-graphical/recipes-apis/agl-service-homescreen/agl-service-homescreen_git.bb @@ -10,5 +10,5 @@ DEPENDS = "dbus glib-2.0 af-binder json-c" inherit cmake aglwgt SRC_URI = "git://gerrit.automotivelinux.org/gerrit/apps/agl-service-homescreen;protocol=https;branch=${AGL_BRANCH}" -SRCREV = "6c3015a7607c45313fa10792b9914864f8c25831" +SRCREV = "${AGL_APP_REVISION}" S = "${WORKDIR}/git" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-apis/agl-service-taskmanager/agl-service-taskmanager.bb b/meta-agl/meta-agl-profile-graphical/recipes-apis/agl-service-taskmanager/agl-service-taskmanager.bb index 490b3f9d..6c5a1810 100644 --- a/meta-agl/meta-agl-profile-graphical/recipes-apis/agl-service-taskmanager/agl-service-taskmanager.bb +++ b/meta-agl/meta-agl-profile-graphical/recipes-apis/agl-service-taskmanager/agl-service-taskmanager.bb @@ -13,7 +13,6 @@ PV = "1.0+git${SRCPV}" S = "${WORKDIR}/git" DEPENDS = "json-c procps" -RDEPENDS_${PN} = "qtwebsockets" inherit cmake aglwgt pkgconfig diff --git a/meta-agl/meta-agl-profile-graphical/recipes-apis/agl-service-windowmanager/agl-service-windowmanager_git.bb b/meta-agl/meta-agl-profile-graphical/recipes-apis/agl-service-windowmanager/agl-service-windowmanager_git.bb deleted file mode 100644 index 4be5ab1d..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-apis/agl-service-windowmanager/agl-service-windowmanager_git.bb +++ /dev/null @@ -1,33 +0,0 @@ -SUMMARY = "Window Manager service binding for applications" -DESCRIPTION = "Window Manager is the service binding for controlling \ - rendering rights. Applications request to render itself, \ - then Window Manager checks the policy and notifies the \ - layout to the respective applications \ - " -HOMEPAGE = "https://wiki.automotivelinux.org/windowmanager" -SECTION = "graphics" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93" - -DEPENDS = "af-binder json-c wayland wayland-ivi-extension" - -inherit cmake aglwgt - -SRC_URI = "git://gerrit.automotivelinux.org/gerrit/apps/agl-service-windowmanager;protocol=https;branch=${AGL_BRANCH} \ - file://weston-ready.conf \ -" -SRCREV = "${AGL_APP_REVISION}" -PV = "1.0+git${SRCPV}" -S = "${WORKDIR}/git" - -do_install_append() { - # Install systemd over-ride that adds a dependency on weston-ready - # to ensure that the windowmanager and its dependencies start after - # weston is actually initialized. - install -d ${D}${sysconfdir}/systemd/system/afm-api-windowmanager@.service.d - install -m 0644 ${WORKDIR}/weston-ready.conf ${D}${sysconfdir}/systemd/system/afm-api-windowmanager@.service.d -} - -FILES_${PN} += "${systemd_system_unitdir}" - -RDEPENDS_${PN} += "weston-ready" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-apis/agl-service-windowmanager/files/weston-ready.conf b/meta-agl/meta-agl-profile-graphical/recipes-apis/agl-service-windowmanager/files/weston-ready.conf deleted file mode 100644 index e90eed5f..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-apis/agl-service-windowmanager/files/weston-ready.conf +++ /dev/null @@ -1,4 +0,0 @@ -[Unit] -Requires=weston-ready.service -After=weston-ready.service - diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/agl-desktop-config_0.1.bb b/meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/agl-desktop-config_0.1.bb deleted file mode 100644 index e0358d61..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/agl-desktop-config_0.1.bb +++ /dev/null @@ -1,21 +0,0 @@ -SUMMARY = "AGL desktop config" - -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" - -SRC_URI += " \ - file://user-weston-term.service \ - file://user-weston-term.path \ -" - -do_install_append() { - install -d ${D}${systemd_user_unitdir} - install -m 0644 ${WORKDIR}/user-weston-term.service ${D}${systemd_user_unitdir} - install -m 0644 ${WORKDIR}/user-weston-term.path ${D}${systemd_user_unitdir} - - install -d ${D}${systemd_user_unitdir}/default.target.wants - ln -sf ${systemd_user_unitdir}/user-weston-term.path ${D}${libdir}/systemd/user/default.target.wants -} - -FILES_${PN} += "${systemd_user_unitdir}/*" -FILES_${PN} += "${systemd_user_unitdir}/default.target.wants/default.target.wants" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/files/user-weston-term.path b/meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/files/user-weston-term.path deleted file mode 100644 index 9481840e..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/files/user-weston-term.path +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Terminal for weston user unit path - -[Path] -PathExists=%t/wayland-0 - -[Install] -WantedBy=default.target diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/files/user-weston-term.service b/meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/files/user-weston-term.service deleted file mode 100644 index ad8b9583..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/files/user-weston-term.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Terminal for weston user -After=user-config.service -Requires=user-config.service - -[Service] -Type=simple -ExecStart=/usr/bin/weston-terminal -Restart=always - -[Install] -WantedBy=multi-user.target diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/libwindowmanager/libwindowmanager_git.bb b/meta-agl/meta-agl-profile-graphical/recipes-graphics/libwindowmanager/libwindowmanager_git.bb deleted file mode 100644 index 56e9a0d9..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/libwindowmanager/libwindowmanager_git.bb +++ /dev/null @@ -1,16 +0,0 @@ -SUMMARY = "Window Manager client library for applications" -DESCRIPTION = "Window Manager client library for application built with recipe" -SECTION = "graphics" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93" - -DEPENDS = "af-binder json-c" -RDEPENDS_${PN} = "agl-service-windowmanager" - -inherit cmake - -SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/libwindowmanager.git;protocol=https;branch=${AGL_BRANCH}" -SRCREV = "949e8b8c90dfb37988b542df171c39941aee7bcb" -S = "${WORKDIR}/git" -PV = "1.0+git${SRCPV}" - diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/runxdg/runxdg_git.bb b/meta-agl/meta-agl-profile-graphical/recipes-graphics/runxdg/runxdg_git.bb deleted file mode 100644 index d5bd568b..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/runxdg/runxdg_git.bb +++ /dev/null @@ -1,16 +0,0 @@ -SUMMARY = "Launcher of XDG application on AGL HMI Framework (2017)" -DESCRIPTION = "The command 'runxdg' is a launcher to execute XDG application \ - on AGL HMI Framework which using wayland-ivi-extension" -HOMEPAGE = "https://git.automotivelinux.org/staging/xdg-launcher" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" - -DEPENDS = "json-c wayland wayland-ivi-extension libhomescreen libwindowmanager" - -inherit cmake - -SRC_URI = "git://gerrit.automotivelinux.org/gerrit/staging/xdg-launcher;protocol=https;branch=${AGL_BRANCH}" -SRCREV = "${AGL_APP_REVISION}" - -PV = "1.0+git${SRCPV}" -S = "${WORKDIR}/git" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/agl-compositor_git.bb b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/agl-compositor_git.bb index 2efcc9bd..1e3162f5 100644 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/agl-compositor_git.bb +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/agl-compositor_git.bb @@ -11,11 +11,17 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=fac6abe0003c4d142ff8fa1f18316df0" DEPENDS = "wayland wayland-protocols wayland-native weston" SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/agl-compositor.git;protocol=https;branch=${AGL_BRANCH}" -SRCREV = "facb744f37ecb40dde776300ab9e99ef21fc7991" +SRCREV = "0056122343c782902457802bb1ef6bde7c14d3c9" PV = "0.0.10+git${SRCPV}" S = "${WORKDIR}/git" +PACKAGECONFIG[policy-deny-all] = "-Dpolicy-default=deny-all,," + inherit meson pkgconfig python3native -FILES_${PN} = "${bindir}/agl-compositor" +FILES_${PN} = " \ + ${bindir}/agl-compositor \ + ${datadir}/${PN}/protocols/agl-shell.xml \ + ${datadir}/${PN}/protocols/agl-shell-desktop.xml \ + " diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-id-agent-added-ivi-id-agent.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-id-agent-added-ivi-id-agent.patch index 7deb01e9..0fe2abb3 100644 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-id-agent-added-ivi-id-agent.patch +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-id-agent-added-ivi-id-agent.patch @@ -73,7 +73,7 @@ index 0000000..7354a7e +pkg_check_modules(WAYLAND_SERVER wayland-server REQUIRED) +pkg_check_modules(WESTON weston>=5.0.0 REQUIRED) +pkg_check_modules(PIXMAN pixman-1 REQUIRED) -+pkg_check_modules(LIBWESTON_DESKTOP libweston-desktop-6 REQUIRED) ++pkg_check_modules(LIBWESTON_DESKTOP libweston-desktop-8 REQUIRED) + +find_package(Threads REQUIRED) + @@ -149,8 +149,8 @@ index 0000000..9bc115d +#include + +#include -+#include -+#include "config-parser.h" ++#include ++#include "libweston/config-parser.h" +#include + +#ifndef INVALID_ID diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0006-fix-plugin-registry-include.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0006-fix-plugin-registry-include.patch new file mode 100644 index 00000000..dddbfd37 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0006-fix-plugin-registry-include.patch @@ -0,0 +1,13 @@ +diff --git a/ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c b/ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c +index a0bfc48..257a1dc 100644 +--- a/ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c ++++ b/ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c +@@ -31,7 +31,7 @@ + #include + #include + +-#include "plugin-registry.h" ++#include + #include "ilm_types.h" + + #include "ivi-input-server-protocol.h" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_git.bb b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_git.bb index 3935929a..68fc694a 100644 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_git.bb +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_git.bb @@ -12,6 +12,7 @@ SRC_URI = "git://github.com/GENIVI/${BPN}.git;protocol=http \ file://0002-add-LayerManagerControl-error-status.patch \ file://0004-ivi-ilmcontrol-added-focus-notification.patch \ file://0005-disable-EGLWLMockNavigation-example-build.patch \ + file://0006-fix-plugin-registry-include.patch \ " SRC_URI_append_wandboard = " file://wandboard_fix_build.patch" SRCREV = "736fb654ac81230cf4f9e51a5772d3a02d7639bf" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0001-Change-socket-mode-add-rw-for-group.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0001-Change-socket-mode-add-rw-for-group.patch index b04127b5..d0dcb45a 100644 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0001-Change-socket-mode-add-rw-for-group.patch +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0001-Change-socket-mode-add-rw-for-group.patch @@ -4,16 +4,19 @@ Date: Tue, 18 Apr 2017 13:53:26 +0200 Subject: [PATCH] Change socket mode:add rw for group Signed-off-by: Ronan Le Martret +[Updated for 1.18.0 to remove fuzz] +Signed-off-by: Scott Murray + --- src/wayland-server.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wayland-server.c b/src/wayland-server.c -index 64d1bec..313c5a0 100644 +index 3f48dfe..fbccb45 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c -@@ -1189,7 +1189,10 @@ _wl_display_add_socket(struct wl_display *display, struct wl_socket *s) - wl_log("bind() failed with error: %m\n"); +@@ -1528,7 +1528,10 @@ _wl_display_add_socket(struct wl_display *display, struct wl_socket *s) + wl_log("bind() failed with error: %s\n", strerror(errno)); return -1; } - @@ -22,8 +25,5 @@ index 64d1bec..313c5a0 100644 + return -1; + } if (listen(s->fd, 128) < 0) { - wl_log("listen() failed with error: %m\n"); + wl_log("listen() failed with error: %s\n", strerror(errno)); return -1; --- -2.6.6 - diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0002-server-Fix-fake-Address-already-in-use-error.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0002-server-Fix-fake-Address-already-in-use-error.patch deleted file mode 100644 index ea9dbd65..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0002-server-Fix-fake-Address-already-in-use-error.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 152c9ed968124c253f0be25b76c2a083a21af37e Mon Sep 17 00:00:00 2001 -From: Liu Wenlong -Date: Mon, 26 Aug 2019 17:08:22 +0800 -Subject: [PATCH] server: Fix fake "Address already in use" error - -In the current workflow, socket file will be deleted if it already exists. -However, if the socket file is a symbolic link and the file that it refers -to doesn't exist, we will got "Address already in use" because bind() -thinks the socket file exists and won't create it. - -Now, use lstat() to determine whether the socket file exists. - -Upstream-Status: Backport [https://gitlab.freedesktop.org/wayland/wayland/merge_requests/35] - -Signed-off-by: Liu Wenlong ---- - src/wayland-server.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/wayland-server.c b/src/wayland-server.c -index 83b984f..3bc6ed7 100644 ---- a/src/wayland-server.c -+++ b/src/wayland-server.c -@@ -1393,7 +1393,7 @@ wl_socket_lock(struct wl_socket *socket) - goto err_fd; - } - -- if (stat(socket->addr.sun_path, &socket_stat) < 0 ) { -+ if (lstat(socket->addr.sun_path, &socket_stat) < 0 ) { - if (errno != ENOENT) { - wl_log("did not manage to stat file %s\n", - socket->addr.sun_path); --- -2.7.4 - diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland_%.bbappend b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland_%.bbappend index 5677ed52..9d182269 100644 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland_%.bbappend +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland_%.bbappend @@ -2,5 +2,4 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI_append = "\ file://0001-Change-socket-mode-add-rw-for-group.patch \ - file://0002-server-Fix-fake-Address-already-in-use-error.patch \ " diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init.bbappend b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init.bbappend index 247aeeee..374e9aa7 100644 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init.bbappend +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init.bbappend @@ -2,17 +2,16 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" inherit agl-graphical +AGL_DEFAULT_WESTONSTART ??= "/usr/bin/agl-compositor --config ${sysconfdir}/xdg/weston/weston.ini" -WESTONSTART ??= "${@bb.utils.contains("DISTRO_FEATURES", "agl-compositor", "/usr/bin/agl-compositor", "/usr/bin/weston",d)} ${WESTONARGS}" -WESTONSTART_append = " ${@bb.utils.contains("IMAGE_FEATURES", "debug-tweaks", " --log=${DISPLAY_XDG_RUNTIME_DIR}/weston.log", "",d)}" - -DROPIN_NAME = "weston-init" +WESTONSTART ??= "${AGL_DEFAULT_WESTONSTART} ${WESTONARGS}" +WESTONSTART_append = " ${@bb.utils.contains("IMAGE_FEATURES", "debug-tweaks", " --log=${DISPLAY_XDG_RUNTIME_DIR}/compositor.log", "",d)}" WIFILES = " \ file://weston.conf.in \ file://tmpfiles.conf.in \ file://zz-dri.rules.in \ - file://zz-input.rules \ + file://zz-input.rules.in \ file://zz-tty.rules.in \ " @@ -23,37 +22,34 @@ WIFILES_append_imx = " \ SRC_URI_append = " ${WIFILES}" do_install_append() { + # Remove upstream weston.ini to avoid conflict with weston-ini-conf package + rm -f ${D}${sysconfdir}/xdg/weston/weston.ini - # files - files=$(echo ${WIFILES} | sed s,file://,,g) + # Remove upstream weston udev rules just to be safe + rm -f ${D}${sysconfdir}/udev/rules.d/71-weston-drm.rules - # process ".in" files + # Process ".in" files + files=$(echo ${WIFILES} | sed s,file://,,g) for f in ${files}; do g=${f%.in} if [ "${f}" != "${g}" ]; then sed -e "s,@WESTONUSER@,${WESTONUSER},g" \ -e "s,@WESTONGROUP@,${WESTONGROUP},g" \ -e "s,@XDG_RUNTIME_DIR@,${DISPLAY_XDG_RUNTIME_DIR},g" \ - -e "s,@WESTONTTY@,${WESTONTTY},g" \ -e "s,@WESTONSTART@,${WESTONSTART},g" \ ${WORKDIR}/${f} > ${WORKDIR}/${g} fi done - # removes any unexpected entry from weston.service - for x in Group User ExecStart PAMName; do - sed -i "/^ *$x *=/d" ${D}${systemd_system_unitdir}/weston.service - done - - # install weston drop-in - install -d ${D}${systemd_system_unitdir}/weston.service.d - install -m644 ${WORKDIR}/weston.conf ${D}/${systemd_system_unitdir}/weston.service.d/${DROPIN_NAME}.conf + # Install weston drop-in + install -d ${D}${systemd_system_unitdir}/weston@.service.d + install -m644 ${WORKDIR}/weston.conf ${D}/${systemd_system_unitdir}/weston@.service.d/weston-init.conf - # install tmpfiles drop-in + # Install tmpfiles drop-in install -d ${D}${libdir}/tmpfiles.d - install -m644 ${WORKDIR}/tmpfiles.conf ${D}${libdir}/tmpfiles.d/${DROPIN_NAME}.conf + install -m644 ${WORKDIR}/tmpfiles.conf ${D}${libdir}/tmpfiles.d/weston-init.conf - # install udev rules + # Install udev rules install -d ${D}${sysconfdir}/udev/rules.d for f in ${files}; do g=${f%.in} @@ -65,8 +61,9 @@ do_install_append() { } FILES_${PN} += " \ - ${libdir}/tmpfiles.d/*.conf \ - ${systemd_system_unitdir}/weston.service.d/${DROPIN_NAME}.conf \ + ${libdir}/tmpfiles.d/ \ + ${systemd_system_unitdir}/weston@.service.d/ \ " +SYSTEMD_AUTO_ENABLE = "enable" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/weston.conf.in b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/weston.conf.in index 89c43669..9c3df052 100644 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/weston.conf.in +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/weston.conf.in @@ -1,17 +1,12 @@ -[Unit] -Conflicts=getty@tty@WESTONTTY@.service [Service] Type=notify -User=@WESTONUSER@ -Group=@WESTONGROUP@ Environment="XDG_RUNTIME_DIR=@XDG_RUNTIME_DIR@" -Environment="XDG_RUNTIMESHARE_DIR=@XDG_RUNTIME_DIR@/share" -ExecStartPre=/bin/mkdir -p @XDG_RUNTIME_DIR@/share -ExecStartPre=+/usr/bin/chsmack -a User::App-Shared -t @XDG_RUNTIME_DIR@/share +# Note that clearing PAMName (thus not having PAMName=login) disables +# logind support for the session, which allows setting XDG_RUNTIME_DIR +# to something other than /run/user/% (as is done above). +# Without systemd-logind support, weston needs to be patched to allow +# its direct launcher to work for non-root users in this scenario. +PAMName= +ExecStart= ExecStart=@WESTONSTART@ -TTYPath=/dev/tty@WESTONTTY@ -StandardInput=tty -TTYReset=yes -TTYVHangup=yes -TTYVTDisallocate=yes -UtmpIdentifier=tty@WESTONTTY@ +SmackProcessLabel=System::Weston diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/zz-dri.rules.in b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/zz-dri.rules.in index 707d12e2..51c68c30 100644 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/zz-dri.rules.in +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/zz-dri.rules.in @@ -1 +1 @@ -SUBSYSTEM=="drm", MODE="0660", GROUP="@WESTONGROUP@", SECLABEL{smack}="*", TAG+="systemd", ENV{SYSTEMD_WANTS}="weston.service" +SUBSYSTEM=="drm", MODE="0660", GROUP="@WESTONGROUP@", SECLABEL{smack}="*", TAG+="systemd", ENV{SYSTEMD_WANTS}="weston@@WESTONUSER@.service" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/zz-input.rules b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/zz-input.rules deleted file mode 100644 index c0842135..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/zz-input.rules +++ /dev/null @@ -1 +0,0 @@ -SUBSYSTEM=="input", MODE="0660", GROUP="input", SECLABEL{smack}="*", TAG+="systemd", ENV{SYSTEMD_WANTS}="weston.service" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/zz-input.rules.in b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/zz-input.rules.in new file mode 100644 index 00000000..fb3e677f --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/zz-input.rules.in @@ -0,0 +1 @@ +SUBSYSTEM=="input", MODE="0660", GROUP="input", SECLABEL{smack}="*", TAG+="systemd", ENV{SYSTEMD_WANTS}="weston@@WESTONUSER@.service" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/zz-tty.rules.in b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/zz-tty.rules.in index bfdf55b8..e5ce4b55 100644 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/zz-tty.rules.in +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/zz-tty.rules.in @@ -1 +1 @@ -SUBSYSTEM=="tty", KERNEL=="tty@WESTONTTY@", OWNER="@WESTONUSER@", SECLABEL{smack}="*", TAG+="systemd", ENV{SYSTEMD_WANTS}="weston.service" +SUBSYSTEM=="tty", KERNEL=="tty7", OWNER="@WESTONUSER@", SECLABEL{smack}="*", TAG+="systemd", ENV{SYSTEMD_WANTS}="weston@@WESTONUSER@.service" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-ready/weston-ready.service b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-ready/weston-ready.service index 603f5f36..82490fef 100644 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-ready/weston-ready.service +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-ready/weston-ready.service @@ -1,7 +1,7 @@ [Unit] Description=Wait for Weston readiness -Requires=weston.service -After=weston.service +Requires=weston@display.service +After=weston@display.service [Service] SupplementaryGroups=display diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston_2.0.0.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston_2.0.0.patch deleted file mode 100644 index 3a59ba0c..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston_2.0.0.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 6c145cea35f0b77613d6e3f48679c976b9839d7c Mon Sep 17 00:00:00 2001 -From: Ronan Le Martret -Date: Wed, 31 May 2017 22:48:18 +0000 -Subject: [PATCH] Allow regular users to launch Weston - -Signed-off-by: Ronan Le Martret - -diff --git a/configure.ac b/configure.ac -index 50f8e013..2043b9b0 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -156,6 +156,12 @@ PKG_CHECK_MODULES(XKBCOMMON_COMPOSE, [xkbcommon >= 0.5.0], - [AC_DEFINE(HAVE_XKBCOMMON_COMPOSE, 1, - [Define if xkbcommon is 0.5.0 or newer])],true) - -+AC_ARG_ENABLE(sys-uid, [ --enable-sys-uid],, -+ enable_sys_uid=no) -+if test x$enable_sys_uid = xyes; then -+ AC_DEFINE(ENABLE_SYS_UID, [1], [Allow regular users to launch Weston]) -+fi -+ - AC_ARG_ENABLE(setuid-install, [ --enable-setuid-install],, - enable_setuid_install=yes) - AM_CONDITIONAL(ENABLE_SETUID_INSTALL, test x$enable_setuid_install = xyes) -diff --git a/libweston/launcher-direct.c b/libweston/launcher-direct.c -index e0ce6d63..d0db9bb5 100644 ---- a/libweston/launcher-direct.c -+++ b/libweston/launcher-direct.c -@@ -283,8 +283,10 @@ launcher_direct_connect(struct weston_launcher **out, struct weston_compositor * - { - struct launcher_direct *launcher; - -+#ifndef ENABLE_SYS_UID - if (geteuid() != 0) - return -EINVAL; -+#endif - - launcher = zalloc(sizeof(*launcher)); - if (launcher == NULL) diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston_7.0.0.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston_7.0.0.patch new file mode 100644 index 00000000..362f6b06 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston_7.0.0.patch @@ -0,0 +1,51 @@ +Allow regular users to launch Weston + +Signed-off-by: Ronan Le Martret +[Reworked for Weston 7.0.0 switch to meson] +Signed-off-by: Scott Murray + +diff --git a/libweston/launcher-direct.c b/libweston/launcher-direct.c +index 9fa329b6..8e218804 100644 +--- a/libweston/launcher-direct.c ++++ b/libweston/launcher-direct.c +@@ -291,8 +291,10 @@ launcher_direct_connect(struct weston_launcher **out, struct weston_compositor * + { + struct launcher_direct *launcher; + ++#ifndef ENABLE_USER_START + if (geteuid() != 0) + return -EINVAL; ++#endif + + launcher = zalloc(sizeof(*launcher)); + if (launcher == NULL) +diff --git a/libweston/meson.build b/libweston/meson.build +index d8d3fc07..0d39ebf1 100644 +--- a/libweston/meson.build ++++ b/libweston/meson.build +@@ -216,6 +216,10 @@ if get_option('weston-launch') + meson.add_install_script('echo', 'REMINDER: You are installing weston-launch, please make it setuid-root.') + endif + ++if get_option('enable-user-start') ++ config_h.set('ENABLE_USER_START', '1') ++endif ++ + subdir('renderer-gl') + subdir('backend-drm') + subdir('backend-fbdev') +diff --git a/meson_options.txt b/meson_options.txt +index d5bf1d54..c93f31d1 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -217,3 +217,10 @@ option( + value: false, + description: 'Generate documentation' + ) ++ ++option( ++ 'enable-user-start', ++ type: 'boolean', ++ value: true, ++ description: 'Tests: enable start as non-root user' ++) diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-config-parser-Export-get_full_path-and-destroy.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-config-parser-Export-get_full_path-and-destroy.patch deleted file mode 100644 index 9dbd7a74..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-config-parser-Export-get_full_path-and-destroy.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 40ff644ac4da90c5cf5239c6ee6051d9bb2b099a Mon Sep 17 00:00:00 2001 -From: Daniel Stone -Date: Mon, 25 Nov 2019 10:30:11 +0000 -Subject: [PATCH] config-parser: Export get_full_path and destroy - -Make sure we export the get_full_path() accessor (declared in the -header, used by Weston itself) and the parser's destroy function. - -Signed-off-by: Daniel Stone ---- - shared/config-parser.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/shared/config-parser.c b/shared/config-parser.c -index 35f09f006..94eb24cc1 100644 ---- a/shared/config-parser.c -+++ b/shared/config-parser.c -@@ -470,6 +470,7 @@ weston_config_parse(const char *name) - return config; - } - -+WL_EXPORT - const char * - weston_config_get_full_path(struct weston_config *config) - { -@@ -500,6 +501,7 @@ weston_config_next_section(struct weston_config *config, - return 1; - } - -+WL_EXPORT - void - weston_config_destroy(struct weston_config *config) - { --- -2.21.0 - diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-ivi-shell-rework-goto-labels-to-avoid-memory-leaks.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-ivi-shell-rework-goto-labels-to-avoid-memory-leaks.patch deleted file mode 100644 index b1e0b8a5..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-ivi-shell-rework-goto-labels-to-avoid-memory-leaks.patch +++ /dev/null @@ -1,57 +0,0 @@ -diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c -index 58f53bc5..34cdce27 100644 ---- a/ivi-shell/ivi-shell.c -+++ b/ivi-shell/ivi-shell.c -@@ -484,13 +484,14 @@ wet_shell_init(struct weston_compositor *compositor, - int *argc, char *argv[]) - { - struct ivi_shell *shell; -- int retval = -1; - - shell = zalloc(sizeof *shell); - if (shell == NULL) -- return -1; -+ goto err_shell; - - init_ivi_shell(compositor, shell); -+ /* TODO deinit_ivi_shell should be implemented, since init_ivi_shell is -+ * initializing multiple lists. */ - - shell->destroy_listener.notify = shell_destroy; - wl_signal_add(&compositor->destroy_signal, &shell->destroy_listener); -@@ -499,22 +500,29 @@ wet_shell_init(struct weston_compositor *compositor, - wl_signal_add(&compositor->wake_signal, &shell->wake_listener); - - if (input_panel_setup(shell) < 0) -- goto out; -+ goto err_shell; - - shell->text_backend = text_backend_init(compositor); - if (!shell->text_backend) -- goto out; -+ goto err_shell; - - if (wl_global_create(compositor->wl_display, - &ivi_application_interface, 1, - shell, bind_ivi_application) == NULL) -- goto out; -+ goto err_text_backend; - - ivi_layout_init_with_compositor(compositor); -+ /* TODO ivi_layout_destroy should be implemented, since multiple lists -+ * and signals are initialized.*/ - shell_add_bindings(compositor, shell); - -- retval = 0; -+ return IVI_SUCCEEDED; - --out: -- return retval; -+err_text_backend: -+ text_backend_destroy(shell->text_backend); -+ -+err_shell: -+ free(shell); -+ -+ return IVI_FAILED; - } diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-libweston-Expose-weston_output_damage-in-libweston.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-libweston-Expose-weston_output_damage-in-libweston.patch new file mode 100644 index 00000000..32755c4b --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-libweston-Expose-weston_output_damage-in-libweston.patch @@ -0,0 +1,30 @@ +From 7e5fb58591a29d60657158262a0772796bfd3461 Mon Sep 17 00:00:00 2001 +From: Marius Vlad +Date: Wed, 12 Feb 2020 13:18:19 +0200 +Subject: [PATCH] libweston: Expose weston_output_damage() in libweston + +We have weston_compositor_damage_all() exported and declared but users +might need weston_output_damage() to refer to an individual output. The +symbol already exported so just declare it. + +Signed-off-by: Marius Vlad +--- + include/libweston/libweston.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h +index 1439775e..9fac5be0 100644 +--- a/include/libweston/libweston.h ++++ b/include/libweston/libweston.h +@@ -1604,6 +1604,8 @@ weston_compositor_schedule_repaint(struct weston_compositor *compositor); + void + weston_compositor_damage_all(struct weston_compositor *compositor); + void ++weston_output_damage(struct weston_output *woutput); ++void + weston_compositor_wake(struct weston_compositor *compositor); + void + weston_compositor_sleep(struct weston_compositor *compositor); +-- +2.20.1 + diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0002-ivi-shell-Fix-crash-due-no-transmitter-screen.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0002-ivi-shell-Fix-crash-due-no-transmitter-screen.patch index 51779cf4..05ce7de3 100644 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0002-ivi-shell-Fix-crash-due-no-transmitter-screen.patch +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0002-ivi-shell-Fix-crash-due-no-transmitter-screen.patch @@ -40,7 +40,7 @@ index 2c450f3..1fbfeeb 100644 #include "ivi-layout-private.h" #include "ivi-layout-shell.h" - -+#include "plugin-registry.h" ++#include #include "shared/helpers.h" #include "shared/os-compatibility.h" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0002-ivi-shell-removed-assert.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0002-ivi-shell-removed-assert.patch deleted file mode 100644 index 4507e769..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0002-ivi-shell-removed-assert.patch +++ /dev/null @@ -1,11 +0,0 @@ -index e9ddf9a4..f3156d35 100644 ---- a/ivi-shell/ivi-shell.c -+++ b/ivi-shell/ivi-shell.c -@@ -114,7 +114,6 @@ shell_surface_send_configure(struct weston_surface *surface, - struct ivi_shell_surface *shsurf; - - shsurf = get_ivi_shell_surface(surface); -- assert(shsurf); - if (!shsurf) - return; - diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0003-ivi-shell-introduction-of-IVI_INVALID_ID.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0003-ivi-shell-introduction-of-IVI_INVALID_ID.patch deleted file mode 100644 index 9f696d8a..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0003-ivi-shell-introduction-of-IVI_INVALID_ID.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h -index 016d8b5c..02bfb2cb 100644 ---- a/ivi-shell/ivi-layout-export.h -+++ b/ivi-shell/ivi-layout-export.h -@@ -56,6 +56,7 @@ extern "C" { - #endif /* __cplusplus */ - - #include -+#include - - #include "stdbool.h" - #include "compositor.h" -@@ -63,6 +64,7 @@ extern "C" { - - #define IVI_SUCCEEDED (0) - #define IVI_FAILED (-1) -+#define IVI_INVALID_ID UINT_MAX - - struct ivi_layout_layer; - struct ivi_layout_screen; diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0004-layout-interface-added-interface-to-change-surface-id.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0004-layout-interface-added-interface-to-change-surface-id.patch deleted file mode 100644 index 6401c5b8..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0004-layout-interface-added-interface-to-change-surface-id.patch +++ /dev/null @@ -1,73 +0,0 @@ -index e1e897ed..5b1f12f0 100644 ---- a/ivi-shell/ivi-layout-export.h -+++ b/ivi-shell/ivi-layout-export.h -@@ -320,6 +320,12 @@ struct ivi_layout_interface { - struct ivi_layout_surface *ivisurf, - uint32_t duration); - -+ /** -+ * \brief set id of ivi_layout_surface -+ */ -+ int32_t (*surface_set_id)(struct ivi_layout_surface *ivisurf, -+ uint32_t id_surface); -+ - /** - * layer controller interface - */ -diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c -index 298e18ea..fa8e75f6 100644 ---- a/ivi-shell/ivi-layout.c -+++ b/ivi-shell/ivi-layout.c -@@ -1901,6 +1901,44 @@ ivi_layout_surface_set_transition_duration(struct ivi_layout_surface *ivisurf, - return 0; - } - -+/* -+ * This interface enables e.g. an id agent to set the id of an ivi-layout -+ * surface, that has been created by a desktop application. This can only be -+ * done once as long as the initial surface id equals IVI_INVALID_ID. Afterwards -+ * two events are emitted, namely surface_created and surface_configured. -+ */ -+static int32_t -+ivi_layout_surface_set_id(struct ivi_layout_surface *ivisurf, -+ uint32_t id_surface) -+{ -+ struct ivi_layout *layout = get_instance(); -+ struct ivi_layout_surface *search_ivisurf = NULL; -+ -+ if (!ivisurf) { -+ weston_log("%s: invalid argument\n", __func__); -+ return IVI_FAILED; -+ } -+ -+ if (ivisurf->id_surface != IVI_INVALID_ID) { -+ weston_log("surface id can only be set once\n"); -+ return IVI_FAILED; -+ } -+ -+ search_ivisurf = get_surface(&layout->surface_list, id_surface); -+ if (search_ivisurf) { -+ weston_log("id_surface(%d) is already created\n", id_surface); -+ return IVI_FAILED; -+ } -+ -+ ivisurf->id_surface = id_surface; -+ -+ wl_signal_emit(&layout->surface_notification.created, ivisurf); -+ wl_signal_emit(&layout->surface_notification.configure_changed, -+ ivisurf); -+ -+ return IVI_SUCCEEDED; -+} -+ - static int32_t - ivi_layout_surface_set_transition(struct ivi_layout_surface *ivisurf, - enum ivi_layout_transition_type type, -@@ -2058,6 +2096,7 @@ static struct ivi_layout_interface ivi_layout_interface = { - .surface_get_weston_surface = ivi_layout_surface_get_weston_surface, - .surface_set_transition = ivi_layout_surface_set_transition, - .surface_set_transition_duration = ivi_layout_surface_set_transition_duration, -+ .surface_set_id = ivi_layout_surface_set_id, - - /** - * layer controller interfaces diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0004-main-change-remoting-initialization-timing.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0004-main-change-remoting-initialization-timing.patch new file mode 100644 index 00000000..61772182 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0004-main-change-remoting-initialization-timing.patch @@ -0,0 +1,40 @@ +From 0a0103f20437d9ed63b6cec500027a6d7bf6185f Mon Sep 17 00:00:00 2001 +From: Harunobu Kurokawa +Date: Mon, 20 May 2019 18:31:32 +0900 +Subject: [PATCH] main: change remoting initialization timing + +Upstream-Status: Pending[1] + +[1]: https://gitlab.freedesktop.org/wayland/weston/issues/246 + +Signed-off-by: Tomohito Esaki +Signed-off-by: Harunobu Kurokawa +[Updated for Weston 8.0.0] +Signed-off-by: Scott Murray + +--- +diff --git a/compositor/main.c b/compositor/main.c +index 8eb8a47..22686b0 100644 +--- a/compositor/main.c ++++ b/compositor/main.c +@@ -2518,9 +2518,6 @@ load_drm_backend(struct weston_compositor *c, + ret = weston_compositor_load_backend(c, WESTON_BACKEND_DRM, + &config.base); + +- /* remoting */ +- load_remoting(c, wc); +- + /* pipewire */ + load_pipewire(c, wc); + +@@ -3278,6 +3275,10 @@ wet_main(int argc, char *argv[]) + if (wet.init_failed) + goto out; + ++ /* remoting: only support on drm-backend */ ++ if (strstr(backend, "drm-backend.so")) ++ load_remoting(wet.compositor, config); ++ + if (idle_time < 0) + weston_config_section_get_int(section, "idle-time", &idle_time, -1); + if (idle_time < 0) diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0005-ivi-layout-introcuded-configure_desktop_changed.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0005-ivi-layout-introcuded-configure_desktop_changed.patch deleted file mode 100644 index ddd949e3..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0005-ivi-layout-introcuded-configure_desktop_changed.patch +++ /dev/null @@ -1,74 +0,0 @@ -index 5b1f12f0..dd0997aa 100644 ---- a/ivi-shell/ivi-layout-export.h -+++ b/ivi-shell/ivi-layout-export.h -@@ -187,6 +187,16 @@ struct ivi_layout_interface { - */ - int32_t (*add_listener_configure_surface)(struct wl_listener *listener); - -+ /** -+ * \brief add a listener for notification when desktop_surface is configured -+ * -+ * When an desktop_surface is configured, a signal is emitted -+ * to the listening controller plugins. -+ * The pointer of the configured desktop_surface is sent as the void *data argument -+ * to the wl_listener::notify callback function of the listener. -+ */ -+ int32_t (*add_listener_configure_desktop_surface)(struct wl_listener *listener); -+ - /** - * \brief Get all ivi_surfaces which are currently registered and managed - * by the services -diff --git a/ivi-shell/ivi-layout-private.h b/ivi-shell/ivi-layout-private.h -index 2b8bd472..fe5be01a 100644 ---- a/ivi-shell/ivi-layout-private.h -+++ b/ivi-shell/ivi-layout-private.h -@@ -104,6 +104,7 @@ struct ivi_layout { - struct wl_signal created; - struct wl_signal removed; - struct wl_signal configure_changed; -+ struct wl_signal configure_desktop_changed; - } surface_notification; - - struct weston_layer layout_layer; -diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c -index fa8e75f6..690af742 100644 ---- a/ivi-shell/ivi-layout.c -+++ b/ivi-shell/ivi-layout.c -@@ -1040,6 +1040,21 @@ ivi_layout_add_listener_configure_surface(struct wl_listener *listener) - return IVI_SUCCEEDED; - } - -+static int32_t -+ivi_layout_add_listener_configure_desktop_surface(struct wl_listener *listener) -+{ -+ struct ivi_layout *layout = get_instance(); -+ -+ if (!listener) { -+ weston_log("ivi_layout_add_listener_configure_desktop_surface: invalid argument\n"); -+ return IVI_FAILED; -+ } -+ -+ wl_signal_add(&layout->surface_notification.configure_desktop_changed, listener); -+ -+ return IVI_SUCCEEDED; -+} -+ - uint32_t - ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf) - { -@@ -2057,6 +2072,7 @@ ivi_layout_init_with_compositor(struct weston_compositor *ec) - wl_signal_init(&layout->surface_notification.created); - wl_signal_init(&layout->surface_notification.removed); - wl_signal_init(&layout->surface_notification.configure_changed); -+ wl_signal_init(&layout->surface_notification.configure_desktop_changed); - - /* Add layout_layer at the last of weston_compositor.layer_list */ - weston_layer_init(&layout->layout_layer, ec); -@@ -2081,6 +2097,7 @@ static struct ivi_layout_interface ivi_layout_interface = { - .add_listener_create_surface = ivi_layout_add_listener_create_surface, - .add_listener_remove_surface = ivi_layout_add_listener_remove_surface, - .add_listener_configure_surface = ivi_layout_add_listener_configure_surface, -+ .add_listener_configure_desktop_surface = ivi_layout_add_listener_configure_desktop_surface, - .get_surface = shell_get_ivi_layout_surface, - .get_surfaces = ivi_layout_get_surfaces, - .get_id_of_surface = ivi_layout_get_id_of_surface, diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0006-ivi-layout-introcuded-surface_create_and_configure.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0006-ivi-layout-introcuded-surface_create_and_configure.patch deleted file mode 100644 index 04461a1d..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0006-ivi-layout-introcuded-surface_create_and_configure.patch +++ /dev/null @@ -1,117 +0,0 @@ -index 68ca68ba..c86cbb11 100644 ---- a/ivi-shell/ivi-layout-shell.h -+++ b/ivi-shell/ivi-layout-shell.h -@@ -39,6 +39,14 @@ struct weston_view; - struct weston_surface; - struct ivi_layout_surface; - -+void -+ivi_layout_desktop_surface_configure(struct ivi_layout_surface *ivisurf, -+ int32_t width, int32_t height); -+ -+struct ivi_layout_surface* -+ivi_layout_desktop_surface_create(struct weston_surface *wl_surface, -+ uint32_t id_surface); -+ - void - ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf, - int32_t width, int32_t height); -diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c -index 690af742..086d0fd2 100644 ---- a/ivi-shell/ivi-layout.c -+++ b/ivi-shell/ivi-layout.c -@@ -1995,20 +1995,8 @@ ivi_layout_surface_dump(struct weston_surface *surface, - * methods of interaction between ivi-shell with ivi-layout - */ - --void --ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf, -- int32_t width, int32_t height) --{ -- struct ivi_layout *layout = get_instance(); -- -- /* emit callback which is set by ivi-layout api user */ -- wl_signal_emit(&layout->surface_notification.configure_changed, -- ivisurf); --} -- --struct ivi_layout_surface* --ivi_layout_surface_create(struct weston_surface *wl_surface, -- uint32_t id_surface) -+static struct ivi_layout_surface* -+surface_create(struct weston_surface *wl_surface, uint32_t id_surface) - { - struct ivi_layout *layout = get_instance(); - struct ivi_layout_surface *ivisurf = NULL; -@@ -2018,14 +2006,6 @@ ivi_layout_surface_create(struct weston_surface *wl_surface, - return NULL; - } - -- ivisurf = get_surface(&layout->surface_list, id_surface); -- if (ivisurf != NULL) { -- if (ivisurf->surface != NULL) { -- weston_log("id_surface(%d) is already created\n", id_surface); -- return NULL; -- } -- } -- - ivisurf = calloc(1, sizeof *ivisurf); - if (ivisurf == NULL) { - weston_log("fails to allocate memory\n"); -@@ -2049,7 +2029,55 @@ ivi_layout_surface_create(struct weston_surface *wl_surface, - - wl_list_insert(&layout->surface_list, &ivisurf->link); - -- wl_signal_emit(&layout->surface_notification.created, ivisurf); -+ return ivisurf; -+} -+ -+void -+ivi_layout_desktop_surface_configure(struct ivi_layout_surface *ivisurf, -+ int32_t width, int32_t height) -+{ -+ struct ivi_layout *layout = get_instance(); -+ -+ /* emit callback which is set by ivi-layout api user */ -+ wl_signal_emit(&layout->surface_notification.configure_desktop_changed, -+ ivisurf); -+} -+ -+struct ivi_layout_surface* -+ivi_layout_desktop_surface_create(struct weston_surface *wl_surface, -+ uint32_t id_surface) -+{ -+ return surface_create(wl_surface, id_surface); -+} -+ -+void -+ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf, -+ int32_t width, int32_t height) -+{ -+ struct ivi_layout *layout = get_instance(); -+ -+ /* emit callback which is set by ivi-layout api user */ -+ wl_signal_emit(&layout->surface_notification.configure_changed, -+ ivisurf); -+} -+ -+struct ivi_layout_surface* -+ivi_layout_surface_create(struct weston_surface *wl_surface, -+ uint32_t id_surface) -+{ -+ struct ivi_layout *layout = get_instance(); -+ struct ivi_layout_surface *ivisurf = NULL; -+ -+ ivisurf = get_surface(&layout->surface_list, id_surface); -+ if (ivisurf) { -+ weston_log("id_surface(%d) is already created\n", id_surface); -+ return NULL; -+ } -+ -+ ivisurf = surface_create(wl_surface, id_surface); -+ -+ if (ivisurf) -+ wl_signal_emit(&layout->surface_notification.created, ivisurf); - - return ivisurf; - } diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0007-ivi-shell-linked-libweston-desktop-and-added-structs.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0007-ivi-shell-linked-libweston-desktop-and-added-structs.patch deleted file mode 100644 index 9286ba00..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0007-ivi-shell-linked-libweston-desktop-and-added-structs.patch +++ /dev/null @@ -1,74 +0,0 @@ -diff --git a/Makefile.am b/Makefile.am -index cdf82ab4..d990d400 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -993,6 +993,7 @@ ivi_shell_la_LDFLAGS = -module -avoid-version - ivi_shell_la_LIBADD = \ - libshared.la \ - libweston-@LIBWESTON_MAJOR@.la \ -+ libweston-desktop-@LIBWESTON_MAJOR@.la \ - $(COMPOSITOR_LIBS) - ivi_shell_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) - ivi_shell_la_SOURCES = \ -diff --git a/ivi-shell/ivi-layout-private.h b/ivi-shell/ivi-layout-private.h -index fe5be01a..c054130b 100644 ---- a/ivi-shell/ivi-layout-private.h -+++ b/ivi-shell/ivi-layout-private.h -@@ -30,6 +30,7 @@ - - #include "compositor.h" - #include "ivi-layout-export.h" -+#include "libweston-desktop/libweston-desktop.h" - - struct ivi_layout_view { - struct wl_list link; /* ivi_layout::view_list */ -@@ -52,6 +53,7 @@ struct ivi_layout_surface { - - struct ivi_layout *layout; - struct weston_surface *surface; -+ struct weston_desktop_surface *weston_desktop_surface; - - struct ivi_layout_surface_properties prop; - -diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c -index f3156d35..84db2c97 100644 ---- a/ivi-shell/ivi-shell.c -+++ b/ivi-shell/ivi-shell.c -@@ -44,7 +44,7 @@ - - #include "ivi-shell.h" - #include "ivi-application-server-protocol.h" --#include "ivi-layout-export.h" -+#include "ivi-layout-private.h" - #include "ivi-layout-shell.h" - #include "shared/helpers.h" - #include "compositor/weston.h" -@@ -271,6 +271,8 @@ application_surface_create(struct wl_client *client, - return; - } - -+ layout_surface->weston_desktop_surface = NULL; -+ - ivisurf = zalloc(sizeof *ivisurf); - if (ivisurf == NULL) { - wl_resource_post_no_memory(resource); -diff --git a/ivi-shell/ivi-shell.h b/ivi-shell/ivi-shell.h -index e35f75f2..be430853 100644 ---- a/ivi-shell/ivi-shell.h -+++ b/ivi-shell/ivi-shell.h -@@ -30,6 +30,7 @@ - #include - - #include "compositor.h" -+#include "libweston-desktop/libweston-desktop.h" - - struct ivi_shell - { -@@ -37,6 +38,7 @@ struct ivi_shell - - struct weston_compositor *compositor; - -+ struct weston_desktop *desktop; - struct wl_list ivi_surface_list; /* struct ivi_shell_surface::link */ - - struct text_backend *text_backend; diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0008-ivi-layout-use-libweston-desktop-api-for-views.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0008-ivi-layout-use-libweston-desktop-api-for-views.patch deleted file mode 100644 index e53a8c45..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0008-ivi-layout-use-libweston-desktop-api-for-views.patch +++ /dev/null @@ -1,30 +0,0 @@ -index 086d0fd2..6b854503 100644 ---- a/ivi-shell/ivi-layout.c -+++ b/ivi-shell/ivi-layout.c -@@ -153,7 +153,10 @@ ivi_view_destroy(struct ivi_layout_view *ivi_view) - wl_list_remove(&ivi_view->pending_link); - wl_list_remove(&ivi_view->order_link); - -- weston_view_destroy(ivi_view->view); -+ if (weston_surface_is_desktop_surface(ivi_view->ivisurf->surface)) -+ weston_desktop_surface_unlink_view(ivi_view->view); -+ else -+ weston_view_destroy(ivi_view->view); - - free(ivi_view); - } -@@ -170,7 +173,13 @@ ivi_view_create(struct ivi_layout_layer *ivilayer, - return NULL; - } - -- ivi_view->view = weston_view_create(ivisurf->surface); -+ if (weston_surface_is_desktop_surface(ivisurf->surface)) { -+ ivi_view->view = weston_desktop_surface_create_view( -+ ivisurf->weston_desktop_surface); -+ } else { -+ ivi_view->view = weston_view_create(ivisurf->surface); -+ } -+ - if (ivi_view->view == NULL) { - weston_log("fails to allocate memory\n"); - free(ivi_view); diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0009-ivi-shell-added-libweston-desktop-api_implementation.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0009-ivi-shell-added-libweston-desktop-api_implementation.patch deleted file mode 100644 index 6a72f15d..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0009-ivi-shell-added-libweston-desktop-api_implementation.patch +++ /dev/null @@ -1,166 +0,0 @@ -index 84db2c97..e797e4f9 100644 ---- a/ivi-shell/ivi-shell.c -+++ b/ivi-shell/ivi-shell.c -@@ -489,6 +489,162 @@ shell_add_bindings(struct weston_compositor *compositor, - shell); - } - -+/* -+ * libweston-desktop -+ */ -+ -+static void -+desktop_surface_ping_timeout(struct weston_desktop_client *client, -+ void *user_data) -+{ -+ weston_log("ivi-shell: desktop_surface_ping_timeout is not supported\n"); -+} -+ -+static void -+desktop_surface_pong(struct weston_desktop_client *client, -+ void *user_data) -+{ -+ weston_log("ivi-shell: desktop_surface_pong is not supported\n"); -+} -+ -+static void -+desktop_surface_added(struct weston_desktop_surface *surface, -+ void *user_data) -+{ -+ struct ivi_shell *shell = (struct ivi_shell *) user_data; -+ struct ivi_layout_surface *layout_surface; -+ struct ivi_shell_surface *ivisurf; -+ struct weston_surface *weston_surf = -+ weston_desktop_surface_get_surface(surface); -+ -+ layout_surface = ivi_layout_desktop_surface_create(weston_surf, -+ IVI_INVALID_ID); -+ if (!layout_surface) { -+ return; -+ } -+ -+ layout_surface->weston_desktop_surface = surface; -+ -+ ivisurf = zalloc(sizeof *ivisurf); -+ if (!ivisurf) { -+ return; -+ } -+ -+ ivisurf->shell = shell; -+ ivisurf->id_surface = IVI_INVALID_ID; -+ -+ ivisurf->width = 0; -+ ivisurf->height = 0; -+ ivisurf->layout_surface = layout_surface; -+ ivisurf->surface = weston_surf; -+ -+ weston_desktop_surface_set_user_data(surface, ivisurf); -+} -+ -+static void -+desktop_surface_removed(struct weston_desktop_surface *surface, -+ void *user_data) -+{ -+ struct ivi_shell_surface *ivisurf = (struct ivi_shell_surface *) -+ weston_desktop_surface_get_user_data(surface); -+ -+ assert(ivisurf != NULL); -+ -+ if (ivisurf->layout_surface) -+ layout_surface_cleanup(ivisurf); -+} -+ -+static void -+desktop_surface_committed(struct weston_desktop_surface *surface, -+ int32_t sx, int32_t sy, void *user_data) -+{ -+ struct ivi_shell_surface *ivisurf = (struct ivi_shell_surface *) -+ weston_desktop_surface_get_user_data(surface); -+ struct weston_surface *weston_surf = -+ weston_desktop_surface_get_surface(surface); -+ -+ if(!ivisurf) -+ return; -+ -+ if (weston_surf->width == 0 || weston_surf->height == 0) -+ return; -+ -+ if (ivisurf->width != weston_surf->width || -+ ivisurf->height != weston_surf->height) { -+ ivisurf->width = weston_surf->width; -+ ivisurf->height = weston_surf->height; -+ -+ ivi_layout_desktop_surface_configure(ivisurf->layout_surface, -+ weston_surf->width, -+ weston_surf->height); -+ } -+} -+ -+static void -+desktop_surface_move(struct weston_desktop_surface *surface, -+ struct weston_seat *seat, uint32_t serial, void *user_data) -+{ -+ weston_log("ivi-shell: desktop_surface_move is not supported\n"); -+} -+ -+static void -+desktop_surface_resize(struct weston_desktop_surface *surface, -+ struct weston_seat *seat, uint32_t serial, -+ enum weston_desktop_surface_edge edges, void *user_data) -+{ -+ weston_log("ivi-shell: desktop_surface_resize is not supported\n"); -+} -+ -+static void -+desktop_surface_fullscreen_requested(struct weston_desktop_surface *surface, -+ bool fullscreen, -+ struct weston_output *output, -+ void *user_data) -+{ -+ weston_log("ivi-shell: desktop_surface_fullscreen_requested is not supported\n"); -+} -+ -+static void -+desktop_surface_maximized_requested(struct weston_desktop_surface *surface, -+ bool maximized, void *user_data) -+{ -+ weston_log("ivi-shell: desktop_surface_maximized_requested is not supported\n"); -+} -+ -+static void -+desktop_surface_minimized_requested(struct weston_desktop_surface *surface, -+ void *user_data) -+{ -+ weston_log("ivi-shell: desktop_surface_minimized_requested is not supported\n"); -+} -+ -+static void -+desktop_surface_set_xwayland_position(struct weston_desktop_surface *surface, -+ int32_t x, int32_t y, void *user_data) -+{ -+ weston_log("ivi-shell: desktop_surface_set_xwayland_position is not supported\n"); -+} -+ -+static const struct weston_desktop_api shell_desktop_api = { -+ .struct_size = sizeof(struct weston_desktop_api), -+ .ping_timeout = desktop_surface_ping_timeout, -+ .pong = desktop_surface_pong, -+ .surface_added = desktop_surface_added, -+ .surface_removed = desktop_surface_removed, -+ .committed = desktop_surface_committed, -+ -+ .move = desktop_surface_move, -+ .resize = desktop_surface_resize, -+ .fullscreen_requested = desktop_surface_fullscreen_requested, -+ .maximized_requested = desktop_surface_maximized_requested, -+ .minimized_requested = desktop_surface_minimized_requested, -+ .set_xwayland_position = desktop_surface_set_xwayland_position, -+}; -+ -+/* -+ * end of libweston-desktop -+ */ -+ - /* - * Initialization of ivi-shell. - */ diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0010-ivi-shell-remove-surface_destroy_listener.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0010-ivi-shell-remove-surface_destroy_listener.patch deleted file mode 100644 index b76c35d4..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0010-ivi-shell-remove-surface_destroy_listener.patch +++ /dev/null @@ -1,24 +0,0 @@ -index e797e4f9..5f64e72d 100644 ---- a/ivi-shell/ivi-shell.c -+++ b/ivi-shell/ivi-shell.c -@@ -162,6 +162,10 @@ layout_surface_cleanup(struct ivi_shell_surface *ivisurf) - { - assert(ivisurf->layout_surface != NULL); - -+ /* destroy weston_surface destroy signal. */ -+ if (!ivisurf->layout_surface->weston_desktop_surface) -+ wl_list_remove(&ivisurf->surface_destroy_listener.link); -+ - ivi_layout_surface_destroy(ivisurf->layout_surface); - ivisurf->layout_surface = NULL; - -@@ -169,9 +173,6 @@ layout_surface_cleanup(struct ivi_shell_surface *ivisurf) - ivisurf->surface->committed_private = NULL; - weston_surface_set_label_func(ivisurf->surface, NULL); - ivisurf->surface = NULL; -- -- // destroy weston_surface destroy signal. -- wl_list_remove(&ivisurf->surface_destroy_listener.link); - } - - /* diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0011-ivi-shell-create-weston-desktop-in_wet_shell_init.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0011-ivi-shell-create-weston-desktop-in_wet_shell_init.patch deleted file mode 100644 index f6256f78..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0011-ivi-shell-create-weston-desktop-in_wet_shell_init.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c -index b0a2a2b9..a889afdb 100644 ---- a/ivi-shell/ivi-shell.c -+++ b/ivi-shell/ivi-shell.c -@@ -664,10 +664,14 @@ wet_shell_init(struct weston_compositor *compositor, - if (!shell->text_backend) - goto err_shell; - -+ shell->desktop = weston_desktop_create(compositor, &shell_desktop_api, shell); -+ if (!shell->desktop) -+ goto err_text_backend; -+ - if (wl_global_create(compositor->wl_display, - &ivi_application_interface, 1, - shell, bind_ivi_application) == NULL) -- goto err_text_backend; -+ goto err_desktop; - - ivi_layout_init_with_compositor(compositor); - /* TODO ivi_layout_destroy should be implemented, since multiple lists -@@ -676,6 +680,9 @@ wet_shell_init(struct weston_compositor *compositor, - - return IVI_SUCCEEDED; - -+err_desktop: -+ weston_desktop_destroy(shell->desktop); -+ - err_text_backend: - text_backend_destroy(shell->text_backend); - diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0012-hmi-controller-register-for-desktop_surface_configured.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0012-hmi-controller-register-for-desktop_surface_configured.patch deleted file mode 100644 index 447cff4f..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0012-hmi-controller-register-for-desktop_surface_configured.patch +++ /dev/null @@ -1,133 +0,0 @@ -diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c -index a0e49ba0..340d1915 100644 ---- a/ivi-shell/hmi-controller.c -+++ b/ivi-shell/hmi-controller.c -@@ -129,9 +129,9 @@ struct hmi_controller { - struct weston_compositor *compositor; - struct wl_listener destroy_listener; - -- struct wl_listener surface_created; - struct wl_listener surface_removed; - struct wl_listener surface_configured; -+ struct wl_listener desktop_surface_configured; - - struct wl_client *user_interface; - struct ui_setting ui_setting; -@@ -576,28 +576,6 @@ create_layer(struct weston_output *output, - /** - * Internal set notification - */ --static void --set_notification_create_surface(struct wl_listener *listener, void *data) --{ -- struct hmi_controller *hmi_ctrl = -- wl_container_of(listener, hmi_ctrl, -- surface_created); -- struct ivi_layout_surface *ivisurf = data; -- struct hmi_controller_layer *layer_link = -- wl_container_of(hmi_ctrl->application_layer_list.prev, -- layer_link, -- link); -- struct ivi_layout_layer *application_layer = layer_link->ivilayer; -- int32_t ret = 0; -- -- /* skip ui widgets */ -- if (is_surf_in_ui_widget(hmi_ctrl, ivisurf)) -- return; -- -- ret = hmi_ctrl->interface->layer_add_surface(application_layer, ivisurf); -- assert(!ret); --} -- - static void - set_notification_remove_surface(struct wl_listener *listener, void *data) - { -@@ -665,6 +643,42 @@ set_notification_configure_surface(struct wl_listener *listener, void *data) - switch_mode(hmi_ctrl, hmi_ctrl->layout_mode); - } - -+static void -+set_notification_configure_desktop_surface(struct wl_listener *listener, void *data) -+{ -+ struct hmi_controller *hmi_ctrl = -+ wl_container_of(listener, hmi_ctrl, -+ desktop_surface_configured); -+ struct ivi_layout_surface *ivisurf = data; -+ struct hmi_controller_layer *layer_link = -+ wl_container_of(hmi_ctrl->application_layer_list.prev, -+ layer_link, -+ link); -+ struct ivi_layout_layer *application_layer = layer_link->ivilayer; -+ struct weston_surface *surface; -+ int32_t ret = 0; -+ -+ /* skip ui widgets */ -+ if (is_surf_in_ui_widget(hmi_ctrl, ivisurf)) -+ return; -+ -+ ret = hmi_ctrl->interface->layer_add_surface(application_layer, ivisurf); -+ assert(!ret); -+ -+ /* -+ * if application changes size of wl_buffer. The source rectangle shall be -+ * fit to the size. -+ */ -+ surface = hmi_ctrl->interface->surface_get_weston_surface(ivisurf); -+ if (surface) { -+ hmi_ctrl->interface->surface_set_source_rectangle(ivisurf, 0, -+ 0, surface->width, surface->height); -+ } -+ -+ hmi_ctrl->interface->commit_changes(); -+ switch_mode(hmi_ctrl, hmi_ctrl->layout_mode); -+} -+ - /** - * A hmi_controller used 4 ivi_layers to manage ivi_surfaces. The IDs of - * corresponding ivi_layer are defined in weston.ini. Default scene graph -@@ -868,6 +882,9 @@ hmi_controller_create(struct weston_compositor *ec) - hmi_ctrl->surface_configured.notify = set_notification_configure_surface; - hmi_ctrl->interface->add_listener_configure_surface(&hmi_ctrl->surface_configured); - -+ hmi_ctrl->desktop_surface_configured.notify = set_notification_configure_desktop_surface; -+ hmi_ctrl->interface->add_listener_configure_desktop_surface(&hmi_ctrl->desktop_surface_configured); -+ - hmi_ctrl->destroy_listener.notify = hmi_controller_destroy; - wl_signal_add(&hmi_ctrl->compositor->destroy_signal, - &hmi_ctrl->destroy_listener); -@@ -1289,12 +1306,6 @@ ivi_hmi_controller_UI_ready(struct wl_client *client, - - ivi_hmi_controller_add_launchers(hmi_ctrl, 256); - -- /* Add surface_created listener after the initialization of launchers. -- * Otherwise, surfaces of the launchers will be added to application -- * layer too.*/ -- hmi_ctrl->surface_created.notify = set_notification_create_surface; -- hmi_ctrl->interface->add_listener_create_surface(&hmi_ctrl->surface_created); -- - hmi_ctrl->is_initialized = 1; - } - -diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c -index b06bf309..ef354d49 100644 ---- a/ivi-shell/ivi-layout.c -+++ b/ivi-shell/ivi-layout.c -@@ -715,9 +715,15 @@ commit_surface_list(struct ivi_layout *layout) - ivisurf->pending.prop.transition_type = IVI_LAYOUT_TRANSITION_NONE; - - if (configured && !is_surface_transition(ivisurf)) { -- shell_surface_send_configure(ivisurf->surface, -- ivisurf->prop.dest_width, -- ivisurf->prop.dest_height); -+ if (ivisurf->weston_desktop_surface) { -+ weston_desktop_surface_set_size(ivisurf->weston_desktop_surface, -+ ivisurf->prop.dest_width, -+ ivisurf->prop.dest_height); -+ } else { -+ shell_surface_send_configure(ivisurf->surface, -+ ivisurf->prop.dest_width, -+ ivisurf->prop.dest_height); -+ } - } - } else { - configured = 0; diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0013-simple-egl-remove-ivi-application-support.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0013-simple-egl-remove-ivi-application-support.patch deleted file mode 100644 index 036b14cb..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0013-simple-egl-remove-ivi-application-support.patch +++ /dev/null @@ -1,165 +0,0 @@ -diff --git a/Makefile.am b/Makefile.am -index 17c053e6..e0d3cb78 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -609,9 +609,7 @@ demo_clients += weston-simple-egl - weston_simple_egl_SOURCES = clients/simple-egl.c - nodist_weston_simple_egl_SOURCES = \ - protocol/xdg-shell-unstable-v6-protocol.c \ -- protocol/xdg-shell-unstable-v6-client-protocol.h \ -- protocol/ivi-application-protocol.c \ -- protocol/ivi-application-client-protocol.h -+ protocol/xdg-shell-unstable-v6-client-protocol.h - weston_simple_egl_CFLAGS = $(AM_CFLAGS) $(SIMPLE_EGL_CLIENT_CFLAGS) - weston_simple_egl_LDADD = $(SIMPLE_EGL_CLIENT_LIBS) -lm - endif -diff --git a/clients/simple-egl.c b/clients/simple-egl.c -index a1e57aef..936e015e 100644 ---- a/clients/simple-egl.c -+++ b/clients/simple-egl.c -@@ -45,8 +45,6 @@ - #include "xdg-shell-unstable-v6-client-protocol.h" - #include - #include --#include "ivi-application-client-protocol.h" --#define IVI_SURFACE_ID 9000 - - #include "shared/helpers.h" - #include "shared/platform.h" -@@ -74,7 +72,6 @@ struct display { - EGLConfig conf; - } egl; - struct window *window; -- struct ivi_application *ivi_application; - - PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC swap_buffers_with_damage; - }; -@@ -97,7 +94,6 @@ struct window { - struct wl_surface *surface; - struct zxdg_surface_v6 *xdg_surface; - struct zxdg_toplevel_v6 *xdg_toplevel; -- struct ivi_surface *ivi_surface; - EGLSurface egl_surface; - struct wl_callback *callback; - int fullscreen, maximized, opaque, buffer_size, frame_sync, delay; -@@ -359,27 +355,22 @@ static const struct zxdg_toplevel_v6_listener xdg_toplevel_listener = { - }; - - static void --handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface, -- int32_t width, int32_t height) -+create_surface(struct window *window) - { -- struct window *window = data; -- -- wl_egl_window_resize(window->native, width, height, 0, 0); -- -- window->geometry.width = width; -- window->geometry.height = height; -+ struct display *display = window->display; -+ EGLBoolean ret; - -- if (!window->fullscreen) -- window->window_size = window->geometry; --} -+ window->surface = wl_compositor_create_surface(display->compositor); - --static const struct ivi_surface_listener ivi_surface_listener = { -- handle_ivi_surface_configure, --}; -+ window->native = -+ wl_egl_window_create(window->surface, -+ window->geometry.width, -+ window->geometry.height); -+ window->egl_surface = -+ weston_platform_create_egl_surface(display->egl.dpy, -+ display->egl.conf, -+ window->native, NULL); - --static void --create_xdg_surface(struct window *window, struct display *display) --{ - window->xdg_surface = zxdg_shell_v6_get_xdg_surface(display->shell, - window->surface); - zxdg_surface_v6_add_listener(window->xdg_surface, -@@ -394,50 +385,6 @@ create_xdg_surface(struct window *window, struct display *display) - - window->wait_for_configure = true; - wl_surface_commit(window->surface); --} -- --static void --create_ivi_surface(struct window *window, struct display *display) --{ -- uint32_t id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid(); -- window->ivi_surface = -- ivi_application_surface_create(display->ivi_application, -- id_ivisurf, window->surface); -- -- if (window->ivi_surface == NULL) { -- fprintf(stderr, "Failed to create ivi_client_surface\n"); -- abort(); -- } -- -- ivi_surface_add_listener(window->ivi_surface, -- &ivi_surface_listener, window); --} -- --static void --create_surface(struct window *window) --{ -- struct display *display = window->display; -- EGLBoolean ret; -- -- window->surface = wl_compositor_create_surface(display->compositor); -- -- window->native = -- wl_egl_window_create(window->surface, -- window->geometry.width, -- window->geometry.height); -- window->egl_surface = -- weston_platform_create_egl_surface(display->egl.dpy, -- display->egl.conf, -- window->native, NULL); -- -- -- if (display->shell) { -- create_xdg_surface(window, display); -- } else if (display->ivi_application ) { -- create_ivi_surface(window, display); -- } else { -- assert(0); -- } - - ret = eglMakeCurrent(window->display->egl.dpy, window->egl_surface, - window->egl_surface, window->display->egl.ctx); -@@ -469,8 +416,6 @@ destroy_surface(struct window *window) - zxdg_toplevel_v6_destroy(window->xdg_toplevel); - if (window->xdg_surface) - zxdg_surface_v6_destroy(window->xdg_surface); -- if (window->display->ivi_application) -- ivi_surface_destroy(window->ivi_surface); - wl_surface_destroy(window->surface); - - if (window->callback) -@@ -825,10 +770,6 @@ registry_handle_global(void *data, struct wl_registry *registry, - fprintf(stderr, "unable to load default left pointer\n"); - // TODO: abort ? - } -- } else if (strcmp(interface, "ivi_application") == 0) { -- d->ivi_application = -- wl_registry_bind(registry, name, -- &ivi_application_interface, 1); - } - } - -@@ -943,9 +884,6 @@ main(int argc, char **argv) - if (display.shell) - zxdg_shell_v6_destroy(display.shell); - -- if (display.ivi_application) -- ivi_application_destroy(display.ivi_application); -- - if (display.compositor) - wl_compositor_destroy(display.compositor); - diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0014-simple-shm-remove-ivi-application-support.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0014-simple-shm-remove-ivi-application-support.patch deleted file mode 100644 index 495e50ca..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0014-simple-shm-remove-ivi-application-support.patch +++ /dev/null @@ -1,107 +0,0 @@ -index f9c8010b..c37cd00b 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -574,9 +574,7 @@ nodist_weston_simple_shm_SOURCES = \ - protocol/xdg-shell-unstable-v6-protocol.c \ - protocol/xdg-shell-unstable-v6-client-protocol.h \ - protocol/fullscreen-shell-unstable-v1-protocol.c \ -- protocol/fullscreen-shell-unstable-v1-client-protocol.h \ -- protocol/ivi-application-protocol.c \ -- protocol/ivi-application-client-protocol.h -+ protocol/fullscreen-shell-unstable-v1-client-protocol.h - weston_simple_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS) - weston_simple_shm_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la - -diff --git a/clients/simple-shm.c b/clients/simple-shm.c -index 9fa2e214..fc2ef001 100644 ---- a/clients/simple-shm.c -+++ b/clients/simple-shm.c -@@ -40,10 +40,6 @@ - #include "xdg-shell-unstable-v6-client-protocol.h" - #include "fullscreen-shell-unstable-v1-client-protocol.h" - --#include --#include "ivi-application-client-protocol.h" --#define IVI_SURFACE_ID 9000 -- - struct display { - struct wl_display *display; - struct wl_registry *registry; -@@ -52,7 +48,6 @@ struct display { - struct zwp_fullscreen_shell_v1 *fshell; - struct wl_shm *shm; - bool has_xrgb; -- struct ivi_application *ivi_application; - }; - - struct buffer { -@@ -67,7 +62,6 @@ struct window { - struct wl_surface *surface; - struct zxdg_surface_v6 *xdg_surface; - struct zxdg_toplevel_v6 *xdg_toplevel; -- struct ivi_surface *ivi_surface; - struct buffer buffers[2]; - struct buffer *prev_buffer; - struct wl_callback *callback; -@@ -165,17 +159,6 @@ static const struct zxdg_toplevel_v6_listener xdg_toplevel_listener = { - handle_xdg_toplevel_close, - }; - --static void --handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface, -- int32_t width, int32_t height) --{ -- /* Simple-shm is resizable */ --} -- --static const struct ivi_surface_listener ivi_surface_listener = { -- handle_ivi_surface_configure, --}; -- - static struct window * - create_window(struct display *display, int width, int height) - { -@@ -213,19 +196,6 @@ create_window(struct display *display, int width, int height) - window->surface, - ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_DEFAULT, - NULL); -- } else if (display->ivi_application ) { -- uint32_t id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid(); -- window->ivi_surface = -- ivi_application_surface_create(display->ivi_application, -- id_ivisurf, window->surface); -- if (window->ivi_surface == NULL) { -- fprintf(stderr, "Failed to create ivi_client_surface\n"); -- abort(); -- } -- -- ivi_surface_add_listener(window->ivi_surface, -- &ivi_surface_listener, window); -- - } else { - assert(0); - } -@@ -407,11 +377,6 @@ registry_handle_global(void *data, struct wl_registry *registry, - id, &wl_shm_interface, 1); - wl_shm_add_listener(d->shm, &shm_listener, d); - } -- else if (strcmp(interface, "ivi_application") == 0) { -- d->ivi_application = -- wl_registry_bind(registry, id, -- &ivi_application_interface, 1); -- } - } - - static void -@@ -555,11 +520,6 @@ main(int argc, char **argv) - - fprintf(stderr, "simple-shm exiting\n"); - -- if (window->display->ivi_application) { -- ivi_surface_destroy(window->ivi_surface); -- ivi_application_destroy(window->display->ivi_application); -- } -- - destroy_window(window); - destroy_display(display); - diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0015-window-client-remove-ivi-application-support.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0015-window-client-remove-ivi-application-support.patch deleted file mode 100644 index f3d2fe47..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0015-window-client-remove-ivi-application-support.patch +++ /dev/null @@ -1,130 +0,0 @@ -index c37cd00b..f30ddbe9 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -665,8 +665,6 @@ nodist_libtoytoolkit_la_SOURCES = \ - protocol/viewporter-client-protocol.h \ - protocol/xdg-shell-unstable-v6-protocol.c \ - protocol/xdg-shell-unstable-v6-client-protocol.h \ -- protocol/ivi-application-protocol.c \ -- protocol/ivi-application-client-protocol.h \ - protocol/pointer-constraints-unstable-v1-protocol.c \ - protocol/pointer-constraints-unstable-v1-client-protocol.h \ - protocol/relative-pointer-unstable-v1-protocol.c \ -diff --git a/clients/window.c b/clients/window.c -index 95796d46..aac43abd 100644 ---- a/clients/window.c -+++ b/clients/window.c -@@ -82,10 +82,6 @@ typedef void *EGLContext; - - #include "window.h" - --#include --#include "ivi-application-client-protocol.h" --#define IVI_SURFACE_ID 9000 -- - #define ZWP_RELATIVE_POINTER_MANAGER_V1_VERSION 1 - #define ZWP_POINTER_CONSTRAINTS_V1_VERSION 1 - -@@ -107,7 +103,6 @@ struct display { - struct wl_data_device_manager *data_device_manager; - struct text_cursor_position *text_cursor_position; - struct zxdg_shell_v6 *xdg_shell; -- struct ivi_application *ivi_application; /* ivi style shell */ - struct zwp_relative_pointer_manager_v1 *relative_pointer_manager; - struct zwp_pointer_constraints_v1 *pointer_constraints; - EGLDisplay dpy; -@@ -269,8 +264,6 @@ struct window { - struct window *parent; - struct window *last_parent; - -- struct ivi_surface *ivi_surface; -- - struct window_frame *frame; - - /* struct surface::link, contains also main_surface */ -@@ -1441,19 +1434,6 @@ window_get_display(struct window *window) - return window->display; - } - --static void --handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface, -- int32_t width, int32_t height) --{ -- struct window *window = data; -- -- window_schedule_resize(window, width, height); --} -- --static const struct ivi_surface_listener ivi_surface_listener = { -- handle_ivi_surface_configure, --}; -- - static void - surface_create_surface(struct surface *surface, uint32_t flags) - { -@@ -1604,9 +1584,6 @@ window_destroy(struct window *window) - if (window->xdg_surface) - zxdg_surface_v6_destroy(window->xdg_surface); - -- if (window->ivi_surface) -- ivi_surface_destroy(window->ivi_surface); -- - surface_destroy(window->main_surface); - - wl_list_remove(&window->link); -@@ -5200,7 +5177,7 @@ window_create_internal(struct display *display, int custom) - surface = surface_create(window); - window->main_surface = surface; - -- assert(custom || display->xdg_shell || display->ivi_application); -+ assert(custom || display->xdg_shell); - - window->custom = custom; - window->preferred_format = WINDOW_PREFERRED_FORMAT_NONE; -@@ -5220,7 +5197,6 @@ struct window * - window_create(struct display *display) - { - struct window *window; -- uint32_t id_ivisurf; - - window = window_create_internal(display, 0); - -@@ -5243,16 +5219,6 @@ window_create(struct display *display) - window_inhibit_redraw(window); - - wl_surface_commit(window->main_surface->surface); -- } else if (display->ivi_application) { -- /* auto generation of ivi_id based on process id + basement of id */ -- id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid(); -- window->ivi_surface = -- ivi_application_surface_create(display->ivi_application, -- id_ivisurf, window->main_surface->surface); -- fail_on_null(window->ivi_surface, 0, __FILE__, __LINE__); -- -- ivi_surface_add_listener(window->ivi_surface, -- &ivi_surface_listener, window); - } - - return window; -@@ -6013,11 +5979,6 @@ registry_handle_global(void *data, struct wl_registry *registry, uint32_t id, - wl_registry_bind(registry, id, - &wl_subcompositor_interface, 1); - } -- else if (strcmp(interface, "ivi_application") == 0) { -- d->ivi_application = -- wl_registry_bind(registry, id, -- &ivi_application_interface, 1); -- } - - if (d->global_handler) - d->global_handler(d, id, interface, version, d->user_data); -@@ -6316,9 +6277,6 @@ display_destroy(struct display *display) - if (display->xdg_shell) - zxdg_shell_v6_destroy(display->xdg_shell); - -- if (display->ivi_application) -- ivi_application_destroy(display->ivi_application); -- - if (display->shm) - wl_shm_destroy(display->shm); - diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0016-compositor-add-output-type-to-weston_output.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0016-compositor-add-output-type-to-weston_output.patch deleted file mode 100644 index 6b93b06e..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0016-compositor-add-output-type-to-weston_output.patch +++ /dev/null @@ -1,254 +0,0 @@ -From 8ea60075d5310101bebedf09c94902e9d41432ac Mon Sep 17 00:00:00 2001 -From: Veeresh Kadasani -Date: Mon, 29 Jul 2019 17:04:12 +0900 -Subject: [PATCH 1/3] compositor: add output type to weston_output - -This enables weston to use multiple types of backend -Each backends have own output structure for each functions -To avoid invalid member access, type identifier is needed - -Signed-off-by: Veeresh Kadasani ---- - libweston/compositor-drm.c | 78 +++++++++++++++++++++++------------------ - libweston/compositor-fbdev.c | 2 +- - libweston/compositor-headless.c | 2 +- - libweston/compositor-rdp.c | 2 +- - libweston/compositor-wayland.c | 2 +- - libweston/compositor-x11.c | 2 +- - libweston/compositor.h | 12 ++++++- - 7 files changed, 60 insertions(+), 40 deletions(-) - -diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c -index 3891176..26a480c 100644 ---- a/libweston/compositor-drm.c -+++ b/libweston/compositor-drm.c -@@ -843,8 +843,9 @@ drm_output_find_by_crtc(struct drm_backend *b, uint32_t crtc_id) - struct drm_output *output; - - wl_list_for_each(output, &b->compositor->output_list, base.link) { -- if (output->crtc_id == crtc_id) -- return output; -+ if(output->base.output_type == OUTPUT_DRM) -+ if (output->crtc_id == crtc_id) -+ return output; - } - - return NULL; -@@ -859,7 +860,8 @@ drm_head_find_by_connector(struct drm_backend *backend, uint32_t connector_id) - wl_list_for_each(base, - &backend->compositor->head_list, compositor_link) { - head = to_drm_head(base); -- if (head->connector_id == connector_id) -+ if(base->output->output_type == OUTPUT_DRM) -+ if (head->connector_id == connector_id) - return head; - } - -@@ -5728,6 +5730,7 @@ drm_output_enable(struct weston_output *base) - drmModeRes *resources; - int ret; - -+ output->base.output_type = OUTPUT_DRM; - resources = drmModeGetResources(b->drm.fd); - if (!resources) { - weston_log("drmModeGetResources failed\n"); -@@ -6188,23 +6191,25 @@ drm_backend_update_heads(struct drm_backend *b, struct udev_device *drm_device) - /* Remove connectors that have disappeared. */ - wl_list_for_each_safe(base, next, - &b->compositor->head_list, compositor_link) { -- bool removed = true; -+ if (base->output->output_type == OUTPUT_DRM) { -+ bool removed = true; - -- head = to_drm_head(base); -+ head = to_drm_head(base); - -- for (i = 0; i < resources->count_connectors; i++) { -- if (resources->connectors[i] == head->connector_id) { -- removed = false; -- break; -- } -- } -+ for (i = 0; i < resources->count_connectors; i++) { -+ if (resources->connectors[i] == head->connector_id) { -+ removed = false; -+ break; -+ } -+ } - -- if (!removed) -- continue; -+ if (!removed) -+ continue; - -- weston_log("DRM: head '%s' (connector %d) disappeared.\n", -- head->base.name, head->connector_id); -- drm_head_destroy(head); -+ weston_log("DRM: head '%s' (connector %d) disappeared.\n", -+ head->base.name, head->connector_id); -+ drm_head_destroy(head); -+ } - } - - drm_backend_update_unused_outputs(b, resources); -@@ -6309,23 +6314,26 @@ session_notify(struct wl_listener *listener, void *data) - * pending frame callbacks. */ - - wl_list_for_each(output, &compositor->output_list, base.link) { -- output->base.repaint_needed = false; -- if (output->cursor_plane) -- drmModeSetCursor(b->drm.fd, output->crtc_id, -- 0, 0, 0); -+ if(output->base.output_type == OUTPUT_DRM) { -+ output->base.repaint_needed = false; -+ if (output->cursor_plane) -+ drmModeSetCursor(b->drm.fd, output->crtc_id, -+ 0, 0, 0); -+ } - } -- -- output = container_of(compositor->output_list.next, -- struct drm_output, base.link); -- -- wl_list_for_each(plane, &b->plane_list, link) { -- if (plane->type != WDRM_PLANE_TYPE_OVERLAY) -- continue; -- -- drmModeSetPlane(b->drm.fd, -- plane->plane_id, -- output->crtc_id, 0, 0, -- 0, 0, 0, 0, 0, 0, 0, 0); -+ if(output->base.output_type == OUTPUT_DRM) { -+ output = container_of(compositor->output_list.next, -+ struct drm_output, base.link); -+ -+ wl_list_for_each(plane, &b->plane_list, link) { -+ if (plane->type != WDRM_PLANE_TYPE_OVERLAY) -+ continue; -+ -+ drmModeSetPlane(b->drm.fd, -+ plane->plane_id, -+ output->crtc_id, 0, 0, -+ 0, 0, 0, 0, 0, 0, 0, 0); -+ } - } - } - } -@@ -6649,7 +6657,8 @@ switch_to_gl_renderer(struct drm_backend *b) - } - - wl_list_for_each(output, &b->compositor->output_list, base.link) -- pixman_renderer_output_destroy(&output->base); -+ if(output->base.output_type == OUTPUT_DRM) -+ pixman_renderer_output_destroy(&output->base); - - b->compositor->renderer->destroy(b->compositor); - -@@ -6661,7 +6670,8 @@ switch_to_gl_renderer(struct drm_backend *b) - } - - wl_list_for_each(output, &b->compositor->output_list, base.link) -- drm_output_init_egl(output, b); -+ if(output->base.output_type == OUTPUT_DRM) -+ drm_output_init_egl(output, b); - - b->use_pixman = 0; - -diff --git a/libweston/compositor-fbdev.c b/libweston/compositor-fbdev.c -index a71b7bd..8edb50b 100644 ---- a/libweston/compositor-fbdev.c -+++ b/libweston/compositor-fbdev.c -@@ -501,7 +501,7 @@ fbdev_output_enable(struct weston_output *base) - struct fbdev_head *head; - int fb_fd; - struct wl_event_loop *loop; -- -+ output->base.output_type = OUTPUT_FBDEV; - head = fbdev_output_get_head(output); - - /* Create the frame buffer. */ -diff --git a/libweston/compositor-headless.c b/libweston/compositor-headless.c -index 61a5bd9..f633cd7 100644 ---- a/libweston/compositor-headless.c -+++ b/libweston/compositor-headless.c -@@ -159,7 +159,7 @@ headless_output_enable(struct weston_output *base) - loop = wl_display_get_event_loop(b->compositor->wl_display); - output->finish_frame_timer = - wl_event_loop_add_timer(loop, finish_frame_handler, output); -- -+ output->base.output_type = OUTPUT_HEADLESS; - if (b->use_pixman) { - output->image_buf = malloc(output->base.current_mode->width * - output->base.current_mode->height * 4); -diff --git a/libweston/compositor-rdp.c b/libweston/compositor-rdp.c -index 134e729..429370c 100644 ---- a/libweston/compositor-rdp.c -+++ b/libweston/compositor-rdp.c -@@ -554,7 +554,7 @@ rdp_output_enable(struct weston_output *base) - struct rdp_output *output = to_rdp_output(base); - struct rdp_backend *b = to_rdp_backend(base->compositor); - struct wl_event_loop *loop; -- -+ output->base.output_type = OUTPUT_RDP; - output->shadow_surface = pixman_image_create_bits(PIXMAN_x8r8g8b8, - output->base.current_mode->width, - output->base.current_mode->height, -diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c -index e80ecc1..808fc8f 100644 ---- a/libweston/compositor-wayland.c -+++ b/libweston/compositor-wayland.c -@@ -1221,7 +1221,7 @@ wayland_output_enable(struct weston_output *base) - struct wayland_backend *b = to_wayland_backend(base->compositor); - enum mode_status mode_status; - int ret = 0; -- -+ output->base.output_type = OUTPUT_WAYLAND; - weston_log("Creating %dx%d wayland output at (%d, %d)\n", - output->base.current_mode->width, - output->base.current_mode->height, -diff --git a/libweston/compositor-x11.c b/libweston/compositor-x11.c -index 4a9d068..afbaa73 100644 ---- a/libweston/compositor-x11.c -+++ b/libweston/compositor-x11.c -@@ -933,7 +933,7 @@ x11_output_enable(struct weston_output *base) - XCB_EVENT_MASK_STRUCTURE_NOTIFY, - 0 - }; -- -+ output->base.output_type = OUTPUT_X11; - if (!b->no_input) - values[0] |= - XCB_EVENT_MASK_KEY_PRESS | -diff --git a/libweston/compositor.h b/libweston/compositor.h -index 8b7a102..60feda3 100644 ---- a/libweston/compositor.h -+++ b/libweston/compositor.h -@@ -169,6 +169,16 @@ enum dpms_enum { - WESTON_DPMS_OFF - }; - -+/* bit compatible with drm definitions. */ -+enum output_type { -+ OUTPUT_DRM, -+ OUTPUT_FBDEV, -+ OUTPUT_HEADLESS, -+ OUTPUT_RDP, -+ OUTPUT_WAYLAND, -+ OUTPUT_X11, -+ OUTPUT_WALTHAM -+}; - /** Represents a monitor - * - * This object represents a monitor (hardware backends like DRM) or a window -@@ -201,7 +211,7 @@ struct weston_head { - struct weston_output { - uint32_t id; - char *name; -- -+ enum output_type output_type; - /** Matches the lifetime from the user perspective */ - struct wl_signal user_destroy_signal; - --- -2.7.4 - diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0017-compositor-drm-introduce-drm_get_dmafd_from_view.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0017-compositor-drm-introduce-drm_get_dmafd_from_view.patch deleted file mode 100644 index 6fb963fb..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0017-compositor-drm-introduce-drm_get_dmafd_from_view.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 020508b35b2bf6c89d62961eb95e2f81d6381ab5 Mon Sep 17 00:00:00 2001 -From: Veeresh Kadasani -Date: Mon, 29 Jul 2019 17:07:00 +0900 -Subject: [PATCH 2/3] compositor-drm: introduce drm_get_dmafd_from_view - -This API enables to get dmafd from weston_view - -Signed-off-by: Veeresh Kadasani ---- - libweston/compositor-drm.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++ - libweston/compositor-drm.h | 7 ++++++ - 2 files changed, 64 insertions(+) - -diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c -index 26a480c..2b99db5 100644 ---- a/libweston/compositor-drm.c -+++ b/libweston/compositor-drm.c -@@ -5420,6 +5420,62 @@ drm_output_set_seat(struct weston_output *base, - } - - static int -+drm_get_dma_fd_from_view(struct weston_output *base, -+ struct weston_view *ev) -+{ -+ struct drm_backend *b = to_drm_backend(base->compositor); -+ struct weston_buffer *buffer = ev->surface->buffer_ref.buffer; -+ struct gbm_bo *bo; -+ struct drm_fb *current; -+ struct linux_dmabuf_buffer *dmabuf; -+ bool is_opaque = drm_view_is_opaque(ev); -+ uint32_t format; -+ int fd, ret; -+ -+ if(!buffer) { -+ weston_log("buffer is NULL\n"); -+ return -1; -+ } -+ -+ if(dmabuf = linux_dmabuf_buffer_get(buffer->resource)) { -+ current = drm_fb_get_from_dmabuf(dmabuf, b, is_opaque); -+ if (!current) -+ { -+ fprintf(stderr, "failed to get drm_fb from dmabuf\n"); -+ return -1; -+ } -+ } -+ else if(ev->surface->buffer_ref.buffer->legacy_buffer) { -+ bo = gbm_bo_import(b->gbm, GBM_BO_IMPORT_WL_BUFFER, -+ buffer->resource, GBM_BO_USE_SCANOUT); -+ if (!bo) { -+ weston_log("failed to get gbm_bo\n"); -+ return -1; -+ } -+ current = drm_fb_get_from_bo(bo, b, is_opaque, BUFFER_CLIENT); -+ -+ if (!current) { -+ weston_log("failed to get drm_fb from bo\n"); -+ return -1; -+ } -+ -+ } -+ else { -+ weston_log("Buffer is not supported\n"); -+ return -1; -+ } -+ -+ ret = drmPrimeHandleToFD(b->drm.fd, current->handles[0], -+ DRM_CLOEXEC, &fd); -+ free(current); -+ if (ret) { -+ weston_log("failed to create prime fd for front buffer\n"); -+ return -1; -+ } -+ -+ return fd; -+} -+static int - drm_output_init_gamma_size(struct drm_output *output) - { - struct drm_backend *backend = to_drm_backend(output->base.compositor); -@@ -6696,6 +6752,7 @@ static const struct weston_drm_output_api api = { - drm_output_set_mode, - drm_output_set_gbm_format, - drm_output_set_seat, -+ drm_get_dma_fd_from_view, - }; - - static struct drm_backend * -diff --git a/libweston/compositor-drm.h b/libweston/compositor-drm.h -index 9c37c15..a82a2a9 100644 ---- a/libweston/compositor-drm.h -+++ b/libweston/compositor-drm.h -@@ -78,6 +78,13 @@ struct weston_drm_output_api { - */ - void (*set_seat)(struct weston_output *output, - const char *seat); -+ -+ /** Get the dma fd from drm view. -+ * -+ * The dma fd is got from weston_view. -+ * Returns fd on success, -1 on failure. -+ */ -+ int (*get_dma_fd_from_view)(struct weston_output *output, struct weston_view *view); - }; - - static inline const struct weston_drm_output_api * --- -2.7.4 - diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0018-compositor-drm-get-stride-from-drm_get_dma_fd_from_view.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0018-compositor-drm-get-stride-from-drm_get_dma_fd_from_view.patch deleted file mode 100644 index e2655d12..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0018-compositor-drm-get-stride-from-drm_get_dma_fd_from_view.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 0dac780379228396a19048544b9e53d5aa407583 Mon Sep 17 00:00:00 2001 -From: Veeresh Kadasani -Date: Mon, 29 Jul 2019 17:08:31 +0900 -Subject: [PATCH 3/3] compositor-drm: get stride from drm_get_dma_fd_from_view - -Modify drm_get_dma_fd_from_view to get buffer stride. - -Signed-off-by: Veeresh Kadasani ---- - libweston/compositor-drm.c | 5 +++-- - libweston/compositor-drm.h | 2 +- - 2 files changed, 4 insertions(+), 3 deletions(-) - -diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c -index 2b99db5..ec2765f 100644 ---- a/libweston/compositor-drm.c -+++ b/libweston/compositor-drm.c -@@ -5421,7 +5421,7 @@ drm_output_set_seat(struct weston_output *base, - - static int - drm_get_dma_fd_from_view(struct weston_output *base, -- struct weston_view *ev) -+ struct weston_view *ev, int *buf_stride) - { - struct drm_backend *b = to_drm_backend(base->compositor); - struct weston_buffer *buffer = ev->surface->buffer_ref.buffer; -@@ -5444,6 +5444,7 @@ drm_get_dma_fd_from_view(struct weston_output *base, - fprintf(stderr, "failed to get drm_fb from dmabuf\n"); - return -1; - } -+ *buf_stride=current->strides[0]; - } - else if(ev->surface->buffer_ref.buffer->legacy_buffer) { - bo = gbm_bo_import(b->gbm, GBM_BO_IMPORT_WL_BUFFER, -@@ -5458,7 +5459,7 @@ drm_get_dma_fd_from_view(struct weston_output *base, - weston_log("failed to get drm_fb from bo\n"); - return -1; - } -- -+ *buf_stride=current->strides[0]; - } - else { - weston_log("Buffer is not supported\n"); -diff --git a/libweston/compositor-drm.h b/libweston/compositor-drm.h -index a82a2a9..c2461b3 100644 ---- a/libweston/compositor-drm.h -+++ b/libweston/compositor-drm.h -@@ -84,7 +84,7 @@ struct weston_drm_output_api { - * The dma fd is got from weston_view. - * Returns fd on success, -1 on failure. - */ -- int (*get_dma_fd_from_view)(struct weston_output *output, struct weston_view *view); -+ int (*get_dma_fd_from_view)(struct weston_output *output, struct weston_view *view, int *buf_stride); - }; - - static inline const struct weston_drm_output_api * --- -2.7.4 - diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/smack-weston b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/smack-weston new file mode 100644 index 00000000..63a32405 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/smack-weston @@ -0,0 +1,8 @@ +System System::Weston rwxa-- +System::Weston System rwx--- +System::Weston System::Shared rwx--- +System::Weston System::Run rwxat- +System::Weston System::Log rwxa-- +System::Weston _ r-x--l +System::Weston User::Home r-x--l +System::Weston User::App-Shared rwxat- diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/use-XDG_RUNTIMESHARE_DIR.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/use-XDG_RUNTIMESHARE_DIR.patch deleted file mode 100644 index 2f3b0108..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/use-XDG_RUNTIMESHARE_DIR.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 0ed62e1a0beb47e033f7632dbf6d2087366b7830 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Bollo?= -Date: Fri, 13 Oct 2017 14:05:56 +0200 -Subject: [PATCH] use XDG_RUNTIMESHARE_DIR - -When running with LSM Smack, the file returned by the -function 'os_create_anonymous_file' is tagged with the -security label of weston. That security label genrally doesn't -allow sharing of files? Then passing the vreated file descriptor -to the client application fails with EPERM. - -To allow file descriptors to be tagged with a security -label that allows clients to receive and use it, that -patch introduce the use of the environment variable -XDG_RUNTIMESHARE_DIR that takes precedence over -XDG_RUNTIME_DIR whe, creating anonymous file is needed. - -A correct setting of the shared directory using Smack's -transmute mechanism allows set up file tag for sharing. - -This patch was submitted upstream for discussion but -was rejected with the following reason (IIRC): "the -function 'os_create_anonymous_file' and the sharing -are obsolete and should not be used anymore. IVI was -requiring it but newer version don't use it". Halas, -even aligned with latest versions of IVI-shell and weston, -the patch is needed. Because of its simplicity, it can -remain maintained locally out of mainstream in the wait -of further investigations. - -Signed-off-by: José Bollo - -diff --git a/shared/os-compatibility.c b/shared/os-compatibility.c -index e19fb61b..826e48b8 100644 ---- a/shared/os-compatibility.c -+++ b/shared/os-compatibility.c -@@ -157,7 +157,9 @@ os_create_anonymous_file(off_t size) - int fd; - int ret; - -- path = getenv("XDG_RUNTIME_DIR"); -+ path = getenv("XDG_RUNTIMESHARE_DIR"); -+ if (!path) -+ path = getenv("XDG_RUNTIME_DIR"); - if (!path) { - errno = ENOENT; - return -1; diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_%.bbappend b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_%.bbappend deleted file mode 100644 index bcfe11b1..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_%.bbappend +++ /dev/null @@ -1,4 +0,0 @@ -PACKAGECONFIG[notify] = "--enable-systemd-notify,--disable-systemd-notify,systemd" -PACKAGECONFIG_append = " notify" - -RRECOMMENDS_${PN}_remove = "weston-conf" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_5.0.0.bbappend b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_5.0.0.bbappend deleted file mode 100644 index 108cca83..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_5.0.0.bbappend +++ /dev/null @@ -1,27 +0,0 @@ -FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" - -SRC_URI_append = "\ - file://0001-Allow-regular-users-to-launch-Weston_2.0.0.patch \ - file://0001-ivi-shell-rework-goto-labels-to-avoid-memory-leaks.patch \ - file://0002-ivi-shell-removed-assert.patch \ - file://0003-ivi-shell-introduction-of-IVI_INVALID_ID.patch \ - file://0004-layout-interface-added-interface-to-change-surface-id.patch \ - file://0005-ivi-layout-introcuded-configure_desktop_changed.patch \ - file://0006-ivi-layout-introcuded-surface_create_and_configure.patch \ - file://0007-ivi-shell-linked-libweston-desktop-and-added-structs.patch \ - file://0008-ivi-layout-use-libweston-desktop-api-for-views.patch \ - file://0009-ivi-shell-added-libweston-desktop-api_implementation.patch \ - file://0010-ivi-shell-remove-surface_destroy_listener.patch \ - file://0011-ivi-shell-create-weston-desktop-in_wet_shell_init.patch \ - file://0012-hmi-controller-register-for-desktop_surface_configured.patch \ - file://0013-simple-egl-remove-ivi-application-support.patch \ - file://0014-simple-shm-remove-ivi-application-support.patch \ - file://0015-window-client-remove-ivi-application-support.patch \ - file://use-XDG_RUNTIMESHARE_DIR.patch \ - file://0016-compositor-add-output-type-to-weston_output.patch \ - file://0017-compositor-drm-introduce-drm_get_dmafd_from_view.patch \ - file://0018-compositor-drm-get-stride-from-drm_get_dma_fd_from_view.patch \ - " - - -EXTRA_OECONF_append = " --enable-sys-uid" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_6.0.0.bbappend b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_6.0.0.bbappend deleted file mode 100644 index 67442bd6..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_6.0.0.bbappend +++ /dev/null @@ -1,10 +0,0 @@ -FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" - -SRC_URI_append = "\ - file://0001-Allow-regular-users-to-launch-Weston_2.0.0.patch \ - file://use-XDG_RUNTIMESHARE_DIR.patch \ - file://0002-ivi-shell-Fix-crash-due-no-transmitter-screen.patch \ - file://0003-compositor-drm-introduce-drm_get_dmafd_from_view.patch \ - file://0001-config-parser-Export-get_full_path-and-destroy.patch \ - " -EXTRA_OECONF_append = " --enable-sys-uid" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_8.0.%.bbappend b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_8.0.%.bbappend new file mode 100644 index 00000000..bada11c3 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_8.0.%.bbappend @@ -0,0 +1,30 @@ +FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" + +# NOTE: +# file://0003-compositor-drm-introduce-drm_get_dmafd_from_view.patch +# has been removed until someone more familiar with weston internals +# and waltham can take a look and update it. +SRC_URI_append = "\ + file://0001-Allow-regular-users-to-launch-Weston_7.0.0.patch \ + file://0002-ivi-shell-Fix-crash-due-no-transmitter-screen.patch \ + file://0001-libweston-Expose-weston_output_damage-in-libweston.patch \ + file://0004-main-change-remoting-initialization-timing.patch \ + file://smack-weston \ + " + +EXTRA_OEMESON_append = " -Denable-user-start=true" + +# Workaround for incorrect upstream definition +PACKAGECONFIG[remoting] = "-Dremoting=true,-Dremoting=false,gstreamer1.0 gstreamer1.0-plugins-base" +PACKAGECONFIG_append = "${@bb.utils.contains('DISTRO_FEATURES', 'weston-remoting', ' remoting', '', d)}" + +do_install_append() { + if ${@bb.utils.contains('DISTRO_FEATURES', 'smack', 'true', 'false', d)}; then + # Install SMACK rules + install -D -m 0644 ${WORKDIR}/smack-weston ${D}${sysconfdir}/smack/accesses.d/weston + fi +} + +FILES_${PN} += "\ + ${sysconfdir}/smack/accesses.d/* \ +" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad/0001-gst-wayland-Install-wayland-header-from-gstwayland-l.patch b/meta-agl/meta-agl-profile-graphical/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad/0001-gst-wayland-Install-wayland-header-from-gstwayland-l.patch new file mode 100644 index 00000000..443e7db8 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad/0001-gst-wayland-Install-wayland-header-from-gstwayland-l.patch @@ -0,0 +1,28 @@ +From 03e502084633838badfcc2b91a1aca1651c18544 Mon Sep 17 00:00:00 2001 +From: Marius Vlad +Date: Wed, 24 Jun 2020 19:44:35 +0300 +Subject: [PATCH] gst/wayland/: Install wayland header from gstwayland library + +Necessary for cluster-receiver to pass out the wl_surface. + +Bug-AGL: SPEC-3382 + +Signed-off-by: Marius Vlad +--- + gst-libs/gst/wayland/meson.build | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/gst-libs/gst/wayland/meson.build b/gst-libs/gst/wayland/meson.build +index b1ede41f1..8957381d2 100644 +--- a/gst-libs/gst/wayland/meson.build ++++ b/gst-libs/gst/wayland/meson.build +@@ -21,4 +21,6 @@ if use_wayland + gstwayland_dep = declare_dependency(link_with : gstwayland, + include_directories : [libsinc], + dependencies : [gst_dep, gstvideo_dep]) ++ ++ install_headers('wayland.h', subdir: 'gst/wayland') + endif +-- +2.26.2 + diff --git a/meta-agl/meta-agl-profile-graphical/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad/0001-install-wayland.h.patch b/meta-agl/meta-agl-profile-graphical/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad/0001-install-wayland.h.patch deleted file mode 100644 index 67481574..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad/0001-install-wayland.h.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 0adaad552a15dfb03d41774c4cf45b8c9a038640 Mon Sep 17 00:00:00 2001 -From: Veeresh Kadasani -Date: Wed, 10 Jul 2019 14:36:37 +0900 -Subject: [PATCH 1/2] install wayland.h - -Signed-off-by: Veeresh Kadasani ---- - gst-libs/gst/wayland/Makefile.am | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/gst-libs/gst/wayland/Makefile.am b/gst-libs/gst/wayland/Makefile.am -index 743a489..c59b06d 100644 ---- a/gst-libs/gst/wayland/Makefile.am -+++ b/gst-libs/gst/wayland/Makefile.am -@@ -5,6 +5,8 @@ libgstwayland_@GST_API_VERSION@_la_SOURCES = wayland.c - libgstwayland_@GST_API_VERSION@includedir = \ - $(includedir)/gstreamer-@GST_API_VERSION@/gst/wayland - -+libgstwayland_@GST_API_VERSION@include_HEADERS = wayland.h -+ - libgstwayland_@GST_API_VERSION@_la_CFLAGS = \ - $(GST_PLUGINS_BAD_CFLAGS) \ - $(GST_PLUGINS_BASE_CFLAGS) \ -@@ -21,7 +23,3 @@ libgstwayland_@GST_API_VERSION@_la_LDFLAGS = \ - $(GST_LIB_LDFLAGS) \ - $(GST_ALL_LDFLAGS) \ - $(GST_LT_LDFLAGS) -- --noinst_HEADERS = \ -- wayland.h -- --- -2.7.4 diff --git a/meta-agl/meta-agl-profile-graphical/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad_1.14.%.bbappend b/meta-agl/meta-agl-profile-graphical/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad_1.14.%.bbappend deleted file mode 100644 index df13a042..00000000 --- a/meta-agl/meta-agl-profile-graphical/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad_1.14.%.bbappend +++ /dev/null @@ -1,2 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -SRC_URI_append="${@bb.utils.contains_any("MACHINE", "m3ulcb h3ulcb m3ulcb-nogfx", " "," file://0001-install-wayland.h.patch", d)}" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad_1.16.%.bbappend b/meta-agl/meta-agl-profile-graphical/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad_1.16.%.bbappend new file mode 100644 index 00000000..7e1fa773 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad_1.16.%.bbappend @@ -0,0 +1,2 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +SRC_URI_append="${@bb.utils.contains_any("MACHINE", "salvator-x m3ulcb h3ulcb m3ulcb-nogfx", " "," file://0001-gst-wayland-Install-wayland-header-from-gstwayland-l.patch", d)}" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-platform/images/agl-image-weston.inc b/meta-agl/meta-agl-profile-graphical/recipes-platform/images/agl-image-weston.inc index ed1634fc..cef3bf64 100644 --- a/meta-agl/meta-agl-profile-graphical/recipes-platform/images/agl-image-weston.inc +++ b/meta-agl/meta-agl-profile-graphical/recipes-platform/images/agl-image-weston.inc @@ -2,6 +2,6 @@ require recipes-platform/images/agl-image-minimal.inc IMAGE_FEATURES += "splash package-management ssh-server-dropbear" -inherit distro_features_check +inherit features_check REQUIRED_DISTRO_FEATURES = "wayland" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-platform/packagegroups/packagegroup-agl-graphical-services.bb b/meta-agl/meta-agl-profile-graphical/recipes-platform/packagegroups/packagegroup-agl-graphical-services.bb index 2ebb3d62..e587ab21 100644 --- a/meta-agl/meta-agl-profile-graphical/recipes-platform/packagegroups/packagegroup-agl-graphical-services.bb +++ b/meta-agl/meta-agl-profile-graphical/recipes-platform/packagegroups/packagegroup-agl-graphical-services.bb @@ -9,7 +9,7 @@ PACKAGES = "\ ALLOW_EMPTY_${PN} = "1" -RDEPENDS_${PN} += "\ -${@bb.utils.contains('DISTRO_FEATURES', 'pipewire', 'agl-service-mediaplayer', '', d)} \ -${@bb.utils.contains('DISTRO_FEATURES', 'pipewire', 'agl-service-radio', '', d)} \ +RDEPENDS_${PN} = "\ + ${@bb.utils.contains('DISTRO_FEATURES', 'pipewire', 'agl-service-mediaplayer', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'pipewire', 'agl-service-radio', '', d)} \ " diff --git a/meta-agl/meta-agl-profile-graphical/recipes-platform/packagegroups/packagegroup-agl-graphical-weston.bb b/meta-agl/meta-agl-profile-graphical/recipes-platform/packagegroups/packagegroup-agl-graphical-weston.bb index a97b6ebe..79577c17 100644 --- a/meta-agl/meta-agl-profile-graphical/recipes-platform/packagegroups/packagegroup-agl-graphical-weston.bb +++ b/meta-agl/meta-agl-profile-graphical/recipes-platform/packagegroups/packagegroup-agl-graphical-weston.bb @@ -14,9 +14,7 @@ RDEPENDS_${PN} += " \ weston-init \ weston-ini-conf \ weston-examples \ - weston-ready \ agl-login-manager \ - agl-desktop-config \ agl-compositor \ " diff --git a/meta-agl/meta-agl-profile-graphical/recipes-security/security-manager/security-manager_%.bbappend b/meta-agl/meta-agl-profile-graphical/recipes-security/security-manager/security-manager_%.bbappend new file mode 100644 index 00000000..d6fcb40a --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-security/security-manager/security-manager_%.bbappend @@ -0,0 +1,6 @@ + +do_install_append() { + # Needed for wayland-0 socket access and memfd usage + echo "~APP~ System::Weston rw" >> ${D}${datadir}/security-manager/policy/app-rules-template.smack + echo "System::Weston ~APP~ rw" >> ${D}${datadir}/security-manager/policy/app-rules-template.smack +} diff --git a/meta-agl/meta-agl-profile-hud/LICENSE b/meta-agl/meta-agl-profile-hud/LICENSE new file mode 100644 index 00000000..e8758f89 --- /dev/null +++ b/meta-agl/meta-agl-profile-hud/LICENSE @@ -0,0 +1,20 @@ +Different components of the AGL layers are under different licenses (a mix +of MIT and GPLv2). See LICENSE.GPL-2.0-only and LICENSE.MIT for further +details of the individual licenses. + +All metadata (e.g. .bb, .bbappend, .bbclass, .inc, templates/* and similar) +is MIT licensed unless otherwise stated. +Source code included in tree for individual recipes (e.g. patches) are under +the LICENSE stated in the associated recipe (.bb file) unless otherwise stated. + +License information for any other files (scripts) is either explicitly stated +or defaults to GPL version 2 only. + +Individual files can contain the following style tags instead of the full +license text to identify their license: + + SPDX-License-Identifier: GPL-2.0-only + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-hud/LICENSE.GPL-2.0-only b/meta-agl/meta-agl-profile-hud/LICENSE.GPL-2.0-only new file mode 100644 index 00000000..5db3c0a2 --- /dev/null +++ b/meta-agl/meta-agl-profile-hud/LICENSE.GPL-2.0-only @@ -0,0 +1,288 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: GPL-2.0-only + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-hud/LICENSE.MIT b/meta-agl/meta-agl-profile-hud/LICENSE.MIT new file mode 100644 index 00000000..a6919eb7 --- /dev/null +++ b/meta-agl/meta-agl-profile-hud/LICENSE.MIT @@ -0,0 +1,25 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-hud/conf/layer.conf b/meta-agl/meta-agl-profile-hud/conf/layer.conf index 4f5d06fc..f8f18cdc 100644 --- a/meta-agl/meta-agl-profile-hud/conf/layer.conf +++ b/meta-agl/meta-agl-profile-hud/conf/layer.conf @@ -9,4 +9,4 @@ BBFILE_COLLECTIONS += "aglprofilehud" BBFILE_PATTERN_aglprofilehud = "^${LAYERDIR}/" BBFILE_PRIORITY_aglprofilehud = "70" -LAYERSERIES_COMPAT_aglprofilehud = "thud" +LAYERSERIES_COMPAT_aglprofilehud = "dunfell" diff --git a/meta-agl/meta-agl-profile-telematics/LICENSE b/meta-agl/meta-agl-profile-telematics/LICENSE new file mode 100644 index 00000000..e8758f89 --- /dev/null +++ b/meta-agl/meta-agl-profile-telematics/LICENSE @@ -0,0 +1,20 @@ +Different components of the AGL layers are under different licenses (a mix +of MIT and GPLv2). See LICENSE.GPL-2.0-only and LICENSE.MIT for further +details of the individual licenses. + +All metadata (e.g. .bb, .bbappend, .bbclass, .inc, templates/* and similar) +is MIT licensed unless otherwise stated. +Source code included in tree for individual recipes (e.g. patches) are under +the LICENSE stated in the associated recipe (.bb file) unless otherwise stated. + +License information for any other files (scripts) is either explicitly stated +or defaults to GPL version 2 only. + +Individual files can contain the following style tags instead of the full +license text to identify their license: + + SPDX-License-Identifier: GPL-2.0-only + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-telematics/LICENSE.GPL-2.0-only b/meta-agl/meta-agl-profile-telematics/LICENSE.GPL-2.0-only new file mode 100644 index 00000000..5db3c0a2 --- /dev/null +++ b/meta-agl/meta-agl-profile-telematics/LICENSE.GPL-2.0-only @@ -0,0 +1,288 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: GPL-2.0-only + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-telematics/LICENSE.MIT b/meta-agl/meta-agl-profile-telematics/LICENSE.MIT new file mode 100644 index 00000000..a6919eb7 --- /dev/null +++ b/meta-agl/meta-agl-profile-telematics/LICENSE.MIT @@ -0,0 +1,25 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-agl-profile-telematics/conf/layer.conf b/meta-agl/meta-agl-profile-telematics/conf/layer.conf index 6d17746b..f9ef2e3b 100644 --- a/meta-agl/meta-agl-profile-telematics/conf/layer.conf +++ b/meta-agl/meta-agl-profile-telematics/conf/layer.conf @@ -9,4 +9,4 @@ BBFILE_COLLECTIONS += "aglprofiletelematics" BBFILE_PATTERN_aglprofiletelematics = "^${LAYERDIR}/" BBFILE_PRIORITY_aglprofiletelematics = "70" -LAYERSERIES_COMPAT_aglprofiletelematics = "thud" +LAYERSERIES_COMPAT_aglprofiletelematics = "dunfell" diff --git a/meta-agl/meta-agl-profile-telematics/recipes-platform/images/agl-image-telematics.inc b/meta-agl/meta-agl-profile-telematics/recipes-platform/images/agl-image-telematics.inc index b8c228cd..3e951550 100644 --- a/meta-agl/meta-agl-profile-telematics/recipes-platform/images/agl-image-telematics.inc +++ b/meta-agl/meta-agl-profile-telematics/recipes-platform/images/agl-image-telematics.inc @@ -1,5 +1,5 @@ require recipes-platform/images/agl-image-boot.inc -inherit distro_features_check +inherit features_check REQUIRED_DISTRO_FEATURES = "3g" diff --git a/meta-agl/meta-agl.md b/meta-agl/meta-agl.md index 19f80ee3..6c3427cd 100755 --- a/meta-agl/meta-agl.md +++ b/meta-agl/meta-agl.md @@ -118,25 +118,3 @@ design: Additional tools used in QA tests (for agl-image*-qa). - diff --git a/meta-agl/meta-agl/conf/layer.conf b/meta-agl/meta-agl/conf/layer.conf index c46ec809..6f431e6a 100644 --- a/meta-agl/meta-agl/conf/layer.conf +++ b/meta-agl/meta-agl/conf/layer.conf @@ -9,4 +9,4 @@ BBFILE_COLLECTIONS += "agl" BBFILE_PATTERN_agl = "^${LAYERDIR}/" BBFILE_PRIORITY_agl = "70" -LAYERSERIES_COMPAT_agl = "thud" +LAYERSERIES_COMPAT_agl = "dunfell" diff --git a/meta-agl/meta-app-framework/LICENSE b/meta-agl/meta-app-framework/LICENSE new file mode 100644 index 00000000..e8758f89 --- /dev/null +++ b/meta-agl/meta-app-framework/LICENSE @@ -0,0 +1,20 @@ +Different components of the AGL layers are under different licenses (a mix +of MIT and GPLv2). See LICENSE.GPL-2.0-only and LICENSE.MIT for further +details of the individual licenses. + +All metadata (e.g. .bb, .bbappend, .bbclass, .inc, templates/* and similar) +is MIT licensed unless otherwise stated. +Source code included in tree for individual recipes (e.g. patches) are under +the LICENSE stated in the associated recipe (.bb file) unless otherwise stated. + +License information for any other files (scripts) is either explicitly stated +or defaults to GPL version 2 only. + +Individual files can contain the following style tags instead of the full +license text to identify their license: + + SPDX-License-Identifier: GPL-2.0-only + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-app-framework/LICENSE.GPL-2.0-only b/meta-agl/meta-app-framework/LICENSE.GPL-2.0-only new file mode 100644 index 00000000..5db3c0a2 --- /dev/null +++ b/meta-agl/meta-app-framework/LICENSE.GPL-2.0-only @@ -0,0 +1,288 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: GPL-2.0-only + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-app-framework/LICENSE.MIT b/meta-agl/meta-app-framework/LICENSE.MIT new file mode 100644 index 00000000..a6919eb7 --- /dev/null +++ b/meta-agl/meta-app-framework/LICENSE.MIT @@ -0,0 +1,25 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-app-framework/classes/aglwgt.bbclass b/meta-agl/meta-app-framework/classes/aglwgt.bbclass index 717bd7b9..042c0fa9 100644 --- a/meta-agl/meta-app-framework/classes/aglwgt.bbclass +++ b/meta-agl/meta-app-framework/classes/aglwgt.bbclass @@ -8,82 +8,152 @@ # The makefile needs to use wgtpkg-pack. # - # 'wgtpkg-pack' in af-main-native is required. DEPENDS_append = " af-main-native" -# for bindings af-binder is required. +# for bindings af-binder is required. DEPENDS_append = " af-binder" -# for bindings that use the cmake-apps-module +# for bindings that use the cmake-apps-module DEPENDS_append = " cmake-apps-module-native" # for hal bindings genskel is required. DEPENDS_append = " af-binder-devtools-native" -EXTRA_OECMAKE_append_agl-ptest = " -DBUILD_TEST_WGT=TRUE" - -# FIXME: Remove once CMake+ninja issues are resolved -OECMAKE_GENERATOR = "Unix Makefiles" +# Re-enable strip for qmake based projects (default value is "echo") +OE_QMAKE_STRIP = "${STRIP}" + +# Extra build arguments passed to the autobuild script invocations +AGLWGT_EXTRA_BUILD_ARGS ?= 'VERBOSE=TRUE BUILD_ARGS="${PARALLEL_MAKE}"' + +# CMake based widgets that inherit cmake.bbclass will have the +# following automatically appended to AGLWGT_EXTRA_BUILD_ARGS as +# the value of CONFIGURE_FLAGS. This definition may need to be +# extended to include more of what is passed in cmake.bbclass's +# do_configure if it is found insufficient. Using the generated +# toolchain.cmake file does fix issues with respect to finding the +# Qt5 CMake modules that seem difficult to fix otherwise, so at the +# very minimum it should be present. +AGLWGT_CMAKE_CONFIGURE_ARGS ?= "-DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake ${EXTRA_OECMAKE}" + +# Only widgets with recipe names starting with agl-service- are +# assumed to have tests by default, set this to "1" to force +# building/packaging of the test widget for other widgets. +AGLWGT_HAVE_TESTS ?= "0" + +# Warning on missing test/debug/coverage packages disabled by default +# for now to reduce build output clutter. +AGLWGT_PACKAGE_WARN ?= "0" + +# Whether the widget should be auto-installed on first boot +AGLWGT_AUTOINSTALL ?= "1" + +# Signature keys +# These are default keys for development purposes ! +# Change it for production. +WGTPKG_AUTOSIGN_0_agl-sign-wgts ??= "${WORKDIR}/recipe-sysroot-native/usr/share/afm/keys/developer.key.pem:${WORKDIR}/recipe-sysroot-native/usr/share/afm/certs/developer.cert.pem" +WGTPKG_AUTOSIGN_1_agl-sign-wgts ??= "${WORKDIR}/recipe-sysroot-native/usr/share/afm/keys/platform.key.pem:${WORKDIR}/recipe-sysroot-native/usr/share/afm/certs/platform.cert.pem" + +export WGTPKG_AUTOSIGN_0 +export WGTPKG_AUTOSIGN_1 + +python __anonymous () { + # NOTE: AGLWGT_CMAKE_CONFIGURE_ARGS is not updated directly here, + # but via the prefunc below to avoid issues around anonymous + # python ordering conflicts with e.g. externalsrc.bbclass. + if bb.data.inherits_class("cmake", d): + d.appendVarFlag('do_compile', 'prefuncs', ' aglwgt_cmake_configure') +} -do_aglwgt_package() { - cd ${B} - ${S}/autobuild/agl/autobuild package BUILD_DIR=${B} DEST=${B} VERBOSE=TRUE || \ - ( ${S}/conf.d/autobuild/agl/autobuild package BUILD_DIR=${B} DEST=${B}/package VERBOSE=TRUE && \ - ( bbwarn "OBSOLETE: Your autobuild script should be located in :" ; \ - bbwarn "autobuild/agl/ from the project root source folder"; \ - bbwarn "and generate a .wgt file using wgtpack in the build"; \ - bbwarn "root folder calling:" ; \ - bbwarn "./autobuild/agl/autobuild package DEST=" ; \ - bbwarn "See: https://wiki.automotivelinux.org/troubleshooting/app-recipes" \ - ) - ) || - ( bbwarn "OBSOLETE: You must have an autobuild script located in:" ; \ - bbwarn "autobuild/agl/ from the project root source folder"; \ - bbwarn "with filename autobuild which should generate"; \ - bbwarn "a .wgt file using wgtpack in the build"; \ - bbwarn "root folder calling:" ; \ - bbwarn "./autobuild/agl/autobuild package DEST=" ; \ - bbwarn "Fix your package as it will not work within the SDK" ; \ - bbwarn "See: https://wiki.automotivelinux.org/troubleshooting/app-recipes"; \ - make package) +python aglwgt_cmake_configure () { + # Define CONFIGURE_FLAGS appropriately if cmake.bbclass has been + # inherited, see description of AGLWGT_CMAKE_CONFIGURE_ARGS above + # for more details. + cmake_config_args = d.getVar("AGLWGT_CMAKE_CONFIGURE_ARGS") + if bb.data.inherits_class("cmake", d) and cmake_config_args: + d.appendVar("AGLWGT_EXTRA_BUILD_ARGS", ' CONFIGURE_ARGS="' + cmake_config_args + '"') + d.appendVarFlag("AGLWGT_EXTRA_BUILD_ARGS", "vardeps", " AGLWGT_CMAKE_CONFIGURE_ARGS") } -python () { - d.setVarFlag('do_aglwgt_deploy', 'fakeroot', '1') +# Placeholder to keep things like externalsrc that prefunc or append +# do_configure working as expected. +aglwgt_do_configure() { + true } +aglwgt_do_compile() { + bldcmd=${S}/autobuild/agl/autobuild + if [ ! -x "$bldcmd" ]; then + bbfatal "Missing autobuild/agl/autobuild script" + fi + + if [ "${S}" != "${B}" ]; then + rm -rf ${B} + mkdir -p ${B} + cd ${B} + fi + + if ! $bldcmd package BUILD_DIR=${B}/build-release ${AGLWGT_EXTRA_BUILD_ARGS}; then + bbwarn "Target: package failed" + fi + + if ! $bldcmd package-debug BUILD_DIR_DEBUG=${B}/build-debug ${AGLWGT_EXTRA_BUILD_ARGS}; then + bbwarn "Target: package-debug failed" + fi + + if echo ${BPN} | grep -q '^agl-service-' || [ "${AGLWGT_HAVE_TESTS}" = "1" ]; then + if ! $bldcmd package-test BUILD_DIR_TEST=${B}/build-test ${AGLWGT_EXTRA_BUILD_ARGS}; then + bbwarn "Target: package-test failed" + fi + + if ! $bldcmd package-coverage BUILD_DIR_COVERAGE=${B}/build-coverage ${AGLWGT_EXTRA_BUILD_ARGS}; then + bbwarn "Target: package-coverage failed" + fi + fi +} POST_INSTALL_LEVEL ?= "10" POST_INSTALL_SCRIPT ?= "${POST_INSTALL_LEVEL}-${PN}.sh" EXTRA_WGT_POSTINSTALL ?= "" -do_aglwgt_deploy() { - TEST_WGT="*-test.wgt" - if [ "${AGLWGT_AUTOINSTALL_${PN}}" = "0" ] - then - install -d ${D}/usr/AGL/apps/manualinstall - install -m 0644 ${B}/*.wgt ${D}/usr/AGL/apps/manualinstall || \ - install -m 0644 ${B}/package/*.wgt ${D}/usr/AGL/apps/manualinstall +aglwgt_do_install() { + DEST=release + if [ "${AGLWGT_AUTOINSTALL_${PN}}" = "0" ]; then + DEST=manualinstall + fi + + if [ "$(find ${B}/build-release -name '*.wgt' -maxdepth 1)" ]; then + install -d ${D}/usr/AGL/apps/$DEST + install -m 0644 ${B}/build-release/*.wgt ${D}/usr/AGL/apps/$DEST/ else - install -d ${D}/usr/AGL/apps/autoinstall - install -m 0644 ${B}/*.wgt ${D}/usr/AGL/apps/autoinstall || \ - install -m 0644 ${B}/package/*.wgt ${D}/usr/AGL/apps/autoinstall - - if [ "$(find ${D}/usr/AGL/apps/autoinstall -name ${TEST_WGT})" ] - then - install -d ${D}/usr/AGL/apps/testwgt - mv ${D}/usr/AGL/apps/autoinstall/*-test.wgt ${D}/usr/AGL/apps/testwgt - fi + bbfatal "no package found in widget directory" fi - APP_FILES="" - for file in ${D}/usr/AGL/apps/autoinstall/*.wgt;do - APP_FILES="${APP_FILES} $(basename $file)"; + for t in test debug coverage; do + if [ "$(find ${B}/build-${t} -name *-${t}.wgt -maxdepth 1)" ]; then + install -d ${D}/usr/AGL/apps/${t} + install -m 0644 ${B}/build-${t}/*-${t}.wgt ${D}/usr/AGL/apps/${t}/ + elif [ "${AGLWGT_PACKAGE_WARN}" = "1" ]; then + if [ "$t" != "test" -a "$t" != "coverage" ]; then + bbwarn "no package found in ${t} widget directory" + elif echo ${BPN} | grep -q '^agl-service-' || [ "${AGLWGT_HAVE_TESTS}" = "1" ]; then + bbwarn "no package found in ${t} widget directory" + fi + fi done - install -d ${D}/${sysconfdir}/agl-postinsts - cat > ${D}/${sysconfdir}/agl-postinsts/${POST_INSTALL_SCRIPT} < ${D}/${sysconfdir}/agl-postinsts/${POST_INSTALL_SCRIPT} < ${D}${afm_confdir}/unit.env.d/qt-shell } pkg_postinst_ontarget_${PN}() { @@ -114,6 +111,7 @@ pkg_postinst_ontarget_${PN}_append_with-lsm-smack() { chsmack -a 'System::Shared' -t $D${afm_datadir}/icons } FILES_${PN} += "${systemd_units_root}/* ${systemd_system_unitdir} ${systemd_user_unitdir}" +FILES_${PN}_append_agl-sign-wgts = " ${datadir}/afm" PACKAGES =+ "${PN}-binding ${PN}-binding-dbg" FILES_${PN}-binding = " ${afb_binding_dir}/afm-main-binding.so " diff --git a/meta-agl/meta-app-framework/recipes-core/af-main/af-main_git.inc b/meta-agl/meta-app-framework/recipes-core/af-main/af-main_git.inc index df06df63..7eb94b23 100644 --- a/meta-agl/meta-app-framework/recipes-core/af-main/af-main_git.inc +++ b/meta-agl/meta-app-framework/recipes-core/af-main/af-main_git.inc @@ -10,7 +10,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57" SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/app-framework-main;protocol=https;branch=${AGL_BRANCH}" -SRCREV = "381a0973c9d421bc031882cecce9244f6d2a6638" +SRCREV = "af8db35cc01c57b7d1d2e4fa7815df8c16f8454f" PV = "${AGL_BRANCH}+git${SRCPV}" S = "${WORKDIR}/git" @@ -22,4 +22,9 @@ afb_binding_dir = "${libdir}/afb" systemd_units_root = "/var/local/lib/systemd" CFLAGS_append_agl-devel = " -DAGL_DEVEL" +# only install sample keys in agl-devel mode +# for production you need to deploy real keys +EXTRA_OECMAKE_append_agl-sign-wgts = " ${@bb.utils.contains('DISTRO_FEATURES', 'agl-devel', '-DINSTALL_SAMPLE_KEYS=ON', '-DINSTALL_SAMPLE_KEYS=OFF', d)}" + + diff --git a/meta-agl/meta-app-framework/recipes-core/af-main/nativesdk-af-main_git.bb b/meta-agl/meta-app-framework/recipes-core/af-main/nativesdk-af-main_git.bb index 759c893c..88ab4ae6 100644 --- a/meta-agl/meta-app-framework/recipes-core/af-main/nativesdk-af-main_git.bb +++ b/meta-agl/meta-app-framework/recipes-core/af-main/nativesdk-af-main_git.bb @@ -23,5 +23,6 @@ do_install_append() { PACKAGES = "${PN}-tools ${PN}-tools-dbg" FILES_${PN}-tools = "${bindir}/wgtpkg-* ${afm_confdir}/*" +FILES_${PN}-tools_append_agl-sign-wgts = " ${datadir}/afm" FILES_${PN}-tools-dbg = "${bindir}/.debug/wgtpkg-*" diff --git a/meta-agl/meta-app-framework/recipes-core/nss-localuser/nss-localuser_0.1.bb b/meta-agl/meta-app-framework/recipes-core/nss-localuser/nss-localuser_0.1.bb index 62e163f9..45861f7c 100644 --- a/meta-agl/meta-app-framework/recipes-core/nss-localuser/nss-localuser_0.1.bb +++ b/meta-agl/meta-app-framework/recipes-core/nss-localuser/nss-localuser_0.1.bb @@ -13,6 +13,8 @@ SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/nss-localuser;protocol=ht SRCREV = "66803c6fdb609ed83a78b9194ecb23e9c1b773e7" PV = "${AGL_BRANCH}+git${SRCPV}" +RDEPENDS_${PN} = "base-files" + S = "${WORKDIR}/git" do_compile() { @@ -23,7 +25,7 @@ do_install() { make nssdir=${D}${libdir} install } -pkg_postinst_${PN} () { +pkg_postinst_ontarget_${PN} () { sed -e '/^hosts:/s/\\s*//' \ -e 's/\(^hosts:\s\s*\)\(.*\)/\1localuser \2/' \ -i $D${sysconfdir}/nsswitch.conf diff --git a/meta-agl/meta-app-framework/recipes-security/xmlsec1/xmlsec1_1.%.bbappend b/meta-agl/meta-app-framework/recipes-security/xmlsec1/xmlsec1_1.%.bbappend index 08d2a3dd..09820be2 100644 --- a/meta-agl/meta-app-framework/recipes-security/xmlsec1/xmlsec1_1.%.bbappend +++ b/meta-agl/meta-app-framework/recipes-security/xmlsec1/xmlsec1_1.%.bbappend @@ -1,4 +1,4 @@ - -DEPENDS = "libtool libxml2 libxslt openssl gnutls libgcrypt" +# Disable nss to avoid build issues on native +PACKAGECONFIG = "gnutls libgcrypt openssl des" BBCLASSEXTEND = "native nativesdk" diff --git a/meta-agl/meta-app-framework/recipes-support/libzip/libzip_%.bbappend b/meta-agl/meta-app-framework/recipes-support/libzip/libzip_%.bbappend new file mode 100644 index 00000000..5174650b --- /dev/null +++ b/meta-agl/meta-app-framework/recipes-support/libzip/libzip_%.bbappend @@ -0,0 +1 @@ +BBCLASSEXTEND += "native nativesdk" diff --git a/meta-agl/meta-app-framework/recipes-support/libzip/libzip_1.1.1.bb b/meta-agl/meta-app-framework/recipes-support/libzip/libzip_1.1.1.bb deleted file mode 100644 index 45097117..00000000 --- a/meta-agl/meta-app-framework/recipes-support/libzip/libzip_1.1.1.bb +++ /dev/null @@ -1,32 +0,0 @@ -inherit autotools - -SUMMARY = "Library providing support for handling zip files" -DESCRIPTION = "\ - This library is wrapping zlib and allows \ - to easily create, browse, inflate of deflate \ - the zip files. \ - It also provides tools for zip comparing, merging or browsing.\ -" - -HOMEPAGE = "http://nih.at/libzip/index.html" -LICENSE = "BSD" -LIC_FILES_CHKSUM = "file://LICENSE;md5=23ebf7ca347ed9703b4ef40824d0ef66" - -SRC_URI = "http://nih.at/libzip/libzip-1.1.1.tar.xz;md5sum=0c86a1a94fbc3ec6724801036726ae1f" - -#SRC_URI = "hg://hg.nih.at/libzip;module=libzip;protocol=http" -#SRCREV = "5895e34af7f9" -#S = "${HGDIR}" - -SECTION = "base" - -DEPENDS = "zlib" - -RDEPENDS_${PN} = "zlib" - -PROVIDES += "${PN}-tools" -RDEPENDS_${PN}-tools = "${PN}" -FILES_${PN}-tools = "${bindir}/zipcmp ${bindir}/zipmerge ${bindir}/ziptool" - -BBCLASSEXTEND = "native nativesdk" - diff --git a/meta-agl/meta-netboot/LICENSE b/meta-agl/meta-netboot/LICENSE new file mode 100644 index 00000000..e8758f89 --- /dev/null +++ b/meta-agl/meta-netboot/LICENSE @@ -0,0 +1,20 @@ +Different components of the AGL layers are under different licenses (a mix +of MIT and GPLv2). See LICENSE.GPL-2.0-only and LICENSE.MIT for further +details of the individual licenses. + +All metadata (e.g. .bb, .bbappend, .bbclass, .inc, templates/* and similar) +is MIT licensed unless otherwise stated. +Source code included in tree for individual recipes (e.g. patches) are under +the LICENSE stated in the associated recipe (.bb file) unless otherwise stated. + +License information for any other files (scripts) is either explicitly stated +or defaults to GPL version 2 only. + +Individual files can contain the following style tags instead of the full +license text to identify their license: + + SPDX-License-Identifier: GPL-2.0-only + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-netboot/LICENSE.GPL-2.0-only b/meta-agl/meta-netboot/LICENSE.GPL-2.0-only new file mode 100644 index 00000000..5db3c0a2 --- /dev/null +++ b/meta-agl/meta-netboot/LICENSE.GPL-2.0-only @@ -0,0 +1,288 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: GPL-2.0-only + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-netboot/LICENSE.MIT b/meta-agl/meta-netboot/LICENSE.MIT new file mode 100644 index 00000000..a6919eb7 --- /dev/null +++ b/meta-agl/meta-netboot/LICENSE.MIT @@ -0,0 +1,25 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: MIT + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/meta-agl/meta-netboot/README b/meta-agl/meta-netboot/README index dc545b2f..7efa2265 100644 --- a/meta-agl/meta-netboot/README +++ b/meta-agl/meta-netboot/README @@ -66,7 +66,7 @@ setenv 'bootkfile' 'Image' setenv 'bootkload_net' 'tftp ${bootkaddr} h3ulcb/${bootkfile}' setenv 'bootiaddr' '0x5C3F9520' setenv 'bootifile' 'initramfs-netboot-image-h3ulcb.ext4.gz' -setenv 'bootiload_net' 'tftp ${bootraddr} h3ulcb/${bootrfile}' +setenv 'bootiload_net' 'tftp ${bootiaddr} h3ulcb/${bootifile}' setenv 'load_net' 'run bootkload_net; run bootdload_net; run bootiload_net; setenv initrd_size ${filesize}' setenv 'bootcmd' 'setenv bootargs ${bootargs_console} ${bootargs_video} ${bootargs_root} ${bootargs_extra} nbd.server=${serverip}; run load_net; booti ${bootkaddr} ${bootiaddr}:${initrd_size} ${bootdaddr}' diff --git a/meta-agl/meta-netboot/conf/layer.conf b/meta-agl/meta-netboot/conf/layer.conf index d22a8644..50def90f 100644 --- a/meta-agl/meta-netboot/conf/layer.conf +++ b/meta-agl/meta-netboot/conf/layer.conf @@ -12,4 +12,4 @@ BBFILE_COLLECTIONS += "meta-netboot" BBFILE_PATTERN_meta-netboot = "^${LAYERDIR}/" BBFILE_PRIORITY_meta-netboot = "60" -LAYERSERIES_COMPAT_meta-netboot = "thud" +LAYERSERIES_COMPAT_meta-netboot = "dunfell" diff --git a/meta-agl/meta-netboot/recipes-core/initramfs-netboot/files/init.sh b/meta-agl/meta-netboot/recipes-core/initramfs-netboot/files/init.sh index 50d62472..2b8bc63d 100644 --- a/meta-agl/meta-netboot/recipes-core/initramfs-netboot/files/init.sh +++ b/meta-agl/meta-netboot/recipes-core/initramfs-netboot/files/init.sh @@ -125,7 +125,7 @@ try=5 while :;do log_info "Starting NBD client" if [ -z "${NBD_NAMEV3}" ]; then - nbd-client $NBD_SERVER $NBD_PORT $NBD_DEV && { log_info "NBD client successfully started"; break; } + nbd-client -persist $NBD_SERVER $NBD_PORT $NBD_DEV && { log_info "NBD client successfully started"; break; } log_info "NBD client failed" else nbd3-client $NBD_SERVER $NBD_DEV --name $NBD_NAMEV3 && { log_info "NBD3 client successfully started"; break; } diff --git a/meta-agl/meta-pipewire/conf/include/agl-pipewire.inc b/meta-agl/meta-pipewire/conf/include/agl-pipewire.inc new file mode 100644 index 00000000..edd89311 --- /dev/null +++ b/meta-agl/meta-pipewire/conf/include/agl-pipewire.inc @@ -0,0 +1,3 @@ +DISTRO_FEATURES_append = " pipewire" +PREFERRED_RPROVIDER_virtual/pipewire-config = "pipewire-conf-agl" +PREFERRED_RPROVIDER_virtual/wireplumber-config = "wireplumber-board-config-agl" diff --git a/meta-agl/meta-pipewire/conf/layer.conf b/meta-agl/meta-pipewire/conf/layer.conf new file mode 100644 index 00000000..68113221 --- /dev/null +++ b/meta-agl/meta-pipewire/conf/layer.conf @@ -0,0 +1,12 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have recipes-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "meta-pipewire" +BBFILE_PATTERN_meta-pipewire = "^${LAYERDIR}/" +BBFILE_PRIORITY_meta-pipewire = "71" + +LAYERSERIES_COMPAT_meta-pipewire = "dunfell" diff --git a/meta-agl/meta-pipewire/recipes-connectivity/bluez-alsa/bluez-alsa/0001-utils-add-a-gstreamer-helper-application-for-interco.patch b/meta-agl/meta-pipewire/recipes-connectivity/bluez-alsa/bluez-alsa/0001-utils-add-a-gstreamer-helper-application-for-interco.patch new file mode 100644 index 00000000..6c9a388c --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-connectivity/bluez-alsa/bluez-alsa/0001-utils-add-a-gstreamer-helper-application-for-interco.patch @@ -0,0 +1,517 @@ +From f2e6a0a324106b40195f88953e55a355875d2b1b Mon Sep 17 00:00:00 2001 +From: George Kiagiadakis +Date: Fri, 4 Oct 2019 20:51:24 +0300 +Subject: [PATCH] utils: add a gstreamer helper application for interconnection + with pipewire + +Unfortunately, the bluez-alsa PCM plugin does not work correctly +when it is used through pipewire (or gstreamer, or anywhere really...). + +Thanfully, the bluez-alsa PCM plugin is only a simple client that +reads/writes on a file descriptor that was opened by bluealsa. +This allows us to use bluealsa without the PCM plugin, just like it +is done in the aplay.c util. + +This one uses GStreamer to implement the plumbing between pipewire +and the file descriptor. On the reading side we are also doing some +tricks to ensure a smooth stream, which is not the case for the +stream that is coming out of bluealsa. + +This helper is implemented as a patch to bluez-alsa so that it can +use its internal private API. In the future this needs some re-thinking. + +Upstream-Status: Inappropriate +--- + configure.ac | 7 + + utils/Makefile.am | 20 +++ + utils/gst-helper.c | 432 +++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 459 insertions(+) + create mode 100644 utils/gst-helper.c + +diff --git a/configure.ac b/configure.ac +index 4825afa..9125871 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -141,6 +141,13 @@ AM_COND_IF([ENABLE_HCITOP], [ + PKG_CHECK_MODULES([NCURSES], [ncurses]) + ]) + ++AC_ARG_ENABLE([gsthelper], ++ [AS_HELP_STRING([--enable-gsthelper], [enable building of gsthelper tool])]) ++AM_CONDITIONAL([ENABLE_GSTHELPER], [test "x$enable_gsthelper" = "xyes"]) ++AM_COND_IF([ENABLE_GSTHELPER], [ ++ PKG_CHECK_MODULES([GST], [gstreamer-1.0 glib-2.0]) ++]) ++ + AC_ARG_ENABLE([test], + [AS_HELP_STRING([--enable-test], [enable unit test])]) + AM_CONDITIONAL([ENABLE_TEST], [test "x$enable_test" = "xyes"]) +diff --git a/utils/Makefile.am b/utils/Makefile.am +index 9057f2c..9790474 100644 +--- a/utils/Makefile.am ++++ b/utils/Makefile.am +@@ -47,3 +47,23 @@ hcitop_LDADD = \ + @LIBBSD_LIBS@ \ + @NCURSES_LIBS@ + endif ++ ++if ENABLE_GSTHELPER ++bin_PROGRAMS += bluealsa-gst-helper ++bluealsa_gst_helper_SOURCES = \ ++ ../src/shared/dbus-client.c \ ++ ../src/shared/ffb.c \ ++ ../src/shared/log.c \ ++ gst-helper.c ++bluealsa_gst_helper_CFLAGS = \ ++ -I$(top_srcdir)/src \ ++ @ALSA_CFLAGS@ \ ++ @BLUEZ_CFLAGS@ \ ++ @DBUS1_CFLAGS@ \ ++ @GST_CFLAGS@ ++bluealsa_gst_helper_LDADD = \ ++ @ALSA_LIBS@ \ ++ @BLUEZ_LIBS@ \ ++ @DBUS1_LIBS@ \ ++ @GST_LIBS@ ++endif +diff --git a/utils/gst-helper.c b/utils/gst-helper.c +new file mode 100644 +index 0000000..de1d47c +--- /dev/null ++++ b/utils/gst-helper.c +@@ -0,0 +1,432 @@ ++/* Bluez-Alsa PipeWire integration GStreamer helper ++ * ++ * Copyright © 2016-2019 Arkadiusz Bokowy ++ * Copyright © 2019 Collabora Ltd. ++ * @author George Kiagiadakis ++ * ++ * SPDX-License-Identifier: MIT ++ */ ++ ++#if HAVE_CONFIG_H ++# include ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include "shared/dbus-client.h" ++#include "shared/defs.h" ++#include "shared/ffb.h" ++#include "shared/log.h" ++ ++struct worker { ++ /* used BlueALSA PCM device */ ++ struct ba_pcm ba_pcm; ++ /* file descriptor of PCM FIFO */ ++ int ba_pcm_fd; ++ /* file descriptor of PCM control */ ++ int ba_pcm_ctrl_fd; ++ /* the gstreamer pipelines (sink & source) */ ++ GstElement *pipeline[2]; ++ /* the queue & pwaudiosink of the sink pipeline */ ++ GstElement *queue; ++ GstElement *pwelem; ++}; ++ ++static struct ba_dbus_ctx dbus_ctx; ++static GHashTable *workers; ++static bool main_loop_on = true; ++ ++static void ++main_loop_stop(int sig) ++{ ++ /* Call to this handler restores the default action, so on the ++ * second call the program will be forcefully terminated. */ ++ ++ struct sigaction sigact = { .sa_handler = SIG_DFL }; ++ sigaction(sig, &sigact, NULL); ++ ++ main_loop_on = false; ++} ++ ++static GstBusSyncReply ++bus_sync_handler(GstBus *bus, GstMessage *message, gpointer user_data) ++{ ++ struct worker *w = user_data; ++ GstState s; ++ ++ switch (GST_MESSAGE_TYPE (message)) { ++ case GST_MESSAGE_REQUEST_STATE: ++ gst_message_parse_request_state (message, &s); ++ ++ debug ("corked: %d", (s == GST_STATE_PAUSED)); ++ ++ /* drop queue data when corked */ ++ g_object_set (w->queue, ++ "leaky", (s == GST_STATE_PAUSED) ? 2 /* downstream */ : 0 /* no */, ++ NULL); ++ gst_element_set_state (w->pwelem, s); ++ ++ /* flush the queue when resuming */ ++ if (s == GST_STATE_PLAYING) { ++ gst_element_send_event (w->queue, gst_event_new_flush_start ()); ++ gst_element_send_event (w->queue, gst_event_new_flush_stop (FALSE)); ++ } ++ break; ++ default: ++ break; ++ } ++ ++ gst_message_unref (message); ++ return GST_BUS_DROP; ++} ++ ++static int ++worker_start_pipeline(struct worker *w, int id, int mode, int profile) ++{ ++ GError *gerr = NULL; ++ DBusError err = DBUS_ERROR_INIT; ++ const gchar * role = NULL; ++ ++ if (w->pipeline[id]) ++ return 0; ++ ++ if (!bluealsa_dbus_pcm_open(&dbus_ctx, w->ba_pcm.pcm_path, mode, ++ &w->ba_pcm_fd, &w->ba_pcm_ctrl_fd, &err)) { ++ error("Couldn't open PCM: %s", err.message); ++ dbus_error_free(&err); ++ goto fail; ++ } ++ ++ if (mode == BA_PCM_FLAG_SINK) { ++ debug("sink start"); ++ w->pipeline[id] = gst_parse_launch( ++ /* add a silent live source to ensure a perfect live stream on the ++ output, even when the bt device is not sending or has gaps; ++ this also effectively changes the clock to be the system clock, ++ which is the same clock used by bluez-alsa on the sending side */ ++ "audiotestsrc is-live=true wave=silence ! capsfilter name=capsf " ++ "! audiomixer name=m " ++ /* mix the input from bluez-alsa using fdsrc; rawaudioparse ++ is necessary to convert bytes to time and align the buffers */ ++ "fdsrc name=fdelem do-timestamp=true ! capsfilter name=capsf2 " ++ "! rawaudioparse use-sink-caps=true ! m. " ++ /* take the mixer output, convert and push to pipewire */ ++ "m.src ! capsfilter name=capsf3 ! audioconvert ! audioresample " ++ "! audio/x-raw,format=F32LE,rate=48000 ! identity sync=true " ++ "! queue name=queue leaky=no max-size-time=0 max-size-buffers=0 max-size-bytes=192000 " ++ "! pwaudiosink name=pwelem", ++ &gerr); ++ ++ /* a2dp is for music, sco is for calls */ ++ role = (profile == BA_PCM_FLAG_PROFILE_A2DP) ? "Multimedia" : "Communication"; ++ } ++ else if (mode == BA_PCM_FLAG_SOURCE && profile == BA_PCM_FLAG_PROFILE_SCO) { ++ debug("source start"); ++ w->pipeline[id] = gst_parse_launch( ++ /* read from pipewire and put the buffers on a leaky queue, which ++ will essentially allow pwaudiosrc to continue working while ++ the fdsink is blocked (when there is no phone call in progress). ++ 9600 bytes = 50ms @ F32LE/1ch/48000 ++ */ ++ "pwaudiosrc name=pwelem ! audio/x-raw,format=F32LE,rate=48000 " ++ "! queue name=queue leaky=downstream max-size-time=0 max-size-buffers=0 max-size-bytes=9600 " ++ "! audioconvert ! audioresample ! capsfilter name=capsf " ++ "! fdsink name=fdelem", &gerr); ++ ++ role = "Communication"; ++ } ++ ++ if (gerr) { ++ error("Failed to start pipeline: %s", gerr->message); ++ g_error_free(gerr); ++ goto fail; ++ } ++ ++ if (w->pipeline[id]) { ++ g_autofree gchar *capsstr = NULL; ++ g_autoptr (GstElement) fdelem = gst_bin_get_by_name(GST_BIN(w->pipeline[id]), "fdelem"); ++ g_autoptr (GstElement) pwelem = gst_bin_get_by_name(GST_BIN(w->pipeline[id]), "pwelem"); ++ g_autoptr (GstElement) queue = gst_bin_get_by_name(GST_BIN(w->pipeline[id]), "queue"); ++ g_autoptr (GstElement) capsf = gst_bin_get_by_name(GST_BIN(w->pipeline[id]), "capsf"); ++ g_autoptr (GstElement) capsf2 = gst_bin_get_by_name(GST_BIN(w->pipeline[id]), "capsf2"); ++ g_autoptr (GstElement) capsf3 = gst_bin_get_by_name(GST_BIN(w->pipeline[id]), "capsf3"); ++ g_autoptr (GstCaps) caps = gst_caps_new_simple("audio/x-raw", ++ "format", G_TYPE_STRING, "S16LE", ++ "layout", G_TYPE_STRING, "interleaved", ++ "channels", G_TYPE_INT, w->ba_pcm.channels, ++ "rate", G_TYPE_INT, w->ba_pcm.sampling, ++ NULL); ++ g_autoptr (GstStructure) stream_props = gst_structure_new("props", ++ "media.role", G_TYPE_STRING, role, ++ "bluealsa.profile", G_TYPE_STRING, ++ (profile == BA_PCM_FLAG_PROFILE_SCO) ? "sco" : "a2dp", ++ NULL); ++ ++ g_object_set(capsf, "caps", caps, NULL); ++ if (capsf2) ++ g_object_set(capsf2, "caps", caps, NULL); ++ if (capsf3) ++ g_object_set(capsf3, "caps", caps, NULL); ++ ++ capsstr = gst_caps_to_string (caps); ++ debug(" caps: %s", capsstr); ++ ++ g_object_set(fdelem, "fd", w->ba_pcm_fd, NULL); ++ g_object_set(pwelem, "stream-properties", stream_props, NULL); ++ ++ if (mode == BA_PCM_FLAG_SINK) { ++ g_autoptr (GstBus) bus = gst_pipeline_get_bus(GST_PIPELINE(w->pipeline[id])); ++ gst_bus_set_sync_handler(bus, bus_sync_handler, w, NULL); ++ w->queue = queue; ++ w->pwelem = pwelem; ++ } ++ ++ gst_element_set_state(w->pipeline[id], GST_STATE_PLAYING); ++ } ++ ++ return 0; ++fail: ++ g_clear_object(&w->pipeline[id]); ++ return -1; ++} ++ ++static int ++worker_start(struct worker *w) ++{ ++ int mode = w->ba_pcm.flags & (BA_PCM_FLAG_SOURCE | BA_PCM_FLAG_SINK); ++ int profile = w->ba_pcm.flags & (BA_PCM_FLAG_PROFILE_A2DP | BA_PCM_FLAG_PROFILE_SCO); ++ /* human-readable BT address */ ++ char addr[18]; ++ ++ g_return_val_if_fail (profile != 0 && profile != (BA_PCM_FLAG_PROFILE_A2DP | BA_PCM_FLAG_PROFILE_SCO), -1); ++ ++ ba2str(&w->ba_pcm.addr, addr); ++ debug("%p: worker start addr:%s, mode:0x%x, profile:0x%x", w, addr, mode, profile); ++ ++ if (mode & BA_PCM_FLAG_SINK) ++ worker_start_pipeline(w, 0, BA_PCM_FLAG_SINK, profile); ++ if (mode & BA_PCM_FLAG_SOURCE) ++ worker_start_pipeline(w, 1, BA_PCM_FLAG_SOURCE, profile); ++} ++ ++static int ++worker_stop(struct worker *w) ++{ ++ debug("stop worker %p", w); ++ if (w->pipeline[0]) { ++ gst_element_set_state(w->pipeline[0], GST_STATE_NULL); ++ g_clear_object(&w->pipeline[0]); ++ } ++ if (w->pipeline[1]) { ++ gst_element_set_state(w->pipeline[1], GST_STATE_NULL); ++ g_clear_object(&w->pipeline[1]); ++ } ++ if (w->ba_pcm_fd != -1) { ++ close(w->ba_pcm_fd); ++ w->ba_pcm_fd = -1; ++ } ++ if (w->ba_pcm_ctrl_fd != -1) { ++ close(w->ba_pcm_ctrl_fd); ++ w->ba_pcm_ctrl_fd = -1; ++ } ++ return 0; ++} ++ ++static int ++supervise_pcm_worker(struct worker *worker) ++{ ++ if (worker == NULL) ++ return -1; ++ ++ /* no mode? */ ++ if (worker->ba_pcm.flags & (BA_PCM_FLAG_SOURCE | BA_PCM_FLAG_SINK) == 0) ++ goto stop; ++ ++ /* no profile? */ ++ if (worker->ba_pcm.flags & (BA_PCM_FLAG_PROFILE_A2DP | BA_PCM_FLAG_PROFILE_SCO) == 0) ++ goto stop; ++ ++ /* check whether SCO has selected codec */ ++ if (worker->ba_pcm.flags & BA_PCM_FLAG_PROFILE_SCO && ++ worker->ba_pcm.codec == 0) { ++ debug("Skipping SCO with codec not selected"); ++ goto stop; ++ } ++ ++start: ++ return worker_start(worker); ++stop: ++ return worker_stop(worker); ++} ++ ++static void ++worker_new(struct ba_pcm *pcm) ++{ ++ struct worker *w = g_slice_new0 (struct worker); ++ memcpy(&w->ba_pcm, pcm, sizeof(struct ba_pcm)); ++ w->ba_pcm_fd = -1; ++ w->ba_pcm_ctrl_fd = -1; ++ g_hash_table_insert(workers, w->ba_pcm.pcm_path, w); ++ supervise_pcm_worker(w); ++} ++ ++static DBusHandlerResult ++dbus_signal_handler(DBusConnection *conn, DBusMessage *message, void *data) ++{ ++ (void)conn; ++ (void)data; ++ ++ const char *path = dbus_message_get_path(message); ++ const char *interface = dbus_message_get_interface(message); ++ const char *signal = dbus_message_get_member(message); ++ ++ DBusMessageIter iter; ++ struct worker *worker; ++ ++ if (strcmp(interface, BLUEALSA_INTERFACE_MANAGER) == 0) { ++ ++ if (strcmp(signal, "PCMAdded") == 0) { ++ struct ba_pcm pcm; ++ if (!dbus_message_iter_init(message, &iter) || ++ !bluealsa_dbus_message_iter_get_pcm(&iter, NULL, &pcm)) { ++ error("Couldn't add new PCM: %s", "Invalid signal signature"); ++ goto fail; ++ } ++ worker_new(&pcm); ++ return DBUS_HANDLER_RESULT_HANDLED; ++ } ++ ++ if (strcmp(signal, "PCMRemoved") == 0) { ++ if (!dbus_message_iter_init(message, &iter) || ++ dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_OBJECT_PATH) { ++ error("Couldn't remove PCM: %s", "Invalid signal signature"); ++ goto fail; ++ } ++ dbus_message_iter_get_basic(&iter, &path); ++ g_hash_table_remove(workers, path); ++ return DBUS_HANDLER_RESULT_HANDLED; ++ } ++ ++ } ++ ++ if (strcmp(interface, DBUS_INTERFACE_PROPERTIES) == 0) { ++ worker = g_hash_table_lookup(workers, path); ++ if (!worker) ++ goto fail; ++ if (!dbus_message_iter_init(message, &iter) || ++ dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING) { ++ error("Couldn't update PCM: %s", "Invalid signal signature"); ++ goto fail; ++ } ++ dbus_message_iter_get_basic(&iter, &interface); ++ dbus_message_iter_next(&iter); ++ if (!bluealsa_dbus_message_iter_get_pcm_props(&iter, NULL, &worker->ba_pcm)) ++ goto fail; ++ supervise_pcm_worker(worker); ++ return DBUS_HANDLER_RESULT_HANDLED; ++ } ++ ++fail: ++ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; ++} ++ ++static void ++destroy_worker(void *worker) ++{ ++ struct worker *w = worker; ++ worker_stop(w); ++ g_slice_free(struct worker, w); ++} ++ ++int ++main(int argc, char *argv[]) ++{ ++ int ret = EXIT_SUCCESS; ++ ++ log_open(argv[0], false, false); ++ gst_init(&argc, &argv); ++ dbus_threads_init_default(); ++ ++ DBusError err = DBUS_ERROR_INIT; ++ if (!bluealsa_dbus_connection_ctx_init(&dbus_ctx, BLUEALSA_SERVICE, &err)) { ++ error("Couldn't initialize D-Bus context: %s", err.message); ++ return EXIT_FAILURE; ++ } ++ ++ bluealsa_dbus_connection_signal_match_add(&dbus_ctx, ++ BLUEALSA_SERVICE, NULL, BLUEALSA_INTERFACE_MANAGER, "PCMAdded", NULL); ++ bluealsa_dbus_connection_signal_match_add(&dbus_ctx, ++ BLUEALSA_SERVICE, NULL, BLUEALSA_INTERFACE_MANAGER, "PCMRemoved", NULL); ++ bluealsa_dbus_connection_signal_match_add(&dbus_ctx, ++ BLUEALSA_SERVICE, NULL, DBUS_INTERFACE_PROPERTIES, "PropertiesChanged", ++ "arg0='"BLUEALSA_INTERFACE_PCM"'"); ++ ++ if (!dbus_connection_add_filter(dbus_ctx.conn, dbus_signal_handler, NULL, NULL)) { ++ error("Couldn't add D-Bus filter: %s", err.message); ++ return EXIT_FAILURE; ++ } ++ ++ workers = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, destroy_worker); ++ ++ { ++ struct ba_pcm *pcms = NULL; ++ size_t pcms_count = 0, i; ++ ++ if (!bluealsa_dbus_get_pcms(&dbus_ctx, &pcms, &pcms_count, &err)) ++ warn("Couldn't get BlueALSA PCM list: %s", err.message); ++ ++ for (i = 0; i < pcms_count; i++) { ++ worker_new(&pcms[i]); ++ } ++ ++ free(pcms); ++ } ++ ++ struct sigaction sigact = { .sa_handler = main_loop_stop }; ++ sigaction(SIGTERM, &sigact, NULL); ++ sigaction(SIGINT, &sigact, NULL); ++ ++ /* Ignore SIGPIPE, which may be received when writing to the bluealsa ++ socket when it is closed on the remote end */ ++ signal(SIGPIPE, SIG_IGN); ++ ++ debug("Starting main loop"); ++ while (main_loop_on) { ++ ++ struct pollfd pfds[10]; ++ nfds_t pfds_len = ARRAYSIZE(pfds); ++ ++ if (!bluealsa_dbus_connection_poll_fds(&dbus_ctx, pfds, &pfds_len)) { ++ error("Couldn't get D-Bus connection file descriptors"); ++ ret = EXIT_FAILURE; ++ goto out; ++ } ++ ++ if (poll(pfds, pfds_len, -1) == -1 && ++ errno == EINTR) ++ continue; ++ ++ if (bluealsa_dbus_connection_poll_dispatch(&dbus_ctx, pfds, pfds_len)) ++ while (dbus_connection_dispatch(dbus_ctx.conn) == DBUS_DISPATCH_DATA_REMAINS) ++ continue; ++ ++ } ++ ++out: ++ g_hash_table_unref(workers); ++ return ret; ++} +-- +2.24.0 + diff --git a/meta-agl/meta-pipewire/recipes-connectivity/bluez-alsa/bluez-alsa/bluealsa-gst-helper@.service b/meta-agl/meta-pipewire/recipes-connectivity/bluez-alsa/bluez-alsa/bluealsa-gst-helper@.service new file mode 100644 index 00000000..495ab622 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-connectivity/bluez-alsa/bluez-alsa/bluealsa-gst-helper@.service @@ -0,0 +1,18 @@ +[Unit] +Description=Bluetooth audio helper for user %i +Requires=pipewire@%i.socket bluez-alsa.service +After=pipewire@%i.socket bluez-alsa.service + +[Service] +Type=simple +Restart=on-failure +ExecStart=/usr/bin/bluealsa-gst-helper + +Environment=XDG_RUNTIME_DIR=/run/user/%i +Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%i/bus + +User=%i +Slice=user-%i.slice +SupplementaryGroups=audio +UMask=0077 +CapabilityBoundingSet= diff --git a/meta-agl/meta-pipewire/recipes-connectivity/bluez-alsa/bluez-alsa_git.bbappend b/meta-agl/meta-pipewire/recipes-connectivity/bluez-alsa/bluez-alsa_git.bbappend new file mode 100644 index 00000000..2f9699a8 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-connectivity/bluez-alsa/bluez-alsa_git.bbappend @@ -0,0 +1,35 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += "\ + file://0001-utils-add-a-gstreamer-helper-application-for-interco.patch \ + file://bluealsa-gst-helper@.service \ + " + +PACKAGECONFIG += "gsthelper" +PACKAGECONFIG[gsthelper] = "--enable-gsthelper, --disable-gsthelper, gstreamer1.0" + +do_install_append() { + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + # install the service file + mkdir -p ${D}${systemd_system_unitdir}/ + install -m 0644 ${WORKDIR}/bluealsa-gst-helper@.service ${D}${systemd_system_unitdir}/bluealsa-gst-helper@.service + + # enable the helper to start together with afm-user-session + mkdir -p ${D}${systemd_system_unitdir}/afm-user-session@.target.wants + ln -sf ../bluealsa-gst-helper@.service ${D}${systemd_system_unitdir}/afm-user-session@.target.wants/bluealsa-gst-helper@.service + fi +} + +PACKAGES =+ "${PN}-pipewire" + +FILES_${PN}-pipewire = "\ + ${bindir}/bluealsa-gst-helper \ + ${systemd_system_unitdir}/bluealsa-gst-helper@.service \ + ${systemd_system_unitdir}/afm-user-session@.target.wants/bluealsa-gst-helper@.service \ + " +RDEPENDS_${PN}-pipewire += "\ + bluez-alsa \ + pipewire \ + gstreamer1.0-plugins-base \ + gstreamer1.0-pipewire \ + " diff --git a/meta-agl/meta-pipewire/recipes-core/packagegroups/packagegroup-pipewire.bb b/meta-agl/meta-pipewire/recipes-core/packagegroups/packagegroup-pipewire.bb new file mode 100644 index 00000000..4020f1e2 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-core/packagegroups/packagegroup-pipewire.bb @@ -0,0 +1,17 @@ +SUMMARY = "PipeWire Media Server" +DESCRIPTION = "The set of packages required to use PipeWire in AGL" +LICENSE = "MIT & LGPL-2.1" + +inherit packagegroup + +PACKAGES = "\ + packagegroup-pipewire \ + " + +RDEPENDS_${PN} += "\ + agl-service-audiomixer \ + pipewire \ + pipewire-alsa \ + gstreamer1.0-pipewire \ + bluez-alsa-pipewire \ +" diff --git a/meta-agl/meta-pipewire/recipes-multimedia/agl-service-audiomixer/agl-service-audiomixer_git.bb b/meta-agl/meta-pipewire/recipes-multimedia/agl-service-audiomixer/agl-service-audiomixer_git.bb new file mode 100644 index 00000000..2a826119 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/agl-service-audiomixer/agl-service-audiomixer_git.bb @@ -0,0 +1,17 @@ +SUMMARY = "Audio Mixer Service Binding" +DESCRIPTION = "AGL Audio Mixer Service Binding" +SECTION = "apps" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;beginline=3;md5=e8ad01a5182f2c1b3a2640e9ea268264" + +PV = "0.1+git${SRCPV}" + +SRC_URI = "git://gerrit.automotivelinux.org/gerrit/apps/agl-service-audiomixer.git;protocol=https;branch=${AGL_BRANCH}" +SRCREV = "${AGL_APP_REVISION}" + +S = "${WORKDIR}/git" + +inherit cmake aglwgt pkgconfig + +DEPENDS += "pipewire wireplumber json-c" +RDEPENDS_${PN} = "agl-service-signal-composer" diff --git a/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire-conf-agl/client.env b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire-conf-agl/client.env new file mode 100644 index 00000000..9b44cee0 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire-conf-agl/client.env @@ -0,0 +1,10 @@ +# This file contains environment variables that will apply +# to pipewire clients started by the application framework + +# libpipewire by default tries to obtain real-time scheduling +# for the streaming thread. This is only useful on the desktop, disable here. +DISABLE_RTKIT=1 + +# Uncomment to enable libpipewire debug for clients +# 1=error, 2=warning, 3=info, 4=debug, 5=trace +#PIPEWIRE_DEBUG=4 diff --git a/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire-conf-agl/pipewire.conf.in b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire-conf-agl/pipewire.conf.in new file mode 100644 index 00000000..6c055bcf --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire-conf-agl/pipewire.conf.in @@ -0,0 +1,17 @@ +# daemon config file for PipeWire version "0.2.9" +# distributed by Automotive Grade Linux + +add-spa-lib audio.convert* audioconvert/libspa-audioconvert +add-spa-lib api.alsa.* alsa/libspa-alsa +add-spa-lib api.v4l2.* v4l2/libspa-v4l2 +add-spa-lib api.bluez5.* bluez5/libspa-bluez5 + +load-module libpipewire-module-protocol-native +load-module libpipewire-module-spa-node-factory +load-module libpipewire-module-client-node +load-module libpipewire-module-client-device +load-module libpipewire-module-access same-sec-label-mode=1 +load-module libpipewire-module-adapter +load-module libpipewire-module-link-factory +load-module libpipewire-module-session-manager +exec /usr/bin/wireplumber diff --git a/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire-conf-agl/server.env b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire-conf-agl/server.env new file mode 100644 index 00000000..c74b941d --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire-conf-agl/server.env @@ -0,0 +1,12 @@ +# This file contains environment variables that will apply +# to the pipewire daemon as well as its session manager + +# Disable rtkit for wireplumber, which is also a client +DISABLE_RTKIT=1 + +# Uncomment to enable wireplumber debug +#G_MESSAGES_DEBUG=all + +# Uncomment to enable pipewire debug +# 1=error, 2=warning, 3=info, 4=debug, 5=trace +#PIPEWIRE_DEBUG=4 diff --git a/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire-conf-agl_git.bb b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire-conf-agl_git.bb new file mode 100644 index 00000000..a28c6534 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire-conf-agl_git.bb @@ -0,0 +1,43 @@ +SUMMARY = "AGL configuration file for pipewire" +HOMEPAGE = "https://pipewire.org" +BUGTRACKER = "https://jira.automotivelinux.org" +AUTHOR = "George Kiagiadakis " +SECTION = "multimedia" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI = " \ + file://pipewire.conf.in \ + file://client.env \ + file://server.env \ + " + +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +do_install_append() { + # enable optional features in the config + BLUEZ5=${@bb.utils.contains('DISTRO_FEATURES', 'bluez5', '', '#', d)} + sed -e "s/#IF_BLUEZ5 /${BLUEZ5}/" ${WORKDIR}/pipewire.conf.in > ${WORKDIR}/pipewire.conf + + # install our custom config + install -d ${D}/${sysconfdir}/pipewire/ + install -m 0644 ${WORKDIR}/pipewire.conf ${D}${sysconfdir}/pipewire/pipewire.conf + + # install environment variable files + install -d ${D}/${sysconfdir}/afm/unit.env.d/ + install -m 0644 ${WORKDIR}/client.env ${D}/${sysconfdir}/afm/unit.env.d/pipewire + install -m 0644 ${WORKDIR}/server.env ${D}${sysconfdir}/pipewire/environment +} + +FILES_${PN} = "\ + ${sysconfdir}/pipewire/* \ + ${sysconfdir}/afm/unit.env.d/* \ +" +CONFFILES_${PN} += "\ + ${sysconfdir}/pipewire/* \ + ${sysconfdir}/afm/unit.env.d/* \ +" + +RPROVIDES_${PN} += "virtual/pipewire-config" diff --git a/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire.inc b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire.inc new file mode 100644 index 00000000..b3081ca4 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire.inc @@ -0,0 +1,120 @@ +SUMMARY = "Multimedia processing server for Linux" +HOMEPAGE = "https://pipewire.org" +BUGTRACKER = "https://github.com/PipeWire/pipewire/issues" +AUTHOR = "Wim Taymans " +SECTION = "multimedia" + +LICENSE = "MIT & LGPL-2.1" +LIC_FILES_CHKSUM = "\ + file://COPYING;beginline=3;md5=b3adc775ca6ee80056383a5ae814cc75 \ + file://pipewire-alsa/LICENSE;md5=fc178bcd425090939a8b634d1d6a9594 \ + file://pipewire-jack/LICENSE;md5=fc178bcd425090939a8b634d1d6a9594 \ + file://pipewire-pulseaudio/LICENSE;md5=fc178bcd425090939a8b634d1d6a9594 \ +" + +inherit meson pkgconfig systemd manpages + +DEPENDS = "dbus" + +PACKAGECONFIG ??= "\ + ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'bluez5', d)} \ + alsa audioconvert audiomixer \ + pipewire-alsa \ + gstreamer \ +" + +GST_VER = "1.0" + +# systemd integration +PACKAGECONFIG[systemd] = "-Dsystemd=true,-Dsystemd=false,systemd" + +# SPA plugins +PACKAGECONFIG[alsa] = "-Dalsa=true,-Dalsa=false,udev alsa-lib" +PACKAGECONFIG[audioconvert] = "-Daudioconvert=true,-Daudioconvert=false," +PACKAGECONFIG[audiomixer] = "-Daudiomixer=true,-Daudiomixer=false," +PACKAGECONFIG[audiotestsrc] = "-Daudiotestsrc=true,-Daudiotestsrc=false, " +PACKAGECONFIG[bluez5] = "-Dbluez5=true,-Dbluez5=false,bluez5 sbc" +PACKAGECONFIG[jack] = "-Djack=true,-Djack=false,jack" +PACKAGECONFIG[v4l2] = "-Dv4l2=true,-Dv4l2=false,udev v4l-utils" +PACKAGECONFIG[videotestsrc] = "-Dvideotestsrc=true,-Dvideotestsrc=false, " +PACKAGECONFIG[vulkan] = "-Dvulkan=true,-Dvulkan=false,vulkan" + +# alsa plugin to redirect audio to pipewire +PACKAGECONFIG[pipewire-alsa] = "-Dpipewire-alsa=true,-Dpipewire-alsa=false,alsa-lib" +# pulseaudio drop-in replacement library +PACKAGECONFIG[pipewire-pulseaudio] = "-Dpipewire-pulseaudio=true,-Dpipewire-pulseaudio=false,pulseaudio glib-2.0" +# jack drop-in replacement library +PACKAGECONFIG[pipewire-jack] = "-Dpipewire-jack=true,-Dpipewire-jack=false,jack" + +# GStreamer plugins +PACKAGECONFIG[gstreamer] = "-Dgstreamer=true,-Dgstreamer=false,glib-2.0 gstreamer${GST_VER} gstreamer${GST_VER}-plugins-base" + +# man pages +PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false,libxml-parser-perl-native" + +do_install_append() { + # only install the alsa config file if the alsa-lib plugin has been built + # this avoids creating the pipewire-alsa package when the pipewire-alsa + # feature is not enabled + if [ -d ${D}${libdir}/alsa-lib ] + then + mkdir -p ${D}${datadir}/alsa/alsa.conf.d + install -m 0644 ${S}/pipewire-alsa/conf/50-pipewire.conf ${D}${datadir}/alsa/alsa.conf.d/50-pipewire.conf + fi +} + +PACKAGES =+ "\ + ${PN}-spa-plugins \ + ${PN}-alsa \ + ${PN}-pulseaudio \ + ${PN}-jack \ + ${PN}-config \ + gstreamer${GST_VER}-${PN} \ + lib${PN} \ + lib${PN}-modules \ +" + +FILES_${PN} = "\ + ${bindir}/pipewire* \ + ${systemd_user_unitdir}/* \ +" + +FILES_lib${PN} = "\ + ${libdir}/libpipewire-*.so.* \ +" + +FILES_lib${PN}-modules = "\ + ${libdir}/pipewire-*/* \ +" + +FILES_${PN}-spa-plugins = "\ + ${bindir}/spa-* \ + ${libdir}/spa/* \ +" + +FILES_${PN}-alsa = "\ + ${libdir}/alsa-lib/* \ + ${datadir}/alsa/alsa.conf.d/50-pipewire.conf \ +" + +FILES_${PN}-pulseaudio = "\ + ${libdir}/libpulse*.so.* \ +" + +FILES_gstreamer${GST_VER}-${PN} = "\ + ${libdir}/gstreamer-${GST_VER}/* \ +" + +RDEPENDS_lib${PN} += "lib${PN}-modules ${PN}-spa-plugins" + +# The default pipewire config. +# Replace in your own package using +# "virtual/pipewire-config" +FILES_${PN}-config = "\ + ${sysconfdir}/pipewire/pipewire.conf \ +" +CONFFILES_${PN}-config += "\ + ${sysconfdir}/pipewire/pipewire.conf \ +" +RPROVIDES_${PN}-config += "virtual/pipewire-config" diff --git a/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-meson-revert-version-check-to-require-meson-0.47-not.patch b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-meson-revert-version-check-to-require-meson-0.47-not.patch new file mode 100644 index 00000000..4e7bb0d4 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-meson-revert-version-check-to-require-meson-0.47-not.patch @@ -0,0 +1,30 @@ +From 5a249321aa84cd74e3d83bcd555c85fba3cd682d Mon Sep 17 00:00:00 2001 +From: George Kiagiadakis +Date: Sun, 22 Sep 2019 17:59:19 +0300 +Subject: [PATCH] meson: revert version check to require meson 0.47, not 0.50 + +meson 0.50 is not really needed, but there are some strange warnings +if you require an older version; in any case, AGL does not have 0.50 +yet, so let's not fail compilation because of that... + +Upstream-Status: Inappropriate [workaround] +--- + meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 2734b0d2..c9da6b4d 100644 +--- a/meson.build ++++ b/meson.build +@@ -1,7 +1,7 @@ + project('pipewire', ['c' ], + version : '0.2.9', + license : 'MIT', +- meson_version : '>= 0.50.0', ++ meson_version : '>= 0.47.0', + default_options : [ 'warning_level=1', + 'c_std=gnu99', + 'buildtype=debugoptimized' ]) +-- +2.24.0 + diff --git a/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-arm-build-with-mno-unaligned-access.patch b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-arm-build-with-mno-unaligned-access.patch new file mode 100644 index 00000000..2077af63 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0002-arm-build-with-mno-unaligned-access.patch @@ -0,0 +1,30 @@ +From e4b81946baf2d8c08de87088c01a1d87ae4f03d9 Mon Sep 17 00:00:00 2001 +From: George Kiagiadakis +Date: Mon, 24 Jun 2019 12:19:20 +0300 +Subject: [PATCH] arm: build with -mno-unaligned-access + +Upstream-Status: Inappropriate [workaround] +See also https://gitlab.freedesktop.org/pipewire/pipewire/issues/161 +--- + meson.build | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/meson.build b/meson.build +index c9da6b4d..5c121339 100644 +--- a/meson.build ++++ b/meson.build +@@ -52,6 +52,11 @@ if cc.get_id() == 'gcc' + language : 'c') + endif + ++if host_machine.cpu_family() == 'arm' ++ add_global_arguments('-mno-unaligned-access', ++ language: 'c') ++endif ++ + sse_args = '-msse' + sse2_args = '-msse2' + ssse3_args = '-mssse3' +-- +2.24.0 + diff --git a/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0003-gst-Implement-new-pwaudio-src-sink-elements-based-on.patch b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0003-gst-Implement-new-pwaudio-src-sink-elements-based-on.patch new file mode 100644 index 00000000..b3eba21f --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0003-gst-Implement-new-pwaudio-src-sink-elements-based-on.patch @@ -0,0 +1,1280 @@ +From 1b1f884a165ed7b2147affbdddf85a641d4cf180 Mon Sep 17 00:00:00 2001 +From: George Kiagiadakis +Date: Tue, 19 Feb 2019 18:23:19 +0200 +Subject: [PATCH] gst: Implement new pwaudio{src,sink} elements, based on + GstAudioBase{Src,Sink} + +These are much more reliable elements to use for audio data. +* GstAudioBaseSink provides a reliable clock implementation based + on the number of samples read/written +* on the pipewire side we make sure to dequeue, fill and enqueue + a single buffer inside the process() function, which avoids + underruns + +Both elements share a common ringbuffer that actually implements +the pipewire integration. + +Upstream-Status: Denied +See https://gitlab.freedesktop.org/pipewire/pipewire/merge_requests/140 +--- + src/gst/gstpipewire.c | 8 +- + src/gst/gstpwaudioringbuffer.c | 565 +++++++++++++++++++++++++++++++++ + src/gst/gstpwaudioringbuffer.h | 83 +++++ + src/gst/gstpwaudiosink.c | 207 ++++++++++++ + src/gst/gstpwaudiosink.h | 48 +++ + src/gst/gstpwaudiosrc.c | 200 ++++++++++++ + src/gst/gstpwaudiosrc.h | 48 +++ + src/gst/meson.build | 6 + + 8 files changed, 1164 insertions(+), 1 deletion(-) + create mode 100644 src/gst/gstpwaudioringbuffer.c + create mode 100644 src/gst/gstpwaudioringbuffer.h + create mode 100644 src/gst/gstpwaudiosink.c + create mode 100644 src/gst/gstpwaudiosink.h + create mode 100644 src/gst/gstpwaudiosrc.c + create mode 100644 src/gst/gstpwaudiosrc.h + +diff --git a/src/gst/gstpipewire.c b/src/gst/gstpipewire.c +index 4040264b..68fd446f 100644 +--- a/src/gst/gstpipewire.c ++++ b/src/gst/gstpipewire.c +@@ -40,6 +40,8 @@ + #include "gstpipewiresrc.h" + #include "gstpipewiresink.h" + #include "gstpipewiredeviceprovider.h" ++#include "gstpwaudiosrc.h" ++#include "gstpwaudiosink.h" + + GST_DEBUG_CATEGORY (pipewire_debug); + +@@ -52,12 +54,16 @@ plugin_init (GstPlugin *plugin) + GST_TYPE_PIPEWIRE_SRC); + gst_element_register (plugin, "pipewiresink", GST_RANK_NONE, + GST_TYPE_PIPEWIRE_SINK); ++ gst_element_register (plugin, "pwaudiosrc", GST_RANK_NONE, ++ GST_TYPE_PW_AUDIO_SRC); ++ gst_element_register (plugin, "pwaudiosink", GST_RANK_NONE, ++ GST_TYPE_PW_AUDIO_SINK); + + if (!gst_device_provider_register (plugin, "pipewiredeviceprovider", + GST_RANK_PRIMARY + 1, GST_TYPE_PIPEWIRE_DEVICE_PROVIDER)) + return FALSE; + +- GST_DEBUG_CATEGORY_INIT (pipewire_debug, "pipewire", 0, "PipeWirie elements"); ++ GST_DEBUG_CATEGORY_INIT (pipewire_debug, "pipewire", 0, "PipeWire elements"); + + return TRUE; + } +diff --git a/src/gst/gstpwaudioringbuffer.c b/src/gst/gstpwaudioringbuffer.c +new file mode 100644 +index 00000000..babf2d83 +--- /dev/null ++++ b/src/gst/gstpwaudioringbuffer.c +@@ -0,0 +1,565 @@ ++/* PipeWire ++ * ++ * Copyright © 2018 Wim Taymans ++ * Copyright © 2019 Collabora Ltd. ++ * @author George Kiagiadakis ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++ * DEALINGS IN THE SOFTWARE. ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include "gstpwaudioringbuffer.h" ++ ++#include ++#include ++ ++GST_DEBUG_CATEGORY_STATIC (pw_audio_ring_buffer_debug); ++#define GST_CAT_DEFAULT pw_audio_ring_buffer_debug ++ ++#define gst_pw_audio_ring_buffer_parent_class parent_class ++G_DEFINE_TYPE (GstPwAudioRingBuffer, gst_pw_audio_ring_buffer, GST_TYPE_AUDIO_RING_BUFFER); ++ ++enum ++{ ++ PROP_0, ++ PROP_ELEMENT, ++ PROP_DIRECTION, ++ PROP_PROPS ++}; ++ ++static void ++gst_pw_audio_ring_buffer_init (GstPwAudioRingBuffer * self) ++{ ++ self->loop = pw_loop_new (NULL); ++ self->main_loop = pw_thread_loop_new (self->loop, "pw-audioringbuffer-loop"); ++ self->core = pw_core_new (self->loop, NULL, 0); ++} ++ ++static void ++gst_pw_audio_ring_buffer_finalize (GObject * object) ++{ ++ GstPwAudioRingBuffer *self = GST_PW_AUDIO_RING_BUFFER (object); ++ ++ pw_core_destroy (self->core); ++ pw_thread_loop_destroy (self->main_loop); ++ pw_loop_destroy (self->loop); ++} ++ ++static void ++gst_pw_audio_ring_buffer_set_property (GObject * object, guint prop_id, ++ const GValue * value, GParamSpec * pspec) ++{ ++ GstPwAudioRingBuffer *self = GST_PW_AUDIO_RING_BUFFER (object); ++ ++ switch (prop_id) { ++ case PROP_ELEMENT: ++ self->elem = g_value_get_object (value); ++ break; ++ ++ case PROP_DIRECTION: ++ self->direction = g_value_get_int (value); ++ break; ++ ++ case PROP_PROPS: ++ self->props = g_value_get_pointer (value); ++ break; ++ ++ default: ++ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); ++ break; ++ } ++} ++ ++static void ++on_remote_state_changed (void *data, enum pw_remote_state old, ++ enum pw_remote_state state, const char *error) ++{ ++ GstPwAudioRingBuffer *self = GST_PW_AUDIO_RING_BUFFER (data); ++ ++ GST_DEBUG_OBJECT (self->elem, "got remote state %d", state); ++ ++ switch (state) { ++ case PW_REMOTE_STATE_UNCONNECTED: ++ case PW_REMOTE_STATE_CONNECTING: ++ case PW_REMOTE_STATE_CONNECTED: ++ break; ++ case PW_REMOTE_STATE_ERROR: ++ GST_ELEMENT_ERROR (self->elem, RESOURCE, FAILED, ++ ("remote error: %s", error), (NULL)); ++ break; ++ } ++ pw_thread_loop_signal (self->main_loop, FALSE); ++} ++ ++static const struct pw_remote_events remote_events = { ++ PW_VERSION_REMOTE_EVENTS, ++ .state_changed = on_remote_state_changed, ++}; ++ ++static gboolean ++wait_for_remote_state (GstPwAudioRingBuffer *self, ++ enum pw_remote_state target) ++{ ++ while (TRUE) { ++ enum pw_remote_state state = pw_remote_get_state (self->remote, NULL); ++ if (state == target) ++ return TRUE; ++ if (state == PW_REMOTE_STATE_ERROR) ++ return FALSE; ++ pw_thread_loop_wait (self->main_loop); ++ } ++} ++ ++static gboolean ++gst_pw_audio_ring_buffer_open_device (GstAudioRingBuffer *buf) ++{ ++ GstPwAudioRingBuffer *self = GST_PW_AUDIO_RING_BUFFER (buf); ++ ++ GST_DEBUG_OBJECT (self->elem, "open device"); ++ ++ if (pw_thread_loop_start (self->main_loop) < 0) ++ goto mainloop_error; ++ ++ pw_thread_loop_lock (self->main_loop); ++ ++ self->remote = pw_remote_new (self->core, NULL, 0); ++ pw_remote_add_listener (self->remote, &self->remote_listener, &remote_events, ++ self); ++ ++ if (self->props->fd == -1) ++ pw_remote_connect (self->remote); ++ else ++ pw_remote_connect_fd (self->remote, self->props->fd); ++ ++ GST_DEBUG_OBJECT (self->elem, "waiting for connection"); ++ ++ if (!wait_for_remote_state (self, PW_REMOTE_STATE_CONNECTED)) ++ goto connect_error; ++ ++ pw_thread_loop_unlock (self->main_loop); ++ ++ return TRUE; ++ ++ /* ERRORS */ ++mainloop_error: ++ { ++ GST_ELEMENT_ERROR (self->elem, RESOURCE, FAILED, ++ ("Failed to start mainloop"), (NULL)); ++ return FALSE; ++ } ++connect_error: ++ { ++ pw_thread_loop_unlock (self->main_loop); ++ return FALSE; ++ } ++} ++ ++static gboolean ++gst_pw_audio_ring_buffer_close_device (GstAudioRingBuffer *buf) ++{ ++ GstPwAudioRingBuffer *self = GST_PW_AUDIO_RING_BUFFER (buf); ++ ++ GST_DEBUG_OBJECT (self->elem, "closing device"); ++ ++ pw_thread_loop_lock (self->main_loop); ++ if (self->remote) { ++ pw_remote_disconnect (self->remote); ++ wait_for_remote_state (self, PW_REMOTE_STATE_UNCONNECTED); ++ } ++ pw_thread_loop_unlock (self->main_loop); ++ ++ pw_thread_loop_stop (self->main_loop); ++ ++ if (self->remote) { ++ pw_remote_destroy (self->remote); ++ self->remote = NULL; ++ } ++ return TRUE; ++} ++ ++static void ++on_stream_state_changed (void *data, enum pw_stream_state old, ++ enum pw_stream_state state, const char *error) ++{ ++ GstPwAudioRingBuffer *self = GST_PW_AUDIO_RING_BUFFER (data); ++ GstMessage *msg; ++ ++ GST_DEBUG_OBJECT (self->elem, "got stream state: %s", ++ pw_stream_state_as_string (state)); ++ ++ switch (state) { ++ case PW_STREAM_STATE_ERROR: ++ GST_ELEMENT_ERROR (self->elem, RESOURCE, FAILED, ++ ("stream error: %s", error), (NULL)); ++ break; ++ case PW_STREAM_STATE_UNCONNECTED: ++ GST_ELEMENT_ERROR (self->elem, RESOURCE, FAILED, ++ ("stream disconnected unexpectedly"), (NULL)); ++ break; ++ case PW_STREAM_STATE_CONNECTING: ++ break; ++ case PW_STREAM_STATE_PAUSED: ++ if (old == PW_STREAM_STATE_STREAMING) { ++ if (GST_STATE (self->elem) != GST_STATE_PAUSED && ++ GST_STATE_TARGET (self->elem) != GST_STATE_PAUSED) { ++ GST_DEBUG_OBJECT (self->elem, "requesting GST_STATE_PAUSED"); ++ msg = gst_message_new_request_state (GST_OBJECT (self->elem), ++ GST_STATE_PAUSED); ++ gst_element_post_message (self->elem, msg); ++ } ++ } ++ break; ++ case PW_STREAM_STATE_STREAMING: ++ if (GST_STATE (self->elem) != GST_STATE_PLAYING && ++ GST_STATE_TARGET (self->elem) != GST_STATE_PLAYING) { ++ GST_DEBUG_OBJECT (self->elem, "requesting GST_STATE_PLAYING"); ++ msg = gst_message_new_request_state (GST_OBJECT (self->elem), ++ GST_STATE_PLAYING); ++ gst_element_post_message (self->elem, msg); ++ } ++ break; ++ } ++ pw_thread_loop_signal (self->main_loop, FALSE); ++} ++ ++static gboolean ++wait_for_stream_state (GstPwAudioRingBuffer *self, ++ enum pw_stream_state target) ++{ ++ while (TRUE) { ++ enum pw_stream_state state = pw_stream_get_state (self->stream, NULL); ++ if (state >= target) ++ return TRUE; ++ if (state == PW_STREAM_STATE_ERROR || state == PW_STREAM_STATE_UNCONNECTED) ++ return FALSE; ++ pw_thread_loop_wait (self->main_loop); ++ } ++} ++ ++static void ++on_stream_param_changed (void *data, uint32_t id, const struct spa_pod *format) ++{ ++ GstPwAudioRingBuffer *self = GST_PW_AUDIO_RING_BUFFER (data); ++ const struct spa_pod *params[1]; ++ struct spa_pod_builder b = { NULL }; ++ uint8_t buffer[512]; ++ ++ if (format == NULL || id != SPA_PARAM_Format) ++ return; ++ ++ spa_pod_builder_init (&b, buffer, sizeof (buffer)); ++ params[0] = spa_pod_builder_add_object (&b, ++ SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers, ++ SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(16, 1, INT32_MAX), ++ SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1), ++ SPA_PARAM_BUFFERS_size, SPA_POD_Int(self->segsize), ++ SPA_PARAM_BUFFERS_stride, SPA_POD_Int(self->bpf), ++ SPA_PARAM_BUFFERS_align, SPA_POD_Int(16)); ++ ++ GST_DEBUG_OBJECT (self->elem, "doing finish format, buffer size:%d", self->segsize); ++ pw_stream_update_params (self->stream, params, 1); ++} ++ ++static void ++on_stream_process (void *data) ++{ ++ GstPwAudioRingBuffer *self = GST_PW_AUDIO_RING_BUFFER (data); ++ GstAudioRingBuffer *buf = GST_AUDIO_RING_BUFFER (data); ++ struct pw_buffer *b; ++ struct spa_data *d; ++ gint size; /*< size to read/write from/to the spa buffer */ ++ gint offset; /*< offset to read/write from/to in the spa buffer */ ++ gint segment; /*< the current segment number in the ringbuffer */ ++ guint8 *ringptr; /*< pointer to the beginning of the current segment */ ++ gint segsize; /*< the size of one segment in the ringbuffer */ ++ gint copy_size; /*< the bytes to copy in one memcpy() invocation */ ++ gint remain; /*< remainder of bytes available in the spa buffer */ ++ ++ if (g_atomic_int_get (&buf->state) != GST_AUDIO_RING_BUFFER_STATE_STARTED) { ++ GST_LOG_OBJECT (self->elem, "ring buffer is not started"); ++ return; ++ } ++ ++ b = pw_stream_dequeue_buffer (self->stream); ++ if (!b) { ++ GST_INFO_OBJECT (self->elem, "no pipewire buffer available"); ++ return; ++ } ++ ++ d = &b->buffer->datas[0]; ++ ++ if (self->direction == PW_DIRECTION_OUTPUT) { ++ /* in output mode, always fill the entire spa buffer */ ++ offset = d->chunk->offset = 0; ++ size = d->chunk->size = d->maxsize; ++ b->size = size / self->bpf; ++ } else { ++ offset = SPA_MIN (d->chunk->offset, d->maxsize); ++ size = SPA_MIN (d->chunk->size, d->maxsize - offset); ++ } ++ ++ do { ++ gst_audio_ring_buffer_prepare_read (buf, &segment, &ringptr, &segsize); ++ ++ /* in INPUT (src) mode, it is possible that the skew algorithm ++ * advances the ringbuffer behind our back */ ++ if (self->segoffset > 0 && self->cur_segment != segment) ++ self->segoffset = 0; ++ ++ copy_size = SPA_MIN (size, segsize - self->segoffset); ++ ++ if (self->direction == PW_DIRECTION_OUTPUT) { ++ memcpy (((guint8*) d->data) + offset, ringptr + self->segoffset, ++ copy_size); ++ } else { ++ memcpy (ringptr + self->segoffset, ((guint8*) d->data) + offset, ++ copy_size); ++ } ++ ++ remain = size - (segsize - self->segoffset); ++ ++ GST_TRACE_OBJECT (self->elem, ++ "seg %d: %s %d bytes remained:%d offset:%d segoffset:%d", segment, ++ self->direction == PW_DIRECTION_INPUT ? "INPUT" : "OUTPUT", ++ copy_size, remain, offset, self->segoffset); ++ ++ if (remain >= 0) { ++ offset += (segsize - self->segoffset); ++ size = remain; ++ ++ /* write silence on the segment we just read */ ++ if (self->direction == PW_DIRECTION_OUTPUT) ++ gst_audio_ring_buffer_clear (buf, segment); ++ ++ /* notify that we have read a complete segment */ ++ gst_audio_ring_buffer_advance (buf, 1); ++ self->segoffset = 0; ++ } else { ++ self->segoffset += size; ++ self->cur_segment = segment; ++ } ++ } while (remain > 0); ++ ++ pw_stream_queue_buffer (self->stream, b); ++} ++ ++static const struct pw_stream_events stream_events = { ++ PW_VERSION_STREAM_EVENTS, ++ .state_changed = on_stream_state_changed, ++ .param_changed = on_stream_param_changed, ++ .process = on_stream_process, ++}; ++ ++static gboolean ++copy_properties (GQuark field_id, const GValue *value, gpointer user_data) ++{ ++ struct pw_properties *properties = user_data; ++ ++ if (G_VALUE_HOLDS_STRING (value)) ++ pw_properties_set (properties, ++ g_quark_to_string (field_id), ++ g_value_get_string (value)); ++ return TRUE; ++} ++ ++static gboolean ++gst_pw_audio_ring_buffer_acquire (GstAudioRingBuffer *buf, ++ GstAudioRingBufferSpec *spec) ++{ ++ GstPwAudioRingBuffer *self = GST_PW_AUDIO_RING_BUFFER (buf); ++ struct pw_properties *props; ++ struct spa_pod_builder b = { NULL }; ++ uint8_t buffer[512]; ++ const struct spa_pod *params[1]; ++ ++ g_return_val_if_fail (spec, FALSE); ++ g_return_val_if_fail (GST_AUDIO_INFO_IS_VALID (&spec->info), FALSE); ++ g_return_val_if_fail (!self->stream, TRUE); /* already acquired */ ++ ++ g_return_val_if_fail (spec->type == GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW, FALSE); ++ g_return_val_if_fail (GST_AUDIO_INFO_IS_FLOAT (&spec->info), FALSE); ++ ++ GST_DEBUG_OBJECT (self->elem, "acquire"); ++ ++ /* construct param & props objects */ ++ ++ props = pw_properties_new (NULL, NULL); ++ if (self->props->properties) { ++ gst_structure_foreach (self->props->properties, copy_properties, props); ++ } ++ ++ spa_pod_builder_init (&b, buffer, sizeof (buffer)); ++ params[0] = spa_pod_builder_add_object (&b, ++ SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, ++ SPA_FORMAT_mediaType, SPA_POD_Id (SPA_MEDIA_TYPE_audio), ++ SPA_FORMAT_mediaSubtype, SPA_POD_Id (SPA_MEDIA_SUBTYPE_raw), ++ SPA_FORMAT_AUDIO_format, SPA_POD_Id (SPA_AUDIO_FORMAT_F32), ++ SPA_FORMAT_AUDIO_rate, SPA_POD_Int (GST_AUDIO_INFO_RATE (&spec->info)), ++ SPA_FORMAT_AUDIO_channels, SPA_POD_Int (GST_AUDIO_INFO_CHANNELS (&spec->info))); ++ ++ self->segsize = spec->segsize; ++ self->bpf = GST_AUDIO_INFO_BPF (&spec->info); ++ self->rate = GST_AUDIO_INFO_RATE (&spec->info); ++ self->segoffset = 0; ++ ++ pw_properties_setf(props, PW_KEY_NODE_LATENCY, "%u/%u", ++ self->segsize / self->bpf, self->rate); ++ GST_DEBUG_OBJECT (self->elem, "segsize:%u, bpf:%u, node.latency = %s", ++ self->segsize, self->bpf, pw_properties_get (props, PW_KEY_NODE_LATENCY)); ++ ++ /* connect stream */ ++ ++ pw_thread_loop_lock (self->main_loop); ++ ++ GST_DEBUG_OBJECT (self->elem, "creating stream"); ++ ++ self->stream = pw_stream_new (self->remote, self->props->client_name, props); ++ pw_stream_add_listener(self->stream, &self->stream_listener, &stream_events, ++ self); ++ ++ if (pw_stream_connect (self->stream, ++ self->direction, ++ self->props->path ? (uint32_t)atoi(self->props->path) : SPA_ID_INVALID, ++ PW_STREAM_FLAG_AUTOCONNECT | ++ PW_STREAM_FLAG_MAP_BUFFERS | ++ PW_STREAM_FLAG_RT_PROCESS, ++ params, 1) < 0) ++ goto start_error; ++ ++ GST_DEBUG_OBJECT (self->elem, "waiting for stream CONFIGURE"); ++ ++ if (!wait_for_stream_state (self, PW_STREAM_STATE_PAUSED)) ++ goto start_error; ++ ++ pw_thread_loop_unlock (self->main_loop); ++ ++ /* allocate the internal ringbuffer */ ++ ++ spec->seglatency = spec->segtotal + 1; ++ buf->size = spec->segtotal * spec->segsize; ++ buf->memory = g_malloc (buf->size); ++ ++ gst_audio_format_fill_silence (buf->spec.info.finfo, buf->memory, ++ buf->size); ++ ++ GST_DEBUG_OBJECT (self->elem, "acquire done"); ++ ++ return TRUE; ++ ++start_error: ++ { ++ GST_ERROR_OBJECT (self->elem, "could not start stream"); ++ pw_stream_destroy (self->stream); ++ self->stream = NULL; ++ pw_thread_loop_unlock (self->main_loop); ++ return FALSE; ++ } ++} ++ ++static gboolean ++gst_pw_audio_ring_buffer_release (GstAudioRingBuffer *buf) ++{ ++ GstPwAudioRingBuffer *self = GST_PW_AUDIO_RING_BUFFER (buf); ++ ++ GST_DEBUG_OBJECT (self->elem, "release"); ++ ++ pw_thread_loop_lock (self->main_loop); ++ if (self->stream) { ++ spa_hook_remove (&self->stream_listener); ++ pw_stream_disconnect (self->stream); ++ pw_stream_destroy (self->stream); ++ self->stream = NULL; ++ } ++ pw_thread_loop_unlock (self->main_loop); ++ ++ /* free the buffer */ ++ g_free (buf->memory); ++ buf->memory = NULL; ++ ++ return TRUE; ++} ++ ++static guint ++gst_pw_audio_ring_buffer_delay (GstAudioRingBuffer *buf) ++{ ++ GstPwAudioRingBuffer *self = GST_PW_AUDIO_RING_BUFFER (buf); ++ struct pw_time t; ++ ++ if (!self->stream || pw_stream_get_time (self->stream, &t) < 0) ++ return 0; ++ ++ if (self->direction == PW_DIRECTION_OUTPUT) { ++ /* on output streams, we set the pw_buffer.size in frames, ++ so no conversion is necessary */ ++ return t.queued; ++ } else { ++ /* on input streams, pw_buffer.size is set by pw_stream in ticks, ++ so we need to convert it to frames and also add segoffset, which ++ is the number of bytes we have read but not advertised yet, as ++ the segment is incomplete */ ++ if (t.rate.denom > 0) ++ return ++ gst_util_uint64_scale (t.queued, self->rate * t.rate.num, t.rate.denom) ++ + self->segoffset / self->bpf; ++ else ++ return self->segoffset / self->bpf; ++ } ++ ++ return 0; ++} ++ ++static void ++gst_pw_audio_ring_buffer_class_init (GstPwAudioRingBufferClass * klass) ++{ ++ GObjectClass *gobject_class; ++ GstAudioRingBufferClass *gstaudiorbuf_class; ++ ++ gobject_class = (GObjectClass *) klass; ++ gstaudiorbuf_class = (GstAudioRingBufferClass *) klass; ++ ++ gobject_class->finalize = gst_pw_audio_ring_buffer_finalize; ++ gobject_class->set_property = gst_pw_audio_ring_buffer_set_property; ++ ++ gstaudiorbuf_class->open_device = gst_pw_audio_ring_buffer_open_device; ++ gstaudiorbuf_class->acquire = gst_pw_audio_ring_buffer_acquire; ++ gstaudiorbuf_class->release = gst_pw_audio_ring_buffer_release; ++ gstaudiorbuf_class->close_device = gst_pw_audio_ring_buffer_close_device; ++ gstaudiorbuf_class->delay = gst_pw_audio_ring_buffer_delay; ++ ++ g_object_class_install_property (gobject_class, PROP_ELEMENT, ++ g_param_spec_object ("element", "Element", "The audio source or sink", ++ GST_TYPE_ELEMENT, ++ G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); ++ ++ g_object_class_install_property (gobject_class, PROP_DIRECTION, ++ g_param_spec_int ("direction", "Direction", "The stream direction", ++ PW_DIRECTION_INPUT, PW_DIRECTION_OUTPUT, PW_DIRECTION_INPUT, ++ G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); ++ ++ g_object_class_install_property (gobject_class, PROP_PROPS, ++ g_param_spec_pointer ("props", "Properties", "The properties struct", ++ G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); ++ ++ GST_DEBUG_CATEGORY_INIT (pw_audio_ring_buffer_debug, "pwaudioringbuffer", 0, ++ "PipeWire Audio Ring Buffer"); ++} +diff --git a/src/gst/gstpwaudioringbuffer.h b/src/gst/gstpwaudioringbuffer.h +new file mode 100644 +index 00000000..f47f668a +--- /dev/null ++++ b/src/gst/gstpwaudioringbuffer.h +@@ -0,0 +1,83 @@ ++/* PipeWire ++ * ++ * Copyright © 2018 Wim Taymans ++ * Copyright © 2019 Collabora Ltd. ++ * @author George Kiagiadakis ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++ * DEALINGS IN THE SOFTWARE. ++ */ ++ ++#ifndef __GST_PW_AUDIO_RING_BUFFER_H__ ++#define __GST_PW_AUDIO_RING_BUFFER_H__ ++ ++#include ++#include ++#include ++ ++G_BEGIN_DECLS ++ ++#define GST_TYPE_PW_AUDIO_RING_BUFFER \ ++ (gst_pw_audio_ring_buffer_get_type ()) ++ ++G_DECLARE_FINAL_TYPE(GstPwAudioRingBuffer, gst_pw_audio_ring_buffer, ++ GST, PW_AUDIO_RING_BUFFER, GstAudioRingBuffer); ++ ++typedef struct _GstPwAudioRingBufferProps GstPwAudioRingBufferProps; ++ ++struct _GstPwAudioRingBuffer ++{ ++ GstAudioRingBuffer parent; ++ ++ /* properties */ ++ GstElement *elem; ++ enum pw_direction direction; ++ GstPwAudioRingBufferProps *props; ++ ++ /* internal */ ++ struct pw_loop *loop; ++ struct pw_thread_loop *main_loop; ++ ++ struct pw_core *core; ++ struct pw_remote *remote; ++ struct spa_hook remote_listener; ++ ++ struct pw_stream *stream; ++ struct spa_hook stream_listener; ++ ++ gint segsize; ++ gint bpf; ++ gint rate; ++ ++ /* on_stream_process() state */ ++ gint segoffset; ++ gint cur_segment; ++}; ++ ++struct _GstPwAudioRingBufferProps ++{ ++ gchar *path; ++ gchar *client_name; ++ GstStructure *properties; ++ int fd; ++}; ++ ++G_END_DECLS ++ ++#endif +diff --git a/src/gst/gstpwaudiosink.c b/src/gst/gstpwaudiosink.c +new file mode 100644 +index 00000000..069996c3 +--- /dev/null ++++ b/src/gst/gstpwaudiosink.c +@@ -0,0 +1,207 @@ ++/* PipeWire ++ * ++ * Copyright © 2018 Wim Taymans ++ * Copyright © 2019 Collabora Ltd. ++ * @author George Kiagiadakis ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++ * DEALINGS IN THE SOFTWARE. ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include "gstpwaudiosink.h" ++ ++GST_DEBUG_CATEGORY_STATIC (pw_audio_sink_debug); ++#define GST_CAT_DEFAULT pw_audio_sink_debug ++ ++G_DEFINE_TYPE (GstPwAudioSink, gst_pw_audio_sink, GST_TYPE_AUDIO_BASE_SINK); ++ ++enum ++{ ++ PROP_0, ++ PROP_PATH, ++ PROP_CLIENT_NAME, ++ PROP_STREAM_PROPERTIES, ++ PROP_FD ++}; ++ ++static GstStaticPadTemplate gst_pw_audio_sink_template = ++GST_STATIC_PAD_TEMPLATE ("sink", ++ GST_PAD_SINK, ++ GST_PAD_ALWAYS, ++ GST_STATIC_CAPS (GST_AUDIO_CAPS_MAKE (GST_AUDIO_NE (F32)) ++ ", layout = (string)\"interleaved\"") ++); ++ ++ ++static void ++gst_pw_audio_sink_init (GstPwAudioSink * self) ++{ ++ self->props.fd = -1; ++ ++ /* Bump the default buffer size up to 21.3 ms, which is the default on most ++ * sound cards, in hope to match the alsa buffer size on the pipewire server. ++ * This may not always happen, but it still sounds better than the 10ms ++ * default latency. This is temporary until we have a better mechanism to ++ * select the appropriate latency */ ++ GST_AUDIO_BASE_SINK (self)->latency_time = 21333; ++} ++ ++static void ++gst_pw_audio_sink_finalize (GObject * object) ++{ ++ GstPwAudioSink *pwsink = GST_PW_AUDIO_SINK (object); ++ ++ g_free (pwsink->props.path); ++ g_free (pwsink->props.client_name); ++ if (pwsink->props.properties) ++ gst_structure_free (pwsink->props.properties); ++} ++ ++static void ++gst_pw_audio_sink_set_property (GObject * object, guint prop_id, ++ const GValue * value, GParamSpec * pspec) ++{ ++ GstPwAudioSink *pwsink = GST_PW_AUDIO_SINK (object); ++ ++ switch (prop_id) { ++ case PROP_PATH: ++ g_free (pwsink->props.path); ++ pwsink->props.path = g_value_dup_string (value); ++ break; ++ ++ case PROP_CLIENT_NAME: ++ g_free (pwsink->props.client_name); ++ pwsink->props.client_name = g_value_dup_string (value); ++ break; ++ ++ case PROP_STREAM_PROPERTIES: ++ if (pwsink->props.properties) ++ gst_structure_free (pwsink->props.properties); ++ pwsink->props.properties = ++ gst_structure_copy (gst_value_get_structure (value)); ++ break; ++ ++ case PROP_FD: ++ pwsink->props.fd = g_value_get_int (value); ++ break; ++ ++ default: ++ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); ++ break; ++ } ++} ++ ++static void ++gst_pw_audio_sink_get_property (GObject * object, guint prop_id, ++ GValue * value, GParamSpec * pspec) ++{ ++ GstPwAudioSink *pwsink = GST_PW_AUDIO_SINK (object); ++ ++ switch (prop_id) { ++ case PROP_PATH: ++ g_value_set_string (value, pwsink->props.path); ++ break; ++ ++ case PROP_CLIENT_NAME: ++ g_value_set_string (value, pwsink->props.client_name); ++ break; ++ ++ case PROP_STREAM_PROPERTIES: ++ gst_value_set_structure (value, pwsink->props.properties); ++ break; ++ ++ case PROP_FD: ++ g_value_set_int (value, pwsink->props.fd); ++ break; ++ ++ default: ++ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); ++ break; ++ } ++} ++ ++static GstAudioRingBuffer * ++gst_pw_audio_sink_create_ringbuffer (GstAudioBaseSink * sink) ++{ ++ GstPwAudioSink *self = GST_PW_AUDIO_SINK (sink); ++ GstAudioRingBuffer *buffer; ++ ++ GST_DEBUG_OBJECT (sink, "creating ringbuffer"); ++ buffer = g_object_new (GST_TYPE_PW_AUDIO_RING_BUFFER, ++ "element", sink, ++ "direction", PW_DIRECTION_OUTPUT, ++ "props", &self->props, ++ NULL); ++ GST_DEBUG_OBJECT (sink, "created ringbuffer @%p", buffer); ++ ++ return buffer; ++} ++ ++static void ++gst_pw_audio_sink_class_init (GstPwAudioSinkClass * klass) ++{ ++ GObjectClass *gobject_class; ++ GstElementClass *gstelement_class; ++ GstAudioBaseSinkClass *gstaudiobsink_class; ++ ++ gobject_class = (GObjectClass *) klass; ++ gstelement_class = (GstElementClass *) klass; ++ gstaudiobsink_class = (GstAudioBaseSinkClass *) klass; ++ ++ gobject_class->finalize = gst_pw_audio_sink_finalize; ++ gobject_class->set_property = gst_pw_audio_sink_set_property; ++ gobject_class->get_property = gst_pw_audio_sink_get_property; ++ ++ gstaudiobsink_class->create_ringbuffer = gst_pw_audio_sink_create_ringbuffer; ++ ++ g_object_class_install_property (gobject_class, PROP_PATH, ++ g_param_spec_string ("path", "Path", ++ "The sink path to connect to (NULL = default)", NULL, ++ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); ++ ++ g_object_class_install_property (gobject_class, PROP_CLIENT_NAME, ++ g_param_spec_string ("client-name", "Client Name", ++ "The client name to use (NULL = default)", NULL, ++ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); ++ ++ g_object_class_install_property (gobject_class, PROP_STREAM_PROPERTIES, ++ g_param_spec_boxed ("stream-properties", "Stream properties", ++ "List of PipeWire stream properties", GST_TYPE_STRUCTURE, ++ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); ++ ++ g_object_class_install_property (gobject_class, PROP_FD, ++ g_param_spec_int ("fd", "Fd", "The fd to connect with", -1, G_MAXINT, -1, ++ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); ++ ++ gst_element_class_set_static_metadata (gstelement_class, ++ "PipeWire Audio sink", "Sink/Audio", ++ "Send audio to PipeWire", ++ "George Kiagiadakis "); ++ ++ gst_element_class_add_pad_template (gstelement_class, ++ gst_static_pad_template_get (&gst_pw_audio_sink_template)); ++ ++ GST_DEBUG_CATEGORY_INIT (pw_audio_sink_debug, "pwaudiosink", 0, ++ "PipeWire Audio Sink"); ++} ++ +diff --git a/src/gst/gstpwaudiosink.h b/src/gst/gstpwaudiosink.h +new file mode 100644 +index 00000000..7ed0de7b +--- /dev/null ++++ b/src/gst/gstpwaudiosink.h +@@ -0,0 +1,48 @@ ++/* PipeWire ++ * ++ * Copyright © 2018 Wim Taymans ++ * Copyright © 2019 Collabora Ltd. ++ * @author George Kiagiadakis ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++ * DEALINGS IN THE SOFTWARE. ++ */ ++ ++#ifndef __GST_PW_AUDIO_SINK_H__ ++#define __GST_PW_AUDIO_SINK_H__ ++ ++#include "gstpwaudioringbuffer.h" ++ ++G_BEGIN_DECLS ++ ++#define GST_TYPE_PW_AUDIO_SINK \ ++ (gst_pw_audio_sink_get_type ()) ++ ++G_DECLARE_FINAL_TYPE(GstPwAudioSink, gst_pw_audio_sink, ++ GST, PW_AUDIO_SINK, GstAudioBaseSink); ++ ++struct _GstPwAudioSink ++{ ++ GstAudioBaseSink parent; ++ GstPwAudioRingBufferProps props; ++}; ++ ++G_END_DECLS ++ ++#endif +diff --git a/src/gst/gstpwaudiosrc.c b/src/gst/gstpwaudiosrc.c +new file mode 100644 +index 00000000..6c522982 +--- /dev/null ++++ b/src/gst/gstpwaudiosrc.c +@@ -0,0 +1,200 @@ ++/* PipeWire ++ * ++ * Copyright © 2018 Wim Taymans ++ * Copyright © 2019 Collabora Ltd. ++ * @author George Kiagiadakis ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++ * DEALINGS IN THE SOFTWARE. ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include "gstpwaudiosrc.h" ++ ++GST_DEBUG_CATEGORY_STATIC (pw_audio_src_debug); ++#define GST_CAT_DEFAULT pw_audio_src_debug ++ ++G_DEFINE_TYPE (GstPwAudioSrc, gst_pw_audio_src, GST_TYPE_AUDIO_BASE_SRC); ++ ++enum ++{ ++ PROP_0, ++ PROP_PATH, ++ PROP_CLIENT_NAME, ++ PROP_STREAM_PROPERTIES, ++ PROP_FD ++}; ++ ++static GstStaticPadTemplate gst_pw_audio_src_template = ++GST_STATIC_PAD_TEMPLATE ("src", ++ GST_PAD_SRC, ++ GST_PAD_ALWAYS, ++ GST_STATIC_CAPS (GST_AUDIO_CAPS_MAKE (GST_AUDIO_NE (F32)) ++ ", layout = (string)\"interleaved\"") ++); ++ ++ ++static void ++gst_pw_audio_src_init (GstPwAudioSrc * self) ++{ ++ self->props.fd = -1; ++} ++ ++static void ++gst_pw_audio_src_finalize (GObject * object) ++{ ++ GstPwAudioSrc *self = GST_PW_AUDIO_SRC (object); ++ ++ g_free (self->props.path); ++ g_free (self->props.client_name); ++ if (self->props.properties) ++ gst_structure_free (self->props.properties); ++} ++ ++static void ++gst_pw_audio_src_set_property (GObject * object, guint prop_id, ++ const GValue * value, GParamSpec * pspec) ++{ ++ GstPwAudioSrc *self = GST_PW_AUDIO_SRC (object); ++ ++ switch (prop_id) { ++ case PROP_PATH: ++ g_free (self->props.path); ++ self->props.path = g_value_dup_string (value); ++ break; ++ ++ case PROP_CLIENT_NAME: ++ g_free (self->props.client_name); ++ self->props.client_name = g_value_dup_string (value); ++ break; ++ ++ case PROP_STREAM_PROPERTIES: ++ if (self->props.properties) ++ gst_structure_free (self->props.properties); ++ self->props.properties = ++ gst_structure_copy (gst_value_get_structure (value)); ++ break; ++ ++ case PROP_FD: ++ self->props.fd = g_value_get_int (value); ++ break; ++ ++ default: ++ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); ++ break; ++ } ++} ++ ++static void ++gst_pw_audio_src_get_property (GObject * object, guint prop_id, ++ GValue * value, GParamSpec * pspec) ++{ ++ GstPwAudioSrc *self = GST_PW_AUDIO_SRC (object); ++ ++ switch (prop_id) { ++ case PROP_PATH: ++ g_value_set_string (value, self->props.path); ++ break; ++ ++ case PROP_CLIENT_NAME: ++ g_value_set_string (value, self->props.client_name); ++ break; ++ ++ case PROP_STREAM_PROPERTIES: ++ gst_value_set_structure (value, self->props.properties); ++ break; ++ ++ case PROP_FD: ++ g_value_set_int (value, self->props.fd); ++ break; ++ ++ default: ++ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); ++ break; ++ } ++} ++ ++static GstAudioRingBuffer * ++gst_pw_audio_src_create_ringbuffer (GstAudioBaseSrc * sink) ++{ ++ GstPwAudioSrc *self = GST_PW_AUDIO_SRC (sink); ++ GstAudioRingBuffer *buffer; ++ ++ GST_DEBUG_OBJECT (sink, "creating ringbuffer"); ++ buffer = g_object_new (GST_TYPE_PW_AUDIO_RING_BUFFER, ++ "element", sink, ++ "direction", PW_DIRECTION_INPUT, ++ "props", &self->props, ++ NULL); ++ GST_DEBUG_OBJECT (sink, "created ringbuffer @%p", buffer); ++ ++ return buffer; ++} ++ ++static void ++gst_pw_audio_src_class_init (GstPwAudioSrcClass * klass) ++{ ++ GObjectClass *gobject_class; ++ GstElementClass *gstelement_class; ++ GstAudioBaseSrcClass *gstaudiobsrc_class; ++ ++ gobject_class = (GObjectClass *) klass; ++ gstelement_class = (GstElementClass *) klass; ++ gstaudiobsrc_class = (GstAudioBaseSrcClass *) klass; ++ ++ gobject_class->finalize = gst_pw_audio_src_finalize; ++ gobject_class->set_property = gst_pw_audio_src_set_property; ++ gobject_class->get_property = gst_pw_audio_src_get_property; ++ ++ gstaudiobsrc_class->create_ringbuffer = gst_pw_audio_src_create_ringbuffer; ++ ++ g_object_class_install_property (gobject_class, PROP_PATH, ++ g_param_spec_string ("path", "Path", ++ "The sink path to connect to (NULL = default)", NULL, ++ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); ++ ++ g_object_class_install_property (gobject_class, PROP_CLIENT_NAME, ++ g_param_spec_string ("client-name", "Client Name", ++ "The client name to use (NULL = default)", NULL, ++ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); ++ ++ g_object_class_install_property (gobject_class, PROP_STREAM_PROPERTIES, ++ g_param_spec_boxed ("stream-properties", "Stream properties", ++ "List of PipeWire stream properties", GST_TYPE_STRUCTURE, ++ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); ++ ++ g_object_class_install_property (gobject_class, PROP_FD, ++ g_param_spec_int ("fd", "Fd", "The fd to connect with", -1, G_MAXINT, -1, ++ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); ++ ++ gst_element_class_set_static_metadata (gstelement_class, ++ "PipeWire Audio source", "Source/Audio", ++ "Receive audio from PipeWire", ++ "George Kiagiadakis "); ++ ++ gst_element_class_add_pad_template (gstelement_class, ++ gst_static_pad_template_get (&gst_pw_audio_src_template)); ++ ++ GST_DEBUG_CATEGORY_INIT (pw_audio_src_debug, "pwaudiosrc", 0, ++ "PipeWire Audio Src"); ++} ++ +diff --git a/src/gst/gstpwaudiosrc.h b/src/gst/gstpwaudiosrc.h +new file mode 100644 +index 00000000..c46e644c +--- /dev/null ++++ b/src/gst/gstpwaudiosrc.h +@@ -0,0 +1,48 @@ ++/* PipeWire ++ * ++ * Copyright © 2018 Wim Taymans ++ * Copyright © 2019 Collabora Ltd. ++ * @author George Kiagiadakis ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++ * DEALINGS IN THE SOFTWARE. ++ */ ++ ++#ifndef __GST_PW_AUDIO_SRC_H__ ++#define __GST_PW_AUDIO_SRC_H__ ++ ++#include "gstpwaudioringbuffer.h" ++ ++G_BEGIN_DECLS ++ ++#define GST_TYPE_PW_AUDIO_SRC \ ++ (gst_pw_audio_src_get_type ()) ++ ++G_DECLARE_FINAL_TYPE(GstPwAudioSrc, gst_pw_audio_src, ++ GST, PW_AUDIO_SRC, GstAudioBaseSrc); ++ ++struct _GstPwAudioSrc ++{ ++ GstAudioBaseSrc parent; ++ GstPwAudioRingBufferProps props; ++}; ++ ++G_END_DECLS ++ ++#endif +diff --git a/src/gst/meson.build b/src/gst/meson.build +index ad0e0801..0e922347 100644 +--- a/src/gst/meson.build ++++ b/src/gst/meson.build +@@ -6,6 +6,9 @@ pipewire_gst_sources = [ + 'gstpipewirepool.c', + 'gstpipewiresink.c', + 'gstpipewiresrc.c', ++ 'gstpwaudioringbuffer.c', ++ 'gstpwaudiosink.c', ++ 'gstpwaudiosrc.c', + ] + + pipewire_gst_headers = [ +@@ -15,6 +18,9 @@ pipewire_gst_headers = [ + 'gstpipewirepool.h', + 'gstpipewiresink.h', + 'gstpipewiresrc.h', ++ 'gstpwaudioringbuffer.h', ++ 'gstpwaudiosink.h', ++ 'gstpwaudiosrc.h', + ] + + pipewire_gst_c_args = [ +-- +2.24.0 + diff --git a/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0004-audioconvert-always-assume-that-output-ports-are-NOT.patch b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0004-audioconvert-always-assume-that-output-ports-are-NOT.patch new file mode 100644 index 00000000..beb87839 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0004-audioconvert-always-assume-that-output-ports-are-NOT.patch @@ -0,0 +1,35 @@ +From ce155eb0073fba84556782633f79bb7d03492c07 Mon Sep 17 00:00:00 2001 +From: George Kiagiadakis +Date: Wed, 2 Oct 2019 21:40:34 +0300 +Subject: [PATCH] audioconvert: always assume that output ports are NOT monitor + ports + +Otherwise, when we setup audioconvert in merge+split mode, +it assumes that the splitter's ports are monitor ports and +belong to the merger. + +Upstream-Status: Inappropriate [workaround] +--- + spa/plugins/audioconvert/audioconvert.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/spa/plugins/audioconvert/audioconvert.c b/spa/plugins/audioconvert/audioconvert.c +index 74a62a35..72da37d1 100644 +--- a/spa/plugins/audioconvert/audioconvert.c ++++ b/spa/plugins/audioconvert/audioconvert.c +@@ -113,8 +113,12 @@ struct impl { + unsigned int add_listener:1; + }; + ++#if 0 + #define IS_MONITOR_PORT(this,dir,port_id) (dir == SPA_DIRECTION_OUTPUT && port_id > 0 && \ + this->mode[SPA_DIRECTION_INPUT] == SPA_PARAM_PORT_CONFIG_MODE_dsp) ++#else ++#define IS_MONITOR_PORT(this,dir,port_id) (false) ++#endif + + static void emit_node_info(struct impl *this, bool full) + { +-- +2.24.0 + diff --git a/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0005-module-access-add-same-sec-label-mode.patch b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0005-module-access-add-same-sec-label-mode.patch new file mode 100644 index 00000000..07a1ec11 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0005-module-access-add-same-sec-label-mode.patch @@ -0,0 +1,94 @@ +From 19fad1a4fa8bdc4f02aac4e169e7ff9cab18bdcd Mon Sep 17 00:00:00 2001 +From: George Kiagiadakis +Date: Tue, 19 Nov 2019 17:09:07 +0200 +Subject: [PATCH] module-access: add same-sec-label-mode + +This is a mode where the access module allows all clients that have +the same security label as the pipewire daemon, and every other +client is put on the restricted state. + +In systems that use SMACK security labels, such as AGL, this allows +the session manager (which is spawned by pipewire, inheriting the +same smack label) to have full access to all objects, while every +other client is restricted and the session manager must decide +what to do with it + +Note that while this option is configurable, there is no loss of +security if this option is not set in the configuration. Clients +that don't have the same security context will be considered to +be flatpak clients because pipewire will not be able to open +/proc/pid/cmdline. This however results in some unwanted error +messages that may be confusing. + +Upstream-Status: Inappropriate [agl/smack specific] +--- + src/modules/module-access.c | 45 ++++++++++++++++++++++++++++++++++++- + 1 file changed, 44 insertions(+), 1 deletion(-) + +diff --git a/src/modules/module-access.c b/src/modules/module-access.c +index 09dafa43..f75306d9 100644 +--- a/src/modules/module-access.c ++++ b/src/modules/module-access.c +@@ -50,6 +50,30 @@ struct impl { + struct spa_hook module_listener; + }; + ++static int check_seclabel(const char *str) ++{ ++ char attr[1024]; ++ int fd, len; ++ ++ fd = open("/proc/self/attr/current", O_RDONLY); ++ if (fd < 0) ++ return -errno; ++ ++ if ((len = read(fd, attr, 1024)) <= 0) { ++ close(fd); ++ return -EIO; ++ } ++ attr[len] = '\0'; ++ ++ if (strcmp(attr, str) == 0) { ++ close(fd); ++ return 1; ++ } ++ ++ close(fd); ++ return 0; ++} ++ + static int check_cmdline(struct pw_client *client, int pid, const char *str) + { + char path[2048]; +@@ -121,8 +145,27 @@ core_check_access(void *data, struct pw_client *client) + const char *str; + int pid, res; + ++ props = pw_client_get_properties(client); ++ ++ if (impl->properties && ++ (str = pw_properties_get(impl->properties, "same-sec-label-mode")) != NULL && ++ strcmp(str, "1") == 0) { ++ if (props && (str = pw_properties_get(props, PW_KEY_SEC_LABEL)) != NULL) { ++ res = check_seclabel(str); ++ if (res == 1) ++ goto granted; ++ else if (res < 0) ++ pw_log_warn("module %p: client %p seclabel check failed: %s", ++ impl, client, spa_strerror(res)); ++ } ++ pw_log_debug("module %p: seclabel restricted client %p added", ++ impl, client); ++ items[0] = SPA_DICT_ITEM_INIT(PW_KEY_ACCESS, "restricted"); ++ goto wait_permissions; ++ } ++ + pid = -EINVAL; +- if ((props = pw_client_get_properties(client)) != NULL) { ++ if (props != NULL) { + if ((str = pw_properties_get(props, PW_KEY_SEC_PID)) != NULL) + pid = atoi(str); + } +-- +2.24.0 + diff --git a/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0006-alsa-pcm-call-reuse_buffers-when-resetting-the-state.patch b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0006-alsa-pcm-call-reuse_buffers-when-resetting-the-state.patch new file mode 100644 index 00000000..cae4d70f --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0006-alsa-pcm-call-reuse_buffers-when-resetting-the-state.patch @@ -0,0 +1,30 @@ +From 5946fbd2ca3a7f892b4ebc10090f62df6bb1ec88 Mon Sep 17 00:00:00 2001 +From: George Kiagiadakis +Date: Thu, 9 Jan 2020 19:27:23 +0200 +Subject: [PATCH] alsa-pcm: call reuse_buffers when resetting the state of the + buffers + +This allows the upstream node to put buffers back to its pool in case +they were left around in the ready list locally when the alsa-pcm-sink +was last paused. + +Fixes #203 +--- + spa/plugins/alsa/alsa-pcm.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c +index 63d75549..a6f22cf0 100644 +--- a/spa/plugins/alsa/alsa-pcm.c ++++ b/spa/plugins/alsa/alsa-pcm.c +@@ -1115,6 +1115,7 @@ static void reset_buffers(struct state *this) + struct buffer *b = &this->buffers[i]; + if (this->stream == SND_PCM_STREAM_PLAYBACK) { + SPA_FLAG_SET(b->flags, BUFFER_FLAG_OUT); ++ spa_node_call_reuse_buffer(&this->callbacks, 0, b->id); + } else { + spa_list_append(&this->free, &b->link); + SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_OUT); +-- +2.24.1 + diff --git a/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0007-alsa-Set-period_size-depending-on-hardware.patch b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0007-alsa-Set-period_size-depending-on-hardware.patch new file mode 100644 index 00000000..f9649400 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0007-alsa-Set-period_size-depending-on-hardware.patch @@ -0,0 +1,35 @@ +From bbf9c767d5b353142e03080762bdd805e124d50b Mon Sep 17 00:00:00 2001 +From: Walter Lozano +Date: Fri, 7 Aug 2020 10:58:29 -0300 +Subject: [PATCH] alsa: Set period_size depending on hardware + +Currently PipeWire is unable to reproduce audio in systems where DMA +granularity is not burst. + +In order to mitigate this issue, set period_size depending on hardware, +lowering it when snd_pcm_hw_params_is_batch == 1, to reduce DMA +transfers size. + +Signed-off-by: Walter Lozano +--- + spa/plugins/alsa/alsa-pcm.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c +index 63d75549..2d3850b7 100644 +--- a/spa/plugins/alsa/alsa-pcm.c ++++ b/spa/plugins/alsa/alsa-pcm.c +@@ -463,6 +463,10 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_ + + dir = 0; + period_size = 1024; ++ if (snd_pcm_hw_params_is_batch(params)) { ++ period_size = 512; ++ spa_log_warn(state->log, NAME" hardware does double buffering, changing period_size to %ld", period_size); ++ } + CHECK(snd_pcm_hw_params_set_period_size_near(hndl, params, &period_size, &dir), "set_period_size_near"); + CHECK(snd_pcm_hw_params_get_buffer_size_max(params, &state->buffer_frames), "get_buffer_size_max"); + CHECK(snd_pcm_hw_params_set_buffer_size_near(hndl, params, &state->buffer_frames), "set_buffer_size_near"); +-- +2.20.1 + diff --git a/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0008-alsa-add-warning-in-case-of-partial-read-write.patch b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0008-alsa-add-warning-in-case-of-partial-read-write.patch new file mode 100644 index 00000000..98a2c98f --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0008-alsa-add-warning-in-case-of-partial-read-write.patch @@ -0,0 +1,80 @@ +From 45658f75e61da47b274f2eba3a55e62d016f8b42 Mon Sep 17 00:00:00 2001 +From: Walter Lozano +Date: Mon, 24 Aug 2020 12:08:32 -0300 +Subject: [PATCH 8/9] alsa: add warning in case of partial read/write + +Currently alsa_read and alsa_write assumes that all the frames committed +using snd_pcm_mmap_commit are read or written, which is probably true. +However, as it could be some corner cases add a warning to notice this +fact. + +Signed-off-by: Walter Lozano +--- + spa/plugins/alsa/alsa-pcm.c | 28 ++++++++++++++++++++-------- + 1 file changed, 20 insertions(+), 8 deletions(-) + +diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c +index ed9bf42b..92ef2151 100644 +--- a/spa/plugins/alsa/alsa-pcm.c ++++ b/spa/plugins/alsa/alsa-pcm.c +@@ -721,6 +721,7 @@ int spa_alsa_write(struct state *state, snd_pcm_uframes_t silence) + snd_pcm_t *hndl = state->hndl; + const snd_pcm_channel_area_t *my_areas; + snd_pcm_uframes_t written, frames, offset, off, to_write, total_written; ++ snd_pcm_sframes_t commitres; + int res; + + if (state->position && state->duration != state->position->clock.duration) { +@@ -834,11 +835,16 @@ again: + state, offset, written, state->sample_count); + total_written += written; + +- if ((res = snd_pcm_mmap_commit(hndl, offset, written)) < 0) { ++ if ((commitres = snd_pcm_mmap_commit(hndl, offset, written)) < 0) { + spa_log_error(state->log, NAME" %p: snd_pcm_mmap_commit error: %s", +- state, snd_strerror(res)); +- if (res != -EPIPE && res != -ESTRPIPE) +- return res; ++ state, snd_strerror(commitres)); ++ if (commitres != -EPIPE && commitres != -ESTRPIPE) ++ return commitres; ++ } ++ ++ if (commitres > 0 && written != (snd_pcm_uframes_t) commitres) { ++ spa_log_warn(state->log, NAME" %p: mmap_commit wrote %ld instead of %ld", ++ state, commitres, written); + } + + if (!spa_list_is_empty(&state->ready) && written > 0) +@@ -922,6 +928,7 @@ int spa_alsa_read(struct state *state, snd_pcm_uframes_t silence) + snd_pcm_uframes_t total_read = 0, to_read; + const snd_pcm_channel_area_t *my_areas; + snd_pcm_uframes_t read, frames, offset; ++ snd_pcm_sframes_t commitres; + int res; + + if (state->position) { +@@ -994,11 +1001,16 @@ int spa_alsa_read(struct state *state, snd_pcm_uframes_t silence) + offset, read, state->sample_count); + total_read += read; + +- if ((res = snd_pcm_mmap_commit(hndl, offset, read)) < 0) { ++ if ((commitres = snd_pcm_mmap_commit(hndl, offset, read)) < 0) { + spa_log_error(state->log, NAME" %p: snd_pcm_mmap_commit error: %s", +- state, snd_strerror(res)); +- if (res != -EPIPE && res != -ESTRPIPE) +- return res; ++ state, snd_strerror(commitres)); ++ if (commitres != -EPIPE && commitres != -ESTRPIPE) ++ return commitres; ++ } ++ ++ if (commitres > 0 && read != (snd_pcm_uframes_t) commitres) { ++ spa_log_warn(state->log, NAME" %p: mmap_commit read %ld instead of %ld", ++ state, commitres, read); + } + + state->sample_count += total_read; +-- +2.20.1 + diff --git a/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0009-alsa-adjust-delay-depending-on-hardware.patch b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0009-alsa-adjust-delay-depending-on-hardware.patch new file mode 100644 index 00000000..a448063f --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/0009-alsa-adjust-delay-depending-on-hardware.patch @@ -0,0 +1,64 @@ +From 38cdfa4483de4c2e91bfccb9c22ec72d9c3720f4 Mon Sep 17 00:00:00 2001 +From: Walter Lozano +Date: Sat, 22 Aug 2020 11:51:30 -0300 +Subject: [PATCH 9/9] alsa: adjust delay depending on hardware + +Currently PipeWire is able to reproduce audio in systems where +DMA granularity is not burst but it could face an xrun. + +In order to mitigate this issue, adjust the delay PipeWire +calculates to make sure that a period is available in the buffer +when snd_pcm_hw_params_is_batch == 1. + +Signed-off-by: Walter Lozano +--- + spa/plugins/alsa/alsa-pcm.c | 12 +++++++++++- + spa/plugins/alsa/alsa-pcm.h | 1 + + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c +index 92ef2151..1f15085f 100644 +--- a/spa/plugins/alsa/alsa-pcm.c ++++ b/spa/plugins/alsa/alsa-pcm.c +@@ -462,8 +462,9 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_ + state->frame_size = info->channels * (snd_pcm_format_physical_width(format) / 8); + + dir = 0; ++ state->pcm_is_batch = snd_pcm_hw_params_is_batch(params); + period_size = 1024; +- if (snd_pcm_hw_params_is_batch(params)) { ++ if (state->pcm_is_batch) { + period_size = 512; + spa_log_warn(state->log, NAME" hardware does double buffering, changing period_size to %ld", period_size); + } +@@ -639,6 +640,15 @@ static int get_status(struct state *state, snd_pcm_uframes_t *delay, snd_pcm_ufr + + if (state->stream == SND_PCM_STREAM_PLAYBACK) { + *delay = state->buffer_frames - avail; ++ if (state->pcm_is_batch) { ++ /* In this case, as we don't have a good granularity in the ++ * avail report try to compensate this by tweaking the delay ++ * and make sure that a period is available in the buffer */ ++ if (*delay > state->period_frames) ++ *delay = *delay - state->period_frames; ++ else ++ *delay = 0; ++ } + } + else { + *delay = avail; +diff --git a/spa/plugins/alsa/alsa-pcm.h b/spa/plugins/alsa/alsa-pcm.h +index b7a2dd29..3b5c0d7b 100644 +--- a/spa/plugins/alsa/alsa-pcm.h ++++ b/spa/plugins/alsa/alsa-pcm.h +@@ -100,6 +100,7 @@ struct state { + + bool have_format; + struct spa_audio_info current_format; ++ bool pcm_is_batch; + + snd_pcm_uframes_t buffer_frames; + snd_pcm_uframes_t period_frames; +-- +2.20.1 + diff --git a/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/pipewire@.service b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/pipewire@.service new file mode 100644 index 00000000..e116dc1f --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/pipewire@.service @@ -0,0 +1,24 @@ +[Unit] +Description=Multimedia Service for user %i +Requires=pipewire@%i.socket + +[Install] +Also=pipewire@%i.socket + +[Service] +Type=simple +Restart=on-failure +ExecStart=/usr/bin/pipewire + +Environment=XDG_RUNTIME_DIR=/run/user/%i +Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%i/bus +EnvironmentFile=-/etc/pipewire/environment + +User=%i +Slice=user-%i.slice +SmackProcessLabel=System::Pipewire +SupplementaryGroups=audio +UMask=0077 +CapabilityBoundingSet= +SystemCallFilter=@basic-io @file-system @io-event @ipc \ + @memlock @network-io @process @resources @signal diff --git a/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/pipewire@.socket b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/pipewire@.socket new file mode 100644 index 00000000..10cb3227 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/pipewire@.socket @@ -0,0 +1,19 @@ +[Unit] +Description=Multimedia Service socket for user %i +Requires=afm-user-setup@%i.service +After=afm-user-setup@%i.service + +[Socket] +Priority=6 +Backlog=5 +ListenStream=/run/user/%i/pipewire-0 +Service=pipewire@%i.service +SmackLabel=* +SmackLabelIPIn=System +SmackLabelIPOut=System +SocketUser=%i +SocketGroup=%i +SocketMode=0660 + +[Install] +WantedBy=afm-user-session@%i.target diff --git a/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/smack-pipewire b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/smack-pipewire new file mode 100644 index 00000000..8d5b541f --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire/smack-pipewire @@ -0,0 +1,8 @@ +System System::Pipewire rwxa-- +System::Pipewire System -wx--- +System::Pipewire System::Shared r-x--- +System::Pipewire System::Run rwxat- +System::Pipewire System::Log rwxa-- +System::Pipewire _ r-x--l +System::Pipewire User::Home r-x--l +System::Pipewire User::App-Shared rwxat- diff --git a/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire_git.bb b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire_git.bb new file mode 100644 index 00000000..e2560ad9 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire_git.bb @@ -0,0 +1,20 @@ +require pipewire.inc + +SRC_URI = "git://gitlab.freedesktop.org/pipewire/pipewire.git;protocol=https;branch=master \ + file://0001-meson-revert-version-check-to-require-meson-0.47-not.patch \ + file://0002-arm-build-with-mno-unaligned-access.patch \ + file://0003-gst-Implement-new-pwaudio-src-sink-elements-based-on.patch \ + file://0004-audioconvert-always-assume-that-output-ports-are-NOT.patch \ + file://0005-module-access-add-same-sec-label-mode.patch \ + file://0006-alsa-pcm-call-reuse_buffers-when-resetting-the-state.patch \ + file://0007-alsa-Set-period_size-depending-on-hardware.patch \ + file://0008-alsa-add-warning-in-case-of-partial-read-write.patch \ + file://0009-alsa-adjust-delay-depending-on-hardware.patch \ + " + +SRCREV = "b0932e687fc47e0872ca291531f2291d99042d70" + +PV = "0.2.91+git${SRCPV}+2" +S = "${WORKDIR}/git" + +RDEPENDS_${PN} += "virtual/pipewire-sessionmanager virtual/pipewire-config" diff --git a/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire_git.bbappend b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire_git.bbappend new file mode 100644 index 00000000..8a0b0741 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/pipewire/pipewire_git.bbappend @@ -0,0 +1,30 @@ +SRC_URI += "\ + file://pipewire@.service \ + file://pipewire@.socket \ + file://smack-pipewire \ + " + +do_install_append() { + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + # remove the original user unit files shipped by pipewire + rm -rf ${D}${systemd_unitdir} + + # install our own system-level templates + mkdir -p ${D}${systemd_system_unitdir}/ + install -m 0644 ${WORKDIR}/pipewire@.service ${D}${systemd_system_unitdir}/pipewire@.service + install -m 0644 ${WORKDIR}/pipewire@.socket ${D}${systemd_system_unitdir}/pipewire@.socket + + # enable the socket to start together with afm-user-session + mkdir -p ${D}${systemd_system_unitdir}/afm-user-session@.target.wants + ln -sf ../pipewire@.socket ${D}${systemd_system_unitdir}/afm-user-session@.target.wants/pipewire@.socket + + # install smack rules + mkdir -p ${D}${sysconfdir}/smack/accesses.d + install -m 0644 ${WORKDIR}/smack-pipewire ${D}${sysconfdir}/smack/accesses.d/pipewire + fi +} + +FILES_${PN} += "\ + ${systemd_system_unitdir}/* \ + ${sysconfdir}/smack/accesses.d/* \ +" diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-audio-sink.endpoint b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-audio-sink.endpoint new file mode 100644 index 00000000..4bc43574 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-audio-sink.endpoint @@ -0,0 +1,10 @@ +[match-node] +priority = 0 +properties = [ + { name = "media.class", value = "Audio/Sink" }, +] + +[endpoint] +type = "pw-audio-softdsp-endpoint" +direction = "sink" +streams = "playback.streams" diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-audio-source.endpoint b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-audio-source.endpoint new file mode 100644 index 00000000..7657f6f4 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-audio-source.endpoint @@ -0,0 +1,10 @@ +[match-node] +priority = 0 +properties = [ + { name = "media.class", value = "Audio/Source" }, +] + +[endpoint] +type = "pw-audio-softdsp-endpoint" +direction = "source" +streams = "capture.streams" diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-default-input-audio.endpoint-link b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-default-input-audio.endpoint-link new file mode 100644 index 00000000..4b70dc89 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-default-input-audio.endpoint-link @@ -0,0 +1,7 @@ +[match-endpoint] +priority = 0 +direction = "sink" +media_class = "Stream/Input/Audio" + +[endpoint-link] +keep = false diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-default-output-audio.endpoint-link b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-default-output-audio.endpoint-link new file mode 100644 index 00000000..5d6428f9 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-default-output-audio.endpoint-link @@ -0,0 +1,7 @@ +[match-endpoint] +priority = 0 +direction = "source" +media_class = "Stream/Output/Audio" + +[endpoint-link] +keep = false diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-stream-input-audio.endpoint b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-stream-input-audio.endpoint new file mode 100644 index 00000000..2993f3e4 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-stream-input-audio.endpoint @@ -0,0 +1,9 @@ +[match-node] +priority = 0 +properties = [ + { name = "media.class", value = "Stream/Input/Audio" }, +] + +[endpoint] +direction = "sink" +type = "pw-audio-softdsp-endpoint" diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-stream-output-audio.endpoint b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-stream-output-audio.endpoint new file mode 100644 index 00000000..1cf82ea0 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/00-stream-output-audio.endpoint @@ -0,0 +1,9 @@ +[match-node] +priority = 0 +properties = [ + { name = "media.class", value = "Stream/Output/Audio" }, +] + +[endpoint] +direction = "source" +type = "pw-audio-softdsp-endpoint" diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/01-hw00-audio-sink.endpoint b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/01-hw00-audio-sink.endpoint new file mode 100644 index 00000000..85a9b511 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/01-hw00-audio-sink.endpoint @@ -0,0 +1,12 @@ +[match-node] +priority = 1 +properties = [ + { name = "media.class", value = "Audio/Sink" }, + { name = "api.alsa.path", value = "hw:0,0" }, +] + +[endpoint] +type = "pw-audio-softdsp-endpoint" +direction = "sink" +streams = "playback.streams" +priority = 1 diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/01-hw00-audio-source.endpoint b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/01-hw00-audio-source.endpoint new file mode 100644 index 00000000..c77701c0 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/01-hw00-audio-source.endpoint @@ -0,0 +1,12 @@ +[match-node] +priority = 1 +properties = [ + { name = "media.class", value = "Audio/Source" }, + { name = "api.alsa.path", value = "hw:0,0" }, +] + +[endpoint] +type = "pw-audio-softdsp-endpoint" +direction = "source" +streams = "capture.streams" +priority = 1 diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-ak4613-audio-sink.endpoint b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-ak4613-audio-sink.endpoint new file mode 100644 index 00000000..afc4303e --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-ak4613-audio-sink.endpoint @@ -0,0 +1,12 @@ +[match-node] +priority = 30 +properties = [ + { name = "media.class", value = "Audio/Sink" }, + { name = "api.alsa.card.id", value = "ak4613" }, +] + +[endpoint] +type = "pw-audio-softdsp-endpoint" +direction = "sink" +streams = "playback.streams" +priority = 30 diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-ak4613-audio-source.endpoint b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-ak4613-audio-source.endpoint new file mode 100644 index 00000000..ad568059 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-ak4613-audio-source.endpoint @@ -0,0 +1,12 @@ +[match-node] +priority = 30 +properties = [ + { name = "media.class", value = "Audio/Source" }, + { name = "api.alsa.card.id", value = "ak4613" }, +] + +[endpoint] +type = "pw-audio-softdsp-endpoint" +direction = "source" +streams = "capture.streams" +priority = 30 diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-dra7xx-audio-sink.endpoint b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-dra7xx-audio-sink.endpoint new file mode 100644 index 00000000..becd21e2 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-dra7xx-audio-sink.endpoint @@ -0,0 +1,12 @@ +[match-node] +priority = 30 +properties = [ + { name = "media.class", value = "Audio/Sink" }, + { name = "api.alsa.card.id", value = "DRA7xx-EVM" }, +] + +[endpoint] +type = "pw-audio-softdsp-endpoint" +direction = "sink" +streams = "playback.streams" +priority = 30 diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-dra7xx-audio-source.endpoint b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-dra7xx-audio-source.endpoint new file mode 100644 index 00000000..72ef4677 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-dra7xx-audio-source.endpoint @@ -0,0 +1,12 @@ +[match-node] +priority = 30 +properties = [ + { name = "media.class", value = "Audio/Source" }, + { name = "api.alsa.card.id", value = "DRA7xx-EVM" }, +] + +[endpoint] +type = "pw-audio-softdsp-endpoint" +direction = "source" +streams = "capture.streams" +priority = 30 diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-imx8mq-audio-sink.endpoint b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-imx8mq-audio-sink.endpoint new file mode 100644 index 00000000..538d3137 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-imx8mq-audio-sink.endpoint @@ -0,0 +1,12 @@ +[match-node] +priority = 30 +properties = [ + { name = "media.class", value = "Audio/Sink" }, + { name = "api.alsa.card.id", value = "wm8524audio" }, +] + +[endpoint] +type = "pw-audio-softdsp-endpoint" +direction = "sink" +streams = "playback.streams" +priority = 30 diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-rcarsound-audio-sink.endpoint b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-rcarsound-audio-sink.endpoint new file mode 100644 index 00000000..53f9d0df --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-rcarsound-audio-sink.endpoint @@ -0,0 +1,12 @@ +[match-node] +priority = 30 +properties = [ + { name = "media.class", value = "Audio/Sink" }, + { name = "api.alsa.card.id", value = "rcarsound" }, +] + +[endpoint] +type = "pw-audio-softdsp-endpoint" +direction = "sink" +streams = "playback.streams" +priority = 30 diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-rcarsound-audio-source.endpoint b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-rcarsound-audio-source.endpoint new file mode 100644 index 00000000..d72d7e31 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-rcarsound-audio-source.endpoint @@ -0,0 +1,12 @@ +[match-node] +priority = 30 +properties = [ + { name = "media.class", value = "Audio/Source" }, + { name = "api.alsa.card.id", value = "rcarsound" }, +] + +[endpoint] +type = "pw-audio-softdsp-endpoint" +direction = "source" +streams = "capture.streams" +priority = 30 diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-rpi3-audio-sink.endpoint b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-rpi3-audio-sink.endpoint new file mode 100644 index 00000000..74e4d62e --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/30-rpi3-audio-sink.endpoint @@ -0,0 +1,13 @@ +[match-node] +priority = 30 +properties = [ + { name = "media.class", value = "Audio/Sink" }, + { name = "api.alsa.card.name", value = "bcm2835 ALSA" }, + { name = "api.alsa.pcm.name", value = "bcm2835 ALSA" }, +] + +[endpoint] +type = "pw-audio-softdsp-endpoint" +direction = "sink" +streams = "playback.streams" +priority = 30 diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/40-fiberdyne-amp.endpoint b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/40-fiberdyne-amp.endpoint new file mode 100644 index 00000000..807ad468 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/40-fiberdyne-amp.endpoint @@ -0,0 +1,12 @@ +[match-node] +priority = 40 +properties = [ + { name = "media.class", value = "Audio/Sink" }, + { name = "api.alsa.card.id", value = "ep016ch" }, +] + +[endpoint] +type = "pw-audio-softdsp-endpoint" +direction = "sink" +streams = "playback.streams" +priority = 40 diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/40-microchip-mic.endpoint b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/40-microchip-mic.endpoint new file mode 100644 index 00000000..bbfcd43a --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/40-microchip-mic.endpoint @@ -0,0 +1,12 @@ +[match-node] +priority = 40 +properties = [ + { name = "media.class", value = "Audio/Source" }, + { name = "api.alsa.card.id", value = "ep811ch" }, +] + +[endpoint] +type = "pw-audio-softdsp-endpoint" +direction = "source" +streams = "capture.streams" +priority = 40 diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/70-usb-audio-sink.endpoint b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/70-usb-audio-sink.endpoint new file mode 100644 index 00000000..62e27909 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/70-usb-audio-sink.endpoint @@ -0,0 +1,12 @@ +[match-node] +priority = 70 +properties = [ + { name = "media.class", value = "Audio/Sink" }, + { name = "api.alsa.card.driver", value = "USB-Audio" }, +] + +[endpoint] +type = "pw-audio-softdsp-endpoint" +direction = "sink" +streams = "playback.streams" +priority = 70 diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/70-usb-audio-source.endpoint b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/70-usb-audio-source.endpoint new file mode 100644 index 00000000..505ae8d8 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/70-usb-audio-source.endpoint @@ -0,0 +1,12 @@ +[match-node] +priority = 70 +properties = [ + { name = "media.class", value = "Audio/Source" }, + { name = "api.alsa.card.driver", value = "USB-Audio" }, +] + +[endpoint] +type = "pw-audio-softdsp-endpoint" +direction = "source" +streams = "capture.streams" +priority = 70 diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/bluealsa-input-audio.endpoint-link b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/bluealsa-input-audio.endpoint-link new file mode 100644 index 00000000..b5753a10 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/bluealsa-input-audio.endpoint-link @@ -0,0 +1,11 @@ +[match-endpoint] +priority = 75 +direction = "sink" +name = "bluealsa*" +media_class = "Stream/Input/Audio" +properties = [ + { name = "bluealsa.profile", value = "sco" }, +] + +[endpoint-link] +keep = true diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/bluealsa-output-audio.endpoint-link b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/bluealsa-output-audio.endpoint-link new file mode 100644 index 00000000..d1b3cec0 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/bluealsa-output-audio.endpoint-link @@ -0,0 +1,11 @@ +[match-endpoint] +priority = 75 +direction = "source" +name = "bluealsa*" +media_class = "Stream/Output/Audio" +properties = [ + { name = "bluealsa.profile", value = "sco" }, +] + +[endpoint-link] +keep = true diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/capture.streams b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/capture.streams new file mode 100644 index 00000000..e7ce36f6 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/capture.streams @@ -0,0 +1,3 @@ +[[streams]] +name = "Default" +priority = 25 diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/playback.streams b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/playback.streams new file mode 100644 index 00000000..c645416a --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/playback.streams @@ -0,0 +1,31 @@ +[[streams]] +name = "Multimedia" +priority = 25 + +[[streams]] +name = "Speech-Low" +priority = 30 + +[[streams]] +name = "Custom-Low" +priority = 35 + +[[streams]] +name = "Navigation" +priority = 50 + +[[streams]] +name = "Speech-High" +priority = 60 + +[[streams]] +name = "Custom-High" +priority = 65 + +[[streams]] +name = "Communication" +priority = 75 + +[[streams]] +name = "Emergency" +priority = 99 diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/wireplumber.conf b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/wireplumber.conf new file mode 100644 index 00000000..e0975a81 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl/wireplumber.conf @@ -0,0 +1,30 @@ +# Register well-known SPA factories +# These do not need to exist on the system to be registered +add-spa-lib audio.convert* audioconvert/libspa-audioconvert +add-spa-lib api.alsa.* alsa/libspa-alsa +add-spa-lib api.v4l2.* v4l2/libspa-v4l2 +add-spa-lib api.bluez5.* bluez5/libspa-bluez5 + +# the client-device pipewire module is needed for libwireplumber-module-monitor +load-pipewire-module libpipewire-module-client-device + +# Session object implementation +# This keeps track of the default input & output device endpoint +load-module C libwireplumber-module-session + +# Basic pipewire integration - do not remove +load-module C libwireplumber-module-pipewire + +# Grants access to security confined clients +load-module C libwireplumber-module-client-permissions + +load-module C libwireplumber-module-monitor { + "factory": <"api.alsa.enum.udev">, + "flags": <["use-adapter", "activate-devices"]> +} + +# Implements endpoint creation based on TOML configuration files +load-module C libwireplumber-module-config-endpoint + +# Implements linking clients to devices based on TOML configuration files +load-module C libwireplumber-module-config-policy diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl_git.bb b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl_git.bb new file mode 100644 index 00000000..8b9a6459 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-board-config-agl_git.bb @@ -0,0 +1,58 @@ +SUMMARY = "AGL configuration file for wireplumber" +HOMEPAGE = "https://gitlab.freedesktop.org/gkiagia/wireplumber" +BUGTRACKER = "https://jira.automotivelinux.org" +AUTHOR = "George Kiagiadakis " +SECTION = "multimedia" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI = "\ + file://wireplumber.conf \ + file://00-audio-sink.endpoint \ + file://00-audio-source.endpoint \ + file://00-default-input-audio.endpoint-link \ + file://00-default-output-audio.endpoint-link \ + file://00-stream-input-audio.endpoint \ + file://00-stream-output-audio.endpoint \ + file://01-hw00-audio-sink.endpoint \ + file://01-hw00-audio-source.endpoint \ + file://30-ak4613-audio-sink.endpoint \ + file://30-ak4613-audio-source.endpoint \ + file://30-rcarsound-audio-sink.endpoint \ + file://30-rcarsound-audio-source.endpoint \ + file://30-dra7xx-audio-sink.endpoint \ + file://30-dra7xx-audio-source.endpoint \ + file://30-rpi3-audio-sink.endpoint \ + file://30-imx8mq-audio-sink.endpoint \ + file://40-fiberdyne-amp.endpoint \ + file://40-microchip-mic.endpoint \ + file://70-usb-audio-sink.endpoint \ + file://70-usb-audio-source.endpoint \ + file://bluealsa-input-audio.endpoint-link \ + file://bluealsa-output-audio.endpoint-link \ + file://capture.streams \ + file://playback.streams \ +" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +do_install_append() { + install -d ${D}/${sysconfdir}/wireplumber/ + install -m 644 ${WORKDIR}/wireplumber.conf ${D}/${sysconfdir}/wireplumber/wireplumber.conf + install -m 644 ${WORKDIR}/*.endpoint ${D}/${sysconfdir}/wireplumber/ + install -m 644 ${WORKDIR}/*.endpoint-link ${D}/${sysconfdir}/wireplumber/ + install -m 644 ${WORKDIR}/*.streams ${D}/${sysconfdir}/wireplumber/ +} + +FILES_${PN} += "\ + ${sysconfdir}/wireplumber/* \ +" +CONFFILES_${PN} += "\ + ${sysconfdir}/wireplumber/* \ +" + +RPROVIDES_${PN} += "virtual/wireplumber-config" diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-Build-cpptoml-without-a-cmake-subproject.patch b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-Build-cpptoml-without-a-cmake-subproject.patch new file mode 100644 index 00000000..726b35e7 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber/0001-Build-cpptoml-without-a-cmake-subproject.patch @@ -0,0 +1,28 @@ +From e5efe3d4f0abc28251dac245ce0cf4124e7e2a12 Mon Sep 17 00:00:00 2001 +From: George Kiagiadakis +Date: Thu, 5 Dec 2019 17:59:44 +0200 +Subject: [PATCH] Build cpptoml without a cmake subproject + +Upstream-Status: Inappropriate +--- + meson.build | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/meson.build b/meson.build +index 5a75d96..0b21377 100644 +--- a/meson.build ++++ b/meson.build +@@ -24,9 +24,7 @@ else + wireplumber_config_dir = join_paths(get_option('prefix'), get_option('sysconfdir'), 'wireplumber') + endif + +-cmake = import('cmake') +-cpptoml = cmake.subproject('cpptoml') +-cpptoml_dep = cpptoml.dependency('cpptoml') ++cpptoml_dep = declare_dependency(include_directories: include_directories('subprojects/cpptoml')) + + gobject_dep = dependency('gobject-2.0') + gmodule_dep = dependency('gmodule-2.0') +-- +2.24.0 + diff --git a/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb new file mode 100644 index 00000000..0e810b37 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb @@ -0,0 +1,46 @@ +SUMMARY = "Session / Policy Manager for PipeWire" +HOMEPAGE = "https://gitlab.freedesktop.org/pipewire/wireplumber" +BUGTRACKER = "https://gitlab.freedesktop.org/pipewire/wireplumber/issues" +AUTHOR = "George Kiagiadakis " +SECTION = "multimedia" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;beginline=3;md5=e8ad01a5182f2c1b3a2640e9ea268264" + +inherit meson pkgconfig gobject-introspection + +DEPENDS = "glib-2.0 glib-2.0-native pipewire" + +SRC_URI = "\ + git://gitlab.freedesktop.org/pipewire/wireplumber.git;protocol=https;branch=master \ + https://raw.githubusercontent.com/skystrife/cpptoml/fededad7169e538ca47e11a9ee9251bc361a9a65/include/cpptoml.h \ + file://0001-Build-cpptoml-without-a-cmake-subproject.patch \ +" +SRCREV = "0e98e4150b73d0bed9b72bf8d3eba49671962991" +SRC_URI[sha256sum] = "3e4e1d315fa1229921c7a4297ead08775b5bb1220c18a7eac62db9ca7e79df0d" + +PV = "0.1.90+git${SRCPV}" +S = "${WORKDIR}/git" + +do_configure_prepend() { + mkdir -p ${WORKDIR}/git/subprojects/cpptoml/include + cp -f ${WORKDIR}/cpptoml.h ${WORKDIR}/git/subprojects/cpptoml/include/ +} + +PACKAGES =+ "${PN}-config" + +FILES_${PN} += "\ + ${libdir}/wireplumber-*/* \ +" +RPROVIDES_${PN} += "virtual/pipewire-sessionmanager" +RDEPENDS_${PN} += "virtual/wireplumber-config" + + +FILES_${PN}-config += "\ + ${sysconfdir}/wireplumber/* \ +" +CONFFILES_${PN}-config += "\ + ${sysconfdir}/wireplumber/* \ +" + +RPROVIDES_${PN}-config += "virtual/wireplumber-config" diff --git a/meta-agl/meta-pipewire/recipes-security/cynagora/cynagora_%.bbappend b/meta-agl/meta-pipewire/recipes-security/cynagora/cynagora_%.bbappend new file mode 100644 index 00000000..9395c90c --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-security/cynagora/cynagora_%.bbappend @@ -0,0 +1,5 @@ + +do_install_append() { + echo "System::Pipewire * * http://tizen.org/privilege/internal/dbus yes forever" >> ${D}${sysconfdir}/security/cynagora.initial +} + diff --git a/meta-agl/meta-pipewire/recipes-security/security-manager/security-manager_%.bbappend b/meta-agl/meta-pipewire/recipes-security/security-manager/security-manager_%.bbappend new file mode 100644 index 00000000..59449446 --- /dev/null +++ b/meta-agl/meta-pipewire/recipes-security/security-manager/security-manager_%.bbappend @@ -0,0 +1,4 @@ + +do_install_append() { + echo "~APP~ System::Pipewire rw" >> ${D}${datadir}/security-manager/policy/app-rules-template.smack +} diff --git a/meta-agl/meta-security/README.md b/meta-agl/meta-security/README.md index 0bae9f3f..6a8024bc 100644 --- a/meta-agl/meta-security/README.md +++ b/meta-agl/meta-security/README.md @@ -27,5 +27,5 @@ Please submit any patches against the meta-security layer via gerrit reviews. For discussion use the discussion mailing list -mailto:automotive-discussions@lists.linuxfoundation.org +https://lists.automotivelinux.org/g/agl-dev-community diff --git a/meta-agl/meta-security/conf/layer.conf b/meta-agl/meta-security/conf/layer.conf index 16dae398..6024d284 100644 --- a/meta-agl/meta-security/conf/layer.conf +++ b/meta-agl/meta-security/conf/layer.conf @@ -11,4 +11,4 @@ BBFILE_COLLECTIONS += "security-smack" BBFILE_PATTERN_security-smack := "^${LAYERDIR}/" BBFILE_PRIORITY_security-smack = "60" -LAYERSERIES_COMPAT_security-smack = "thud" +LAYERSERIES_COMPAT_security-smack = "dunfell" diff --git a/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0001-Integration-of-Cynara-asynchronous-security-checks.patch b/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0001-Integration-of-Cynara-asynchronous-security-checks.patch new file mode 100644 index 00000000..55cedb9c --- /dev/null +++ b/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0001-Integration-of-Cynara-asynchronous-security-checks.patch @@ -0,0 +1,2309 @@ +From ea4b650366261e4257e4b0fb95e7f48e30ef36f0 Mon Sep 17 00:00:00 2001 +From: Jacek Bukarewicz +Date: Thu, 27 Nov 2014 18:11:05 +0100 +Subject: [PATCH 1/8] Integration of Cynara asynchronous security checks +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This commit introduces basic framework for asynchronous policy +checks and Cynara integration code. Functions for checking security +policy can now return third value - BUS_RESULT_LATER denoting check +result unavailability. Whenever policy checker cannot decide on the +result of the check it is supposed to allocate DeferredMessage structure +that will be passed to the upper layers which can decide what should be +done in such situation. +Proper handling of such case will be implemented in subsequent commits. +Currently such return value results in message denial. + +Cherry picked from 4dcfb02f17247ff9de966b62182cd2e08f301238 +by José Bollo. + +Updated for dbus 1.10.20 by Scott Murray and José Bollo +Updated for dbus 1.12.16 by José Bollo + +Change-Id: I9bcbce34577e5dc2a3cecf6233a0a2b0e43e1108 +Signed-off-by: José Bollo +Signed-off-by: Scott Murray +--- + bus/Makefile.am | 6 + + bus/activation.c | 5 +- + bus/bus.c | 124 ++++-- + bus/bus.h | 22 +- + bus/check.c | 217 ++++++++++ + bus/check.h | 68 ++++ + bus/config-parser-common.c | 6 + + bus/config-parser-common.h | 1 + + bus/config-parser-trivial.c | 2 + + bus/config-parser.c | 72 +++- + bus/connection.c | 57 ++- + bus/connection.h | 4 + + bus/cynara.c | 374 ++++++++++++++++++ + bus/cynara.h | 37 ++ + bus/dispatch.c | 46 ++- + bus/driver.h | 2 + + bus/policy.c | 195 ++++++--- + bus/policy.h | 29 +- + configure.ac | 12 + + test/Makefile.am | 1 + + .../data/invalid-config-files/badcheck-1.conf | 9 + + .../data/invalid-config-files/badcheck-2.conf | 9 + + test/data/valid-config-files/check-1.conf | 9 + + .../debug-check-some.conf.in | 18 + + 24 files changed, 1181 insertions(+), 144 deletions(-) + create mode 100644 bus/check.c + create mode 100644 bus/check.h + create mode 100644 bus/cynara.c + create mode 100644 bus/cynara.h + create mode 100644 test/data/invalid-config-files/badcheck-1.conf + create mode 100644 test/data/invalid-config-files/badcheck-2.conf + create mode 100644 test/data/valid-config-files/check-1.conf + create mode 100644 test/data/valid-config-files/debug-check-some.conf.in + +diff --git a/bus/Makefile.am b/bus/Makefile.am +index c917063..2a8a72c 100644 +--- a/bus/Makefile.am ++++ b/bus/Makefile.am +@@ -13,6 +13,7 @@ DBUS_BUS_LIBS = \ + $(THREAD_LIBS) \ + $(ADT_LIBS) \ + $(NETWORK_libs) \ ++ $(CYNARA_LIBS) \ + $(NULL) + + DBUS_LAUNCHER_LIBS = \ +@@ -30,6 +31,7 @@ AM_CPPFLAGS = \ + $(APPARMOR_CFLAGS) \ + -DDBUS_SYSTEM_CONFIG_FILE=\""$(dbusdatadir)/system.conf"\" \ + -DDBUS_COMPILATION \ ++ $(CYNARA_CFLAGS) \ + $(NULL) + + # if assertions are enabled, improve backtraces +@@ -90,6 +92,8 @@ BUS_SOURCES= \ + audit.h \ + bus.c \ + bus.h \ ++ check.c \ ++ check.h \ + config-loader-expat.c \ + config-parser.c \ + config-parser.h \ +@@ -97,6 +101,8 @@ BUS_SOURCES= \ + config-parser-common.h \ + connection.c \ + connection.h \ ++ cynara.c \ ++ cynara.h \ + desktop-file.c \ + desktop-file.h \ + $(DIR_WATCH_SOURCE) \ +diff --git a/bus/activation.c b/bus/activation.c +index 99404b9..f9c6c62 100644 +--- a/bus/activation.c ++++ b/bus/activation.c +@@ -1789,14 +1789,15 @@ bus_activation_activate_service (BusActivation *activation, + + if (auto_activation && + entry != NULL && +- !bus_context_check_security_policy (activation->context, ++ BUS_RESULT_TRUE != bus_context_check_security_policy (activation->context, + transaction, + connection, /* sender */ + NULL, /* addressed recipient */ + NULL, /* proposed recipient */ + activation_message, + entry, +- error)) ++ error, ++ NULL)) + { + _DBUS_ASSERT_ERROR_IS_SET (error); + _dbus_verbose ("activation not authorized: %s: %s\n", +diff --git a/bus/bus.c b/bus/bus.c +index 2ad8e78..6fc45d0 100644 +--- a/bus/bus.c ++++ b/bus/bus.c +@@ -38,6 +38,7 @@ + #include "apparmor.h" + #include "audit.h" + #include "dir-watch.h" ++#include "check.h" + #include + #include + #include +@@ -67,6 +68,7 @@ struct BusContext + BusRegistry *registry; + BusPolicy *policy; + BusMatchmaker *matchmaker; ++ BusCheck *check; + BusLimits limits; + DBusRLimit *initial_fd_limit; + unsigned int fork : 1; +@@ -1003,6 +1005,10 @@ bus_context_new (const DBusString *config_file, + parser = NULL; + } + ++ context->check = bus_check_new(context, error); ++ if (context->check == NULL) ++ goto failed; ++ + dbus_server_free_data_slot (&server_data_slot); + + return context; +@@ -1127,6 +1133,12 @@ bus_context_unref (BusContext *context) + + bus_context_shutdown (context); + ++ if (context->check) ++ { ++ bus_check_unref(context->check); ++ context->check = NULL; ++ } ++ + if (context->connections) + { + bus_connections_unref (context->connections); +@@ -1256,6 +1268,12 @@ bus_context_get_loop (BusContext *context) + return context->loop; + } + ++BusCheck* ++bus_context_get_check (BusContext *context) ++{ ++ return context->check; ++} ++ + dbus_bool_t + bus_context_allow_unix_user (BusContext *context, + unsigned long uid) +@@ -1451,6 +1469,7 @@ complain_about_message (BusContext *context, + DBusConnection *proposed_recipient, + dbus_bool_t requested_reply, + dbus_bool_t log, ++ const char *privilege, + DBusError *error) + { + DBusError stack_error = DBUS_ERROR_INIT; +@@ -1480,7 +1499,8 @@ complain_about_message (BusContext *context, + dbus_set_error (&stack_error, error_name, + "%s, %d matched rules; type=\"%s\", sender=\"%s\" (%s) " + "interface=\"%s\" member=\"%s\" error name=\"%s\" " +- "requested_reply=\"%d\" destination=\"%s\" (%s)", ++ "requested_reply=\"%d\" destination=\"%s\" (%s) " ++ "privilege=\"%s\"", + complaint, + matched_rules, + dbus_message_type_to_string (dbus_message_get_type (message)), +@@ -1491,7 +1511,8 @@ complain_about_message (BusContext *context, + nonnull (dbus_message_get_error_name (message), "(unset)"), + requested_reply, + nonnull (dbus_message_get_destination (message), DBUS_SERVICE_DBUS), +- proposed_recipient_loginfo); ++ proposed_recipient_loginfo, ++ nonnull (privilege, "(n/a)")); + + /* If we hit OOM while setting the error, this will syslog "out of memory" + * which is itself an indication that something is seriously wrong */ +@@ -1519,7 +1540,7 @@ complain_about_message (BusContext *context, + * NULL for addressed_recipient may mean the bus driver, or may mean + * no destination was specified in the message (e.g. a signal). + */ +-dbus_bool_t ++BusResult + bus_context_check_security_policy (BusContext *context, + BusTransaction *transaction, + DBusConnection *sender, +@@ -1527,7 +1548,8 @@ bus_context_check_security_policy (BusContext *context, + DBusConnection *proposed_recipient, + DBusMessage *message, + BusActivationEntry *activation_entry, +- DBusError *error) ++ DBusError *error, ++ BusDeferredMessage **deferred_message) + { + const char *src, *dest; + BusClientPolicy *sender_policy; +@@ -1536,6 +1558,7 @@ bus_context_check_security_policy (BusContext *context, + dbus_bool_t log; + int type; + dbus_bool_t requested_reply; ++ const char *privilege; + + type = dbus_message_get_type (message); + src = dbus_message_get_sender (message); +@@ -1565,7 +1588,7 @@ bus_context_check_security_policy (BusContext *context, + dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, + "Message bus will not accept messages of unknown type\n"); + +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + requested_reply = FALSE; +@@ -1595,7 +1618,7 @@ bus_context_check_security_policy (BusContext *context, + if (dbus_error_is_set (&error2)) + { + dbus_move_error (&error2, error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + } + } +@@ -1624,11 +1647,11 @@ bus_context_check_security_policy (BusContext *context, + complain_about_message (context, DBUS_ERROR_ACCESS_DENIED, + "An SELinux policy prevents this sender from sending this " + "message to this recipient", +- 0, message, sender, proposed_recipient, FALSE, FALSE, error); ++ 0, message, sender, proposed_recipient, FALSE, FALSE, NULL, error); + _dbus_verbose ("SELinux security check denying send to service\n"); + } + +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + /* next verify AppArmor access controls. If allowed then +@@ -1646,7 +1669,7 @@ bus_context_check_security_policy (BusContext *context, + src ? src : DBUS_SERVICE_DBUS, + activation_entry, + error)) +- return FALSE; ++ return BUS_RESULT_FALSE; + + if (!bus_connection_is_active (sender)) + { +@@ -1660,7 +1683,7 @@ bus_context_check_security_policy (BusContext *context, + { + _dbus_verbose ("security check allowing %s message\n", + "Hello"); +- return TRUE; ++ return BUS_RESULT_TRUE; + } + else + { +@@ -1671,7 +1694,7 @@ bus_context_check_security_policy (BusContext *context, + "Client tried to send a message other than %s without being registered", + "Hello"); + +- return FALSE; ++ return BUS_RESULT_FALSE; + } + } + } +@@ -1720,20 +1743,29 @@ bus_context_check_security_policy (BusContext *context, + (proposed_recipient == NULL && recipient_policy == NULL)); + + log = FALSE; +- if (sender_policy && +- !bus_client_policy_check_can_send (sender_policy, +- context->registry, +- requested_reply, +- proposed_recipient, +- message, &toggles, &log)) +- { +- complain_about_message (context, DBUS_ERROR_ACCESS_DENIED, +- "Rejected send message", toggles, +- message, sender, proposed_recipient, requested_reply, +- (addressed_recipient == proposed_recipient), error); +- _dbus_verbose ("security policy disallowing message due to sender policy\n"); +- return FALSE; +- } ++ if (sender_policy) ++ { ++ BusResult res = bus_client_policy_check_can_send (sender, ++ sender_policy, ++ context->registry, ++ requested_reply, ++ addressed_recipient, ++ proposed_recipient, ++ message, &toggles, &log, &privilege, ++ deferred_message); ++ if (res == BUS_RESULT_FALSE) ++ { ++ complain_about_message (context, DBUS_ERROR_ACCESS_DENIED, ++ "Rejected send message", toggles, ++ message, sender, proposed_recipient, requested_reply, ++ (addressed_recipient == proposed_recipient), privilege, ++ error); ++ _dbus_verbose ("security policy disallowing message due to sender policy\n"); ++ return BUS_RESULT_FALSE; ++ } ++ else if (res == BUS_RESULT_LATER) ++ return BUS_RESULT_LATER; ++ } + + if (log) + { +@@ -1742,23 +1774,29 @@ bus_context_check_security_policy (BusContext *context, + complain_about_message (context, DBUS_ERROR_ACCESS_DENIED, + "Would reject message", toggles, + message, sender, proposed_recipient, requested_reply, +- TRUE, NULL); ++ TRUE, privilege, NULL); + } + +- if (recipient_policy && +- !bus_client_policy_check_can_receive (recipient_policy, +- context->registry, +- requested_reply, +- sender, +- addressed_recipient, proposed_recipient, +- message, &toggles)) ++ if (recipient_policy) + { +- complain_about_message (context, DBUS_ERROR_ACCESS_DENIED, +- "Rejected receive message", toggles, +- message, sender, proposed_recipient, requested_reply, +- (addressed_recipient == proposed_recipient), error); +- _dbus_verbose ("security policy disallowing message due to recipient policy\n"); +- return FALSE; ++ BusResult res; ++ res = bus_client_policy_check_can_receive (recipient_policy, ++ context->registry, ++ requested_reply, ++ sender, ++ addressed_recipient, proposed_recipient, ++ message, &toggles, &privilege, deferred_message); ++ if (res == BUS_RESULT_FALSE) ++ { ++ complain_about_message(context, DBUS_ERROR_ACCESS_DENIED, "Rejected receive message", ++ toggles, message, sender, proposed_recipient, requested_reply, ++ (addressed_recipient == proposed_recipient), privilege, error); ++ _dbus_verbose( ++ "security policy disallowing message due to recipient policy\n"); ++ return BUS_RESULT_FALSE; ++ } ++ else if (res == BUS_RESULT_LATER) ++ return BUS_RESULT_LATER; + } + + /* See if limits on size have been exceeded */ +@@ -1768,10 +1806,10 @@ bus_context_check_security_policy (BusContext *context, + { + complain_about_message (context, DBUS_ERROR_LIMITS_EXCEEDED, + "Rejected: destination has a full message queue", +- 0, message, sender, proposed_recipient, requested_reply, TRUE, ++ 0, message, sender, proposed_recipient, requested_reply, TRUE, NULL, + error); + _dbus_verbose ("security policy disallowing message due to full message queue\n"); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + /* Record that we will allow a reply here in the future (don't +@@ -1792,11 +1830,11 @@ bus_context_check_security_policy (BusContext *context, + message, error)) + { + _dbus_verbose ("Failed to record reply expectation or problem with the message expecting a reply\n"); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + _dbus_verbose ("security policy allowing message\n"); +- return TRUE; ++ return BUS_RESULT_TRUE; + } + + void +diff --git a/bus/bus.h b/bus/bus.h +index 2e0de82..82c32c8 100644 +--- a/bus/bus.h ++++ b/bus/bus.h +@@ -45,6 +45,22 @@ typedef struct BusTransaction BusTransaction; + typedef struct BusMatchmaker BusMatchmaker; + typedef struct BusMatchRule BusMatchRule; + typedef struct BusActivationEntry BusActivationEntry; ++typedef struct BusCheck BusCheck; ++typedef struct BusDeferredMessage BusDeferredMessage; ++typedef struct BusCynara BusCynara; ++ ++/** ++ * BusResult is defined as a pointer to a dummy structure to allow detection of type mismatches. ++ * The disadvantage of such solution is that now BusResult variables cannot be used in switch ++ * statement. ++ * Additionally, BUS_RESULT_TRUE is defined as 0 instead of 1 to help detect type mismatches ++ * at runtime. ++ */ ++typedef const struct BusResultStruct { int dummy; } *BusResult; ++ ++static const BusResult BUS_RESULT_TRUE = (BusResult)0x0; ++static const BusResult BUS_RESULT_FALSE = (BusResult)0x1; ++static const BusResult BUS_RESULT_LATER = (BusResult)0x2; + + typedef struct + { +@@ -101,6 +117,7 @@ BusConnections* bus_context_get_connections (BusContext + BusActivation* bus_context_get_activation (BusContext *context); + BusMatchmaker* bus_context_get_matchmaker (BusContext *context); + DBusLoop* bus_context_get_loop (BusContext *context); ++BusCheck * bus_context_get_check (BusContext *context); + dbus_bool_t bus_context_allow_unix_user (BusContext *context, + unsigned long uid); + dbus_bool_t bus_context_allow_windows_user (BusContext *context, +@@ -136,14 +153,15 @@ void bus_context_log_and_set_error (BusContext + const char *name, + const char *msg, + ...) _DBUS_GNUC_PRINTF (5, 6); +-dbus_bool_t bus_context_check_security_policy (BusContext *context, ++BusResult bus_context_check_security_policy (BusContext *context, + BusTransaction *transaction, + DBusConnection *sender, + DBusConnection *addressed_recipient, + DBusConnection *proposed_recipient, + DBusMessage *message, + BusActivationEntry *activation_entry, +- DBusError *error); ++ DBusError *error, ++ BusDeferredMessage **deferred_message); + void bus_context_check_all_watches (BusContext *context); + + #endif /* BUS_BUS_H */ +diff --git a/bus/check.c b/bus/check.c +new file mode 100644 +index 0000000..5b72d31 +--- /dev/null ++++ b/bus/check.c +@@ -0,0 +1,217 @@ ++/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ ++/* check.c Bus security policy runtime check ++ * ++ * Copyright (C) 2014 Intel, Inc. ++ * Copyright (c) 2014 Samsung Electronics, Ltd. ++ * ++ * Licensed under the Academic Free License version 2.1 ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#include ++#include "check.h" ++#include "connection.h" ++#include "dispatch.h" ++#include "cynara.h" ++#include "utils.h" ++#include ++#include ++#include ++ ++ ++typedef struct BusCheck ++{ ++ int refcount; ++ ++ BusContext *context; ++ BusCynara *cynara; ++} BusCheck; ++ ++typedef struct BusDeferredMessage ++{ ++ int refcount; ++ ++ DBusMessage *message; ++ DBusConnection *sender; ++ DBusConnection *proposed_recipient; ++ DBusConnection *addressed_recipient; ++ dbus_bool_t full_dispatch; ++ BusDeferredMessageStatus status; ++ BusResult response; ++ BusCheckResponseFunc response_callback; ++} BusDeferredMessage; ++ ++BusCheck * ++bus_check_new (BusContext *context, DBusError *error) ++{ ++ BusCheck *check; ++ ++ check = dbus_new(BusCheck, 1); ++ if (check == NULL) ++ { ++ BUS_SET_OOM(error); ++ return NULL; ++ } ++ ++ check->refcount = 1; ++ check->context = context; ++ check->cynara = bus_cynara_new(check, error); ++ if (dbus_error_is_set(error)) ++ { ++ dbus_free(check); ++ return NULL; ++ } ++ ++ return check; ++} ++ ++BusCheck * ++bus_check_ref (BusCheck *check) ++{ ++ _dbus_assert (check->refcount > 0); ++ check->refcount += 1; ++ ++ return check; ++} ++ ++void ++bus_check_unref (BusCheck *check) ++{ ++ _dbus_assert (check->refcount > 0); ++ ++ check->refcount -= 1; ++ ++ if (check->refcount == 0) ++ { ++ bus_cynara_unref(check->cynara); ++ dbus_free(check); ++ } ++} ++ ++BusContext * ++bus_check_get_context (BusCheck *check) ++{ ++ return check->context; ++} ++ ++BusCynara * ++bus_check_get_cynara (BusCheck *check) ++{ ++ return check->cynara; ++} ++ ++BusResult ++bus_check_privilege (BusCheck *check, ++ DBusMessage *message, ++ DBusConnection *sender, ++ DBusConnection *addressed_recipient, ++ DBusConnection *proposed_recipient, ++ const char *privilege, ++ BusDeferredMessageStatus check_type, ++ BusDeferredMessage **deferred_message) ++{ ++ BusResult result = BUS_RESULT_FALSE; ++#ifdef DBUS_ENABLE_CYNARA ++ BusCynara *cynara; ++#endif ++ DBusConnection *connection; ++ ++ connection = check_type == BUS_DEFERRED_MESSAGE_CHECK_RECEIVE ? proposed_recipient : sender; ++ ++ if (!dbus_connection_get_is_connected(connection)) ++ { ++ return BUS_RESULT_FALSE; ++ } ++ ++ /* ask policy checkers */ ++#ifdef DBUS_ENABLE_CYNARA ++ cynara = bus_check_get_cynara(check); ++ result = bus_cynara_check_privilege(cynara, message, sender, addressed_recipient, ++ proposed_recipient, privilege, check_type, deferred_message); ++#endif ++ ++ if (result == BUS_RESULT_LATER && deferred_message != NULL) ++ { ++ (*deferred_message)->status |= check_type; ++ } ++ return result; ++} ++ ++BusDeferredMessage *bus_deferred_message_new (DBusMessage *message, ++ DBusConnection *sender, ++ DBusConnection *addressed_recipient, ++ DBusConnection *proposed_recipient, ++ BusResult response) ++{ ++ BusDeferredMessage *deferred_message; ++ ++ deferred_message = dbus_new(BusDeferredMessage, 1); ++ if (deferred_message == NULL) ++ { ++ return NULL; ++ } ++ ++ deferred_message->refcount = 1; ++ deferred_message->sender = sender != NULL ? dbus_connection_ref(sender) : NULL; ++ deferred_message->addressed_recipient = addressed_recipient != NULL ? dbus_connection_ref(addressed_recipient) : NULL; ++ deferred_message->proposed_recipient = proposed_recipient != NULL ? dbus_connection_ref(proposed_recipient) : NULL; ++ deferred_message->message = dbus_message_ref(message); ++ deferred_message->response = response; ++ deferred_message->status = 0; ++ deferred_message->full_dispatch = FALSE; ++ deferred_message->response_callback = NULL; ++ ++ return deferred_message; ++} ++ ++BusDeferredMessage * ++bus_deferred_message_ref (BusDeferredMessage *deferred_message) ++{ ++ _dbus_assert (deferred_message->refcount > 0); ++ deferred_message->refcount += 1; ++ return deferred_message; ++} ++ ++void ++bus_deferred_message_unref (BusDeferredMessage *deferred_message) ++{ ++ _dbus_assert (deferred_message->refcount > 0); ++ ++ deferred_message->refcount -= 1; ++ ++ if (deferred_message->refcount == 0) ++ { ++ dbus_message_unref(deferred_message->message); ++ if (deferred_message->sender != NULL) ++ dbus_connection_unref(deferred_message->sender); ++ if (deferred_message->addressed_recipient != NULL) ++ dbus_connection_unref(deferred_message->addressed_recipient); ++ if (deferred_message->proposed_recipient != NULL) ++ dbus_connection_unref(deferred_message->proposed_recipient); ++ dbus_free(deferred_message); ++ } ++} ++ ++void ++bus_deferred_message_response_received (BusDeferredMessage *deferred_message, ++ BusResult result) ++{ ++ if (deferred_message->response_callback != NULL) ++ { ++ deferred_message->response_callback(deferred_message, result); ++ } ++} +diff --git a/bus/check.h b/bus/check.h +new file mode 100644 +index 0000000..c3fcaf9 +--- /dev/null ++++ b/bus/check.h +@@ -0,0 +1,68 @@ ++/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ ++/* check.h Bus security policy runtime check ++ * ++ * Copyright (C) 2014 Intel, Inc. ++ * Copyright (c) 2014 Samsung Electronics, Ltd. ++ * ++ * Licensed under the Academic Free License version 2.1 ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifndef BUS_CHECK_H ++#define BUS_CHECK_H ++ ++#include "bus.h" ++#include "policy.h" ++ ++ ++typedef void (*BusCheckResponseFunc) (BusDeferredMessage *message, ++ BusResult result); ++ ++typedef enum { ++ BUS_DEFERRED_MESSAGE_CHECK_SEND = 1 << 0, ++ BUS_DEFERRED_MESSAGE_CHECK_RECEIVE = 1 << 1, ++ BUS_DEFERRED_MESSAGE_CHECK_OWN = 1 << 2, ++} BusDeferredMessageStatus; ++ ++ ++BusCheck *bus_check_new (BusContext *context, ++ DBusError *error); ++BusCheck *bus_check_ref (BusCheck *check); ++void bus_check_unref (BusCheck *check); ++ ++BusContext *bus_check_get_context (BusCheck *check); ++BusCynara *bus_check_get_cynara (BusCheck *check); ++BusResult bus_check_privilege (BusCheck *check, ++ DBusMessage *message, ++ DBusConnection *sender, ++ DBusConnection *addressed_recipient, ++ DBusConnection *proposed_recipient, ++ const char *privilege, ++ BusDeferredMessageStatus check_type, ++ BusDeferredMessage **deferred_message); ++ ++BusDeferredMessage *bus_deferred_message_new (DBusMessage *message, ++ DBusConnection *sender, ++ DBusConnection *addressed_recipient, ++ DBusConnection *proposed_recipient, ++ BusResult response); ++ ++BusDeferredMessage *bus_deferred_message_ref (BusDeferredMessage *deferred_message); ++void bus_deferred_message_unref (BusDeferredMessage *deferred_message); ++void bus_deferred_message_response_received (BusDeferredMessage *deferred_message, ++ BusResult result); ++#endif /* BUS_CHECK_H */ +diff --git a/bus/config-parser-common.c b/bus/config-parser-common.c +index c1c4191..e2f253d 100644 +--- a/bus/config-parser-common.c ++++ b/bus/config-parser-common.c +@@ -75,6 +75,10 @@ bus_config_parser_element_name_to_type (const char *name) + { + return ELEMENT_DENY; + } ++ else if (strcmp (name, "check") == 0) ++ { ++ return ELEMENT_CHECK; ++ } + else if (strcmp (name, "servicehelper") == 0) + { + return ELEMENT_SERVICEHELPER; +@@ -159,6 +163,8 @@ bus_config_parser_element_type_to_name (ElementType type) + return "allow"; + case ELEMENT_DENY: + return "deny"; ++ case ELEMENT_CHECK: ++ return "check"; + case ELEMENT_FORK: + return "fork"; + case ELEMENT_PIDFILE: +diff --git a/bus/config-parser-common.h b/bus/config-parser-common.h +index 382a014..9e026d1 100644 +--- a/bus/config-parser-common.h ++++ b/bus/config-parser-common.h +@@ -36,6 +36,7 @@ typedef enum + ELEMENT_LIMIT, + ELEMENT_ALLOW, + ELEMENT_DENY, ++ ELEMENT_CHECK, + ELEMENT_FORK, + ELEMENT_PIDFILE, + ELEMENT_SERVICEDIR, +diff --git a/bus/config-parser-trivial.c b/bus/config-parser-trivial.c +index dd65c6d..23dedb4 100644 +--- a/bus/config-parser-trivial.c ++++ b/bus/config-parser-trivial.c +@@ -194,6 +194,7 @@ bus_config_parser_start_element (BusConfigParser *parser, + case ELEMENT_POLICY: + case ELEMENT_LIMIT: + case ELEMENT_ALLOW: ++ case ELEMENT_CHECK: + case ELEMENT_DENY: + case ELEMENT_FORK: + case ELEMENT_PIDFILE: +@@ -316,6 +317,7 @@ bus_config_parser_content (BusConfigParser *parser, + case ELEMENT_POLICY: + case ELEMENT_LIMIT: + case ELEMENT_ALLOW: ++ case ELEMENT_CHECK: + case ELEMENT_DENY: + case ELEMENT_FORK: + case ELEMENT_PIDFILE: +diff --git a/bus/config-parser.c b/bus/config-parser.c +index be27d38..7f91469 100644 +--- a/bus/config-parser.c ++++ b/bus/config-parser.c +@@ -1318,7 +1318,7 @@ append_rule_from_element (BusConfigParser *parser, + const char *element_name, + const char **attribute_names, + const char **attribute_values, +- dbus_bool_t allow, ++ BusPolicyRuleAccess access, + DBusError *error) + { + const char *log; +@@ -1360,6 +1360,7 @@ append_rule_from_element (BusConfigParser *parser, + const char *own_prefix; + const char *user; + const char *group; ++ const char *privilege; + + BusPolicyRule *rule; + +@@ -1390,6 +1391,7 @@ append_rule_from_element (BusConfigParser *parser, + "user", &user, + "group", &group, + "log", &log, ++ "privilege", &privilege, + NULL)) + return FALSE; + +@@ -1422,6 +1424,7 @@ append_rule_from_element (BusConfigParser *parser, + + if (!(any_send_attribute || + any_receive_attribute || ++ privilege || + own || own_prefix || user || group)) + { + dbus_set_error (error, DBUS_ERROR_FAILED, +@@ -1438,7 +1441,30 @@ append_rule_from_element (BusConfigParser *parser, + element_name); + return FALSE; + } +- ++ ++ if (access == BUS_POLICY_RULE_ACCESS_CHECK) ++ { ++ if (privilege == NULL || !*privilege) ++ { ++ dbus_set_error (error, DBUS_ERROR_FAILED, ++ "On element <%s>, you must specify the privilege to be checked.", ++ element_name); ++ return FALSE; ++ } ++ } ++ else ++ { ++ if (privilege != NULL && *privilege) ++ { ++ dbus_set_error (error, DBUS_ERROR_FAILED, ++ "On element <%s>, privilege %s is used outside of a check rule.", ++ element_name, privilege); ++ return FALSE; ++ } ++ else ++ privilege = NULL; /* replace (potentially) empty string with NULL pointer, it wouldn't be used anyway */ ++ } ++ + /* Allowed combinations of elements are: + * + * base, must be all send or all receive: +@@ -1589,7 +1615,7 @@ append_rule_from_element (BusConfigParser *parser, + error)) + return FALSE; + +- rule = bus_policy_rule_new (BUS_POLICY_RULE_SEND, allow); ++ rule = bus_policy_rule_new (BUS_POLICY_RULE_SEND, access); + if (rule == NULL) + goto nomem; + +@@ -1694,7 +1720,7 @@ append_rule_from_element (BusConfigParser *parser, + error)) + return FALSE; + +- rule = bus_policy_rule_new (BUS_POLICY_RULE_RECEIVE, allow); ++ rule = bus_policy_rule_new (BUS_POLICY_RULE_RECEIVE, access); + if (rule == NULL) + goto nomem; + +@@ -1726,7 +1752,7 @@ append_rule_from_element (BusConfigParser *parser, + } + else if (own || own_prefix) + { +- rule = bus_policy_rule_new (BUS_POLICY_RULE_OWN, allow); ++ rule = bus_policy_rule_new (BUS_POLICY_RULE_OWN, access); + if (rule == NULL) + goto nomem; + +@@ -1752,7 +1778,7 @@ append_rule_from_element (BusConfigParser *parser, + { + if (IS_WILDCARD (user)) + { +- rule = bus_policy_rule_new (BUS_POLICY_RULE_USER, allow); ++ rule = bus_policy_rule_new (BUS_POLICY_RULE_USER, access); + if (rule == NULL) + goto nomem; + +@@ -1767,7 +1793,7 @@ append_rule_from_element (BusConfigParser *parser, + + if (_dbus_parse_unix_user_from_config (&username, &uid)) + { +- rule = bus_policy_rule_new (BUS_POLICY_RULE_USER, allow); ++ rule = bus_policy_rule_new (BUS_POLICY_RULE_USER, access); + if (rule == NULL) + goto nomem; + +@@ -1784,7 +1810,7 @@ append_rule_from_element (BusConfigParser *parser, + { + if (IS_WILDCARD (group)) + { +- rule = bus_policy_rule_new (BUS_POLICY_RULE_GROUP, allow); ++ rule = bus_policy_rule_new (BUS_POLICY_RULE_GROUP, access); + if (rule == NULL) + goto nomem; + +@@ -1799,7 +1825,7 @@ append_rule_from_element (BusConfigParser *parser, + + if (_dbus_parse_unix_group_from_config (&groupname, &gid)) + { +- rule = bus_policy_rule_new (BUS_POLICY_RULE_GROUP, allow); ++ rule = bus_policy_rule_new (BUS_POLICY_RULE_GROUP, access); + if (rule == NULL) + goto nomem; + +@@ -1823,6 +1849,10 @@ append_rule_from_element (BusConfigParser *parser, + _dbus_assert (pe != NULL); + _dbus_assert (pe->type == ELEMENT_POLICY); + ++ rule->privilege = _dbus_strdup (privilege); ++ if (privilege && !rule->privilege) ++ goto nomem; ++ + switch (pe->d.policy.type) + { + case POLICY_IGNORED: +@@ -1898,7 +1928,7 @@ start_policy_child (BusConfigParser *parser, + { + if (!append_rule_from_element (parser, element_name, + attribute_names, attribute_values, +- TRUE, error)) ++ BUS_POLICY_RULE_ACCESS_ALLOW, error)) + return FALSE; + + if (push_element (parser, ELEMENT_ALLOW) == NULL) +@@ -1913,7 +1943,7 @@ start_policy_child (BusConfigParser *parser, + { + if (!append_rule_from_element (parser, element_name, + attribute_names, attribute_values, +- FALSE, error)) ++ BUS_POLICY_RULE_ACCESS_DENY, error)) + return FALSE; + + if (push_element (parser, ELEMENT_DENY) == NULL) +@@ -1922,6 +1952,21 @@ start_policy_child (BusConfigParser *parser, + return FALSE; + } + ++ return TRUE; ++ } ++ else if (strcmp (element_name, "check") == 0) ++ { ++ if (!append_rule_from_element (parser, element_name, ++ attribute_names, attribute_values, ++ BUS_POLICY_RULE_ACCESS_CHECK, error)) ++ return FALSE; ++ ++ if (push_element (parser, ELEMENT_CHECK) == NULL) ++ { ++ BUS_SET_OOM (error); ++ return FALSE; ++ } ++ + return TRUE; + } + else +@@ -2284,6 +2329,7 @@ bus_config_parser_end_element (BusConfigParser *parser, + case ELEMENT_POLICY: + case ELEMENT_ALLOW: + case ELEMENT_DENY: ++ case ELEMENT_CHECK: + case ELEMENT_FORK: + case ELEMENT_SYSLOG: + case ELEMENT_KEEP_UMASK: +@@ -2600,6 +2646,7 @@ bus_config_parser_content (BusConfigParser *parser, + case ELEMENT_POLICY: + case ELEMENT_ALLOW: + case ELEMENT_DENY: ++ case ELEMENT_CHECK: + case ELEMENT_FORK: + case ELEMENT_SYSLOG: + case ELEMENT_KEEP_UMASK: +@@ -3127,6 +3174,8 @@ do_load (const DBusString *full_path, + dbus_error_init (&error); + + parser = bus_config_load (full_path, TRUE, NULL, &error); ++ if (dbus_error_is_set (&error)) ++ _dbus_verbose ("Failed to load file: %s\n", error.message); + if (parser == NULL) + { + _DBUS_ASSERT_ERROR_IS_SET (&error); +@@ -3359,6 +3408,7 @@ elements_equal (const Element *a, + case ELEMENT_LISTEN: + case ELEMENT_AUTH: + case ELEMENT_ALLOW: ++ case ELEMENT_CHECK: + case ELEMENT_DENY: + case ELEMENT_FORK: + case ELEMENT_PIDFILE: +diff --git a/bus/connection.c b/bus/connection.c +index 53605fa..b348d42 100644 +--- a/bus/connection.c ++++ b/bus/connection.c +@@ -36,6 +36,10 @@ + #include + #include + #include ++#ifdef DBUS_ENABLE_CYNARA ++#include ++#include ++#endif + + /* Trim executed commands to this length; we want to keep logs readable */ + #define MAX_LOG_COMMAND_LEN 50 +@@ -116,6 +120,9 @@ typedef struct + + /** non-NULL if and only if this is a monitor */ + DBusList *link_in_monitors; ++#ifdef DBUS_ENABLE_CYNARA ++ char *cynara_session_id; ++#endif + } BusConnectionData; + + static dbus_bool_t bus_pending_reply_expired (BusExpireList *list, +@@ -129,8 +136,8 @@ static dbus_bool_t expire_incomplete_timeout (void *data); + + #define BUS_CONNECTION_DATA(connection) (dbus_connection_get_data ((connection), connection_data_slot)) + +-static DBusLoop* +-connection_get_loop (DBusConnection *connection) ++DBusLoop* ++bus_connection_get_loop (DBusConnection *connection) + { + BusConnectionData *d; + +@@ -354,7 +361,7 @@ add_connection_watch (DBusWatch *watch, + { + DBusConnection *connection = data; + +- return _dbus_loop_add_watch (connection_get_loop (connection), watch); ++ return _dbus_loop_add_watch (bus_connection_get_loop (connection), watch); + } + + static void +@@ -363,7 +370,7 @@ remove_connection_watch (DBusWatch *watch, + { + DBusConnection *connection = data; + +- _dbus_loop_remove_watch (connection_get_loop (connection), watch); ++ _dbus_loop_remove_watch (bus_connection_get_loop (connection), watch); + } + + static void +@@ -372,7 +379,7 @@ toggle_connection_watch (DBusWatch *watch, + { + DBusConnection *connection = data; + +- _dbus_loop_toggle_watch (connection_get_loop (connection), watch); ++ _dbus_loop_toggle_watch (bus_connection_get_loop (connection), watch); + } + + static dbus_bool_t +@@ -381,7 +388,7 @@ add_connection_timeout (DBusTimeout *timeout, + { + DBusConnection *connection = data; + +- return _dbus_loop_add_timeout (connection_get_loop (connection), timeout); ++ return _dbus_loop_add_timeout (bus_connection_get_loop (connection), timeout); + } + + static void +@@ -390,7 +397,7 @@ remove_connection_timeout (DBusTimeout *timeout, + { + DBusConnection *connection = data; + +- _dbus_loop_remove_timeout (connection_get_loop (connection), timeout); ++ _dbus_loop_remove_timeout (bus_connection_get_loop (connection), timeout); + } + + static void +@@ -448,6 +455,10 @@ free_connection_data (void *data) + + dbus_free (d->name); + ++#ifdef DBUS_ENABLE_CYNARA ++ free (d->cynara_session_id); ++#endif ++ + dbus_free (d); + } + +@@ -1078,6 +1089,22 @@ bus_connection_get_policy (DBusConnection *connection) + return d->policy; + } + ++#ifdef DBUS_ENABLE_CYNARA ++const char *bus_connection_get_cynara_session_id (DBusConnection *connection) ++{ ++ BusConnectionData *d = BUS_CONNECTION_DATA (connection); ++ _dbus_assert (d != NULL); ++ ++ if (d->cynara_session_id == NULL) ++ { ++ unsigned long pid; ++ if (dbus_connection_get_unix_process_id(connection, &pid)) ++ d->cynara_session_id = cynara_session_from_pid(pid); ++ } ++ return d->cynara_session_id; ++} ++#endif ++ + static dbus_bool_t + foreach_active (BusConnections *connections, + BusConnectionForeachFunction function, +@@ -2333,6 +2360,7 @@ bus_transaction_send_from_driver (BusTransaction *transaction, + DBusMessage *message) + { + DBusError error = DBUS_ERROR_INIT; ++ BusResult res; + + /* We have to set the sender to the driver, and have + * to check security policy since it was not done in +@@ -2370,10 +2398,11 @@ bus_transaction_send_from_driver (BusTransaction *transaction, + * if we're actively capturing messages, it's nice to log that we + * tried to send it and did not allow ourselves to do so. + */ +- if (!bus_context_check_security_policy (bus_transaction_get_context (transaction), +- transaction, +- NULL, connection, connection, +- message, NULL, &error)) ++ res = bus_context_check_security_policy (bus_transaction_get_context (transaction), ++ transaction, ++ NULL, connection, connection, message, NULL, ++ &error, NULL); ++ if (res == BUS_RESULT_FALSE) + { + if (!bus_transaction_capture_error_reply (transaction, connection, + &error, message)) +@@ -2388,6 +2417,12 @@ bus_transaction_send_from_driver (BusTransaction *transaction, + dbus_error_free (&error); + return TRUE; + } ++ else if (res == BUS_RESULT_LATER) ++ { ++ _dbus_verbose ("Cannot delay sending message from bus driver, dropping it\n"); ++ dbus_error_free (&error); ++ return TRUE; ++ } + + return bus_transaction_send (transaction, connection, message); + } +diff --git a/bus/connection.h b/bus/connection.h +index 9e253ae..71078ea 100644 +--- a/bus/connection.h ++++ b/bus/connection.h +@@ -31,6 +31,7 @@ + typedef dbus_bool_t (* BusConnectionForeachFunction) (DBusConnection *connection, + void *data); + ++DBusLoop* bus_connection_get_loop (DBusConnection *connection); + + BusConnections* bus_connections_new (BusContext *context); + BusConnections* bus_connections_ref (BusConnections *connections); +@@ -124,6 +125,9 @@ dbus_bool_t bus_connection_be_monitor (DBusConnection *connection, + BusTransaction *transaction, + DBusList **rules, + DBusError *error); ++#ifdef DBUS_ENABLE_CYNARA ++const char *bus_connection_get_cynara_session_id (DBusConnection *connection); ++#endif + + /* transaction API so we can send or not send a block of messages as a whole */ + +diff --git a/bus/cynara.c b/bus/cynara.c +new file mode 100644 +index 0000000..57a4c45 +--- /dev/null ++++ b/bus/cynara.c +@@ -0,0 +1,374 @@ ++/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ ++/* cynara.c Cynara runtime privilege checking ++ * ++ * Copyright (c) 2014 Samsung Electronics, Ltd. ++ * ++ * Licensed under the Academic Free License version 2.1 ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#include ++#include "cynara.h" ++#include "check.h" ++#include "utils.h" ++ ++#include ++ ++#include ++#include ++#include ++#include ++#ifdef DBUS_ENABLE_CYNARA ++#include ++#endif ++ ++ ++#ifdef DBUS_ENABLE_CYNARA ++typedef struct BusCynara ++{ ++ int refcount; ++ ++ BusContext *context; ++ BusCheck *check; ++ cynara_async *cynara; ++ DBusWatch *cynara_watch; ++} BusCynara; ++ ++#define USE_CYNARA_CACHE 1 ++#ifdef USE_CYNARA_CACHE ++#define CYNARA_CACHE_SIZE 1000 ++#endif ++ ++static dbus_bool_t bus_cynara_watch_callback(DBusWatch *watch, ++ unsigned int flags, ++ void *data); ++ ++static void status_callback(int old_fd, ++ int new_fd, ++ cynara_async_status status, ++ void *user_status_data); ++static void bus_cynara_check_response_callback (cynara_check_id check_id, ++ cynara_async_call_cause cause, ++ int response, ++ void *user_response_data); ++#endif ++ ++ ++BusCynara * ++bus_cynara_new(BusCheck *check, DBusError *error) ++{ ++#ifdef DBUS_ENABLE_CYNARA ++ BusContext *context; ++ BusCynara *cynara; ++ cynara_async_configuration *conf = NULL; ++ int ret; ++ ++ cynara = dbus_new(BusCynara, 1); ++ if (cynara == NULL) ++ { ++ BUS_SET_OOM(error); ++ return NULL; ++ } ++ ++ context = bus_check_get_context(check); ++ ++ cynara->refcount = 1; ++ cynara->check = check; ++ cynara->context = context; ++ cynara->cynara_watch = NULL; ++ ++ ret = cynara_async_configuration_create(&conf); ++ if (ret != CYNARA_API_SUCCESS) ++ { ++ dbus_set_error (error, DBUS_ERROR_FAILED, "Failed to create Cynara configuration"); ++ goto out; ++ } ++ ++#ifdef CYNARA_CACHE_SIZE ++ ret = cynara_async_configuration_set_cache_size(conf, CYNARA_CACHE_SIZE); ++ if (ret != CYNARA_API_SUCCESS) ++ { ++ dbus_set_error (error, DBUS_ERROR_FAILED, "Failed to Cynara cache size"); ++ goto out; ++ } ++#endif ++ ++ ret = cynara_async_initialize(&cynara->cynara, conf, &status_callback, cynara); ++ if (ret != CYNARA_API_SUCCESS) ++ { ++ dbus_set_error (error, DBUS_ERROR_FAILED, "Failed to initialize Cynara client"); ++ goto out; ++ } ++ ++out: ++ cynara_async_configuration_destroy(conf); ++ if (ret != CYNARA_API_SUCCESS) ++ { ++ dbus_free(cynara); ++ return NULL; ++ } ++ ++ return cynara; ++#else ++ return NULL; ++#endif ++} ++ ++BusCynara * ++bus_cynara_ref (BusCynara *cynara) ++{ ++#ifdef DBUS_ENABLE_CYNARA ++ _dbus_assert (cynara->refcount > 0); ++ cynara->refcount += 1; ++ ++ return cynara; ++#else ++ return NULL; ++#endif ++} ++ ++void ++bus_cynara_unref (BusCynara *cynara) ++{ ++#ifdef DBUS_ENABLE_CYNARA ++ _dbus_assert (cynara->refcount > 0); ++ ++ cynara->refcount -= 1; ++ ++ if (cynara->refcount == 0) ++ { ++ cynara_async_finish(cynara->cynara); ++ dbus_free(cynara); ++ } ++#endif ++} ++ ++BusResult ++bus_cynara_check_privilege (BusCynara *cynara, ++ DBusMessage *message, ++ DBusConnection *sender, ++ DBusConnection *addressed_recipient, ++ DBusConnection *proposed_recipient, ++ const char *privilege, ++ BusDeferredMessageStatus check_type, ++ BusDeferredMessage **deferred_message_param) ++{ ++#ifdef DBUS_ENABLE_CYNARA ++ int result; ++ unsigned long uid; ++ char *label; ++ const char *session_id; ++ char user[32]; ++ cynara_check_id check_id; ++ DBusConnection *connection = check_type == BUS_DEFERRED_MESSAGE_CHECK_RECEIVE ? proposed_recipient : sender; ++ BusDeferredMessage *deferred_message; ++ BusResult ret; ++ ++ _dbus_assert(connection != NULL); ++ ++ if (dbus_connection_get_unix_user(connection, &uid) == FALSE) ++ return BUS_RESULT_FALSE; ++ ++ if (_dbus_connection_get_linux_security_label(connection, &label) == FALSE || label == NULL) ++ { ++ _dbus_warn("Failed to obtain security label for connection\n"); ++ return BUS_RESULT_FALSE; ++ } ++ ++ session_id = bus_connection_get_cynara_session_id (connection); ++ if (session_id == NULL) ++ { ++ ret = BUS_RESULT_FALSE; ++ goto out; ++ } ++ ++ snprintf(user, sizeof(user), "%lu", uid); ++ ++#if USE_CYNARA_CACHE ++ result = cynara_async_check_cache(cynara->cynara, label, session_id, user, privilege); ++#else ++ result = CYNARA_API_CACHE_MISS; ++#endif ++ ++ switch (result) ++ { ++ case CYNARA_API_ACCESS_ALLOWED: ++ _dbus_verbose("Cynara: got ALLOWED answer from cache (client=%s session_id=%s user=%s privilege=%s)\n", ++ label, session_id, user, privilege); ++ ret = BUS_RESULT_TRUE; ++ break; ++ ++ case CYNARA_API_ACCESS_DENIED: ++ _dbus_verbose("Cynara: got DENIED answer from cache (client=%s session_id=%s user=%s privilege=%s)\n", ++ label, session_id, user, privilege); ++ ret = BUS_RESULT_FALSE; ++ break; ++ ++ case CYNARA_API_CACHE_MISS: ++ deferred_message = bus_deferred_message_new(message, sender, addressed_recipient, ++ proposed_recipient, BUS_RESULT_LATER); ++ if (deferred_message == NULL) ++ { ++ _dbus_verbose("Failed to allocate memory for deferred message\n"); ++ ret = BUS_RESULT_FALSE; ++ goto out; ++ } ++ ++ /* callback is supposed to unref deferred_message*/ ++ result = cynara_async_create_request(cynara->cynara, label, session_id, user, privilege, &check_id, ++ &bus_cynara_check_response_callback, deferred_message); ++ if (result == CYNARA_API_SUCCESS) ++ { ++ _dbus_verbose("Created Cynara request: client=%s session_id=%s user=%s privilege=%s check_id=%u " ++ "deferred_message=%p\n", label, session_id, user, privilege, (unsigned int)check_id, deferred_message); ++ if (deferred_message_param != NULL) ++ *deferred_message_param = deferred_message; ++ ret = BUS_RESULT_LATER; ++ } ++ else ++ { ++ _dbus_verbose("Error on cynara request create: %i\n", result); ++ bus_deferred_message_unref(deferred_message); ++ ret = BUS_RESULT_FALSE; ++ } ++ break; ++ default: ++ _dbus_verbose("Error when accessing Cynara cache: %i\n", result); ++ ret = BUS_RESULT_FALSE; ++ } ++out: ++ dbus_free(label); ++ return ret; ++ ++#else ++ return BUS_RESULT_FALSE; ++#endif ++} ++ ++ ++ ++#ifdef DBUS_ENABLE_CYNARA ++static void ++status_callback(int old_fd, int new_fd, cynara_async_status status, ++ void *user_status_data) ++{ ++ BusCynara *cynara = (BusCynara *)user_status_data; ++ DBusLoop *loop = bus_context_get_loop(cynara->context); ++ ++ if (cynara->cynara_watch != NULL) ++ { ++ _dbus_loop_remove_watch(loop, cynara->cynara_watch); ++ _dbus_watch_invalidate(cynara->cynara_watch); ++ _dbus_watch_unref(cynara->cynara_watch); ++ cynara->cynara_watch = NULL; ++ } ++ ++ if (new_fd != -1) ++ { ++ unsigned int flags; ++ DBusWatch *watch; ++ ++ switch (status) ++ { ++ case CYNARA_STATUS_FOR_READ: ++ flags = DBUS_WATCH_READABLE; ++ break; ++ case CYNARA_STATUS_FOR_RW: ++ flags = DBUS_WATCH_READABLE | DBUS_WATCH_WRITABLE; ++ break; ++ default: ++ /* Cynara passed unknown status - warn and add RW watch */ ++ _dbus_verbose("Cynara passed unknown status value: 0x%08X\n", (unsigned int)status); ++ flags = DBUS_WATCH_READABLE | DBUS_WATCH_WRITABLE; ++ break; ++ } ++ ++ watch = _dbus_watch_new(new_fd, flags, TRUE, &bus_cynara_watch_callback, cynara, NULL); ++ if (watch != NULL) ++ { ++ if (_dbus_loop_add_watch(loop, watch) == TRUE) ++ { ++ cynara->cynara_watch = watch; ++ return; ++ } ++ ++ _dbus_watch_invalidate(watch); ++ _dbus_watch_unref(watch); ++ } ++ ++ /* It seems like not much can be done at this point. Cynara events won't be processed ++ * until next Cynara function call triggering status callback */ ++ _dbus_verbose("Failed to add dbus watch\n"); ++ } ++} ++ ++static dbus_bool_t ++bus_cynara_watch_callback(DBusWatch *watch, ++ unsigned int flags, ++ void *data) ++{ ++ BusCynara *cynara = (BusCynara *)data; ++ int result = cynara_async_process(cynara->cynara); ++ if (result != CYNARA_API_SUCCESS) ++ _dbus_verbose("cynara_async_process returned %d\n", result); ++ ++ return result != CYNARA_API_OUT_OF_MEMORY ? TRUE : FALSE; ++} ++ ++static inline const char * ++call_cause_to_string(cynara_async_call_cause cause) ++{ ++ switch (cause) ++ { ++ case CYNARA_CALL_CAUSE_ANSWER: ++ return "ANSWER"; ++ case CYNARA_CALL_CAUSE_CANCEL: ++ return "CANCEL"; ++ case CYNARA_CALL_CAUSE_FINISH: ++ return "FINSIH"; ++ case CYNARA_CALL_CAUSE_SERVICE_NOT_AVAILABLE: ++ return "SERVICE NOT AVAILABLE"; ++ default: ++ return "INVALID"; ++ } ++} ++ ++static void ++bus_cynara_check_response_callback (cynara_check_id check_id, ++ cynara_async_call_cause cause, ++ int response, ++ void *user_response_data) ++{ ++ BusDeferredMessage *deferred_message = user_response_data; ++ BusResult result; ++ ++ _dbus_verbose("Cynara callback: check_id=%u, cause=%s response=%i response_data=%p\n", ++ (unsigned int)check_id, call_cause_to_string(cause), response, user_response_data); ++ ++ if (deferred_message == NULL) ++ return; ++ ++ if (cause == CYNARA_CALL_CAUSE_ANSWER && response == CYNARA_API_ACCESS_ALLOWED) ++ result = BUS_RESULT_TRUE; ++ else ++ result = BUS_RESULT_FALSE; ++ ++ bus_deferred_message_response_received(deferred_message, result); ++ bus_deferred_message_unref(deferred_message); ++} ++ ++#endif /* DBUS_ENABLE_CYNARA */ +diff --git a/bus/cynara.h b/bus/cynara.h +new file mode 100644 +index 0000000..c4728bb +--- /dev/null ++++ b/bus/cynara.h +@@ -0,0 +1,37 @@ ++/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ ++/* cynara.h Cynara runtime privilege checking ++ * ++ * Copyright (c) 2014 Samsung Electronics, Ltd. ++ * ++ * Licensed under the Academic Free License version 2.1 ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#include "bus.h" ++#include "check.h" ++ ++BusCynara *bus_cynara_new (BusCheck *check, DBusError *error); ++BusCynara *bus_cynara_ref (BusCynara *cynara); ++void bus_cynara_unref (BusCynara *cynara); ++BusResult bus_cynara_check_privilege (BusCynara *cynara, ++ DBusMessage *message, ++ DBusConnection *sender, ++ DBusConnection *addressed_recipient, ++ DBusConnection *proposed_recipient, ++ const char *privilege, ++ BusDeferredMessageStatus check_type, ++ BusDeferredMessage **deferred_message); +diff --git a/bus/dispatch.c b/bus/dispatch.c +index 19228be..d3867f7 100644 +--- a/bus/dispatch.c ++++ b/bus/dispatch.c +@@ -25,6 +25,7 @@ + + #include + #include "dispatch.h" ++#include "check.h" + #include "connection.h" + #include "driver.h" + #include "services.h" +@@ -64,14 +65,18 @@ send_one_message (DBusConnection *connection, + DBusError *error) + { + DBusError stack_error = DBUS_ERROR_INIT; ++ BusDeferredMessage *deferred_message; ++ BusResult result; + +- if (!bus_context_check_security_policy (context, transaction, ++ result = bus_context_check_security_policy (context, transaction, + sender, + addressed_recipient, + connection, + message, + NULL, +- &stack_error)) ++ &stack_error, ++ &deferred_message); ++ if (result != BUS_RESULT_TRUE) + { + if (!bus_transaction_capture_error_reply (transaction, sender, + &stack_error, message)) +@@ -130,6 +135,8 @@ bus_dispatch_matches (BusTransaction *transaction, + BusMatchmaker *matchmaker; + DBusList *link; + BusContext *context; ++ BusDeferredMessage *deferred_message; ++ BusResult res; + + _DBUS_ASSERT_ERROR_IS_CLEAR (error); + +@@ -145,11 +152,20 @@ bus_dispatch_matches (BusTransaction *transaction, + /* First, send the message to the addressed_recipient, if there is one. */ + if (addressed_recipient != NULL) + { +- if (!bus_context_check_security_policy (context, transaction, +- sender, addressed_recipient, +- addressed_recipient, +- message, NULL, error)) ++ res = bus_context_check_security_policy (context, transaction, ++ sender, addressed_recipient, ++ addressed_recipient, ++ message, NULL, error, ++ &deferred_message); ++ if (res == BUS_RESULT_FALSE) + return FALSE; ++ else if (res == BUS_RESULT_LATER) ++ { ++ dbus_set_error (error, ++ DBUS_ERROR_ACCESS_DENIED, ++ "Rejecting message because time is needed to check security policy"); ++ return FALSE; ++ } + + if (dbus_message_contains_unix_fds (message) && + !dbus_connection_can_send_type (addressed_recipient, +@@ -374,19 +390,31 @@ bus_dispatch (DBusConnection *connection, + if (service_name && + strcmp (service_name, DBUS_SERVICE_DBUS) == 0) /* to bus driver */ + { ++ BusDeferredMessage *deferred_message; ++ BusResult res; ++ + if (!bus_transaction_capture (transaction, connection, NULL, message)) + { + BUS_SET_OOM (&error); + goto out; + } + +- if (!bus_context_check_security_policy (context, transaction, +- connection, NULL, NULL, message, +- NULL, &error)) ++ res = bus_context_check_security_policy (context, transaction, ++ connection, NULL, NULL, message, NULL, ++ &error, &deferred_message); ++ if (res == BUS_RESULT_FALSE) + { + _dbus_verbose ("Security policy rejected message\n"); + goto out; + } ++ else if (res == BUS_RESULT_LATER) ++ { ++ dbus_set_error (&error, ++ DBUS_ERROR_ACCESS_DENIED, ++ "Rejecting message because time is needed to check security policy"); ++ _dbus_verbose ("Security policy needs time to check policy. Dropping message\n"); ++ goto out; ++ } + + _dbus_verbose ("Giving message to %s\n", DBUS_SERVICE_DBUS); + if (!bus_driver_handle_message (connection, transaction, message, &error)) +diff --git a/bus/driver.h b/bus/driver.h +index ac1289d..a7297ad 100644 +--- a/bus/driver.h ++++ b/bus/driver.h +@@ -66,5 +66,7 @@ dbus_bool_t bus_driver_send_ack_reply (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, + DBusError *error); ++dbus_bool_t bus_driver_check_message_is_for_us (DBusMessage *message, ++ DBusError *error); + + #endif /* BUS_DRIVER_H */ +diff --git a/bus/policy.c b/bus/policy.c +index a37be80..7de92c6 100644 +--- a/bus/policy.c ++++ b/bus/policy.c +@@ -22,6 +22,7 @@ + */ + + #include ++#include "check.h" + #include "policy.h" + #include "services.h" + #include "test.h" +@@ -33,7 +34,7 @@ + + BusPolicyRule* + bus_policy_rule_new (BusPolicyRuleType type, +- dbus_bool_t allow) ++ BusPolicyRuleAccess access) + { + BusPolicyRule *rule; + +@@ -43,7 +44,7 @@ bus_policy_rule_new (BusPolicyRuleType type, + + rule->type = type; + rule->refcount = 1; +- rule->allow = allow; ++ rule->access = access; + + switch (rule->type) + { +@@ -55,18 +56,19 @@ bus_policy_rule_new (BusPolicyRuleType type, + break; + case BUS_POLICY_RULE_SEND: + rule->d.send.message_type = DBUS_MESSAGE_TYPE_INVALID; +- + /* allow rules default to TRUE (only requested replies allowed) ++ * check rules default to TRUE (only requested replies are checked) + * deny rules default to FALSE (only unrequested replies denied) + */ +- rule->d.send.requested_reply = rule->allow; ++ rule->d.send.requested_reply = rule->access != BUS_POLICY_RULE_ACCESS_DENY; + break; + case BUS_POLICY_RULE_RECEIVE: + rule->d.receive.message_type = DBUS_MESSAGE_TYPE_INVALID; + /* allow rules default to TRUE (only requested replies allowed) ++ * check rules default to TRUE (only requested replies are checked) + * deny rules default to FALSE (only unrequested replies denied) + */ +- rule->d.receive.requested_reply = rule->allow; ++ rule->d.receive.requested_reply = rule->access != BUS_POLICY_RULE_ACCESS_DENY; + break; + case BUS_POLICY_RULE_OWN: + break; +@@ -122,7 +124,8 @@ bus_policy_rule_unref (BusPolicyRule *rule) + default: + _dbus_assert_not_reached ("invalid rule"); + } +- ++ ++ dbus_free (rule->privilege); + dbus_free (rule); + } + } +@@ -435,7 +438,10 @@ list_allows_user (dbus_bool_t def, + else + continue; + +- allowed = rule->allow; ++ /* We don't intend to support and ++ rules. They are treated like deny. ++ */ ++ allowed = rule->access == BUS_POLICY_RULE_ACCESS_ALLOW; + } + + return allowed; +@@ -873,18 +879,23 @@ bus_client_policy_append_rule (BusClientPolicy *policy, + return TRUE; + } + +-dbus_bool_t +-bus_client_policy_check_can_send (BusClientPolicy *policy, +- BusRegistry *registry, +- dbus_bool_t requested_reply, +- DBusConnection *receiver, +- DBusMessage *message, +- dbus_int32_t *toggles, +- dbus_bool_t *log) ++BusResult ++bus_client_policy_check_can_send (DBusConnection *sender, ++ BusClientPolicy *policy, ++ BusRegistry *registry, ++ dbus_bool_t requested_reply, ++ DBusConnection *addressed_recipient, ++ DBusConnection *receiver, ++ DBusMessage *message, ++ dbus_int32_t *toggles, ++ dbus_bool_t *log, ++ const char **privilege_param, ++ BusDeferredMessage **deferred_message) + { + DBusList *link; +- dbus_bool_t allowed; +- ++ BusResult result; ++ const char *privilege; ++ + /* policy->rules is in the order the rules appeared + * in the config file, i.e. last rule that applies wins + */ +@@ -892,7 +903,7 @@ bus_client_policy_check_can_send (BusClientPolicy *policy, + _dbus_verbose (" (policy) checking send rules\n"); + *toggles = 0; + +- allowed = FALSE; ++ result = BUS_RESULT_FALSE; + link = _dbus_list_get_first_link (&policy->rules); + while (link != NULL) + { +@@ -923,13 +934,14 @@ bus_client_policy_check_can_send (BusClientPolicy *policy, + /* If it's a reply, the requested_reply flag kicks in */ + if (dbus_message_get_reply_serial (message) != 0) + { +- /* for allow, requested_reply=true means the rule applies +- * only when reply was requested. requested_reply=false means +- * always allow. ++ /* for allow or check requested_reply=true means the rule applies ++ * only when reply was requested. requested_reply=false means the ++ * rule always applies + */ +- if (!requested_reply && rule->allow && rule->d.send.requested_reply && !rule->d.send.eavesdrop) ++ if (!requested_reply && rule->access != BUS_POLICY_RULE_ACCESS_DENY && rule->d.send.requested_reply && !rule->d.send.eavesdrop) + { +- _dbus_verbose (" (policy) skipping allow rule since it only applies to requested replies and does not allow eavesdropping\n"); ++ _dbus_verbose (" (policy) skipping %s rule since it only applies to requested replies and does not allow eavesdropping\n", ++ rule->access == BUS_POLICY_RULE_ACCESS_ALLOW ? "allow" : "check"); + continue; + } + +@@ -937,7 +949,7 @@ bus_client_policy_check_can_send (BusClientPolicy *policy, + * when the reply was not requested. requested_reply=true means the + * rule always applies. + */ +- if (requested_reply && !rule->allow && !rule->d.send.requested_reply) ++ if (requested_reply && rule->access == BUS_POLICY_RULE_ACCESS_DENY && !rule->d.send.requested_reply) + { + _dbus_verbose (" (policy) skipping deny rule since it only applies to unrequested replies\n"); + continue; +@@ -960,13 +972,15 @@ bus_client_policy_check_can_send (BusClientPolicy *policy, + /* The interface is optional in messages. For allow rules, if the message + * has no interface we want to skip the rule (and thus not allow); + * for deny rules, if the message has no interface we want to use the +- * rule (and thus deny). ++ * rule (and thus deny). Check rules are meant to be used like allow ++ * rules (they can grant access, but not remove it), so we treat it like ++ * allow here. + */ + dbus_bool_t no_interface; + + no_interface = dbus_message_get_interface (message) == NULL; + +- if ((no_interface && rule->allow) || ++ if ((no_interface && rule->access != BUS_POLICY_RULE_ACCESS_DENY) || + (!no_interface && + strcmp (dbus_message_get_interface (message), + rule->d.send.interface) != 0)) +@@ -1079,33 +1093,64 @@ bus_client_policy_check_can_send (BusClientPolicy *policy, + } + + /* Use this rule */ +- allowed = rule->allow; ++ switch (rule->access) ++ { ++ case BUS_POLICY_RULE_ACCESS_ALLOW: ++ result = BUS_RESULT_TRUE; ++ break; ++ case BUS_POLICY_RULE_ACCESS_DENY: ++ default: ++ result = BUS_RESULT_FALSE; ++ break; ++ case BUS_POLICY_RULE_ACCESS_CHECK: ++ result = BUS_RESULT_LATER; ++ privilege = rule->privilege; ++ break; ++ } ++ + *log = rule->d.send.log; + (*toggles)++; + +- _dbus_verbose (" (policy) used rule, allow now = %d\n", +- allowed); ++ _dbus_verbose (" (policy) used rule, result now = %d\n", ++ (int)(intptr_t)result); + } + +- return allowed; ++ if (result == BUS_RESULT_LATER) ++ { ++ BusContext *context = bus_connection_get_context(sender); ++ BusCheck *check = bus_context_get_check(context); ++ ++ result = bus_check_privilege(check, message, sender, addressed_recipient, receiver, ++ privilege, BUS_DEFERRED_MESSAGE_CHECK_SEND, deferred_message); ++ } ++ else ++ privilege = NULL; ++ ++ if (privilege_param != NULL) ++ *privilege_param = privilege; ++ ++ return result; + } + + /* See docs on what the args mean on bus_context_check_security_policy() + * comment + */ +-dbus_bool_t +-bus_client_policy_check_can_receive (BusClientPolicy *policy, +- BusRegistry *registry, +- dbus_bool_t requested_reply, +- DBusConnection *sender, +- DBusConnection *addressed_recipient, +- DBusConnection *proposed_recipient, +- DBusMessage *message, +- dbus_int32_t *toggles) ++BusResult ++bus_client_policy_check_can_receive (BusClientPolicy *policy, ++ BusRegistry *registry, ++ dbus_bool_t requested_reply, ++ DBusConnection *sender, ++ DBusConnection *addressed_recipient, ++ DBusConnection *proposed_recipient, ++ DBusMessage *message, ++ dbus_int32_t *toggles, ++ const char **privilege_param, ++ BusDeferredMessage **deferred_message) + { + DBusList *link; +- dbus_bool_t allowed; + dbus_bool_t eavesdropping; ++ BusResult result; ++ const char *privilege; + + eavesdropping = + addressed_recipient != proposed_recipient && +@@ -1118,7 +1163,7 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, + _dbus_verbose (" (policy) checking receive rules, eavesdropping = %d\n", eavesdropping); + *toggles = 0; + +- allowed = FALSE; ++ result = BUS_RESULT_FALSE; + link = _dbus_list_get_first_link (&policy->rules); + while (link != NULL) + { +@@ -1141,19 +1186,21 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, + } + } + +- /* for allow, eavesdrop=false means the rule doesn't apply when +- * eavesdropping. eavesdrop=true means always allow. ++ ++ /* for allow or check, eavesdrop=false means the rule doesn't apply when ++ * eavesdropping. eavesdrop=true means the rule always applies + */ +- if (eavesdropping && rule->allow && !rule->d.receive.eavesdrop) ++ if (eavesdropping && rule->access != BUS_POLICY_RULE_ACCESS_DENY && !rule->d.receive.eavesdrop) + { +- _dbus_verbose (" (policy) skipping allow rule since it doesn't apply to eavesdropping\n"); ++ _dbus_verbose (" (policy) skipping %s rule since it doesn't apply to eavesdropping\n", ++ rule->access == BUS_POLICY_RULE_ACCESS_ALLOW ? "allow" : "check"); + continue; + } + + /* for deny, eavesdrop=true means the rule applies only when + * eavesdropping; eavesdrop=false means always deny. + */ +- if (!eavesdropping && !rule->allow && rule->d.receive.eavesdrop) ++ if (!eavesdropping && rule->access == BUS_POLICY_RULE_ACCESS_DENY && rule->d.receive.eavesdrop) + { + _dbus_verbose (" (policy) skipping deny rule since it only applies to eavesdropping\n"); + continue; +@@ -1162,13 +1209,14 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, + /* If it's a reply, the requested_reply flag kicks in */ + if (dbus_message_get_reply_serial (message) != 0) + { +- /* for allow, requested_reply=true means the rule applies +- * only when reply was requested. requested_reply=false means +- * always allow. ++ /* for allow or check requested_reply=true means the rule applies ++ * only when reply was requested. requested_reply=false means the ++ * rule always applies + */ +- if (!requested_reply && rule->allow && rule->d.receive.requested_reply && !rule->d.receive.eavesdrop) ++ if (!requested_reply && rule->access != BUS_POLICY_RULE_ACCESS_DENY && rule->d.send.requested_reply && !rule->d.send.eavesdrop) + { +- _dbus_verbose (" (policy) skipping allow rule since it only applies to requested replies and does not allow eavesdropping\n"); ++ _dbus_verbose (" (policy) skipping %s rule since it only applies to requested replies and does not allow eavesdropping\n", ++ rule->access == BUS_POLICY_RULE_ACCESS_DENY ? "allow" : "deny"); + continue; + } + +@@ -1176,7 +1224,7 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, + * when the reply was not requested. requested_reply=true means the + * rule always applies. + */ +- if (requested_reply && !rule->allow && !rule->d.receive.requested_reply) ++ if (requested_reply && rule->access == BUS_POLICY_RULE_ACCESS_DENY && !rule->d.receive.requested_reply) + { + _dbus_verbose (" (policy) skipping deny rule since it only applies to unrequested replies\n"); + continue; +@@ -1199,13 +1247,13 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, + /* The interface is optional in messages. For allow rules, if the message + * has no interface we want to skip the rule (and thus not allow); + * for deny rules, if the message has no interface we want to use the +- * rule (and thus deny). ++ * rule (and thus deny). Check rules are treated like allow rules. + */ + dbus_bool_t no_interface; + + no_interface = dbus_message_get_interface (message) == NULL; + +- if ((no_interface && rule->allow) || ++ if ((no_interface && rule->access != BUS_POLICY_RULE_ACCESS_DENY) || + (!no_interface && + strcmp (dbus_message_get_interface (message), + rule->d.receive.interface) != 0)) +@@ -1295,14 +1343,43 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, + } + + /* Use this rule */ +- allowed = rule->allow; ++ switch (rule->access) ++ { ++ case BUS_POLICY_RULE_ACCESS_ALLOW: ++ result = BUS_RESULT_TRUE; ++ break; ++ case BUS_POLICY_RULE_ACCESS_DENY: ++ default: ++ result = BUS_RESULT_FALSE; ++ break; ++ case BUS_POLICY_RULE_ACCESS_CHECK: ++ result = BUS_RESULT_LATER; ++ privilege = rule->privilege; ++ break; ++ } ++ + (*toggles)++; + +- _dbus_verbose (" (policy) used rule, allow now = %d\n", +- allowed); ++ _dbus_verbose (" (policy) used rule, result now = %d\n", ++ (int)(intptr_t)result); + } + +- return allowed; ++ ++ if (result == BUS_RESULT_LATER) ++ { ++ BusContext *context = bus_connection_get_context(proposed_recipient); ++ BusCheck *check = bus_context_get_check(context); ++ ++ result = bus_check_privilege(check, message, sender, addressed_recipient, proposed_recipient, ++ privilege, BUS_DEFERRED_MESSAGE_CHECK_RECEIVE, deferred_message); ++ } ++ else ++ privilege = NULL; ++ ++ if (privilege_param != NULL) ++ *privilege_param = privilege; ++ ++ return result; + } + + +@@ -1354,7 +1431,7 @@ bus_rules_check_can_own (DBusList *rules, + } + + /* Use this rule */ +- allowed = rule->allow; ++ allowed = rule->access == BUS_POLICY_RULE_ACCESS_ALLOW; + } + + return allowed; +diff --git a/bus/policy.h b/bus/policy.h +index ec43ffa..f839d23 100644 +--- a/bus/policy.h ++++ b/bus/policy.h +@@ -46,6 +46,14 @@ typedef enum + BUS_POLICY_TRISTATE_TRUE + } BusPolicyTristate; + ++typedef enum ++{ ++ BUS_POLICY_RULE_ACCESS_DENY, ++ BUS_POLICY_RULE_ACCESS_ALLOW, ++ /** runtime check resulting in allow or deny */ ++ BUS_POLICY_RULE_ACCESS_CHECK ++} BusPolicyRuleAccess; ++ + /** determines whether the rule affects a connection, or some global item */ + #define BUS_POLICY_RULE_IS_PER_CLIENT(rule) (!((rule)->type == BUS_POLICY_RULE_USER || \ + (rule)->type == BUS_POLICY_RULE_GROUP)) +@@ -56,8 +64,9 @@ struct BusPolicyRule + + BusPolicyRuleType type; + +- unsigned int allow : 1; /**< #TRUE if this allows, #FALSE if it denies */ +- ++ unsigned int access : 2; /**< BusPolicyRuleAccess */ ++ char *privilege; /**< for BUS_POLICY_RULE_ACCESS_CHECK */ ++ + union + { + struct +@@ -118,7 +127,7 @@ struct BusPolicyRule + }; + + BusPolicyRule* bus_policy_rule_new (BusPolicyRuleType type, +- dbus_bool_t allow); ++ BusPolicyRuleAccess access); + BusPolicyRule* bus_policy_rule_ref (BusPolicyRule *rule); + void bus_policy_rule_unref (BusPolicyRule *rule); + +@@ -152,21 +161,27 @@ dbus_bool_t bus_policy_merge (BusPolicy *policy, + BusClientPolicy* bus_client_policy_new (void); + BusClientPolicy* bus_client_policy_ref (BusClientPolicy *policy); + void bus_client_policy_unref (BusClientPolicy *policy); +-dbus_bool_t bus_client_policy_check_can_send (BusClientPolicy *policy, ++BusResult bus_client_policy_check_can_send (DBusConnection *sender, ++ BusClientPolicy *policy, + BusRegistry *registry, + dbus_bool_t requested_reply, ++ DBusConnection *addressed_recipient, + DBusConnection *receiver, + DBusMessage *message, + dbus_int32_t *toggles, +- dbus_bool_t *log); +-dbus_bool_t bus_client_policy_check_can_receive (BusClientPolicy *policy, ++ dbus_bool_t *log, ++ const char **privilege_param, ++ BusDeferredMessage **deferred_message); ++BusResult bus_client_policy_check_can_receive (BusClientPolicy *policy, + BusRegistry *registry, + dbus_bool_t requested_reply, + DBusConnection *sender, + DBusConnection *addressed_recipient, + DBusConnection *proposed_recipient, + DBusMessage *message, +- dbus_int32_t *toggles); ++ dbus_int32_t *toggles, ++ const char **privilege_param, ++ BusDeferredMessage **deferred_message); + dbus_bool_t bus_client_policy_check_can_own (BusClientPolicy *policy, + const DBusString *service_name); + dbus_bool_t bus_client_policy_append_rule (BusClientPolicy *policy, +diff --git a/configure.ac b/configure.ac +index d1e3a29..11b5ffd 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1742,6 +1742,17 @@ AC_ARG_ENABLE([user-session], + AM_CONDITIONAL([DBUS_ENABLE_USER_SESSION], + [test "x$enable_user_session" = xyes]) + ++#enable cynara integration ++AC_ARG_ENABLE([cynara], [AS_HELP_STRING([--enable-cynara], [enable Cynara integration])], [], [enable_cynara=no]) ++if test "x$enable_cynara" = xyes; then ++ PKG_CHECK_MODULES([CYNARA], [cynara-client-async >= 0.6.0 cynara-session >= 0.6.0], ++ [AC_DEFINE([DBUS_ENABLE_CYNARA], [1], [Define to enable Cynara privilege checks in dbus-daemon])], ++ [AC_MSG_ERROR([libcynara-client-async and cynara-session are required to enable Cynara integration])]) ++fi ++ ++AC_SUBST([CYNARA_CFLAGS]) ++AC_SUBST([CYNARA_LIBS]) ++ + AC_CONFIG_FILES([ + Doxyfile + dbus/Version +@@ -1824,6 +1835,7 @@ echo " + Building bus stats API: ${enable_stats} + Building SELinux support: ${have_selinux} + Building AppArmor support: ${have_apparmor} ++ Building Cynara support: ${enable_cynara} + Building inotify support: ${have_inotify} + Building kqueue support: ${have_kqueue} + Building systemd support: ${have_systemd} +diff --git a/test/Makefile.am b/test/Makefile.am +index af1e13b..e6f50e1 100644 +--- a/test/Makefile.am ++++ b/test/Makefile.am +@@ -439,6 +439,7 @@ in_data = \ + data/valid-config-files/debug-allow-all.conf.in \ + data/valid-config-files/finite-timeout.conf.in \ + data/valid-config-files/forbidding.conf.in \ ++ data/valid-config-files/debug-check-some.conf.in \ + data/valid-config-files/incoming-limit.conf.in \ + data/valid-config-files/max-completed-connections.conf.in \ + data/valid-config-files/max-connections-per-user.conf.in \ +diff --git a/test/data/invalid-config-files/badcheck-1.conf b/test/data/invalid-config-files/badcheck-1.conf +new file mode 100644 +index 0000000..fad9f50 +--- /dev/null ++++ b/test/data/invalid-config-files/badcheck-1.conf +@@ -0,0 +1,9 @@ ++ ++ ++ mybususer ++ unix:path=/foo/bar ++ ++ ++ ++ +diff --git a/test/data/invalid-config-files/badcheck-2.conf b/test/data/invalid-config-files/badcheck-2.conf +new file mode 100644 +index 0000000..63c7ef2 +--- /dev/null ++++ b/test/data/invalid-config-files/badcheck-2.conf +@@ -0,0 +1,9 @@ ++ ++ ++ mybususer ++ unix:path=/foo/bar ++ ++ ++ ++ +diff --git a/test/data/valid-config-files/check-1.conf b/test/data/valid-config-files/check-1.conf +new file mode 100644 +index 0000000..ad71473 +--- /dev/null ++++ b/test/data/valid-config-files/check-1.conf +@@ -0,0 +1,9 @@ ++ ++ ++ mybususer ++ unix:path=/foo/bar ++ ++ ++ ++ +diff --git a/test/data/valid-config-files/debug-check-some.conf.in b/test/data/valid-config-files/debug-check-some.conf.in +new file mode 100644 +index 0000000..47ee854 +--- /dev/null ++++ b/test/data/valid-config-files/debug-check-some.conf.in +@@ -0,0 +1,18 @@ ++ ++ ++ ++ ++ debug-pipe:name=test-server ++ @TEST_LISTEN@ ++ @DBUS_TEST_DATA@/valid-service-files ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +-- +2.21.1 + diff --git a/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0002-Disable-message-dispatching-when-send-rule-result-is.patch b/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0002-Disable-message-dispatching-when-send-rule-result-is.patch new file mode 100644 index 00000000..bac8cf97 --- /dev/null +++ b/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0002-Disable-message-dispatching-when-send-rule-result-is.patch @@ -0,0 +1,967 @@ +From c2f4ba585c777b731df6b6b8a165b6cc4dc5d639 Mon Sep 17 00:00:00 2001 +From: Jacek Bukarewicz +Date: Fri, 28 Nov 2014 12:07:39 +0100 +Subject: [PATCH 2/8] Disable message dispatching when send rule result is not + known +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When unicast message is sent to addressed recipient and policy result +is not available message dispatch from the sender is disabled. +This also means that any further messages from the given connection are +put into the incoming queue without being processed. If response is received +message dispatching is resumed. This time answer is attached to the message +which is now processed synchronously. +Receive rule result unavailability is not yet handled - such messages are +rejected. Also, if message is sent to non-addressed recipient and policy result +is unknown, message is silently dropped. + +Cherry-picked from b1b87ad9f20b2052c28431b48e81073078a745ce +by Jose Bollo. + +Updated for dbus 1.10.20 by Scott Murray and José Bollo + +Signed-off-by: José Bollo +Signed-off-by: Scott Murray +--- + bus/activation.c | 76 +++++++++++-- + bus/check.c | 109 +++++++++++++++++-- + bus/check.h | 10 ++ + bus/cynara.c | 1 - + bus/dispatch.c | 184 ++++++++++++++++++++++++++++---- + bus/dispatch.h | 2 +- + bus/driver.c | 12 ++- + dbus/dbus-connection-internal.h | 15 +++ + dbus/dbus-connection.c | 125 +++++++++++++++++++++- + dbus/dbus-list.c | 29 +++++ + dbus/dbus-list.h | 3 + + dbus/dbus-shared.h | 3 +- + 12 files changed, 528 insertions(+), 41 deletions(-) + +diff --git a/bus/activation.c b/bus/activation.c +index f9c6c62..8301b59 100644 +--- a/bus/activation.c ++++ b/bus/activation.c +@@ -32,6 +32,7 @@ + #include "services.h" + #include "test.h" + #include "utils.h" ++#include + #include + #include + #include +@@ -94,6 +95,8 @@ struct BusPendingActivationEntry + DBusConnection *connection; + + dbus_bool_t auto_activation; ++ ++ dbus_bool_t is_put_back; + }; + + typedef struct +@@ -1241,20 +1244,23 @@ bus_activation_send_pending_auto_activation_messages (BusActivation *activation + BusPendingActivationEntry *entry = link->data; + DBusList *next = _dbus_list_get_next_link (&pending_activation->entries, link); + +- if (entry->auto_activation && (entry->connection == NULL || dbus_connection_get_is_connected (entry->connection))) ++ if (entry->auto_activation && !entry->is_put_back && ++ (entry->connection == NULL || dbus_connection_get_is_connected (entry->connection))) + { + DBusConnection *addressed_recipient; + DBusError error; ++ BusResult res; + + dbus_error_init (&error); + + addressed_recipient = bus_service_get_primary_owners_connection (service); + + /* Resume dispatching where we left off in bus_dispatch() */ +- if (!bus_dispatch_matches (transaction, +- entry->connection, +- addressed_recipient, +- entry->activation_message, &error)) ++ res = bus_dispatch_matches (transaction, ++ entry->connection, ++ addressed_recipient, ++ entry->activation_message, &error); ++ if (res == BUS_RESULT_FALSE) + { + /* If permission is denied, we just want to return the error + * to the original method invoker; in particular, we don't +@@ -1266,11 +1272,44 @@ bus_activation_send_pending_auto_activation_messages (BusActivation *activation + bus_connection_send_oom_error (entry->connection, + entry->activation_message); + } +- + dbus_error_free (&error); + link = next; + continue; + } ++ else if (res == BUS_RESULT_LATER) ++ { ++ DBusList *putback_message_link = link; ++ DBusMessage *last_inserted_message = NULL; ++ ++ /* NULL entry->connection implies sending pending ActivationRequest message to systemd */ ++ if (entry->connection == NULL) ++ { ++ _dbus_assert_not_reached ("bus_dispatch_matches returned BUS_RESULT_LATER unexpectedly when sender is NULL"); ++ link = next; ++ continue; ++ } ++ ++ /** ++ * Getting here means that policy check result is not yet available and dispatching ++ * messages from entry->connection has been disabled. ++ * Let's put back all messages for the given connection in the incoming queue and mark ++ * this entry as put back so they are not handled twice. ++ */ ++ while (putback_message_link != NULL) ++ { ++ BusPendingActivationEntry *putback_message = putback_message_link->data; ++ if (putback_message->connection == entry->connection) ++ { ++ if (!_dbus_connection_putback_message (putback_message->connection, last_inserted_message, ++ putback_message->activation_message, &error)) ++ goto error; ++ last_inserted_message = putback_message->activation_message; ++ putback_message->is_put_back = TRUE; ++ } ++ ++ putback_message_link = _dbus_list_get_next_link(&pending_activation->entries, putback_message_link); ++ } ++ } + } + + link = next; +@@ -1287,6 +1326,19 @@ bus_activation_send_pending_auto_activation_messages (BusActivation *activation + return TRUE; + + error: ++ /* remove all messages that have been put to connections' incoming queues */ ++ link = _dbus_list_get_first_link (&pending_activation->entries); ++ while (link != NULL) ++ { ++ BusPendingActivationEntry *entry = link->data; ++ if (entry->is_put_back) ++ { ++ _dbus_connection_remove_message(entry->connection, entry->activation_message); ++ entry->is_put_back = FALSE; ++ } ++ link = _dbus_list_get_next_link(&pending_activation->entries, link); ++ } ++ + return FALSE; + } + +@@ -2079,6 +2131,7 @@ bus_activation_activate_service (BusActivation *activation, + + if (service != NULL) + { ++ BusResult res; + bus_context_log (activation->context, + DBUS_SYSTEM_LOG_INFO, "Activating via systemd: service name='%s' unit='%s' requested by '%s' (%s)", + service_name, +@@ -2086,8 +2139,17 @@ bus_activation_activate_service (BusActivation *activation, + bus_connection_get_name (connection), + bus_connection_get_loginfo (connection)); + /* Wonderful, systemd is connected, let's just send the msg */ +- retval = bus_dispatch_matches (activation_transaction, NULL, ++ res = bus_dispatch_matches (activation_transaction, NULL, + systemd, message, error); ++ ++ if (res == BUS_RESULT_TRUE) ++ retval = TRUE; ++ else ++ { ++ retval = FALSE; ++ if (res == BUS_RESULT_LATER) ++ _dbus_verbose("Unexpectedly need time to check message from bus driver to systemd - dropping the message.\n"); ++ } + } + else + { +diff --git a/bus/check.c b/bus/check.c +index 5b72d31..4b8a699 100644 +--- a/bus/check.c ++++ b/bus/check.c +@@ -55,6 +55,8 @@ typedef struct BusDeferredMessage + BusCheckResponseFunc response_callback; + } BusDeferredMessage; + ++static dbus_int32_t deferred_message_data_slot = -1; ++ + BusCheck * + bus_check_new (BusContext *context, DBusError *error) + { +@@ -67,11 +69,19 @@ bus_check_new (BusContext *context, DBusError *error) + return NULL; + } + ++ if (!dbus_message_allocate_data_slot(&deferred_message_data_slot)) ++ { ++ dbus_free(check); ++ BUS_SET_OOM(error); ++ return NULL; ++ } ++ + check->refcount = 1; + check->context = context; + check->cynara = bus_cynara_new(check, error); + if (dbus_error_is_set(error)) + { ++ dbus_message_free_data_slot(&deferred_message_data_slot); + dbus_free(check); + return NULL; + } +@@ -98,6 +108,7 @@ bus_check_unref (BusCheck *check) + if (check->refcount == 0) + { + bus_cynara_unref(check->cynara); ++ dbus_message_free_data_slot(&deferred_message_data_slot); + dbus_free(check); + } + } +@@ -114,6 +125,45 @@ bus_check_get_cynara (BusCheck *check) + return check->cynara; + } + ++static void ++bus_check_enable_dispatch_callback (BusDeferredMessage *deferred_message, ++ BusResult result) ++{ ++ _dbus_verbose("bus_check_enable_dispatch_callback called deferred_message=%p\n", deferred_message); ++ ++ deferred_message->response = result; ++ _dbus_connection_enable_dispatch(deferred_message->sender); ++} ++ ++static void ++deferred_message_free_function(void *data) ++{ ++ BusDeferredMessage *deferred_message = (BusDeferredMessage *)data; ++ bus_deferred_message_unref(deferred_message); ++} ++ ++void ++bus_deferred_message_disable_sender (BusDeferredMessage *deferred_message) ++{ ++ _dbus_assert(deferred_message != NULL); ++ _dbus_assert(deferred_message->sender != NULL); ++ ++ if (dbus_message_get_data(deferred_message->message, deferred_message_data_slot) == NULL) ++ { ++ if (dbus_message_set_data(deferred_message->message, deferred_message_data_slot, deferred_message, ++ deferred_message_free_function)) ++ bus_deferred_message_ref(deferred_message); ++ } ++ ++ _dbus_connection_disable_dispatch(deferred_message->sender); ++ deferred_message->response_callback = bus_check_enable_dispatch_callback; ++} ++ ++#ifdef DBUS_ENABLE_EMBEDDED_TESTS ++BusResult (*bus_check_test_override) (DBusConnection *connection, ++ const char *privilege); ++#endif ++ + BusResult + bus_check_privilege (BusCheck *check, + DBusMessage *message, +@@ -124,6 +174,7 @@ bus_check_privilege (BusCheck *check, + BusDeferredMessageStatus check_type, + BusDeferredMessage **deferred_message) + { ++ BusDeferredMessage *previous_deferred_message; + BusResult result = BUS_RESULT_FALSE; + #ifdef DBUS_ENABLE_CYNARA + BusCynara *cynara; +@@ -137,16 +188,54 @@ bus_check_privilege (BusCheck *check, + return BUS_RESULT_FALSE; + } + +- /* ask policy checkers */ +-#ifdef DBUS_ENABLE_CYNARA +- cynara = bus_check_get_cynara(check); +- result = bus_cynara_check_privilege(cynara, message, sender, addressed_recipient, +- proposed_recipient, privilege, check_type, deferred_message); ++#ifdef DBUS_ENABLE_EMBEDDED_TESTS ++ if (bus_check_test_override) ++ return bus_check_test_override (connection, privilege); + #endif + +- if (result == BUS_RESULT_LATER && deferred_message != NULL) ++ previous_deferred_message = dbus_message_get_data(message, deferred_message_data_slot); ++ /* check if message blocked at sender's queue is being processed */ ++ if (previous_deferred_message != NULL) ++ { ++ if ((check_type & BUS_DEFERRED_MESSAGE_CHECK_SEND) && ++ !(previous_deferred_message->status & BUS_DEFERRED_MESSAGE_CHECK_SEND)) ++ { ++ /** ++ * Message has been deferred due to receive or own rule which means that sending this message ++ * is allowed - it must have been checked previously. ++ * This might happen when client calls RequestName method which depending on security ++ * policy might result in both "can_send" and "can_own" Cynara checks. ++ */ ++ result = BUS_RESULT_TRUE; ++ } ++ else ++ { ++ result = previous_deferred_message->response; ++ if (result == BUS_RESULT_LATER) ++ { ++ /* result is still not known - reuse deferred message object */ ++ if (deferred_message != NULL) ++ *deferred_message = previous_deferred_message; ++ } ++ else ++ { ++ /* result is available - we can remove deferred message from the processed message */ ++ dbus_message_set_data(message, deferred_message_data_slot, NULL, NULL); ++ } ++ } ++ } ++ else + { +- (*deferred_message)->status |= check_type; ++ /* ask policy checkers */ ++#ifdef DBUS_ENABLE_CYNARA ++ cynara = bus_check_get_cynara(check); ++ result = bus_cynara_check_privilege(cynara, message, sender, addressed_recipient, ++ proposed_recipient, privilege, check_type, deferred_message); ++#endif ++ if (result == BUS_RESULT_LATER && deferred_message != NULL) ++ { ++ (*deferred_message)->status |= check_type; ++ } + } + return result; + } +@@ -206,6 +295,12 @@ bus_deferred_message_unref (BusDeferredMessage *deferred_message) + } + } + ++BusDeferredMessageStatus ++bus_deferred_message_get_status (BusDeferredMessage *deferred_message) ++{ ++ return deferred_message->status; ++} ++ + void + bus_deferred_message_response_received (BusDeferredMessage *deferred_message, + BusResult result) +diff --git a/bus/check.h b/bus/check.h +index c3fcaf9..d177549 100644 +--- a/bus/check.h ++++ b/bus/check.h +@@ -55,6 +55,7 @@ BusResult bus_check_privilege (BusCheck *check, + BusDeferredMessageStatus check_type, + BusDeferredMessage **deferred_message); + ++ + BusDeferredMessage *bus_deferred_message_new (DBusMessage *message, + DBusConnection *sender, + DBusConnection *addressed_recipient, +@@ -65,4 +66,13 @@ BusDeferredMessage *bus_deferred_message_ref (BusDeferredMessage + void bus_deferred_message_unref (BusDeferredMessage *deferred_message); + void bus_deferred_message_response_received (BusDeferredMessage *deferred_message, + BusResult result); ++void bus_deferred_message_disable_sender (BusDeferredMessage *deferred_message); ++ ++BusDeferredMessageStatus bus_deferred_message_get_status (BusDeferredMessage *deferred_message); ++ ++#ifdef DBUS_ENABLE_EMBEDDED_TESTS ++extern BusResult (*bus_check_test_override) (DBusConnection *connection, ++ const char *privilege); ++#endif ++ + #endif /* BUS_CHECK_H */ +diff --git a/bus/cynara.c b/bus/cynara.c +index 57a4c45..77aed62 100644 +--- a/bus/cynara.c ++++ b/bus/cynara.c +@@ -36,7 +36,6 @@ + #include + #endif + +- + #ifdef DBUS_ENABLE_CYNARA + typedef struct BusCynara + { +diff --git a/bus/dispatch.c b/bus/dispatch.c +index d3867f7..50a22a3 100644 +--- a/bus/dispatch.c ++++ b/bus/dispatch.c +@@ -35,6 +35,7 @@ + #include "signals.h" + #include "test.h" + #include ++#include + #include + #include + +@@ -122,7 +123,7 @@ send_one_message (DBusConnection *connection, + return TRUE; + } + +-dbus_bool_t ++BusResult + bus_dispatch_matches (BusTransaction *transaction, + DBusConnection *sender, + DBusConnection *addressed_recipient, +@@ -158,13 +159,29 @@ bus_dispatch_matches (BusTransaction *transaction, + message, NULL, error, + &deferred_message); + if (res == BUS_RESULT_FALSE) +- return FALSE; ++ return BUS_RESULT_FALSE; + else if (res == BUS_RESULT_LATER) + { +- dbus_set_error (error, +- DBUS_ERROR_ACCESS_DENIED, +- "Rejecting message because time is needed to check security policy"); +- return FALSE; ++ BusDeferredMessageStatus status; ++ status = bus_deferred_message_get_status(deferred_message); ++ ++ if (status & BUS_DEFERRED_MESSAGE_CHECK_SEND) ++ { ++ /* send rule result not available - disable dispatching messages from the sender */ ++ bus_deferred_message_disable_sender(deferred_message); ++ return BUS_RESULT_LATER; ++ } ++ else if (status & BUS_DEFERRED_MESSAGE_CHECK_RECEIVE) ++ { ++ dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, ++ "Rejecting message because time is needed to check security policy"); ++ return BUS_RESULT_FALSE; ++ } ++ else ++ { ++ _dbus_verbose("deferred message has no status field set to send or receive unexpectedly\n"); ++ return BUS_RESULT_FALSE; ++ } + } + + if (dbus_message_contains_unix_fds (message) && +@@ -175,14 +192,14 @@ bus_dispatch_matches (BusTransaction *transaction, + DBUS_ERROR_NOT_SUPPORTED, + "Tried to send message with Unix file descriptors" + "to a client that doesn't support that."); +- return FALSE; +- } ++ return BUS_RESULT_FALSE; ++ } + + /* Dispatch the message */ + if (!bus_transaction_send (transaction, addressed_recipient, message)) + { + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + } + +@@ -197,7 +214,7 @@ bus_dispatch_matches (BusTransaction *transaction, + &recipients)) + { + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + link = _dbus_list_get_first_link (&recipients); +@@ -219,10 +236,10 @@ bus_dispatch_matches (BusTransaction *transaction, + if (dbus_error_is_set (&tmp_error)) + { + dbus_move_error (&tmp_error, error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + else +- return TRUE; ++ return BUS_RESULT_TRUE; + } + + static DBusHandlerResult +@@ -409,10 +426,12 @@ bus_dispatch (DBusConnection *connection, + } + else if (res == BUS_RESULT_LATER) + { +- dbus_set_error (&error, +- DBUS_ERROR_ACCESS_DENIED, +- "Rejecting message because time is needed to check security policy"); +- _dbus_verbose ("Security policy needs time to check policy. Dropping message\n"); ++ /* Disable dispatching messages from the sender, ++ * roll back and dispatch the message once the policy result is available */ ++ bus_deferred_message_disable_sender(deferred_message); ++ bus_transaction_cancel_and_free (transaction); ++ transaction = NULL; ++ result = DBUS_HANDLER_RESULT_LATER; + goto out; + } + +@@ -514,8 +533,14 @@ bus_dispatch (DBusConnection *connection, + * addressed_recipient == NULL), and match it against other connections' + * match rules. + */ +- if (!bus_dispatch_matches (transaction, connection, addressed_recipient, message, &error)) +- goto out; ++ if (BUS_RESULT_LATER == bus_dispatch_matches (transaction, connection, addressed_recipient, ++ message, &error)) ++ { ++ /* Roll back and dispatch the message once the policy result is available */ ++ bus_transaction_cancel_and_free (transaction); ++ transaction = NULL; ++ result = DBUS_HANDLER_RESULT_LATER; ++ } + + out: + if (dbus_error_is_set (&error)) +@@ -5060,9 +5085,132 @@ bus_dispatch_test_conf_fail (const DBusString *test_data_dir, + } + #endif + ++typedef struct { ++ DBusTimeout *timeout; ++ DBusConnection *connection; ++ dbus_bool_t timedout; ++ int check_counter; ++} BusTestCheckData; ++ ++static BusTestCheckData *cdata; ++ ++static dbus_bool_t ++bus_dispatch_test_check_timeout (void *data) ++{ ++ _dbus_verbose ("timeout triggered - pretend that privilege check result is available\n"); ++ ++ /* should only happen once during the test */ ++ _dbus_assert (!cdata->timedout); ++ cdata->timedout = TRUE; ++ _dbus_connection_enable_dispatch (cdata->connection); ++ ++ /* don't call this again */ ++ _dbus_loop_remove_timeout (bus_connection_get_loop (cdata->connection), ++ cdata->timeout); ++ dbus_connection_unref (cdata->connection); ++ cdata->connection = NULL; ++ return TRUE; ++} ++ ++static BusResult ++bus_dispatch_test_check_override (DBusConnection *connection, ++ const char *privilege) ++{ ++ _dbus_verbose ("overriding privilege check %s #%d\n", privilege, cdata->check_counter); ++ cdata->check_counter++; ++ if (!cdata->timedout) ++ { ++ dbus_bool_t added; ++ ++ /* Should be the first privilege check for the "Echo" method. */ ++ _dbus_assert (cdata->check_counter == 1); ++ cdata->timeout = _dbus_timeout_new (1, bus_dispatch_test_check_timeout, ++ NULL, NULL); ++ _dbus_assert (cdata->timeout); ++ added = _dbus_loop_add_timeout (bus_connection_get_loop (connection), ++ cdata->timeout); ++ _dbus_assert (added); ++ cdata->connection = connection; ++ dbus_connection_ref (connection); ++ _dbus_connection_disable_dispatch (connection); ++ return BUS_RESULT_LATER; ++ } ++ else ++ { ++ /* Should only be checked one more time, and this time succeeds. */ ++ _dbus_assert (cdata->check_counter == 2); ++ return BUS_RESULT_TRUE; ++ } ++} ++ ++static dbus_bool_t ++bus_dispatch_test_check (const DBusString *test_data_dir) ++{ ++ const char *filename = "valid-config-files/debug-check-some.conf"; ++ BusContext *context; ++ DBusConnection *foo; ++ DBusError error; ++ dbus_bool_t result = TRUE; ++ BusTestCheckData data; ++ ++ /* save the config name for the activation helper */ ++ if (!setenv_TEST_LAUNCH_HELPER_CONFIG (test_data_dir, filename)) ++ _dbus_assert_not_reached ("no memory setting TEST_LAUNCH_HELPER_CONFIG"); ++ ++ dbus_error_init (&error); ++ ++ context = bus_context_new_test (test_data_dir, filename); ++ if (context == NULL) ++ return FALSE; ++ ++ foo = dbus_connection_open_private (TEST_DEBUG_PIPE, &error); ++ if (foo == NULL) ++ _dbus_assert_not_reached ("could not alloc connection"); ++ ++ if (!bus_setup_debug_client (foo)) ++ _dbus_assert_not_reached ("could not set up connection"); ++ ++ spin_connection_until_authenticated (context, foo); ++ ++ if (!check_hello_message (context, foo)) ++ _dbus_assert_not_reached ("hello message failed"); ++ ++ if (!check_double_hello_message (context, foo)) ++ _dbus_assert_not_reached ("double hello message failed"); ++ ++ if (!check_add_match (context, foo, "")) ++ _dbus_assert_not_reached ("AddMatch message failed"); ++ ++ /* ++ * Cause bus_check_send_privilege() to return BUS_RESULT_LATER in the ++ * first call, then BUS_RESULT_TRUE. ++ */ ++ cdata = &data; ++ memset (cdata, 0, sizeof(*cdata)); ++ bus_check_test_override = bus_dispatch_test_check_override; ++ ++ result = check_existent_service_auto_start (context, foo); ++ ++ _dbus_assert (cdata->check_counter == 2); ++ _dbus_assert (cdata->timedout); ++ _dbus_assert (cdata->timeout); ++ _dbus_assert (!cdata->connection); ++ _dbus_timeout_unref (cdata->timeout); ++ ++ kill_client_connection_unchecked (foo); ++ ++ bus_context_unref (context); ++ ++ return result; ++} ++ + dbus_bool_t + bus_dispatch_test (const DBusString *test_data_dir) + { ++ _dbus_verbose (" tests\n"); ++ if (!bus_dispatch_test_check (test_data_dir)) ++ return FALSE; ++ + /* run normal activation tests */ + _dbus_verbose ("Normal activation tests\n"); + if (!bus_dispatch_test_conf (test_data_dir, +diff --git a/bus/dispatch.h b/bus/dispatch.h +index fb5ba7a..afba6a2 100644 +--- a/bus/dispatch.h ++++ b/bus/dispatch.h +@@ -29,7 +29,7 @@ + + dbus_bool_t bus_dispatch_add_connection (DBusConnection *connection); + void bus_dispatch_remove_connection (DBusConnection *connection); +-dbus_bool_t bus_dispatch_matches (BusTransaction *transaction, ++BusResult bus_dispatch_matches (BusTransaction *transaction, + DBusConnection *sender, + DBusConnection *recipient, + DBusMessage *message, +diff --git a/bus/driver.c b/bus/driver.c +index cd0a714..f414f64 100644 +--- a/bus/driver.c ++++ b/bus/driver.c +@@ -218,6 +218,7 @@ bus_driver_send_service_owner_changed (const char *service_name, + { + DBusMessage *message; + dbus_bool_t retval; ++ BusResult res; + const char *null_service; + + _DBUS_ASSERT_ERROR_IS_CLEAR (error); +@@ -253,7 +254,16 @@ bus_driver_send_service_owner_changed (const char *service_name, + if (!bus_transaction_capture (transaction, NULL, NULL, message)) + goto oom; + +- retval = bus_dispatch_matches (transaction, NULL, NULL, message, error); ++ res = bus_dispatch_matches (transaction, NULL, NULL, message, error); ++ if (res == BUS_RESULT_TRUE) ++ retval = TRUE; ++ else ++ { ++ retval = FALSE; ++ if (res == BUS_RESULT_LATER) ++ /* should never happen */ ++ _dbus_assert_not_reached ("bus_dispatch_matches returned BUS_RESULT_LATER unexpectedly"); ++ } + dbus_message_unref (message); + + return retval; +diff --git a/dbus/dbus-connection-internal.h b/dbus/dbus-connection-internal.h +index 4835732..94b1c95 100644 +--- a/dbus/dbus-connection-internal.h ++++ b/dbus/dbus-connection-internal.h +@@ -118,6 +118,21 @@ DBUS_PRIVATE_EXPORT + dbus_bool_t _dbus_connection_get_linux_security_label (DBusConnection *connection, + char **label_p); + ++DBUS_PRIVATE_EXPORT ++void _dbus_connection_enable_dispatch (DBusConnection *connection); ++DBUS_PRIVATE_EXPORT ++void _dbus_connection_disable_dispatch (DBusConnection *connection); ++ ++DBUS_PRIVATE_EXPORT ++dbus_bool_t _dbus_connection_putback_message (DBusConnection *connection, ++ DBusMessage *after_message, ++ DBusMessage *message, ++ DBusError *error); ++ ++DBUS_PRIVATE_EXPORT ++dbus_bool_t _dbus_connection_remove_message (DBusConnection *connection, ++ DBusMessage *message); ++ + /* if DBUS_ENABLE_STATS */ + DBUS_PRIVATE_EXPORT + void _dbus_connection_get_stats (DBusConnection *connection, +diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c +index c525b6d..958968c 100644 +--- a/dbus/dbus-connection.c ++++ b/dbus/dbus-connection.c +@@ -311,7 +311,8 @@ struct DBusConnection + */ + dbus_bool_t dispatch_acquired; /**< Someone has dispatch path (can drain incoming queue) */ + dbus_bool_t io_path_acquired; /**< Someone has transport io path (can use the transport to read/write messages) */ +- ++ ++ unsigned int dispatch_disabled : 1; /**< if true, then dispatching incoming messages is stopped until enabled again */ + unsigned int shareable : 1; /**< #TRUE if libdbus owns a reference to the connection and can return it from dbus_connection_open() more than once */ + + unsigned int exit_on_disconnect : 1; /**< If #TRUE, exit after handling disconnect signal */ +@@ -439,6 +440,39 @@ _dbus_connection_wakeup_mainloop (DBusConnection *connection) + (*connection->wakeup_main_function) (connection->wakeup_main_data); + } + ++static void ++_dbus_connection_set_dispatch(DBusConnection *connection, ++ dbus_bool_t disabled) ++{ ++ CONNECTION_LOCK (connection); ++ if (connection->dispatch_disabled != disabled) ++ { ++ DBusDispatchStatus status; ++ ++ connection->dispatch_disabled = disabled; ++ status = _dbus_connection_get_dispatch_status_unlocked (connection); ++ _dbus_connection_update_dispatch_status_and_unlock (connection, status); ++ } ++ else ++ { ++ CONNECTION_UNLOCK (connection); ++ } ++} ++ ++ ++void ++_dbus_connection_enable_dispatch (DBusConnection *connection) ++{ ++ _dbus_connection_set_dispatch (connection, FALSE); ++} ++ ++void ++ _dbus_connection_disable_dispatch (DBusConnection *connection) ++{ ++ _dbus_connection_set_dispatch (connection, TRUE); ++} ++ ++ + #ifdef DBUS_ENABLE_EMBEDDED_TESTS + /** + * Gets the locks so we can examine them +@@ -4069,6 +4103,82 @@ _dbus_connection_putback_message_link_unlocked (DBusConnection *connection, + "_dbus_connection_putback_message_link_unlocked"); + } + ++dbus_bool_t ++_dbus_connection_putback_message (DBusConnection *connection, ++ DBusMessage *after_message, ++ DBusMessage *message, ++ DBusError *error) ++{ ++ DBusDispatchStatus status; ++ DBusList *message_link = _dbus_list_alloc_link (message); ++ DBusList *after_link; ++ if (message_link == NULL) ++ { ++ _DBUS_SET_OOM (error); ++ return FALSE; ++ } ++ dbus_message_ref (message); ++ ++ CONNECTION_LOCK (connection); ++ _dbus_connection_acquire_dispatch (connection); ++ HAVE_LOCK_CHECK (connection); ++ ++ after_link = _dbus_list_find_first(&connection->incoming_messages, after_message); ++ _dbus_list_insert_after_link (&connection->incoming_messages, after_link, message_link); ++ connection->n_incoming += 1; ++ ++ _dbus_verbose ("Message %p (%s %s %s '%s') put back into queue %p, %d incoming\n", ++ message_link->data, ++ dbus_message_type_to_string (dbus_message_get_type (message_link->data)), ++ dbus_message_get_interface (message_link->data) ? ++ dbus_message_get_interface (message_link->data) : ++ "no interface", ++ dbus_message_get_member (message_link->data) ? ++ dbus_message_get_member (message_link->data) : ++ "no member", ++ dbus_message_get_signature (message_link->data), ++ connection, connection->n_incoming); ++ ++ _dbus_message_trace_ref (message_link->data, -1, -1, ++ "_dbus_connection_putback_message"); ++ ++ _dbus_connection_release_dispatch (connection); ++ ++ status = _dbus_connection_get_dispatch_status_unlocked (connection); ++ _dbus_connection_update_dispatch_status_and_unlock (connection, status); ++ ++ return TRUE; ++} ++ ++dbus_bool_t ++_dbus_connection_remove_message (DBusConnection *connection, ++ DBusMessage *message) ++{ ++ DBusDispatchStatus status; ++ dbus_bool_t removed; ++ ++ CONNECTION_LOCK (connection); ++ _dbus_connection_acquire_dispatch (connection); ++ HAVE_LOCK_CHECK (connection); ++ ++ removed = _dbus_list_remove(&connection->incoming_messages, message); ++ ++ if (removed) ++ { ++ connection->n_incoming -= 1; ++ dbus_message_unref(message); ++ _dbus_verbose ("Message %p removed from incoming queue\n", message); ++ } ++ else ++ _dbus_verbose ("Message %p not found in the incoming queue\n", message); ++ ++ _dbus_connection_release_dispatch (connection); ++ ++ status = _dbus_connection_get_dispatch_status_unlocked (connection); ++ _dbus_connection_update_dispatch_status_and_unlock (connection, status); ++ return removed; ++} ++ + /** + * Returns the first-received message from the incoming message queue, + * removing it from the queue. The caller owns a reference to the +@@ -4252,8 +4362,9 @@ static DBusDispatchStatus + _dbus_connection_get_dispatch_status_unlocked (DBusConnection *connection) + { + HAVE_LOCK_CHECK (connection); +- +- if (connection->n_incoming > 0) ++ if (connection->dispatch_disabled && _dbus_connection_get_is_connected_unlocked(connection)) ++ return DBUS_DISPATCH_COMPLETE; ++ else if (connection->n_incoming > 0) + return DBUS_DISPATCH_DATA_REMAINS; + else if (!_dbus_transport_queue_messages (connection->transport)) + return DBUS_DISPATCH_NEED_MEMORY; +@@ -4716,6 +4827,8 @@ dbus_connection_dispatch (DBusConnection *connection) + + CONNECTION_LOCK (connection); + ++ if (result == DBUS_HANDLER_RESULT_LATER) ++ goto out; + if (result == DBUS_HANDLER_RESULT_NEED_MEMORY) + { + _dbus_verbose ("No memory\n"); +@@ -4838,9 +4951,11 @@ dbus_connection_dispatch (DBusConnection *connection) + connection); + + out: +- if (result == DBUS_HANDLER_RESULT_NEED_MEMORY) ++ if (result == DBUS_HANDLER_RESULT_LATER || ++ result == DBUS_HANDLER_RESULT_NEED_MEMORY) + { +- _dbus_verbose ("out of memory\n"); ++ if (result == DBUS_HANDLER_RESULT_NEED_MEMORY) ++ _dbus_verbose ("out of memory\n"); + + /* Put message back, and we'll start over. + * Yes this means handlers must be idempotent if they +diff --git a/dbus/dbus-list.c b/dbus/dbus-list.c +index 8e713c0..32ea871 100644 +--- a/dbus/dbus-list.c ++++ b/dbus/dbus-list.c +@@ -458,6 +458,35 @@ _dbus_list_remove_last (DBusList **list, + return FALSE; + } + ++/** ++ * Finds a value in the list. Returns the first link ++ * with value equal to the given data pointer. ++ * This is a linear-time operation. ++ * Returns #NULL if no value found that matches. ++ * ++ * @param list address of the list head. ++ * @param data the value to find. ++ * @returns the link if found ++ */ ++DBusList* ++_dbus_list_find_first (DBusList **list, ++ void *data) ++{ ++ DBusList *link; ++ ++ link = _dbus_list_get_first_link (list); ++ ++ while (link != NULL) ++ { ++ if (link->data == data) ++ return link; ++ ++ link = _dbus_list_get_next_link (list, link); ++ } ++ ++ return NULL; ++} ++ + /** + * Finds a value in the list. Returns the last link + * with value equal to the given data pointer. +diff --git a/dbus/dbus-list.h b/dbus/dbus-list.h +index 9350a0d..fee9f1b 100644 +--- a/dbus/dbus-list.h ++++ b/dbus/dbus-list.h +@@ -68,6 +68,9 @@ DBUS_PRIVATE_EXPORT + void _dbus_list_remove_link (DBusList **list, + DBusList *link); + DBUS_PRIVATE_EXPORT ++DBusList* _dbus_list_find_first (DBusList **list, ++ void *data); ++DBUS_PRIVATE_EXPORT + DBusList* _dbus_list_find_last (DBusList **list, + void *data); + DBUS_PRIVATE_EXPORT +diff --git a/dbus/dbus-shared.h b/dbus/dbus-shared.h +index 7ab9103..e5bfbed 100644 +--- a/dbus/dbus-shared.h ++++ b/dbus/dbus-shared.h +@@ -67,7 +67,8 @@ typedef enum + { + DBUS_HANDLER_RESULT_HANDLED, /**< Message has had its effect - no need to run more handlers. */ + DBUS_HANDLER_RESULT_NOT_YET_HANDLED, /**< Message has not had any effect - see if other handlers want it. */ +- DBUS_HANDLER_RESULT_NEED_MEMORY /**< Need more memory in order to return #DBUS_HANDLER_RESULT_HANDLED or #DBUS_HANDLER_RESULT_NOT_YET_HANDLED. Please try again later with more memory. */ ++ DBUS_HANDLER_RESULT_NEED_MEMORY, /**< Need more memory in order to return #DBUS_HANDLER_RESULT_HANDLED or #DBUS_HANDLER_RESULT_NOT_YET_HANDLED. Please try again later with more memory. */ ++ DBUS_HANDLER_RESULT_LATER /**< Message dispatch deferred due to pending policy check */ + } DBusHandlerResult; + + /* Bus names */ +-- +2.21.1 + diff --git a/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0003-Handle-unavailability-of-policy-results-for-broadcas.patch b/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0003-Handle-unavailability-of-policy-results-for-broadcas.patch new file mode 100644 index 00000000..7d89a749 --- /dev/null +++ b/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0003-Handle-unavailability-of-policy-results-for-broadcas.patch @@ -0,0 +1,1095 @@ +From 9d39aa9dd55680529d721a0389ce9ef579bb669a Mon Sep 17 00:00:00 2001 +From: Jacek Bukarewicz +Date: Fri, 28 Nov 2014 12:39:33 +0100 +Subject: [PATCH 3/8] Handle unavailability of policy results for broadcasts + and receive rules +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When message is sent to the addressed recipient and receive rule +result is unavailable we don't want to block the sender +as it most likely will be the privileged service, so instead we queue +it at the recipient. Any further messages sent to it will be queued to +maintain message order. Once the answer from Cynara arrives messages are +dispatched from the recipient queue. In such case full dispatch is +performed - messages are sent to addressed recipient and other +interested connections. +Messages sent to non-addressed recipients (eavesdroppers or broadcast +message recipients) are handled in a similar way. The difference is +that it is not full dispatch meaning message is sent to a single recipient. + +Cherry picked from 1e231194610892dd4360224998d91336097b05a1 by Jose Bollo + +Updated for dbus 1.10.20 by Scott Murray and José Bollo + +Signed-off-by: José Bollo +Signed-off-by: Scott Murray +--- + bus/activation.c | 4 +- + bus/bus.c | 50 ++++++-- + bus/bus.h | 19 +++ + bus/check.c | 307 +++++++++++++++++++++++++++++++++++++++++++++++ + bus/check.h | 25 ++++ + bus/connection.c | 168 ++++++++++++++++++++++++-- + bus/connection.h | 19 ++- + bus/dispatch.c | 115 +++++++++++++++--- + bus/dispatch.h | 11 +- + bus/driver.c | 2 +- + bus/policy.c | 6 + + 11 files changed, 683 insertions(+), 43 deletions(-) + +diff --git a/bus/activation.c b/bus/activation.c +index 8301b59..d4b597c 100644 +--- a/bus/activation.c ++++ b/bus/activation.c +@@ -1259,7 +1259,7 @@ bus_activation_send_pending_auto_activation_messages (BusActivation *activation + res = bus_dispatch_matches (transaction, + entry->connection, + addressed_recipient, +- entry->activation_message, &error); ++ entry->activation_message, NULL, &error); + if (res == BUS_RESULT_FALSE) + { + /* If permission is denied, we just want to return the error +@@ -2140,7 +2140,7 @@ bus_activation_activate_service (BusActivation *activation, + bus_connection_get_loginfo (connection)); + /* Wonderful, systemd is connected, let's just send the msg */ + res = bus_dispatch_matches (activation_transaction, NULL, +- systemd, message, error); ++ systemd, message, NULL, error); + + if (res == BUS_RESULT_TRUE) + retval = TRUE; +diff --git a/bus/bus.c b/bus/bus.c +index 6fc45d0..0aa700b 100644 +--- a/bus/bus.c ++++ b/bus/bus.c +@@ -1800,17 +1800,9 @@ bus_context_check_security_policy (BusContext *context, + } + + /* See if limits on size have been exceeded */ +- if (proposed_recipient && +- ((dbus_connection_get_outgoing_size (proposed_recipient) > context->limits.max_outgoing_bytes) || +- (dbus_connection_get_outgoing_unix_fds (proposed_recipient) > context->limits.max_outgoing_unix_fds))) +- { +- complain_about_message (context, DBUS_ERROR_LIMITS_EXCEEDED, +- "Rejected: destination has a full message queue", +- 0, message, sender, proposed_recipient, requested_reply, TRUE, NULL, +- error); +- _dbus_verbose ("security policy disallowing message due to full message queue\n"); ++ if (!bus_context_check_recipient_message_limits(context, proposed_recipient, sender, message, ++ requested_reply, error)) + return BUS_RESULT_FALSE; +- } + + /* Record that we will allow a reply here in the future (don't + * bother if the recipient is the bus or this is an eavesdropping +@@ -1869,3 +1861,41 @@ bus_context_check_all_watches (BusContext *context) + _dbus_server_toggle_all_watches (server, enabled); + } + } ++ ++void ++bus_context_complain_about_message (BusContext *context, ++ const char *error_name, ++ const char *complaint, ++ int matched_rules, ++ DBusMessage *message, ++ DBusConnection *sender, ++ DBusConnection *proposed_recipient, ++ dbus_bool_t requested_reply, ++ dbus_bool_t log, ++ const char *privilege, ++ DBusError *error) ++{ ++ complain_about_message(context, error_name, complaint, matched_rules, message, sender, ++ proposed_recipient, requested_reply, log, privilege, error); ++} ++ ++dbus_bool_t bus_context_check_recipient_message_limits (BusContext *context, ++ DBusConnection *recipient, ++ DBusConnection *sender, ++ DBusMessage *message, ++ dbus_bool_t requested_reply, ++ DBusError *error) ++{ ++ if (recipient && ++ ((dbus_connection_get_outgoing_size (recipient) > context->limits.max_outgoing_bytes) || ++ (dbus_connection_get_outgoing_unix_fds (recipient) > context->limits.max_outgoing_unix_fds))) ++ { ++ complain_about_message (context, DBUS_ERROR_LIMITS_EXCEEDED, ++ "Rejected: destination has a full message queue", ++ 0, message, sender, recipient, requested_reply, TRUE, NULL, ++ error); ++ _dbus_verbose ("security policy disallowing message due to full message queue\n"); ++ return FALSE; ++ } ++ return TRUE; ++} +diff --git a/bus/bus.h b/bus/bus.h +index 82c32c8..1b08f7c 100644 +--- a/bus/bus.h ++++ b/bus/bus.h +@@ -164,4 +164,23 @@ BusResult bus_context_check_security_policy (BusContext + BusDeferredMessage **deferred_message); + void bus_context_check_all_watches (BusContext *context); + ++dbus_bool_t bus_context_check_recipient_message_limits (BusContext *context, ++ DBusConnection *recipient, ++ DBusConnection *sender, ++ DBusMessage *message, ++ dbus_bool_t requested_reply, ++ DBusError *error); ++void bus_context_complain_about_message (BusContext *context, ++ const char *error_name, ++ const char *complaint, ++ int matched_rules, ++ DBusMessage *message, ++ DBusConnection *sender, ++ DBusConnection *proposed_recipient, ++ dbus_bool_t requested_reply, ++ dbus_bool_t log, ++ const char *privilege, ++ DBusError *error); ++ ++ + #endif /* BUS_BUS_H */ +diff --git a/bus/check.c b/bus/check.c +index 4b8a699..f3d283f 100644 +--- a/bus/check.c ++++ b/bus/check.c +@@ -49,6 +49,9 @@ typedef struct BusDeferredMessage + DBusConnection *sender; + DBusConnection *proposed_recipient; + DBusConnection *addressed_recipient; ++ dbus_bool_t requested_reply; ++ int matched_rules; ++ const char *privilege; + dbus_bool_t full_dispatch; + BusDeferredMessageStatus status; + BusResult response; +@@ -135,6 +138,89 @@ bus_check_enable_dispatch_callback (BusDeferredMessage *deferred_message, + _dbus_connection_enable_dispatch(deferred_message->sender); + } + ++static void ++bus_check_queued_message_reply_callback (BusDeferredMessage *deferred_message, ++ BusResult result) ++{ ++ int status; ++ ++ _dbus_verbose("bus_check_queued_message_reply_callback called message=%p\n", deferred_message); ++ ++ if (!bus_connection_is_active(deferred_message->proposed_recipient)) ++ return; ++ ++ status = deferred_message->status; ++ ++ deferred_message->status = 0; /* mark message as not waiting for response */ ++ deferred_message->response = result; ++ ++ /* ++ * If send rule allows us to send message we still need to check receive rules. ++ */ ++ if ((status & BUS_DEFERRED_MESSAGE_CHECK_SEND) && (result == BUS_RESULT_TRUE)) ++ { ++ int toggles; ++ BusContext *context; ++ BusRegistry *registry; ++ BusClientPolicy *recipient_policy; ++ BusDeferredMessage *deferred_message_receive; ++ ++ context = bus_connection_get_context(deferred_message->proposed_recipient); ++ registry = bus_context_get_registry(context); ++ recipient_policy = bus_connection_get_policy(deferred_message->proposed_recipient); ++ ++ deferred_message->response = bus_client_policy_check_can_receive(recipient_policy, registry, ++ deferred_message->requested_reply, deferred_message->sender, ++ deferred_message->addressed_recipient, deferred_message->proposed_recipient, deferred_message->message, ++ &toggles, NULL, &deferred_message_receive); ++ if (deferred_message->response == BUS_RESULT_LATER) ++ { ++ /* replace deferred message associated with send check with the one associated with ++ * receive check */ ++ if (!bus_deferred_message_replace(deferred_message, deferred_message_receive)) ++ { ++ /* failed to replace deferred message (due to oom). Set it to rejected */ ++ deferred_message->response = BUS_RESULT_FALSE; ++ } ++ } ++ } ++ ++ bus_connection_dispatch_deferred(deferred_message->proposed_recipient); ++} ++ ++static void ++queue_deferred_message_cancel_transaction_hook (void *data) ++{ ++ BusDeferredMessage *deferred_message = (BusDeferredMessage *)data; ++ bus_connection_remove_deferred_message(deferred_message->proposed_recipient, deferred_message); ++} ++ ++ ++dbus_bool_t ++bus_deferred_message_queue_at_recipient (BusDeferredMessage *deferred_message, ++ BusTransaction *transaction, ++ dbus_bool_t full_dispatch, ++ dbus_bool_t prepend) ++{ ++ _dbus_assert(deferred_message != NULL); ++ _dbus_assert(deferred_message->proposed_recipient != NULL); ++ ++ if (!bus_connection_queue_deferred_message(deferred_message->proposed_recipient, ++ deferred_message, prepend)) ++ return FALSE; ++ ++ if (!bus_transaction_add_cancel_hook(transaction, queue_deferred_message_cancel_transaction_hook, ++ deferred_message, NULL)) ++ { ++ bus_connection_remove_deferred_message(deferred_message->proposed_recipient, deferred_message); ++ return FALSE; ++ } ++ deferred_message->response_callback = bus_check_queued_message_reply_callback; ++ deferred_message->full_dispatch = full_dispatch; ++ ++ return TRUE; ++} ++ + static void + deferred_message_free_function(void *data) + { +@@ -159,6 +245,20 @@ bus_deferred_message_disable_sender (BusDeferredMessage *deferred_message) + deferred_message->response_callback = bus_check_enable_dispatch_callback; + } + ++void ++bus_deferred_message_set_policy_check_info (BusDeferredMessage *deferred_message, ++ dbus_bool_t requested_reply, ++ int matched_rules, ++ const char *privilege) ++{ ++ _dbus_assert(deferred_message != NULL); ++ ++ deferred_message->requested_reply = requested_reply; ++ deferred_message->matched_rules = matched_rules; ++ deferred_message->privilege = privilege; ++} ++ ++ + #ifdef DBUS_ENABLE_EMBEDDED_TESTS + BusResult (*bus_check_test_override) (DBusConnection *connection, + const char *privilege); +@@ -259,6 +359,9 @@ BusDeferredMessage *bus_deferred_message_new (DBusMessage *message, + deferred_message->addressed_recipient = addressed_recipient != NULL ? dbus_connection_ref(addressed_recipient) : NULL; + deferred_message->proposed_recipient = proposed_recipient != NULL ? dbus_connection_ref(proposed_recipient) : NULL; + deferred_message->message = dbus_message_ref(message); ++ deferred_message->requested_reply = FALSE; ++ deferred_message->matched_rules = 0; ++ deferred_message->privilege = NULL; + deferred_message->response = response; + deferred_message->status = 0; + deferred_message->full_dispatch = FALSE; +@@ -295,12 +398,215 @@ bus_deferred_message_unref (BusDeferredMessage *deferred_message) + } + } + ++dbus_bool_t ++bus_deferred_message_check_message_limits (BusDeferredMessage *deferred_message, DBusError *error) ++{ ++ BusContext *context = bus_connection_get_context(deferred_message->proposed_recipient); ++ ++ return bus_context_check_recipient_message_limits(context, deferred_message->proposed_recipient, ++ deferred_message->sender, deferred_message->message, deferred_message->requested_reply, ++ error); ++} ++ ++dbus_bool_t ++bus_deferred_message_expect_method_reply(BusDeferredMessage *deferred_message, BusTransaction *transaction, DBusError *error) ++{ ++ int type = dbus_message_get_type(deferred_message->message); ++ if (type == DBUS_MESSAGE_TYPE_METHOD_CALL && ++ deferred_message->sender && ++ deferred_message->addressed_recipient && ++ deferred_message->addressed_recipient == deferred_message->proposed_recipient && /* not eavesdropping */ ++ !bus_connections_expect_reply (bus_connection_get_connections (deferred_message->sender), ++ transaction, ++ deferred_message->sender, deferred_message->addressed_recipient, ++ deferred_message->message, error)) ++ { ++ _dbus_verbose ("Failed to record reply expectation or problem with the message expecting a reply\n"); ++ return FALSE; ++ } ++ return TRUE; ++} ++ ++void ++bus_deferred_message_create_error(BusDeferredMessage *deferred_message, ++ const char *error_message, DBusError *error) ++{ ++ BusContext *context; ++ _dbus_assert (deferred_message->status == 0 && deferred_message->response == BUS_RESULT_FALSE); ++ ++ if (deferred_message->sender == NULL) ++ return; /* error won't be sent to bus driver anyway */ ++ ++ context = bus_connection_get_context(deferred_message->sender); ++ bus_context_complain_about_message(context, DBUS_ERROR_ACCESS_DENIED, "Rejected message", ++ deferred_message->matched_rules, deferred_message->message, deferred_message->sender, ++ deferred_message->proposed_recipient, deferred_message->requested_reply, FALSE, ++ deferred_message->privilege, error); ++} ++ ++BusResult ++bus_deferred_message_dispatch (BusDeferredMessage *deferred_message) ++{ ++ BusContext *context = bus_connection_get_context (deferred_message->proposed_recipient); ++ BusTransaction *transaction = bus_transaction_new (context); ++ BusResult result = BUS_RESULT_TRUE; ++ DBusError error; ++ ++ if (transaction == NULL) ++ { ++ return BUS_RESULT_FALSE; ++ } ++ ++ dbus_error_init(&error); ++ ++ if (!deferred_message->full_dispatch) ++ { ++ result = deferred_message->response; ++ if (result == BUS_RESULT_TRUE) ++ { ++ if (!bus_context_check_recipient_message_limits(context, deferred_message->proposed_recipient, ++ deferred_message->sender, deferred_message->message, deferred_message->requested_reply, &error)) ++ result = BUS_RESULT_FALSE; ++ } ++ else if (result == BUS_RESULT_LATER) ++ { ++ BusDeferredMessage *deferred_message2; ++ result = bus_context_check_security_policy (context, transaction, ++ deferred_message->sender, ++ deferred_message->addressed_recipient, ++ deferred_message->proposed_recipient, ++ deferred_message->message, NULL, NULL, ++ &deferred_message2); ++ ++ if (result == BUS_RESULT_LATER) ++ { ++ /* prepend at recipient */ ++ if (!bus_deferred_message_queue_at_recipient(deferred_message2, transaction, ++ FALSE, TRUE)) ++ result = BUS_RESULT_FALSE; ++ } ++ } ++ ++ /* silently drop messages on access denial */ ++ if (result == BUS_RESULT_TRUE) ++ { ++ if (!bus_transaction_send (transaction, deferred_message->proposed_recipient, deferred_message->message, TRUE)) ++ result = BUS_RESULT_FALSE; ++ } ++ ++ bus_transaction_execute_and_free(transaction); ++ ++ goto out; ++ } ++ ++ /* do not attempt to send message if sender has disconnected */ ++ if (deferred_message->sender != NULL && !bus_connection_is_active(deferred_message->sender)) ++ { ++ bus_transaction_cancel_and_free(transaction); ++ result = BUS_RESULT_FALSE; ++ goto out; ++ } ++ ++ result = bus_dispatch_matches(transaction, deferred_message->sender, ++ deferred_message->addressed_recipient, deferred_message->message, deferred_message, &error); ++ ++ if (result == BUS_RESULT_LATER) ++ { ++ /* Message deferring was already done in bus_dispatch_matches */ ++ bus_transaction_cancel_and_free(transaction); ++ goto out; ++ } ++ ++ /* this part is a copy & paste from bus_dispatch function. Probably can be moved to a function */ ++ if (dbus_error_is_set (&error)) ++ { ++ if (!dbus_connection_get_is_connected (deferred_message->sender)) ++ { ++ /* If we disconnected it, we won't bother to send it any error ++ * messages. ++ */ ++ _dbus_verbose ("Not sending error to connection we disconnected\n"); ++ } ++ else if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY)) ++ { ++ bus_connection_send_oom_error (deferred_message->sender, deferred_message->message); ++ ++ /* cancel transaction due to OOM */ ++ if (transaction != NULL) ++ { ++ bus_transaction_cancel_and_free (transaction); ++ transaction = NULL; ++ } ++ } ++ else ++ { ++ /* Try to send the real error, if no mem to do that, send ++ * the OOM error ++ */ ++ _dbus_assert (transaction != NULL); ++ if (!bus_transaction_send_error_reply (transaction, deferred_message->sender, ++ &error, deferred_message->message)) ++ { ++ bus_connection_send_oom_error (deferred_message->sender, deferred_message->message); ++ ++ /* cancel transaction due to OOM */ ++ if (transaction != NULL) ++ { ++ bus_transaction_cancel_and_free (transaction); ++ transaction = NULL; ++ } ++ } ++ } ++ } ++ ++ if (transaction != NULL) ++ { ++ bus_transaction_execute_and_free (transaction); ++ } ++ ++out: ++ dbus_error_free(&error); ++ ++ return result; ++} ++ ++dbus_bool_t ++bus_deferred_message_replace (BusDeferredMessage *old_message, BusDeferredMessage *new_message) ++{ ++ if (bus_connection_replace_deferred_message(old_message->proposed_recipient, ++ old_message, new_message)) ++ { ++ new_message->response_callback = old_message->response_callback; ++ new_message->full_dispatch = old_message->full_dispatch; ++ return TRUE; ++ } ++ return FALSE; ++} ++ ++dbus_bool_t ++bus_deferred_message_waits_for_check(BusDeferredMessage *deferred_message) ++{ ++ return deferred_message->status != 0; ++} ++ ++DBusConnection * ++bus_deferred_message_get_recipient(BusDeferredMessage *deferred_message) ++{ ++ return deferred_message->proposed_recipient; ++} ++ + BusDeferredMessageStatus + bus_deferred_message_get_status (BusDeferredMessage *deferred_message) + { + return deferred_message->status; + } + ++BusResult ++bus_deferred_message_get_response (BusDeferredMessage *deferred_message) ++{ ++ return deferred_message->response; ++} ++ + void + bus_deferred_message_response_received (BusDeferredMessage *deferred_message, + BusResult result) +@@ -310,3 +616,4 @@ bus_deferred_message_response_received (BusDeferredMessage *deferred_message, + deferred_message->response_callback(deferred_message, result); + } + } ++ +diff --git a/bus/check.h b/bus/check.h +index d177549..9c13c18 100644 +--- a/bus/check.h ++++ b/bus/check.h +@@ -64,12 +64,37 @@ BusDeferredMessage *bus_deferred_message_new (DBusMessage *messag + + BusDeferredMessage *bus_deferred_message_ref (BusDeferredMessage *deferred_message); + void bus_deferred_message_unref (BusDeferredMessage *deferred_message); ++BusResult bus_deferred_message_dispatch (BusDeferredMessage *deferred_message); ++dbus_bool_t bus_deferred_message_waits_for_check (BusDeferredMessage *deferred_message); ++DBusConnection *bus_deferred_message_get_recipient (BusDeferredMessage *deferred_message); + void bus_deferred_message_response_received (BusDeferredMessage *deferred_message, + BusResult result); ++dbus_bool_t bus_deferred_message_queue_at_recipient (BusDeferredMessage *deferred_message, ++ BusTransaction *transaction, ++ dbus_bool_t full_dispatch, ++ dbus_bool_t prepend); ++dbus_bool_t bus_deferred_message_replace (BusDeferredMessage *old_message, ++ BusDeferredMessage *new_message); + void bus_deferred_message_disable_sender (BusDeferredMessage *deferred_message); ++BusResult bus_deferred_message_get_response (BusDeferredMessage *deferred_message); + + BusDeferredMessageStatus bus_deferred_message_get_status (BusDeferredMessage *deferred_message); + ++ ++dbus_bool_t bus_deferred_message_expect_method_reply (BusDeferredMessage *deferred_message, ++ BusTransaction *transaction, ++ DBusError *error); ++void bus_deferred_message_create_error (BusDeferredMessage *deferred_message, ++ const char *error_message, ++ DBusError *error); ++void bus_deferred_message_set_policy_check_info (BusDeferredMessage *deferred_message, ++ dbus_bool_t requested_reply, ++ int matched_rules, ++ const char *privilege); ++dbus_bool_t bus_deferred_message_check_message_limits (BusDeferredMessage *deferred_message, ++ DBusError *error); ++ ++ + #ifdef DBUS_ENABLE_EMBEDDED_TESTS + extern BusResult (*bus_check_test_override) (DBusConnection *connection, + const char *privilege); +diff --git a/bus/connection.c b/bus/connection.c +index b348d42..ee93384 100644 +--- a/bus/connection.c ++++ b/bus/connection.c +@@ -31,11 +31,13 @@ + #include "expirelist.h" + #include "selinux.h" + #include "apparmor.h" ++#include "check.h" + #include + #include + #include + #include + #include ++#include + #ifdef DBUS_ENABLE_CYNARA + #include + #include +@@ -102,6 +104,7 @@ typedef struct + DBusMessage *oom_message; + DBusPreallocatedSend *oom_preallocated; + BusClientPolicy *policy; ++ DBusList *deferred_messages; /**< Queue of messages deferred due to pending policy check */ + + char *cached_loginfo_string; + BusSELinuxID *selinux_id; +@@ -268,6 +271,8 @@ bus_connection_disconnected (DBusConnection *connection) + bus_transaction_execute_and_free (transaction); + } + ++ bus_connection_clear_deferred_messages(connection); ++ + bus_dispatch_remove_connection (connection); + + /* no more watching */ +@@ -2307,7 +2312,7 @@ bus_transaction_capture (BusTransaction *transaction, + { + DBusConnection *recipient = link->data; + +- if (!bus_transaction_send (transaction, recipient, message)) ++ if (!bus_transaction_send (transaction, recipient, message, FALSE)) + goto out; + } + +@@ -2361,6 +2366,7 @@ bus_transaction_send_from_driver (BusTransaction *transaction, + { + DBusError error = DBUS_ERROR_INIT; + BusResult res; ++ BusDeferredMessage *deferred_message; + + /* We have to set the sender to the driver, and have + * to check security policy since it was not done in +@@ -2401,7 +2407,7 @@ bus_transaction_send_from_driver (BusTransaction *transaction, + res = bus_context_check_security_policy (bus_transaction_get_context (transaction), + transaction, + NULL, connection, connection, message, NULL, +- &error, NULL); ++ &error, &deferred_message); + if (res == BUS_RESULT_FALSE) + { + if (!bus_transaction_capture_error_reply (transaction, connection, +@@ -2419,18 +2425,20 @@ bus_transaction_send_from_driver (BusTransaction *transaction, + } + else if (res == BUS_RESULT_LATER) + { +- _dbus_verbose ("Cannot delay sending message from bus driver, dropping it\n"); + dbus_error_free (&error); +- return TRUE; ++ if (!bus_deferred_message_queue_at_recipient(deferred_message, transaction, FALSE, FALSE)) ++ return FALSE; ++ return TRUE; /* pretend to have sent it */ + } + +- return bus_transaction_send (transaction, connection, message); ++ return bus_transaction_send (transaction, connection, message, FALSE); + } + + dbus_bool_t + bus_transaction_send (BusTransaction *transaction, + DBusConnection *connection, +- DBusMessage *message) ++ DBusMessage *message, ++ dbus_bool_t deferred_dispatch) + { + MessageToSend *to_send; + BusConnectionData *d; +@@ -2456,7 +2464,28 @@ bus_transaction_send (BusTransaction *transaction, + + d = BUS_CONNECTION_DATA (connection); + _dbus_assert (d != NULL); +- ++ ++ if (!deferred_dispatch && d->deferred_messages != NULL) ++ { ++ BusDeferredMessage *deferred_message; ++ dbus_bool_t success; ++ /* sender and addressed recipient are not required at this point as we only need to send message ++ * to a single recipient without performing policy check. */ ++ deferred_message = bus_deferred_message_new (message, ++ NULL, ++ NULL, ++ connection, ++ BUS_RESULT_TRUE); ++ if (deferred_message == NULL) ++ return FALSE; ++ ++ success = bus_deferred_message_queue_at_recipient(deferred_message, transaction, ++ FALSE, FALSE); ++ bus_deferred_message_unref(deferred_message); ++ ++ return success; ++ } ++ + to_send = dbus_new (MessageToSend, 1); + if (to_send == NULL) + { +@@ -2708,6 +2737,131 @@ bus_transaction_add_cancel_hook (BusTransaction *transaction, + return TRUE; + } + ++void ++bus_connection_dispatch_deferred (DBusConnection *connection) ++{ ++ BusDeferredMessage *message; ++ ++ _dbus_return_if_fail (connection != NULL); ++ ++ while ((message = bus_connection_pop_deferred_message(connection)) != NULL) ++ { ++ bus_deferred_message_dispatch(message); ++ bus_deferred_message_unref(message); ++ } ++} ++ ++dbus_bool_t ++bus_connection_has_deferred_messages (DBusConnection *connection) ++{ ++ BusConnectionData *d = BUS_CONNECTION_DATA(connection); ++ return d->deferred_messages != NULL ? TRUE : FALSE; ++} ++ ++dbus_bool_t ++bus_connection_queue_deferred_message (DBusConnection *connection, ++ BusDeferredMessage *message, ++ dbus_bool_t prepend) ++{ ++ BusConnectionData *d = BUS_CONNECTION_DATA(connection); ++ dbus_bool_t success; ++ if (prepend) ++ success = _dbus_list_prepend(&d->deferred_messages, message); ++ else ++ success = _dbus_list_append(&d->deferred_messages, message); ++ ++ if (success) ++ { ++ bus_deferred_message_ref(message); ++ return TRUE; ++ } ++ ++ return FALSE; ++} ++ ++dbus_bool_t ++bus_connection_replace_deferred_message (DBusConnection *connection, ++ BusDeferredMessage *oldMessage, ++ BusDeferredMessage *newMessage) ++{ ++ DBusList *link; ++ BusConnectionData *d = BUS_CONNECTION_DATA(connection); ++ ++ link = _dbus_list_find_first(&d->deferred_messages, oldMessage); ++ if (link == NULL) ++ return FALSE; ++ ++ if (!_dbus_list_insert_after(&d->deferred_messages, link, newMessage)) ++ return FALSE; ++ ++ bus_deferred_message_ref(newMessage); ++ _dbus_list_remove_link(&d->deferred_messages, link); ++ bus_deferred_message_unref(oldMessage); ++ return TRUE; ++} ++ ++BusDeferredMessage * ++bus_connection_pop_deferred_message (DBusConnection *connection) ++{ ++ DBusList *link; ++ BusDeferredMessage *message; ++ BusConnectionData *d = BUS_CONNECTION_DATA(connection); ++ ++ link =_dbus_list_get_first_link(&d->deferred_messages); ++ if (link != NULL) ++ { ++ message = link->data; ++ if (!bus_deferred_message_waits_for_check(message)) ++ { ++ _dbus_list_remove_link(&d->deferred_messages, link); ++ return message; ++ } ++ } ++ ++ return NULL; ++} ++ ++dbus_bool_t ++bus_connection_putback_deferred_message (DBusConnection *connection, BusDeferredMessage *message) ++{ ++ BusConnectionData *d = BUS_CONNECTION_DATA(connection); ++ if (_dbus_list_prepend(&d->deferred_messages, message)) ++ { ++ return TRUE; ++ } ++ return FALSE; ++} ++ ++void ++bus_connection_clear_deferred_messages (DBusConnection *connection) ++{ ++ BusConnectionData *d = BUS_CONNECTION_DATA(connection); ++ DBusList *link; ++ DBusList *next; ++ BusDeferredMessage *message; ++ ++ link =_dbus_list_get_first_link(&d->deferred_messages); ++ while (link != NULL) ++ { ++ next = _dbus_list_get_next_link (&d->deferred_messages, link); ++ message = link->data; ++ ++ bus_deferred_message_unref(message); ++ _dbus_list_remove_link(&d->deferred_messages, link); ++ ++ link = next; ++ } ++} ++ ++void ++bus_connection_remove_deferred_message (DBusConnection *connection, ++ BusDeferredMessage *message) ++{ ++ BusConnectionData *d = BUS_CONNECTION_DATA(connection); ++ if (_dbus_list_remove(&d->deferred_messages, message)) ++ bus_deferred_message_unref(message); ++} ++ + int + bus_connections_get_n_active (BusConnections *connections) + { +diff --git a/bus/connection.h b/bus/connection.h +index 71078ea..97dae96 100644 +--- a/bus/connection.h ++++ b/bus/connection.h +@@ -85,6 +85,22 @@ dbus_bool_t bus_connection_preallocate_oom_error (DBusConnection *connection); + void bus_connection_send_oom_error (DBusConnection *connection, + DBusMessage *in_reply_to); + ++dbus_bool_t bus_connection_has_deferred_messages (DBusConnection *connection); ++dbus_bool_t bus_connection_queue_deferred_message (DBusConnection *connection, ++ BusDeferredMessage *message, ++ dbus_bool_t prepend); ++BusDeferredMessage *bus_connection_pop_deferred_message (DBusConnection *connection); ++dbus_bool_t bus_connection_putback_deferred_message (DBusConnection *connection, ++ BusDeferredMessage *message); ++void bus_connection_remove_deferred_message (DBusConnection *connection, ++ BusDeferredMessage *message); ++dbus_bool_t bus_connection_replace_deferred_message (DBusConnection *connection, ++ BusDeferredMessage *oldMessage, ++ BusDeferredMessage *newMessage); ++void bus_connection_dispatch_deferred (DBusConnection *connection); ++void bus_connection_clear_deferred_messages (DBusConnection *connection); ++ ++ + /* called by signals.c */ + dbus_bool_t bus_connection_add_match_rule (DBusConnection *connection, + BusMatchRule *rule); +@@ -137,7 +153,8 @@ BusTransaction* bus_transaction_new (BusContext * + BusContext* bus_transaction_get_context (BusTransaction *transaction); + dbus_bool_t bus_transaction_send (BusTransaction *transaction, + DBusConnection *connection, +- DBusMessage *message); ++ DBusMessage *message, ++ dbus_bool_t deferred_dispatch); + dbus_bool_t bus_transaction_capture (BusTransaction *transaction, + DBusConnection *connection, + DBusConnection *addressed_recipient, +diff --git a/bus/dispatch.c b/bus/dispatch.c +index 50a22a3..7d30ce4 100644 +--- a/bus/dispatch.c ++++ b/bus/dispatch.c +@@ -33,6 +33,7 @@ + #include "utils.h" + #include "bus.h" + #include "signals.h" ++#include "dispatch.h" + #include "test.h" + #include + #include +@@ -77,7 +78,7 @@ send_one_message (DBusConnection *connection, + NULL, + &stack_error, + &deferred_message); +- if (result != BUS_RESULT_TRUE) ++ if (result == BUS_RESULT_FALSE) + { + if (!bus_transaction_capture_error_reply (transaction, sender, + &stack_error, message)) +@@ -112,9 +113,19 @@ send_one_message (DBusConnection *connection, + return TRUE; /* don't send it but don't return an error either */ + } + ++ if (result == BUS_RESULT_LATER) ++ { ++ if (!bus_deferred_message_queue_at_recipient(deferred_message, transaction, FALSE, FALSE)) ++ { ++ BUS_SET_OOM (error); ++ return FALSE; ++ } ++ return TRUE; /* pretend to have sent it */ ++ } ++ + if (!bus_transaction_send (transaction, + connection, +- message)) ++ message, FALSE)) + { + BUS_SET_OOM (error); + return FALSE; +@@ -124,11 +135,12 @@ send_one_message (DBusConnection *connection, + } + + BusResult +-bus_dispatch_matches (BusTransaction *transaction, +- DBusConnection *sender, +- DBusConnection *addressed_recipient, +- DBusMessage *message, +- DBusError *error) ++bus_dispatch_matches (BusTransaction *transaction, ++ DBusConnection *sender, ++ DBusConnection *addressed_recipient, ++ DBusMessage *message, ++ BusDeferredMessage *dispatched_deferred_message, ++ DBusError *error) + { + DBusError tmp_error; + BusConnections *connections; +@@ -137,7 +149,6 @@ bus_dispatch_matches (BusTransaction *transaction, + DBusList *link; + BusContext *context; + BusDeferredMessage *deferred_message; +- BusResult res; + + _DBUS_ASSERT_ERROR_IS_CLEAR (error); + +@@ -153,16 +164,80 @@ bus_dispatch_matches (BusTransaction *transaction, + /* First, send the message to the addressed_recipient, if there is one. */ + if (addressed_recipient != NULL) + { +- res = bus_context_check_security_policy (context, transaction, ++ BusResult result; ++ /* To maintain message order message needs to be appended at the recipient if there are already ++ * deferred messages and we are not doing deferred dispatch ++ */ ++ if (dispatched_deferred_message == NULL && bus_connection_has_deferred_messages(addressed_recipient)) ++ { ++ deferred_message = bus_deferred_message_new(message, sender, ++ addressed_recipient, addressed_recipient, BUS_RESULT_LATER); ++ ++ if (deferred_message == NULL) ++ { ++ BUS_SET_OOM(error); ++ return BUS_RESULT_FALSE; ++ } ++ ++ if (!bus_deferred_message_queue_at_recipient(deferred_message, transaction, TRUE, FALSE)) ++ { ++ bus_deferred_message_unref(deferred_message); ++ BUS_SET_OOM(error); ++ return BUS_RESULT_FALSE; ++ } ++ ++ bus_deferred_message_unref(deferred_message); ++ return BUS_RESULT_TRUE; /* pretend to have sent it */ ++ } ++ ++ if (dispatched_deferred_message != NULL) ++ { ++ result = bus_deferred_message_get_response(dispatched_deferred_message); ++ if (result == BUS_RESULT_TRUE) ++ { ++ /* if we know the result of policy check we still need to check if message limits ++ * are not exceeded. It is also required to add entry in expected replies list if ++ * this is a method call ++ */ ++ if (!bus_deferred_message_check_message_limits(dispatched_deferred_message, error)) ++ return BUS_RESULT_FALSE; ++ ++ if (!bus_deferred_message_expect_method_reply(dispatched_deferred_message, transaction, error)) ++ return BUS_RESULT_FALSE; ++ } ++ else if (result == BUS_RESULT_FALSE) ++ { ++ bus_deferred_message_create_error(dispatched_deferred_message, "Rejected message", error); ++ return BUS_RESULT_FALSE; ++ } ++ } ++ else ++ result = BUS_RESULT_LATER; ++ ++ if (result == BUS_RESULT_LATER) ++ result = bus_context_check_security_policy (context, transaction, + sender, addressed_recipient, + addressed_recipient, + message, NULL, error, + &deferred_message); +- if (res == BUS_RESULT_FALSE) ++ ++ if (result == BUS_RESULT_FALSE) + return BUS_RESULT_FALSE; +- else if (res == BUS_RESULT_LATER) ++ else if (result == BUS_RESULT_LATER) + { + BusDeferredMessageStatus status; ++ ++ if (dispatched_deferred_message != NULL) ++ { ++ /* for deferred dispatch prepend message at the recipient */ ++ if (!bus_deferred_message_queue_at_recipient(deferred_message, transaction, TRUE, TRUE)) ++ { ++ BUS_SET_OOM(error); ++ return BUS_RESULT_FALSE; ++ } ++ return BUS_RESULT_TRUE; /* pretend to have sent it */ ++ } ++ + status = bus_deferred_message_get_status(deferred_message); + + if (status & BUS_DEFERRED_MESSAGE_CHECK_SEND) +@@ -173,13 +248,18 @@ bus_dispatch_matches (BusTransaction *transaction, + } + else if (status & BUS_DEFERRED_MESSAGE_CHECK_RECEIVE) + { +- dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, +- "Rejecting message because time is needed to check security policy"); +- return BUS_RESULT_FALSE; ++ /* receive rule result not available - queue message at the recipient */ ++ if (!bus_deferred_message_queue_at_recipient(deferred_message, transaction, TRUE, FALSE)) ++ { ++ BUS_SET_OOM(error); ++ return BUS_RESULT_FALSE; ++ } ++ ++ return BUS_RESULT_TRUE; /* pretend to have sent it */ + } + else + { +- _dbus_verbose("deferred message has no status field set to send or receive unexpectedly\n"); ++ _dbus_verbose("deferred message has no status field set unexpectedly\n"); + return BUS_RESULT_FALSE; + } + } +@@ -196,7 +276,8 @@ bus_dispatch_matches (BusTransaction *transaction, + } + + /* Dispatch the message */ +- if (!bus_transaction_send (transaction, addressed_recipient, message)) ++ if (!bus_transaction_send(transaction, addressed_recipient, message, ++ dispatched_deferred_message != NULL ? TRUE : FALSE)) + { + BUS_SET_OOM (error); + return BUS_RESULT_FALSE; +@@ -534,7 +615,7 @@ bus_dispatch (DBusConnection *connection, + * match rules. + */ + if (BUS_RESULT_LATER == bus_dispatch_matches (transaction, connection, addressed_recipient, +- message, &error)) ++ message, NULL, &error)) + { + /* Roll back and dispatch the message once the policy result is available */ + bus_transaction_cancel_and_free (transaction); +diff --git a/bus/dispatch.h b/bus/dispatch.h +index afba6a2..f6102e8 100644 +--- a/bus/dispatch.h ++++ b/bus/dispatch.h +@@ -29,10 +29,11 @@ + + dbus_bool_t bus_dispatch_add_connection (DBusConnection *connection); + void bus_dispatch_remove_connection (DBusConnection *connection); +-BusResult bus_dispatch_matches (BusTransaction *transaction, +- DBusConnection *sender, +- DBusConnection *recipient, +- DBusMessage *message, +- DBusError *error); ++BusResult bus_dispatch_matches (BusTransaction *transaction, ++ DBusConnection *sender, ++ DBusConnection *recipient, ++ DBusMessage *message, ++ BusDeferredMessage *dispatched_deferred_message, ++ DBusError *error); + + #endif /* BUS_DISPATCH_H */ +diff --git a/bus/driver.c b/bus/driver.c +index f414f64..d89a658 100644 +--- a/bus/driver.c ++++ b/bus/driver.c +@@ -254,7 +254,7 @@ bus_driver_send_service_owner_changed (const char *service_name, + if (!bus_transaction_capture (transaction, NULL, NULL, message)) + goto oom; + +- res = bus_dispatch_matches (transaction, NULL, NULL, message, error); ++ res = bus_dispatch_matches (transaction, NULL, NULL, message, NULL, error); + if (res == BUS_RESULT_TRUE) + retval = TRUE; + else +diff --git a/bus/policy.c b/bus/policy.c +index 7de92c6..483cc97 100644 +--- a/bus/policy.c ++++ b/bus/policy.c +@@ -1122,6 +1122,9 @@ bus_client_policy_check_can_send (DBusConnection *sender, + + result = bus_check_privilege(check, message, sender, addressed_recipient, receiver, + privilege, BUS_DEFERRED_MESSAGE_CHECK_SEND, deferred_message); ++ if (result == BUS_RESULT_LATER && deferred_message != NULL) ++ bus_deferred_message_set_policy_check_info(*deferred_message, requested_reply, ++ *toggles, privilege); + } + else + privilege = NULL; +@@ -1372,6 +1375,9 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, + + result = bus_check_privilege(check, message, sender, addressed_recipient, proposed_recipient, + privilege, BUS_DEFERRED_MESSAGE_CHECK_RECEIVE, deferred_message); ++ if (result == BUS_RESULT_LATER && deferred_message != NULL) ++ bus_deferred_message_set_policy_check_info(*deferred_message, requested_reply, ++ *toggles, privilege); + } + else + privilege = NULL; +-- +2.21.1 + diff --git a/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0004-Add-own-rule-result-unavailability-handling.patch b/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0004-Add-own-rule-result-unavailability-handling.patch new file mode 100644 index 00000000..9953dcaa --- /dev/null +++ b/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0004-Add-own-rule-result-unavailability-handling.patch @@ -0,0 +1,1505 @@ +From 28ada62c98d74285dc22b66650b09b6c8f2c28c4 Mon Sep 17 00:00:00 2001 +From: Jacek Bukarewicz +Date: Thu, 27 Nov 2014 11:26:21 +0100 +Subject: [PATCH 4/8] Add own rule result unavailability handling +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Own rule result unavailability is handled like send rules - dispatching +messages from the sender is blocked and resumed when result becomes +available. + +Handler of "RequestName" method needs to return BUS_RESULT_LATER when +policy result is not known therefore its return type is modified. +Since bus message handlers are put into function pointer array other +message handler function singatures are also affected. + +Cherry-picked from 35ef89cd6777ea2430077fc621d21bd01df92349 by Jose.bollo + +Updated for dbus 1.10.20 by Scott Murray and José Bollo + +Signed-off-by: José Bollo +Signed-off-by: Scott Murray +--- + bus/dispatch.c | 11 +- + bus/driver.c | 334 ++++++++++++++++++++++++++++--------------------- + bus/driver.h | 2 +- + bus/policy.c | 52 ++++++-- + bus/policy.h | 6 +- + bus/services.c | 26 ++-- + bus/services.h | 3 +- + bus/stats.c | 23 ++-- + bus/stats.h | 6 +- + 9 files changed, 283 insertions(+), 180 deletions(-) + +diff --git a/bus/dispatch.c b/bus/dispatch.c +index 7d30ce4..4b84c21 100644 +--- a/bus/dispatch.c ++++ b/bus/dispatch.c +@@ -517,8 +517,17 @@ bus_dispatch (DBusConnection *connection, + } + + _dbus_verbose ("Giving message to %s\n", DBUS_SERVICE_DBUS); +- if (!bus_driver_handle_message (connection, transaction, message, &error)) ++ res = bus_driver_handle_message (connection, transaction, message, &error); ++ if (res == BUS_RESULT_FALSE) + goto out; ++ else if (res == BUS_RESULT_LATER) ++ { ++ /* connection has been disabled in message handler */ ++ bus_transaction_cancel_and_free (transaction); ++ transaction = NULL; ++ result = DBUS_HANDLER_RESULT_LATER; ++ goto out; ++ } + } + else if (!bus_connection_is_active (connection)) /* clients must talk to bus driver first */ + { +diff --git a/bus/driver.c b/bus/driver.c +index d89a658..aaeb3b2 100644 +--- a/bus/driver.c ++++ b/bus/driver.c +@@ -420,7 +420,7 @@ create_unique_client_name (BusRegistry *registry, + return TRUE; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_hello (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -428,7 +428,7 @@ bus_driver_handle_hello (DBusConnection *connection, + { + DBusString unique_name; + BusService *service; +- dbus_bool_t retval; ++ BusResult retval; + BusRegistry *registry; + BusConnections *connections; + DBusError tmp_error; +@@ -442,7 +442,7 @@ bus_driver_handle_hello (DBusConnection *connection, + /* We already handled an Hello message for this connection. */ + dbus_set_error (error, DBUS_ERROR_FAILED, + "Already handled an Hello message"); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + /* Note that when these limits are exceeded we don't disconnect the +@@ -464,16 +464,16 @@ bus_driver_handle_hello (DBusConnection *connection, + bus_context_log (context, DBUS_SYSTEM_LOG_WARNING, "%s (%s=%d)", + tmp_error.message, limit_name, limit); + dbus_move_error (&tmp_error, error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + if (!_dbus_string_init (&unique_name)) + { + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + +- retval = FALSE; ++ retval = BUS_RESULT_FALSE; + + registry = bus_connection_get_registry (connection); + +@@ -506,7 +506,7 @@ bus_driver_handle_hello (DBusConnection *connection, + goto out_0; + + _dbus_assert (bus_connection_is_active (connection)); +- retval = TRUE; ++ retval = BUS_RESULT_TRUE; + + out_0: + _dbus_string_free (&unique_name); +@@ -558,7 +558,7 @@ bus_driver_send_welcome_message (DBusConnection *connection, + } + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_list_services (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -580,14 +580,14 @@ bus_driver_handle_list_services (DBusConnection *connection, + if (reply == NULL) + { + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + if (!bus_registry_list_services (registry, &services, &len)) + { + dbus_message_unref (reply); + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + dbus_message_iter_init_append (reply, &iter); +@@ -599,7 +599,7 @@ bus_driver_handle_list_services (DBusConnection *connection, + dbus_free_string_array (services); + dbus_message_unref (reply); + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + { +@@ -611,7 +611,7 @@ bus_driver_handle_list_services (DBusConnection *connection, + dbus_free_string_array (services); + dbus_message_unref (reply); + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + } + +@@ -624,7 +624,7 @@ bus_driver_handle_list_services (DBusConnection *connection, + dbus_free_string_array (services); + dbus_message_unref (reply); + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + ++i; + } +@@ -635,23 +635,23 @@ bus_driver_handle_list_services (DBusConnection *connection, + { + dbus_message_unref (reply); + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + if (!bus_transaction_send_from_driver (transaction, connection, reply)) + { + dbus_message_unref (reply); + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + else + { + dbus_message_unref (reply); +- return TRUE; ++ return BUS_RESULT_TRUE; + } + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_list_activatable_services (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -673,14 +673,14 @@ bus_driver_handle_list_activatable_services (DBusConnection *connection, + if (reply == NULL) + { + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + if (!bus_activation_list_services (activation, &services, &len)) + { + dbus_message_unref (reply); + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + dbus_message_iter_init_append (reply, &iter); +@@ -692,7 +692,7 @@ bus_driver_handle_list_activatable_services (DBusConnection *connection, + dbus_free_string_array (services); + dbus_message_unref (reply); + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + { +@@ -704,7 +704,7 @@ bus_driver_handle_list_activatable_services (DBusConnection *connection, + dbus_free_string_array (services); + dbus_message_unref (reply); + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + } + +@@ -717,7 +717,7 @@ bus_driver_handle_list_activatable_services (DBusConnection *connection, + dbus_free_string_array (services); + dbus_message_unref (reply); + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + ++i; + } +@@ -728,23 +728,23 @@ bus_driver_handle_list_activatable_services (DBusConnection *connection, + { + dbus_message_unref (reply); + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + if (!bus_transaction_send_from_driver (transaction, connection, reply)) + { + dbus_message_unref (reply); + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + else + { + dbus_message_unref (reply); +- return TRUE; ++ return BUS_RESULT_TRUE; + } + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_acquire_service (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -755,7 +755,8 @@ bus_driver_handle_acquire_service (DBusConnection *connection, + const char *name; + dbus_uint32_t service_reply; + dbus_uint32_t flags; +- dbus_bool_t retval; ++ BusResult retval; ++ BusResult res; + BusRegistry *registry; + + _DBUS_ASSERT_ERROR_IS_CLEAR (error); +@@ -766,20 +767,24 @@ bus_driver_handle_acquire_service (DBusConnection *connection, + DBUS_TYPE_STRING, &name, + DBUS_TYPE_UINT32, &flags, + DBUS_TYPE_INVALID)) +- return FALSE; ++ return BUS_RESULT_FALSE; + + _dbus_verbose ("Trying to own name %s with flags 0x%x\n", name, flags); + +- retval = FALSE; ++ retval = BUS_RESULT_FALSE; + reply = NULL; + + _dbus_string_init_const (&service_name, name); + +- if (!bus_registry_acquire_service (registry, connection, +- &service_name, flags, +- &service_reply, transaction, +- error)) +- goto out; ++ res = bus_registry_acquire_service (registry, connection, message, ++ &service_name, flags, ++ &service_reply, transaction, ++ error); ++ if (res != BUS_RESULT_TRUE) ++ { ++ retval = res; ++ goto out; ++ } + + reply = dbus_message_new_method_return (message); + if (reply == NULL) +@@ -800,7 +805,7 @@ bus_driver_handle_acquire_service (DBusConnection *connection, + goto out; + } + +- retval = TRUE; ++ retval = BUS_RESULT_TRUE; + + out: + if (reply) +@@ -808,7 +813,7 @@ bus_driver_handle_acquire_service (DBusConnection *connection, + return retval; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_release_service (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -818,7 +823,7 @@ bus_driver_handle_release_service (DBusConnection *connection, + DBusString service_name; + const char *name; + dbus_uint32_t service_reply; +- dbus_bool_t retval; ++ BusResult retval; + BusRegistry *registry; + + _DBUS_ASSERT_ERROR_IS_CLEAR (error); +@@ -828,11 +833,11 @@ bus_driver_handle_release_service (DBusConnection *connection, + if (!dbus_message_get_args (message, error, + DBUS_TYPE_STRING, &name, + DBUS_TYPE_INVALID)) +- return FALSE; ++ return BUS_RESULT_FALSE; + + _dbus_verbose ("Trying to release name %s\n", name); + +- retval = FALSE; ++ retval = BUS_RESULT_FALSE; + reply = NULL; + + _dbus_string_init_const (&service_name, name); +@@ -861,7 +866,7 @@ bus_driver_handle_release_service (DBusConnection *connection, + goto out; + } + +- retval = TRUE; ++ retval = BUS_RESULT_TRUE; + + out: + if (reply) +@@ -869,7 +874,7 @@ bus_driver_handle_release_service (DBusConnection *connection, + return retval; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_service_exists (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -880,7 +885,7 @@ bus_driver_handle_service_exists (DBusConnection *connection, + BusService *service; + dbus_bool_t service_exists; + const char *name; +- dbus_bool_t retval; ++ BusResult retval; + BusRegistry *registry; + + _DBUS_ASSERT_ERROR_IS_CLEAR (error); +@@ -890,9 +895,9 @@ bus_driver_handle_service_exists (DBusConnection *connection, + if (!dbus_message_get_args (message, error, + DBUS_TYPE_STRING, &name, + DBUS_TYPE_INVALID)) +- return FALSE; ++ return BUS_RESULT_FALSE; + +- retval = FALSE; ++ retval = BUS_RESULT_FALSE; + + if (strcmp (name, DBUS_SERVICE_DBUS) == 0) + { +@@ -926,7 +931,7 @@ bus_driver_handle_service_exists (DBusConnection *connection, + goto out; + } + +- retval = TRUE; ++ retval = BUS_RESULT_TRUE; + + out: + if (reply) +@@ -935,7 +940,7 @@ bus_driver_handle_service_exists (DBusConnection *connection, + return retval; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_activate_service (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -943,7 +948,7 @@ bus_driver_handle_activate_service (DBusConnection *connection, + { + dbus_uint32_t flags; + const char *name; +- dbus_bool_t retval; ++ BusResult retval; + BusActivation *activation; + + _DBUS_ASSERT_ERROR_IS_CLEAR (error); +@@ -957,10 +962,10 @@ bus_driver_handle_activate_service (DBusConnection *connection, + { + _DBUS_ASSERT_ERROR_IS_SET (error); + _dbus_verbose ("No memory to get arguments to StartServiceByName\n"); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + +- retval = FALSE; ++ retval = BUS_RESULT_FALSE; + + if (!bus_activation_activate_service (activation, connection, transaction, FALSE, + message, name, error)) +@@ -970,7 +975,7 @@ bus_driver_handle_activate_service (DBusConnection *connection, + goto out; + } + +- retval = TRUE; ++ retval = BUS_RESULT_TRUE; + + out: + return retval; +@@ -1072,13 +1077,13 @@ bus_driver_send_or_activate (BusTransaction *transaction, + return TRUE; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_update_activation_environment (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, + DBusError *error) + { +- dbus_bool_t retval; ++ BusResult retval; + BusActivation *activation; + BusContext *context; + DBusMessageIter iter; +@@ -1100,7 +1105,7 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection, + dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, + "Cannot change activation environment " + "on a system bus."); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + activation = bus_connection_get_activation (connection); +@@ -1114,7 +1119,7 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection, + + dbus_message_iter_recurse (&iter, &dict_iter); + +- retval = FALSE; ++ retval = BUS_RESULT_FALSE; + systemd_message = NULL; + + /* Then loop through the sent dictionary, add the location of +@@ -1279,7 +1284,7 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection, + if (!bus_driver_send_ack_reply (connection, transaction, message, error)) + goto out; + +- retval = TRUE; ++ retval = BUS_RESULT_TRUE; + + out: + if (systemd_message != NULL) +@@ -1289,7 +1294,7 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection, + return retval; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_add_match (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -1371,16 +1376,16 @@ bus_driver_handle_add_match (DBusConnection *connection, + + bus_match_rule_unref (rule); + +- return TRUE; ++ return BUS_RESULT_TRUE; + + failed: + _DBUS_ASSERT_ERROR_IS_SET (error); + if (rule) + bus_match_rule_unref (rule); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_remove_match (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -1423,16 +1428,16 @@ bus_driver_handle_remove_match (DBusConnection *connection, + + bus_match_rule_unref (rule); + +- return TRUE; ++ return BUS_RESULT_TRUE; + + failed: + _DBUS_ASSERT_ERROR_IS_SET (error); + if (rule) + bus_match_rule_unref (rule); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_get_service_owner (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -1502,7 +1507,7 @@ bus_driver_handle_get_service_owner (DBusConnection *connection, + + dbus_message_unref (reply); + +- return TRUE; ++ return BUS_RESULT_TRUE; + + oom: + BUS_SET_OOM (error); +@@ -1511,10 +1516,10 @@ bus_driver_handle_get_service_owner (DBusConnection *connection, + _DBUS_ASSERT_ERROR_IS_SET (error); + if (reply) + dbus_message_unref (reply); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_list_queued_owners (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -1606,7 +1611,7 @@ bus_driver_handle_list_queued_owners (DBusConnection *connection, + + dbus_message_unref (reply); + +- return TRUE; ++ return BUS_RESULT_TRUE; + + oom: + BUS_SET_OOM (error); +@@ -1619,10 +1624,10 @@ bus_driver_handle_list_queued_owners (DBusConnection *connection, + if (base_names) + _dbus_list_clear (&base_names); + +- return FALSE; ++ return BUS_RESULT_FALSE; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_get_connection_unix_user (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -1679,7 +1684,7 @@ bus_driver_handle_get_connection_unix_user (DBusConnection *connection, + + dbus_message_unref (reply); + +- return TRUE; ++ return BUS_RESULT_TRUE; + + oom: + BUS_SET_OOM (error); +@@ -1688,10 +1693,10 @@ bus_driver_handle_get_connection_unix_user (DBusConnection *connection, + _DBUS_ASSERT_ERROR_IS_SET (error); + if (reply) + dbus_message_unref (reply); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_get_connection_unix_process_id (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -1748,7 +1753,7 @@ bus_driver_handle_get_connection_unix_process_id (DBusConnection *connection, + + dbus_message_unref (reply); + +- return TRUE; ++ return BUS_RESULT_TRUE; + + oom: + BUS_SET_OOM (error); +@@ -1757,10 +1762,10 @@ bus_driver_handle_get_connection_unix_process_id (DBusConnection *connection, + _DBUS_ASSERT_ERROR_IS_SET (error); + if (reply) + dbus_message_unref (reply); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_get_adt_audit_session_data (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -1811,7 +1816,7 @@ bus_driver_handle_get_adt_audit_session_data (DBusConnection *connection, + + dbus_message_unref (reply); + +- return TRUE; ++ return BUS_RESULT_TRUE; + + oom: + BUS_SET_OOM (error); +@@ -1820,10 +1825,10 @@ bus_driver_handle_get_adt_audit_session_data (DBusConnection *connection, + _DBUS_ASSERT_ERROR_IS_SET (error); + if (reply) + dbus_message_unref (reply); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_get_connection_selinux_security_context (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -1872,7 +1877,7 @@ bus_driver_handle_get_connection_selinux_security_context (DBusConnection *conne + + dbus_message_unref (reply); + +- return TRUE; ++ return BUS_RESULT_TRUE; + + oom: + BUS_SET_OOM (error); +@@ -1881,10 +1886,10 @@ bus_driver_handle_get_connection_selinux_security_context (DBusConnection *conne + _DBUS_ASSERT_ERROR_IS_SET (error); + if (reply) + dbus_message_unref (reply); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_get_connection_credentials (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -1998,7 +2003,7 @@ bus_driver_handle_get_connection_credentials (DBusConnection *connection, + + dbus_message_unref (reply); + +- return TRUE; ++ return BUS_RESULT_TRUE; + + oom: + BUS_SET_OOM (error); +@@ -2012,10 +2017,10 @@ bus_driver_handle_get_connection_credentials (DBusConnection *connection, + dbus_message_unref (reply); + } + +- return FALSE; ++ return BUS_RESULT_FALSE; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_reload_config (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -2040,7 +2045,7 @@ bus_driver_handle_reload_config (DBusConnection *connection, + goto oom; + + dbus_message_unref (reply); +- return TRUE; ++ return BUS_RESULT_TRUE; + + oom: + BUS_SET_OOM (error); +@@ -2049,11 +2054,11 @@ bus_driver_handle_reload_config (DBusConnection *connection, + _DBUS_ASSERT_ERROR_IS_SET (error); + if (reply) + dbus_message_unref (reply); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + #ifdef DBUS_ENABLE_VERBOSE_MODE +-static dbus_bool_t ++static BusResult + bus_driver_handle_enable_verbose (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -2073,7 +2078,7 @@ bus_driver_handle_enable_verbose (DBusConnection *connection, + _dbus_set_verbose(TRUE); + + dbus_message_unref (reply); +- return TRUE; ++ return BUS_RESULT_TRUE; + + oom: + _DBUS_ASSERT_ERROR_IS_CLEAR (error); +@@ -2082,10 +2087,10 @@ bus_driver_handle_enable_verbose (DBusConnection *connection, + + if (reply) + dbus_message_unref (reply); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_disable_verbose (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -2105,7 +2110,7 @@ bus_driver_handle_disable_verbose (DBusConnection *connection, + _dbus_set_verbose(FALSE); + + dbus_message_unref (reply); +- return TRUE; ++ return BUS_RESULT_TRUE; + + oom: + _DBUS_ASSERT_ERROR_IS_CLEAR (error); +@@ -2114,11 +2119,11 @@ bus_driver_handle_disable_verbose (DBusConnection *connection, + + if (reply) + dbus_message_unref (reply); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + #endif + +-static dbus_bool_t ++static BusResult + bus_driver_handle_get_id (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -2134,7 +2139,7 @@ bus_driver_handle_get_id (DBusConnection *connection, + if (!_dbus_string_init (&uuid)) + { + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + reply = NULL; +@@ -2160,7 +2165,7 @@ bus_driver_handle_get_id (DBusConnection *connection, + + _dbus_string_free (&uuid); + dbus_message_unref (reply); +- return TRUE; ++ return BUS_RESULT_TRUE; + + oom: + _DBUS_ASSERT_ERROR_IS_CLEAR (error); +@@ -2170,10 +2175,10 @@ bus_driver_handle_get_id (DBusConnection *connection, + if (reply) + dbus_message_unref (reply); + _dbus_string_free (&uuid); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_become_monitor (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -2189,7 +2194,7 @@ bus_driver_handle_become_monitor (DBusConnection *connection, + int i; + int n_match_rules; + dbus_uint32_t flags; +- dbus_bool_t ret = FALSE; ++ BusResult ret = BUS_RESULT_FALSE; + + _DBUS_ASSERT_ERROR_IS_CLEAR (error); + +@@ -2262,10 +2267,10 @@ bus_driver_handle_become_monitor (DBusConnection *connection, + if (!bus_connection_be_monitor (connection, transaction, &rules, error)) + goto out; + +- ret = TRUE; ++ ret = BUS_RESULT_TRUE; + + out: +- if (ret) ++ if (ret == BUS_RESULT_TRUE) + _DBUS_ASSERT_ERROR_IS_CLEAR (error); + else + _DBUS_ASSERT_ERROR_IS_SET (error); +@@ -2281,7 +2286,7 @@ out: + return ret; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_get_machine_id (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -2296,7 +2301,7 @@ bus_driver_handle_get_machine_id (DBusConnection *connection, + if (!_dbus_string_init (&uuid)) + { + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + if (!_dbus_get_local_machine_uuid_encoded (&uuid, error)) +@@ -2321,7 +2326,7 @@ bus_driver_handle_get_machine_id (DBusConnection *connection, + + _dbus_string_free (&uuid); + dbus_message_unref (reply); +- return TRUE; ++ return BUS_RESULT_TRUE; + + oom: + _DBUS_ASSERT_ERROR_IS_CLEAR (error); +@@ -2335,29 +2340,30 @@ fail: + dbus_message_unref (reply); + + _dbus_string_free (&uuid); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_ping (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, + DBusError *error) + { +- return bus_driver_send_ack_reply (connection, transaction, message, error); ++ return bus_driver_send_ack_reply (connection, transaction, message, error) == TRUE ++ ? BUS_RESULT_TRUE : BUS_RESULT_FALSE; + } + +-static dbus_bool_t bus_driver_handle_get (DBusConnection *connection, ++static BusResult bus_driver_handle_get (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, + DBusError *error); + +-static dbus_bool_t bus_driver_handle_get_all (DBusConnection *connection, ++static BusResult bus_driver_handle_get_all (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, + DBusError *error); + +-static dbus_bool_t bus_driver_handle_set (DBusConnection *connection, ++static BusResult bus_driver_handle_set (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, + DBusError *error); +@@ -2389,10 +2395,10 @@ typedef struct + const char *name; + const char *in_args; + const char *out_args; +- dbus_bool_t (* handler) (DBusConnection *connection, +- BusTransaction *transaction, +- DBusMessage *message, +- DBusError *error); ++ BusResult (* handler) (DBusConnection *connection, ++ BusTransaction *transaction, ++ DBusMessage *message, ++ DBusError *error); + MethodFlags flags; + } MessageHandler; + +@@ -2511,7 +2517,7 @@ static const PropertyHandler dbus_property_handlers[] = { + { NULL, NULL, NULL } + }; + +-static dbus_bool_t bus_driver_handle_introspect (DBusConnection *, ++static BusResult bus_driver_handle_introspect (DBusConnection *, + BusTransaction *, DBusMessage *, DBusError *); + + static const MessageHandler properties_message_handlers[] = { +@@ -2763,7 +2769,7 @@ bus_driver_generate_introspect_string (DBusString *xml, + return TRUE; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_introspect (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -2784,13 +2790,13 @@ bus_driver_handle_introspect (DBusConnection *connection, + DBUS_TYPE_INVALID)) + { + _DBUS_ASSERT_ERROR_IS_SET (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + if (!_dbus_string_init (&xml)) + { + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + is_canonical_path = dbus_message_has_path (message, DBUS_PATH_DBUS); +@@ -2815,7 +2821,7 @@ bus_driver_handle_introspect (DBusConnection *connection, + dbus_message_unref (reply); + _dbus_string_free (&xml); + +- return TRUE; ++ return BUS_RESULT_TRUE; + + oom: + BUS_SET_OOM (error); +@@ -2825,10 +2831,42 @@ bus_driver_handle_introspect (DBusConnection *connection, + + _dbus_string_free (&xml); + +- return FALSE; ++ return BUS_RESULT_FALSE; + } + ++/* ++ * Set @error and return FALSE if the message is not directed to the ++ * dbus-daemon by its canonical object path. This is hardening against ++ * system services with poorly-written security policy files, which ++ * might allow sending dangerously broad equivalence classes of messages ++ * such as "anything with this assumed-to-be-safe object path". ++ * ++ * dbus-daemon is unusual in that it normally ignores the object path ++ * of incoming messages; we need to keep that behaviour for the "read" ++ * read-only method calls like GetConnectionUnixUser for backwards ++ * compatibility, but it seems safer to be more restrictive for things ++ * intended to be root-only or privileged-developers-only. ++ * ++ * It is possible that there are other system services with the same ++ * quirk as dbus-daemon. ++ */ + dbus_bool_t ++bus_driver_check_message_is_for_us (DBusMessage *message, ++ DBusError *error) ++{ ++ if (!dbus_message_has_path (message, DBUS_PATH_DBUS)) ++ { ++ dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, ++ "Method '%s' is only available at the canonical object path '%s'", ++ dbus_message_get_member (message), DBUS_PATH_DBUS); ++ ++ return FALSE; ++ } ++ ++ return TRUE; ++} ++ ++BusResult + bus_driver_handle_message (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -2839,6 +2877,7 @@ bus_driver_handle_message (DBusConnection *connection, + const MessageHandler *mh; + dbus_bool_t found_interface = FALSE; + dbus_bool_t is_canonical_path; ++ BusResult res; + + _DBUS_ASSERT_ERROR_IS_CLEAR (error); + +@@ -2854,7 +2893,7 @@ bus_driver_handle_message (DBusConnection *connection, + transaction, + message, + error)) +- return FALSE; ++ return BUS_RESULT_FALSE; + + context = bus_connection_get_context (connection); + systemd = bus_driver_get_owner_of_name (connection, +@@ -2871,7 +2910,7 @@ bus_driver_handle_message (DBusConnection *connection, + attacker ? attacker : "(unauthenticated)", + bus_connection_get_loginfo (connection)); + /* ignore it */ +- return TRUE; ++ return BUS_RESULT_TRUE; + } + + if (!bus_context_get_systemd_activation (context)) +@@ -2879,16 +2918,16 @@ bus_driver_handle_message (DBusConnection *connection, + bus_context_log (context, DBUS_SYSTEM_LOG_WARNING, + "Ignoring unexpected ActivationFailure message " + "while not using systemd activation"); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + +- return dbus_activation_systemd_failure(bus_context_get_activation(context), message); ++ return dbus_activation_systemd_failure(bus_context_get_activation(context), message) == TRUE ? BUS_RESULT_TRUE : BUS_RESULT_FALSE; + } + + if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_METHOD_CALL) + { + _dbus_verbose ("Driver got a non-method-call message, ignoring\n"); +- return TRUE; /* we just ignore this */ ++ return BUS_RESULT_TRUE; /* we just ignore this */ + } + + /* may be NULL, which means "any interface will do" */ +@@ -2953,20 +2992,27 @@ bus_driver_handle_message (DBusConnection *connection, + name, dbus_message_get_signature (message), + mh->in_args); + _DBUS_ASSERT_ERROR_IS_SET (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + +- if ((* mh->handler) (connection, transaction, message, error)) ++ res = (* mh->handler) (connection, transaction, message, error); ++ if (res == BUS_RESULT_TRUE) + { + _DBUS_ASSERT_ERROR_IS_CLEAR (error); + _dbus_verbose ("Driver handler succeeded\n"); +- return TRUE; ++ return BUS_RESULT_TRUE; + } +- else ++ else if (res == BUS_RESULT_FALSE) + { + _DBUS_ASSERT_ERROR_IS_SET (error); + _dbus_verbose ("Driver handler returned failure\n"); +- return FALSE; ++ return BUS_RESULT_FALSE; ++ } ++ else if (res == BUS_RESULT_LATER) ++ { ++ _DBUS_ASSERT_ERROR_IS_CLEAR (error); ++ _dbus_verbose ("Driver handler delayed message processing due to policy check\n"); ++ return BUS_RESULT_LATER; + } + } + } +@@ -2978,7 +3024,7 @@ bus_driver_handle_message (DBusConnection *connection, + "%s does not understand message %s", + DBUS_SERVICE_DBUS, name); + +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + void +@@ -3099,7 +3145,7 @@ interface_handler_find_property (const InterfaceHandler *ih, + return NULL; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_get (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -3120,18 +3166,18 @@ bus_driver_handle_get (DBusConnection *connection, + DBUS_TYPE_STRING, &iface, + DBUS_TYPE_STRING, &prop, + DBUS_TYPE_INVALID)) +- return FALSE; ++ return BUS_RESULT_FALSE; + + /* We only implement Properties on /org/freedesktop/DBus so far. */ + ih = bus_driver_find_interface (iface, TRUE, error); + + if (ih == NULL) +- return FALSE; ++ return BUS_RESULT_FALSE; + + handler = interface_handler_find_property (ih, prop, error); + + if (handler == NULL) +- return FALSE; ++ return BUS_RESULT_FALSE; + + context = bus_transaction_get_context (transaction); + +@@ -3159,17 +3205,17 @@ bus_driver_handle_get (DBusConnection *connection, + goto oom; + + dbus_message_unref (reply); +- return TRUE; ++ return BUS_RESULT_TRUE; + + oom: + if (reply != NULL) + dbus_message_unref (reply); + + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_get_all (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -3188,13 +3234,13 @@ bus_driver_handle_get_all (DBusConnection *connection, + if (!dbus_message_get_args (message, error, + DBUS_TYPE_STRING, &iface, + DBUS_TYPE_INVALID)) +- return FALSE; ++ return BUS_RESULT_FALSE; + + /* We only implement Properties on /org/freedesktop/DBus so far. */ + ih = bus_driver_find_interface (iface, TRUE, error); + + if (ih == NULL) +- return FALSE; ++ return BUS_RESULT_FALSE; + + context = bus_transaction_get_context (transaction); + +@@ -3229,7 +3275,7 @@ bus_driver_handle_get_all (DBusConnection *connection, + goto oom; + + dbus_message_unref (reply); +- return TRUE; ++ return BUS_RESULT_TRUE; + + oom_abandon_message: + _dbus_asv_abandon (&reply_iter, &array_iter); +@@ -3239,10 +3285,10 @@ oom: + dbus_message_unref (reply); + + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + +-static dbus_bool_t ++static BusResult + bus_driver_handle_set (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -3271,15 +3317,15 @@ bus_driver_handle_set (DBusConnection *connection, + ih = bus_driver_find_interface (iface, TRUE, error); + + if (ih == NULL) +- return FALSE; ++ return BUS_RESULT_FALSE; + + handler = interface_handler_find_property (ih, prop, error); + + if (handler == NULL) +- return FALSE; ++ return BUS_RESULT_FALSE; + + /* We don't implement any properties that can be set yet. */ + dbus_set_error (error, DBUS_ERROR_PROPERTY_READ_ONLY, + "Property '%s.%s' cannot be set", iface, prop); +- return FALSE; ++ return BUS_RESULT_FALSE; + } +diff --git a/bus/driver.h b/bus/driver.h +index a7297ad..05e9886 100644 +--- a/bus/driver.h ++++ b/bus/driver.h +@@ -35,7 +35,7 @@ typedef enum + } BusDriverFound; + + void bus_driver_remove_connection (DBusConnection *connection); +-dbus_bool_t bus_driver_handle_message (DBusConnection *connection, ++BusResult bus_driver_handle_message (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, + DBusError *error); +diff --git a/bus/policy.c b/bus/policy.c +index 483cc97..f6f4d85 100644 +--- a/bus/policy.c ++++ b/bus/policy.c +@@ -1390,18 +1390,21 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, + + + +-static dbus_bool_t ++static BusResult + bus_rules_check_can_own (DBusList *rules, +- const DBusString *service_name) ++ const DBusString *service_name, ++ DBusConnection *connection, ++ DBusMessage *message) + { + DBusList *link; +- dbus_bool_t allowed; ++ BusResult result; ++ const char *privilege; + + /* rules is in the order the rules appeared + * in the config file, i.e. last rule that applies wins + */ + +- allowed = FALSE; ++ result = BUS_RESULT_FALSE; + link = _dbus_list_get_first_link (&rules); + while (link != NULL) + { +@@ -1437,17 +1440,46 @@ bus_rules_check_can_own (DBusList *rules, + } + + /* Use this rule */ +- allowed = rule->access == BUS_POLICY_RULE_ACCESS_ALLOW; ++ switch (rule->access) ++ { ++ case BUS_POLICY_RULE_ACCESS_ALLOW: ++ result = BUS_RESULT_TRUE; ++ break; ++ default: ++ case BUS_POLICY_RULE_ACCESS_DENY: ++ result = BUS_RESULT_FALSE; ++ break; ++ case BUS_POLICY_RULE_ACCESS_CHECK: ++ result = BUS_RESULT_LATER; ++ privilege = rule->privilege; ++ break; ++ } + } + +- return allowed; ++ if (result == BUS_RESULT_LATER) ++ { ++ BusContext *context = bus_connection_get_context(connection); ++ BusCheck *check = bus_context_get_check(context); ++ BusDeferredMessage *deferred_message; ++ ++ result = bus_check_privilege(check, message, connection, NULL, NULL, ++ privilege, BUS_DEFERRED_MESSAGE_CHECK_OWN, &deferred_message); ++ if (result == BUS_RESULT_LATER) ++ { ++ bus_deferred_message_disable_sender(deferred_message); ++ } ++ } ++ ++ return result; + } + +-dbus_bool_t ++BusResult + bus_client_policy_check_can_own (BusClientPolicy *policy, +- const DBusString *service_name) ++ const DBusString *service_name, ++ DBusConnection *connection, ++ DBusMessage *message) + { +- return bus_rules_check_can_own (policy->rules, service_name); ++ return bus_rules_check_can_own (policy->rules, service_name, connection, message); + } + + #ifdef DBUS_ENABLE_EMBEDDED_TESTS +@@ -1455,7 +1487,7 @@ dbus_bool_t + bus_policy_check_can_own (BusPolicy *policy, + const DBusString *service_name) + { +- return bus_rules_check_can_own (policy->default_rules, service_name); ++ return bus_rules_check_can_own (policy->default_rules, service_name, NULL, NULL) == BUS_RESULT_TRUE; + } + #endif /* DBUS_ENABLE_EMBEDDED_TESTS */ + +diff --git a/bus/policy.h b/bus/policy.h +index f839d23..28ce8f2 100644 +--- a/bus/policy.h ++++ b/bus/policy.h +@@ -182,8 +182,10 @@ BusResult bus_client_policy_check_can_receive (BusClientPolicy *policy, + dbus_int32_t *toggles, + const char **privilege_param, + BusDeferredMessage **deferred_message); +-dbus_bool_t bus_client_policy_check_can_own (BusClientPolicy *policy, +- const DBusString *service_name); ++BusResult bus_client_policy_check_can_own (BusClientPolicy *policy, ++ const DBusString *service_name, ++ DBusConnection *connection, ++ DBusMessage *message); + dbus_bool_t bus_client_policy_append_rule (BusClientPolicy *policy, + BusPolicyRule *rule); + void bus_client_policy_optimize (BusClientPolicy *policy); +diff --git a/bus/services.c b/bus/services.c +index 127edda..586af18 100644 +--- a/bus/services.c ++++ b/bus/services.c +@@ -376,16 +376,17 @@ bus_registry_list_services (BusRegistry *registry, + return FALSE; + } + +-dbus_bool_t ++BusResult + bus_registry_acquire_service (BusRegistry *registry, + DBusConnection *connection, ++ DBusMessage *message, + const DBusString *service_name, + dbus_uint32_t flags, + dbus_uint32_t *result, + BusTransaction *transaction, + DBusError *error) + { +- dbus_bool_t retval; ++ BusResult retval; + DBusConnection *old_owner_conn; + BusClientPolicy *policy; + BusService *service; +@@ -393,8 +394,9 @@ bus_registry_acquire_service (BusRegistry *registry, + BusSELinuxID *sid; + BusOwner *primary_owner; + int limit; ++ BusResult res; + +- retval = FALSE; ++ retval = BUS_RESULT_FALSE; + + if (!_dbus_validate_bus_name (service_name, 0, + _dbus_string_get_length (service_name))) +@@ -467,7 +469,8 @@ bus_registry_acquire_service (BusRegistry *registry, + _dbus_string_get_const_data (service_name), error)) + goto out; + +- if (!bus_client_policy_check_can_own (policy, service_name)) ++ res = bus_client_policy_check_can_own (policy, service_name, connection, message); ++ if (res == BUS_RESULT_FALSE) + { + dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, + "Connection \"%s\" is not allowed to own the service \"%s\" due " +@@ -478,6 +481,11 @@ bus_registry_acquire_service (BusRegistry *registry, + _dbus_string_get_const_data (service_name)); + goto out; + } ++ else if (res == BUS_RESULT_LATER) ++ { ++ retval = BUS_RESULT_LATER; ++ goto out; ++ } + + limit = bus_context_get_max_services_per_connection (registry->context); + +@@ -603,11 +611,13 @@ bus_registry_acquire_service (BusRegistry *registry, + } + + activation = bus_context_get_activation (registry->context); +- retval = bus_activation_send_pending_auto_activation_messages (activation, ++ ++ if (bus_activation_send_pending_auto_activation_messages (activation, + service, +- transaction); +- if (!retval) +- BUS_SET_OOM (error); ++ transaction)) ++ retval = BUS_RESULT_TRUE; ++ else ++ BUS_SET_OOM (error); + + out: + return retval; +diff --git a/bus/services.h b/bus/services.h +index 056dd9f..3df3dd7 100644 +--- a/bus/services.h ++++ b/bus/services.h +@@ -50,8 +50,9 @@ void bus_registry_foreach (BusRegistry *registry + dbus_bool_t bus_registry_list_services (BusRegistry *registry, + char ***listp, + int *array_len); +-dbus_bool_t bus_registry_acquire_service (BusRegistry *registry, ++BusResult bus_registry_acquire_service (BusRegistry *registry, + DBusConnection *connection, ++ DBusMessage *message, + const DBusString *service_name, + dbus_uint32_t flags, + dbus_uint32_t *result, +diff --git a/bus/stats.c b/bus/stats.c +index 1582255..c25be98 100644 +--- a/bus/stats.c ++++ b/bus/stats.c +@@ -36,7 +36,7 @@ + + #ifdef DBUS_ENABLE_STATS + +-dbus_bool_t ++BusResult + bus_stats_handle_get_stats (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -51,6 +51,9 @@ bus_stats_handle_get_stats (DBusConnection *connection, + + _DBUS_ASSERT_ERROR_IS_CLEAR (error); + ++ if (!bus_driver_check_message_is_for_us (message, error)) ++ return BUS_RESULT_FALSE; ++ + context = bus_transaction_get_context (transaction); + connections = bus_context_get_connections (context); + +@@ -104,17 +107,17 @@ bus_stats_handle_get_stats (DBusConnection *connection, + goto oom; + + dbus_message_unref (reply); +- return TRUE; ++ return BUS_RESULT_TRUE; + + oom: + if (reply != NULL) + dbus_message_unref (reply); + + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + +-dbus_bool_t ++BusResult + bus_stats_handle_get_connection_stats (DBusConnection *caller_connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -209,7 +212,7 @@ bus_stats_handle_get_connection_stats (DBusConnection *caller_connection, + goto oom; + + dbus_message_unref (reply); +- return TRUE; ++ return BUS_RESULT_TRUE; + + oom: + BUS_SET_OOM (error); +@@ -218,11 +221,11 @@ failed: + if (reply != NULL) + dbus_message_unref (reply); + +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + +-dbus_bool_t ++BusResult + bus_stats_handle_get_all_match_rules (DBusConnection *caller_connection, + BusTransaction *transaction, + DBusMessage *message, +@@ -246,7 +249,7 @@ bus_stats_handle_get_all_match_rules (DBusConnection *caller_connection, + matchmaker = bus_context_get_matchmaker (context); + + if (!bus_registry_list_services (registry, &services, &services_len)) +- return FALSE; ++ return BUS_RESULT_FALSE; + + reply = dbus_message_new_method_return (message); + if (reply == NULL) +@@ -325,7 +328,7 @@ bus_stats_handle_get_all_match_rules (DBusConnection *caller_connection, + + dbus_message_unref (reply); + dbus_free_string_array (services); +- return TRUE; ++ return BUS_RESULT_TRUE; + + oom: + if (reply != NULL) +@@ -334,7 +337,7 @@ oom: + dbus_free_string_array (services); + + BUS_SET_OOM (error); +- return FALSE; ++ return BUS_RESULT_FALSE; + } + + #endif +diff --git a/bus/stats.h b/bus/stats.h +index dcb022c..683fa17 100644 +--- a/bus/stats.h ++++ b/bus/stats.h +@@ -25,17 +25,17 @@ + + #define BUS_INTERFACE_STATS "org.freedesktop.DBus.Debug.Stats" + +-dbus_bool_t bus_stats_handle_get_stats (DBusConnection *connection, ++BusResult bus_stats_handle_get_stats (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, + DBusError *error); + +-dbus_bool_t bus_stats_handle_get_connection_stats (DBusConnection *connection, ++BusResult bus_stats_handle_get_connection_stats (DBusConnection *connection, + BusTransaction *transaction, + DBusMessage *message, + DBusError *error); + +-dbus_bool_t bus_stats_handle_get_all_match_rules (DBusConnection *caller_connection, ++BusResult bus_stats_handle_get_all_match_rules (DBusConnection *caller_connection, + BusTransaction *transaction, + DBusMessage *message, + DBusError *error); +-- +2.21.1 + diff --git a/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0005-Perform-Cynara-runtime-policy-checks-by-default.patch b/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0005-Perform-Cynara-runtime-policy-checks-by-default.patch new file mode 100644 index 00000000..5f7e96a3 --- /dev/null +++ b/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0005-Perform-Cynara-runtime-policy-checks-by-default.patch @@ -0,0 +1,180 @@ +From 1f7ba56c9ced669951061d13b06e31d96a170e37 Mon Sep 17 00:00:00 2001 +From: Jacek Bukarewicz +Date: Tue, 23 Jun 2015 11:08:48 +0200 +Subject: [PATCH 5/8] Perform Cynara runtime policy checks by default +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This change introduces http://tizen.org/privilege/internal/dbus privilege +which is supposed to be available only to trusted system resources. +Checks for this privilege are used in place of certain allow rules to +make security policy more strict. + +For system bus sending and receiving signals now requires +http://tizen.org/privilege/internal/dbus privilege. Requesting name +ownership and sending methods is still denied by default. + +For session bus http://tizen.org/privilege/internal/dbus privilege +is now required for requesting name, calling methods, sending and receiving +signals. + +Services are supposed to override these default settings to implement their +own security policy. + +Cherry picked from e8610297cf7031e94eb314a2e8c11246f4405403 by Jose Bollo + +Updated for dbus 1.10.20 by Scott Murray and José Bollo + +Signed-off-by: Jacek Bukarewicz +Signed-off-by: José Bollo +Signed-off-by: Scott Murray +--- + bus/activation.c | 42 ++++++++++++++++++++++++++---------------- + bus/session.conf.in | 32 ++++++++++++++++++++++++++------ + bus/system.conf.in | 19 +++++++++++++++---- + 3 files changed, 67 insertions(+), 26 deletions(-) + +diff --git a/bus/activation.c b/bus/activation.c +index d4b597c..8aabeaa 100644 +--- a/bus/activation.c ++++ b/bus/activation.c +@@ -1840,22 +1840,32 @@ bus_activation_activate_service (BusActivation *activation, + } + + if (auto_activation && +- entry != NULL && +- BUS_RESULT_TRUE != bus_context_check_security_policy (activation->context, +- transaction, +- connection, /* sender */ +- NULL, /* addressed recipient */ +- NULL, /* proposed recipient */ +- activation_message, +- entry, +- error, +- NULL)) +- { +- _DBUS_ASSERT_ERROR_IS_SET (error); +- _dbus_verbose ("activation not authorized: %s: %s\n", +- error != NULL ? error->name : "(error ignored)", +- error != NULL ? error->message : "(error ignored)"); +- return FALSE; ++ entry != NULL) ++ { ++ BusResult result; ++ ++ result = bus_context_check_security_policy (activation->context, ++ transaction, ++ connection, /* sender */ ++ NULL, /* addressed recipient */ ++ NULL, /* proposed recipient */ ++ activation_message, ++ entry, ++ error, ++ NULL); ++ if (result == BUS_RESULT_FALSE) ++ { ++ _DBUS_ASSERT_ERROR_IS_SET (error); ++ _dbus_verbose ("activation not authorized: %s: %s\n", ++ error != NULL ? error->name : "(error ignored)", ++ error != NULL ? error->message : "(error ignored)"); ++ return FALSE; ++ } ++ if (result == BUS_RESULT_LATER) ++ { ++ /* TODO */ ++ _dbus_verbose ("ALERT FIX ME!!!!!!!!!!!!!!!"); ++ } + } + + /* Bypass the registry lookup if we're auto-activating, bus_dispatch would not +diff --git a/bus/session.conf.in b/bus/session.conf.in +index affa7f1..157dfb4 100644 +--- a/bus/session.conf.in ++++ b/bus/session.conf.in +@@ -27,12 +27,32 @@ + + + +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +diff --git a/bus/system.conf.in b/bus/system.conf.in +index f139b55..19d0c04 100644 +--- a/bus/system.conf.in ++++ b/bus/system.conf.in +@@ -50,17 +50,20 @@ + + + +- ++ ++ ++ ++ +- + + + +- ++ + + + +- + + + + ++ ++ ++ + + +Date: Fri, 16 Aug 2019 13:29:23 +0200 +Subject: [PATCH 6/8] Fix SIGSEGV on disconnections +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Sometime, at start of the system, dbus-daemon was crashing +because a pending authorisation were reactivating a closed +connection. + +Also, clean unused function. + +Signed-off-by: José Bollo +--- + bus/check.c | 5 +++++ + bus/check.h | 1 + + bus/connection.c | 14 +++----------- + bus/connection.h | 3 --- + 4 files changed, 9 insertions(+), 14 deletions(-) + +diff --git a/bus/check.c b/bus/check.c +index f3d283f..b73d08b 100644 +--- a/bus/check.c ++++ b/bus/check.c +@@ -617,3 +617,8 @@ bus_deferred_message_response_received (BusDeferredMessage *deferred_message, + } + } + ++void ++bus_deferred_message_abort (BusDeferredMessage *deferred_message) ++{ ++ deferred_message->response_callback = NULL; ++} +diff --git a/bus/check.h b/bus/check.h +index 9c13c18..d718a69 100644 +--- a/bus/check.h ++++ b/bus/check.h +@@ -93,6 +93,7 @@ void bus_deferred_message_set_policy_check_info (BusDeferredMessa + const char *privilege); + dbus_bool_t bus_deferred_message_check_message_limits (BusDeferredMessage *deferred_message, + DBusError *error); ++void bus_deferred_message_abort (BusDeferredMessage *deferred_message); + + + #ifdef DBUS_ENABLE_EMBEDDED_TESTS +diff --git a/bus/connection.c b/bus/connection.c +index ee93384..b520d57 100644 +--- a/bus/connection.c ++++ b/bus/connection.c +@@ -47,6 +47,7 @@ + #define MAX_LOG_COMMAND_LEN 50 + + static void bus_connection_remove_transactions (DBusConnection *connection); ++static void bus_connection_clear_deferred_messages (DBusConnection *connection); + + typedef struct + { +@@ -2821,17 +2822,7 @@ bus_connection_pop_deferred_message (DBusConnection *connection) + return NULL; + } + +-dbus_bool_t +-bus_connection_putback_deferred_message (DBusConnection *connection, BusDeferredMessage *message) +-{ +- BusConnectionData *d = BUS_CONNECTION_DATA(connection); +- if (_dbus_list_prepend(&d->deferred_messages, message)) +- { +- return TRUE; +- } +- return FALSE; +-} +- ++static + void + bus_connection_clear_deferred_messages (DBusConnection *connection) + { +@@ -2846,6 +2837,7 @@ bus_connection_clear_deferred_messages (DBusConnection *connection) + next = _dbus_list_get_next_link (&d->deferred_messages, link); + message = link->data; + ++ bus_deferred_message_abort(message); + bus_deferred_message_unref(message); + _dbus_list_remove_link(&d->deferred_messages, link); + +diff --git a/bus/connection.h b/bus/connection.h +index 97dae96..6af7bf1 100644 +--- a/bus/connection.h ++++ b/bus/connection.h +@@ -90,15 +90,12 @@ dbus_bool_t bus_connection_queue_deferred_message (DBusConnection *con + BusDeferredMessage *message, + dbus_bool_t prepend); + BusDeferredMessage *bus_connection_pop_deferred_message (DBusConnection *connection); +-dbus_bool_t bus_connection_putback_deferred_message (DBusConnection *connection, +- BusDeferredMessage *message); + void bus_connection_remove_deferred_message (DBusConnection *connection, + BusDeferredMessage *message); + dbus_bool_t bus_connection_replace_deferred_message (DBusConnection *connection, + BusDeferredMessage *oldMessage, + BusDeferredMessage *newMessage); + void bus_connection_dispatch_deferred (DBusConnection *connection); +-void bus_connection_clear_deferred_messages (DBusConnection *connection); + + + /* called by signals.c */ +-- +2.21.1 + diff --git a/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0007-Switch-from-cynara-to-cynagora.patch b/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0007-Switch-from-cynara-to-cynagora.patch new file mode 100644 index 00000000..7a69efcd --- /dev/null +++ b/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus-cynagora/0007-Switch-from-cynara-to-cynagora.patch @@ -0,0 +1,1048 @@ +From 43cc361a5c32c81c0f93451bdb0ef781cd19a1cb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jos=C3=A9=20Bollo?= +Date: Tue, 4 Feb 2020 12:23:36 +0100 +Subject: [PATCH 7/8] Switch from cynara to cynagora +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: José Bollo +--- + bus/Makefile.am | 8 +- + bus/bus.h | 2 +- + bus/check.c | 26 +- + bus/check.h | 2 +- + bus/connection.c | 27 --- + bus/connection.h | 3 - + bus/cynagora-check.c | 330 +++++++++++++++++++++++++ + bus/{cynara.h => cynagora-check.h} | 10 +- + bus/cynara.c | 373 ----------------------------- + bus/system.conf.in | 6 +- + configure.ac | 18 +- + 11 files changed, 366 insertions(+), 439 deletions(-) + create mode 100644 bus/cynagora-check.c + rename bus/{cynara.h => cynagora-check.h} (81%) + delete mode 100644 bus/cynara.c + +diff --git a/bus/Makefile.am b/bus/Makefile.am +index 2a8a72c..1720048 100644 +--- a/bus/Makefile.am ++++ b/bus/Makefile.am +@@ -13,7 +13,7 @@ DBUS_BUS_LIBS = \ + $(THREAD_LIBS) \ + $(ADT_LIBS) \ + $(NETWORK_libs) \ +- $(CYNARA_LIBS) \ ++ $(CYNAGORA_LIBS) \ + $(NULL) + + DBUS_LAUNCHER_LIBS = \ +@@ -31,7 +31,7 @@ AM_CPPFLAGS = \ + $(APPARMOR_CFLAGS) \ + -DDBUS_SYSTEM_CONFIG_FILE=\""$(dbusdatadir)/system.conf"\" \ + -DDBUS_COMPILATION \ +- $(CYNARA_CFLAGS) \ ++ $(CYNAGORA_CFLAGS) \ + $(NULL) + + # if assertions are enabled, improve backtraces +@@ -101,8 +101,8 @@ BUS_SOURCES= \ + config-parser-common.h \ + connection.c \ + connection.h \ +- cynara.c \ +- cynara.h \ ++ cynagora-check.c \ ++ cynagora-check.h \ + desktop-file.c \ + desktop-file.h \ + $(DIR_WATCH_SOURCE) \ +diff --git a/bus/bus.h b/bus/bus.h +index 1b08f7c..e167d9e 100644 +--- a/bus/bus.h ++++ b/bus/bus.h +@@ -47,7 +47,7 @@ typedef struct BusMatchRule BusMatchRule; + typedef struct BusActivationEntry BusActivationEntry; + typedef struct BusCheck BusCheck; + typedef struct BusDeferredMessage BusDeferredMessage; +-typedef struct BusCynara BusCynara; ++typedef struct BusCynagora BusCynagora; + + /** + * BusResult is defined as a pointer to a dummy structure to allow detection of type mismatches. +diff --git a/bus/check.c b/bus/check.c +index b73d08b..ec30770 100644 +--- a/bus/check.c ++++ b/bus/check.c +@@ -26,7 +26,7 @@ + #include "check.h" + #include "connection.h" + #include "dispatch.h" +-#include "cynara.h" ++#include "cynagora-check.h" + #include "utils.h" + #include + #include +@@ -38,7 +38,7 @@ typedef struct BusCheck + int refcount; + + BusContext *context; +- BusCynara *cynara; ++ BusCynagora *cynagora; + } BusCheck; + + typedef struct BusDeferredMessage +@@ -81,7 +81,7 @@ bus_check_new (BusContext *context, DBusError *error) + + check->refcount = 1; + check->context = context; +- check->cynara = bus_cynara_new(check, error); ++ check->cynagora = bus_cynagora_new(check, error); + if (dbus_error_is_set(error)) + { + dbus_message_free_data_slot(&deferred_message_data_slot); +@@ -110,7 +110,7 @@ bus_check_unref (BusCheck *check) + + if (check->refcount == 0) + { +- bus_cynara_unref(check->cynara); ++ bus_cynagora_unref(check->cynagora); + dbus_message_free_data_slot(&deferred_message_data_slot); + dbus_free(check); + } +@@ -122,10 +122,10 @@ bus_check_get_context (BusCheck *check) + return check->context; + } + +-BusCynara * +-bus_check_get_cynara (BusCheck *check) ++BusCynagora * ++bus_check_get_cynagora (BusCheck *check) + { +- return check->cynara; ++ return check->cynagora; + } + + static void +@@ -276,8 +276,8 @@ bus_check_privilege (BusCheck *check, + { + BusDeferredMessage *previous_deferred_message; + BusResult result = BUS_RESULT_FALSE; +-#ifdef DBUS_ENABLE_CYNARA +- BusCynara *cynara; ++#ifdef DBUS_ENABLE_CYNAGORA ++ BusCynagora *cynagora; + #endif + DBusConnection *connection; + +@@ -304,7 +304,7 @@ bus_check_privilege (BusCheck *check, + * Message has been deferred due to receive or own rule which means that sending this message + * is allowed - it must have been checked previously. + * This might happen when client calls RequestName method which depending on security +- * policy might result in both "can_send" and "can_own" Cynara checks. ++ * policy might result in both "can_send" and "can_own" Cynagora checks. + */ + result = BUS_RESULT_TRUE; + } +@@ -327,9 +327,9 @@ bus_check_privilege (BusCheck *check, + else + { + /* ask policy checkers */ +-#ifdef DBUS_ENABLE_CYNARA +- cynara = bus_check_get_cynara(check); +- result = bus_cynara_check_privilege(cynara, message, sender, addressed_recipient, ++#ifdef DBUS_ENABLE_CYNAGORA ++ cynagora = bus_check_get_cynagora(check); ++ result = bus_cynagora_check_privilege(cynagora, message, sender, addressed_recipient, + proposed_recipient, privilege, check_type, deferred_message); + #endif + if (result == BUS_RESULT_LATER && deferred_message != NULL) +diff --git a/bus/check.h b/bus/check.h +index d718a69..ab63c18 100644 +--- a/bus/check.h ++++ b/bus/check.h +@@ -45,7 +45,7 @@ BusCheck *bus_check_ref (BusCheck *check); + void bus_check_unref (BusCheck *check); + + BusContext *bus_check_get_context (BusCheck *check); +-BusCynara *bus_check_get_cynara (BusCheck *check); ++BusCynagora *bus_check_get_cynagora (BusCheck *check); + BusResult bus_check_privilege (BusCheck *check, + DBusMessage *message, + DBusConnection *sender, +diff --git a/bus/connection.c b/bus/connection.c +index b520d57..48910e0 100644 +--- a/bus/connection.c ++++ b/bus/connection.c +@@ -38,10 +38,6 @@ + #include + #include + #include +-#ifdef DBUS_ENABLE_CYNARA +-#include +-#include +-#endif + + /* Trim executed commands to this length; we want to keep logs readable */ + #define MAX_LOG_COMMAND_LEN 50 +@@ -124,9 +120,6 @@ typedef struct + + /** non-NULL if and only if this is a monitor */ + DBusList *link_in_monitors; +-#ifdef DBUS_ENABLE_CYNARA +- char *cynara_session_id; +-#endif + } BusConnectionData; + + static dbus_bool_t bus_pending_reply_expired (BusExpireList *list, +@@ -461,10 +454,6 @@ free_connection_data (void *data) + + dbus_free (d->name); + +-#ifdef DBUS_ENABLE_CYNARA +- free (d->cynara_session_id); +-#endif +- + dbus_free (d); + } + +@@ -1095,22 +1084,6 @@ bus_connection_get_policy (DBusConnection *connection) + return d->policy; + } + +-#ifdef DBUS_ENABLE_CYNARA +-const char *bus_connection_get_cynara_session_id (DBusConnection *connection) +-{ +- BusConnectionData *d = BUS_CONNECTION_DATA (connection); +- _dbus_assert (d != NULL); +- +- if (d->cynara_session_id == NULL) +- { +- unsigned long pid; +- if (dbus_connection_get_unix_process_id(connection, &pid)) +- d->cynara_session_id = cynara_session_from_pid(pid); +- } +- return d->cynara_session_id; +-} +-#endif +- + static dbus_bool_t + foreach_active (BusConnections *connections, + BusConnectionForeachFunction function, +diff --git a/bus/connection.h b/bus/connection.h +index 6af7bf1..3116bcf 100644 +--- a/bus/connection.h ++++ b/bus/connection.h +@@ -138,9 +138,6 @@ dbus_bool_t bus_connection_be_monitor (DBusConnection *connection, + BusTransaction *transaction, + DBusList **rules, + DBusError *error); +-#ifdef DBUS_ENABLE_CYNARA +-const char *bus_connection_get_cynara_session_id (DBusConnection *connection); +-#endif + + /* transaction API so we can send or not send a block of messages as a whole */ + +diff --git a/bus/cynagora-check.c b/bus/cynagora-check.c +new file mode 100644 +index 0000000..6c0c635 +--- /dev/null ++++ b/bus/cynagora-check.c +@@ -0,0 +1,330 @@ ++/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ ++/* cynagora.c Cynagora runtime privilege checking ++ * ++ * Copyright (c) 2014 Samsung Electronics, Ltd. ++ * ++ * Licensed under the Academic Free License version 2.1 ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#include ++#include "cynagora-check.h" ++#include "check.h" ++#include "utils.h" ++ ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#ifndef DBUS_ENABLE_CYNAGORA ++ ++BusCynagora * ++bus_cynagora_new(BusCheck *check, DBusError *error) ++{ ++ return NULL; ++} ++ ++BusCynagora * ++bus_cynagora_ref (BusCynagora *cynagora) ++{ ++ return NULL; ++} ++ ++void ++bus_cynagora_unref (BusCynagora *cynagora) ++{ ++} ++ ++BusResult ++bus_cynagora_check_privilege (BusCynagora *cynagora, ++ DBusMessage *message, ++ DBusConnection *sender, ++ DBusConnection *addressed_recipient, ++ DBusConnection *proposed_recipient, ++ const char *privilege, ++ BusDeferredMessageStatus check_type, ++ BusDeferredMessage **deferred_message_param) ++{ ++ return BUS_RESULT_FALSE; ++} ++ ++#endif ++ ++#ifdef DBUS_ENABLE_CYNAGORA ++ ++#include ++#include ++ ++#include ++ ++#ifndef CYNAGORA_CACHE_SIZE ++#define CYNAGORA_CACHE_SIZE 8000 ++#endif ++ ++typedef struct BusCynagora ++{ ++ int refcount; ++ ++ BusContext *context; ++ BusCheck *check; ++ cynagora_t *cynagora; ++ DBusWatch *cynagora_watch; ++} BusCynagora; ++ ++static int async_callback(void *closure, ++ int op, ++ int fd, ++ uint32_t events); ++ ++BusCynagora * ++bus_cynagora_new(BusCheck *check, DBusError *error) ++{ ++ BusContext *context; ++ BusCynagora *cynagora; ++ int ret; ++ ++ cynagora = dbus_new(BusCynagora, 1); ++ if (cynagora == NULL) ++ { ++ BUS_SET_OOM(error); ++ return NULL; ++ } ++ ++ context = bus_check_get_context(check); ++ ++ cynagora->refcount = 1; ++ cynagora->check = check; ++ cynagora->context = context; ++ cynagora->cynagora_watch = NULL; ++ ++ ret = cynagora_create(&cynagora->cynagora, cynagora_Check, CYNAGORA_CACHE_SIZE, NULL); ++ if (ret < 0) ++ { ++ dbus_set_error (error, DBUS_ERROR_FAILED, "Failed to create Cynagora configuration"); ++ } ++ else ++ { ++ ret = cynagora_async_setup(cynagora->cynagora, async_callback, cynagora); ++ if (ret < 0) ++ { ++ dbus_set_error (error, DBUS_ERROR_FAILED, "Failed to initialize Cynagora client"); ++ } ++ else ++ { ++ return cynagora; ++ } ++ cynagora_destroy(cynagora->cynagora); ++ } ++ ++ dbus_free(cynagora); ++ return NULL; ++} ++ ++BusCynagora * ++bus_cynagora_ref (BusCynagora *cynagora) ++{ ++ _dbus_assert (cynagora->refcount > 0); ++ cynagora->refcount += 1; ++ ++ return cynagora; ++} ++ ++void ++bus_cynagora_unref (BusCynagora *cynagora) ++{ ++ _dbus_assert (cynagora->refcount > 0); ++ ++ cynagora->refcount -= 1; ++ ++ if (cynagora->refcount == 0) ++ { ++ cynagora_destroy(cynagora->cynagora); ++ dbus_free(cynagora); ++ } ++} ++ ++static void ++async_check_callback (void *closure, int status) ++{ ++ BusDeferredMessage *deferred_message = closure; ++ BusResult result; ++ ++ if (deferred_message == NULL) ++ return; ++ ++ if (status == 1) ++ result = BUS_RESULT_TRUE; ++ else ++ result = BUS_RESULT_FALSE; ++ ++ bus_deferred_message_response_received(deferred_message, result); ++ bus_deferred_message_unref(deferred_message); ++} ++ ++BusResult ++bus_cynagora_check_privilege (BusCynagora *cynagora, ++ DBusMessage *message, ++ DBusConnection *sender, ++ DBusConnection *addressed_recipient, ++ DBusConnection *proposed_recipient, ++ const char *permission, ++ BusDeferredMessageStatus check_type, ++ BusDeferredMessage **deferred_message_param) ++{ ++ int result; ++ unsigned long uid; ++ unsigned long pid; ++ char *label; ++ char user[32]; ++ char session[32]; ++ DBusConnection *connection = check_type == BUS_DEFERRED_MESSAGE_CHECK_RECEIVE ? proposed_recipient : sender; ++ BusDeferredMessage *deferred_message; ++ BusResult ret; ++ cynagora_key_t key; ++ ++ _dbus_assert(connection != NULL); ++ ++ if (dbus_connection_get_unix_user(connection, &uid) == FALSE) ++ return BUS_RESULT_FALSE; ++ ++ if (dbus_connection_get_unix_process_id(connection, &pid) == FALSE) ++ return BUS_RESULT_FALSE; ++ ++ if (_dbus_connection_get_linux_security_label(connection, &label) == FALSE || label == NULL) ++ { ++ _dbus_warn("Failed to obtain security label for connection\n"); ++ return BUS_RESULT_FALSE; ++ } ++ ++ snprintf(user, sizeof(user), "%lu", uid); ++ snprintf(session, sizeof(session), "%lu", pid); ++ ++ key.client = label; ++ key.session = session; ++ key.user = user; ++ key.permission = permission; ++ ++ result = cynagora_cache_check(cynagora->cynagora, &key); ++ switch (result) ++ { ++ case 1: ++ _dbus_verbose("Cynagora: got ALLOWED answer from cache (client=%s session_id=%s user=%s permission=%s)\n", ++ label, session_id, user, permission); ++ ret = BUS_RESULT_TRUE; ++ break; ++ ++ case 0: ++ _dbus_verbose("Cynagora: got DENIED answer from cache (client=%s session_id=%s user=%s permission=%s)\n", ++ label, session_id, user, permission); ++ ret = BUS_RESULT_FALSE; ++ break; ++ ++ default: ++ deferred_message = bus_deferred_message_new(message, sender, addressed_recipient, ++ proposed_recipient, BUS_RESULT_LATER); ++ if (deferred_message == NULL) ++ { ++ _dbus_verbose("Failed to allocate memory for deferred message\n"); ++ ret = BUS_RESULT_FALSE; ++ goto out; ++ } ++ ++ /* callback is supposed to unref deferred_message*/ ++ result = cynagora_async_check(cynagora->cynagora, &key, 1, 0, async_check_callback, deferred_message); ++ if (result == 0) ++ { ++ _dbus_verbose("Created Cynagora request: client=%s session_id=%s user=%s permission=%s " ++ "deferred_message=%p\n", label, session_id, user, permission, deferred_message); ++ if (deferred_message_param != NULL) ++ *deferred_message_param = deferred_message; ++ ret = BUS_RESULT_LATER; ++ } ++ else ++ { ++ _dbus_verbose("Error on cynagora request create: %i\n", result); ++ bus_deferred_message_unref(deferred_message); ++ ret = BUS_RESULT_FALSE; ++ } ++ break; ++ } ++out: ++ dbus_free(label); ++ return ret; ++} ++ ++static dbus_bool_t ++watch_handler_callback(DBusWatch *watch, ++ unsigned int flags, ++ void *data) ++{ ++ BusCynagora *cynagora = (BusCynagora *)data; ++ int result = cynagora_async_process(cynagora->cynagora); ++ if (result < 0) ++ _dbus_verbose("cynagora_async_process returned %d\n", result); ++ ++ return result != -ENOMEM ? TRUE : FALSE; ++} ++ ++static int ++async_callback(void *closure, int op, int fd, uint32_t events) ++{ ++ BusCynagora *cynagora = (BusCynagora *)closure; ++ DBusLoop *loop = bus_context_get_loop(cynagora->context); ++ unsigned int flags; ++ DBusWatch *watch; ++ ++ /* compute flags */ ++ flags = 0; ++ if (events & EPOLLIN) ++ flags |= DBUS_WATCH_READABLE; ++ if (events & EPOLLOUT) ++ flags |= DBUS_WATCH_WRITABLE; ++ ++ /* remove the watch if needed */ ++ watch = cynagora->cynagora_watch; ++ if (watch != NULL) ++ { ++ cynagora->cynagora_watch = NULL; ++ _dbus_loop_remove_watch(loop, watch); ++ _dbus_watch_invalidate(watch); ++ _dbus_watch_unref(watch); ++ } ++ ++ /* create the watch if needed */ ++ watch = cynagora->cynagora_watch; ++ if (op != EPOLL_CTL_DEL) ++ { ++ watch = _dbus_watch_new(fd, flags, TRUE, watch_handler_callback, cynagora, NULL); ++ if (watch == NULL) ++ return -ENOMEM; ++ if (_dbus_loop_add_watch(loop, watch) != TRUE) ++ { ++ _dbus_watch_invalidate(watch); ++ _dbus_watch_unref(watch); ++ return -ENOMEM; ++ } ++ cynagora->cynagora_watch = watch; ++ } ++ return 0; ++} ++ ++#endif /* DBUS_ENABLE_CYNAGORA */ +diff --git a/bus/cynara.h b/bus/cynagora-check.h +similarity index 81% +rename from bus/cynara.h +rename to bus/cynagora-check.h +index c4728bb..c0892c3 100644 +--- a/bus/cynara.h ++++ b/bus/cynagora-check.h +@@ -1,5 +1,5 @@ + /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +-/* cynara.h Cynara runtime privilege checking ++/* cynagora.h Cynagora runtime privilege checking + * + * Copyright (c) 2014 Samsung Electronics, Ltd. + * +@@ -24,10 +24,10 @@ + #include "bus.h" + #include "check.h" + +-BusCynara *bus_cynara_new (BusCheck *check, DBusError *error); +-BusCynara *bus_cynara_ref (BusCynara *cynara); +-void bus_cynara_unref (BusCynara *cynara); +-BusResult bus_cynara_check_privilege (BusCynara *cynara, ++BusCynagora *bus_cynagora_new (BusCheck *check, DBusError *error); ++BusCynagora *bus_cynagora_ref (BusCynagora *cynagora); ++void bus_cynagora_unref (BusCynagora *cynagora); ++BusResult bus_cynagora_check_privilege (BusCynagora *cynagora, + DBusMessage *message, + DBusConnection *sender, + DBusConnection *addressed_recipient, +diff --git a/bus/cynara.c b/bus/cynara.c +deleted file mode 100644 +index 77aed62..0000000 +--- a/bus/cynara.c ++++ /dev/null +@@ -1,373 +0,0 @@ +-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +-/* cynara.c Cynara runtime privilege checking +- * +- * Copyright (c) 2014 Samsung Electronics, Ltd. +- * +- * Licensed under the Academic Free License version 2.1 +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, write to the Free Software +- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +- * +- */ +- +-#include +-#include "cynara.h" +-#include "check.h" +-#include "utils.h" +- +-#include +- +-#include +-#include +-#include +-#include +-#ifdef DBUS_ENABLE_CYNARA +-#include +-#endif +- +-#ifdef DBUS_ENABLE_CYNARA +-typedef struct BusCynara +-{ +- int refcount; +- +- BusContext *context; +- BusCheck *check; +- cynara_async *cynara; +- DBusWatch *cynara_watch; +-} BusCynara; +- +-#define USE_CYNARA_CACHE 1 +-#ifdef USE_CYNARA_CACHE +-#define CYNARA_CACHE_SIZE 1000 +-#endif +- +-static dbus_bool_t bus_cynara_watch_callback(DBusWatch *watch, +- unsigned int flags, +- void *data); +- +-static void status_callback(int old_fd, +- int new_fd, +- cynara_async_status status, +- void *user_status_data); +-static void bus_cynara_check_response_callback (cynara_check_id check_id, +- cynara_async_call_cause cause, +- int response, +- void *user_response_data); +-#endif +- +- +-BusCynara * +-bus_cynara_new(BusCheck *check, DBusError *error) +-{ +-#ifdef DBUS_ENABLE_CYNARA +- BusContext *context; +- BusCynara *cynara; +- cynara_async_configuration *conf = NULL; +- int ret; +- +- cynara = dbus_new(BusCynara, 1); +- if (cynara == NULL) +- { +- BUS_SET_OOM(error); +- return NULL; +- } +- +- context = bus_check_get_context(check); +- +- cynara->refcount = 1; +- cynara->check = check; +- cynara->context = context; +- cynara->cynara_watch = NULL; +- +- ret = cynara_async_configuration_create(&conf); +- if (ret != CYNARA_API_SUCCESS) +- { +- dbus_set_error (error, DBUS_ERROR_FAILED, "Failed to create Cynara configuration"); +- goto out; +- } +- +-#ifdef CYNARA_CACHE_SIZE +- ret = cynara_async_configuration_set_cache_size(conf, CYNARA_CACHE_SIZE); +- if (ret != CYNARA_API_SUCCESS) +- { +- dbus_set_error (error, DBUS_ERROR_FAILED, "Failed to Cynara cache size"); +- goto out; +- } +-#endif +- +- ret = cynara_async_initialize(&cynara->cynara, conf, &status_callback, cynara); +- if (ret != CYNARA_API_SUCCESS) +- { +- dbus_set_error (error, DBUS_ERROR_FAILED, "Failed to initialize Cynara client"); +- goto out; +- } +- +-out: +- cynara_async_configuration_destroy(conf); +- if (ret != CYNARA_API_SUCCESS) +- { +- dbus_free(cynara); +- return NULL; +- } +- +- return cynara; +-#else +- return NULL; +-#endif +-} +- +-BusCynara * +-bus_cynara_ref (BusCynara *cynara) +-{ +-#ifdef DBUS_ENABLE_CYNARA +- _dbus_assert (cynara->refcount > 0); +- cynara->refcount += 1; +- +- return cynara; +-#else +- return NULL; +-#endif +-} +- +-void +-bus_cynara_unref (BusCynara *cynara) +-{ +-#ifdef DBUS_ENABLE_CYNARA +- _dbus_assert (cynara->refcount > 0); +- +- cynara->refcount -= 1; +- +- if (cynara->refcount == 0) +- { +- cynara_async_finish(cynara->cynara); +- dbus_free(cynara); +- } +-#endif +-} +- +-BusResult +-bus_cynara_check_privilege (BusCynara *cynara, +- DBusMessage *message, +- DBusConnection *sender, +- DBusConnection *addressed_recipient, +- DBusConnection *proposed_recipient, +- const char *privilege, +- BusDeferredMessageStatus check_type, +- BusDeferredMessage **deferred_message_param) +-{ +-#ifdef DBUS_ENABLE_CYNARA +- int result; +- unsigned long uid; +- char *label; +- const char *session_id; +- char user[32]; +- cynara_check_id check_id; +- DBusConnection *connection = check_type == BUS_DEFERRED_MESSAGE_CHECK_RECEIVE ? proposed_recipient : sender; +- BusDeferredMessage *deferred_message; +- BusResult ret; +- +- _dbus_assert(connection != NULL); +- +- if (dbus_connection_get_unix_user(connection, &uid) == FALSE) +- return BUS_RESULT_FALSE; +- +- if (_dbus_connection_get_linux_security_label(connection, &label) == FALSE || label == NULL) +- { +- _dbus_warn("Failed to obtain security label for connection\n"); +- return BUS_RESULT_FALSE; +- } +- +- session_id = bus_connection_get_cynara_session_id (connection); +- if (session_id == NULL) +- { +- ret = BUS_RESULT_FALSE; +- goto out; +- } +- +- snprintf(user, sizeof(user), "%lu", uid); +- +-#if USE_CYNARA_CACHE +- result = cynara_async_check_cache(cynara->cynara, label, session_id, user, privilege); +-#else +- result = CYNARA_API_CACHE_MISS; +-#endif +- +- switch (result) +- { +- case CYNARA_API_ACCESS_ALLOWED: +- _dbus_verbose("Cynara: got ALLOWED answer from cache (client=%s session_id=%s user=%s privilege=%s)\n", +- label, session_id, user, privilege); +- ret = BUS_RESULT_TRUE; +- break; +- +- case CYNARA_API_ACCESS_DENIED: +- _dbus_verbose("Cynara: got DENIED answer from cache (client=%s session_id=%s user=%s privilege=%s)\n", +- label, session_id, user, privilege); +- ret = BUS_RESULT_FALSE; +- break; +- +- case CYNARA_API_CACHE_MISS: +- deferred_message = bus_deferred_message_new(message, sender, addressed_recipient, +- proposed_recipient, BUS_RESULT_LATER); +- if (deferred_message == NULL) +- { +- _dbus_verbose("Failed to allocate memory for deferred message\n"); +- ret = BUS_RESULT_FALSE; +- goto out; +- } +- +- /* callback is supposed to unref deferred_message*/ +- result = cynara_async_create_request(cynara->cynara, label, session_id, user, privilege, &check_id, +- &bus_cynara_check_response_callback, deferred_message); +- if (result == CYNARA_API_SUCCESS) +- { +- _dbus_verbose("Created Cynara request: client=%s session_id=%s user=%s privilege=%s check_id=%u " +- "deferred_message=%p\n", label, session_id, user, privilege, (unsigned int)check_id, deferred_message); +- if (deferred_message_param != NULL) +- *deferred_message_param = deferred_message; +- ret = BUS_RESULT_LATER; +- } +- else +- { +- _dbus_verbose("Error on cynara request create: %i\n", result); +- bus_deferred_message_unref(deferred_message); +- ret = BUS_RESULT_FALSE; +- } +- break; +- default: +- _dbus_verbose("Error when accessing Cynara cache: %i\n", result); +- ret = BUS_RESULT_FALSE; +- } +-out: +- dbus_free(label); +- return ret; +- +-#else +- return BUS_RESULT_FALSE; +-#endif +-} +- +- +- +-#ifdef DBUS_ENABLE_CYNARA +-static void +-status_callback(int old_fd, int new_fd, cynara_async_status status, +- void *user_status_data) +-{ +- BusCynara *cynara = (BusCynara *)user_status_data; +- DBusLoop *loop = bus_context_get_loop(cynara->context); +- +- if (cynara->cynara_watch != NULL) +- { +- _dbus_loop_remove_watch(loop, cynara->cynara_watch); +- _dbus_watch_invalidate(cynara->cynara_watch); +- _dbus_watch_unref(cynara->cynara_watch); +- cynara->cynara_watch = NULL; +- } +- +- if (new_fd != -1) +- { +- unsigned int flags; +- DBusWatch *watch; +- +- switch (status) +- { +- case CYNARA_STATUS_FOR_READ: +- flags = DBUS_WATCH_READABLE; +- break; +- case CYNARA_STATUS_FOR_RW: +- flags = DBUS_WATCH_READABLE | DBUS_WATCH_WRITABLE; +- break; +- default: +- /* Cynara passed unknown status - warn and add RW watch */ +- _dbus_verbose("Cynara passed unknown status value: 0x%08X\n", (unsigned int)status); +- flags = DBUS_WATCH_READABLE | DBUS_WATCH_WRITABLE; +- break; +- } +- +- watch = _dbus_watch_new(new_fd, flags, TRUE, &bus_cynara_watch_callback, cynara, NULL); +- if (watch != NULL) +- { +- if (_dbus_loop_add_watch(loop, watch) == TRUE) +- { +- cynara->cynara_watch = watch; +- return; +- } +- +- _dbus_watch_invalidate(watch); +- _dbus_watch_unref(watch); +- } +- +- /* It seems like not much can be done at this point. Cynara events won't be processed +- * until next Cynara function call triggering status callback */ +- _dbus_verbose("Failed to add dbus watch\n"); +- } +-} +- +-static dbus_bool_t +-bus_cynara_watch_callback(DBusWatch *watch, +- unsigned int flags, +- void *data) +-{ +- BusCynara *cynara = (BusCynara *)data; +- int result = cynara_async_process(cynara->cynara); +- if (result != CYNARA_API_SUCCESS) +- _dbus_verbose("cynara_async_process returned %d\n", result); +- +- return result != CYNARA_API_OUT_OF_MEMORY ? TRUE : FALSE; +-} +- +-static inline const char * +-call_cause_to_string(cynara_async_call_cause cause) +-{ +- switch (cause) +- { +- case CYNARA_CALL_CAUSE_ANSWER: +- return "ANSWER"; +- case CYNARA_CALL_CAUSE_CANCEL: +- return "CANCEL"; +- case CYNARA_CALL_CAUSE_FINISH: +- return "FINSIH"; +- case CYNARA_CALL_CAUSE_SERVICE_NOT_AVAILABLE: +- return "SERVICE NOT AVAILABLE"; +- default: +- return "INVALID"; +- } +-} +- +-static void +-bus_cynara_check_response_callback (cynara_check_id check_id, +- cynara_async_call_cause cause, +- int response, +- void *user_response_data) +-{ +- BusDeferredMessage *deferred_message = user_response_data; +- BusResult result; +- +- _dbus_verbose("Cynara callback: check_id=%u, cause=%s response=%i response_data=%p\n", +- (unsigned int)check_id, call_cause_to_string(cause), response, user_response_data); +- +- if (deferred_message == NULL) +- return; +- +- if (cause == CYNARA_CALL_CAUSE_ANSWER && response == CYNARA_API_ACCESS_ALLOWED) +- result = BUS_RESULT_TRUE; +- else +- result = BUS_RESULT_FALSE; +- +- bus_deferred_message_response_received(deferred_message, result); +- bus_deferred_message_unref(deferred_message); +-} +- +-#endif /* DBUS_ENABLE_CYNARA */ +diff --git a/bus/system.conf.in b/bus/system.conf.in +index 19d0c04..81c39c8 100644 +--- a/bus/system.conf.in ++++ b/bus/system.conf.in +@@ -72,10 +72,10 @@ + send_interface="org.freedesktop.DBus.Introspectable"/> + +- + +diff --git a/configure.ac b/configure.ac +index 11b5ffd..df9341c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1742,16 +1742,16 @@ AC_ARG_ENABLE([user-session], + AM_CONDITIONAL([DBUS_ENABLE_USER_SESSION], + [test "x$enable_user_session" = xyes]) + +-#enable cynara integration +-AC_ARG_ENABLE([cynara], [AS_HELP_STRING([--enable-cynara], [enable Cynara integration])], [], [enable_cynara=no]) +-if test "x$enable_cynara" = xyes; then +- PKG_CHECK_MODULES([CYNARA], [cynara-client-async >= 0.6.0 cynara-session >= 0.6.0], +- [AC_DEFINE([DBUS_ENABLE_CYNARA], [1], [Define to enable Cynara privilege checks in dbus-daemon])], +- [AC_MSG_ERROR([libcynara-client-async and cynara-session are required to enable Cynara integration])]) ++#enable cynagora integration ++AC_ARG_ENABLE([cynagora], [AS_HELP_STRING([--enable-cynagora], [enable Cynagora integration])], [], [enable_cynagora=no]) ++if test "x$enable_cynagora" = xyes; then ++ PKG_CHECK_MODULES([CYNAGORA], [cynagora], ++ [AC_DEFINE([DBUS_ENABLE_CYNAGORA], [1], [Define to enable Cynagora privilege checks in dbus-daemon])], ++ [AC_MSG_ERROR([libcynagora is required to enable Cynagora integration])]) + fi + +-AC_SUBST([CYNARA_CFLAGS]) +-AC_SUBST([CYNARA_LIBS]) ++AC_SUBST([CYNAGORA_CFLAGS]) ++AC_SUBST([CYNAGORA_LIBS]) + + AC_CONFIG_FILES([ + Doxyfile +@@ -1835,7 +1835,7 @@ echo " + Building bus stats API: ${enable_stats} + Building SELinux support: ${have_selinux} + Building AppArmor support: ${have_apparmor} +- Building Cynara support: ${enable_cynara} ++ Building Cynagora support: ${enable_cynagora} + Building inotify support: ${have_inotify} + Building kqueue support: ${have_kqueue} + Building systemd support: ${have_systemd} +-- +2.21.1 + diff --git a/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus_1.12.16.bbappend b/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus_1.12.16.bbappend new file mode 100644 index 00000000..177a117b --- /dev/null +++ b/meta-agl/meta-security/recipes-core/dbus-cynagora/dbus_1.12.16.bbappend @@ -0,0 +1,15 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/dbus-cynagora:" + +SRC_URI_append_class-target = "\ + file://0001-Integration-of-Cynara-asynchronous-security-checks.patch \ + file://0002-Disable-message-dispatching-when-send-rule-result-is.patch \ + file://0003-Handle-unavailability-of-policy-results-for-broadcas.patch \ + file://0004-Add-own-rule-result-unavailability-handling.patch \ + file://0005-Perform-Cynara-runtime-policy-checks-by-default.patch \ + file://0006-Fix-SIGSEGV-on-disconnections.patch \ + file://0007-Switch-from-cynara-to-cynagora.patch \ +" + +DEPENDS_append_class-target = " cynagora smack" +EXTRA_OECONF_append_class-target = " ${@bb.utils.contains('DISTRO_FEATURES','smack','--enable-cynagora --disable-selinux','',d)}" + diff --git a/meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0001-Integration-of-Cynara-asynchronous-security-checks.patch b/meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0001-Integration-of-Cynara-asynchronous-security-checks.patch deleted file mode 100644 index 69d13ac3..00000000 --- a/meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0001-Integration-of-Cynara-asynchronous-security-checks.patch +++ /dev/null @@ -1,2232 +0,0 @@ -From 6c498a9b0f4122d1ac49d603f9968b6d85830cdb Mon Sep 17 00:00:00 2001 -From: Jacek Bukarewicz -Date: Thu, 27 Nov 2014 18:11:05 +0100 -Subject: Integration of Cynara asynchronous security checks -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This commit introduces basic framework for asynchronous policy -checks and Cynara integration code. Functions for checking security -policy can now return third value - BUS_RESULT_LATER denoting check -result unavailability. Whenever policy checker cannot decide on the -result of the check it is supposed to allocate DeferredMessage structure -that will be passed to the upper layers which can decide what should be -done in such situation. -Proper handling of such case will be implemented in subsequent commits. -Currently such return value results in message denial. - -Cherry picked from 4dcfb02f17247ff9de966b62182cd2e08f301238 -by José Bollo. - -Updated for dbus 1.10.20 by Scott Murray and José Bollo - -Change-Id: I9bcbce34577e5dc2a3cecf6233a0a2b0e43e1108 -Signed-off-by: José Bollo -Signed-off-by: Scott Murray - -diff --git a/bus/Makefile.am b/bus/Makefile.am -index 9ae3071..46afb31 100644 ---- a/bus/Makefile.am -+++ b/bus/Makefile.am -@@ -13,6 +13,7 @@ DBUS_BUS_LIBS = \ - $(THREAD_LIBS) \ - $(ADT_LIBS) \ - $(NETWORK_libs) \ -+ $(CYNARA_LIBS) \ - $(NULL) - - DBUS_LAUNCHER_LIBS = \ -@@ -30,6 +31,7 @@ AM_CPPFLAGS = \ - $(APPARMOR_CFLAGS) \ - -DDBUS_SYSTEM_CONFIG_FILE=\""$(dbusdatadir)/system.conf"\" \ - -DDBUS_COMPILATION \ -+ $(CYNARA_CFLAGS) \ - $(NULL) - - # if assertions are enabled, improve backtraces -@@ -90,6 +92,8 @@ BUS_SOURCES= \ - audit.h \ - bus.c \ - bus.h \ -+ check.c \ -+ check.h \ - config-loader-expat.c \ - config-parser.c \ - config-parser.h \ -@@ -97,6 +101,8 @@ BUS_SOURCES= \ - config-parser-common.h \ - connection.c \ - connection.h \ -+ cynara.c \ -+ cynara.h \ - desktop-file.c \ - desktop-file.h \ - $(DIR_WATCH_SOURCE) \ -diff --git a/bus/activation.c b/bus/activation.c -index 6f009f5..f8a02eb 100644 ---- a/bus/activation.c -+++ b/bus/activation.c -@@ -1788,14 +1788,15 @@ bus_activation_activate_service (BusActivation *activation, - - if (auto_activation && - entry != NULL && -- !bus_context_check_security_policy (activation->context, -+ BUS_RESULT_TRUE != bus_context_check_security_policy (activation->context, - transaction, - connection, /* sender */ - NULL, /* addressed recipient */ - NULL, /* proposed recipient */ - activation_message, - entry, -- error)) -+ error, -+ NULL)) - { - _DBUS_ASSERT_ERROR_IS_SET (error); - _dbus_verbose ("activation not authorized: %s: %s\n", -diff --git a/bus/bus.c b/bus/bus.c -index 30ce4e1..237efe3 100644 ---- a/bus/bus.c -+++ b/bus/bus.c -@@ -38,6 +38,7 @@ - #include "apparmor.h" - #include "audit.h" - #include "dir-watch.h" -+#include "check.h" - #include - #include - #include -@@ -67,6 +68,7 @@ struct BusContext - BusRegistry *registry; - BusPolicy *policy; - BusMatchmaker *matchmaker; -+ BusCheck *check; - BusLimits limits; - DBusRLimit *initial_fd_limit; - unsigned int fork : 1; -@@ -1003,6 +1005,10 @@ bus_context_new (const DBusString *config_file, - parser = NULL; - } - -+ context->check = bus_check_new(context, error); -+ if (context->check == NULL) -+ goto failed; -+ - dbus_server_free_data_slot (&server_data_slot); - - return context; -@@ -1127,6 +1133,12 @@ bus_context_unref (BusContext *context) - - bus_context_shutdown (context); - -+ if (context->check) -+ { -+ bus_check_unref(context->check); -+ context->check = NULL; -+ } -+ - if (context->connections) - { - bus_connections_unref (context->connections); -@@ -1256,6 +1268,12 @@ bus_context_get_loop (BusContext *context) - return context->loop; - } - -+BusCheck* -+bus_context_get_check (BusContext *context) -+{ -+ return context->check; -+} -+ - dbus_bool_t - bus_context_allow_unix_user (BusContext *context, - unsigned long uid) -@@ -1451,6 +1469,7 @@ complain_about_message (BusContext *context, - DBusConnection *proposed_recipient, - dbus_bool_t requested_reply, - dbus_bool_t log, -+ const char *privilege, - DBusError *error) - { - DBusError stack_error = DBUS_ERROR_INIT; -@@ -1480,7 +1499,8 @@ complain_about_message (BusContext *context, - dbus_set_error (&stack_error, error_name, - "%s, %d matched rules; type=\"%s\", sender=\"%s\" (%s) " - "interface=\"%s\" member=\"%s\" error name=\"%s\" " -- "requested_reply=\"%d\" destination=\"%s\" (%s)", -+ "requested_reply=\"%d\" destination=\"%s\" (%s) " -+ "privilege=\"%s\"", - complaint, - matched_rules, - dbus_message_type_to_string (dbus_message_get_type (message)), -@@ -1491,7 +1511,8 @@ complain_about_message (BusContext *context, - nonnull (dbus_message_get_error_name (message), "(unset)"), - requested_reply, - nonnull (dbus_message_get_destination (message), DBUS_SERVICE_DBUS), -- proposed_recipient_loginfo); -+ proposed_recipient_loginfo, -+ nonnull (privilege, "(n/a)")); - - /* If we hit OOM while setting the error, this will syslog "out of memory" - * which is itself an indication that something is seriously wrong */ -@@ -1519,7 +1540,7 @@ complain_about_message (BusContext *context, - * NULL for addressed_recipient may mean the bus driver, or may mean - * no destination was specified in the message (e.g. a signal). - */ --dbus_bool_t -+BusResult - bus_context_check_security_policy (BusContext *context, - BusTransaction *transaction, - DBusConnection *sender, -@@ -1527,7 +1548,8 @@ bus_context_check_security_policy (BusContext *context, - DBusConnection *proposed_recipient, - DBusMessage *message, - BusActivationEntry *activation_entry, -- DBusError *error) -+ DBusError *error, -+ BusDeferredMessage **deferred_message) - { - const char *src, *dest; - BusClientPolicy *sender_policy; -@@ -1536,6 +1558,7 @@ bus_context_check_security_policy (BusContext *context, - dbus_bool_t log; - int type; - dbus_bool_t requested_reply; -+ const char *privilege; - - type = dbus_message_get_type (message); - src = dbus_message_get_sender (message); -@@ -1565,7 +1588,7 @@ bus_context_check_security_policy (BusContext *context, - dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, - "Message bus will not accept messages of unknown type\n"); - -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - requested_reply = FALSE; -@@ -1595,7 +1618,7 @@ bus_context_check_security_policy (BusContext *context, - if (dbus_error_is_set (&error2)) - { - dbus_move_error (&error2, error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - } - } -@@ -1624,11 +1647,11 @@ bus_context_check_security_policy (BusContext *context, - complain_about_message (context, DBUS_ERROR_ACCESS_DENIED, - "An SELinux policy prevents this sender from sending this " - "message to this recipient", -- 0, message, sender, proposed_recipient, FALSE, FALSE, error); -+ 0, message, sender, proposed_recipient, FALSE, FALSE, NULL, error); - _dbus_verbose ("SELinux security check denying send to service\n"); - } - -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - /* next verify AppArmor access controls. If allowed then -@@ -1646,7 +1669,7 @@ bus_context_check_security_policy (BusContext *context, - src ? src : DBUS_SERVICE_DBUS, - activation_entry, - error)) -- return FALSE; -+ return BUS_RESULT_FALSE; - - if (!bus_connection_is_active (sender)) - { -@@ -1660,7 +1683,7 @@ bus_context_check_security_policy (BusContext *context, - { - _dbus_verbose ("security check allowing %s message\n", - "Hello"); -- return TRUE; -+ return BUS_RESULT_TRUE; - } - else - { -@@ -1671,7 +1694,7 @@ bus_context_check_security_policy (BusContext *context, - "Client tried to send a message other than %s without being registered", - "Hello"); - -- return FALSE; -+ return BUS_RESULT_FALSE; - } - } - } -@@ -1720,20 +1743,29 @@ bus_context_check_security_policy (BusContext *context, - (proposed_recipient == NULL && recipient_policy == NULL)); - - log = FALSE; -- if (sender_policy && -- !bus_client_policy_check_can_send (sender_policy, -- context->registry, -- requested_reply, -- proposed_recipient, -- message, &toggles, &log)) -- { -- complain_about_message (context, DBUS_ERROR_ACCESS_DENIED, -- "Rejected send message", toggles, -- message, sender, proposed_recipient, requested_reply, -- (addressed_recipient == proposed_recipient), error); -- _dbus_verbose ("security policy disallowing message due to sender policy\n"); -- return FALSE; -- } -+ if (sender_policy) -+ { -+ BusResult res = bus_client_policy_check_can_send (sender, -+ sender_policy, -+ context->registry, -+ requested_reply, -+ addressed_recipient, -+ proposed_recipient, -+ message, &toggles, &log, &privilege, -+ deferred_message); -+ if (res == BUS_RESULT_FALSE) -+ { -+ complain_about_message (context, DBUS_ERROR_ACCESS_DENIED, -+ "Rejected send message", toggles, -+ message, sender, proposed_recipient, requested_reply, -+ (addressed_recipient == proposed_recipient), privilege, -+ error); -+ _dbus_verbose ("security policy disallowing message due to sender policy\n"); -+ return BUS_RESULT_FALSE; -+ } -+ else if (res == BUS_RESULT_LATER) -+ return BUS_RESULT_LATER; -+ } - - if (log) - { -@@ -1742,23 +1774,29 @@ bus_context_check_security_policy (BusContext *context, - complain_about_message (context, DBUS_ERROR_ACCESS_DENIED, - "Would reject message", toggles, - message, sender, proposed_recipient, requested_reply, -- TRUE, NULL); -+ TRUE, privilege, NULL); - } - -- if (recipient_policy && -- !bus_client_policy_check_can_receive (recipient_policy, -- context->registry, -- requested_reply, -- sender, -- addressed_recipient, proposed_recipient, -- message, &toggles)) -+ if (recipient_policy) - { -- complain_about_message (context, DBUS_ERROR_ACCESS_DENIED, -- "Rejected receive message", toggles, -- message, sender, proposed_recipient, requested_reply, -- (addressed_recipient == proposed_recipient), error); -- _dbus_verbose ("security policy disallowing message due to recipient policy\n"); -- return FALSE; -+ BusResult res; -+ res = bus_client_policy_check_can_receive (recipient_policy, -+ context->registry, -+ requested_reply, -+ sender, -+ addressed_recipient, proposed_recipient, -+ message, &toggles, &privilege, deferred_message); -+ if (res == BUS_RESULT_FALSE) -+ { -+ complain_about_message(context, DBUS_ERROR_ACCESS_DENIED, "Rejected receive message", -+ toggles, message, sender, proposed_recipient, requested_reply, -+ (addressed_recipient == proposed_recipient), privilege, error); -+ _dbus_verbose( -+ "security policy disallowing message due to recipient policy\n"); -+ return BUS_RESULT_FALSE; -+ } -+ else if (res == BUS_RESULT_LATER) -+ return BUS_RESULT_LATER; - } - - /* See if limits on size have been exceeded */ -@@ -1768,10 +1806,10 @@ bus_context_check_security_policy (BusContext *context, - { - complain_about_message (context, DBUS_ERROR_LIMITS_EXCEEDED, - "Rejected: destination has a full message queue", -- 0, message, sender, proposed_recipient, requested_reply, TRUE, -+ 0, message, sender, proposed_recipient, requested_reply, TRUE, NULL, - error); - _dbus_verbose ("security policy disallowing message due to full message queue\n"); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - /* Record that we will allow a reply here in the future (don't -@@ -1792,11 +1830,11 @@ bus_context_check_security_policy (BusContext *context, - message, error)) - { - _dbus_verbose ("Failed to record reply expectation or problem with the message expecting a reply\n"); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - _dbus_verbose ("security policy allowing message\n"); -- return TRUE; -+ return BUS_RESULT_TRUE; - } - - void -diff --git a/bus/bus.h b/bus/bus.h -index 2e0de82..82c32c8 100644 ---- a/bus/bus.h -+++ b/bus/bus.h -@@ -45,6 +45,22 @@ typedef struct BusTransaction BusTransaction; - typedef struct BusMatchmaker BusMatchmaker; - typedef struct BusMatchRule BusMatchRule; - typedef struct BusActivationEntry BusActivationEntry; -+typedef struct BusCheck BusCheck; -+typedef struct BusDeferredMessage BusDeferredMessage; -+typedef struct BusCynara BusCynara; -+ -+/** -+ * BusResult is defined as a pointer to a dummy structure to allow detection of type mismatches. -+ * The disadvantage of such solution is that now BusResult variables cannot be used in switch -+ * statement. -+ * Additionally, BUS_RESULT_TRUE is defined as 0 instead of 1 to help detect type mismatches -+ * at runtime. -+ */ -+typedef const struct BusResultStruct { int dummy; } *BusResult; -+ -+static const BusResult BUS_RESULT_TRUE = (BusResult)0x0; -+static const BusResult BUS_RESULT_FALSE = (BusResult)0x1; -+static const BusResult BUS_RESULT_LATER = (BusResult)0x2; - - typedef struct - { -@@ -101,6 +117,7 @@ BusConnections* bus_context_get_connections (BusContext - BusActivation* bus_context_get_activation (BusContext *context); - BusMatchmaker* bus_context_get_matchmaker (BusContext *context); - DBusLoop* bus_context_get_loop (BusContext *context); -+BusCheck * bus_context_get_check (BusContext *context); - dbus_bool_t bus_context_allow_unix_user (BusContext *context, - unsigned long uid); - dbus_bool_t bus_context_allow_windows_user (BusContext *context, -@@ -136,14 +153,15 @@ void bus_context_log_and_set_error (BusContext - const char *name, - const char *msg, - ...) _DBUS_GNUC_PRINTF (5, 6); --dbus_bool_t bus_context_check_security_policy (BusContext *context, -+BusResult bus_context_check_security_policy (BusContext *context, - BusTransaction *transaction, - DBusConnection *sender, - DBusConnection *addressed_recipient, - DBusConnection *proposed_recipient, - DBusMessage *message, - BusActivationEntry *activation_entry, -- DBusError *error); -+ DBusError *error, -+ BusDeferredMessage **deferred_message); - void bus_context_check_all_watches (BusContext *context); - - #endif /* BUS_BUS_H */ -diff --git a/bus/check.c b/bus/check.c -new file mode 100644 -index 0000000..5b72d31 ---- /dev/null -+++ b/bus/check.c -@@ -0,0 +1,217 @@ -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ -+/* check.c Bus security policy runtime check -+ * -+ * Copyright (C) 2014 Intel, Inc. -+ * Copyright (c) 2014 Samsung Electronics, Ltd. -+ * -+ * Licensed under the Academic Free License version 2.1 -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ * -+ */ -+ -+#include -+#include "check.h" -+#include "connection.h" -+#include "dispatch.h" -+#include "cynara.h" -+#include "utils.h" -+#include -+#include -+#include -+ -+ -+typedef struct BusCheck -+{ -+ int refcount; -+ -+ BusContext *context; -+ BusCynara *cynara; -+} BusCheck; -+ -+typedef struct BusDeferredMessage -+{ -+ int refcount; -+ -+ DBusMessage *message; -+ DBusConnection *sender; -+ DBusConnection *proposed_recipient; -+ DBusConnection *addressed_recipient; -+ dbus_bool_t full_dispatch; -+ BusDeferredMessageStatus status; -+ BusResult response; -+ BusCheckResponseFunc response_callback; -+} BusDeferredMessage; -+ -+BusCheck * -+bus_check_new (BusContext *context, DBusError *error) -+{ -+ BusCheck *check; -+ -+ check = dbus_new(BusCheck, 1); -+ if (check == NULL) -+ { -+ BUS_SET_OOM(error); -+ return NULL; -+ } -+ -+ check->refcount = 1; -+ check->context = context; -+ check->cynara = bus_cynara_new(check, error); -+ if (dbus_error_is_set(error)) -+ { -+ dbus_free(check); -+ return NULL; -+ } -+ -+ return check; -+} -+ -+BusCheck * -+bus_check_ref (BusCheck *check) -+{ -+ _dbus_assert (check->refcount > 0); -+ check->refcount += 1; -+ -+ return check; -+} -+ -+void -+bus_check_unref (BusCheck *check) -+{ -+ _dbus_assert (check->refcount > 0); -+ -+ check->refcount -= 1; -+ -+ if (check->refcount == 0) -+ { -+ bus_cynara_unref(check->cynara); -+ dbus_free(check); -+ } -+} -+ -+BusContext * -+bus_check_get_context (BusCheck *check) -+{ -+ return check->context; -+} -+ -+BusCynara * -+bus_check_get_cynara (BusCheck *check) -+{ -+ return check->cynara; -+} -+ -+BusResult -+bus_check_privilege (BusCheck *check, -+ DBusMessage *message, -+ DBusConnection *sender, -+ DBusConnection *addressed_recipient, -+ DBusConnection *proposed_recipient, -+ const char *privilege, -+ BusDeferredMessageStatus check_type, -+ BusDeferredMessage **deferred_message) -+{ -+ BusResult result = BUS_RESULT_FALSE; -+#ifdef DBUS_ENABLE_CYNARA -+ BusCynara *cynara; -+#endif -+ DBusConnection *connection; -+ -+ connection = check_type == BUS_DEFERRED_MESSAGE_CHECK_RECEIVE ? proposed_recipient : sender; -+ -+ if (!dbus_connection_get_is_connected(connection)) -+ { -+ return BUS_RESULT_FALSE; -+ } -+ -+ /* ask policy checkers */ -+#ifdef DBUS_ENABLE_CYNARA -+ cynara = bus_check_get_cynara(check); -+ result = bus_cynara_check_privilege(cynara, message, sender, addressed_recipient, -+ proposed_recipient, privilege, check_type, deferred_message); -+#endif -+ -+ if (result == BUS_RESULT_LATER && deferred_message != NULL) -+ { -+ (*deferred_message)->status |= check_type; -+ } -+ return result; -+} -+ -+BusDeferredMessage *bus_deferred_message_new (DBusMessage *message, -+ DBusConnection *sender, -+ DBusConnection *addressed_recipient, -+ DBusConnection *proposed_recipient, -+ BusResult response) -+{ -+ BusDeferredMessage *deferred_message; -+ -+ deferred_message = dbus_new(BusDeferredMessage, 1); -+ if (deferred_message == NULL) -+ { -+ return NULL; -+ } -+ -+ deferred_message->refcount = 1; -+ deferred_message->sender = sender != NULL ? dbus_connection_ref(sender) : NULL; -+ deferred_message->addressed_recipient = addressed_recipient != NULL ? dbus_connection_ref(addressed_recipient) : NULL; -+ deferred_message->proposed_recipient = proposed_recipient != NULL ? dbus_connection_ref(proposed_recipient) : NULL; -+ deferred_message->message = dbus_message_ref(message); -+ deferred_message->response = response; -+ deferred_message->status = 0; -+ deferred_message->full_dispatch = FALSE; -+ deferred_message->response_callback = NULL; -+ -+ return deferred_message; -+} -+ -+BusDeferredMessage * -+bus_deferred_message_ref (BusDeferredMessage *deferred_message) -+{ -+ _dbus_assert (deferred_message->refcount > 0); -+ deferred_message->refcount += 1; -+ return deferred_message; -+} -+ -+void -+bus_deferred_message_unref (BusDeferredMessage *deferred_message) -+{ -+ _dbus_assert (deferred_message->refcount > 0); -+ -+ deferred_message->refcount -= 1; -+ -+ if (deferred_message->refcount == 0) -+ { -+ dbus_message_unref(deferred_message->message); -+ if (deferred_message->sender != NULL) -+ dbus_connection_unref(deferred_message->sender); -+ if (deferred_message->addressed_recipient != NULL) -+ dbus_connection_unref(deferred_message->addressed_recipient); -+ if (deferred_message->proposed_recipient != NULL) -+ dbus_connection_unref(deferred_message->proposed_recipient); -+ dbus_free(deferred_message); -+ } -+} -+ -+void -+bus_deferred_message_response_received (BusDeferredMessage *deferred_message, -+ BusResult result) -+{ -+ if (deferred_message->response_callback != NULL) -+ { -+ deferred_message->response_callback(deferred_message, result); -+ } -+} -diff --git a/bus/check.h b/bus/check.h -new file mode 100644 -index 0000000..c3fcaf9 ---- /dev/null -+++ b/bus/check.h -@@ -0,0 +1,68 @@ -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ -+/* check.h Bus security policy runtime check -+ * -+ * Copyright (C) 2014 Intel, Inc. -+ * Copyright (c) 2014 Samsung Electronics, Ltd. -+ * -+ * Licensed under the Academic Free License version 2.1 -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ * -+ */ -+ -+#ifndef BUS_CHECK_H -+#define BUS_CHECK_H -+ -+#include "bus.h" -+#include "policy.h" -+ -+ -+typedef void (*BusCheckResponseFunc) (BusDeferredMessage *message, -+ BusResult result); -+ -+typedef enum { -+ BUS_DEFERRED_MESSAGE_CHECK_SEND = 1 << 0, -+ BUS_DEFERRED_MESSAGE_CHECK_RECEIVE = 1 << 1, -+ BUS_DEFERRED_MESSAGE_CHECK_OWN = 1 << 2, -+} BusDeferredMessageStatus; -+ -+ -+BusCheck *bus_check_new (BusContext *context, -+ DBusError *error); -+BusCheck *bus_check_ref (BusCheck *check); -+void bus_check_unref (BusCheck *check); -+ -+BusContext *bus_check_get_context (BusCheck *check); -+BusCynara *bus_check_get_cynara (BusCheck *check); -+BusResult bus_check_privilege (BusCheck *check, -+ DBusMessage *message, -+ DBusConnection *sender, -+ DBusConnection *addressed_recipient, -+ DBusConnection *proposed_recipient, -+ const char *privilege, -+ BusDeferredMessageStatus check_type, -+ BusDeferredMessage **deferred_message); -+ -+BusDeferredMessage *bus_deferred_message_new (DBusMessage *message, -+ DBusConnection *sender, -+ DBusConnection *addressed_recipient, -+ DBusConnection *proposed_recipient, -+ BusResult response); -+ -+BusDeferredMessage *bus_deferred_message_ref (BusDeferredMessage *deferred_message); -+void bus_deferred_message_unref (BusDeferredMessage *deferred_message); -+void bus_deferred_message_response_received (BusDeferredMessage *deferred_message, -+ BusResult result); -+#endif /* BUS_CHECK_H */ -diff --git a/bus/config-parser-common.c b/bus/config-parser-common.c -index c1c4191..e2f253d 100644 ---- a/bus/config-parser-common.c -+++ b/bus/config-parser-common.c -@@ -75,6 +75,10 @@ bus_config_parser_element_name_to_type (const char *name) - { - return ELEMENT_DENY; - } -+ else if (strcmp (name, "check") == 0) -+ { -+ return ELEMENT_CHECK; -+ } - else if (strcmp (name, "servicehelper") == 0) - { - return ELEMENT_SERVICEHELPER; -@@ -159,6 +163,8 @@ bus_config_parser_element_type_to_name (ElementType type) - return "allow"; - case ELEMENT_DENY: - return "deny"; -+ case ELEMENT_CHECK: -+ return "check"; - case ELEMENT_FORK: - return "fork"; - case ELEMENT_PIDFILE: -diff --git a/bus/config-parser-common.h b/bus/config-parser-common.h -index 382a014..9e026d1 100644 ---- a/bus/config-parser-common.h -+++ b/bus/config-parser-common.h -@@ -36,6 +36,7 @@ typedef enum - ELEMENT_LIMIT, - ELEMENT_ALLOW, - ELEMENT_DENY, -+ ELEMENT_CHECK, - ELEMENT_FORK, - ELEMENT_PIDFILE, - ELEMENT_SERVICEDIR, -diff --git a/bus/config-parser.c b/bus/config-parser.c -index be27d38..b5f1dd1 100644 ---- a/bus/config-parser.c -+++ b/bus/config-parser.c -@@ -1318,7 +1318,7 @@ append_rule_from_element (BusConfigParser *parser, - const char *element_name, - const char **attribute_names, - const char **attribute_values, -- dbus_bool_t allow, -+ BusPolicyRuleAccess access, - DBusError *error) - { - const char *log; -@@ -1360,6 +1360,7 @@ append_rule_from_element (BusConfigParser *parser, - const char *own_prefix; - const char *user; - const char *group; -+ const char *privilege; - - BusPolicyRule *rule; - -@@ -1390,6 +1391,7 @@ append_rule_from_element (BusConfigParser *parser, - "user", &user, - "group", &group, - "log", &log, -+ "privilege", &privilege, - NULL)) - return FALSE; - -@@ -1422,6 +1424,7 @@ append_rule_from_element (BusConfigParser *parser, - - if (!(any_send_attribute || - any_receive_attribute || -+ privilege || - own || own_prefix || user || group)) - { - dbus_set_error (error, DBUS_ERROR_FAILED, -@@ -1438,7 +1441,30 @@ append_rule_from_element (BusConfigParser *parser, - element_name); - return FALSE; - } -- -+ -+ if (access == BUS_POLICY_RULE_ACCESS_CHECK) -+ { -+ if (privilege == NULL || !*privilege) -+ { -+ dbus_set_error (error, DBUS_ERROR_FAILED, -+ "On element <%s>, you must specify the privilege to be checked.", -+ element_name); -+ return FALSE; -+ } -+ } -+ else -+ { -+ if (privilege != NULL && *privilege) -+ { -+ dbus_set_error (error, DBUS_ERROR_FAILED, -+ "On element <%s>, privilege %s is used outside of a check rule.", -+ element_name, privilege); -+ return FALSE; -+ } -+ else -+ privilege = NULL; /* replace (potentially) empty string with NULL pointer, it wouldn't be used anyway */ -+ } -+ - /* Allowed combinations of elements are: - * - * base, must be all send or all receive: -@@ -1589,7 +1615,7 @@ append_rule_from_element (BusConfigParser *parser, - error)) - return FALSE; - -- rule = bus_policy_rule_new (BUS_POLICY_RULE_SEND, allow); -+ rule = bus_policy_rule_new (BUS_POLICY_RULE_SEND, access); - if (rule == NULL) - goto nomem; - -@@ -1694,7 +1720,7 @@ append_rule_from_element (BusConfigParser *parser, - error)) - return FALSE; - -- rule = bus_policy_rule_new (BUS_POLICY_RULE_RECEIVE, allow); -+ rule = bus_policy_rule_new (BUS_POLICY_RULE_RECEIVE, access); - if (rule == NULL) - goto nomem; - -@@ -1726,7 +1752,7 @@ append_rule_from_element (BusConfigParser *parser, - } - else if (own || own_prefix) - { -- rule = bus_policy_rule_new (BUS_POLICY_RULE_OWN, allow); -+ rule = bus_policy_rule_new (BUS_POLICY_RULE_OWN, access); - if (rule == NULL) - goto nomem; - -@@ -1752,7 +1778,7 @@ append_rule_from_element (BusConfigParser *parser, - { - if (IS_WILDCARD (user)) - { -- rule = bus_policy_rule_new (BUS_POLICY_RULE_USER, allow); -+ rule = bus_policy_rule_new (BUS_POLICY_RULE_USER, access); - if (rule == NULL) - goto nomem; - -@@ -1767,7 +1793,7 @@ append_rule_from_element (BusConfigParser *parser, - - if (_dbus_parse_unix_user_from_config (&username, &uid)) - { -- rule = bus_policy_rule_new (BUS_POLICY_RULE_USER, allow); -+ rule = bus_policy_rule_new (BUS_POLICY_RULE_USER, access); - if (rule == NULL) - goto nomem; - -@@ -1784,7 +1810,7 @@ append_rule_from_element (BusConfigParser *parser, - { - if (IS_WILDCARD (group)) - { -- rule = bus_policy_rule_new (BUS_POLICY_RULE_GROUP, allow); -+ rule = bus_policy_rule_new (BUS_POLICY_RULE_GROUP, access); - if (rule == NULL) - goto nomem; - -@@ -1799,7 +1825,7 @@ append_rule_from_element (BusConfigParser *parser, - - if (_dbus_parse_unix_group_from_config (&groupname, &gid)) - { -- rule = bus_policy_rule_new (BUS_POLICY_RULE_GROUP, allow); -+ rule = bus_policy_rule_new (BUS_POLICY_RULE_GROUP, access); - if (rule == NULL) - goto nomem; - -@@ -1823,6 +1849,10 @@ append_rule_from_element (BusConfigParser *parser, - _dbus_assert (pe != NULL); - _dbus_assert (pe->type == ELEMENT_POLICY); - -+ rule->privilege = _dbus_strdup (privilege); -+ if (privilege && !rule->privilege) -+ goto nomem; -+ - switch (pe->d.policy.type) - { - case POLICY_IGNORED: -@@ -1898,7 +1928,7 @@ start_policy_child (BusConfigParser *parser, - { - if (!append_rule_from_element (parser, element_name, - attribute_names, attribute_values, -- TRUE, error)) -+ BUS_POLICY_RULE_ACCESS_ALLOW, error)) - return FALSE; - - if (push_element (parser, ELEMENT_ALLOW) == NULL) -@@ -1913,7 +1943,7 @@ start_policy_child (BusConfigParser *parser, - { - if (!append_rule_from_element (parser, element_name, - attribute_names, attribute_values, -- FALSE, error)) -+ BUS_POLICY_RULE_ACCESS_DENY, error)) - return FALSE; - - if (push_element (parser, ELEMENT_DENY) == NULL) -@@ -1922,6 +1952,21 @@ start_policy_child (BusConfigParser *parser, - return FALSE; - } - -+ return TRUE; -+ } -+ else if (strcmp (element_name, "check") == 0) -+ { -+ if (!append_rule_from_element (parser, element_name, -+ attribute_names, attribute_values, -+ BUS_POLICY_RULE_ACCESS_CHECK, error)) -+ return FALSE; -+ -+ if (push_element (parser, ELEMENT_CHECK) == NULL) -+ { -+ BUS_SET_OOM (error); -+ return FALSE; -+ } -+ - return TRUE; - } - else -@@ -2284,6 +2329,7 @@ bus_config_parser_end_element (BusConfigParser *parser, - case ELEMENT_POLICY: - case ELEMENT_ALLOW: - case ELEMENT_DENY: -+ case ELEMENT_CHECK: - case ELEMENT_FORK: - case ELEMENT_SYSLOG: - case ELEMENT_KEEP_UMASK: -@@ -2600,6 +2646,7 @@ bus_config_parser_content (BusConfigParser *parser, - case ELEMENT_POLICY: - case ELEMENT_ALLOW: - case ELEMENT_DENY: -+ case ELEMENT_CHECK: - case ELEMENT_FORK: - case ELEMENT_SYSLOG: - case ELEMENT_KEEP_UMASK: -@@ -3127,6 +3174,8 @@ do_load (const DBusString *full_path, - dbus_error_init (&error); - - parser = bus_config_load (full_path, TRUE, NULL, &error); -+ if (dbus_error_is_set (&error)) -+ _dbus_verbose ("Failed to load file: %s\n", error.message); - if (parser == NULL) - { - _DBUS_ASSERT_ERROR_IS_SET (&error); -diff --git a/bus/connection.c b/bus/connection.c -index 53605fa..b348d42 100644 ---- a/bus/connection.c -+++ b/bus/connection.c -@@ -36,6 +36,10 @@ - #include - #include - #include -+#ifdef DBUS_ENABLE_CYNARA -+#include -+#include -+#endif - - /* Trim executed commands to this length; we want to keep logs readable */ - #define MAX_LOG_COMMAND_LEN 50 -@@ -116,6 +120,9 @@ typedef struct - - /** non-NULL if and only if this is a monitor */ - DBusList *link_in_monitors; -+#ifdef DBUS_ENABLE_CYNARA -+ char *cynara_session_id; -+#endif - } BusConnectionData; - - static dbus_bool_t bus_pending_reply_expired (BusExpireList *list, -@@ -129,8 +136,8 @@ static dbus_bool_t expire_incomplete_timeout (void *data); - - #define BUS_CONNECTION_DATA(connection) (dbus_connection_get_data ((connection), connection_data_slot)) - --static DBusLoop* --connection_get_loop (DBusConnection *connection) -+DBusLoop* -+bus_connection_get_loop (DBusConnection *connection) - { - BusConnectionData *d; - -@@ -354,7 +361,7 @@ add_connection_watch (DBusWatch *watch, - { - DBusConnection *connection = data; - -- return _dbus_loop_add_watch (connection_get_loop (connection), watch); -+ return _dbus_loop_add_watch (bus_connection_get_loop (connection), watch); - } - - static void -@@ -363,7 +370,7 @@ remove_connection_watch (DBusWatch *watch, - { - DBusConnection *connection = data; - -- _dbus_loop_remove_watch (connection_get_loop (connection), watch); -+ _dbus_loop_remove_watch (bus_connection_get_loop (connection), watch); - } - - static void -@@ -372,7 +379,7 @@ toggle_connection_watch (DBusWatch *watch, - { - DBusConnection *connection = data; - -- _dbus_loop_toggle_watch (connection_get_loop (connection), watch); -+ _dbus_loop_toggle_watch (bus_connection_get_loop (connection), watch); - } - - static dbus_bool_t -@@ -381,7 +388,7 @@ add_connection_timeout (DBusTimeout *timeout, - { - DBusConnection *connection = data; - -- return _dbus_loop_add_timeout (connection_get_loop (connection), timeout); -+ return _dbus_loop_add_timeout (bus_connection_get_loop (connection), timeout); - } - - static void -@@ -390,7 +397,7 @@ remove_connection_timeout (DBusTimeout *timeout, - { - DBusConnection *connection = data; - -- _dbus_loop_remove_timeout (connection_get_loop (connection), timeout); -+ _dbus_loop_remove_timeout (bus_connection_get_loop (connection), timeout); - } - - static void -@@ -448,6 +455,10 @@ free_connection_data (void *data) - - dbus_free (d->name); - -+#ifdef DBUS_ENABLE_CYNARA -+ free (d->cynara_session_id); -+#endif -+ - dbus_free (d); - } - -@@ -1078,6 +1089,22 @@ bus_connection_get_policy (DBusConnection *connection) - return d->policy; - } - -+#ifdef DBUS_ENABLE_CYNARA -+const char *bus_connection_get_cynara_session_id (DBusConnection *connection) -+{ -+ BusConnectionData *d = BUS_CONNECTION_DATA (connection); -+ _dbus_assert (d != NULL); -+ -+ if (d->cynara_session_id == NULL) -+ { -+ unsigned long pid; -+ if (dbus_connection_get_unix_process_id(connection, &pid)) -+ d->cynara_session_id = cynara_session_from_pid(pid); -+ } -+ return d->cynara_session_id; -+} -+#endif -+ - static dbus_bool_t - foreach_active (BusConnections *connections, - BusConnectionForeachFunction function, -@@ -2333,6 +2360,7 @@ bus_transaction_send_from_driver (BusTransaction *transaction, - DBusMessage *message) - { - DBusError error = DBUS_ERROR_INIT; -+ BusResult res; - - /* We have to set the sender to the driver, and have - * to check security policy since it was not done in -@@ -2370,10 +2398,11 @@ bus_transaction_send_from_driver (BusTransaction *transaction, - * if we're actively capturing messages, it's nice to log that we - * tried to send it and did not allow ourselves to do so. - */ -- if (!bus_context_check_security_policy (bus_transaction_get_context (transaction), -- transaction, -- NULL, connection, connection, -- message, NULL, &error)) -+ res = bus_context_check_security_policy (bus_transaction_get_context (transaction), -+ transaction, -+ NULL, connection, connection, message, NULL, -+ &error, NULL); -+ if (res == BUS_RESULT_FALSE) - { - if (!bus_transaction_capture_error_reply (transaction, connection, - &error, message)) -@@ -2388,6 +2417,12 @@ bus_transaction_send_from_driver (BusTransaction *transaction, - dbus_error_free (&error); - return TRUE; - } -+ else if (res == BUS_RESULT_LATER) -+ { -+ _dbus_verbose ("Cannot delay sending message from bus driver, dropping it\n"); -+ dbus_error_free (&error); -+ return TRUE; -+ } - - return bus_transaction_send (transaction, connection, message); - } -diff --git a/bus/connection.h b/bus/connection.h -index 9e253ae..71078ea 100644 ---- a/bus/connection.h -+++ b/bus/connection.h -@@ -31,6 +31,7 @@ - typedef dbus_bool_t (* BusConnectionForeachFunction) (DBusConnection *connection, - void *data); - -+DBusLoop* bus_connection_get_loop (DBusConnection *connection); - - BusConnections* bus_connections_new (BusContext *context); - BusConnections* bus_connections_ref (BusConnections *connections); -@@ -124,6 +125,9 @@ dbus_bool_t bus_connection_be_monitor (DBusConnection *connection, - BusTransaction *transaction, - DBusList **rules, - DBusError *error); -+#ifdef DBUS_ENABLE_CYNARA -+const char *bus_connection_get_cynara_session_id (DBusConnection *connection); -+#endif - - /* transaction API so we can send or not send a block of messages as a whole */ - -diff --git a/bus/cynara.c b/bus/cynara.c -new file mode 100644 -index 0000000..57a4c45 ---- /dev/null -+++ b/bus/cynara.c -@@ -0,0 +1,374 @@ -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ -+/* cynara.c Cynara runtime privilege checking -+ * -+ * Copyright (c) 2014 Samsung Electronics, Ltd. -+ * -+ * Licensed under the Academic Free License version 2.1 -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ * -+ */ -+ -+#include -+#include "cynara.h" -+#include "check.h" -+#include "utils.h" -+ -+#include -+ -+#include -+#include -+#include -+#include -+#ifdef DBUS_ENABLE_CYNARA -+#include -+#endif -+ -+ -+#ifdef DBUS_ENABLE_CYNARA -+typedef struct BusCynara -+{ -+ int refcount; -+ -+ BusContext *context; -+ BusCheck *check; -+ cynara_async *cynara; -+ DBusWatch *cynara_watch; -+} BusCynara; -+ -+#define USE_CYNARA_CACHE 1 -+#ifdef USE_CYNARA_CACHE -+#define CYNARA_CACHE_SIZE 7000 -+#endif -+ -+static dbus_bool_t bus_cynara_watch_callback(DBusWatch *watch, -+ unsigned int flags, -+ void *data); -+ -+static void status_callback(int old_fd, -+ int new_fd, -+ cynara_async_status status, -+ void *user_status_data); -+static void bus_cynara_check_response_callback (cynara_check_id check_id, -+ cynara_async_call_cause cause, -+ int response, -+ void *user_response_data); -+#endif -+ -+ -+BusCynara * -+bus_cynara_new(BusCheck *check, DBusError *error) -+{ -+#ifdef DBUS_ENABLE_CYNARA -+ BusContext *context; -+ BusCynara *cynara; -+ cynara_async_configuration *conf = NULL; -+ int ret; -+ -+ cynara = dbus_new(BusCynara, 1); -+ if (cynara == NULL) -+ { -+ BUS_SET_OOM(error); -+ return NULL; -+ } -+ -+ context = bus_check_get_context(check); -+ -+ cynara->refcount = 1; -+ cynara->check = check; -+ cynara->context = context; -+ cynara->cynara_watch = NULL; -+ -+ ret = cynara_async_configuration_create(&conf); -+ if (ret != CYNARA_API_SUCCESS) -+ { -+ dbus_set_error (error, DBUS_ERROR_FAILED, "Failed to create Cynara configuration"); -+ goto out; -+ } -+ -+#ifdef CYNARA_CACHE_SIZE -+ ret = cynara_async_configuration_set_cache_size(conf, CYNARA_CACHE_SIZE); -+ if (ret != CYNARA_API_SUCCESS) -+ { -+ dbus_set_error (error, DBUS_ERROR_FAILED, "Failed to Cynara cache size"); -+ goto out; -+ } -+#endif -+ -+ ret = cynara_async_initialize(&cynara->cynara, conf, &status_callback, cynara); -+ if (ret != CYNARA_API_SUCCESS) -+ { -+ dbus_set_error (error, DBUS_ERROR_FAILED, "Failed to initialize Cynara client"); -+ goto out; -+ } -+ -+out: -+ cynara_async_configuration_destroy(conf); -+ if (ret != CYNARA_API_SUCCESS) -+ { -+ dbus_free(cynara); -+ return NULL; -+ } -+ -+ return cynara; -+#else -+ return NULL; -+#endif -+} -+ -+BusCynara * -+bus_cynara_ref (BusCynara *cynara) -+{ -+#ifdef DBUS_ENABLE_CYNARA -+ _dbus_assert (cynara->refcount > 0); -+ cynara->refcount += 1; -+ -+ return cynara; -+#else -+ return NULL; -+#endif -+} -+ -+void -+bus_cynara_unref (BusCynara *cynara) -+{ -+#ifdef DBUS_ENABLE_CYNARA -+ _dbus_assert (cynara->refcount > 0); -+ -+ cynara->refcount -= 1; -+ -+ if (cynara->refcount == 0) -+ { -+ cynara_async_finish(cynara->cynara); -+ dbus_free(cynara); -+ } -+#endif -+} -+ -+BusResult -+bus_cynara_check_privilege (BusCynara *cynara, -+ DBusMessage *message, -+ DBusConnection *sender, -+ DBusConnection *addressed_recipient, -+ DBusConnection *proposed_recipient, -+ const char *privilege, -+ BusDeferredMessageStatus check_type, -+ BusDeferredMessage **deferred_message_param) -+{ -+#ifdef DBUS_ENABLE_CYNARA -+ int result; -+ unsigned long uid; -+ char *label; -+ const char *session_id; -+ char user[32]; -+ cynara_check_id check_id; -+ DBusConnection *connection = check_type == BUS_DEFERRED_MESSAGE_CHECK_RECEIVE ? proposed_recipient : sender; -+ BusDeferredMessage *deferred_message; -+ BusResult ret; -+ -+ _dbus_assert(connection != NULL); -+ -+ if (dbus_connection_get_unix_user(connection, &uid) == FALSE) -+ return BUS_RESULT_FALSE; -+ -+ if (_dbus_connection_get_linux_security_label(connection, &label) == FALSE || label == NULL) -+ { -+ _dbus_warn("Failed to obtain security label for connection\n"); -+ return BUS_RESULT_FALSE; -+ } -+ -+ session_id = bus_connection_get_cynara_session_id (connection); -+ if (session_id == NULL) -+ { -+ ret = BUS_RESULT_FALSE; -+ goto out; -+ } -+ -+ snprintf(user, sizeof(user), "%lu", uid); -+ -+#if USE_CYNARA_CACHE -+ result = cynara_async_check_cache(cynara->cynara, label, session_id, user, privilege); -+#else -+ result = CYNARA_API_CACHE_MISS; -+#endif -+ -+ switch (result) -+ { -+ case CYNARA_API_ACCESS_ALLOWED: -+ _dbus_verbose("Cynara: got ALLOWED answer from cache (client=%s session_id=%s user=%s privilege=%s)\n", -+ label, session_id, user, privilege); -+ ret = BUS_RESULT_TRUE; -+ break; -+ -+ case CYNARA_API_ACCESS_DENIED: -+ _dbus_verbose("Cynara: got DENIED answer from cache (client=%s session_id=%s user=%s privilege=%s)\n", -+ label, session_id, user, privilege); -+ ret = BUS_RESULT_FALSE; -+ break; -+ -+ case CYNARA_API_CACHE_MISS: -+ deferred_message = bus_deferred_message_new(message, sender, addressed_recipient, -+ proposed_recipient, BUS_RESULT_LATER); -+ if (deferred_message == NULL) -+ { -+ _dbus_verbose("Failed to allocate memory for deferred message\n"); -+ ret = BUS_RESULT_FALSE; -+ goto out; -+ } -+ -+ /* callback is supposed to unref deferred_message*/ -+ result = cynara_async_create_request(cynara->cynara, label, session_id, user, privilege, &check_id, -+ &bus_cynara_check_response_callback, deferred_message); -+ if (result == CYNARA_API_SUCCESS) -+ { -+ _dbus_verbose("Created Cynara request: client=%s session_id=%s user=%s privilege=%s check_id=%u " -+ "deferred_message=%p\n", label, session_id, user, privilege, (unsigned int)check_id, deferred_message); -+ if (deferred_message_param != NULL) -+ *deferred_message_param = deferred_message; -+ ret = BUS_RESULT_LATER; -+ } -+ else -+ { -+ _dbus_verbose("Error on cynara request create: %i\n", result); -+ bus_deferred_message_unref(deferred_message); -+ ret = BUS_RESULT_FALSE; -+ } -+ break; -+ default: -+ _dbus_verbose("Error when accessing Cynara cache: %i\n", result); -+ ret = BUS_RESULT_FALSE; -+ } -+out: -+ dbus_free(label); -+ return ret; -+ -+#else -+ return BUS_RESULT_FALSE; -+#endif -+} -+ -+ -+ -+#ifdef DBUS_ENABLE_CYNARA -+static void -+status_callback(int old_fd, int new_fd, cynara_async_status status, -+ void *user_status_data) -+{ -+ BusCynara *cynara = (BusCynara *)user_status_data; -+ DBusLoop *loop = bus_context_get_loop(cynara->context); -+ -+ if (cynara->cynara_watch != NULL) -+ { -+ _dbus_loop_remove_watch(loop, cynara->cynara_watch); -+ _dbus_watch_invalidate(cynara->cynara_watch); -+ _dbus_watch_unref(cynara->cynara_watch); -+ cynara->cynara_watch = NULL; -+ } -+ -+ if (new_fd != -1) -+ { -+ unsigned int flags; -+ DBusWatch *watch; -+ -+ switch (status) -+ { -+ case CYNARA_STATUS_FOR_READ: -+ flags = DBUS_WATCH_READABLE; -+ break; -+ case CYNARA_STATUS_FOR_RW: -+ flags = DBUS_WATCH_READABLE | DBUS_WATCH_WRITABLE; -+ break; -+ default: -+ /* Cynara passed unknown status - warn and add RW watch */ -+ _dbus_verbose("Cynara passed unknown status value: 0x%08X\n", (unsigned int)status); -+ flags = DBUS_WATCH_READABLE | DBUS_WATCH_WRITABLE; -+ break; -+ } -+ -+ watch = _dbus_watch_new(new_fd, flags, TRUE, &bus_cynara_watch_callback, cynara, NULL); -+ if (watch != NULL) -+ { -+ if (_dbus_loop_add_watch(loop, watch) == TRUE) -+ { -+ cynara->cynara_watch = watch; -+ return; -+ } -+ -+ _dbus_watch_invalidate(watch); -+ _dbus_watch_unref(watch); -+ } -+ -+ /* It seems like not much can be done at this point. Cynara events won't be processed -+ * until next Cynara function call triggering status callback */ -+ _dbus_verbose("Failed to add dbus watch\n"); -+ } -+} -+ -+static dbus_bool_t -+bus_cynara_watch_callback(DBusWatch *watch, -+ unsigned int flags, -+ void *data) -+{ -+ BusCynara *cynara = (BusCynara *)data; -+ int result = cynara_async_process(cynara->cynara); -+ if (result != CYNARA_API_SUCCESS) -+ _dbus_verbose("cynara_async_process returned %d\n", result); -+ -+ return result != CYNARA_API_OUT_OF_MEMORY ? TRUE : FALSE; -+} -+ -+static inline const char * -+call_cause_to_string(cynara_async_call_cause cause) -+{ -+ switch (cause) -+ { -+ case CYNARA_CALL_CAUSE_ANSWER: -+ return "ANSWER"; -+ case CYNARA_CALL_CAUSE_CANCEL: -+ return "CANCEL"; -+ case CYNARA_CALL_CAUSE_FINISH: -+ return "FINSIH"; -+ case CYNARA_CALL_CAUSE_SERVICE_NOT_AVAILABLE: -+ return "SERVICE NOT AVAILABLE"; -+ default: -+ return "INVALID"; -+ } -+} -+ -+static void -+bus_cynara_check_response_callback (cynara_check_id check_id, -+ cynara_async_call_cause cause, -+ int response, -+ void *user_response_data) -+{ -+ BusDeferredMessage *deferred_message = user_response_data; -+ BusResult result; -+ -+ _dbus_verbose("Cynara callback: check_id=%u, cause=%s response=%i response_data=%p\n", -+ (unsigned int)check_id, call_cause_to_string(cause), response, user_response_data); -+ -+ if (deferred_message == NULL) -+ return; -+ -+ if (cause == CYNARA_CALL_CAUSE_ANSWER && response == CYNARA_API_ACCESS_ALLOWED) -+ result = BUS_RESULT_TRUE; -+ else -+ result = BUS_RESULT_FALSE; -+ -+ bus_deferred_message_response_received(deferred_message, result); -+ bus_deferred_message_unref(deferred_message); -+} -+ -+#endif /* DBUS_ENABLE_CYNARA */ -diff --git a/bus/cynara.h b/bus/cynara.h -new file mode 100644 -index 0000000..c4728bb ---- /dev/null -+++ b/bus/cynara.h -@@ -0,0 +1,37 @@ -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ -+/* cynara.h Cynara runtime privilege checking -+ * -+ * Copyright (c) 2014 Samsung Electronics, Ltd. -+ * -+ * Licensed under the Academic Free License version 2.1 -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ * -+ */ -+ -+#include "bus.h" -+#include "check.h" -+ -+BusCynara *bus_cynara_new (BusCheck *check, DBusError *error); -+BusCynara *bus_cynara_ref (BusCynara *cynara); -+void bus_cynara_unref (BusCynara *cynara); -+BusResult bus_cynara_check_privilege (BusCynara *cynara, -+ DBusMessage *message, -+ DBusConnection *sender, -+ DBusConnection *addressed_recipient, -+ DBusConnection *proposed_recipient, -+ const char *privilege, -+ BusDeferredMessageStatus check_type, -+ BusDeferredMessage **deferred_message); -diff --git a/bus/dispatch.c b/bus/dispatch.c -index 19228be..d3867f7 100644 ---- a/bus/dispatch.c -+++ b/bus/dispatch.c -@@ -25,6 +25,7 @@ - - #include - #include "dispatch.h" -+#include "check.h" - #include "connection.h" - #include "driver.h" - #include "services.h" -@@ -64,14 +65,18 @@ send_one_message (DBusConnection *connection, - DBusError *error) - { - DBusError stack_error = DBUS_ERROR_INIT; -+ BusDeferredMessage *deferred_message; -+ BusResult result; - -- if (!bus_context_check_security_policy (context, transaction, -+ result = bus_context_check_security_policy (context, transaction, - sender, - addressed_recipient, - connection, - message, - NULL, -- &stack_error)) -+ &stack_error, -+ &deferred_message); -+ if (result != BUS_RESULT_TRUE) - { - if (!bus_transaction_capture_error_reply (transaction, sender, - &stack_error, message)) -@@ -130,6 +135,8 @@ bus_dispatch_matches (BusTransaction *transaction, - BusMatchmaker *matchmaker; - DBusList *link; - BusContext *context; -+ BusDeferredMessage *deferred_message; -+ BusResult res; - - _DBUS_ASSERT_ERROR_IS_CLEAR (error); - -@@ -145,11 +152,20 @@ bus_dispatch_matches (BusTransaction *transaction, - /* First, send the message to the addressed_recipient, if there is one. */ - if (addressed_recipient != NULL) - { -- if (!bus_context_check_security_policy (context, transaction, -- sender, addressed_recipient, -- addressed_recipient, -- message, NULL, error)) -+ res = bus_context_check_security_policy (context, transaction, -+ sender, addressed_recipient, -+ addressed_recipient, -+ message, NULL, error, -+ &deferred_message); -+ if (res == BUS_RESULT_FALSE) - return FALSE; -+ else if (res == BUS_RESULT_LATER) -+ { -+ dbus_set_error (error, -+ DBUS_ERROR_ACCESS_DENIED, -+ "Rejecting message because time is needed to check security policy"); -+ return FALSE; -+ } - - if (dbus_message_contains_unix_fds (message) && - !dbus_connection_can_send_type (addressed_recipient, -@@ -374,19 +390,31 @@ bus_dispatch (DBusConnection *connection, - if (service_name && - strcmp (service_name, DBUS_SERVICE_DBUS) == 0) /* to bus driver */ - { -+ BusDeferredMessage *deferred_message; -+ BusResult res; -+ - if (!bus_transaction_capture (transaction, connection, NULL, message)) - { - BUS_SET_OOM (&error); - goto out; - } - -- if (!bus_context_check_security_policy (context, transaction, -- connection, NULL, NULL, message, -- NULL, &error)) -+ res = bus_context_check_security_policy (context, transaction, -+ connection, NULL, NULL, message, NULL, -+ &error, &deferred_message); -+ if (res == BUS_RESULT_FALSE) - { - _dbus_verbose ("Security policy rejected message\n"); - goto out; - } -+ else if (res == BUS_RESULT_LATER) -+ { -+ dbus_set_error (&error, -+ DBUS_ERROR_ACCESS_DENIED, -+ "Rejecting message because time is needed to check security policy"); -+ _dbus_verbose ("Security policy needs time to check policy. Dropping message\n"); -+ goto out; -+ } - - _dbus_verbose ("Giving message to %s\n", DBUS_SERVICE_DBUS); - if (!bus_driver_handle_message (connection, transaction, message, &error)) -diff --git a/bus/policy.c b/bus/policy.c -index a37be80..7ee1ce5 100644 ---- a/bus/policy.c -+++ b/bus/policy.c -@@ -22,6 +22,7 @@ - */ - - #include -+#include "check.h" - #include "policy.h" - #include "services.h" - #include "test.h" -@@ -33,7 +34,7 @@ - - BusPolicyRule* - bus_policy_rule_new (BusPolicyRuleType type, -- dbus_bool_t allow) -+ BusPolicyRuleAccess access) - { - BusPolicyRule *rule; - -@@ -43,7 +44,7 @@ bus_policy_rule_new (BusPolicyRuleType type, - - rule->type = type; - rule->refcount = 1; -- rule->allow = allow; -+ rule->access = access; - - switch (rule->type) - { -@@ -55,18 +56,19 @@ bus_policy_rule_new (BusPolicyRuleType type, - break; - case BUS_POLICY_RULE_SEND: - rule->d.send.message_type = DBUS_MESSAGE_TYPE_INVALID; -- - /* allow rules default to TRUE (only requested replies allowed) -+ * check rules default to TRUE (only requested replies are checked) - * deny rules default to FALSE (only unrequested replies denied) - */ -- rule->d.send.requested_reply = rule->allow; -+ rule->d.send.requested_reply = rule->access != BUS_POLICY_RULE_ACCESS_DENY; - break; - case BUS_POLICY_RULE_RECEIVE: - rule->d.receive.message_type = DBUS_MESSAGE_TYPE_INVALID; - /* allow rules default to TRUE (only requested replies allowed) -+ * check rules default to TRUE (only requested replies are checked) - * deny rules default to FALSE (only unrequested replies denied) - */ -- rule->d.receive.requested_reply = rule->allow; -+ rule->d.receive.requested_reply = rule->access != BUS_POLICY_RULE_ACCESS_DENY; - break; - case BUS_POLICY_RULE_OWN: - break; -@@ -122,7 +124,8 @@ bus_policy_rule_unref (BusPolicyRule *rule) - default: - _dbus_assert_not_reached ("invalid rule"); - } -- -+ -+ dbus_free (rule->privilege); - dbus_free (rule); - } - } -@@ -435,7 +438,10 @@ list_allows_user (dbus_bool_t def, - else - continue; - -- allowed = rule->allow; -+ /* We don't intend to support and -+ rules. They are treated like deny. -+ */ -+ allowed = rule->access == BUS_POLICY_RULE_ACCESS_ALLOW; - } - - return allowed; -@@ -873,18 +879,23 @@ bus_client_policy_append_rule (BusClientPolicy *policy, - return TRUE; - } - --dbus_bool_t --bus_client_policy_check_can_send (BusClientPolicy *policy, -- BusRegistry *registry, -- dbus_bool_t requested_reply, -- DBusConnection *receiver, -- DBusMessage *message, -- dbus_int32_t *toggles, -- dbus_bool_t *log) -+BusResult -+bus_client_policy_check_can_send (DBusConnection *sender, -+ BusClientPolicy *policy, -+ BusRegistry *registry, -+ dbus_bool_t requested_reply, -+ DBusConnection *addressed_recipient, -+ DBusConnection *receiver, -+ DBusMessage *message, -+ dbus_int32_t *toggles, -+ dbus_bool_t *log, -+ const char **privilege_param, -+ BusDeferredMessage **deferred_message) - { - DBusList *link; -- dbus_bool_t allowed; -- -+ BusResult result; -+ const char *privilege; -+ - /* policy->rules is in the order the rules appeared - * in the config file, i.e. last rule that applies wins - */ -@@ -892,7 +903,7 @@ bus_client_policy_check_can_send (BusClientPolicy *policy, - _dbus_verbose (" (policy) checking send rules\n"); - *toggles = 0; - -- allowed = FALSE; -+ result = BUS_RESULT_FALSE; - link = _dbus_list_get_first_link (&policy->rules); - while (link != NULL) - { -@@ -923,13 +934,14 @@ bus_client_policy_check_can_send (BusClientPolicy *policy, - /* If it's a reply, the requested_reply flag kicks in */ - if (dbus_message_get_reply_serial (message) != 0) - { -- /* for allow, requested_reply=true means the rule applies -- * only when reply was requested. requested_reply=false means -- * always allow. -+ /* for allow or check requested_reply=true means the rule applies -+ * only when reply was requested. requested_reply=false means the -+ * rule always applies - */ -- if (!requested_reply && rule->allow && rule->d.send.requested_reply && !rule->d.send.eavesdrop) -+ if (!requested_reply && rule->access != BUS_POLICY_RULE_ACCESS_DENY && rule->d.send.requested_reply && !rule->d.send.eavesdrop) - { -- _dbus_verbose (" (policy) skipping allow rule since it only applies to requested replies and does not allow eavesdropping\n"); -+ _dbus_verbose (" (policy) skipping %s rule since it only applies to requested replies and does not allow eavesdropping\n", -+ rule->access == BUS_POLICY_RULE_ACCESS_ALLOW ? "allow" : "check"); - continue; - } - -@@ -937,7 +949,7 @@ bus_client_policy_check_can_send (BusClientPolicy *policy, - * when the reply was not requested. requested_reply=true means the - * rule always applies. - */ -- if (requested_reply && !rule->allow && !rule->d.send.requested_reply) -+ if (requested_reply && rule->access == BUS_POLICY_RULE_ACCESS_DENY && !rule->d.send.requested_reply) - { - _dbus_verbose (" (policy) skipping deny rule since it only applies to unrequested replies\n"); - continue; -@@ -960,13 +972,15 @@ bus_client_policy_check_can_send (BusClientPolicy *policy, - /* The interface is optional in messages. For allow rules, if the message - * has no interface we want to skip the rule (and thus not allow); - * for deny rules, if the message has no interface we want to use the -- * rule (and thus deny). -+ * rule (and thus deny). Check rules are meant to be used like allow -+ * rules (they can grant access, but not remove it), so we treat it like -+ * allow here. - */ - dbus_bool_t no_interface; - - no_interface = dbus_message_get_interface (message) == NULL; - -- if ((no_interface && rule->allow) || -+ if ((no_interface && rule->access != BUS_POLICY_RULE_ACCESS_DENY) || - (!no_interface && - strcmp (dbus_message_get_interface (message), - rule->d.send.interface) != 0)) -@@ -1079,33 +1093,63 @@ bus_client_policy_check_can_send (BusClientPolicy *policy, - } - - /* Use this rule */ -- allowed = rule->allow; -+ switch (rule->access) -+ { -+ case BUS_POLICY_RULE_ACCESS_ALLOW: -+ result = BUS_RESULT_TRUE; -+ break; -+ case BUS_POLICY_RULE_ACCESS_DENY: -+ result = BUS_RESULT_FALSE; -+ break; -+ case BUS_POLICY_RULE_ACCESS_CHECK: -+ result = BUS_RESULT_LATER; -+ privilege = rule->privilege; -+ break; -+ } -+ - *log = rule->d.send.log; - (*toggles)++; - -- _dbus_verbose (" (policy) used rule, allow now = %d\n", -- allowed); -+ _dbus_verbose (" (policy) used rule, result now = %d\n", -+ (int)(intptr_t)result); - } - -- return allowed; -+ if (result == BUS_RESULT_LATER) -+ { -+ BusContext *context = bus_connection_get_context(sender); -+ BusCheck *check = bus_context_get_check(context); -+ -+ result = bus_check_privilege(check, message, sender, addressed_recipient, receiver, -+ privilege, BUS_DEFERRED_MESSAGE_CHECK_SEND, deferred_message); -+ } -+ else -+ privilege = NULL; -+ -+ if (privilege_param != NULL) -+ *privilege_param = privilege; -+ -+ return result; - } - - /* See docs on what the args mean on bus_context_check_security_policy() - * comment - */ --dbus_bool_t --bus_client_policy_check_can_receive (BusClientPolicy *policy, -- BusRegistry *registry, -- dbus_bool_t requested_reply, -- DBusConnection *sender, -- DBusConnection *addressed_recipient, -- DBusConnection *proposed_recipient, -- DBusMessage *message, -- dbus_int32_t *toggles) -+BusResult -+bus_client_policy_check_can_receive (BusClientPolicy *policy, -+ BusRegistry *registry, -+ dbus_bool_t requested_reply, -+ DBusConnection *sender, -+ DBusConnection *addressed_recipient, -+ DBusConnection *proposed_recipient, -+ DBusMessage *message, -+ dbus_int32_t *toggles, -+ const char **privilege_param, -+ BusDeferredMessage **deferred_message) - { - DBusList *link; -- dbus_bool_t allowed; - dbus_bool_t eavesdropping; -+ BusResult result; -+ const char *privilege; - - eavesdropping = - addressed_recipient != proposed_recipient && -@@ -1118,7 +1162,7 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, - _dbus_verbose (" (policy) checking receive rules, eavesdropping = %d\n", eavesdropping); - *toggles = 0; - -- allowed = FALSE; -+ result = BUS_RESULT_FALSE; - link = _dbus_list_get_first_link (&policy->rules); - while (link != NULL) - { -@@ -1141,19 +1185,21 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, - } - } - -- /* for allow, eavesdrop=false means the rule doesn't apply when -- * eavesdropping. eavesdrop=true means always allow. -+ -+ /* for allow or check, eavesdrop=false means the rule doesn't apply when -+ * eavesdropping. eavesdrop=true means the rule always applies - */ -- if (eavesdropping && rule->allow && !rule->d.receive.eavesdrop) -+ if (eavesdropping && rule->access != BUS_POLICY_RULE_ACCESS_DENY && !rule->d.receive.eavesdrop) - { -- _dbus_verbose (" (policy) skipping allow rule since it doesn't apply to eavesdropping\n"); -+ _dbus_verbose (" (policy) skipping %s rule since it doesn't apply to eavesdropping\n", -+ rule->access == BUS_POLICY_RULE_ACCESS_ALLOW ? "allow" : "check"); - continue; - } - - /* for deny, eavesdrop=true means the rule applies only when - * eavesdropping; eavesdrop=false means always deny. - */ -- if (!eavesdropping && !rule->allow && rule->d.receive.eavesdrop) -+ if (!eavesdropping && rule->access == BUS_POLICY_RULE_ACCESS_DENY && rule->d.receive.eavesdrop) - { - _dbus_verbose (" (policy) skipping deny rule since it only applies to eavesdropping\n"); - continue; -@@ -1162,13 +1208,14 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, - /* If it's a reply, the requested_reply flag kicks in */ - if (dbus_message_get_reply_serial (message) != 0) - { -- /* for allow, requested_reply=true means the rule applies -- * only when reply was requested. requested_reply=false means -- * always allow. -+ /* for allow or check requested_reply=true means the rule applies -+ * only when reply was requested. requested_reply=false means the -+ * rule always applies - */ -- if (!requested_reply && rule->allow && rule->d.receive.requested_reply && !rule->d.receive.eavesdrop) -+ if (!requested_reply && rule->access != BUS_POLICY_RULE_ACCESS_DENY && rule->d.send.requested_reply && !rule->d.send.eavesdrop) - { -- _dbus_verbose (" (policy) skipping allow rule since it only applies to requested replies and does not allow eavesdropping\n"); -+ _dbus_verbose (" (policy) skipping %s rule since it only applies to requested replies and does not allow eavesdropping\n", -+ rule->access == BUS_POLICY_RULE_ACCESS_DENY ? "allow" : "deny"); - continue; - } - -@@ -1176,7 +1223,7 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, - * when the reply was not requested. requested_reply=true means the - * rule always applies. - */ -- if (requested_reply && !rule->allow && !rule->d.receive.requested_reply) -+ if (requested_reply && rule->access == BUS_POLICY_RULE_ACCESS_DENY && !rule->d.receive.requested_reply) - { - _dbus_verbose (" (policy) skipping deny rule since it only applies to unrequested replies\n"); - continue; -@@ -1199,13 +1246,13 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, - /* The interface is optional in messages. For allow rules, if the message - * has no interface we want to skip the rule (and thus not allow); - * for deny rules, if the message has no interface we want to use the -- * rule (and thus deny). -+ * rule (and thus deny). Check rules are treated like allow rules. - */ - dbus_bool_t no_interface; - - no_interface = dbus_message_get_interface (message) == NULL; - -- if ((no_interface && rule->allow) || -+ if ((no_interface && rule->access != BUS_POLICY_RULE_ACCESS_DENY) || - (!no_interface && - strcmp (dbus_message_get_interface (message), - rule->d.receive.interface) != 0)) -@@ -1295,14 +1342,42 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, - } - - /* Use this rule */ -- allowed = rule->allow; -+ switch (rule->access) -+ { -+ case BUS_POLICY_RULE_ACCESS_ALLOW: -+ result = BUS_RESULT_TRUE; -+ break; -+ case BUS_POLICY_RULE_ACCESS_DENY: -+ result = BUS_RESULT_FALSE; -+ break; -+ case BUS_POLICY_RULE_ACCESS_CHECK: -+ result = BUS_RESULT_LATER; -+ privilege = rule->privilege; -+ break; -+ } -+ - (*toggles)++; - -- _dbus_verbose (" (policy) used rule, allow now = %d\n", -- allowed); -+ _dbus_verbose (" (policy) used rule, result now = %d\n", -+ (int)(intptr_t)result); - } - -- return allowed; -+ -+ if (result == BUS_RESULT_LATER) -+ { -+ BusContext *context = bus_connection_get_context(proposed_recipient); -+ BusCheck *check = bus_context_get_check(context); -+ -+ result = bus_check_privilege(check, message, sender, addressed_recipient, proposed_recipient, -+ privilege, BUS_DEFERRED_MESSAGE_CHECK_RECEIVE, deferred_message); -+ } -+ else -+ privilege = NULL; -+ -+ if (privilege_param != NULL) -+ *privilege_param = privilege; -+ -+ return result; - } - - -@@ -1354,7 +1429,7 @@ bus_rules_check_can_own (DBusList *rules, - } - - /* Use this rule */ -- allowed = rule->allow; -+ allowed = rule->access == BUS_POLICY_RULE_ACCESS_ALLOW; - } - - return allowed; -diff --git a/bus/policy.h b/bus/policy.h -index ec43ffa..f839d23 100644 ---- a/bus/policy.h -+++ b/bus/policy.h -@@ -46,6 +46,14 @@ typedef enum - BUS_POLICY_TRISTATE_TRUE - } BusPolicyTristate; - -+typedef enum -+{ -+ BUS_POLICY_RULE_ACCESS_DENY, -+ BUS_POLICY_RULE_ACCESS_ALLOW, -+ /** runtime check resulting in allow or deny */ -+ BUS_POLICY_RULE_ACCESS_CHECK -+} BusPolicyRuleAccess; -+ - /** determines whether the rule affects a connection, or some global item */ - #define BUS_POLICY_RULE_IS_PER_CLIENT(rule) (!((rule)->type == BUS_POLICY_RULE_USER || \ - (rule)->type == BUS_POLICY_RULE_GROUP)) -@@ -56,8 +64,9 @@ struct BusPolicyRule - - BusPolicyRuleType type; - -- unsigned int allow : 1; /**< #TRUE if this allows, #FALSE if it denies */ -- -+ unsigned int access : 2; /**< BusPolicyRuleAccess */ -+ char *privilege; /**< for BUS_POLICY_RULE_ACCESS_CHECK */ -+ - union - { - struct -@@ -118,7 +127,7 @@ struct BusPolicyRule - }; - - BusPolicyRule* bus_policy_rule_new (BusPolicyRuleType type, -- dbus_bool_t allow); -+ BusPolicyRuleAccess access); - BusPolicyRule* bus_policy_rule_ref (BusPolicyRule *rule); - void bus_policy_rule_unref (BusPolicyRule *rule); - -@@ -152,21 +161,27 @@ dbus_bool_t bus_policy_merge (BusPolicy *policy, - BusClientPolicy* bus_client_policy_new (void); - BusClientPolicy* bus_client_policy_ref (BusClientPolicy *policy); - void bus_client_policy_unref (BusClientPolicy *policy); --dbus_bool_t bus_client_policy_check_can_send (BusClientPolicy *policy, -+BusResult bus_client_policy_check_can_send (DBusConnection *sender, -+ BusClientPolicy *policy, - BusRegistry *registry, - dbus_bool_t requested_reply, -+ DBusConnection *addressed_recipient, - DBusConnection *receiver, - DBusMessage *message, - dbus_int32_t *toggles, -- dbus_bool_t *log); --dbus_bool_t bus_client_policy_check_can_receive (BusClientPolicy *policy, -+ dbus_bool_t *log, -+ const char **privilege_param, -+ BusDeferredMessage **deferred_message); -+BusResult bus_client_policy_check_can_receive (BusClientPolicy *policy, - BusRegistry *registry, - dbus_bool_t requested_reply, - DBusConnection *sender, - DBusConnection *addressed_recipient, - DBusConnection *proposed_recipient, - DBusMessage *message, -- dbus_int32_t *toggles); -+ dbus_int32_t *toggles, -+ const char **privilege_param, -+ BusDeferredMessage **deferred_message); - dbus_bool_t bus_client_policy_check_can_own (BusClientPolicy *policy, - const DBusString *service_name); - dbus_bool_t bus_client_policy_append_rule (BusClientPolicy *policy, -diff --git a/configure.ac b/configure.ac -index 81028ba..f21d1b2 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1770,6 +1770,17 @@ AC_ARG_ENABLE([user-session], - AM_CONDITIONAL([DBUS_ENABLE_USER_SESSION], - [test "x$enable_user_session" = xyes]) - -+#enable cynara integration -+AC_ARG_ENABLE([cynara], [AS_HELP_STRING([--enable-cynara], [enable Cynara integration])], [], [enable_cynara=no]) -+if test "x$enable_cynara" = xyes; then -+ PKG_CHECK_MODULES([CYNARA], [cynara-client-async >= 0.6.0 cynara-session >= 0.6.0], -+ [AC_DEFINE([DBUS_ENABLE_CYNARA], [1], [Define to enable Cynara privilege checks in dbus-daemon])], -+ [AC_MSG_ERROR([libcynara-client-async and cynara-session are required to enable Cynara integration])]) -+fi -+ -+AC_SUBST([CYNARA_CFLAGS]) -+AC_SUBST([CYNARA_LIBS]) -+ - AC_CONFIG_FILES([ - Doxyfile - dbus/Version -@@ -1852,6 +1863,7 @@ echo " - Building bus stats API: ${enable_stats} - Building SELinux support: ${have_selinux} - Building AppArmor support: ${have_apparmor} -+ Building Cynara support: ${enable_cynara} - Building inotify support: ${have_inotify} - Building kqueue support: ${have_kqueue} - Building systemd support: ${have_systemd} -diff --git a/test/Makefile.am b/test/Makefile.am -index 6a6e1a3..ce84dbc 100644 ---- a/test/Makefile.am -+++ b/test/Makefile.am -@@ -439,6 +439,7 @@ in_data = \ - data/valid-config-files/debug-allow-all.conf.in \ - data/valid-config-files/finite-timeout.conf.in \ - data/valid-config-files/forbidding.conf.in \ -+ data/valid-config-files/debug-check-some.conf.in \ - data/valid-config-files/incoming-limit.conf.in \ - data/valid-config-files/max-completed-connections.conf.in \ - data/valid-config-files/max-connections-per-user.conf.in \ -diff --git a/test/data/invalid-config-files/badcheck-1.conf b/test/data/invalid-config-files/badcheck-1.conf -new file mode 100644 -index 0000000..fad9f50 ---- /dev/null -+++ b/test/data/invalid-config-files/badcheck-1.conf -@@ -0,0 +1,9 @@ -+ -+ -+ mybususer -+ unix:path=/foo/bar -+ -+ -+ -+ -diff --git a/test/data/invalid-config-files/badcheck-2.conf b/test/data/invalid-config-files/badcheck-2.conf -new file mode 100644 -index 0000000..63c7ef2 ---- /dev/null -+++ b/test/data/invalid-config-files/badcheck-2.conf -@@ -0,0 +1,9 @@ -+ -+ -+ mybususer -+ unix:path=/foo/bar -+ -+ -+ -+ -diff --git a/test/data/valid-config-files/check-1.conf b/test/data/valid-config-files/check-1.conf -new file mode 100644 -index 0000000..ad71473 ---- /dev/null -+++ b/test/data/valid-config-files/check-1.conf -@@ -0,0 +1,9 @@ -+ -+ -+ mybususer -+ unix:path=/foo/bar -+ -+ -+ -+ -diff --git a/test/data/valid-config-files/debug-check-some.conf.in b/test/data/valid-config-files/debug-check-some.conf.in -new file mode 100644 -index 0000000..47ee854 ---- /dev/null -+++ b/test/data/valid-config-files/debug-check-some.conf.in -@@ -0,0 +1,18 @@ -+ -+ -+ -+ -+ debug-pipe:name=test-server -+ @TEST_LISTEN@ -+ @DBUS_TEST_DATA@/valid-service-files -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ --- -2.17.2 - diff --git a/meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0002-Disable-message-dispatching-when-send-rule-result-is.patch b/meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0002-Disable-message-dispatching-when-send-rule-result-is.patch deleted file mode 100644 index ebbd531f..00000000 --- a/meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0002-Disable-message-dispatching-when-send-rule-result-is.patch +++ /dev/null @@ -1,949 +0,0 @@ -From aae977a0c4bb1c25640c7056166fbc4e76ef1db6 Mon Sep 17 00:00:00 2001 -From: Jacek Bukarewicz -Date: Fri, 28 Nov 2014 12:07:39 +0100 -Subject: Disable message dispatching when send rule result is not known -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When unicast message is sent to addressed recipient and policy result -is not available message dispatch from the sender is disabled. -This also means that any further messages from the given connection are -put into the incoming queue without being processed. If response is received -message dispatching is resumed. This time answer is attached to the message -which is now processed synchronously. -Receive rule result unavailability is not yet handled - such messages are -rejected. Also, if message is sent to non-addressed recipient and policy result -is unknown, message is silently dropped. - -Cherry-picked from b1b87ad9f20b2052c28431b48e81073078a745ce -by Jose Bollo. - -Updated for dbus 1.10.20 by Scott Murray and José Bollo - -Signed-off-by: José Bollo -Signed-off-by: Scott Murray - -diff --git a/bus/activation.c b/bus/activation.c -index f8a02eb..005047f 100644 ---- a/bus/activation.c -+++ b/bus/activation.c -@@ -32,6 +32,7 @@ - #include "services.h" - #include "test.h" - #include "utils.h" -+#include - #include - #include - #include -@@ -94,6 +95,8 @@ struct BusPendingActivationEntry - DBusConnection *connection; - - dbus_bool_t auto_activation; -+ -+ dbus_bool_t is_put_back; - }; - - typedef struct -@@ -1241,20 +1244,23 @@ bus_activation_send_pending_auto_activation_messages (BusActivation *activation - BusPendingActivationEntry *entry = link->data; - DBusList *next = _dbus_list_get_next_link (&pending_activation->entries, link); - -- if (entry->auto_activation && (entry->connection == NULL || dbus_connection_get_is_connected (entry->connection))) -+ if (entry->auto_activation && !entry->is_put_back && -+ (entry->connection == NULL || dbus_connection_get_is_connected (entry->connection))) - { - DBusConnection *addressed_recipient; - DBusError error; -+ BusResult res; - - dbus_error_init (&error); - - addressed_recipient = bus_service_get_primary_owners_connection (service); - - /* Resume dispatching where we left off in bus_dispatch() */ -- if (!bus_dispatch_matches (transaction, -- entry->connection, -- addressed_recipient, -- entry->activation_message, &error)) -+ res = bus_dispatch_matches (transaction, -+ entry->connection, -+ addressed_recipient, -+ entry->activation_message, &error); -+ if (res == BUS_RESULT_FALSE) - { - /* If permission is denied, we just want to return the error - * to the original method invoker; in particular, we don't -@@ -1266,9 +1272,40 @@ bus_activation_send_pending_auto_activation_messages (BusActivation *activation - bus_connection_send_oom_error (entry->connection, - entry->activation_message); - } -+ } -+ else if (res == BUS_RESULT_LATER) -+ { -+ DBusList *putback_message_link = link; -+ DBusMessage *last_inserted_message = NULL; -+ -+ /* NULL entry->connection implies sending pending ActivationRequest message to systemd */ -+ if (entry->connection == NULL) -+ { -+ _dbus_assert_not_reached ("bus_dispatch_matches returned BUS_RESULT_LATER unexpectedly when sender is NULL"); -+ link = next; -+ continue; -+ } - -- link = next; -- continue; -+ /** -+ * Getting here means that policy check result is not yet available and dispatching -+ * messages from entry->connection has been disabled. -+ * Let's put back all messages for the given connection in the incoming queue and mark -+ * this entry as put back so they are not handled twice. -+ */ -+ while (putback_message_link != NULL) -+ { -+ BusPendingActivationEntry *putback_message = putback_message_link->data; -+ if (putback_message->connection == entry->connection) -+ { -+ if (!_dbus_connection_putback_message (putback_message->connection, last_inserted_message, -+ putback_message->activation_message, &error)) -+ goto error; -+ last_inserted_message = putback_message->activation_message; -+ putback_message->is_put_back = TRUE; -+ } -+ -+ putback_message_link = _dbus_list_get_next_link(&pending_activation->entries, putback_message_link); -+ } - } - } - -@@ -1286,6 +1323,19 @@ bus_activation_send_pending_auto_activation_messages (BusActivation *activation - return TRUE; - - error: -+ /* remove all messages that have been put to connections' incoming queues */ -+ link = _dbus_list_get_first_link (&pending_activation->entries); -+ while (link != NULL) -+ { -+ BusPendingActivationEntry *entry = link->data; -+ if (entry->is_put_back) -+ { -+ _dbus_connection_remove_message(entry->connection, entry->activation_message); -+ entry->is_put_back = FALSE; -+ } -+ link = _dbus_list_get_next_link(&pending_activation->entries, link); -+ } -+ - return FALSE; - } - -@@ -2078,6 +2128,7 @@ bus_activation_activate_service (BusActivation *activation, - - if (service != NULL) - { -+ BusResult res; - bus_context_log (activation->context, - DBUS_SYSTEM_LOG_INFO, "Activating via systemd: service name='%s' unit='%s' requested by '%s' (%s)", - service_name, -@@ -2085,8 +2136,17 @@ bus_activation_activate_service (BusActivation *activation, - bus_connection_get_name (connection), - bus_connection_get_loginfo (connection)); - /* Wonderful, systemd is connected, let's just send the msg */ -- retval = bus_dispatch_matches (activation_transaction, NULL, -+ res = bus_dispatch_matches (activation_transaction, NULL, - systemd, message, error); -+ -+ if (res == BUS_RESULT_TRUE) -+ retval = TRUE; -+ else -+ { -+ retval = FALSE; -+ if (res == BUS_RESULT_LATER) -+ _dbus_verbose("Unexpectedly need time to check message from bus driver to systemd - dropping the message.\n"); -+ } - } - else - { -diff --git a/bus/check.c b/bus/check.c -index 5b72d31..4b8a699 100644 ---- a/bus/check.c -+++ b/bus/check.c -@@ -55,6 +55,8 @@ typedef struct BusDeferredMessage - BusCheckResponseFunc response_callback; - } BusDeferredMessage; - -+static dbus_int32_t deferred_message_data_slot = -1; -+ - BusCheck * - bus_check_new (BusContext *context, DBusError *error) - { -@@ -67,11 +69,19 @@ bus_check_new (BusContext *context, DBusError *error) - return NULL; - } - -+ if (!dbus_message_allocate_data_slot(&deferred_message_data_slot)) -+ { -+ dbus_free(check); -+ BUS_SET_OOM(error); -+ return NULL; -+ } -+ - check->refcount = 1; - check->context = context; - check->cynara = bus_cynara_new(check, error); - if (dbus_error_is_set(error)) - { -+ dbus_message_free_data_slot(&deferred_message_data_slot); - dbus_free(check); - return NULL; - } -@@ -98,6 +108,7 @@ bus_check_unref (BusCheck *check) - if (check->refcount == 0) - { - bus_cynara_unref(check->cynara); -+ dbus_message_free_data_slot(&deferred_message_data_slot); - dbus_free(check); - } - } -@@ -114,6 +125,45 @@ bus_check_get_cynara (BusCheck *check) - return check->cynara; - } - -+static void -+bus_check_enable_dispatch_callback (BusDeferredMessage *deferred_message, -+ BusResult result) -+{ -+ _dbus_verbose("bus_check_enable_dispatch_callback called deferred_message=%p\n", deferred_message); -+ -+ deferred_message->response = result; -+ _dbus_connection_enable_dispatch(deferred_message->sender); -+} -+ -+static void -+deferred_message_free_function(void *data) -+{ -+ BusDeferredMessage *deferred_message = (BusDeferredMessage *)data; -+ bus_deferred_message_unref(deferred_message); -+} -+ -+void -+bus_deferred_message_disable_sender (BusDeferredMessage *deferred_message) -+{ -+ _dbus_assert(deferred_message != NULL); -+ _dbus_assert(deferred_message->sender != NULL); -+ -+ if (dbus_message_get_data(deferred_message->message, deferred_message_data_slot) == NULL) -+ { -+ if (dbus_message_set_data(deferred_message->message, deferred_message_data_slot, deferred_message, -+ deferred_message_free_function)) -+ bus_deferred_message_ref(deferred_message); -+ } -+ -+ _dbus_connection_disable_dispatch(deferred_message->sender); -+ deferred_message->response_callback = bus_check_enable_dispatch_callback; -+} -+ -+#ifdef DBUS_ENABLE_EMBEDDED_TESTS -+BusResult (*bus_check_test_override) (DBusConnection *connection, -+ const char *privilege); -+#endif -+ - BusResult - bus_check_privilege (BusCheck *check, - DBusMessage *message, -@@ -124,6 +174,7 @@ bus_check_privilege (BusCheck *check, - BusDeferredMessageStatus check_type, - BusDeferredMessage **deferred_message) - { -+ BusDeferredMessage *previous_deferred_message; - BusResult result = BUS_RESULT_FALSE; - #ifdef DBUS_ENABLE_CYNARA - BusCynara *cynara; -@@ -137,16 +188,54 @@ bus_check_privilege (BusCheck *check, - return BUS_RESULT_FALSE; - } - -- /* ask policy checkers */ --#ifdef DBUS_ENABLE_CYNARA -- cynara = bus_check_get_cynara(check); -- result = bus_cynara_check_privilege(cynara, message, sender, addressed_recipient, -- proposed_recipient, privilege, check_type, deferred_message); -+#ifdef DBUS_ENABLE_EMBEDDED_TESTS -+ if (bus_check_test_override) -+ return bus_check_test_override (connection, privilege); - #endif - -- if (result == BUS_RESULT_LATER && deferred_message != NULL) -+ previous_deferred_message = dbus_message_get_data(message, deferred_message_data_slot); -+ /* check if message blocked at sender's queue is being processed */ -+ if (previous_deferred_message != NULL) -+ { -+ if ((check_type & BUS_DEFERRED_MESSAGE_CHECK_SEND) && -+ !(previous_deferred_message->status & BUS_DEFERRED_MESSAGE_CHECK_SEND)) -+ { -+ /** -+ * Message has been deferred due to receive or own rule which means that sending this message -+ * is allowed - it must have been checked previously. -+ * This might happen when client calls RequestName method which depending on security -+ * policy might result in both "can_send" and "can_own" Cynara checks. -+ */ -+ result = BUS_RESULT_TRUE; -+ } -+ else -+ { -+ result = previous_deferred_message->response; -+ if (result == BUS_RESULT_LATER) -+ { -+ /* result is still not known - reuse deferred message object */ -+ if (deferred_message != NULL) -+ *deferred_message = previous_deferred_message; -+ } -+ else -+ { -+ /* result is available - we can remove deferred message from the processed message */ -+ dbus_message_set_data(message, deferred_message_data_slot, NULL, NULL); -+ } -+ } -+ } -+ else - { -- (*deferred_message)->status |= check_type; -+ /* ask policy checkers */ -+#ifdef DBUS_ENABLE_CYNARA -+ cynara = bus_check_get_cynara(check); -+ result = bus_cynara_check_privilege(cynara, message, sender, addressed_recipient, -+ proposed_recipient, privilege, check_type, deferred_message); -+#endif -+ if (result == BUS_RESULT_LATER && deferred_message != NULL) -+ { -+ (*deferred_message)->status |= check_type; -+ } - } - return result; - } -@@ -206,6 +295,12 @@ bus_deferred_message_unref (BusDeferredMessage *deferred_message) - } - } - -+BusDeferredMessageStatus -+bus_deferred_message_get_status (BusDeferredMessage *deferred_message) -+{ -+ return deferred_message->status; -+} -+ - void - bus_deferred_message_response_received (BusDeferredMessage *deferred_message, - BusResult result) -diff --git a/bus/check.h b/bus/check.h -index c3fcaf9..d177549 100644 ---- a/bus/check.h -+++ b/bus/check.h -@@ -55,6 +55,7 @@ BusResult bus_check_privilege (BusCheck *check, - BusDeferredMessageStatus check_type, - BusDeferredMessage **deferred_message); - -+ - BusDeferredMessage *bus_deferred_message_new (DBusMessage *message, - DBusConnection *sender, - DBusConnection *addressed_recipient, -@@ -65,4 +66,13 @@ BusDeferredMessage *bus_deferred_message_ref (BusDeferredMessage - void bus_deferred_message_unref (BusDeferredMessage *deferred_message); - void bus_deferred_message_response_received (BusDeferredMessage *deferred_message, - BusResult result); -+void bus_deferred_message_disable_sender (BusDeferredMessage *deferred_message); -+ -+BusDeferredMessageStatus bus_deferred_message_get_status (BusDeferredMessage *deferred_message); -+ -+#ifdef DBUS_ENABLE_EMBEDDED_TESTS -+extern BusResult (*bus_check_test_override) (DBusConnection *connection, -+ const char *privilege); -+#endif -+ - #endif /* BUS_CHECK_H */ -diff --git a/bus/cynara.c b/bus/cynara.c -index 57a4c45..77aed62 100644 ---- a/bus/cynara.c -+++ b/bus/cynara.c -@@ -36,7 +36,6 @@ - #include - #endif - -- - #ifdef DBUS_ENABLE_CYNARA - typedef struct BusCynara - { -diff --git a/bus/dispatch.c b/bus/dispatch.c -index d3867f7..50a22a3 100644 ---- a/bus/dispatch.c -+++ b/bus/dispatch.c -@@ -35,6 +35,7 @@ - #include "signals.h" - #include "test.h" - #include -+#include - #include - #include - -@@ -122,7 +123,7 @@ send_one_message (DBusConnection *connection, - return TRUE; - } - --dbus_bool_t -+BusResult - bus_dispatch_matches (BusTransaction *transaction, - DBusConnection *sender, - DBusConnection *addressed_recipient, -@@ -158,13 +159,29 @@ bus_dispatch_matches (BusTransaction *transaction, - message, NULL, error, - &deferred_message); - if (res == BUS_RESULT_FALSE) -- return FALSE; -+ return BUS_RESULT_FALSE; - else if (res == BUS_RESULT_LATER) - { -- dbus_set_error (error, -- DBUS_ERROR_ACCESS_DENIED, -- "Rejecting message because time is needed to check security policy"); -- return FALSE; -+ BusDeferredMessageStatus status; -+ status = bus_deferred_message_get_status(deferred_message); -+ -+ if (status & BUS_DEFERRED_MESSAGE_CHECK_SEND) -+ { -+ /* send rule result not available - disable dispatching messages from the sender */ -+ bus_deferred_message_disable_sender(deferred_message); -+ return BUS_RESULT_LATER; -+ } -+ else if (status & BUS_DEFERRED_MESSAGE_CHECK_RECEIVE) -+ { -+ dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, -+ "Rejecting message because time is needed to check security policy"); -+ return BUS_RESULT_FALSE; -+ } -+ else -+ { -+ _dbus_verbose("deferred message has no status field set to send or receive unexpectedly\n"); -+ return BUS_RESULT_FALSE; -+ } - } - - if (dbus_message_contains_unix_fds (message) && -@@ -175,14 +192,14 @@ bus_dispatch_matches (BusTransaction *transaction, - DBUS_ERROR_NOT_SUPPORTED, - "Tried to send message with Unix file descriptors" - "to a client that doesn't support that."); -- return FALSE; -- } -+ return BUS_RESULT_FALSE; -+ } - - /* Dispatch the message */ - if (!bus_transaction_send (transaction, addressed_recipient, message)) - { - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - } - -@@ -197,7 +214,7 @@ bus_dispatch_matches (BusTransaction *transaction, - &recipients)) - { - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - link = _dbus_list_get_first_link (&recipients); -@@ -219,10 +236,10 @@ bus_dispatch_matches (BusTransaction *transaction, - if (dbus_error_is_set (&tmp_error)) - { - dbus_move_error (&tmp_error, error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - else -- return TRUE; -+ return BUS_RESULT_TRUE; - } - - static DBusHandlerResult -@@ -409,10 +426,12 @@ bus_dispatch (DBusConnection *connection, - } - else if (res == BUS_RESULT_LATER) - { -- dbus_set_error (&error, -- DBUS_ERROR_ACCESS_DENIED, -- "Rejecting message because time is needed to check security policy"); -- _dbus_verbose ("Security policy needs time to check policy. Dropping message\n"); -+ /* Disable dispatching messages from the sender, -+ * roll back and dispatch the message once the policy result is available */ -+ bus_deferred_message_disable_sender(deferred_message); -+ bus_transaction_cancel_and_free (transaction); -+ transaction = NULL; -+ result = DBUS_HANDLER_RESULT_LATER; - goto out; - } - -@@ -514,8 +533,14 @@ bus_dispatch (DBusConnection *connection, - * addressed_recipient == NULL), and match it against other connections' - * match rules. - */ -- if (!bus_dispatch_matches (transaction, connection, addressed_recipient, message, &error)) -- goto out; -+ if (BUS_RESULT_LATER == bus_dispatch_matches (transaction, connection, addressed_recipient, -+ message, &error)) -+ { -+ /* Roll back and dispatch the message once the policy result is available */ -+ bus_transaction_cancel_and_free (transaction); -+ transaction = NULL; -+ result = DBUS_HANDLER_RESULT_LATER; -+ } - - out: - if (dbus_error_is_set (&error)) -@@ -5060,9 +5085,132 @@ bus_dispatch_test_conf_fail (const DBusString *test_data_dir, - } - #endif - -+typedef struct { -+ DBusTimeout *timeout; -+ DBusConnection *connection; -+ dbus_bool_t timedout; -+ int check_counter; -+} BusTestCheckData; -+ -+static BusTestCheckData *cdata; -+ -+static dbus_bool_t -+bus_dispatch_test_check_timeout (void *data) -+{ -+ _dbus_verbose ("timeout triggered - pretend that privilege check result is available\n"); -+ -+ /* should only happen once during the test */ -+ _dbus_assert (!cdata->timedout); -+ cdata->timedout = TRUE; -+ _dbus_connection_enable_dispatch (cdata->connection); -+ -+ /* don't call this again */ -+ _dbus_loop_remove_timeout (bus_connection_get_loop (cdata->connection), -+ cdata->timeout); -+ dbus_connection_unref (cdata->connection); -+ cdata->connection = NULL; -+ return TRUE; -+} -+ -+static BusResult -+bus_dispatch_test_check_override (DBusConnection *connection, -+ const char *privilege) -+{ -+ _dbus_verbose ("overriding privilege check %s #%d\n", privilege, cdata->check_counter); -+ cdata->check_counter++; -+ if (!cdata->timedout) -+ { -+ dbus_bool_t added; -+ -+ /* Should be the first privilege check for the "Echo" method. */ -+ _dbus_assert (cdata->check_counter == 1); -+ cdata->timeout = _dbus_timeout_new (1, bus_dispatch_test_check_timeout, -+ NULL, NULL); -+ _dbus_assert (cdata->timeout); -+ added = _dbus_loop_add_timeout (bus_connection_get_loop (connection), -+ cdata->timeout); -+ _dbus_assert (added); -+ cdata->connection = connection; -+ dbus_connection_ref (connection); -+ _dbus_connection_disable_dispatch (connection); -+ return BUS_RESULT_LATER; -+ } -+ else -+ { -+ /* Should only be checked one more time, and this time succeeds. */ -+ _dbus_assert (cdata->check_counter == 2); -+ return BUS_RESULT_TRUE; -+ } -+} -+ -+static dbus_bool_t -+bus_dispatch_test_check (const DBusString *test_data_dir) -+{ -+ const char *filename = "valid-config-files/debug-check-some.conf"; -+ BusContext *context; -+ DBusConnection *foo; -+ DBusError error; -+ dbus_bool_t result = TRUE; -+ BusTestCheckData data; -+ -+ /* save the config name for the activation helper */ -+ if (!setenv_TEST_LAUNCH_HELPER_CONFIG (test_data_dir, filename)) -+ _dbus_assert_not_reached ("no memory setting TEST_LAUNCH_HELPER_CONFIG"); -+ -+ dbus_error_init (&error); -+ -+ context = bus_context_new_test (test_data_dir, filename); -+ if (context == NULL) -+ return FALSE; -+ -+ foo = dbus_connection_open_private (TEST_DEBUG_PIPE, &error); -+ if (foo == NULL) -+ _dbus_assert_not_reached ("could not alloc connection"); -+ -+ if (!bus_setup_debug_client (foo)) -+ _dbus_assert_not_reached ("could not set up connection"); -+ -+ spin_connection_until_authenticated (context, foo); -+ -+ if (!check_hello_message (context, foo)) -+ _dbus_assert_not_reached ("hello message failed"); -+ -+ if (!check_double_hello_message (context, foo)) -+ _dbus_assert_not_reached ("double hello message failed"); -+ -+ if (!check_add_match (context, foo, "")) -+ _dbus_assert_not_reached ("AddMatch message failed"); -+ -+ /* -+ * Cause bus_check_send_privilege() to return BUS_RESULT_LATER in the -+ * first call, then BUS_RESULT_TRUE. -+ */ -+ cdata = &data; -+ memset (cdata, 0, sizeof(*cdata)); -+ bus_check_test_override = bus_dispatch_test_check_override; -+ -+ result = check_existent_service_auto_start (context, foo); -+ -+ _dbus_assert (cdata->check_counter == 2); -+ _dbus_assert (cdata->timedout); -+ _dbus_assert (cdata->timeout); -+ _dbus_assert (!cdata->connection); -+ _dbus_timeout_unref (cdata->timeout); -+ -+ kill_client_connection_unchecked (foo); -+ -+ bus_context_unref (context); -+ -+ return result; -+} -+ - dbus_bool_t - bus_dispatch_test (const DBusString *test_data_dir) - { -+ _dbus_verbose (" tests\n"); -+ if (!bus_dispatch_test_check (test_data_dir)) -+ return FALSE; -+ - /* run normal activation tests */ - _dbus_verbose ("Normal activation tests\n"); - if (!bus_dispatch_test_conf (test_data_dir, -diff --git a/bus/dispatch.h b/bus/dispatch.h -index fb5ba7a..afba6a2 100644 ---- a/bus/dispatch.h -+++ b/bus/dispatch.h -@@ -29,7 +29,7 @@ - - dbus_bool_t bus_dispatch_add_connection (DBusConnection *connection); - void bus_dispatch_remove_connection (DBusConnection *connection); --dbus_bool_t bus_dispatch_matches (BusTransaction *transaction, -+BusResult bus_dispatch_matches (BusTransaction *transaction, - DBusConnection *sender, - DBusConnection *recipient, - DBusMessage *message, -diff --git a/bus/driver.c b/bus/driver.c -index cd0a714..f414f64 100644 ---- a/bus/driver.c -+++ b/bus/driver.c -@@ -218,6 +218,7 @@ bus_driver_send_service_owner_changed (const char *service_name, - { - DBusMessage *message; - dbus_bool_t retval; -+ BusResult res; - const char *null_service; - - _DBUS_ASSERT_ERROR_IS_CLEAR (error); -@@ -253,7 +254,16 @@ bus_driver_send_service_owner_changed (const char *service_name, - if (!bus_transaction_capture (transaction, NULL, NULL, message)) - goto oom; - -- retval = bus_dispatch_matches (transaction, NULL, NULL, message, error); -+ res = bus_dispatch_matches (transaction, NULL, NULL, message, error); -+ if (res == BUS_RESULT_TRUE) -+ retval = TRUE; -+ else -+ { -+ retval = FALSE; -+ if (res == BUS_RESULT_LATER) -+ /* should never happen */ -+ _dbus_assert_not_reached ("bus_dispatch_matches returned BUS_RESULT_LATER unexpectedly"); -+ } - dbus_message_unref (message); - - return retval; -diff --git a/dbus/dbus-connection-internal.h b/dbus/dbus-connection-internal.h -index 4835732..94b1c95 100644 ---- a/dbus/dbus-connection-internal.h -+++ b/dbus/dbus-connection-internal.h -@@ -118,6 +118,21 @@ DBUS_PRIVATE_EXPORT - dbus_bool_t _dbus_connection_get_linux_security_label (DBusConnection *connection, - char **label_p); - -+DBUS_PRIVATE_EXPORT -+void _dbus_connection_enable_dispatch (DBusConnection *connection); -+DBUS_PRIVATE_EXPORT -+void _dbus_connection_disable_dispatch (DBusConnection *connection); -+ -+DBUS_PRIVATE_EXPORT -+dbus_bool_t _dbus_connection_putback_message (DBusConnection *connection, -+ DBusMessage *after_message, -+ DBusMessage *message, -+ DBusError *error); -+ -+DBUS_PRIVATE_EXPORT -+dbus_bool_t _dbus_connection_remove_message (DBusConnection *connection, -+ DBusMessage *message); -+ - /* if DBUS_ENABLE_STATS */ - DBUS_PRIVATE_EXPORT - void _dbus_connection_get_stats (DBusConnection *connection, -diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c -index c525b6d..958968c 100644 ---- a/dbus/dbus-connection.c -+++ b/dbus/dbus-connection.c -@@ -311,7 +311,8 @@ struct DBusConnection - */ - dbus_bool_t dispatch_acquired; /**< Someone has dispatch path (can drain incoming queue) */ - dbus_bool_t io_path_acquired; /**< Someone has transport io path (can use the transport to read/write messages) */ -- -+ -+ unsigned int dispatch_disabled : 1; /**< if true, then dispatching incoming messages is stopped until enabled again */ - unsigned int shareable : 1; /**< #TRUE if libdbus owns a reference to the connection and can return it from dbus_connection_open() more than once */ - - unsigned int exit_on_disconnect : 1; /**< If #TRUE, exit after handling disconnect signal */ -@@ -439,6 +440,39 @@ _dbus_connection_wakeup_mainloop (DBusConnection *connection) - (*connection->wakeup_main_function) (connection->wakeup_main_data); - } - -+static void -+_dbus_connection_set_dispatch(DBusConnection *connection, -+ dbus_bool_t disabled) -+{ -+ CONNECTION_LOCK (connection); -+ if (connection->dispatch_disabled != disabled) -+ { -+ DBusDispatchStatus status; -+ -+ connection->dispatch_disabled = disabled; -+ status = _dbus_connection_get_dispatch_status_unlocked (connection); -+ _dbus_connection_update_dispatch_status_and_unlock (connection, status); -+ } -+ else -+ { -+ CONNECTION_UNLOCK (connection); -+ } -+} -+ -+ -+void -+_dbus_connection_enable_dispatch (DBusConnection *connection) -+{ -+ _dbus_connection_set_dispatch (connection, FALSE); -+} -+ -+void -+ _dbus_connection_disable_dispatch (DBusConnection *connection) -+{ -+ _dbus_connection_set_dispatch (connection, TRUE); -+} -+ -+ - #ifdef DBUS_ENABLE_EMBEDDED_TESTS - /** - * Gets the locks so we can examine them -@@ -4069,6 +4103,82 @@ _dbus_connection_putback_message_link_unlocked (DBusConnection *connection, - "_dbus_connection_putback_message_link_unlocked"); - } - -+dbus_bool_t -+_dbus_connection_putback_message (DBusConnection *connection, -+ DBusMessage *after_message, -+ DBusMessage *message, -+ DBusError *error) -+{ -+ DBusDispatchStatus status; -+ DBusList *message_link = _dbus_list_alloc_link (message); -+ DBusList *after_link; -+ if (message_link == NULL) -+ { -+ _DBUS_SET_OOM (error); -+ return FALSE; -+ } -+ dbus_message_ref (message); -+ -+ CONNECTION_LOCK (connection); -+ _dbus_connection_acquire_dispatch (connection); -+ HAVE_LOCK_CHECK (connection); -+ -+ after_link = _dbus_list_find_first(&connection->incoming_messages, after_message); -+ _dbus_list_insert_after_link (&connection->incoming_messages, after_link, message_link); -+ connection->n_incoming += 1; -+ -+ _dbus_verbose ("Message %p (%s %s %s '%s') put back into queue %p, %d incoming\n", -+ message_link->data, -+ dbus_message_type_to_string (dbus_message_get_type (message_link->data)), -+ dbus_message_get_interface (message_link->data) ? -+ dbus_message_get_interface (message_link->data) : -+ "no interface", -+ dbus_message_get_member (message_link->data) ? -+ dbus_message_get_member (message_link->data) : -+ "no member", -+ dbus_message_get_signature (message_link->data), -+ connection, connection->n_incoming); -+ -+ _dbus_message_trace_ref (message_link->data, -1, -1, -+ "_dbus_connection_putback_message"); -+ -+ _dbus_connection_release_dispatch (connection); -+ -+ status = _dbus_connection_get_dispatch_status_unlocked (connection); -+ _dbus_connection_update_dispatch_status_and_unlock (connection, status); -+ -+ return TRUE; -+} -+ -+dbus_bool_t -+_dbus_connection_remove_message (DBusConnection *connection, -+ DBusMessage *message) -+{ -+ DBusDispatchStatus status; -+ dbus_bool_t removed; -+ -+ CONNECTION_LOCK (connection); -+ _dbus_connection_acquire_dispatch (connection); -+ HAVE_LOCK_CHECK (connection); -+ -+ removed = _dbus_list_remove(&connection->incoming_messages, message); -+ -+ if (removed) -+ { -+ connection->n_incoming -= 1; -+ dbus_message_unref(message); -+ _dbus_verbose ("Message %p removed from incoming queue\n", message); -+ } -+ else -+ _dbus_verbose ("Message %p not found in the incoming queue\n", message); -+ -+ _dbus_connection_release_dispatch (connection); -+ -+ status = _dbus_connection_get_dispatch_status_unlocked (connection); -+ _dbus_connection_update_dispatch_status_and_unlock (connection, status); -+ return removed; -+} -+ - /** - * Returns the first-received message from the incoming message queue, - * removing it from the queue. The caller owns a reference to the -@@ -4252,8 +4362,9 @@ static DBusDispatchStatus - _dbus_connection_get_dispatch_status_unlocked (DBusConnection *connection) - { - HAVE_LOCK_CHECK (connection); -- -- if (connection->n_incoming > 0) -+ if (connection->dispatch_disabled && _dbus_connection_get_is_connected_unlocked(connection)) -+ return DBUS_DISPATCH_COMPLETE; -+ else if (connection->n_incoming > 0) - return DBUS_DISPATCH_DATA_REMAINS; - else if (!_dbus_transport_queue_messages (connection->transport)) - return DBUS_DISPATCH_NEED_MEMORY; -@@ -4716,6 +4827,8 @@ dbus_connection_dispatch (DBusConnection *connection) - - CONNECTION_LOCK (connection); - -+ if (result == DBUS_HANDLER_RESULT_LATER) -+ goto out; - if (result == DBUS_HANDLER_RESULT_NEED_MEMORY) - { - _dbus_verbose ("No memory\n"); -@@ -4838,9 +4951,11 @@ dbus_connection_dispatch (DBusConnection *connection) - connection); - - out: -- if (result == DBUS_HANDLER_RESULT_NEED_MEMORY) -+ if (result == DBUS_HANDLER_RESULT_LATER || -+ result == DBUS_HANDLER_RESULT_NEED_MEMORY) - { -- _dbus_verbose ("out of memory\n"); -+ if (result == DBUS_HANDLER_RESULT_NEED_MEMORY) -+ _dbus_verbose ("out of memory\n"); - - /* Put message back, and we'll start over. - * Yes this means handlers must be idempotent if they -diff --git a/dbus/dbus-list.c b/dbus/dbus-list.c -index 8e713c0..32ea871 100644 ---- a/dbus/dbus-list.c -+++ b/dbus/dbus-list.c -@@ -458,6 +458,35 @@ _dbus_list_remove_last (DBusList **list, - return FALSE; - } - -+/** -+ * Finds a value in the list. Returns the first link -+ * with value equal to the given data pointer. -+ * This is a linear-time operation. -+ * Returns #NULL if no value found that matches. -+ * -+ * @param list address of the list head. -+ * @param data the value to find. -+ * @returns the link if found -+ */ -+DBusList* -+_dbus_list_find_first (DBusList **list, -+ void *data) -+{ -+ DBusList *link; -+ -+ link = _dbus_list_get_first_link (list); -+ -+ while (link != NULL) -+ { -+ if (link->data == data) -+ return link; -+ -+ link = _dbus_list_get_next_link (list, link); -+ } -+ -+ return NULL; -+} -+ - /** - * Finds a value in the list. Returns the last link - * with value equal to the given data pointer. -diff --git a/dbus/dbus-list.h b/dbus/dbus-list.h -index 9350a0d..fee9f1b 100644 ---- a/dbus/dbus-list.h -+++ b/dbus/dbus-list.h -@@ -68,6 +68,9 @@ DBUS_PRIVATE_EXPORT - void _dbus_list_remove_link (DBusList **list, - DBusList *link); - DBUS_PRIVATE_EXPORT -+DBusList* _dbus_list_find_first (DBusList **list, -+ void *data); -+DBUS_PRIVATE_EXPORT - DBusList* _dbus_list_find_last (DBusList **list, - void *data); - DBUS_PRIVATE_EXPORT -diff --git a/dbus/dbus-shared.h b/dbus/dbus-shared.h -index 7ab9103..e5bfbed 100644 ---- a/dbus/dbus-shared.h -+++ b/dbus/dbus-shared.h -@@ -67,7 +67,8 @@ typedef enum - { - DBUS_HANDLER_RESULT_HANDLED, /**< Message has had its effect - no need to run more handlers. */ - DBUS_HANDLER_RESULT_NOT_YET_HANDLED, /**< Message has not had any effect - see if other handlers want it. */ -- DBUS_HANDLER_RESULT_NEED_MEMORY /**< Need more memory in order to return #DBUS_HANDLER_RESULT_HANDLED or #DBUS_HANDLER_RESULT_NOT_YET_HANDLED. Please try again later with more memory. */ -+ DBUS_HANDLER_RESULT_NEED_MEMORY, /**< Need more memory in order to return #DBUS_HANDLER_RESULT_HANDLED or #DBUS_HANDLER_RESULT_NOT_YET_HANDLED. Please try again later with more memory. */ -+ DBUS_HANDLER_RESULT_LATER /**< Message dispatch deferred due to pending policy check */ - } DBusHandlerResult; - - /* Bus names */ --- -2.17.2 - diff --git a/meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0003-Handle-unavailability-of-policy-results-for-broadcas.patch b/meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0003-Handle-unavailability-of-policy-results-for-broadcas.patch deleted file mode 100644 index 1c2ab2bc..00000000 --- a/meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0003-Handle-unavailability-of-policy-results-for-broadcas.patch +++ /dev/null @@ -1,1082 +0,0 @@ -From fdc3d7086c8f7a623e3da80e559708545b9201fc Mon Sep 17 00:00:00 2001 -From: Jacek Bukarewicz -Date: Fri, 28 Nov 2014 12:39:33 +0100 -Subject: Handle unavailability of policy results for broadcasts and receive - rules -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When message is sent to the addressed recipient and receive rule -result is unavailable we don't want to block the sender -as it most likely will be the privileged service, so instead we queue -it at the recipient. Any further messages sent to it will be queued to -maintain message order. Once the answer from Cynara arrives messages are -dispatched from the recipient queue. In such case full dispatch is -performed - messages are sent to addressed recipient and other -interested connections. -Messages sent to non-addressed recipients (eavesdroppers or broadcast -message recipients) are handled in a similar way. The difference is -that it is not full dispatch meaning message is sent to a single recipient. - -Cherry picked from 1e231194610892dd4360224998d91336097b05a1 by Jose Bollo - -Updated for dbus 1.10.20 by Scott Murray and José Bollo - -Signed-off-by: José Bollo -Signed-off-by: Scott Murray - -diff --git a/bus/activation.c b/bus/activation.c -index 005047f..ffdc6fc 100644 ---- a/bus/activation.c -+++ b/bus/activation.c -@@ -1259,7 +1259,7 @@ bus_activation_send_pending_auto_activation_messages (BusActivation *activation - res = bus_dispatch_matches (transaction, - entry->connection, - addressed_recipient, -- entry->activation_message, &error); -+ entry->activation_message, NULL, &error); - if (res == BUS_RESULT_FALSE) - { - /* If permission is denied, we just want to return the error -@@ -2137,7 +2137,7 @@ bus_activation_activate_service (BusActivation *activation, - bus_connection_get_loginfo (connection)); - /* Wonderful, systemd is connected, let's just send the msg */ - res = bus_dispatch_matches (activation_transaction, NULL, -- systemd, message, error); -+ systemd, message, NULL, error); - - if (res == BUS_RESULT_TRUE) - retval = TRUE; -diff --git a/bus/bus.c b/bus/bus.c -index 237efe3..5bb5637 100644 ---- a/bus/bus.c -+++ b/bus/bus.c -@@ -1800,17 +1800,9 @@ bus_context_check_security_policy (BusContext *context, - } - - /* See if limits on size have been exceeded */ -- if (proposed_recipient && -- ((dbus_connection_get_outgoing_size (proposed_recipient) > context->limits.max_outgoing_bytes) || -- (dbus_connection_get_outgoing_unix_fds (proposed_recipient) > context->limits.max_outgoing_unix_fds))) -- { -- complain_about_message (context, DBUS_ERROR_LIMITS_EXCEEDED, -- "Rejected: destination has a full message queue", -- 0, message, sender, proposed_recipient, requested_reply, TRUE, NULL, -- error); -- _dbus_verbose ("security policy disallowing message due to full message queue\n"); -+ if (!bus_context_check_recipient_message_limits(context, proposed_recipient, sender, message, -+ requested_reply, error)) - return BUS_RESULT_FALSE; -- } - - /* Record that we will allow a reply here in the future (don't - * bother if the recipient is the bus or this is an eavesdropping -@@ -1869,3 +1861,41 @@ bus_context_check_all_watches (BusContext *context) - _dbus_server_toggle_all_watches (server, enabled); - } - } -+ -+void -+bus_context_complain_about_message (BusContext *context, -+ const char *error_name, -+ const char *complaint, -+ int matched_rules, -+ DBusMessage *message, -+ DBusConnection *sender, -+ DBusConnection *proposed_recipient, -+ dbus_bool_t requested_reply, -+ dbus_bool_t log, -+ const char *privilege, -+ DBusError *error) -+{ -+ complain_about_message(context, error_name, complaint, matched_rules, message, sender, -+ proposed_recipient, requested_reply, log, privilege, error); -+} -+ -+dbus_bool_t bus_context_check_recipient_message_limits (BusContext *context, -+ DBusConnection *recipient, -+ DBusConnection *sender, -+ DBusMessage *message, -+ dbus_bool_t requested_reply, -+ DBusError *error) -+{ -+ if (recipient && -+ ((dbus_connection_get_outgoing_size (recipient) > context->limits.max_outgoing_bytes) || -+ (dbus_connection_get_outgoing_unix_fds (recipient) > context->limits.max_outgoing_unix_fds))) -+ { -+ complain_about_message (context, DBUS_ERROR_LIMITS_EXCEEDED, -+ "Rejected: destination has a full message queue", -+ 0, message, sender, recipient, requested_reply, TRUE, NULL, -+ error); -+ _dbus_verbose ("security policy disallowing message due to full message queue\n"); -+ return FALSE; -+ } -+ return TRUE; -+} -diff --git a/bus/bus.h b/bus/bus.h -index 82c32c8..1b08f7c 100644 ---- a/bus/bus.h -+++ b/bus/bus.h -@@ -164,4 +164,23 @@ BusResult bus_context_check_security_policy (BusContext - BusDeferredMessage **deferred_message); - void bus_context_check_all_watches (BusContext *context); - -+dbus_bool_t bus_context_check_recipient_message_limits (BusContext *context, -+ DBusConnection *recipient, -+ DBusConnection *sender, -+ DBusMessage *message, -+ dbus_bool_t requested_reply, -+ DBusError *error); -+void bus_context_complain_about_message (BusContext *context, -+ const char *error_name, -+ const char *complaint, -+ int matched_rules, -+ DBusMessage *message, -+ DBusConnection *sender, -+ DBusConnection *proposed_recipient, -+ dbus_bool_t requested_reply, -+ dbus_bool_t log, -+ const char *privilege, -+ DBusError *error); -+ -+ - #endif /* BUS_BUS_H */ -diff --git a/bus/check.c b/bus/check.c -index 4b8a699..f3d283f 100644 ---- a/bus/check.c -+++ b/bus/check.c -@@ -49,6 +49,9 @@ typedef struct BusDeferredMessage - DBusConnection *sender; - DBusConnection *proposed_recipient; - DBusConnection *addressed_recipient; -+ dbus_bool_t requested_reply; -+ int matched_rules; -+ const char *privilege; - dbus_bool_t full_dispatch; - BusDeferredMessageStatus status; - BusResult response; -@@ -135,6 +138,89 @@ bus_check_enable_dispatch_callback (BusDeferredMessage *deferred_message, - _dbus_connection_enable_dispatch(deferred_message->sender); - } - -+static void -+bus_check_queued_message_reply_callback (BusDeferredMessage *deferred_message, -+ BusResult result) -+{ -+ int status; -+ -+ _dbus_verbose("bus_check_queued_message_reply_callback called message=%p\n", deferred_message); -+ -+ if (!bus_connection_is_active(deferred_message->proposed_recipient)) -+ return; -+ -+ status = deferred_message->status; -+ -+ deferred_message->status = 0; /* mark message as not waiting for response */ -+ deferred_message->response = result; -+ -+ /* -+ * If send rule allows us to send message we still need to check receive rules. -+ */ -+ if ((status & BUS_DEFERRED_MESSAGE_CHECK_SEND) && (result == BUS_RESULT_TRUE)) -+ { -+ int toggles; -+ BusContext *context; -+ BusRegistry *registry; -+ BusClientPolicy *recipient_policy; -+ BusDeferredMessage *deferred_message_receive; -+ -+ context = bus_connection_get_context(deferred_message->proposed_recipient); -+ registry = bus_context_get_registry(context); -+ recipient_policy = bus_connection_get_policy(deferred_message->proposed_recipient); -+ -+ deferred_message->response = bus_client_policy_check_can_receive(recipient_policy, registry, -+ deferred_message->requested_reply, deferred_message->sender, -+ deferred_message->addressed_recipient, deferred_message->proposed_recipient, deferred_message->message, -+ &toggles, NULL, &deferred_message_receive); -+ if (deferred_message->response == BUS_RESULT_LATER) -+ { -+ /* replace deferred message associated with send check with the one associated with -+ * receive check */ -+ if (!bus_deferred_message_replace(deferred_message, deferred_message_receive)) -+ { -+ /* failed to replace deferred message (due to oom). Set it to rejected */ -+ deferred_message->response = BUS_RESULT_FALSE; -+ } -+ } -+ } -+ -+ bus_connection_dispatch_deferred(deferred_message->proposed_recipient); -+} -+ -+static void -+queue_deferred_message_cancel_transaction_hook (void *data) -+{ -+ BusDeferredMessage *deferred_message = (BusDeferredMessage *)data; -+ bus_connection_remove_deferred_message(deferred_message->proposed_recipient, deferred_message); -+} -+ -+ -+dbus_bool_t -+bus_deferred_message_queue_at_recipient (BusDeferredMessage *deferred_message, -+ BusTransaction *transaction, -+ dbus_bool_t full_dispatch, -+ dbus_bool_t prepend) -+{ -+ _dbus_assert(deferred_message != NULL); -+ _dbus_assert(deferred_message->proposed_recipient != NULL); -+ -+ if (!bus_connection_queue_deferred_message(deferred_message->proposed_recipient, -+ deferred_message, prepend)) -+ return FALSE; -+ -+ if (!bus_transaction_add_cancel_hook(transaction, queue_deferred_message_cancel_transaction_hook, -+ deferred_message, NULL)) -+ { -+ bus_connection_remove_deferred_message(deferred_message->proposed_recipient, deferred_message); -+ return FALSE; -+ } -+ deferred_message->response_callback = bus_check_queued_message_reply_callback; -+ deferred_message->full_dispatch = full_dispatch; -+ -+ return TRUE; -+} -+ - static void - deferred_message_free_function(void *data) - { -@@ -159,6 +245,20 @@ bus_deferred_message_disable_sender (BusDeferredMessage *deferred_message) - deferred_message->response_callback = bus_check_enable_dispatch_callback; - } - -+void -+bus_deferred_message_set_policy_check_info (BusDeferredMessage *deferred_message, -+ dbus_bool_t requested_reply, -+ int matched_rules, -+ const char *privilege) -+{ -+ _dbus_assert(deferred_message != NULL); -+ -+ deferred_message->requested_reply = requested_reply; -+ deferred_message->matched_rules = matched_rules; -+ deferred_message->privilege = privilege; -+} -+ -+ - #ifdef DBUS_ENABLE_EMBEDDED_TESTS - BusResult (*bus_check_test_override) (DBusConnection *connection, - const char *privilege); -@@ -259,6 +359,9 @@ BusDeferredMessage *bus_deferred_message_new (DBusMessage *message, - deferred_message->addressed_recipient = addressed_recipient != NULL ? dbus_connection_ref(addressed_recipient) : NULL; - deferred_message->proposed_recipient = proposed_recipient != NULL ? dbus_connection_ref(proposed_recipient) : NULL; - deferred_message->message = dbus_message_ref(message); -+ deferred_message->requested_reply = FALSE; -+ deferred_message->matched_rules = 0; -+ deferred_message->privilege = NULL; - deferred_message->response = response; - deferred_message->status = 0; - deferred_message->full_dispatch = FALSE; -@@ -295,12 +398,215 @@ bus_deferred_message_unref (BusDeferredMessage *deferred_message) - } - } - -+dbus_bool_t -+bus_deferred_message_check_message_limits (BusDeferredMessage *deferred_message, DBusError *error) -+{ -+ BusContext *context = bus_connection_get_context(deferred_message->proposed_recipient); -+ -+ return bus_context_check_recipient_message_limits(context, deferred_message->proposed_recipient, -+ deferred_message->sender, deferred_message->message, deferred_message->requested_reply, -+ error); -+} -+ -+dbus_bool_t -+bus_deferred_message_expect_method_reply(BusDeferredMessage *deferred_message, BusTransaction *transaction, DBusError *error) -+{ -+ int type = dbus_message_get_type(deferred_message->message); -+ if (type == DBUS_MESSAGE_TYPE_METHOD_CALL && -+ deferred_message->sender && -+ deferred_message->addressed_recipient && -+ deferred_message->addressed_recipient == deferred_message->proposed_recipient && /* not eavesdropping */ -+ !bus_connections_expect_reply (bus_connection_get_connections (deferred_message->sender), -+ transaction, -+ deferred_message->sender, deferred_message->addressed_recipient, -+ deferred_message->message, error)) -+ { -+ _dbus_verbose ("Failed to record reply expectation or problem with the message expecting a reply\n"); -+ return FALSE; -+ } -+ return TRUE; -+} -+ -+void -+bus_deferred_message_create_error(BusDeferredMessage *deferred_message, -+ const char *error_message, DBusError *error) -+{ -+ BusContext *context; -+ _dbus_assert (deferred_message->status == 0 && deferred_message->response == BUS_RESULT_FALSE); -+ -+ if (deferred_message->sender == NULL) -+ return; /* error won't be sent to bus driver anyway */ -+ -+ context = bus_connection_get_context(deferred_message->sender); -+ bus_context_complain_about_message(context, DBUS_ERROR_ACCESS_DENIED, "Rejected message", -+ deferred_message->matched_rules, deferred_message->message, deferred_message->sender, -+ deferred_message->proposed_recipient, deferred_message->requested_reply, FALSE, -+ deferred_message->privilege, error); -+} -+ -+BusResult -+bus_deferred_message_dispatch (BusDeferredMessage *deferred_message) -+{ -+ BusContext *context = bus_connection_get_context (deferred_message->proposed_recipient); -+ BusTransaction *transaction = bus_transaction_new (context); -+ BusResult result = BUS_RESULT_TRUE; -+ DBusError error; -+ -+ if (transaction == NULL) -+ { -+ return BUS_RESULT_FALSE; -+ } -+ -+ dbus_error_init(&error); -+ -+ if (!deferred_message->full_dispatch) -+ { -+ result = deferred_message->response; -+ if (result == BUS_RESULT_TRUE) -+ { -+ if (!bus_context_check_recipient_message_limits(context, deferred_message->proposed_recipient, -+ deferred_message->sender, deferred_message->message, deferred_message->requested_reply, &error)) -+ result = BUS_RESULT_FALSE; -+ } -+ else if (result == BUS_RESULT_LATER) -+ { -+ BusDeferredMessage *deferred_message2; -+ result = bus_context_check_security_policy (context, transaction, -+ deferred_message->sender, -+ deferred_message->addressed_recipient, -+ deferred_message->proposed_recipient, -+ deferred_message->message, NULL, NULL, -+ &deferred_message2); -+ -+ if (result == BUS_RESULT_LATER) -+ { -+ /* prepend at recipient */ -+ if (!bus_deferred_message_queue_at_recipient(deferred_message2, transaction, -+ FALSE, TRUE)) -+ result = BUS_RESULT_FALSE; -+ } -+ } -+ -+ /* silently drop messages on access denial */ -+ if (result == BUS_RESULT_TRUE) -+ { -+ if (!bus_transaction_send (transaction, deferred_message->proposed_recipient, deferred_message->message, TRUE)) -+ result = BUS_RESULT_FALSE; -+ } -+ -+ bus_transaction_execute_and_free(transaction); -+ -+ goto out; -+ } -+ -+ /* do not attempt to send message if sender has disconnected */ -+ if (deferred_message->sender != NULL && !bus_connection_is_active(deferred_message->sender)) -+ { -+ bus_transaction_cancel_and_free(transaction); -+ result = BUS_RESULT_FALSE; -+ goto out; -+ } -+ -+ result = bus_dispatch_matches(transaction, deferred_message->sender, -+ deferred_message->addressed_recipient, deferred_message->message, deferred_message, &error); -+ -+ if (result == BUS_RESULT_LATER) -+ { -+ /* Message deferring was already done in bus_dispatch_matches */ -+ bus_transaction_cancel_and_free(transaction); -+ goto out; -+ } -+ -+ /* this part is a copy & paste from bus_dispatch function. Probably can be moved to a function */ -+ if (dbus_error_is_set (&error)) -+ { -+ if (!dbus_connection_get_is_connected (deferred_message->sender)) -+ { -+ /* If we disconnected it, we won't bother to send it any error -+ * messages. -+ */ -+ _dbus_verbose ("Not sending error to connection we disconnected\n"); -+ } -+ else if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY)) -+ { -+ bus_connection_send_oom_error (deferred_message->sender, deferred_message->message); -+ -+ /* cancel transaction due to OOM */ -+ if (transaction != NULL) -+ { -+ bus_transaction_cancel_and_free (transaction); -+ transaction = NULL; -+ } -+ } -+ else -+ { -+ /* Try to send the real error, if no mem to do that, send -+ * the OOM error -+ */ -+ _dbus_assert (transaction != NULL); -+ if (!bus_transaction_send_error_reply (transaction, deferred_message->sender, -+ &error, deferred_message->message)) -+ { -+ bus_connection_send_oom_error (deferred_message->sender, deferred_message->message); -+ -+ /* cancel transaction due to OOM */ -+ if (transaction != NULL) -+ { -+ bus_transaction_cancel_and_free (transaction); -+ transaction = NULL; -+ } -+ } -+ } -+ } -+ -+ if (transaction != NULL) -+ { -+ bus_transaction_execute_and_free (transaction); -+ } -+ -+out: -+ dbus_error_free(&error); -+ -+ return result; -+} -+ -+dbus_bool_t -+bus_deferred_message_replace (BusDeferredMessage *old_message, BusDeferredMessage *new_message) -+{ -+ if (bus_connection_replace_deferred_message(old_message->proposed_recipient, -+ old_message, new_message)) -+ { -+ new_message->response_callback = old_message->response_callback; -+ new_message->full_dispatch = old_message->full_dispatch; -+ return TRUE; -+ } -+ return FALSE; -+} -+ -+dbus_bool_t -+bus_deferred_message_waits_for_check(BusDeferredMessage *deferred_message) -+{ -+ return deferred_message->status != 0; -+} -+ -+DBusConnection * -+bus_deferred_message_get_recipient(BusDeferredMessage *deferred_message) -+{ -+ return deferred_message->proposed_recipient; -+} -+ - BusDeferredMessageStatus - bus_deferred_message_get_status (BusDeferredMessage *deferred_message) - { - return deferred_message->status; - } - -+BusResult -+bus_deferred_message_get_response (BusDeferredMessage *deferred_message) -+{ -+ return deferred_message->response; -+} -+ - void - bus_deferred_message_response_received (BusDeferredMessage *deferred_message, - BusResult result) -@@ -310,3 +616,4 @@ bus_deferred_message_response_received (BusDeferredMessage *deferred_message, - deferred_message->response_callback(deferred_message, result); - } - } -+ -diff --git a/bus/check.h b/bus/check.h -index d177549..9c13c18 100644 ---- a/bus/check.h -+++ b/bus/check.h -@@ -64,12 +64,37 @@ BusDeferredMessage *bus_deferred_message_new (DBusMessage *messag - - BusDeferredMessage *bus_deferred_message_ref (BusDeferredMessage *deferred_message); - void bus_deferred_message_unref (BusDeferredMessage *deferred_message); -+BusResult bus_deferred_message_dispatch (BusDeferredMessage *deferred_message); -+dbus_bool_t bus_deferred_message_waits_for_check (BusDeferredMessage *deferred_message); -+DBusConnection *bus_deferred_message_get_recipient (BusDeferredMessage *deferred_message); - void bus_deferred_message_response_received (BusDeferredMessage *deferred_message, - BusResult result); -+dbus_bool_t bus_deferred_message_queue_at_recipient (BusDeferredMessage *deferred_message, -+ BusTransaction *transaction, -+ dbus_bool_t full_dispatch, -+ dbus_bool_t prepend); -+dbus_bool_t bus_deferred_message_replace (BusDeferredMessage *old_message, -+ BusDeferredMessage *new_message); - void bus_deferred_message_disable_sender (BusDeferredMessage *deferred_message); -+BusResult bus_deferred_message_get_response (BusDeferredMessage *deferred_message); - - BusDeferredMessageStatus bus_deferred_message_get_status (BusDeferredMessage *deferred_message); - -+ -+dbus_bool_t bus_deferred_message_expect_method_reply (BusDeferredMessage *deferred_message, -+ BusTransaction *transaction, -+ DBusError *error); -+void bus_deferred_message_create_error (BusDeferredMessage *deferred_message, -+ const char *error_message, -+ DBusError *error); -+void bus_deferred_message_set_policy_check_info (BusDeferredMessage *deferred_message, -+ dbus_bool_t requested_reply, -+ int matched_rules, -+ const char *privilege); -+dbus_bool_t bus_deferred_message_check_message_limits (BusDeferredMessage *deferred_message, -+ DBusError *error); -+ -+ - #ifdef DBUS_ENABLE_EMBEDDED_TESTS - extern BusResult (*bus_check_test_override) (DBusConnection *connection, - const char *privilege); -diff --git a/bus/connection.c b/bus/connection.c -index b348d42..ee93384 100644 ---- a/bus/connection.c -+++ b/bus/connection.c -@@ -31,11 +31,13 @@ - #include "expirelist.h" - #include "selinux.h" - #include "apparmor.h" -+#include "check.h" - #include - #include - #include - #include - #include -+#include - #ifdef DBUS_ENABLE_CYNARA - #include - #include -@@ -102,6 +104,7 @@ typedef struct - DBusMessage *oom_message; - DBusPreallocatedSend *oom_preallocated; - BusClientPolicy *policy; -+ DBusList *deferred_messages; /**< Queue of messages deferred due to pending policy check */ - - char *cached_loginfo_string; - BusSELinuxID *selinux_id; -@@ -268,6 +271,8 @@ bus_connection_disconnected (DBusConnection *connection) - bus_transaction_execute_and_free (transaction); - } - -+ bus_connection_clear_deferred_messages(connection); -+ - bus_dispatch_remove_connection (connection); - - /* no more watching */ -@@ -2307,7 +2312,7 @@ bus_transaction_capture (BusTransaction *transaction, - { - DBusConnection *recipient = link->data; - -- if (!bus_transaction_send (transaction, recipient, message)) -+ if (!bus_transaction_send (transaction, recipient, message, FALSE)) - goto out; - } - -@@ -2361,6 +2366,7 @@ bus_transaction_send_from_driver (BusTransaction *transaction, - { - DBusError error = DBUS_ERROR_INIT; - BusResult res; -+ BusDeferredMessage *deferred_message; - - /* We have to set the sender to the driver, and have - * to check security policy since it was not done in -@@ -2401,7 +2407,7 @@ bus_transaction_send_from_driver (BusTransaction *transaction, - res = bus_context_check_security_policy (bus_transaction_get_context (transaction), - transaction, - NULL, connection, connection, message, NULL, -- &error, NULL); -+ &error, &deferred_message); - if (res == BUS_RESULT_FALSE) - { - if (!bus_transaction_capture_error_reply (transaction, connection, -@@ -2419,18 +2425,20 @@ bus_transaction_send_from_driver (BusTransaction *transaction, - } - else if (res == BUS_RESULT_LATER) - { -- _dbus_verbose ("Cannot delay sending message from bus driver, dropping it\n"); - dbus_error_free (&error); -- return TRUE; -+ if (!bus_deferred_message_queue_at_recipient(deferred_message, transaction, FALSE, FALSE)) -+ return FALSE; -+ return TRUE; /* pretend to have sent it */ - } - -- return bus_transaction_send (transaction, connection, message); -+ return bus_transaction_send (transaction, connection, message, FALSE); - } - - dbus_bool_t - bus_transaction_send (BusTransaction *transaction, - DBusConnection *connection, -- DBusMessage *message) -+ DBusMessage *message, -+ dbus_bool_t deferred_dispatch) - { - MessageToSend *to_send; - BusConnectionData *d; -@@ -2456,7 +2464,28 @@ bus_transaction_send (BusTransaction *transaction, - - d = BUS_CONNECTION_DATA (connection); - _dbus_assert (d != NULL); -- -+ -+ if (!deferred_dispatch && d->deferred_messages != NULL) -+ { -+ BusDeferredMessage *deferred_message; -+ dbus_bool_t success; -+ /* sender and addressed recipient are not required at this point as we only need to send message -+ * to a single recipient without performing policy check. */ -+ deferred_message = bus_deferred_message_new (message, -+ NULL, -+ NULL, -+ connection, -+ BUS_RESULT_TRUE); -+ if (deferred_message == NULL) -+ return FALSE; -+ -+ success = bus_deferred_message_queue_at_recipient(deferred_message, transaction, -+ FALSE, FALSE); -+ bus_deferred_message_unref(deferred_message); -+ -+ return success; -+ } -+ - to_send = dbus_new (MessageToSend, 1); - if (to_send == NULL) - { -@@ -2708,6 +2737,131 @@ bus_transaction_add_cancel_hook (BusTransaction *transaction, - return TRUE; - } - -+void -+bus_connection_dispatch_deferred (DBusConnection *connection) -+{ -+ BusDeferredMessage *message; -+ -+ _dbus_return_if_fail (connection != NULL); -+ -+ while ((message = bus_connection_pop_deferred_message(connection)) != NULL) -+ { -+ bus_deferred_message_dispatch(message); -+ bus_deferred_message_unref(message); -+ } -+} -+ -+dbus_bool_t -+bus_connection_has_deferred_messages (DBusConnection *connection) -+{ -+ BusConnectionData *d = BUS_CONNECTION_DATA(connection); -+ return d->deferred_messages != NULL ? TRUE : FALSE; -+} -+ -+dbus_bool_t -+bus_connection_queue_deferred_message (DBusConnection *connection, -+ BusDeferredMessage *message, -+ dbus_bool_t prepend) -+{ -+ BusConnectionData *d = BUS_CONNECTION_DATA(connection); -+ dbus_bool_t success; -+ if (prepend) -+ success = _dbus_list_prepend(&d->deferred_messages, message); -+ else -+ success = _dbus_list_append(&d->deferred_messages, message); -+ -+ if (success) -+ { -+ bus_deferred_message_ref(message); -+ return TRUE; -+ } -+ -+ return FALSE; -+} -+ -+dbus_bool_t -+bus_connection_replace_deferred_message (DBusConnection *connection, -+ BusDeferredMessage *oldMessage, -+ BusDeferredMessage *newMessage) -+{ -+ DBusList *link; -+ BusConnectionData *d = BUS_CONNECTION_DATA(connection); -+ -+ link = _dbus_list_find_first(&d->deferred_messages, oldMessage); -+ if (link == NULL) -+ return FALSE; -+ -+ if (!_dbus_list_insert_after(&d->deferred_messages, link, newMessage)) -+ return FALSE; -+ -+ bus_deferred_message_ref(newMessage); -+ _dbus_list_remove_link(&d->deferred_messages, link); -+ bus_deferred_message_unref(oldMessage); -+ return TRUE; -+} -+ -+BusDeferredMessage * -+bus_connection_pop_deferred_message (DBusConnection *connection) -+{ -+ DBusList *link; -+ BusDeferredMessage *message; -+ BusConnectionData *d = BUS_CONNECTION_DATA(connection); -+ -+ link =_dbus_list_get_first_link(&d->deferred_messages); -+ if (link != NULL) -+ { -+ message = link->data; -+ if (!bus_deferred_message_waits_for_check(message)) -+ { -+ _dbus_list_remove_link(&d->deferred_messages, link); -+ return message; -+ } -+ } -+ -+ return NULL; -+} -+ -+dbus_bool_t -+bus_connection_putback_deferred_message (DBusConnection *connection, BusDeferredMessage *message) -+{ -+ BusConnectionData *d = BUS_CONNECTION_DATA(connection); -+ if (_dbus_list_prepend(&d->deferred_messages, message)) -+ { -+ return TRUE; -+ } -+ return FALSE; -+} -+ -+void -+bus_connection_clear_deferred_messages (DBusConnection *connection) -+{ -+ BusConnectionData *d = BUS_CONNECTION_DATA(connection); -+ DBusList *link; -+ DBusList *next; -+ BusDeferredMessage *message; -+ -+ link =_dbus_list_get_first_link(&d->deferred_messages); -+ while (link != NULL) -+ { -+ next = _dbus_list_get_next_link (&d->deferred_messages, link); -+ message = link->data; -+ -+ bus_deferred_message_unref(message); -+ _dbus_list_remove_link(&d->deferred_messages, link); -+ -+ link = next; -+ } -+} -+ -+void -+bus_connection_remove_deferred_message (DBusConnection *connection, -+ BusDeferredMessage *message) -+{ -+ BusConnectionData *d = BUS_CONNECTION_DATA(connection); -+ if (_dbus_list_remove(&d->deferred_messages, message)) -+ bus_deferred_message_unref(message); -+} -+ - int - bus_connections_get_n_active (BusConnections *connections) - { -diff --git a/bus/connection.h b/bus/connection.h -index 71078ea..97dae96 100644 ---- a/bus/connection.h -+++ b/bus/connection.h -@@ -85,6 +85,22 @@ dbus_bool_t bus_connection_preallocate_oom_error (DBusConnection *connection); - void bus_connection_send_oom_error (DBusConnection *connection, - DBusMessage *in_reply_to); - -+dbus_bool_t bus_connection_has_deferred_messages (DBusConnection *connection); -+dbus_bool_t bus_connection_queue_deferred_message (DBusConnection *connection, -+ BusDeferredMessage *message, -+ dbus_bool_t prepend); -+BusDeferredMessage *bus_connection_pop_deferred_message (DBusConnection *connection); -+dbus_bool_t bus_connection_putback_deferred_message (DBusConnection *connection, -+ BusDeferredMessage *message); -+void bus_connection_remove_deferred_message (DBusConnection *connection, -+ BusDeferredMessage *message); -+dbus_bool_t bus_connection_replace_deferred_message (DBusConnection *connection, -+ BusDeferredMessage *oldMessage, -+ BusDeferredMessage *newMessage); -+void bus_connection_dispatch_deferred (DBusConnection *connection); -+void bus_connection_clear_deferred_messages (DBusConnection *connection); -+ -+ - /* called by signals.c */ - dbus_bool_t bus_connection_add_match_rule (DBusConnection *connection, - BusMatchRule *rule); -@@ -137,7 +153,8 @@ BusTransaction* bus_transaction_new (BusContext * - BusContext* bus_transaction_get_context (BusTransaction *transaction); - dbus_bool_t bus_transaction_send (BusTransaction *transaction, - DBusConnection *connection, -- DBusMessage *message); -+ DBusMessage *message, -+ dbus_bool_t deferred_dispatch); - dbus_bool_t bus_transaction_capture (BusTransaction *transaction, - DBusConnection *connection, - DBusConnection *addressed_recipient, -diff --git a/bus/dispatch.c b/bus/dispatch.c -index 50a22a3..7d30ce4 100644 ---- a/bus/dispatch.c -+++ b/bus/dispatch.c -@@ -33,6 +33,7 @@ - #include "utils.h" - #include "bus.h" - #include "signals.h" -+#include "dispatch.h" - #include "test.h" - #include - #include -@@ -77,7 +78,7 @@ send_one_message (DBusConnection *connection, - NULL, - &stack_error, - &deferred_message); -- if (result != BUS_RESULT_TRUE) -+ if (result == BUS_RESULT_FALSE) - { - if (!bus_transaction_capture_error_reply (transaction, sender, - &stack_error, message)) -@@ -112,9 +113,19 @@ send_one_message (DBusConnection *connection, - return TRUE; /* don't send it but don't return an error either */ - } - -+ if (result == BUS_RESULT_LATER) -+ { -+ if (!bus_deferred_message_queue_at_recipient(deferred_message, transaction, FALSE, FALSE)) -+ { -+ BUS_SET_OOM (error); -+ return FALSE; -+ } -+ return TRUE; /* pretend to have sent it */ -+ } -+ - if (!bus_transaction_send (transaction, - connection, -- message)) -+ message, FALSE)) - { - BUS_SET_OOM (error); - return FALSE; -@@ -124,11 +135,12 @@ send_one_message (DBusConnection *connection, - } - - BusResult --bus_dispatch_matches (BusTransaction *transaction, -- DBusConnection *sender, -- DBusConnection *addressed_recipient, -- DBusMessage *message, -- DBusError *error) -+bus_dispatch_matches (BusTransaction *transaction, -+ DBusConnection *sender, -+ DBusConnection *addressed_recipient, -+ DBusMessage *message, -+ BusDeferredMessage *dispatched_deferred_message, -+ DBusError *error) - { - DBusError tmp_error; - BusConnections *connections; -@@ -137,7 +149,6 @@ bus_dispatch_matches (BusTransaction *transaction, - DBusList *link; - BusContext *context; - BusDeferredMessage *deferred_message; -- BusResult res; - - _DBUS_ASSERT_ERROR_IS_CLEAR (error); - -@@ -153,16 +164,80 @@ bus_dispatch_matches (BusTransaction *transaction, - /* First, send the message to the addressed_recipient, if there is one. */ - if (addressed_recipient != NULL) - { -- res = bus_context_check_security_policy (context, transaction, -+ BusResult result; -+ /* To maintain message order message needs to be appended at the recipient if there are already -+ * deferred messages and we are not doing deferred dispatch -+ */ -+ if (dispatched_deferred_message == NULL && bus_connection_has_deferred_messages(addressed_recipient)) -+ { -+ deferred_message = bus_deferred_message_new(message, sender, -+ addressed_recipient, addressed_recipient, BUS_RESULT_LATER); -+ -+ if (deferred_message == NULL) -+ { -+ BUS_SET_OOM(error); -+ return BUS_RESULT_FALSE; -+ } -+ -+ if (!bus_deferred_message_queue_at_recipient(deferred_message, transaction, TRUE, FALSE)) -+ { -+ bus_deferred_message_unref(deferred_message); -+ BUS_SET_OOM(error); -+ return BUS_RESULT_FALSE; -+ } -+ -+ bus_deferred_message_unref(deferred_message); -+ return BUS_RESULT_TRUE; /* pretend to have sent it */ -+ } -+ -+ if (dispatched_deferred_message != NULL) -+ { -+ result = bus_deferred_message_get_response(dispatched_deferred_message); -+ if (result == BUS_RESULT_TRUE) -+ { -+ /* if we know the result of policy check we still need to check if message limits -+ * are not exceeded. It is also required to add entry in expected replies list if -+ * this is a method call -+ */ -+ if (!bus_deferred_message_check_message_limits(dispatched_deferred_message, error)) -+ return BUS_RESULT_FALSE; -+ -+ if (!bus_deferred_message_expect_method_reply(dispatched_deferred_message, transaction, error)) -+ return BUS_RESULT_FALSE; -+ } -+ else if (result == BUS_RESULT_FALSE) -+ { -+ bus_deferred_message_create_error(dispatched_deferred_message, "Rejected message", error); -+ return BUS_RESULT_FALSE; -+ } -+ } -+ else -+ result = BUS_RESULT_LATER; -+ -+ if (result == BUS_RESULT_LATER) -+ result = bus_context_check_security_policy (context, transaction, - sender, addressed_recipient, - addressed_recipient, - message, NULL, error, - &deferred_message); -- if (res == BUS_RESULT_FALSE) -+ -+ if (result == BUS_RESULT_FALSE) - return BUS_RESULT_FALSE; -- else if (res == BUS_RESULT_LATER) -+ else if (result == BUS_RESULT_LATER) - { - BusDeferredMessageStatus status; -+ -+ if (dispatched_deferred_message != NULL) -+ { -+ /* for deferred dispatch prepend message at the recipient */ -+ if (!bus_deferred_message_queue_at_recipient(deferred_message, transaction, TRUE, TRUE)) -+ { -+ BUS_SET_OOM(error); -+ return BUS_RESULT_FALSE; -+ } -+ return BUS_RESULT_TRUE; /* pretend to have sent it */ -+ } -+ - status = bus_deferred_message_get_status(deferred_message); - - if (status & BUS_DEFERRED_MESSAGE_CHECK_SEND) -@@ -173,13 +248,18 @@ bus_dispatch_matches (BusTransaction *transaction, - } - else if (status & BUS_DEFERRED_MESSAGE_CHECK_RECEIVE) - { -- dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, -- "Rejecting message because time is needed to check security policy"); -- return BUS_RESULT_FALSE; -+ /* receive rule result not available - queue message at the recipient */ -+ if (!bus_deferred_message_queue_at_recipient(deferred_message, transaction, TRUE, FALSE)) -+ { -+ BUS_SET_OOM(error); -+ return BUS_RESULT_FALSE; -+ } -+ -+ return BUS_RESULT_TRUE; /* pretend to have sent it */ - } - else - { -- _dbus_verbose("deferred message has no status field set to send or receive unexpectedly\n"); -+ _dbus_verbose("deferred message has no status field set unexpectedly\n"); - return BUS_RESULT_FALSE; - } - } -@@ -196,7 +276,8 @@ bus_dispatch_matches (BusTransaction *transaction, - } - - /* Dispatch the message */ -- if (!bus_transaction_send (transaction, addressed_recipient, message)) -+ if (!bus_transaction_send(transaction, addressed_recipient, message, -+ dispatched_deferred_message != NULL ? TRUE : FALSE)) - { - BUS_SET_OOM (error); - return BUS_RESULT_FALSE; -@@ -534,7 +615,7 @@ bus_dispatch (DBusConnection *connection, - * match rules. - */ - if (BUS_RESULT_LATER == bus_dispatch_matches (transaction, connection, addressed_recipient, -- message, &error)) -+ message, NULL, &error)) - { - /* Roll back and dispatch the message once the policy result is available */ - bus_transaction_cancel_and_free (transaction); -diff --git a/bus/dispatch.h b/bus/dispatch.h -index afba6a2..f6102e8 100644 ---- a/bus/dispatch.h -+++ b/bus/dispatch.h -@@ -29,10 +29,11 @@ - - dbus_bool_t bus_dispatch_add_connection (DBusConnection *connection); - void bus_dispatch_remove_connection (DBusConnection *connection); --BusResult bus_dispatch_matches (BusTransaction *transaction, -- DBusConnection *sender, -- DBusConnection *recipient, -- DBusMessage *message, -- DBusError *error); -+BusResult bus_dispatch_matches (BusTransaction *transaction, -+ DBusConnection *sender, -+ DBusConnection *recipient, -+ DBusMessage *message, -+ BusDeferredMessage *dispatched_deferred_message, -+ DBusError *error); - - #endif /* BUS_DISPATCH_H */ -diff --git a/bus/driver.c b/bus/driver.c -index f414f64..d89a658 100644 ---- a/bus/driver.c -+++ b/bus/driver.c -@@ -254,7 +254,7 @@ bus_driver_send_service_owner_changed (const char *service_name, - if (!bus_transaction_capture (transaction, NULL, NULL, message)) - goto oom; - -- res = bus_dispatch_matches (transaction, NULL, NULL, message, error); -+ res = bus_dispatch_matches (transaction, NULL, NULL, message, NULL, error); - if (res == BUS_RESULT_TRUE) - retval = TRUE; - else -diff --git a/bus/policy.c b/bus/policy.c -index 7ee1ce5..b1fab0d 100644 ---- a/bus/policy.c -+++ b/bus/policy.c -@@ -1121,6 +1121,9 @@ bus_client_policy_check_can_send (DBusConnection *sender, - - result = bus_check_privilege(check, message, sender, addressed_recipient, receiver, - privilege, BUS_DEFERRED_MESSAGE_CHECK_SEND, deferred_message); -+ if (result == BUS_RESULT_LATER && deferred_message != NULL) -+ bus_deferred_message_set_policy_check_info(*deferred_message, requested_reply, -+ *toggles, privilege); - } - else - privilege = NULL; -@@ -1370,6 +1373,9 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, - - result = bus_check_privilege(check, message, sender, addressed_recipient, proposed_recipient, - privilege, BUS_DEFERRED_MESSAGE_CHECK_RECEIVE, deferred_message); -+ if (result == BUS_RESULT_LATER && deferred_message != NULL) -+ bus_deferred_message_set_policy_check_info(*deferred_message, requested_reply, -+ *toggles, privilege); - } - else - privilege = NULL; --- -2.17.2 - diff --git a/meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0004-Add-own-rule-result-unavailability-handling.patch b/meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0004-Add-own-rule-result-unavailability-handling.patch deleted file mode 100644 index 9cb744de..00000000 --- a/meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0004-Add-own-rule-result-unavailability-handling.patch +++ /dev/null @@ -1,1493 +0,0 @@ -From e7ae85429aa3e6d80df13b3a5a492d9ccbf42518 Mon Sep 17 00:00:00 2001 -From: Jacek Bukarewicz -Date: Thu, 27 Nov 2014 11:26:21 +0100 -Subject: Add own rule result unavailability handling -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Own rule result unavailability is handled like send rules - dispatching -messages from the sender is blocked and resumed when result becomes -available. - -Handler of "RequestName" method needs to return BUS_RESULT_LATER when -policy result is not known therefore its return type is modified. -Since bus message handlers are put into function pointer array other -message handler function singatures are also affected. - -Cherry-picked from 35ef89cd6777ea2430077fc621d21bd01df92349 by Jose.bollo - -Updated for dbus 1.10.20 by Scott Murray and José Bollo - -Signed-off-by: José Bollo -Signed-off-by: Scott Murray - -diff --git a/bus/dispatch.c b/bus/dispatch.c -index 7d30ce4..4b84c21 100644 ---- a/bus/dispatch.c -+++ b/bus/dispatch.c -@@ -517,8 +517,17 @@ bus_dispatch (DBusConnection *connection, - } - - _dbus_verbose ("Giving message to %s\n", DBUS_SERVICE_DBUS); -- if (!bus_driver_handle_message (connection, transaction, message, &error)) -+ res = bus_driver_handle_message (connection, transaction, message, &error); -+ if (res == BUS_RESULT_FALSE) - goto out; -+ else if (res == BUS_RESULT_LATER) -+ { -+ /* connection has been disabled in message handler */ -+ bus_transaction_cancel_and_free (transaction); -+ transaction = NULL; -+ result = DBUS_HANDLER_RESULT_LATER; -+ goto out; -+ } - } - else if (!bus_connection_is_active (connection)) /* clients must talk to bus driver first */ - { -diff --git a/bus/driver.c b/bus/driver.c -index d89a658..aaeb3b2 100644 ---- a/bus/driver.c -+++ b/bus/driver.c -@@ -420,7 +420,7 @@ create_unique_client_name (BusRegistry *registry, - return TRUE; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_hello (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -428,7 +428,7 @@ bus_driver_handle_hello (DBusConnection *connection, - { - DBusString unique_name; - BusService *service; -- dbus_bool_t retval; -+ BusResult retval; - BusRegistry *registry; - BusConnections *connections; - DBusError tmp_error; -@@ -442,7 +442,7 @@ bus_driver_handle_hello (DBusConnection *connection, - /* We already handled an Hello message for this connection. */ - dbus_set_error (error, DBUS_ERROR_FAILED, - "Already handled an Hello message"); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - /* Note that when these limits are exceeded we don't disconnect the -@@ -464,16 +464,16 @@ bus_driver_handle_hello (DBusConnection *connection, - bus_context_log (context, DBUS_SYSTEM_LOG_WARNING, "%s (%s=%d)", - tmp_error.message, limit_name, limit); - dbus_move_error (&tmp_error, error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - if (!_dbus_string_init (&unique_name)) - { - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - -- retval = FALSE; -+ retval = BUS_RESULT_FALSE; - - registry = bus_connection_get_registry (connection); - -@@ -506,7 +506,7 @@ bus_driver_handle_hello (DBusConnection *connection, - goto out_0; - - _dbus_assert (bus_connection_is_active (connection)); -- retval = TRUE; -+ retval = BUS_RESULT_TRUE; - - out_0: - _dbus_string_free (&unique_name); -@@ -558,7 +558,7 @@ bus_driver_send_welcome_message (DBusConnection *connection, - } - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_list_services (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -580,14 +580,14 @@ bus_driver_handle_list_services (DBusConnection *connection, - if (reply == NULL) - { - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - if (!bus_registry_list_services (registry, &services, &len)) - { - dbus_message_unref (reply); - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - dbus_message_iter_init_append (reply, &iter); -@@ -599,7 +599,7 @@ bus_driver_handle_list_services (DBusConnection *connection, - dbus_free_string_array (services); - dbus_message_unref (reply); - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - { -@@ -611,7 +611,7 @@ bus_driver_handle_list_services (DBusConnection *connection, - dbus_free_string_array (services); - dbus_message_unref (reply); - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - } - -@@ -624,7 +624,7 @@ bus_driver_handle_list_services (DBusConnection *connection, - dbus_free_string_array (services); - dbus_message_unref (reply); - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - ++i; - } -@@ -635,23 +635,23 @@ bus_driver_handle_list_services (DBusConnection *connection, - { - dbus_message_unref (reply); - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - if (!bus_transaction_send_from_driver (transaction, connection, reply)) - { - dbus_message_unref (reply); - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - else - { - dbus_message_unref (reply); -- return TRUE; -+ return BUS_RESULT_TRUE; - } - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_list_activatable_services (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -673,14 +673,14 @@ bus_driver_handle_list_activatable_services (DBusConnection *connection, - if (reply == NULL) - { - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - if (!bus_activation_list_services (activation, &services, &len)) - { - dbus_message_unref (reply); - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - dbus_message_iter_init_append (reply, &iter); -@@ -692,7 +692,7 @@ bus_driver_handle_list_activatable_services (DBusConnection *connection, - dbus_free_string_array (services); - dbus_message_unref (reply); - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - { -@@ -704,7 +704,7 @@ bus_driver_handle_list_activatable_services (DBusConnection *connection, - dbus_free_string_array (services); - dbus_message_unref (reply); - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - } - -@@ -717,7 +717,7 @@ bus_driver_handle_list_activatable_services (DBusConnection *connection, - dbus_free_string_array (services); - dbus_message_unref (reply); - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - ++i; - } -@@ -728,23 +728,23 @@ bus_driver_handle_list_activatable_services (DBusConnection *connection, - { - dbus_message_unref (reply); - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - if (!bus_transaction_send_from_driver (transaction, connection, reply)) - { - dbus_message_unref (reply); - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - else - { - dbus_message_unref (reply); -- return TRUE; -+ return BUS_RESULT_TRUE; - } - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_acquire_service (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -755,7 +755,8 @@ bus_driver_handle_acquire_service (DBusConnection *connection, - const char *name; - dbus_uint32_t service_reply; - dbus_uint32_t flags; -- dbus_bool_t retval; -+ BusResult retval; -+ BusResult res; - BusRegistry *registry; - - _DBUS_ASSERT_ERROR_IS_CLEAR (error); -@@ -766,20 +767,24 @@ bus_driver_handle_acquire_service (DBusConnection *connection, - DBUS_TYPE_STRING, &name, - DBUS_TYPE_UINT32, &flags, - DBUS_TYPE_INVALID)) -- return FALSE; -+ return BUS_RESULT_FALSE; - - _dbus_verbose ("Trying to own name %s with flags 0x%x\n", name, flags); - -- retval = FALSE; -+ retval = BUS_RESULT_FALSE; - reply = NULL; - - _dbus_string_init_const (&service_name, name); - -- if (!bus_registry_acquire_service (registry, connection, -- &service_name, flags, -- &service_reply, transaction, -- error)) -- goto out; -+ res = bus_registry_acquire_service (registry, connection, message, -+ &service_name, flags, -+ &service_reply, transaction, -+ error); -+ if (res != BUS_RESULT_TRUE) -+ { -+ retval = res; -+ goto out; -+ } - - reply = dbus_message_new_method_return (message); - if (reply == NULL) -@@ -800,7 +805,7 @@ bus_driver_handle_acquire_service (DBusConnection *connection, - goto out; - } - -- retval = TRUE; -+ retval = BUS_RESULT_TRUE; - - out: - if (reply) -@@ -808,7 +813,7 @@ bus_driver_handle_acquire_service (DBusConnection *connection, - return retval; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_release_service (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -818,7 +823,7 @@ bus_driver_handle_release_service (DBusConnection *connection, - DBusString service_name; - const char *name; - dbus_uint32_t service_reply; -- dbus_bool_t retval; -+ BusResult retval; - BusRegistry *registry; - - _DBUS_ASSERT_ERROR_IS_CLEAR (error); -@@ -828,11 +833,11 @@ bus_driver_handle_release_service (DBusConnection *connection, - if (!dbus_message_get_args (message, error, - DBUS_TYPE_STRING, &name, - DBUS_TYPE_INVALID)) -- return FALSE; -+ return BUS_RESULT_FALSE; - - _dbus_verbose ("Trying to release name %s\n", name); - -- retval = FALSE; -+ retval = BUS_RESULT_FALSE; - reply = NULL; - - _dbus_string_init_const (&service_name, name); -@@ -861,7 +866,7 @@ bus_driver_handle_release_service (DBusConnection *connection, - goto out; - } - -- retval = TRUE; -+ retval = BUS_RESULT_TRUE; - - out: - if (reply) -@@ -869,7 +874,7 @@ bus_driver_handle_release_service (DBusConnection *connection, - return retval; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_service_exists (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -880,7 +885,7 @@ bus_driver_handle_service_exists (DBusConnection *connection, - BusService *service; - dbus_bool_t service_exists; - const char *name; -- dbus_bool_t retval; -+ BusResult retval; - BusRegistry *registry; - - _DBUS_ASSERT_ERROR_IS_CLEAR (error); -@@ -890,9 +895,9 @@ bus_driver_handle_service_exists (DBusConnection *connection, - if (!dbus_message_get_args (message, error, - DBUS_TYPE_STRING, &name, - DBUS_TYPE_INVALID)) -- return FALSE; -+ return BUS_RESULT_FALSE; - -- retval = FALSE; -+ retval = BUS_RESULT_FALSE; - - if (strcmp (name, DBUS_SERVICE_DBUS) == 0) - { -@@ -926,7 +931,7 @@ bus_driver_handle_service_exists (DBusConnection *connection, - goto out; - } - -- retval = TRUE; -+ retval = BUS_RESULT_TRUE; - - out: - if (reply) -@@ -935,7 +940,7 @@ bus_driver_handle_service_exists (DBusConnection *connection, - return retval; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_activate_service (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -943,7 +948,7 @@ bus_driver_handle_activate_service (DBusConnection *connection, - { - dbus_uint32_t flags; - const char *name; -- dbus_bool_t retval; -+ BusResult retval; - BusActivation *activation; - - _DBUS_ASSERT_ERROR_IS_CLEAR (error); -@@ -957,10 +962,10 @@ bus_driver_handle_activate_service (DBusConnection *connection, - { - _DBUS_ASSERT_ERROR_IS_SET (error); - _dbus_verbose ("No memory to get arguments to StartServiceByName\n"); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - -- retval = FALSE; -+ retval = BUS_RESULT_FALSE; - - if (!bus_activation_activate_service (activation, connection, transaction, FALSE, - message, name, error)) -@@ -970,7 +975,7 @@ bus_driver_handle_activate_service (DBusConnection *connection, - goto out; - } - -- retval = TRUE; -+ retval = BUS_RESULT_TRUE; - - out: - return retval; -@@ -1072,13 +1077,13 @@ bus_driver_send_or_activate (BusTransaction *transaction, - return TRUE; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_update_activation_environment (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, - DBusError *error) - { -- dbus_bool_t retval; -+ BusResult retval; - BusActivation *activation; - BusContext *context; - DBusMessageIter iter; -@@ -1100,7 +1105,7 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection, - dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, - "Cannot change activation environment " - "on a system bus."); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - activation = bus_connection_get_activation (connection); -@@ -1114,7 +1119,7 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection, - - dbus_message_iter_recurse (&iter, &dict_iter); - -- retval = FALSE; -+ retval = BUS_RESULT_FALSE; - systemd_message = NULL; - - /* Then loop through the sent dictionary, add the location of -@@ -1279,7 +1284,7 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection, - if (!bus_driver_send_ack_reply (connection, transaction, message, error)) - goto out; - -- retval = TRUE; -+ retval = BUS_RESULT_TRUE; - - out: - if (systemd_message != NULL) -@@ -1289,7 +1294,7 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection, - return retval; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_add_match (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -1371,16 +1376,16 @@ bus_driver_handle_add_match (DBusConnection *connection, - - bus_match_rule_unref (rule); - -- return TRUE; -+ return BUS_RESULT_TRUE; - - failed: - _DBUS_ASSERT_ERROR_IS_SET (error); - if (rule) - bus_match_rule_unref (rule); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_remove_match (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -1423,16 +1428,16 @@ bus_driver_handle_remove_match (DBusConnection *connection, - - bus_match_rule_unref (rule); - -- return TRUE; -+ return BUS_RESULT_TRUE; - - failed: - _DBUS_ASSERT_ERROR_IS_SET (error); - if (rule) - bus_match_rule_unref (rule); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_get_service_owner (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -1502,7 +1507,7 @@ bus_driver_handle_get_service_owner (DBusConnection *connection, - - dbus_message_unref (reply); - -- return TRUE; -+ return BUS_RESULT_TRUE; - - oom: - BUS_SET_OOM (error); -@@ -1511,10 +1516,10 @@ bus_driver_handle_get_service_owner (DBusConnection *connection, - _DBUS_ASSERT_ERROR_IS_SET (error); - if (reply) - dbus_message_unref (reply); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_list_queued_owners (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -1606,7 +1611,7 @@ bus_driver_handle_list_queued_owners (DBusConnection *connection, - - dbus_message_unref (reply); - -- return TRUE; -+ return BUS_RESULT_TRUE; - - oom: - BUS_SET_OOM (error); -@@ -1619,10 +1624,10 @@ bus_driver_handle_list_queued_owners (DBusConnection *connection, - if (base_names) - _dbus_list_clear (&base_names); - -- return FALSE; -+ return BUS_RESULT_FALSE; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_get_connection_unix_user (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -1679,7 +1684,7 @@ bus_driver_handle_get_connection_unix_user (DBusConnection *connection, - - dbus_message_unref (reply); - -- return TRUE; -+ return BUS_RESULT_TRUE; - - oom: - BUS_SET_OOM (error); -@@ -1688,10 +1693,10 @@ bus_driver_handle_get_connection_unix_user (DBusConnection *connection, - _DBUS_ASSERT_ERROR_IS_SET (error); - if (reply) - dbus_message_unref (reply); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_get_connection_unix_process_id (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -1748,7 +1753,7 @@ bus_driver_handle_get_connection_unix_process_id (DBusConnection *connection, - - dbus_message_unref (reply); - -- return TRUE; -+ return BUS_RESULT_TRUE; - - oom: - BUS_SET_OOM (error); -@@ -1757,10 +1762,10 @@ bus_driver_handle_get_connection_unix_process_id (DBusConnection *connection, - _DBUS_ASSERT_ERROR_IS_SET (error); - if (reply) - dbus_message_unref (reply); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_get_adt_audit_session_data (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -1811,7 +1816,7 @@ bus_driver_handle_get_adt_audit_session_data (DBusConnection *connection, - - dbus_message_unref (reply); - -- return TRUE; -+ return BUS_RESULT_TRUE; - - oom: - BUS_SET_OOM (error); -@@ -1820,10 +1825,10 @@ bus_driver_handle_get_adt_audit_session_data (DBusConnection *connection, - _DBUS_ASSERT_ERROR_IS_SET (error); - if (reply) - dbus_message_unref (reply); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_get_connection_selinux_security_context (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -1872,7 +1877,7 @@ bus_driver_handle_get_connection_selinux_security_context (DBusConnection *conne - - dbus_message_unref (reply); - -- return TRUE; -+ return BUS_RESULT_TRUE; - - oom: - BUS_SET_OOM (error); -@@ -1881,10 +1886,10 @@ bus_driver_handle_get_connection_selinux_security_context (DBusConnection *conne - _DBUS_ASSERT_ERROR_IS_SET (error); - if (reply) - dbus_message_unref (reply); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_get_connection_credentials (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -1998,7 +2003,7 @@ bus_driver_handle_get_connection_credentials (DBusConnection *connection, - - dbus_message_unref (reply); - -- return TRUE; -+ return BUS_RESULT_TRUE; - - oom: - BUS_SET_OOM (error); -@@ -2012,10 +2017,10 @@ bus_driver_handle_get_connection_credentials (DBusConnection *connection, - dbus_message_unref (reply); - } - -- return FALSE; -+ return BUS_RESULT_FALSE; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_reload_config (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -2040,7 +2045,7 @@ bus_driver_handle_reload_config (DBusConnection *connection, - goto oom; - - dbus_message_unref (reply); -- return TRUE; -+ return BUS_RESULT_TRUE; - - oom: - BUS_SET_OOM (error); -@@ -2049,11 +2054,11 @@ bus_driver_handle_reload_config (DBusConnection *connection, - _DBUS_ASSERT_ERROR_IS_SET (error); - if (reply) - dbus_message_unref (reply); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - #ifdef DBUS_ENABLE_VERBOSE_MODE --static dbus_bool_t -+static BusResult - bus_driver_handle_enable_verbose (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -2073,7 +2078,7 @@ bus_driver_handle_enable_verbose (DBusConnection *connection, - _dbus_set_verbose(TRUE); - - dbus_message_unref (reply); -- return TRUE; -+ return BUS_RESULT_TRUE; - - oom: - _DBUS_ASSERT_ERROR_IS_CLEAR (error); -@@ -2082,10 +2087,10 @@ bus_driver_handle_enable_verbose (DBusConnection *connection, - - if (reply) - dbus_message_unref (reply); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_disable_verbose (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -2105,7 +2110,7 @@ bus_driver_handle_disable_verbose (DBusConnection *connection, - _dbus_set_verbose(FALSE); - - dbus_message_unref (reply); -- return TRUE; -+ return BUS_RESULT_TRUE; - - oom: - _DBUS_ASSERT_ERROR_IS_CLEAR (error); -@@ -2114,11 +2119,11 @@ bus_driver_handle_disable_verbose (DBusConnection *connection, - - if (reply) - dbus_message_unref (reply); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - #endif - --static dbus_bool_t -+static BusResult - bus_driver_handle_get_id (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -2134,7 +2139,7 @@ bus_driver_handle_get_id (DBusConnection *connection, - if (!_dbus_string_init (&uuid)) - { - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - reply = NULL; -@@ -2160,7 +2165,7 @@ bus_driver_handle_get_id (DBusConnection *connection, - - _dbus_string_free (&uuid); - dbus_message_unref (reply); -- return TRUE; -+ return BUS_RESULT_TRUE; - - oom: - _DBUS_ASSERT_ERROR_IS_CLEAR (error); -@@ -2170,10 +2175,10 @@ bus_driver_handle_get_id (DBusConnection *connection, - if (reply) - dbus_message_unref (reply); - _dbus_string_free (&uuid); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_become_monitor (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -2189,7 +2194,7 @@ bus_driver_handle_become_monitor (DBusConnection *connection, - int i; - int n_match_rules; - dbus_uint32_t flags; -- dbus_bool_t ret = FALSE; -+ BusResult ret = BUS_RESULT_FALSE; - - _DBUS_ASSERT_ERROR_IS_CLEAR (error); - -@@ -2262,10 +2267,10 @@ bus_driver_handle_become_monitor (DBusConnection *connection, - if (!bus_connection_be_monitor (connection, transaction, &rules, error)) - goto out; - -- ret = TRUE; -+ ret = BUS_RESULT_TRUE; - - out: -- if (ret) -+ if (ret == BUS_RESULT_TRUE) - _DBUS_ASSERT_ERROR_IS_CLEAR (error); - else - _DBUS_ASSERT_ERROR_IS_SET (error); -@@ -2281,7 +2286,7 @@ out: - return ret; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_get_machine_id (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -2296,7 +2301,7 @@ bus_driver_handle_get_machine_id (DBusConnection *connection, - if (!_dbus_string_init (&uuid)) - { - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - if (!_dbus_get_local_machine_uuid_encoded (&uuid, error)) -@@ -2321,7 +2326,7 @@ bus_driver_handle_get_machine_id (DBusConnection *connection, - - _dbus_string_free (&uuid); - dbus_message_unref (reply); -- return TRUE; -+ return BUS_RESULT_TRUE; - - oom: - _DBUS_ASSERT_ERROR_IS_CLEAR (error); -@@ -2335,29 +2340,30 @@ fail: - dbus_message_unref (reply); - - _dbus_string_free (&uuid); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_ping (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, - DBusError *error) - { -- return bus_driver_send_ack_reply (connection, transaction, message, error); -+ return bus_driver_send_ack_reply (connection, transaction, message, error) == TRUE -+ ? BUS_RESULT_TRUE : BUS_RESULT_FALSE; - } - --static dbus_bool_t bus_driver_handle_get (DBusConnection *connection, -+static BusResult bus_driver_handle_get (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, - DBusError *error); - --static dbus_bool_t bus_driver_handle_get_all (DBusConnection *connection, -+static BusResult bus_driver_handle_get_all (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, - DBusError *error); - --static dbus_bool_t bus_driver_handle_set (DBusConnection *connection, -+static BusResult bus_driver_handle_set (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, - DBusError *error); -@@ -2389,10 +2395,10 @@ typedef struct - const char *name; - const char *in_args; - const char *out_args; -- dbus_bool_t (* handler) (DBusConnection *connection, -- BusTransaction *transaction, -- DBusMessage *message, -- DBusError *error); -+ BusResult (* handler) (DBusConnection *connection, -+ BusTransaction *transaction, -+ DBusMessage *message, -+ DBusError *error); - MethodFlags flags; - } MessageHandler; - -@@ -2511,7 +2517,7 @@ static const PropertyHandler dbus_property_handlers[] = { - { NULL, NULL, NULL } - }; - --static dbus_bool_t bus_driver_handle_introspect (DBusConnection *, -+static BusResult bus_driver_handle_introspect (DBusConnection *, - BusTransaction *, DBusMessage *, DBusError *); - - static const MessageHandler properties_message_handlers[] = { -@@ -2763,7 +2769,7 @@ bus_driver_generate_introspect_string (DBusString *xml, - return TRUE; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_introspect (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -2784,13 +2790,13 @@ bus_driver_handle_introspect (DBusConnection *connection, - DBUS_TYPE_INVALID)) - { - _DBUS_ASSERT_ERROR_IS_SET (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - if (!_dbus_string_init (&xml)) - { - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - is_canonical_path = dbus_message_has_path (message, DBUS_PATH_DBUS); -@@ -2815,7 +2821,7 @@ bus_driver_handle_introspect (DBusConnection *connection, - dbus_message_unref (reply); - _dbus_string_free (&xml); - -- return TRUE; -+ return BUS_RESULT_TRUE; - - oom: - BUS_SET_OOM (error); -@@ -2825,10 +2831,42 @@ bus_driver_handle_introspect (DBusConnection *connection, - - _dbus_string_free (&xml); - -- return FALSE; -+ return BUS_RESULT_FALSE; - } - -+/* -+ * Set @error and return FALSE if the message is not directed to the -+ * dbus-daemon by its canonical object path. This is hardening against -+ * system services with poorly-written security policy files, which -+ * might allow sending dangerously broad equivalence classes of messages -+ * such as "anything with this assumed-to-be-safe object path". -+ * -+ * dbus-daemon is unusual in that it normally ignores the object path -+ * of incoming messages; we need to keep that behaviour for the "read" -+ * read-only method calls like GetConnectionUnixUser for backwards -+ * compatibility, but it seems safer to be more restrictive for things -+ * intended to be root-only or privileged-developers-only. -+ * -+ * It is possible that there are other system services with the same -+ * quirk as dbus-daemon. -+ */ - dbus_bool_t -+bus_driver_check_message_is_for_us (DBusMessage *message, -+ DBusError *error) -+{ -+ if (!dbus_message_has_path (message, DBUS_PATH_DBUS)) -+ { -+ dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, -+ "Method '%s' is only available at the canonical object path '%s'", -+ dbus_message_get_member (message), DBUS_PATH_DBUS); -+ -+ return FALSE; -+ } -+ -+ return TRUE; -+} -+ -+BusResult - bus_driver_handle_message (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -2839,6 +2877,7 @@ bus_driver_handle_message (DBusConnection *connection, - const MessageHandler *mh; - dbus_bool_t found_interface = FALSE; - dbus_bool_t is_canonical_path; -+ BusResult res; - - _DBUS_ASSERT_ERROR_IS_CLEAR (error); - -@@ -2854,7 +2893,7 @@ bus_driver_handle_message (DBusConnection *connection, - transaction, - message, - error)) -- return FALSE; -+ return BUS_RESULT_FALSE; - - context = bus_connection_get_context (connection); - systemd = bus_driver_get_owner_of_name (connection, -@@ -2871,7 +2910,7 @@ bus_driver_handle_message (DBusConnection *connection, - attacker ? attacker : "(unauthenticated)", - bus_connection_get_loginfo (connection)); - /* ignore it */ -- return TRUE; -+ return BUS_RESULT_TRUE; - } - - if (!bus_context_get_systemd_activation (context)) -@@ -2879,16 +2918,16 @@ bus_driver_handle_message (DBusConnection *connection, - bus_context_log (context, DBUS_SYSTEM_LOG_WARNING, - "Ignoring unexpected ActivationFailure message " - "while not using systemd activation"); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - -- return dbus_activation_systemd_failure(bus_context_get_activation(context), message); -+ return dbus_activation_systemd_failure(bus_context_get_activation(context), message) == TRUE ? BUS_RESULT_TRUE : BUS_RESULT_FALSE; - } - - if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_METHOD_CALL) - { - _dbus_verbose ("Driver got a non-method-call message, ignoring\n"); -- return TRUE; /* we just ignore this */ -+ return BUS_RESULT_TRUE; /* we just ignore this */ - } - - /* may be NULL, which means "any interface will do" */ -@@ -2953,20 +2992,27 @@ bus_driver_handle_message (DBusConnection *connection, - name, dbus_message_get_signature (message), - mh->in_args); - _DBUS_ASSERT_ERROR_IS_SET (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - -- if ((* mh->handler) (connection, transaction, message, error)) -+ res = (* mh->handler) (connection, transaction, message, error); -+ if (res == BUS_RESULT_TRUE) - { - _DBUS_ASSERT_ERROR_IS_CLEAR (error); - _dbus_verbose ("Driver handler succeeded\n"); -- return TRUE; -+ return BUS_RESULT_TRUE; - } -- else -+ else if (res == BUS_RESULT_FALSE) - { - _DBUS_ASSERT_ERROR_IS_SET (error); - _dbus_verbose ("Driver handler returned failure\n"); -- return FALSE; -+ return BUS_RESULT_FALSE; -+ } -+ else if (res == BUS_RESULT_LATER) -+ { -+ _DBUS_ASSERT_ERROR_IS_CLEAR (error); -+ _dbus_verbose ("Driver handler delayed message processing due to policy check\n"); -+ return BUS_RESULT_LATER; - } - } - } -@@ -2978,7 +3024,7 @@ bus_driver_handle_message (DBusConnection *connection, - "%s does not understand message %s", - DBUS_SERVICE_DBUS, name); - -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - void -@@ -3099,7 +3145,7 @@ interface_handler_find_property (const InterfaceHandler *ih, - return NULL; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_get (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -3120,18 +3166,18 @@ bus_driver_handle_get (DBusConnection *connection, - DBUS_TYPE_STRING, &iface, - DBUS_TYPE_STRING, &prop, - DBUS_TYPE_INVALID)) -- return FALSE; -+ return BUS_RESULT_FALSE; - - /* We only implement Properties on /org/freedesktop/DBus so far. */ - ih = bus_driver_find_interface (iface, TRUE, error); - - if (ih == NULL) -- return FALSE; -+ return BUS_RESULT_FALSE; - - handler = interface_handler_find_property (ih, prop, error); - - if (handler == NULL) -- return FALSE; -+ return BUS_RESULT_FALSE; - - context = bus_transaction_get_context (transaction); - -@@ -3159,17 +3205,17 @@ bus_driver_handle_get (DBusConnection *connection, - goto oom; - - dbus_message_unref (reply); -- return TRUE; -+ return BUS_RESULT_TRUE; - - oom: - if (reply != NULL) - dbus_message_unref (reply); - - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_get_all (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -3188,13 +3234,13 @@ bus_driver_handle_get_all (DBusConnection *connection, - if (!dbus_message_get_args (message, error, - DBUS_TYPE_STRING, &iface, - DBUS_TYPE_INVALID)) -- return FALSE; -+ return BUS_RESULT_FALSE; - - /* We only implement Properties on /org/freedesktop/DBus so far. */ - ih = bus_driver_find_interface (iface, TRUE, error); - - if (ih == NULL) -- return FALSE; -+ return BUS_RESULT_FALSE; - - context = bus_transaction_get_context (transaction); - -@@ -3229,7 +3275,7 @@ bus_driver_handle_get_all (DBusConnection *connection, - goto oom; - - dbus_message_unref (reply); -- return TRUE; -+ return BUS_RESULT_TRUE; - - oom_abandon_message: - _dbus_asv_abandon (&reply_iter, &array_iter); -@@ -3239,10 +3285,10 @@ oom: - dbus_message_unref (reply); - - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - --static dbus_bool_t -+static BusResult - bus_driver_handle_set (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -3271,15 +3317,15 @@ bus_driver_handle_set (DBusConnection *connection, - ih = bus_driver_find_interface (iface, TRUE, error); - - if (ih == NULL) -- return FALSE; -+ return BUS_RESULT_FALSE; - - handler = interface_handler_find_property (ih, prop, error); - - if (handler == NULL) -- return FALSE; -+ return BUS_RESULT_FALSE; - - /* We don't implement any properties that can be set yet. */ - dbus_set_error (error, DBUS_ERROR_PROPERTY_READ_ONLY, - "Property '%s.%s' cannot be set", iface, prop); -- return FALSE; -+ return BUS_RESULT_FALSE; - } -diff --git a/bus/driver.h b/bus/driver.h -index ac1289d..183c28b 100644 ---- a/bus/driver.h -+++ b/bus/driver.h -@@ -35,7 +35,7 @@ typedef enum - } BusDriverFound; - - void bus_driver_remove_connection (DBusConnection *connection); --dbus_bool_t bus_driver_handle_message (DBusConnection *connection, -+BusResult bus_driver_handle_message (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, - DBusError *error); -diff --git a/bus/policy.c b/bus/policy.c -index b1fab0d..27b66d1 100644 ---- a/bus/policy.c -+++ b/bus/policy.c -@@ -1388,18 +1388,21 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, - - - --static dbus_bool_t -+static BusResult - bus_rules_check_can_own (DBusList *rules, -- const DBusString *service_name) -+ const DBusString *service_name, -+ DBusConnection *connection, -+ DBusMessage *message) - { - DBusList *link; -- dbus_bool_t allowed; -+ BusResult result; -+ const char *privilege; - - /* rules is in the order the rules appeared - * in the config file, i.e. last rule that applies wins - */ - -- allowed = FALSE; -+ result = BUS_RESULT_FALSE; - link = _dbus_list_get_first_link (&rules); - while (link != NULL) - { -@@ -1435,17 +1438,45 @@ bus_rules_check_can_own (DBusList *rules, - } - - /* Use this rule */ -- allowed = rule->access == BUS_POLICY_RULE_ACCESS_ALLOW; -+ switch (rule->access) -+ { -+ case BUS_POLICY_RULE_ACCESS_ALLOW: -+ result = BUS_RESULT_TRUE; -+ break; -+ case BUS_POLICY_RULE_ACCESS_DENY: -+ result = BUS_RESULT_FALSE; -+ break; -+ case BUS_POLICY_RULE_ACCESS_CHECK: -+ result = BUS_RESULT_LATER; -+ privilege = rule->privilege; -+ break; -+ } - } - -- return allowed; -+ if (result == BUS_RESULT_LATER) -+ { -+ BusContext *context = bus_connection_get_context(connection); -+ BusCheck *check = bus_context_get_check(context); -+ BusDeferredMessage *deferred_message; -+ -+ result = bus_check_privilege(check, message, connection, NULL, NULL, -+ privilege, BUS_DEFERRED_MESSAGE_CHECK_OWN, &deferred_message); -+ if (result == BUS_RESULT_LATER) -+ { -+ bus_deferred_message_disable_sender(deferred_message); -+ } -+ } -+ -+ return result; - } - --dbus_bool_t -+BusResult - bus_client_policy_check_can_own (BusClientPolicy *policy, -- const DBusString *service_name) -+ const DBusString *service_name, -+ DBusConnection *connection, -+ DBusMessage *message) - { -- return bus_rules_check_can_own (policy->rules, service_name); -+ return bus_rules_check_can_own (policy->rules, service_name, connection, message); - } - - #ifdef DBUS_ENABLE_EMBEDDED_TESTS -@@ -1453,7 +1484,7 @@ dbus_bool_t - bus_policy_check_can_own (BusPolicy *policy, - const DBusString *service_name) - { -- return bus_rules_check_can_own (policy->default_rules, service_name); -+ return bus_rules_check_can_own (policy->default_rules, service_name, NULL, NULL) == BUS_RESULT_TRUE; - } - #endif /* DBUS_ENABLE_EMBEDDED_TESTS */ - -diff --git a/bus/policy.h b/bus/policy.h -index f839d23..28ce8f2 100644 ---- a/bus/policy.h -+++ b/bus/policy.h -@@ -182,8 +182,10 @@ BusResult bus_client_policy_check_can_receive (BusClientPolicy *policy, - dbus_int32_t *toggles, - const char **privilege_param, - BusDeferredMessage **deferred_message); --dbus_bool_t bus_client_policy_check_can_own (BusClientPolicy *policy, -- const DBusString *service_name); -+BusResult bus_client_policy_check_can_own (BusClientPolicy *policy, -+ const DBusString *service_name, -+ DBusConnection *connection, -+ DBusMessage *message); - dbus_bool_t bus_client_policy_append_rule (BusClientPolicy *policy, - BusPolicyRule *rule); - void bus_client_policy_optimize (BusClientPolicy *policy); -diff --git a/bus/services.c b/bus/services.c -index 127edda..586af18 100644 ---- a/bus/services.c -+++ b/bus/services.c -@@ -376,16 +376,17 @@ bus_registry_list_services (BusRegistry *registry, - return FALSE; - } - --dbus_bool_t -+BusResult - bus_registry_acquire_service (BusRegistry *registry, - DBusConnection *connection, -+ DBusMessage *message, - const DBusString *service_name, - dbus_uint32_t flags, - dbus_uint32_t *result, - BusTransaction *transaction, - DBusError *error) - { -- dbus_bool_t retval; -+ BusResult retval; - DBusConnection *old_owner_conn; - BusClientPolicy *policy; - BusService *service; -@@ -393,8 +394,9 @@ bus_registry_acquire_service (BusRegistry *registry, - BusSELinuxID *sid; - BusOwner *primary_owner; - int limit; -+ BusResult res; - -- retval = FALSE; -+ retval = BUS_RESULT_FALSE; - - if (!_dbus_validate_bus_name (service_name, 0, - _dbus_string_get_length (service_name))) -@@ -467,7 +469,8 @@ bus_registry_acquire_service (BusRegistry *registry, - _dbus_string_get_const_data (service_name), error)) - goto out; - -- if (!bus_client_policy_check_can_own (policy, service_name)) -+ res = bus_client_policy_check_can_own (policy, service_name, connection, message); -+ if (res == BUS_RESULT_FALSE) - { - dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, - "Connection \"%s\" is not allowed to own the service \"%s\" due " -@@ -478,6 +481,11 @@ bus_registry_acquire_service (BusRegistry *registry, - _dbus_string_get_const_data (service_name)); - goto out; - } -+ else if (res == BUS_RESULT_LATER) -+ { -+ retval = BUS_RESULT_LATER; -+ goto out; -+ } - - limit = bus_context_get_max_services_per_connection (registry->context); - -@@ -603,11 +611,13 @@ bus_registry_acquire_service (BusRegistry *registry, - } - - activation = bus_context_get_activation (registry->context); -- retval = bus_activation_send_pending_auto_activation_messages (activation, -+ -+ if (bus_activation_send_pending_auto_activation_messages (activation, - service, -- transaction); -- if (!retval) -- BUS_SET_OOM (error); -+ transaction)) -+ retval = BUS_RESULT_TRUE; -+ else -+ BUS_SET_OOM (error); - - out: - return retval; -diff --git a/bus/services.h b/bus/services.h -index 056dd9f..3df3dd7 100644 ---- a/bus/services.h -+++ b/bus/services.h -@@ -50,8 +50,9 @@ void bus_registry_foreach (BusRegistry *registry - dbus_bool_t bus_registry_list_services (BusRegistry *registry, - char ***listp, - int *array_len); --dbus_bool_t bus_registry_acquire_service (BusRegistry *registry, -+BusResult bus_registry_acquire_service (BusRegistry *registry, - DBusConnection *connection, -+ DBusMessage *message, - const DBusString *service_name, - dbus_uint32_t flags, - dbus_uint32_t *result, -diff --git a/bus/stats.c b/bus/stats.c -index 1582255..c25be98 100644 ---- a/bus/stats.c -+++ b/bus/stats.c -@@ -36,7 +36,7 @@ - - #ifdef DBUS_ENABLE_STATS - --dbus_bool_t -+BusResult - bus_stats_handle_get_stats (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -51,6 +51,9 @@ bus_stats_handle_get_stats (DBusConnection *connection, - - _DBUS_ASSERT_ERROR_IS_CLEAR (error); - -+ if (!bus_driver_check_message_is_for_us (message, error)) -+ return BUS_RESULT_FALSE; -+ - context = bus_transaction_get_context (transaction); - connections = bus_context_get_connections (context); - -@@ -104,17 +107,17 @@ bus_stats_handle_get_stats (DBusConnection *connection, - goto oom; - - dbus_message_unref (reply); -- return TRUE; -+ return BUS_RESULT_TRUE; - - oom: - if (reply != NULL) - dbus_message_unref (reply); - - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - --dbus_bool_t -+BusResult - bus_stats_handle_get_connection_stats (DBusConnection *caller_connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -209,7 +212,7 @@ bus_stats_handle_get_connection_stats (DBusConnection *caller_connection, - goto oom; - - dbus_message_unref (reply); -- return TRUE; -+ return BUS_RESULT_TRUE; - - oom: - BUS_SET_OOM (error); -@@ -218,11 +221,11 @@ failed: - if (reply != NULL) - dbus_message_unref (reply); - -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - --dbus_bool_t -+BusResult - bus_stats_handle_get_all_match_rules (DBusConnection *caller_connection, - BusTransaction *transaction, - DBusMessage *message, -@@ -246,7 +249,7 @@ bus_stats_handle_get_all_match_rules (DBusConnection *caller_connection, - matchmaker = bus_context_get_matchmaker (context); - - if (!bus_registry_list_services (registry, &services, &services_len)) -- return FALSE; -+ return BUS_RESULT_FALSE; - - reply = dbus_message_new_method_return (message); - if (reply == NULL) -@@ -325,7 +328,7 @@ bus_stats_handle_get_all_match_rules (DBusConnection *caller_connection, - - dbus_message_unref (reply); - dbus_free_string_array (services); -- return TRUE; -+ return BUS_RESULT_TRUE; - - oom: - if (reply != NULL) -@@ -334,7 +337,7 @@ oom: - dbus_free_string_array (services); - - BUS_SET_OOM (error); -- return FALSE; -+ return BUS_RESULT_FALSE; - } - - #endif -diff --git a/bus/stats.h b/bus/stats.h -index dcb022c..683fa17 100644 ---- a/bus/stats.h -+++ b/bus/stats.h -@@ -25,17 +25,17 @@ - - #define BUS_INTERFACE_STATS "org.freedesktop.DBus.Debug.Stats" - --dbus_bool_t bus_stats_handle_get_stats (DBusConnection *connection, -+BusResult bus_stats_handle_get_stats (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, - DBusError *error); - --dbus_bool_t bus_stats_handle_get_connection_stats (DBusConnection *connection, -+BusResult bus_stats_handle_get_connection_stats (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, - DBusError *error); - --dbus_bool_t bus_stats_handle_get_all_match_rules (DBusConnection *caller_connection, -+BusResult bus_stats_handle_get_all_match_rules (DBusConnection *caller_connection, - BusTransaction *transaction, - DBusMessage *message, - DBusError *error); --- -2.17.2 - diff --git a/meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0005-Perform-Cynara-runtime-policy-checks-by-default.patch b/meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0005-Perform-Cynara-runtime-policy-checks-by-default.patch deleted file mode 100644 index 8ce441b0..00000000 --- a/meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0005-Perform-Cynara-runtime-policy-checks-by-default.patch +++ /dev/null @@ -1,175 +0,0 @@ -From 69ba571e0daa0a7a9aa6c6b5be5d3338a89d144a Mon Sep 17 00:00:00 2001 -From: Jacek Bukarewicz -Date: Tue, 23 Jun 2015 11:08:48 +0200 -Subject: Perform Cynara runtime policy checks by default -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This change introduces http://tizen.org/privilege/internal/dbus privilege -which is supposed to be available only to trusted system resources. -Checks for this privilege are used in place of certain allow rules to -make security policy more strict. - -For system bus sending and receiving signals now requires -http://tizen.org/privilege/internal/dbus privilege. Requesting name -ownership and sending methods is still denied by default. - -For session bus http://tizen.org/privilege/internal/dbus privilege -is now required for requesting name, calling methods, sending and receiving -signals. - -Services are supposed to override these default settings to implement their -own security policy. - -Cherry picked from e8610297cf7031e94eb314a2e8c11246f4405403 by Jose Bollo - -Updated for dbus 1.10.20 by Scott Murray and José Bollo - -Signed-off-by: Jacek Bukarewicz -Signed-off-by: José Bollo -Signed-off-by: Scott Murray - -diff --git a/bus/activation.c b/bus/activation.c -index ffdc6fc..6a95b95 100644 ---- a/bus/activation.c -+++ b/bus/activation.c -@@ -1837,22 +1837,32 @@ bus_activation_activate_service (BusActivation *activation, - } - - if (auto_activation && -- entry != NULL && -- BUS_RESULT_TRUE != bus_context_check_security_policy (activation->context, -- transaction, -- connection, /* sender */ -- NULL, /* addressed recipient */ -- NULL, /* proposed recipient */ -- activation_message, -- entry, -- error, -- NULL)) -- { -- _DBUS_ASSERT_ERROR_IS_SET (error); -- _dbus_verbose ("activation not authorized: %s: %s\n", -- error != NULL ? error->name : "(error ignored)", -- error != NULL ? error->message : "(error ignored)"); -- return FALSE; -+ entry != NULL) -+ { -+ BusResult result; -+ -+ result = bus_context_check_security_policy (activation->context, -+ transaction, -+ connection, /* sender */ -+ NULL, /* addressed recipient */ -+ NULL, /* proposed recipient */ -+ activation_message, -+ entry, -+ error, -+ NULL); -+ if (result == BUS_RESULT_FALSE) -+ { -+ _DBUS_ASSERT_ERROR_IS_SET (error); -+ _dbus_verbose ("activation not authorized: %s: %s\n", -+ error != NULL ? error->name : "(error ignored)", -+ error != NULL ? error->message : "(error ignored)"); -+ return FALSE; -+ } -+ if (result == BUS_RESULT_LATER) -+ { -+ /* TODO */ -+ _dbus_verbose ("ALERT FIX ME!!!!!!!!!!!!!!!"); -+ } - } - - /* Bypass the registry lookup if we're auto-activating, bus_dispatch would not -diff --git a/bus/session.conf.in b/bus/session.conf.in -index affa7f1..157dfb4 100644 ---- a/bus/session.conf.in -+++ b/bus/session.conf.in -@@ -27,12 +27,32 @@ - - - -- -- -- -- -- -- -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - -diff --git a/bus/system.conf.in b/bus/system.conf.in -index f139b55..19d0c04 100644 ---- a/bus/system.conf.in -+++ b/bus/system.conf.in -@@ -50,17 +50,20 @@ - - - -- -+ -+ -+ -+ -- - - - -- -+ - - - -- - - - - -+ -+ -+ - - -Date: Wed, 29 May 2019 16:32:50 +0200 -Subject: Fix gcc 8 warnings -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Compiling with -Werror isn't possible without adaptation -of the code. - -Signed-off-by: José Bollo - -diff --git a/bus/config-parser-trivial.c b/bus/config-parser-trivial.c -index dd65c6d..23dedb4 100644 ---- a/bus/config-parser-trivial.c -+++ b/bus/config-parser-trivial.c -@@ -194,6 +194,7 @@ bus_config_parser_start_element (BusConfigParser *parser, - case ELEMENT_POLICY: - case ELEMENT_LIMIT: - case ELEMENT_ALLOW: -+ case ELEMENT_CHECK: - case ELEMENT_DENY: - case ELEMENT_FORK: - case ELEMENT_PIDFILE: -@@ -316,6 +317,7 @@ bus_config_parser_content (BusConfigParser *parser, - case ELEMENT_POLICY: - case ELEMENT_LIMIT: - case ELEMENT_ALLOW: -+ case ELEMENT_CHECK: - case ELEMENT_DENY: - case ELEMENT_FORK: - case ELEMENT_PIDFILE: -diff --git a/bus/config-parser.c b/bus/config-parser.c -index b5f1dd1..7f91469 100644 ---- a/bus/config-parser.c -+++ b/bus/config-parser.c -@@ -3408,6 +3408,7 @@ elements_equal (const Element *a, - case ELEMENT_LISTEN: - case ELEMENT_AUTH: - case ELEMENT_ALLOW: -+ case ELEMENT_CHECK: - case ELEMENT_DENY: - case ELEMENT_FORK: - case ELEMENT_PIDFILE: -diff --git a/bus/desktop-file.c b/bus/desktop-file.c -index 4459858..4a27ee3 100644 ---- a/bus/desktop-file.c -+++ b/bus/desktop-file.c -@@ -382,7 +382,7 @@ is_valid_section_name (const char *name) - - while (*name) - { -- if (!((*name >= 'A' && *name <= 'Z') || (*name >= 'a' || *name <= 'z') || -+ if (!((*name >= ' ' && *name <= '~' && *name != '[' && *name != ']') || - *name == '\n' || *name == '\t')) - return FALSE; - -diff --git a/bus/driver.h b/bus/driver.h -index 183c28b..05e9886 100644 ---- a/bus/driver.h -+++ b/bus/driver.h -@@ -66,5 +66,7 @@ dbus_bool_t bus_driver_send_ack_reply (DBusConnection *connection, - BusTransaction *transaction, - DBusMessage *message, - DBusError *error); -+dbus_bool_t bus_driver_check_message_is_for_us (DBusMessage *message, -+ DBusError *error); - - #endif /* BUS_DRIVER_H */ -diff --git a/bus/policy.c b/bus/policy.c -index 27b66d1..c4c3d4b 100644 ---- a/bus/policy.c -+++ b/bus/policy.c -@@ -1098,6 +1098,7 @@ bus_client_policy_check_can_send (DBusConnection *sender, - case BUS_POLICY_RULE_ACCESS_ALLOW: - result = BUS_RESULT_TRUE; - break; -+ default: - case BUS_POLICY_RULE_ACCESS_DENY: - result = BUS_RESULT_FALSE; - break; -@@ -1350,6 +1351,7 @@ bus_client_policy_check_can_receive (BusClientPolicy *policy, - case BUS_POLICY_RULE_ACCESS_ALLOW: - result = BUS_RESULT_TRUE; - break; -+ default: - case BUS_POLICY_RULE_ACCESS_DENY: - result = BUS_RESULT_FALSE; - break; -@@ -1443,6 +1445,7 @@ bus_rules_check_can_own (DBusList *rules, - case BUS_POLICY_RULE_ACCESS_ALLOW: - result = BUS_RESULT_TRUE; - break; -+ default: - case BUS_POLICY_RULE_ACCESS_DENY: - result = BUS_RESULT_FALSE; - break; -diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c -index 565e089..b96c735 100644 ---- a/dbus/dbus-sysdeps-unix.c -+++ b/dbus/dbus-sysdeps-unix.c -@@ -4364,7 +4364,11 @@ _dbus_daemon_unpublish_session_bus_address (void) - dbus_bool_t - _dbus_get_is_errno_eagain_or_ewouldblock (int e) - { -+#if EAGAIN != EWOULDBLOCK - return e == EAGAIN || e == EWOULDBLOCK; -+#else -+ return e == EAGAIN; -+#endif - } - - /** -diff --git a/tools/dbus-send.c b/tools/dbus-send.c -index 6fb65fe..d853b39 100644 ---- a/tools/dbus-send.c -+++ b/tools/dbus-send.c -@@ -293,10 +293,12 @@ main (int argc, char *argv[]) - { - is_bus = TRUE; - } -+#if 0 - else if (arg[2] == 'p') /* peer */ - { - is_bus = FALSE; - } -+#endif - else /* address; keeping backwards compatibility */ - { - is_bus = FALSE; --- -2.17.2 - diff --git a/meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0007-Fix-SIGSEGV-on-disconnections.patch b/meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0007-Fix-SIGSEGV-on-disconnections.patch deleted file mode 100644 index b5ee138e..00000000 --- a/meta-agl/meta-security/recipes-core/dbus-cynara/dbus-cynara/0007-Fix-SIGSEGV-on-disconnections.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 2a1c1c3f9264f53abc439ec44b33fdca8ffbb803 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Bollo?= -Date: Fri, 16 Aug 2019 13:29:23 +0200 -Subject: [PATCH 7/8] Fix SIGSEGV on disconnections -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Sometime, at start of the system, dbus-daemon was crashing -because a pending authorisation were reactivating a closed -connection. - -Also, clean unused function. - -Signed-off-by: José Bollo ---- - bus/check.c | 5 +++++ - bus/check.h | 1 + - bus/connection.c | 14 +++----------- - bus/connection.h | 3 --- - 4 files changed, 9 insertions(+), 14 deletions(-) - -diff --git a/bus/check.c b/bus/check.c -index f3d283f..b73d08b 100644 ---- a/bus/check.c -+++ b/bus/check.c -@@ -617,3 +617,8 @@ bus_deferred_message_response_received (BusDeferredMessage *deferred_message, - } - } - -+void -+bus_deferred_message_abort (BusDeferredMessage *deferred_message) -+{ -+ deferred_message->response_callback = NULL; -+} -diff --git a/bus/check.h b/bus/check.h -index 9c13c18..d718a69 100644 ---- a/bus/check.h -+++ b/bus/check.h -@@ -93,6 +93,7 @@ void bus_deferred_message_set_policy_check_info (BusDeferredMessa - const char *privilege); - dbus_bool_t bus_deferred_message_check_message_limits (BusDeferredMessage *deferred_message, - DBusError *error); -+void bus_deferred_message_abort (BusDeferredMessage *deferred_message); - - - #ifdef DBUS_ENABLE_EMBEDDED_TESTS -diff --git a/bus/connection.c b/bus/connection.c -index ee93384..b520d57 100644 ---- a/bus/connection.c -+++ b/bus/connection.c -@@ -47,6 +47,7 @@ - #define MAX_LOG_COMMAND_LEN 50 - - static void bus_connection_remove_transactions (DBusConnection *connection); -+static void bus_connection_clear_deferred_messages (DBusConnection *connection); - - typedef struct - { -@@ -2821,17 +2822,7 @@ bus_connection_pop_deferred_message (DBusConnection *connection) - return NULL; - } - --dbus_bool_t --bus_connection_putback_deferred_message (DBusConnection *connection, BusDeferredMessage *message) --{ -- BusConnectionData *d = BUS_CONNECTION_DATA(connection); -- if (_dbus_list_prepend(&d->deferred_messages, message)) -- { -- return TRUE; -- } -- return FALSE; --} -- -+static - void - bus_connection_clear_deferred_messages (DBusConnection *connection) - { -@@ -2846,6 +2837,7 @@ bus_connection_clear_deferred_messages (DBusConnection *connection) - next = _dbus_list_get_next_link (&d->deferred_messages, link); - message = link->data; - -+ bus_deferred_message_abort(message); - bus_deferred_message_unref(message); - _dbus_list_remove_link(&d->deferred_messages, link); - -diff --git a/bus/connection.h b/bus/connection.h -index 97dae96..6af7bf1 100644 ---- a/bus/connection.h -+++ b/bus/connection.h -@@ -90,15 +90,12 @@ dbus_bool_t bus_connection_queue_deferred_message (DBusConnection *con - BusDeferredMessage *message, - dbus_bool_t prepend); - BusDeferredMessage *bus_connection_pop_deferred_message (DBusConnection *connection); --dbus_bool_t bus_connection_putback_deferred_message (DBusConnection *connection, -- BusDeferredMessage *message); - void bus_connection_remove_deferred_message (DBusConnection *connection, - BusDeferredMessage *message); - dbus_bool_t bus_connection_replace_deferred_message (DBusConnection *connection, - BusDeferredMessage *oldMessage, - BusDeferredMessage *newMessage); - void bus_connection_dispatch_deferred (DBusConnection *connection); --void bus_connection_clear_deferred_messages (DBusConnection *connection); - - - /* called by signals.c */ --- -2.17.2 - diff --git a/meta-agl/meta-security/recipes-core/dbus-cynara/dbus_1.12.10.bbappend b/meta-agl/meta-security/recipes-core/dbus-cynara/dbus_1.12.10.bbappend deleted file mode 100644 index 5cbf65ef..00000000 --- a/meta-agl/meta-security/recipes-core/dbus-cynara/dbus_1.12.10.bbappend +++ /dev/null @@ -1,15 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/dbus-cynara:" - -SRC_URI_append_class-target = "\ - file://0001-Integration-of-Cynara-asynchronous-security-checks.patch \ - file://0002-Disable-message-dispatching-when-send-rule-result-is.patch \ - file://0003-Handle-unavailability-of-policy-results-for-broadcas.patch \ - file://0004-Add-own-rule-result-unavailability-handling.patch \ - file://0005-Perform-Cynara-runtime-policy-checks-by-default.patch \ - file://0006-Fix-gcc-8-warnings.patch \ - file://0007-Fix-SIGSEGV-on-disconnections.patch \ -" - -DEPENDS_append_class-target = " cynara smack" -EXTRA_OECONF_append_class-target = " ${@bb.utils.contains('DISTRO_FEATURES','smack','--enable-cynara --disable-selinux','',d)}" - diff --git a/meta-agl/meta-security/recipes-core/systemd/systemd_2%.bbappend b/meta-agl/meta-security/recipes-core/systemd/systemd_2%.bbappend new file mode 100644 index 00000000..789c05f8 --- /dev/null +++ b/meta-agl/meta-security/recipes-core/systemd/systemd_2%.bbappend @@ -0,0 +1,40 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +# Ensures systemd runs with label "System" +EXTRA_OEMESON_append_with-lsm-smack = " -Dsmack-run-label=System" + +################################################################################## +# Maintaining trivial, non-upstreamable configuration changes as patches +# is tedious. But in same cases (like early mounting of special directories) +# the configuration has to be in code. We make these changes here directly. +################################################################################## +do_patch[prefuncs] += "patch_systemd" +do_patch[vardeps] += "patch_systemd" +patch_systemd() { + # Handling of /run and /sys/fs/cgroup. Make /run a transmuting directory to + # enable systemd communications with services in the User domain. + # Original patch by Michael Demeter . + # + # We simplify the patching by touching only lines which check the result of + # mac_smack_use(). Those are the ones which are used when Smack is active. + # + # smackfsroot=* on /sys/fs/cgroup may be upstreamable, but smackfstransmute=System::Run + # is too distro specific (depends on Smack rules) and thus has to remain here. + sed -i -e 's;\("/sys/fs/cgroup", *"[^"]*", *"[^"]*\)\(.*mac_smack_use.*\);\1,smackfsroot=*\2;' \ + -e 's;\("/run", *"[^"]*", *"[^"]*\)\(.*mac_smack_use.*\);\1,smackfstransmute=System::Run\2;' \ + ${S}/src/core/mount-setup.c +} + +################################################################################## +# What follows is temporary. +# This is a solution to the Bug-AGL SPEC-539 +# (see https://jira.automotivelinux.org/browse/SPEC-539). +# +# It renames the file "touchscreen.rules" to "55-touchscreen.rules" +# This comes with the recipe systemd_230/234 of poky (meta/recipes-core/systemd) +# It should be removed when poky changes. +################################################################################## +do_install_prepend() { + mv ${WORKDIR}/touchscreen.rules ${WORKDIR}/55-touchscreen.rules || true +} + diff --git a/meta-agl/meta-security/recipes-core/systemd/systemd_239.bbappend b/meta-agl/meta-security/recipes-core/systemd/systemd_239.bbappend deleted file mode 100644 index 789c05f8..00000000 --- a/meta-agl/meta-security/recipes-core/systemd/systemd_239.bbappend +++ /dev/null @@ -1,40 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -# Ensures systemd runs with label "System" -EXTRA_OEMESON_append_with-lsm-smack = " -Dsmack-run-label=System" - -################################################################################## -# Maintaining trivial, non-upstreamable configuration changes as patches -# is tedious. But in same cases (like early mounting of special directories) -# the configuration has to be in code. We make these changes here directly. -################################################################################## -do_patch[prefuncs] += "patch_systemd" -do_patch[vardeps] += "patch_systemd" -patch_systemd() { - # Handling of /run and /sys/fs/cgroup. Make /run a transmuting directory to - # enable systemd communications with services in the User domain. - # Original patch by Michael Demeter . - # - # We simplify the patching by touching only lines which check the result of - # mac_smack_use(). Those are the ones which are used when Smack is active. - # - # smackfsroot=* on /sys/fs/cgroup may be upstreamable, but smackfstransmute=System::Run - # is too distro specific (depends on Smack rules) and thus has to remain here. - sed -i -e 's;\("/sys/fs/cgroup", *"[^"]*", *"[^"]*\)\(.*mac_smack_use.*\);\1,smackfsroot=*\2;' \ - -e 's;\("/run", *"[^"]*", *"[^"]*\)\(.*mac_smack_use.*\);\1,smackfstransmute=System::Run\2;' \ - ${S}/src/core/mount-setup.c -} - -################################################################################## -# What follows is temporary. -# This is a solution to the Bug-AGL SPEC-539 -# (see https://jira.automotivelinux.org/browse/SPEC-539). -# -# It renames the file "touchscreen.rules" to "55-touchscreen.rules" -# This comes with the recipe systemd_230/234 of poky (meta/recipes-core/systemd) -# It should be removed when poky changes. -################################################################################## -do_install_prepend() { - mv ${WORKDIR}/touchscreen.rules ${WORKDIR}/55-touchscreen.rules || true -} - diff --git a/meta-agl/meta-security/recipes-security/audit/audit/0001-lib-i386_table.h-add-new-syscall.patch b/meta-agl/meta-security/recipes-security/audit/audit/0001-lib-i386_table.h-add-new-syscall.patch new file mode 100644 index 00000000..6e1827c0 --- /dev/null +++ b/meta-agl/meta-security/recipes-security/audit/audit/0001-lib-i386_table.h-add-new-syscall.patch @@ -0,0 +1,42 @@ +From df878b92e01f4d1c3de7f7d8229cea6a431509eb Mon Sep 17 00:00:00 2001 +From: Mingli Yu +Date: Wed, 19 Feb 2020 15:23:40 +0800 +Subject: [PATCH] lib/i386_table.h: add new syscall + +On 32bit system, +After upgrade glibc to 2.31 + # strace -o /tmp/test.log date -s 09:16:45 + # tail -f /tmp/test.log + close(3) = 0 + stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=114, ...}) = 0 + clock_settime64(CLOCK_REALTIME, {tv_sec=1582103805, tv_nsec=0}) = 0 + fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(0x4, 0x40), ...}) = 0 + ioctl(1, TCGETS, {B115200 opost isig icanon echo ...}) = 0 + write(1, "Wed Feb 19 09:16:45 UTC 2020\n", 29) = 29 + close(1) = 0 + close(2) = 0 + exit_group(0) = ? + +++ exited with 0 +++ + +It means the clock_settime64 syscall is used, so +add the syscall. + +Upstream-Status: Submitted [https://github.com/linux-audit/audit-userspace/pull/116] + +Signed-off-by: Mingli Yu +--- + lib/i386_table.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/i386_table.h b/lib/i386_table.h +index 1a64c88..65fd4d9 100644 +--- a/lib/i386_table.h ++++ b/lib/i386_table.h +@@ -405,3 +405,4 @@ _S(383, "statx") + _S(384, "arch_prctl") + _S(385, "io_pgetevents") + _S(386, "rseq") ++_S(404, "clock_settime64") +-- +2.7.4 + diff --git a/meta-agl/meta-security/recipes-security/audit/audit/Add-substitue-functions-for-strndupa-rawmemchr.patch b/meta-agl/meta-security/recipes-security/audit/audit/Add-substitue-functions-for-strndupa-rawmemchr.patch new file mode 100644 index 00000000..bb6c61e8 --- /dev/null +++ b/meta-agl/meta-security/recipes-security/audit/audit/Add-substitue-functions-for-strndupa-rawmemchr.patch @@ -0,0 +1,133 @@ +From bdcdc3dff4469aac88e718bd15958d5ed4b9392a Mon Sep 17 00:00:00 2001 +From: Steve Grubb +Date: Tue, 26 Feb 2019 18:33:33 -0500 +Subject: [PATCH] Add substitue functions for strndupa & rawmemchr + +Upstream-Status: Backport +[https://github.com/linux-audit/audit-userspace/commit/d579a08bb1cde71f939c13ac6b2261052ae9f77e] +--- + auparse/auparse.c | 12 +++++++++++- + auparse/interpret.c | 9 ++++++++- + configure.ac | 14 +++++++++++++- + src/ausearch-lol.c | 12 +++++++++++- + 4 files changed, 43 insertions(+), 4 deletions(-) + +diff --git a/auparse/auparse.c b/auparse/auparse.c +index 650db02..2e1c737 100644 +--- a/auparse/auparse.c ++++ b/auparse/auparse.c +@@ -1,5 +1,5 @@ + /* auparse.c -- +- * Copyright 2006-08,2012-17 Red Hat Inc., Durham, North Carolina. ++ * Copyright 2006-08,2012-19 Red Hat Inc., Durham, North Carolina. + * All Rights Reserved. + * + * This library is free software; you can redistribute it and/or +@@ -1118,6 +1118,16 @@ static int str2event(char *s, au_event_t *e) + return 0; + } + ++#ifndef HAVE_STRNDUPA ++static inline char *strndupa(const char *old, size_t n) ++{ ++ size_t len = strnlen(old, n); ++ char *tmp = alloca(len + 1); ++ tmp[len] = 0; ++ return memcpy(tmp, old, len); ++} ++#endif ++ + /* Returns 0 on success and 1 on error */ + static int extract_timestamp(const char *b, au_event_t *e) + { +diff --git a/auparse/interpret.c b/auparse/interpret.c +index 51c4a5e..67b7b77 100644 +--- a/auparse/interpret.c ++++ b/auparse/interpret.c +@@ -853,6 +853,13 @@ err_out: + return print_escaped(id->val); + } + ++// rawmemchr is faster. Let's use it if we have it. ++#ifdef HAVE_RAWMEMCHR ++#define STRCHR rawmemchr ++#else ++#define STRCHR strchr ++#endif ++ + static const char *print_proctitle(const char *val) + { + char *out = (char *)print_escaped(val); +@@ -863,7 +870,7 @@ static const char *print_proctitle(const char *val) + // Proctitle has arguments separated by NUL bytes + // We need to write over the NUL bytes with a space + // so that we can see the arguments +- while ((ptr = rawmemchr(ptr, '\0'))) { ++ while ((ptr = STRCHR(ptr, '\0'))) { + if (ptr >= end) + break; + *ptr = ' '; +diff --git a/configure.ac b/configure.ac +index 54bdbf1..aef07fb 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1,7 +1,7 @@ + dnl + define([AC_INIT_NOTICE], + [### Generated automatically using autoconf version] AC_ACVERSION [ +-### Copyright 2005-18 Steve Grubb ++### Copyright 2005-19 Steve Grubb + ### + ### Permission is hereby granted, free of charge, to any person obtaining a + ### copy of this software and associated documentation files (the "Software"), +@@ -72,6 +72,18 @@ dnl; posix_fallocate is used in audisp-remote + AC_CHECK_FUNCS([posix_fallocate]) + dnl; signalfd is needed for libev + AC_CHECK_FUNC([signalfd], [], [ AC_MSG_ERROR([The signalfd system call is necessary for auditd]) ]) ++dnl; check if rawmemchr is available ++AC_CHECK_FUNCS([rawmemchr]) ++dnl; check if strndupa is available ++AC_LINK_IFELSE( ++ [AC_LANG_SOURCE( ++ [[ ++ #define _GNU_SOURCE ++ #include ++ int main() { (void) strndupa("test", 10); return 0; }]])], ++ [AC_DEFINE(HAVE_STRNDUPA, 1, [Let us know if we have it or not])], ++ [] ++) + + ALLWARNS="" + ALLDEBUG="-g" +diff --git a/src/ausearch-lol.c b/src/ausearch-lol.c +index 5d17a72..758c33e 100644 +--- a/src/ausearch-lol.c ++++ b/src/ausearch-lol.c +@@ -1,6 +1,6 @@ + /* + * ausearch-lol.c - linked list of linked lists library +-* Copyright (c) 2008,2010,2014,2016 Red Hat Inc., Durham, North Carolina. ++* Copyright (c) 2008,2010,2014,2016,2019 Red Hat Inc., Durham, North Carolina. + * All Rights Reserved. + * + * This software may be freely redistributed and/or modified under the +@@ -152,6 +152,16 @@ static int compare_event_time(event *e1, event *e2) + return 0; + } + ++#ifndef HAVE_STRNDUPA ++static inline char *strndupa(const char *old, size_t n) ++{ ++ size_t len = strnlen(old, n); ++ char *tmp = alloca(len + 1); ++ tmp[len] = 0; ++ return memcpy(tmp, old, len); ++} ++#endif ++ + /* + * This function will look at the line and pick out pieces of it. + */ +-- +2.7.4 + diff --git a/meta-agl/meta-security/recipes-security/audit/audit/Fixed-swig-host-contamination-issue.patch b/meta-agl/meta-security/recipes-security/audit/audit/Fixed-swig-host-contamination-issue.patch new file mode 100644 index 00000000..7c269954 --- /dev/null +++ b/meta-agl/meta-security/recipes-security/audit/audit/Fixed-swig-host-contamination-issue.patch @@ -0,0 +1,57 @@ +From a07271f1cce82122610b622bcea4a8a37528f321 Mon Sep 17 00:00:00 2001 +From: Li xin +Date: Sun, 19 Jul 2015 02:42:58 +0900 +Subject: [PATCH] audit: Fixed swig host contamination issue + +The audit build uses swig to generate a python wrapper. +Unfortunately, the swig info file references host include +directories. Some of these were previously noticed and +eliminated, but the one fixed here was not. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Anders Hedlund +Signed-off-by: Joe Slater +Signed-off-by: Yi Zhao +--- + bindings/swig/python3/Makefile.am | 3 ++- + bindings/swig/src/auditswig.i | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/bindings/swig/python3/Makefile.am b/bindings/swig/python3/Makefile.am +index 9938418..fa46aac 100644 +--- a/bindings/swig/python3/Makefile.am ++++ b/bindings/swig/python3/Makefile.am +@@ -22,6 +22,7 @@ + CONFIG_CLEAN_FILES = *.loT *.rej *.orig + AM_CFLAGS = -fPIC -DPIC -fno-strict-aliasing $(PYTHON3_CFLAGS) + AM_CPPFLAGS = -I. -I$(top_builddir) -I${top_srcdir}/lib $(PYTHON3_INCLUDES) ++STDINC ?= /usr/include + LIBS = $(top_builddir)/lib/libaudit.la + SWIG_FLAGS = -python -py3 -modern + SWIG_INCLUDES = -I. -I$(top_builddir) -I${top_srcdir}/lib $(PYTHON3_INCLUDES) +@@ -37,7 +38,7 @@ _audit_la_DEPENDENCIES =${top_srcdir}/lib/libaudit.h ${top_builddir}/lib/libaudi + _audit_la_LIBADD = ${top_builddir}/lib/libaudit.la + nodist__audit_la_SOURCES = audit_wrap.c + audit.py audit_wrap.c: ${srcdir}/../src/auditswig.i +- swig -o audit_wrap.c ${SWIG_FLAGS} ${SWIG_INCLUDES} ${srcdir}/../src/auditswig.i ++ swig -o audit_wrap.c ${SWIG_FLAGS} ${SWIG_INCLUDES} -I$(STDINC) ${srcdir}/../src/auditswig.i + + CLEANFILES = audit.py* audit_wrap.c *~ + +diff --git a/bindings/swig/src/auditswig.i b/bindings/swig/src/auditswig.i +index 7ebb373..424fb68 100644 +--- a/bindings/swig/src/auditswig.i ++++ b/bindings/swig/src/auditswig.i +@@ -39,7 +39,7 @@ signed + #define __attribute(X) /*nothing*/ + typedef unsigned __u32; + typedef unsigned uid_t; +-%include "/usr/include/linux/audit.h" ++%include "linux/audit.h" + #define __extension__ /*nothing*/ + #include + %include "../lib/libaudit.h" +-- +2.7.4 + diff --git a/meta-agl/meta-security/recipes-security/audit/audit/add-system-call-table-for-ARM.patch b/meta-agl/meta-security/recipes-security/audit/audit/add-system-call-table-for-ARM.patch deleted file mode 100644 index ad94d11b..00000000 --- a/meta-agl/meta-security/recipes-security/audit/audit/add-system-call-table-for-ARM.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 52ff74be2f01182ed9d4fcc3da059512fad63d72 Mon Sep 17 00:00:00 2001 -From: Han Chao -Date: Thu, 27 Feb 2014 14:58:57 +0800 -Subject: [PATCH] add system call table for ARM. - -This change enable audit system call on ARM. -Add arm System call table on machinetabs.h. -Audit system call need enable kernel config CONFIG_AUDITSYSCALL. - -Signed-off-by: Han Chao ---- - lib/machinetabs.h | 11 ++++++----- - 1 file changed, 6 insertions(+), 5 deletions(-) - -diff --git a/lib/machinetabs.h b/lib/machinetabs.h -index ec2d033..1c2e284 100644 ---- a/lib/machinetabs.h -+++ b/lib/machinetabs.h -@@ -1,10 +1,11 @@ --/* This is a generated file, see Makefile.am for its inputs. */ --static const char machine_strings[] = "i386\0i486\0i586\0i686\0ia64\0ppc\0ppc64\0s390\0s390x\0x86_64"; -+/* Such is aways generated file, see Makefile.am for its inputs. -+ * But this version is not generated file, which is for ARM. */ -+static const char machine_strings[] = "armeb\0armv5tejl\0armv5tel\0armv6l\0armv7l"; - static const unsigned machine_s2i_s[] = { -- 0,5,10,15,20,25,29,35,40,46, -+ 0,6,16,25,32, - }; - static const int machine_s2i_i[] = { -- 0,0,0,0,2,4,3,6,5,1, -+ 8,8,8,8,8, - }; - static int machine_s2i(const char *s, int *value) { - size_t len, i; -@@ -19,7 +20,7 @@ static int machine_s2i(const char *s, int *value) { - } - } - static const unsigned machine_i2s_direct[] = { -- 0,46,20,29,25,40,35, -+ 39,85,59,68,64, - }; - static const char *machine_i2s(int v) { - return i2s_direct__(machine_strings, machine_i2s_direct, 0, 6, v); --- -1.7.9.5 - diff --git a/meta-agl/meta-security/recipes-security/audit/audit/audit-for-cross-compiling.patch b/meta-agl/meta-security/recipes-security/audit/audit/audit-for-cross-compiling.patch deleted file mode 100644 index 60a23a8a..00000000 --- a/meta-agl/meta-security/recipes-security/audit/audit/audit-for-cross-compiling.patch +++ /dev/null @@ -1,2938 +0,0 @@ -From f73f654734c5f0d1a6568c6c8fba232b01f919f4 Mon Sep 17 00:00:00 2001 -From: Joe MacDonald -Date: Wed, 23 Oct 2013 16:02:34 -0400 -Subject: [PATCH] audit: use generated headers for cross compiling - -In the same vein as the patch for audit 2.2.1 (commit: 6c77455b), we generate -the headers which are inherently architecture specific but portable on a -convenient platform and use them for all platforms. - -Upstream-Status: Inappropriate [cross-compile specific] - -Signed-off-by: Joe MacDonald ---- - auparse/Makefile.am | 200 --------------------------------------------- - auparse/accesstabs.h | 6 ++ - auparse/captabs.h | 14 ++++ - auparse/clocktabs.h | 8 ++ - auparse/clone-flagtabs.h | 10 +++ - auparse/epoll_ctls.h | 8 ++ - auparse/famtabs.h | 14 ++++ - auparse/fcntl-cmdtabs.h | 17 ++++ - auparse/flagtabs.h | 6 ++ - auparse/icmptypetabs.h | 10 +++ - auparse/ip6optnametabs.h | 20 +++++ - auparse/ipccmdtabs.h | 6 ++ - auparse/ipctabs.h | 11 +++ - auparse/ipoptnametabs.h | 17 ++++ - auparse/mmaptabs.h | 8 ++ - auparse/mounttabs.h | 10 +++ - auparse/nfprototabs.h | 9 ++ - auparse/open-flagtabs.h | 8 ++ - auparse/persontabs.h | 17 ++++ - auparse/pktoptnametabs.h | 10 +++ - auparse/prctl_opttabs.h | 14 ++++ - auparse/prottabs.h | 6 ++ - auparse/ptracetabs.h | 17 ++++ - auparse/recvtabs.h | 8 ++ - auparse/rlimittabs.h | 10 +++ - auparse/schedtabs.h | 8 ++ - auparse/seccomptabs.h | 11 +++ - auparse/seektabs.h | 8 ++ - auparse/shm_modetabs.h | 6 ++ - auparse/signaltabs.h | 14 ++++ - auparse/sockleveltabs.h | 12 +++ - auparse/sockoptnametabs.h | 23 ++++++ - auparse/socktabs.h | 10 +++ - auparse/socktypetabs.h | 8 ++ - auparse/tcpoptnametabs.h | 12 +++ - auparse/typetabs.h | 35 ++++++++ - auparse/umounttabs.h | 6 ++ - lib/Makefile.am | 106 ------------------------ - lib/aarch64_tables.h | 125 ++++++++++++++++++++++++++++ - lib/actiontabs.h | 26 ++++++ - lib/alpha_tables.h | 196 ++++++++++++++++++++++++++++++++++++++++++++ - lib/armeb_tables.h | 165 +++++++++++++++++++++++++++++++++++++ - lib/errtabs.h | 78 ++++++++++++++++++ - lib/fieldtabs.h | 49 +++++++++++ - lib/flagtabs.h | 26 ++++++ - lib/ftypetabs.h | 29 +++++++ - lib/i386_tables.h | 163 ++++++++++++++++++++++++++++++++++++ - lib/ia64_tables.h | 147 +++++++++++++++++++++++++++++++++ - lib/machinetabs.h | 26 ++++++ - lib/msg_typetabs.h | 104 +++++++++++++++++++++++ - lib/optabs.h | 11 +++ - lib/ppc_tables.h | 163 ++++++++++++++++++++++++++++++++++++ - lib/s390_tables.h | 153 ++++++++++++++++++++++++++++++++++ - lib/s390x_tables.h | 144 ++++++++++++++++++++++++++++++++ - lib/x86_64_tables.h | 150 ++++++++++++++++++++++++++++++++++ - 55 files changed, 2172 insertions(+), 306 deletions(-) - create mode 100644 auparse/accesstabs.h - create mode 100644 auparse/captabs.h - create mode 100644 auparse/clocktabs.h - create mode 100644 auparse/clone-flagtabs.h - create mode 100644 auparse/epoll_ctls.h - create mode 100644 auparse/famtabs.h - create mode 100644 auparse/fcntl-cmdtabs.h - create mode 100644 auparse/flagtabs.h - create mode 100644 auparse/icmptypetabs.h - create mode 100644 auparse/ip6optnametabs.h - create mode 100644 auparse/ipccmdtabs.h - create mode 100644 auparse/ipctabs.h - create mode 100644 auparse/ipoptnametabs.h - create mode 100644 auparse/mmaptabs.h - create mode 100644 auparse/mounttabs.h - create mode 100644 auparse/nfprototabs.h - create mode 100644 auparse/open-flagtabs.h - create mode 100644 auparse/persontabs.h - create mode 100644 auparse/pktoptnametabs.h - create mode 100644 auparse/prctl_opttabs.h - create mode 100644 auparse/prottabs.h - create mode 100644 auparse/ptracetabs.h - create mode 100644 auparse/recvtabs.h - create mode 100644 auparse/rlimittabs.h - create mode 100644 auparse/schedtabs.h - create mode 100644 auparse/seccomptabs.h - create mode 100644 auparse/seektabs.h - create mode 100644 auparse/shm_modetabs.h - create mode 100644 auparse/signaltabs.h - create mode 100644 auparse/sockleveltabs.h - create mode 100644 auparse/sockoptnametabs.h - create mode 100644 auparse/socktabs.h - create mode 100644 auparse/socktypetabs.h - create mode 100644 auparse/tcpoptnametabs.h - create mode 100644 auparse/typetabs.h - create mode 100644 auparse/umounttabs.h - create mode 100644 lib/aarch64_tables.h - create mode 100644 lib/actiontabs.h - create mode 100644 lib/alpha_tables.h - create mode 100644 lib/armeb_tables.h - create mode 100644 lib/errtabs.h - create mode 100644 lib/fieldtabs.h - create mode 100644 lib/flagtabs.h - create mode 100644 lib/ftypetabs.h - create mode 100644 lib/i386_tables.h - create mode 100644 lib/ia64_tables.h - create mode 100644 lib/machinetabs.h - create mode 100644 lib/msg_typetabs.h - create mode 100644 lib/optabs.h - create mode 100644 lib/ppc_tables.h - create mode 100644 lib/s390_tables.h - create mode 100644 lib/s390x_tables.h - create mode 100644 lib/x86_64_tables.h - -diff --git a/auparse/Makefile.am b/auparse/Makefile.am -index f0ca18f..7d1527c 100644 ---- a/auparse/Makefile.am -+++ b/auparse/Makefile.am -@@ -53,203 +53,3 @@ BUILT_SOURCES = accesstabs.h captabs.h clocktabs.h clone-flagtabs.h \ - seektabs.h shm_modetabs.h signaltabs.h sockoptnametabs.h \ - socktabs.h sockleveltabs.h socktypetabs.h \ - tcpoptnametabs.h typetabs.h umounttabs.h --noinst_PROGRAMS = gen_accesstabs_h gen_captabs_h gen_clock_h \ -- gen_clone-flagtabs_h \ -- gen_epoll_ctls_h gen_famtabs_h \ -- gen_fcntl-cmdtabs_h gen_flagtabs_h \ -- gen_icmptypetabs_h gen_ipctabs_h gen_ipccmdtabs_h\ -- gen_ipoptnametabs_h gen_ip6optnametabs_h gen_nfprototabs_h \ -- gen_mmaptabs_h gen_mounttabs_h \ -- gen_open-flagtabs_h gen_persontabs_h \ -- gen_prctl_opttabs_h gen_pktoptnametabs_h gen_prottabs_h \ -- gen_recvtabs_h gen_rlimit_h gen_ptracetabs_h \ -- gen_schedtabs_h gen_seccomptabs_h \ -- gen_seektabs_h gen_shm_modetabs_h gen_signals_h \ -- gen_sockoptnametabs_h gen_socktabs_h gen_sockleveltabs_h \ -- gen_socktypetabs_h gen_tcpoptnametabs_h gen_typetabs_h \ -- gen_umounttabs_h -- --gen_accesstabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h accesstab.h --gen_accesstabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="accesstab.h"' --accesstabs.h: gen_accesstabs_h Makefile -- ./gen_accesstabs_h --i2s-transtab access > $@ -- --gen_captabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h captab.h --gen_captabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="captab.h"' --captabs.h: gen_captabs_h Makefile -- ./gen_captabs_h --i2s cap > $@ -- --gen_clock_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h clocktab.h --gen_clock_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="clocktab.h"' --clocktabs.h: gen_clock_h Makefile -- ./gen_clock_h --i2s clock > $@ -- --gen_clone_flagtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h \ -- clone-flagtab.h --gen_clone_flagtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="clone-flagtab.h"' --clone-flagtabs.h: gen_clone-flagtabs_h Makefile -- ./gen_clone-flagtabs_h --i2s-transtab clone_flag > $@ -- --gen_epoll_ctls_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h epoll_ctl.h --gen_epoll_ctls_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="epoll_ctl.h"' --epoll_ctls.h: gen_epoll_ctls_h Makefile -- ./gen_epoll_ctls_h --i2s epoll_ctl > $@ -- --gen_famtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h famtab.h --gen_famtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="famtab.h"' --famtabs.h: gen_famtabs_h Makefile -- ./gen_famtabs_h --i2s fam > $@ -- --gen_flagtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h flagtab.h --# ../auparse/ is used to avoid using ../lib/flagtab.h --gen_flagtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="../auparse/flagtab.h"' --flagtabs.h: gen_flagtabs_h Makefile -- ./gen_flagtabs_h --i2s-transtab flag > $@ -- --gen_fcntl_cmdtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h \ -- fcntl-cmdtab.h --gen_fcntl_cmdtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="fcntl-cmdtab.h"' --fcntl-cmdtabs.h: gen_fcntl-cmdtabs_h Makefile -- ./gen_fcntl-cmdtabs_h --i2s fcntl > $@ -- --gen_icmptypetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h icmptypetab.h --gen_icmptypetabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="icmptypetab.h"' --icmptypetabs.h: gen_icmptypetabs_h Makefile -- ./gen_icmptypetabs_h --i2s icmptype > $@ -- --gen_ipctabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h ipctab.h --gen_ipctabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="ipctab.h"' --ipctabs.h: gen_ipctabs_h Makefile -- ./gen_ipctabs_h --i2s ipc > $@ -- --gen_ipccmdtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h ipccmdtab.h --gen_ipccmdtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="ipccmdtab.h"' --ipccmdtabs.h: gen_ipccmdtabs_h Makefile -- ./gen_ipccmdtabs_h --i2s-transtab ipccmd > $@ -- --gen_ipoptnametabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h ipoptnametab.h --gen_ipoptnametabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="ipoptnametab.h"' --ipoptnametabs.h: gen_ipoptnametabs_h Makefile -- ./gen_ipoptnametabs_h --i2s ipoptname > $@ -- --gen_ip6optnametabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h ip6optnametab.h --gen_ip6optnametabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="ip6optnametab.h"' --ip6optnametabs.h: gen_ip6optnametabs_h Makefile -- ./gen_ip6optnametabs_h --i2s ip6optname > $@ -- --gen_mmaptabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h mmaptab.h --gen_mmaptabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="mmaptab.h"' --mmaptabs.h: gen_mmaptabs_h Makefile -- ./gen_mmaptabs_h --i2s-transtab mmap > $@ -- --gen_mounttabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h mounttab.h --gen_mounttabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="mounttab.h"' --mounttabs.h: gen_mounttabs_h Makefile -- ./gen_mounttabs_h --i2s-transtab mount > $@ -- --gen_nfprototabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h nfprototab.h --gen_nfprototabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="nfprototab.h"' --nfprototabs.h: gen_nfprototabs_h Makefile -- ./gen_nfprototabs_h --i2s nfproto > $@ -- --gen_open_flagtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h \ -- open-flagtab.h --gen_open_flagtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="open-flagtab.h"' --open-flagtabs.h: gen_open-flagtabs_h Makefile -- ./gen_open-flagtabs_h --i2s-transtab open_flag > $@ -- --gen_persontabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h persontab.h --gen_persontabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="persontab.h"' --persontabs.h: gen_persontabs_h Makefile -- ./gen_persontabs_h --i2s person > $@ -- --gen_ptracetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h ptracetab.h --gen_ptracetabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="ptracetab.h"' --ptracetabs.h: gen_ptracetabs_h Makefile -- ./gen_ptracetabs_h --i2s ptrace > $@ -- --gen_prctl_opttabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h prctl-opt-tab.h --gen_prctl_opttabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="prctl-opt-tab.h"' --prctl_opttabs.h: gen_prctl_opttabs_h Makefile -- ./gen_prctl_opttabs_h --i2s prctl_opt > $@ -- --gen_pktoptnametabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h pktoptnametab.h --gen_pktoptnametabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="pktoptnametab.h"' --pktoptnametabs.h: gen_pktoptnametabs_h Makefile -- ./gen_pktoptnametabs_h --i2s pktoptname > $@ -- --gen_prottabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h prottab.h --gen_prottabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="prottab.h"' --prottabs.h: gen_prottabs_h Makefile -- ./gen_prottabs_h --i2s-transtab prot > $@ -- --gen_recvtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h recvtab.h --gen_recvtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="recvtab.h"' --recvtabs.h: gen_recvtabs_h Makefile -- ./gen_recvtabs_h --i2s-transtab recv > $@ -- --gen_rlimit_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h rlimittab.h --gen_rlimit_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="rlimittab.h"' --rlimittabs.h: gen_rlimit_h Makefile -- ./gen_rlimit_h --i2s rlimit > $@ -- --gen_schedtabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h schedtab.h --gen_schedtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="schedtab.h"' --schedtabs.h: gen_schedtabs_h Makefile -- ./gen_schedtabs_h --i2s sched > $@ -- --gen_seccomptabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h seccomptab.h --gen_seccomptabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="seccomptab.h"' --seccomptabs.h: gen_seccomptabs_h Makefile -- ./gen_seccomptabs_h --i2s seccomp > $@ -- --gen_seektabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h seektab.h --gen_seektabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="seektab.h"' --seektabs.h: gen_seektabs_h Makefile -- ./gen_seektabs_h --i2s seek > $@ -- --gen_shm_modetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h shm_modetab.h --gen_shm_modetabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="shm_modetab.h"' --shm_modetabs.h: gen_shm_modetabs_h Makefile -- ./gen_shm_modetabs_h --i2s-transtab shm_mode > $@ -- --gen_signals_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h signaltab.h --gen_signals_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="signaltab.h"' --signaltabs.h: gen_signals_h Makefile -- ./gen_signals_h --i2s signal > $@ -- --gen_sockleveltabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h sockleveltab.h --gen_sockleveltabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="sockleveltab.h"' --sockleveltabs.h: gen_sockleveltabs_h Makefile -- ./gen_sockleveltabs_h --i2s socklevel > $@ -- --gen_sockoptnametabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h sockoptnametab.h --gen_sockoptnametabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="sockoptnametab.h"' --sockoptnametabs.h: gen_sockoptnametabs_h Makefile -- ./gen_sockoptnametabs_h --i2s sockoptname > $@ -- --gen_socktabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h socktab.h --gen_socktabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="socktab.h"' --socktabs.h: gen_socktabs_h Makefile -- ./gen_socktabs_h --i2s sock > $@ -- --gen_socktypetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h socktypetab.h --gen_socktypetabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="socktypetab.h"' --socktypetabs.h: gen_socktypetabs_h Makefile -- ./gen_socktypetabs_h --i2s sock_type > $@ -- --gen_tcpoptnametabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h tcpoptnametab.h --gen_tcpoptnametabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="tcpoptnametab.h"' --tcpoptnametabs.h: gen_tcpoptnametabs_h Makefile -- ./gen_tcpoptnametabs_h --i2s tcpoptname > $@ -- --gen_typetabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h typetab.h --gen_typetabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="typetab.h"' --typetabs.h: gen_typetabs_h Makefile -- ./gen_typetabs_h --s2i type > $@ -- --gen_umounttabs_h_SOURCES = ../lib/gen_tables.c ../lib/gen_tables.h umounttab.h --gen_umounttabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="umounttab.h"' --umounttabs.h: gen_umounttabs_h Makefile -- ./gen_umounttabs_h --i2s-transtab umount > $@ -- -diff --git a/auparse/accesstabs.h b/auparse/accesstabs.h -new file mode 100644 -index 0000000..867d99c ---- /dev/null -+++ b/auparse/accesstabs.h -@@ -0,0 +1,6 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char access_strings[] = "R_OK\0W_OK\0X_OK"; -+static const struct transtab access_table[] = { -+ {1,10},{2,5},{4,0}, -+}; -+#define ACCESS_NUM_ENTRIES (sizeof(access_table) / sizeof(*access_table)) -diff --git a/auparse/captabs.h b/auparse/captabs.h -new file mode 100644 -index 0000000..9267466 ---- /dev/null -+++ b/auparse/captabs.h -@@ -0,0 +1,14 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char cap_strings[] = "audit_control\0audit_write\0block_suspend\0chown\0compromise_kernel\0dac_override\0dac_read_search\0fowner\0fsetid\0ipc_lock\0" -+ "ipc_owner\0kill\0lease\0linux_immutable\0mac_admin\0mac_override\0mknod\0net_admin\0net_bind_service\0net_broadcast\0" -+ "net_raw\0setfcap\0setgid\0setpcap\0setuid\0sys_admin\0sys_boot\0sys_chroot\0sys_module\0sys_nice\0" -+ "sys_pacct\0sys_ptrace\0sys_rawio\0sys_resource\0sys_time\0sys_tty_config\0syslog\0wake_alarm"; -+static const unsigned cap_i2s_direct[] = { -+ 40,64,77,93,100,126,239,254,246,137, -+ 192,209,182,223,107,116,291,332,280,321, -+ 311,261,271,302,342,355,364,176,131,14, -+ 0,231,163,153,379,386,26,46, -+}; -+static const char *cap_i2s(int v) { -+ return i2s_direct__(cap_strings, cap_i2s_direct, 0, 37, v); -+} -diff --git a/auparse/clocktabs.h b/auparse/clocktabs.h -new file mode 100644 -index 0000000..03f9f09 ---- /dev/null -+++ b/auparse/clocktabs.h -@@ -0,0 +1,8 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char clock_strings[] = "CLOCK_BOOTTIME\0CLOCK_BOOTTIME_ALARM\0CLOCK_MONOTONIC\0CLOCK_MONOTONIC_COARSE\0CLOCK_MONOTONIC_RAW\0CLOCK_PROCESS_CPUTIME_ID\0CLOCK_REALTIME\0CLOCK_REALTIME_ALARM\0CLOCK_REALTIME_COARSE\0CLOCK_THREAD_CPUTIME_ID"; -+static const unsigned clock_i2s_direct[] = { -+ 120,36,95,178,75,156,52,0,135,15, -+}; -+static const char *clock_i2s(int v) { -+ return i2s_direct__(clock_strings, clock_i2s_direct, 0, 9, v); -+} -diff --git a/auparse/clone-flagtabs.h b/auparse/clone-flagtabs.h -new file mode 100644 -index 0000000..b8f815d ---- /dev/null -+++ b/auparse/clone-flagtabs.h -@@ -0,0 +1,10 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char clone_flag_strings[] = "CLONE_CHILD_CLEARTID\0CLONE_CHILD_SETTID\0CLONE_DETACHED\0CLONE_FILES\0CLONE_FS\0CLONE_IO\0CLONE_NEWIPC\0CLONE_NEWNET\0CLONE_NEWNS\0CLONE_NEWPID\0" -+ "CLONE_NEWUSER\0CLONE_NEWUTS\0CLONE_PARENT\0CLONE_PARENT_SETTID\0CLONE_PTRACE\0CLONE_SETTLS\0CLONE_SIGHAND\0CLONE_STOPPED\0CLONE_SYSVSEM\0CLONE_THREAD\0" -+ "CLONE_UNTRACED\0CLONE_VFORK\0CLONE_VM"; -+static const struct transtab clone_flag_table[] = { -+ {256,304},{512,67},{1024,55},{2048,222},{8192,196},{16384,292},{32768,163},{65536,264},{131072,111},{262144,250}, -+ {524288,209},{1048576,176},{2097152,0},{4194304,40},{8388608,277},{16777216,21},{33554432,236},{67108864,150},{134217728,85},{268435456,136}, -+ {536870912,123},{1073741824,98},{-2147483648,76}, -+}; -+#define CLONE_FLAG_NUM_ENTRIES (sizeof(clone_flag_table) / sizeof(*clone_flag_table)) -diff --git a/auparse/epoll_ctls.h b/auparse/epoll_ctls.h -new file mode 100644 -index 0000000..2787c18 ---- /dev/null -+++ b/auparse/epoll_ctls.h -@@ -0,0 +1,8 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char epoll_ctl_strings[] = "EPOLL_CTL_ADD\0EPOLL_CTL_DEL\0EPOLL_CTL_MOD"; -+static const unsigned epoll_ctl_i2s_direct[] = { -+ 0,14,28, -+}; -+static const char *epoll_ctl_i2s(int v) { -+ return i2s_direct__(epoll_ctl_strings, epoll_ctl_i2s_direct, 1, 3, v); -+} -diff --git a/auparse/famtabs.h b/auparse/famtabs.h -new file mode 100644 -index 0000000..cae396b ---- /dev/null -+++ b/auparse/famtabs.h -@@ -0,0 +1,14 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char fam_strings[] = "alg\0appletalk\0ash\0atmpvc\0atmsvc\0ax25\0bluetooth\0bridge\0caif\0can\0" -+ "decnet\0econet\0ieee802154\0inet\0inet6\0ipx\0irda\0isdn\0iucv\0key\0" -+ "llc\0local\0netbeui\0netlink\0netrom\0nfc\0packet\0phonet\0pppox\0rds\0" -+ "rose\0rxrpc\0security\0sna\0tipc\0vsock\0wanpipe\0x25"; -+static const unsigned fam_i2s_direct[] = { -+ 126,88,32,99,4,148,47,18,226,93, -+ 183,63,132,194,118,140,159,14,70,25, -+ 179,203,103,173,218,122,-1u,-1u,59,207, -+ 37,113,188,108,166,77,54,0,155,212, -+}; -+static const char *fam_i2s(int v) { -+ return i2s_direct__(fam_strings, fam_i2s_direct, 1, 40, v); -+} -diff --git a/auparse/fcntl-cmdtabs.h b/auparse/fcntl-cmdtabs.h -new file mode 100644 -index 0000000..18c6cc7 ---- /dev/null -+++ b/auparse/fcntl-cmdtabs.h -@@ -0,0 +1,17 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char fcntl_strings[] = "F_CANCELLK\0F_DUPFD\0F_DUPFD_CLOEXEC\0F_GETFD\0F_GETFL\0F_GETLEASE\0F_GETLK\0F_GETLK64\0F_GETOWN\0F_GETOWNER_UIDS\0" -+ "F_GETOWN_EX\0F_GETPIPE_SZ\0F_GETSIG\0F_NOTIFY\0F_SETFD\0F_SETFL\0F_SETLEASE\0F_SETLK\0F_SETLK64\0F_SETLKW\0" -+ "F_SETLKW64\0F_SETOWN\0F_SETOWN_EX\0F_SETPIPE_SZ\0F_SETSIG"; -+static const int fcntl_i2s_i[] = { -+ 0,1,2,3,4,5,6,7,8,9, -+ 10,11,12,13,14,15,16,17,1024,1025, -+ 1026,1029,1030,1031,1032, -+}; -+static const unsigned fcntl_i2s_s[] = { -+ 11,35,148,43,156,62,175,193,213,80, -+ 247,130,70,183,202,222,105,89,164,51, -+ 139,0,19,234,117, -+}; -+static const char *fcntl_i2s(int v) { -+ return i2s_bsearch__(fcntl_strings, fcntl_i2s_i, fcntl_i2s_s, 25, v); -+} -diff --git a/auparse/flagtabs.h b/auparse/flagtabs.h -new file mode 100644 -index 0000000..5f57e14 ---- /dev/null -+++ b/auparse/flagtabs.h -@@ -0,0 +1,6 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char flag_strings[] = "access\0atomic\0continue\0create\0directory\0follow\0noalt\0open\0parent"; -+static const struct transtab flag_table[] = { -+ {1,40},{2,30},{4,14},{16,58},{32,47},{64,7},{256,53},{512,23},{1024,0}, -+}; -+#define FLAG_NUM_ENTRIES (sizeof(flag_table) / sizeof(*flag_table)) -diff --git a/auparse/icmptypetabs.h b/auparse/icmptypetabs.h -new file mode 100644 -index 0000000..49b44bf ---- /dev/null -+++ b/auparse/icmptypetabs.h -@@ -0,0 +1,10 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char icmptype_strings[] = "address-mask-reply\0address-mask-request\0destination-unreachable\0echo\0echo-reply\0info-reply\0info-request\0parameter-problem\0redirect\0source-quench\0" -+ "time-exceeded\0timestamp-reply\0timestamp-request"; -+static const unsigned icmptype_i2s_direct[] = { -+ 69,-1u,-1u,40,131,122,-1u,-1u,64,-1u, -+ -1u,145,104,175,159,91,80,19,0, -+}; -+static const char *icmptype_i2s(int v) { -+ return i2s_direct__(icmptype_strings, icmptype_i2s_direct, 0, 18, v); -+} -diff --git a/auparse/ip6optnametabs.h b/auparse/ip6optnametabs.h -new file mode 100644 -index 0000000..4af11c2 ---- /dev/null -+++ b/auparse/ip6optnametabs.h -@@ -0,0 +1,20 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char ip6optname_strings[] = "IP6T_SO_GET_REVISION_MATCH\0IP6T_SO_GET_REVISION_TARGET\0IP6T_SO_ORIGINAL_DST\0IP6T_SO_SET_ADD_COUNTERS\0IP6T_SO_SET_REPLACE\0IPV6_2292DSTOPTS\0IPV6_2292HOPLIMIT\0IPV6_2292HOPOPTS\0IPV6_2292PKTINFO\0IPV6_2292PKTOPTIONS\0" -+ "IPV6_2292RTHDR\0IPV6_ADDRFORM\0IPV6_ADDR_PREFERENCES\0IPV6_ADD_MEMBERSHIP\0IPV6_AUTHHDR\0IPV6_CHECKSUM\0IPV6_DONTFRAG\0IPV6_DROP_MEMBERSHIP\0IPV6_DSTOPTS\0IPV6_FLOWINFO\0" -+ "IPV6_FLOWINFO_SEND\0IPV6_FLOWLABEL_MGR\0IPV6_HOPLIMIT\0IPV6_HOPOPTS\0IPV6_IPSEC_POLICY\0IPV6_JOIN_ANYCAST\0IPV6_LEAVE_ANYCAST\0IPV6_MINHOPCOUNT\0IPV6_MTU\0IPV6_MTU_DISCOVER\0" -+ "IPV6_MULTICAST_HOPS\0IPV6_MULTICAST_IF\0IPV6_MULTICAST_LOOP\0IPV6_NEXTHOP\0IPV6_ORIGDSTADDR\0IPV6_PATHMTU\0IPV6_PKTINFO\0IPV6_RECVDSTOPTS\0IPV6_RECVERR\0IPV6_RECVHOPLIMIT\0" -+ "IPV6_RECVHOPOPTS\0IPV6_RECVPATHMTU\0IPV6_RECVPKTINFO\0IPV6_RECVRTHDR\0IPV6_RECVTCLASS\0IPV6_ROUTER_ALERT\0IPV6_RTHDR\0IPV6_RTHDRDSTOPTS\0IPV6_TCLASS\0IPV6_TRANSPARENT\0" -+ "IPV6_UNICAST_HOPS\0IPV6_UNICAST_IF\0IPV6_USE_MIN_MTU\0IPV6_V6ONLY\0IPV6_XFRM_POLICY"; -+static const unsigned ip6optname_i2s_direct[] = { -+ 225,173,156,121,210,190,294,138,592,281, -+ 356,-1u,-1u,-1u,-1u,854,554,534,572,261, -+ 322,778,516,507,665,905,453,471,-1u,-1u, -+ -1u,389,370,435,917,-1u,-1u,-1u,-1u,-1u, -+ -1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u,730,635, -+ 678,408,696,422,807,747,796,648,343,713, -+ 622,308,888,101,76,762,825,0,27,-1u, -+ -1u,239,490,605,837,872,-1u,-1u,-1u,55, -+}; -+static const char *ip6optname_i2s(int v) { -+ return i2s_direct__(ip6optname_strings, ip6optname_i2s_direct, 1, 80, v); -+} -diff --git a/auparse/ipccmdtabs.h b/auparse/ipccmdtabs.h -new file mode 100644 -index 0000000..ff43dbb ---- /dev/null -+++ b/auparse/ipccmdtabs.h -@@ -0,0 +1,6 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char ipccmd_strings[] = "IPC_CREAT\0IPC_EXCL\0IPC_NOWAIT"; -+static const struct transtab ipccmd_table[] = { -+ {512,0},{1024,10},{2048,19}, -+}; -+#define IPCCMD_NUM_ENTRIES (sizeof(ipccmd_table) / sizeof(*ipccmd_table)) -diff --git a/auparse/ipctabs.h b/auparse/ipctabs.h -new file mode 100644 -index 0000000..4bf3bcd ---- /dev/null -+++ b/auparse/ipctabs.h -@@ -0,0 +1,11 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char ipc_strings[] = "msgctl\0msgget\0msgrcv\0msgsnd\0semctl\0semget\0semop\0semtimedop\0shmat\0shmctl\0" -+ "shmdt\0shmget"; -+static const unsigned ipc_i2s_direct[] = { -+ 42,35,28,48,-1u,-1u,-1u,-1u,-1u,-1u, -+ 21,14,7,0,-1u,-1u,-1u,-1u,-1u,-1u, -+ 59,72,78,65, -+}; -+static const char *ipc_i2s(int v) { -+ return i2s_direct__(ipc_strings, ipc_i2s_direct, 1, 24, v); -+} -diff --git a/auparse/ipoptnametabs.h b/auparse/ipoptnametabs.h -new file mode 100644 -index 0000000..fb0b8b7 ---- /dev/null -+++ b/auparse/ipoptnametabs.h -@@ -0,0 +1,17 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char ipoptname_strings[] = "IPT_SO_GET_REVISION_TARGET\0IPT_SO_SET_ADD_COUNTERS\0IPT_SO_SET_REPLACE\0IP_ADD_MEMBERSHIP\0IP_ADD_SOURCE_MEMBERSHIP\0IP_BLOCK_SOURCE\0IP_DROP_MEMBERSHIP\0IP_DROP_SOURCE_MEMBERSHIP\0IP_FREEBIND\0IP_HDRINCL\0" -+ "IP_IPSEC_POLICY\0IP_MINTTL\0IP_MSFILTER\0IP_MTU\0IP_MTU_DISCOVER\0IP_MULTICAST_ALL\0IP_MULTICAST_IF\0IP_MULTICAST_LOOP\0IP_MULTICAST_TTL\0IP_NODEFRAG\0" -+ "IP_OPTIONS\0IP_ORIGDSTADDR\0IP_PASSSEC\0IP_PKTINFO\0IP_PKTOPTIONS\0IP_RECVERR\0IP_RECVOPTS\0IP_RECVTTL\0IP_RETOPTS\0IP_ROUTER_ALERT\0" -+ "IP_TOS\0IP_TRANSPARENT\0IP_TTL\0IP_UNBLOCK_SOURCE\0IP_UNICAST_IF\0IP_XFRM_POLICY"; -+static const unsigned ipoptname_i2s_direct[] = { -+ 461,483,186,338,445,411,434,375,386,242, -+ 400,423,-1u,235,174,197,522,364,468,349, -+ 213,326,-1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u, -+ -1u,275,309,291,70,129,490,113,88,148, -+ 223,-1u,-1u,-1u,-1u,-1u,-1u,-1u,258,508, -+ -1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u, -+ -1u,-1u,-1u,51,27,0, -+}; -+static const char *ipoptname_i2s(int v) { -+ return i2s_direct__(ipoptname_strings, ipoptname_i2s_direct, 1, 66, v); -+} -diff --git a/auparse/mmaptabs.h b/auparse/mmaptabs.h -new file mode 100644 -index 0000000..386833c ---- /dev/null -+++ b/auparse/mmaptabs.h -@@ -0,0 +1,8 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char mmap_strings[] = "MAP_32BIT\0MAP_ANONYMOUS\0MAP_DENYWRITE\0MAP_EXECUTABLE\0MAP_FIXED\0MAP_GROWSDOWN\0MAP_HUGETLB\0MAP_LOCKED\0MAP_NONBLOCK\0MAP_NORESERVE\0" -+ "MAP_POPULATE\0MAP_PRIVATE\0MAP_SHARED\0MAP_STACK"; -+static const struct transtab mmap_table[] = { -+ {1,152},{2,140},{16,53},{32,10},{64,0},{256,63},{2048,24},{4096,38},{8192,89},{16384,113}, -+ {32768,127},{65536,100},{131072,163},{262144,77}, -+}; -+#define MMAP_NUM_ENTRIES (sizeof(mmap_table) / sizeof(*mmap_table)) -diff --git a/auparse/mounttabs.h b/auparse/mounttabs.h -new file mode 100644 -index 0000000..ca66885 ---- /dev/null -+++ b/auparse/mounttabs.h -@@ -0,0 +1,10 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char mount_strings[] = "MS_ACTIVE\0MS_BIND\0MS_BORN\0MS_DIRSYNC\0MS_I_VERSION\0MS_KERNMOUNT\0MS_MANDLOCK\0MS_MOVE\0MS_NOATIME\0MS_NODEV\0" -+ "MS_NODIRATIME\0MS_NOEXEC\0MS_NOSEC\0MS_NOSUID\0MS_NOUSER\0MS_POSIXACL\0MS_PRIVATE\0MS_RDONLY\0MS_REC\0MS_RELATIME\0" -+ "MS_REMOUNT\0MS_SHARED\0MS_SILENT\0MS_SLAVE\0MS_SNAP_STABLE\0MS_STRICTATIME\0MS_SYNCHRONOUS\0MS_UNBINDABLE"; -+static const struct transtab mount_table[] = { -+ {1,179},{2,136},{4,94},{8,117},{16,278},{32,208},{64,63},{128,26},{1024,83},{2048,103}, -+ {4096,10},{8192,75},{16384,189},{32768,229},{65536,156},{131072,293},{262144,168},{524288,239},{1048576,219},{2097152,196}, -+ {4194304,50},{8388608,37},{16777216,263},{134217728,248},{268435456,127},{536870912,18},{1073741824,0},{-2147483648,146}, -+}; -+#define MOUNT_NUM_ENTRIES (sizeof(mount_table) / sizeof(*mount_table)) -diff --git a/auparse/nfprototabs.h b/auparse/nfprototabs.h -new file mode 100644 -index 0000000..9bb2723 ---- /dev/null -+++ b/auparse/nfprototabs.h -@@ -0,0 +1,9 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char nfproto_strings[] = "arp\0bridge\0decnet\0ipv4\0ipv6\0unspecified"; -+static const unsigned nfproto_i2s_direct[] = { -+ 28,-1u,18,0,-1u,-1u,-1u,4,-1u,-1u, -+ 23,-1u,11, -+}; -+static const char *nfproto_i2s(int v) { -+ return i2s_direct__(nfproto_strings, nfproto_i2s_direct, 0, 12, v); -+} -diff --git a/auparse/open-flagtabs.h b/auparse/open-flagtabs.h -new file mode 100644 -index 0000000..5e3c3eb ---- /dev/null -+++ b/auparse/open-flagtabs.h -@@ -0,0 +1,8 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char open_flag_strings[] = "O_APPEND\0O_ASYNC\0O_CLOEXEC\0O_CREAT\0O_DIRECT\0O_DIRECTORY\0O_DSYNC\0O_EXCL\0O_NOATIME\0O_NOCTTY\0" -+ "O_NOFOLLOW\0O_NONBLOCK\0O_PATH\0O_RDWR\0O_TRUNC\0O_WRONLY\0__O_SYNC"; -+static const struct transtab open_flag_table[] = { -+ {1,134},{2,119},{64,27},{128,64},{256,81},{512,126},{1024,0},{2048,101},{4096,56},{8192,9}, -+ {16384,35},{65536,44},{131072,90},{262144,71},{524288,17},{1048576,143},{2097152,112}, -+}; -+#define OPEN_FLAG_NUM_ENTRIES (sizeof(open_flag_table) / sizeof(*open_flag_table)) -diff --git a/auparse/persontabs.h b/auparse/persontabs.h -new file mode 100644 -index 0000000..d099839 ---- /dev/null -+++ b/auparse/persontabs.h -@@ -0,0 +1,17 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char person_strings[] = "PER_BSD\0PER_HPUX\0PER_IRIX32\0PER_IRIX64\0PER_IRIXN32\0PER_ISCR4\0PER_LINUX\0PER_LINUX32\0PER_LINUX32_3GB\0PER_LINUX_32BIT\0" -+ "PER_OSF4\0PER_OSR5\0PER_RISCOS\0PER_SCOSVR3\0PER_SOLARIS\0PER_SUNOS\0PER_SVR3\0PER_SVR4\0PER_UW7\0PER_WYSEV386\0" -+ "PER_XENIX"; -+static const int person_i2s_i[] = { -+ 0,6,8,12,15,16,8388608,67108869,67108870,67108873, -+ 67108874,67108875,67108877,68157441,68157454,83886082,83886084,83886087,100663299,117440515, -+ 134217736, -+}; -+static const unsigned person_i2s_s[] = { -+ 61,0,71,133,115,8,99,51,168,17, -+ 39,28,156,187,196,178,204,217,124,144, -+ 83, -+}; -+static const char *person_i2s(int v) { -+ return i2s_bsearch__(person_strings, person_i2s_i, person_i2s_s, 21, v); -+} -diff --git a/auparse/pktoptnametabs.h b/auparse/pktoptnametabs.h -new file mode 100644 -index 0000000..4613372 ---- /dev/null -+++ b/auparse/pktoptnametabs.h -@@ -0,0 +1,10 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char pktoptname_strings[] = "PACKET_ADD_MEMBERSHIP\0PACKET_AUXDATA\0PACKET_COPY_THRESH\0PACKET_DROP_MEMBERSHIP\0PACKET_FANOUT\0PACKET_HDRLEN\0PACKET_LOSS\0PACKET_ORIGDEV\0PACKET_RECV_OUTPUT\0PACKET_RESERVE\0" -+ "PACKET_RX_RING\0PACKET_STATISTICS\0PACKET_TIMESTAMP\0PACKET_TX_HAS_OFF\0PACKET_TX_RING\0PACKET_TX_TIMESTAMP\0PACKET_VERSION\0PACKET_VNET_HDR"; -+static const unsigned pktoptname_i2s_direct[] = { -+ 0,56,134,-1u,168,183,37,22,119,271, -+ 93,153,236,107,286,251,201,79,218, -+}; -+static const char *pktoptname_i2s(int v) { -+ return i2s_direct__(pktoptname_strings, pktoptname_i2s_direct, 1, 19, v); -+} -diff --git a/auparse/prctl_opttabs.h b/auparse/prctl_opttabs.h -new file mode 100644 -index 0000000..03707a8 ---- /dev/null -+++ b/auparse/prctl_opttabs.h -@@ -0,0 +1,14 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char prctl_opt_strings[] = "PR_CAPBSET_DROP\0PR_CAPBSET_READ\0PR_GET_CHILD_SUBREAPER\0PR_GET_DUMPABLE\0PR_GET_ENDIAN\0PR_GET_FPEMU\0PR_GET_FPEXC\0PR_GET_KEEPCAPS\0PR_GET_NAME\0PR_GET_NO_NEW_PRIVS\0" -+ "PR_GET_PDEATHSIG\0PR_GET_SECCOMP\0PR_GET_SECUREBITS\0PR_GET_TID_ADDRESS\0PR_GET_TIMERSLACK\0PR_GET_TIMING\0PR_GET_TSC\0PR_GET_UNALIGN\0PR_MCE_KILL\0PR_MCE_KILL_GET\0" -+ "PR_SET_CHILD_SUBREAPER\0PR_SET_DUMPABLE\0PR_SET_ENDIAN\0PR_SET_FPEMU\0PR_SET_FPEXC\0PR_SET_KEEPCAPS\0PR_SET_MM\0PR_SET_NAME\0PR_SET_NO_NEW_PRIVS\0PR_SET_PDEATHSIG\0" -+ "PR_SET_SECCOMP\0PR_SET_SECUREBITS\0PR_SET_TIMERSLACK\0PR_SET_TIMING\0PR_SET_TSC\0PR_SET_UNALIGN\0PR_TASK_PERF_EVENTS_DISABLE\0PR_TASK_PERF_EVENTS_ENABLE"; -+static const unsigned prctl_opt_i2s_direct[] = { -+ 451,159,55,337,271,544,111,393,85,367, -+ 98,380,246,519,419,127,-1u,-1u,71,353, -+ 176,468,16,0,260,533,191,483,501,228, -+ 559,587,286,298,409,314,32,431,139,209, -+}; -+static const char *prctl_opt_i2s(int v) { -+ return i2s_direct__(prctl_opt_strings, prctl_opt_i2s_direct, 1, 40, v); -+} -diff --git a/auparse/prottabs.h b/auparse/prottabs.h -new file mode 100644 -index 0000000..1727f43 ---- /dev/null -+++ b/auparse/prottabs.h -@@ -0,0 +1,6 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char prot_strings[] = "PROT_EXEC\0PROT_READ\0PROT_SEM\0PROT_WRITE"; -+static const struct transtab prot_table[] = { -+ {1,10},{2,29},{4,0},{8,20}, -+}; -+#define PROT_NUM_ENTRIES (sizeof(prot_table) / sizeof(*prot_table)) -diff --git a/auparse/ptracetabs.h b/auparse/ptracetabs.h -new file mode 100644 -index 0000000..6bbfc9b ---- /dev/null -+++ b/auparse/ptracetabs.h -@@ -0,0 +1,17 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char ptrace_strings[] = "PTRACE_ATTACH\0PTRACE_CONT\0PTRACE_DETACH\0PTRACE_GETEVENTMSG\0PTRACE_GETFPREGS\0PTRACE_GETFPXREGS\0PTRACE_GETREGS\0PTRACE_GETREGSET\0PTRACE_GETSIGINFO\0PTRACE_INTERRUPT\0" -+ "PTRACE_KILL\0PTRACE_LISTEN\0PTRACE_PEEKDATA\0PTRACE_PEEKTEXT\0PTRACE_PEEKUSER\0PTRACE_POKEDATA\0PTRACE_POKETEXT\0PTRACE_POKEUSER\0PTRACE_SEIZE\0PTRACE_SETFPREGS\0" -+ "PTRACE_SETFPXREGS\0PTRACE_SETOPTIONS\0PTRACE_SETREGS\0PTRACE_SETREGSET\0PTRACE_SETSIGINFO\0PTRACE_SINGLESTEP\0PTRACE_SYSCALL\0PTRACE_TRACEME"; -+static const int ptrace_i2s_i[] = { -+ 0,1,2,3,4,5,6,7,8,9, -+ 12,13,14,15,16,17,18,19,24,16896, -+ 16897,16898,16899,16900,16901,16902,16903,16904, -+}; -+static const unsigned ptrace_i2s_s[] = { -+ 432,203,187,219,251,235,267,14,161,399, -+ 94,349,59,296,0,26,76,313,417,331, -+ 40,126,381,109,364,283,144,173, -+}; -+static const char *ptrace_i2s(int v) { -+ return i2s_bsearch__(ptrace_strings, ptrace_i2s_i, ptrace_i2s_s, 28, v); -+} -diff --git a/auparse/recvtabs.h b/auparse/recvtabs.h -new file mode 100644 -index 0000000..9cab5a3 ---- /dev/null -+++ b/auparse/recvtabs.h -@@ -0,0 +1,8 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char recv_strings[] = "MSG_CMSG_CLOEXEC\0MSG_CONFIRM\0MSG_CTRUNC\0MSG_DONTROUTE\0MSG_DONTWAIT\0MSG_EOR\0MSG_ERRQUEUE\0MSG_FASTOPEN\0MSG_FIN\0MSG_MORE\0" -+ "MSG_NOSIGNAL\0MSG_OOB\0MSG_PEEK\0MSG_PROXY\0MSG_RST\0MSG_SENDPAGE_NOTLAST\0MSG_SYN\0MSG_TRUNC\0MSG_WAITALL\0MSG_WAITFORONE"; -+static const struct transtab recv_table[] = { -+ {1,131},{2,139},{4,40},{8,29},{16,148},{32,195},{64,54},{128,67},{256,205},{512,101}, -+ {1024,187},{2048,17},{4096,158},{8192,75},{16384,118},{32768,109},{65536,217},{131072,166},{536870912,88},{1073741824,0}, -+}; -+#define RECV_NUM_ENTRIES (sizeof(recv_table) / sizeof(*recv_table)) -diff --git a/auparse/rlimittabs.h b/auparse/rlimittabs.h -new file mode 100644 -index 0000000..364ad69 ---- /dev/null -+++ b/auparse/rlimittabs.h -@@ -0,0 +1,10 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char rlimit_strings[] = "RLIMIT_AS\0RLIMIT_CORE\0RLIMIT_CPU\0RLIMIT_DATA\0RLIMIT_FSIZE\0RLIMIT_LOCKS\0RLIMIT_MEMLOCK\0RLIMIT_MSGQUEUE\0RLIMIT_NICE\0RLIMIT_NOFILE\0" -+ "RLIMIT_NPROC\0RLIMIT_RSS\0RLIMIT_RTPRIO\0RLIMIT_RTTIME\0RLIMIT_SIGPENDING\0RLIMIT_STACK"; -+static const unsigned rlimit_i2s_direct[] = { -+ 22,45,33,198,10,141,128,114,71,0, -+ 58,180,86,102,152,166, -+}; -+static const char *rlimit_i2s(int v) { -+ return i2s_direct__(rlimit_strings, rlimit_i2s_direct, 0, 15, v); -+} -diff --git a/auparse/schedtabs.h b/auparse/schedtabs.h -new file mode 100644 -index 0000000..875317f ---- /dev/null -+++ b/auparse/schedtabs.h -@@ -0,0 +1,8 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char sched_strings[] = "SCHED_BATCH\0SCHED_FIFO\0SCHED_IDLE\0SCHED_OTHER\0SCHED_RR"; -+static const unsigned sched_i2s_direct[] = { -+ 34,12,46,0,-1u,23, -+}; -+static const char *sched_i2s(int v) { -+ return i2s_direct__(sched_strings, sched_i2s_direct, 0, 5, v); -+} -diff --git a/auparse/seccomptabs.h b/auparse/seccomptabs.h -new file mode 100644 -index 0000000..5c6c911 ---- /dev/null -+++ b/auparse/seccomptabs.h -@@ -0,0 +1,11 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char seccomp_strings[] = "allow\0errno\0kill\0trace\0trap"; -+static const int seccomp_i2s_i[] = { -+ 0,196608,327680,2146435072,2147418112, -+}; -+static const unsigned seccomp_i2s_s[] = { -+ 12,23,6,17,0, -+}; -+static const char *seccomp_i2s(int v) { -+ return i2s_bsearch__(seccomp_strings, seccomp_i2s_i, seccomp_i2s_s, 5, v); -+} -diff --git a/auparse/seektabs.h b/auparse/seektabs.h -new file mode 100644 -index 0000000..0d0f542 ---- /dev/null -+++ b/auparse/seektabs.h -@@ -0,0 +1,8 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char seek_strings[] = "SEEK_CUR\0SEEK_DATA\0SEEK_END\0SEEK_HOLE\0SEEK_SET"; -+static const unsigned seek_i2s_direct[] = { -+ 38,0,19,9,28, -+}; -+static const char *seek_i2s(int v) { -+ return i2s_direct__(seek_strings, seek_i2s_direct, 0, 4, v); -+} -diff --git a/auparse/shm_modetabs.h b/auparse/shm_modetabs.h -new file mode 100644 -index 0000000..ddd414d ---- /dev/null -+++ b/auparse/shm_modetabs.h -@@ -0,0 +1,6 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char shm_mode_strings[] = "SHM_DEST\0SHM_HUGETLB\0SHM_LOCKED\0SHM_NORESERVE"; -+static const struct transtab shm_mode_table[] = { -+ {512,0},{1024,21},{2048,9},{4096,32}, -+}; -+#define SHM_MODE_NUM_ENTRIES (sizeof(shm_mode_table) / sizeof(*shm_mode_table)) -diff --git a/auparse/signaltabs.h b/auparse/signaltabs.h -new file mode 100644 -index 0000000..91ce38e ---- /dev/null -+++ b/auparse/signaltabs.h -@@ -0,0 +1,14 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char signal_strings[] = "IGPWR\0SIG0\0SIGABRT\0SIGALRM\0SIGBUS\0SIGCHLD\0SIGCONT\0SIGFPE\0SIGHUP\0SIGILL\0" -+ "SIGINT\0SIGIO\0SIGKILL\0SIGPIPE\0SIGPROF\0SIGQUIT\0SIGSEGV\0SIGSTKFLT\0SIGSTOP\0SIGSYS\0" -+ "SIGTERM\0SIGTRAP\0SIGTSTP\0SIGTTIN\0SIGTTOU\0SIGURG\0SIGUSR1\0SIGUSR2\0SIGVTALRM\0SIGWINCH\0" -+ "SIGXCPU\0SIGXFSZ"; -+static const unsigned signal_i2s_direct[] = { -+ 6,57,71,108,64,157,11,27,50,84, -+ 196,116,204,92,19,149,124,34,42,134, -+ 165,173,181,189,231,239,212,100,222,78, -+ 0,142, -+}; -+static const char *signal_i2s(int v) { -+ return i2s_direct__(signal_strings, signal_i2s_direct, 0, 31, v); -+} -diff --git a/auparse/sockleveltabs.h b/auparse/sockleveltabs.h -new file mode 100644 -index 0000000..4473d8c ---- /dev/null -+++ b/auparse/sockleveltabs.h -@@ -0,0 +1,12 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char socklevel_strings[] = "SOL_AAL\0SOL_ALG\0SOL_ATALK\0SOL_ATM\0SOL_AX25\0SOL_BLUETOOTH\0SOL_CAIF\0SOL_DCCP\0SOL_DECNET\0SOL_IPX\0" -+ "SOL_IRDA\0SOL_IUCV\0SOL_LLC\0SOL_NETBEUI\0SOL_NETLINK\0SOL_NETROM\0SOL_PACKET\0SOL_PNPIPE\0SOL_PPPOL2TP\0SOL_RAW\0" -+ "SOL_RDS\0SOL_ROSE\0SOL_RXRPC\0SOL_TIPC"; -+static const unsigned socklevel_i2s_direct[] = { -+ 190,86,34,16,144,206,75,-1u,155,26, -+ 0,94,120,112,66,132,225,215,177,43, -+ 166,198,103,57,8, -+}; -+static const char *socklevel_i2s(int v) { -+ return i2s_direct__(socklevel_strings, socklevel_i2s_direct, 255, 279, v); -+} -diff --git a/auparse/sockoptnametabs.h b/auparse/sockoptnametabs.h -new file mode 100644 -index 0000000..831a030 ---- /dev/null -+++ b/auparse/sockoptnametabs.h -@@ -0,0 +1,23 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char sockoptname_strings[] = "SO_ACCEPTCONN\0SO_ATTACH_FILTER\0SO_BINDTODEVICE\0SO_BROADCAST\0SO_BSDCOMPAT\0SO_DEBUG\0SO_DETACH_FILTER\0SO_DOMAIN\0SO_DONTROUTE\0SO_ERROR\0" -+ "SO_KEEPALIVE\0SO_LINGER\0SO_LOCK_FILTER\0SO_MARK\0SO_NOFCS\0SO_NO_CHECK\0SO_OOBINLINE\0SO_PASSCRED\0SO_PASSCRED\0SO_PASSSEC\0" -+ "SO_PEEK_OFF\0SO_PEERCRED\0SO_PEERCRED\0SO_PEERNAME\0SO_PEERSEC\0SO_PRIORITY\0SO_PROTOCOL\0SO_RCVBUF\0SO_RCVBUFFORCE\0SO_RCVLOWAT\0" -+ "SO_RCVLOWAT\0SO_RCVTIMEO\0SO_RCVTIMEO\0SO_REUSEADDR\0SO_REUSEPORT\0SO_RXQ_OVFL\0SO_SECURITY_AUTHENTICATION\0SO_SECURITY_ENCRYPTION_NETWORK\0SO_SECURITY_ENCRYPTION_TRANSPORT\0SO_SNDBUF\0" -+ "SO_SNDBUFFORCE\0SO_SNDLOWAT\0SO_SNDLOWAT\0SO_SNDTIMEO\0SO_SNDTIMEO\0SO_TIMESTAMP\0SO_TIMESTAMPING\0SO_TIMESTAMPNS\0SO_TYPE\0SO_WIFI_STATUS"; -+static const int sockoptname_i2s_i[] = { -+ 1,2,3,4,5,6,7,8,9,10, -+ 11,12,13,14,15,16,17,18,19,20, -+ 21,22,23,24,25,26,27,28,29,30, -+ 31,32,33,34,35,36,37,38,39,40, -+ 41,42,43,44,116,117,118,119,120,121, -+}; -+static const unsigned sockoptname_i2s_s[] = { -+ 73,402,648,122,109,47,531,329,131,198, -+ 186,305,144,60,415,211,258,354,556,378, -+ 580,440,498,467,31,14,82,282,604,0, -+ 294,541,339,235,633,169,617,317,99,428, -+ 656,246,177,154,366,568,390,592,223,270, -+}; -+static const char *sockoptname_i2s(int v) { -+ return i2s_bsearch__(sockoptname_strings, sockoptname_i2s_i, sockoptname_i2s_s, 50, v); -+} -diff --git a/auparse/socktabs.h b/auparse/socktabs.h -new file mode 100644 -index 0000000..66a8235 ---- /dev/null -+++ b/auparse/socktabs.h -@@ -0,0 +1,10 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char sock_strings[] = "accept\0accept4\0bind\0connect\0getpeername\0getsockname\0getsockopt\0listen\0recv\0recvfrom\0" -+ "recvmmsg\0recvmsg\0send\0sendmmsg\0sendmsg\0sendto\0setsockopt\0shutdown\0socket\0socketpair"; -+static const unsigned sock_i2s_direct[] = { -+ 150,15,20,63,0,40,28,157,101,70, -+ 123,75,141,130,52,115,93,7,84,106, -+}; -+static const char *sock_i2s(int v) { -+ return i2s_direct__(sock_strings, sock_i2s_direct, 1, 20, v); -+} -diff --git a/auparse/socktypetabs.h b/auparse/socktypetabs.h -new file mode 100644 -index 0000000..05e8d36 ---- /dev/null -+++ b/auparse/socktypetabs.h -@@ -0,0 +1,8 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char sock_type_strings[] = "SOCK_DCCP\0SOCK_DGRAM\0SOCK_PACKET\0SOCK_RAW\0SOCK_RDM\0SOCK_SEQPACKET\0SOCK_STREAM"; -+static const unsigned sock_type_i2s_direct[] = { -+ 66,10,33,42,51,0,-1u,-1u,-1u,21, -+}; -+static const char *sock_type_i2s(int v) { -+ return i2s_direct__(sock_type_strings, sock_type_i2s_direct, 1, 10, v); -+} -diff --git a/auparse/tcpoptnametabs.h b/auparse/tcpoptnametabs.h -new file mode 100644 -index 0000000..061db3f ---- /dev/null -+++ b/auparse/tcpoptnametabs.h -@@ -0,0 +1,12 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char tcpoptname_strings[] = "TCP_CONGESTION\0TCP_COOKIE_TRANSACTIONS\0TCP_CORK\0TCP_DEFER_ACCEPT\0TCP_FASTOPEN\0TCP_INFO\0TCP_KEEPCNT\0TCP_KEEPIDLE\0TCP_KEEPINTVL\0TCP_LINGER2\0" -+ "TCP_MAXSEG\0TCP_MD5SIG\0TCP_NODELAY\0TCP_QUEUE_SEQ\0TCP_QUICKACK\0TCP_REPAIR\0TCP_REPAIR_OPTIONS\0TCP_REPAIR_QUEUE\0TCP_SYNCNT\0TCP_THIN_DUPACK\0" -+ "TCP_THIN_LINEAR_TIMEOUTS\0TCP_TIMESTAMP\0TCP_USER_TIMEOUT\0TCP_WINDOW_CLAMP"; -+static const unsigned tcpoptname_i2s_direct[] = { -+ 160,138,39,99,112,87,246,126,48,329, -+ 78,186,0,149,15,273,257,312,199,229, -+ 172,210,65,298, -+}; -+static const char *tcpoptname_i2s(int v) { -+ return i2s_direct__(tcpoptname_strings, tcpoptname_i2s_direct, 1, 24, v); -+} -diff --git a/auparse/typetabs.h b/auparse/typetabs.h -new file mode 100644 -index 0000000..a99d398 ---- /dev/null -+++ b/auparse/typetabs.h -@@ -0,0 +1,35 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char type_strings[] = "a0\0a1\0a2\0a3\0acct\0addr\0arch\0auid\0cap_fi\0cap_fp\0" -+ "cap_pe\0cap_pi\0cap_pp\0capability\0cgroup\0cmd\0code\0comm\0cwd\0data\0" -+ "device\0dir\0egid\0euid\0exe\0exit\0family\0fe\0fi\0file\0" -+ "flags\0fp\0fsgid\0fsuid\0gid\0icmptype\0id\0igid\0inode_gid\0inode_uid\0" -+ "iuid\0key\0list\0mode\0name\0new-disk\0new-fs\0new-rng\0new_gid\0new_pe\0" -+ "new_pi\0new_pp\0oauid\0obj_gid\0obj_uid\0ocomm\0oflag\0ogid\0old-disk\0old-fs\0" -+ "old-rng\0old_pe\0old_pi\0old_pp\0old_prom\0ouid\0path\0per\0perm\0perm_mask\0" -+ "prom\0proto\0res\0result\0saddr\0sauid\0ses\0sgid\0sig\0sigev_signo\0" -+ "suid\0syscall\0uid\0vm\0watch"; -+static const unsigned type_s2i_s[] = { -+ 0,3,6,9,12,17,22,27,32,39, -+ 46,53,60,67,78,85,89,94,99,103, -+ 108,115,119,124,129,133,138,145,148,151, -+ 156,162,165,171,177,181,190,193,198,208, -+ 218,223,227,232,237,242,251,258,266,274, -+ 281,288,295,301,309,317,323,329,334,343, -+ 350,358,365,372,379,388,393,398,402,407, -+ 417,422,428,432,439,445,451,455,460,464, -+ 476,481,489,493,496, -+}; -+static const int type_s2i_i[] = { -+ 14,15,16,17,6,26,4,1,22,22, -+ 22,22,22,12,6,6,28,6,6,20, -+ 6,6,2,1,6,5,23,22,22,6, -+ 30,22,2,1,2,24,1,2,2,1, -+ 1,6,19,8,6,6,6,6,2,22, -+ 22,22,1,2,1,6,29,2,6,6, -+ 6,22,22,22,11,1,6,27,7,7, -+ 11,25,13,13,9,1,21,2,18,18, -+ 1,3,1,6,6, -+}; -+static int type_s2i(const char *s, int *value) { -+ return s2i__(type_strings, type_s2i_s, type_s2i_i, 85, s, value); -+} -diff --git a/auparse/umounttabs.h b/auparse/umounttabs.h -new file mode 100644 -index 0000000..e98118f ---- /dev/null -+++ b/auparse/umounttabs.h -@@ -0,0 +1,6 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char umount_strings[] = "MNT_DETACH\0MNT_EXPIRE\0MNT_FORCE\0UMOUNT_NOFOLLOW\0UMOUNT_UNUSED"; -+static const struct transtab umount_table[] = { -+ {1,22},{2,0},{4,11},{8,32},{-2147483647,48}, -+}; -+#define UMOUNT_NUM_ENTRIES (sizeof(umount_table) / sizeof(*umount_table)) -diff --git a/lib/Makefile.am b/lib/Makefile.am -index 5e9f966..5a7d12b 100644 ---- a/lib/Makefile.am -+++ b/lib/Makefile.am -@@ -50,109 +50,3 @@ endif - if USE_AARCH64 - BUILT_SOURCES += aarch64_tables.h - endif --noinst_PROGRAMS = gen_actiontabs_h gen_errtabs_h gen_fieldtabs_h \ -- gen_flagtabs_h gen_ftypetabs_h gen_i386_tables_h \ -- gen_ia64_tables_h gen_machinetabs_h gen_msg_typetabs_h \ -- gen_optabs_h gen_ppc_tables_h gen_s390_tables_h \ -- gen_s390x_tables_h gen_x86_64_tables_h --if USE_ALPHA --noinst_PROGRAMS += gen_alpha_tables_h --endif --if USE_ARMEB --noinst_PROGRAMS += gen_armeb_tables_h --endif --if USE_AARCH64 --noinst_PROGRAMS += gen_aarch64_tables_h --endif --gen_actiontabs_h_SOURCES = gen_tables.c gen_tables.h actiontab.h --gen_actiontabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="actiontab.h"' --actiontabs.h: gen_actiontabs_h Makefile -- ./gen_actiontabs_h --lowercase --i2s --s2i action > $@ -- --if USE_ALPHA --gen_alpha_tables_h_SOURCES = gen_tables.c gen_tables.h alpha_table.h --gen_alpha_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="alpha_table.h"' --alpha_tables.h: gen_alpha_tables_h Makefile -- ./gen_alpha_tables_h --lowercase --i2s --s2i alpha_syscall > $@ --endif -- --if USE_ARMEB --gen_armeb_tables_h_SOURCES = gen_tables.c gen_tables.h armeb_table.h --gen_armeb_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="armeb_table.h"' --armeb_tables.h: gen_armeb_tables_h Makefile -- ./gen_armeb_tables_h --lowercase --i2s --s2i armeb_syscall > $@ --endif -- --if USE_AARCH64 --gen_aarch64_tables_h_SOURCES = gen_tables.c gen_tables.h aarch64_table.h --gen_aarch64_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="aarch64_table.h"' --aarch64_tables.h: gen_aarch64_tables_h Makefile -- ./gen_aarch64_tables_h --lowercase --i2s --s2i aarch64_syscall > $@ --endif -- --gen_errtabs_h_SOURCES = gen_tables.c gen_tables.h errtab.h --gen_errtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="errtab.h"' --errtabs.h: gen_errtabs_h Makefile -- ./gen_errtabs_h --duplicate-ints --uppercase --i2s --s2i err > $@ -- --gen_fieldtabs_h_SOURCES = gen_tables.c gen_tables.h fieldtab.h --gen_fieldtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="fieldtab.h"' --fieldtabs.h: gen_fieldtabs_h Makefile -- ./gen_fieldtabs_h --duplicate-ints --lowercase --i2s --s2i field > $@ -- --gen_flagtabs_h_SOURCES = gen_tables.c gen_tables.h flagtab.h --gen_flagtabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="flagtab.h"' --flagtabs.h: gen_flagtabs_h Makefile -- ./gen_flagtabs_h --lowercase --i2s --s2i flag > $@ -- --gen_ftypetabs_h_SOURCES = gen_tables.c gen_tables.h ftypetab.h --gen_ftypetabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="ftypetab.h"' --ftypetabs.h: gen_ftypetabs_h Makefile -- ./gen_ftypetabs_h --lowercase --i2s --s2i ftype > $@ -- --gen_i386_tables_h_SOURCES = gen_tables.c gen_tables.h i386_table.h --gen_i386_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="i386_table.h"' --i386_tables.h: gen_i386_tables_h Makefile -- ./gen_i386_tables_h --duplicate-ints --lowercase --i2s --s2i \ -- i386_syscall > $@ -- --gen_ia64_tables_h_SOURCES = gen_tables.c gen_tables.h ia64_table.h --gen_ia64_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="ia64_table.h"' --ia64_tables.h: gen_ia64_tables_h Makefile -- ./gen_ia64_tables_h --lowercase --i2s --s2i ia64_syscall > $@ -- --gen_machinetabs_h_SOURCES = gen_tables.c gen_tables.h machinetab.h --gen_machinetabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="machinetab.h"' --machinetabs.h: gen_machinetabs_h Makefile -- ./gen_machinetabs_h --duplicate-ints --lowercase --i2s --s2i machine \ -- > $@ -- --gen_msg_typetabs_h_SOURCES = gen_tables.c gen_tables.h msg_typetab.h --gen_msg_typetabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="msg_typetab.h"' --msg_typetabs.h: gen_msg_typetabs_h Makefile -- ./gen_msg_typetabs_h --uppercase --i2s --s2i msg_type > $@ -- --gen_optabs_h_SOURCES = gen_tables.c gen_tables.h optab.h --gen_optabs_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="optab.h"' --optabs.h: gen_optabs_h Makefile -- ./gen_optabs_h --i2s op > $@ -- --gen_ppc_tables_h_SOURCES = gen_tables.c gen_tables.h ppc_table.h --gen_ppc_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="ppc_table.h"' --ppc_tables.h: gen_ppc_tables_h Makefile -- ./gen_ppc_tables_h --lowercase --i2s --s2i ppc_syscall > $@ -- --gen_s390_tables_h_SOURCES = gen_tables.c gen_tables.h s390_table.h --gen_s390_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="s390_table.h"' --s390_tables.h: gen_s390_tables_h Makefile -- ./gen_s390_tables_h --lowercase --i2s --s2i s390_syscall > $@ -- --gen_s390x_tables_h_SOURCES = gen_tables.c gen_tables.h s390x_table.h --gen_s390x_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="s390x_table.h"' --s390x_tables.h: gen_s390x_tables_h Makefile -- ./gen_s390x_tables_h --lowercase --i2s --s2i s390x_syscall > $@ -- --gen_x86_64_tables_h_SOURCES = gen_tables.c gen_tables.h x86_64_table.h --gen_x86_64_tables_h_CFLAGS = $(AM_CFLAGS) '-DTABLE_H="x86_64_table.h"' --x86_64_tables.h: gen_x86_64_tables_h Makefile -- ./gen_x86_64_tables_h --lowercase --i2s --s2i x86_64_syscall > $@ -diff --git a/lib/aarch64_tables.h b/lib/aarch64_tables.h -new file mode 100644 -index 0000000..571d6ee ---- /dev/null -+++ b/lib/aarch64_tables.h -@@ -0,0 +1,125 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char aarch64_syscall_strings[] = "accept\0accept4\0acct\0add_key\0adjtimex\0bind\0brk\0capget\0capset\0chdir\0" -+ "chroot\0clock_adjtime\0clock_getres\0clock_gettime\0clock_nanosleep\0clock_settime\0clone\0close\0connect\0delete_module\0" -+ "dup\0dup3\0epoll_create1\0epoll_ctl\0epoll_pwait\0eventfd2\0execve\0exit\0exit_group\0faccessat\0" -+ "fallocate\0fanotify_init\0fanotify_mark\0fchdir\0fchmod\0fchmodat\0fchown\0fchownat\0fdatasync\0fgetxattr\0" -+ "finit_module\0flistxattr\0flock\0fremovexattr\0fsetxattr\0fsync\0futex\0get_mempolicy\0get_robust_list\0getcpu\0" -+ "getcwd\0getdents64\0getegid\0geteuid\0getgid\0getgroups\0getitimer\0getpeername\0getpgid\0getpid\0" -+ "getppid\0getpriority\0getresgid\0getresuid\0getrlimit\0getrusage\0getsid\0getsockname\0getsockopt\0gettid\0" -+ "gettimeofday\0getuid\0getxattr\0init_module\0inotify_add_watch\0inotify_init1\0inotify_rm_watch\0io_cancel\0io_destroy\0io_getevents\0" -+ "io_setup\0io_submit\0ioctl\0ioprio_get\0ioprio_set\0kcmp\0kexec_load\0keyctl\0kill\0lgetxattr\0" -+ "linkat\0listen\0listxattr\0llistxattr\0lookup_dcookie\0lremovexattr\0lsetxattr\0madvise\0mbind\0migrate_pages\0" -+ "mincore\0mkdirat\0mknodat\0mlock\0mlockall\0mount\0move_pages\0mprotect\0mq_getsetattr\0mq_notify\0" -+ "mq_open\0mq_timedreceive\0mq_timedsend\0mq_unlink\0mremap\0msgctl\0msgget\0msgrcv\0msgsnd\0msync\0" -+ "munlock\0munlockall\0munmap\0name_to_handle_at\0nanosleep\0nfsservctl\0open_by_handle_at\0openat\0perf_event_open\0personality\0" -+ "pipe2\0pivot_root\0ppoll\0prctl\0pread64\0preadv\0prlimit64\0process_vm_readv\0process_vm_writev\0pselect6\0" -+ "ptrace\0pwrite64\0pwritev\0quotactl\0read\0readahead\0readlinkat\0readv\0reboot\0recvfrom\0" -+ "recvmmsg\0recvmsg\0remap_file_pages\0removexattr\0renameat\0request_key\0restart_syscall\0rt_sigaction\0rt_sigpending\0rt_sigprocmask\0" -+ "rt_sigqueueinfo\0rt_sigreturn\0rt_sigsuspend\0rt_sigtimedwait\0rt_tgsigqueueinfo\0sched_get_priority_max\0sched_get_priority_min\0sched_getaffinity\0sched_getparam\0sched_getscheduler\0" -+ "sched_rr_get_interval\0sched_setaffinity\0sched_setparam\0sched_setscheduler\0sched_yield\0semctl\0semget\0semop\0semtimedop\0sendmmsg\0" -+ "sendmsg\0sendto\0set_mempolicy\0set_robust_list\0set_tid_address\0setdomainname\0setfsgid\0setfsuid\0setgid\0setgroups\0" -+ "sethostname\0setitimer\0setns\0setpgid\0setpriority\0setregid\0setresgid\0setresuid\0setreuid\0setrlimit\0" -+ "setsid\0setsockopt\0settimeofday\0setuid\0setxattr\0shmat\0shmctl\0shmdt\0shmget\0shutdown\0" -+ "sigaltstack\0signalfd4\0socket\0socketpair\0splice\0swapoff\0swapon\0symlinkat\0sync\0sync_file_range\0" -+ "syncfs\0sysinfo\0syslog\0tee\0tgkill\0timer_create\0timer_delete\0timer_getoverrun\0timer_gettime\0timer_settime\0" -+ "timerfd_create\0timerfd_gettime\0timerfd_settime\0times\0tkill\0umask\0umount2\0uname\0unlinkat\0unshare\0" -+ "utimensat\0vhangup\0vmsplice\0wait4\0waitid\0write\0writev"; -+static const unsigned aarch64_syscall_s2i_s[] = { -+ 0,7,15,20,28,37,42,46,53,60, -+ 66,73,87,100,114,130,144,150,156,164, -+ 178,182,187,201,211,223,232,239,244,255, -+ 265,275,289,303,310,317,326,333,342,352, -+ 362,375,386,392,405,415,421,427,441,457, -+ 464,471,482,490,498,505,515,525,537,545, -+ 552,560,572,582,592,602,612,619,631,642, -+ 649,662,669,678,690,708,722,739,749,760, -+ 773,782,792,798,809,820,825,836,843,848, -+ 858,865,872,882,893,908,921,931,939,945, -+ 959,967,975,983,989,998,1004,1015,1024,1038, -+ 1048,1056,1072,1085,1095,1102,1109,1116,1123,1130, -+ 1136,1144,1155,1162,1180,1190,1201,1219,1226,1242, -+ 1254,1260,1271,1277,1283,1291,1298,1308,1325,1343, -+ 1352,1359,1368,1376,1385,1390,1400,1411,1417,1424, -+ 1433,1442,1450,1467,1479,1488,1500,1516,1529,1543, -+ 1558,1574,1587,1601,1617,1635,1658,1681,1699,1714, -+ 1733,1755,1773,1788,1807,1819,1826,1833,1839,1850, -+ 1859,1867,1874,1888,1904,1920,1934,1943,1952,1959, -+ 1969,1981,1991,1997,2005,2017,2026,2036,2046,2055, -+ 2065,2072,2083,2096,2103,2112,2118,2125,2131,2138, -+ 2147,2159,2169,2176,2187,2194,2202,2209,2219,2224, -+ 2240,2247,2255,2262,2266,2273,2286,2299,2316,2330, -+ 2344,2359,2375,2391,2397,2403,2409,2417,2423,2432, -+ 2440,2450,2458,2467,2473,2480,2486, -+}; -+static const int aarch64_syscall_s2i_i[] = { -+ 202,242,89,217,171,200,214,90,91,49, -+ 51,266,114,113,115,112,220,57,203,106, -+ 23,24,20,21,22,19,221,93,94,48, -+ 47,262,263,50,52,53,55,54,83,10, -+ 273,13,32,16,7,82,98,236,100,168, -+ 17,61,177,175,176,158,102,205,155,172, -+ 173,141,150,148,163,165,156,204,209,178, -+ 169,174,8,105,27,26,28,3,1,4, -+ 0,2,29,31,30,272,104,219,129,9, -+ 37,201,11,12,18,15,6,233,235,238, -+ 232,34,33,228,230,40,239,226,185,184, -+ 180,183,182,181,216,187,186,188,189,227, -+ 229,231,215,264,101,42,265,56,241,92, -+ 59,41,73,167,67,69,261,270,271,72, -+ 117,68,70,60,63,213,78,65,142,207, -+ 243,212,234,14,38,218,128,134,136,135, -+ 138,139,133,137,240,125,126,123,121,120, -+ 127,122,118,119,124,191,190,193,192,269, -+ 211,206,237,99,96,162,152,151,144,159, -+ 161,103,268,154,140,143,149,147,145,164, -+ 157,208,170,146,5,196,195,197,194,210, -+ 132,74,198,199,76,225,224,36,81,84, -+ 267,179,116,77,131,107,111,109,108,110, -+ 85,87,86,153,130,166,39,160,35,97, -+ 88,58,75,260,95,64,66, -+}; -+static int aarch64_syscall_s2i(const char *s, int *value) { -+ size_t len, i; -+ len = strlen(s); -+ { char copy[len + 1]; -+ for (i = 0; i < len; i++) { -+ char c = s[i]; -+ copy[i] = GT_ISUPPER(c) ? c - 'A' + 'a' : c; -+ } -+ copy[i] = 0; -+ return s2i__(aarch64_syscall_strings, aarch64_syscall_s2i_s, aarch64_syscall_s2i_i, 247, copy, value); -+ } -+} -+static const unsigned aarch64_syscall_i2s_direct[] = { -+ 773,749,782,739,760,2103,921,405,669,848, -+ 352,872,882,375,1467,908,392,464,893,223, -+ 187,201,211,178,182,-1u,708,690,722,792, -+ 809,798,386,975,967,2423,2209,858,1479,2409, -+ 998,1260,1190,-1u,-1u,-1u,-1u,265,255,60, -+ 303,66,310,317,333,326,1219,150,2450,1254, -+ 1376,471,-1u,1385,2480,1411,2486,1283,1359,1291, -+ 1368,-1u,1343,1271,2159,2458,2187,2262,1400,-1u, -+ -1u,2219,415,342,2224,2344,2375,2359,2440,15, -+ 46,53,1242,239,244,2473,1904,2432,421,1888, -+ 441,1180,515,1981,825,678,164,2273,2316,2299, -+ 2330,2286,130,100,87,114,2255,1352,1773,1788, -+ 1714,1699,1755,1681,1807,1635,1658,1733,1500,843, -+ 2397,2266,2147,1587,1516,1543,1529,1601,1558,1574, -+ 2005,560,1417,2017,1952,2046,2096,2036,582,2026, -+ 572,1943,1934,2391,1997,537,612,2065,505,1959, -+ 2417,1969,1920,592,2055,602,2403,1277,457,649, -+ 2083,28,545,552,662,490,498,482,642,2247, -+ 1048,1085,1072,1056,1038,1024,1109,1102,1116,1123, -+ 1826,1819,1839,1833,2131,2118,2112,2125,2169,2176, -+ 37,865,0,156,619,525,1867,1424,2072,631, -+ 2138,1859,1442,1390,42,1155,1095,20,1488,836, -+ 144,232,-1u,-1u,2202,2194,1015,1130,983,1136, -+ 989,1144,959,931,1450,939,427,1874,945,1004, -+ 1617,1226,7,1433,-1u,-1u,-1u,-1u,-1u,-1u, -+ -1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u, -+ 2467,1298,275,289,1162,1201,73,2240,1991,1850, -+ 1308,1325,820,362, -+}; -+static const char *aarch64_syscall_i2s(int v) { -+ return i2s_direct__(aarch64_syscall_strings, aarch64_syscall_i2s_direct, 0, 273, v); -+} -diff --git a/lib/actiontabs.h b/lib/actiontabs.h -new file mode 100644 -index 0000000..a7a9e62 ---- /dev/null -+++ b/lib/actiontabs.h -@@ -0,0 +1,26 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char action_strings[] = "always\0never\0possible"; -+static const unsigned action_s2i_s[] = { -+ 0,7,13, -+}; -+static const int action_s2i_i[] = { -+ 2,0,1, -+}; -+static int action_s2i(const char *s, int *value) { -+ size_t len, i; -+ len = strlen(s); -+ { char copy[len + 1]; -+ for (i = 0; i < len; i++) { -+ char c = s[i]; -+ copy[i] = GT_ISUPPER(c) ? c - 'A' + 'a' : c; -+ } -+ copy[i] = 0; -+ return s2i__(action_strings, action_s2i_s, action_s2i_i, 3, copy, value); -+ } -+} -+static const unsigned action_i2s_direct[] = { -+ 7,13,0, -+}; -+static const char *action_i2s(int v) { -+ return i2s_direct__(action_strings, action_i2s_direct, 0, 2, v); -+} -diff --git a/lib/alpha_tables.h b/lib/alpha_tables.h -new file mode 100644 -index 0000000..b57e54c ---- /dev/null -+++ b/lib/alpha_tables.h -@@ -0,0 +1,196 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char alpha_syscall_strings[] = "_sysctl\0accept\0accept4\0access\0acct\0add_key\0adjtimex\0afs_syscall\0bdflush\0bind\0" -+ "brk\0capget\0capset\0chdir\0chmod\0chown\0chroot\0clock_adjtime\0clone\0close\0" -+ "connect\0create_module\0delete_module\0dipc\0dup\0dup2\0dup3\0epoll_create\0epoll_create1\0epoll_ctl\0" -+ "epoll_pwait\0epoll_wait\0eventfd\0eventfd2\0exec_with_loader\0execve\0exit\0exit_group\0faccessat\0fadvise64\0" -+ "fallocate\0fanotify_init\0fanotify_mark\0fchdir\0fchmod\0fchmodat\0fchown\0fchownat\0fcntl\0fdatasync\0" -+ "fgetxattr\0flistxattr\0flock\0fork\0fremovexattr\0fsetxattr\0fstat\0fstat64\0fstatat64\0fstatfs\0" -+ "fsync\0ftruncate\0futex\0futimesat\0get_kernel_syms\0get_mempolicy\0get_robust_list\0getcpu\0getcwd\0getdents\0" -+ "getdents64\0getdtablesize\0getgroups\0gethostname\0getitimer\0getpagesize\0getpeername\0getpgid\0getpgrp\0getpriority\0" -+ "getresgid\0getresuid\0getrlimit\0getrusage\0getsid\0getsockname\0getsockopt\0gettid\0gettimeofday\0getxattr\0" -+ "getxgid\0getxpid\0getxuid\0init_module\0inotify_add_watch\0inotify_init\0inotify_init1\0inotify_rm_watch\0io_cancel\0io_destroy\0" -+ "io_getevents\0io_setup\0io_submit\0ioctl\0ioprio_get\0ioprio_set\0kexec_load\0keyctl\0kill\0lchown\0" -+ "lgetxattr\0link\0linkat\0listen\0listxattr\0llistxattr\0lookup_dcookie\0lremovexattr\0lseek\0lsetxattr\0" -+ "lstat\0lstat64\0madvise\0mbind\0migrate_pages\0mincore\0mkdir\0mkdirat\0mknod\0mknodat\0" -+ "mlock\0mlockall\0mmap\0mount\0move_pages\0mprotect\0mq_getsetattr\0mq_notify\0mq_open\0mq_timedreceive\0" -+ "mq_timedsend\0mq_unlink\0mremap\0msgctl\0msgget\0msgrcv\0msgsnd\0msync\0munlock\0munlockall\0" -+ "munmap\0name_to_handle_at\0nanosleep\0nfsservctl\0old_adjtimex\0oldumount\0open\0open_by_handle_at\0openat\0osf_adjtime\0" -+ "osf_afs_syscall\0osf_alt_plock\0osf_alt_setsid\0osf_alt_sigpending\0osf_asynch_daemon\0osf_audcntl\0osf_audgen\0osf_chflags\0osf_execve\0osf_exportfs\0" -+ "osf_fchflags\0osf_fdatasync\0osf_fpathconf\0osf_fstatfs\0osf_fuser\0osf_getaddressconf\0osf_getdirentries\0osf_getdomainname\0osf_getfh\0osf_getfsstat\0" -+ "osf_gethostid\0osf_getitimer\0osf_getlogin\0osf_getmnt\0osf_getrusage\0osf_getsysinfo\0osf_gettimeofday\0osf_kloadcall\0osf_kmodcall\0osf_memcntl\0" -+ "osf_mincore\0osf_mount\0osf_mremap\0osf_msfs_syscall\0osf_msleep\0osf_mvalid\0osf_mwakeup\0osf_naccept\0osf_nfssvc\0osf_ngetpeername\0" -+ "osf_ngetsockname\0osf_nrecvfrom\0osf_nrecvmsg\0osf_nsendmsg\0osf_ntp_adjtime\0osf_ntp_gettime\0osf_old_creat\0osf_old_fstat\0osf_old_getpgrp\0osf_old_killpg\0" -+ "osf_old_lstat\0osf_old_open\0osf_old_sigaction\0osf_old_sigblock\0osf_old_sigreturn\0osf_old_sigsetmask\0osf_old_sigvec\0osf_old_stat\0osf_old_vadvise\0osf_old_vtrace\0" -+ "osf_old_wait\0osf_oldquota\0osf_pathconf\0osf_pid_block\0osf_pid_unblock\0osf_plock\0osf_priocntlset\0osf_profil\0osf_proplist_syscall\0osf_reboot\0" -+ "osf_revoke\0osf_sbrk\0osf_security\0osf_select\0osf_set_program_attributes\0osf_set_speculative\0osf_sethostid\0osf_setitimer\0osf_setlogin\0osf_setsysinfo\0" -+ "osf_settimeofday\0osf_shmat\0osf_signal\0osf_sigprocmask\0osf_sigsendset\0osf_sigstack\0osf_sigwaitprim\0osf_sstk\0osf_statfs\0osf_subsys_info\0" -+ "osf_swapctl\0osf_swapon\0osf_syscall\0osf_sysinfo\0osf_table\0osf_uadmin\0osf_usleep_thread\0osf_uswitch\0osf_utc_adjtime\0osf_utc_gettime\0" -+ "osf_utimes\0osf_utsname\0osf_wait4\0osf_waitid\0pciconfig_iobase\0pciconfig_read\0pciconfig_write\0perf_event_open\0personality\0pipe\0" -+ "pipe2\0pivot_root\0poll\0ppoll\0prctl\0pread\0preadv\0prlimit64\0process_vm_readv\0process_vm_writev\0" -+ "pselect6\0ptrace\0pwrite\0pwritev\0query_module\0quotactl\0read\0readahead\0readlink\0readlinkat\0" -+ "readv\0reboot\0recv\0recvfrom\0recvmmsg\0recvmsg\0remap_file_pages\0removexattr\0rename\0renameat\0" -+ "request_key\0restart_syscall\0rmdir\0rt_sigaction\0rt_sigpending\0rt_sigprocmask\0rt_sigqueueinfo\0rt_sigreturn\0rt_sigsuspend\0rt_sigtimedwait\0" -+ "rt_tgsigqueueinfo\0sched_get_priority_max\0sched_get_priority_min\0sched_getaffinity\0sched_getparam\0sched_getscheduler\0sched_rr_get_interval\0sched_setaffinity\0sched_setparam\0sched_setscheduler\0" -+ "sched_yield\0select\0semctl\0semget\0semop\0send\0sendfile\0sendmmsg\0sendmsg\0sendto\0" -+ "set_mempolicy\0set_robust_list\0set_tid_address\0setdomainname\0setfsgid\0setfsuid\0setgid\0setgroups\0sethae\0sethostname\0" -+ "setitimer\0setns\0setpgid\0setpgrp\0setpriority\0setregid\0setresgid\0setresuid\0setreuid\0setrlimit\0" -+ "setsid\0setsockopt\0settimeofday\0setuid\0setxattr\0shmctl\0shmdt\0shmget\0shutdown\0sigaction\0" -+ "sigaltstack\0signalfd\0signalfd4\0sigpending\0sigreturn\0sigsuspend\0socket\0socketpair\0splice\0stat\0" -+ "stat64\0statfs\0swapoff\0swapon\0symlink\0symlinkat\0sync\0sync_file_range\0syncfs\0sysfs\0" -+ "sysinfo\0syslog\0tee\0tgkill\0timerfd\0timerfd_create\0timerfd_gettime\0timerfd_settime\0times\0tkill\0" -+ "truncate\0tuxcall\0umask\0umount\0uname\0unlink\0unlinkat\0unshare\0uselib\0ustat\0" -+ "utimensat\0utimes\0vfork\0vhangup\0vmsplice\0vserver\0wait4\0waitid\0write\0writev"; -+static const unsigned alpha_syscall_s2i_s[] = { -+ 0,8,15,23,30,35,43,52,64,72, -+ 77,81,88,95,101,107,113,120,134,140, -+ 146,154,168,182,187,191,196,201,214,228, -+ 238,250,261,269,278,295,302,307,318,328, -+ 338,348,362,376,383,390,399,406,415,421, -+ 431,441,452,458,463,476,486,492,500,510, -+ 518,524,534,540,550,566,580,596,603,610, -+ 619,630,644,654,666,676,688,700,708,716, -+ 728,738,748,758,768,775,787,798,805,818, -+ 827,835,843,851,863,881,894,908,925,935, -+ 946,959,968,978,984,995,1006,1017,1024,1029, -+ 1036,1046,1051,1058,1065,1075,1086,1101,1114,1120, -+ 1130,1136,1144,1152,1158,1172,1180,1186,1194,1200, -+ 1208,1214,1223,1228,1234,1245,1254,1268,1278,1286, -+ 1302,1315,1325,1332,1339,1346,1353,1360,1366,1374, -+ 1385,1392,1410,1420,1431,1444,1454,1459,1477,1484, -+ 1496,1512,1526,1541,1560,1578,1590,1601,1613,1624, -+ 1637,1650,1664,1678,1690,1700,1719,1737,1755,1765, -+ 1779,1793,1807,1820,1831,1845,1860,1877,1891,1904, -+ 1916,1928,1938,1949,1966,1977,1988,2000,2012,2023, -+ 2040,2057,2071,2084,2097,2113,2129,2143,2157,2173, -+ 2188,2202,2215,2233,2250,2268,2287,2302,2315,2331, -+ 2346,2359,2372,2385,2399,2415,2425,2441,2452,2473, -+ 2484,2495,2504,2517,2528,2555,2575,2589,2603,2616, -+ 2631,2648,2658,2669,2685,2700,2713,2729,2738,2749, -+ 2765,2777,2788,2800,2812,2822,2833,2851,2863,2879, -+ 2895,2906,2918,2928,2939,2956,2971,2987,3003,3015, -+ 3020,3026,3037,3042,3048,3054,3060,3067,3077,3094, -+ 3112,3121,3128,3135,3143,3156,3165,3170,3180,3189, -+ 3200,3206,3213,3218,3227,3236,3244,3261,3273,3280, -+ 3289,3301,3317,3323,3336,3350,3365,3381,3394,3408, -+ 3424,3442,3465,3488,3506,3521,3540,3562,3580,3595, -+ 3614,3626,3633,3640,3647,3653,3658,3667,3676,3684, -+ 3691,3705,3721,3737,3751,3760,3769,3776,3786,3793, -+ 3805,3815,3821,3829,3837,3849,3858,3868,3878,3887, -+ 3897,3904,3915,3928,3935,3944,3951,3957,3964,3973, -+ 3983,3995,4004,4014,4025,4035,4046,4053,4064,4071, -+ 4076,4083,4090,4098,4105,4113,4123,4128,4144,4151, -+ 4157,4165,4172,4176,4183,4191,4206,4222,4238,4244, -+ 4250,4259,4267,4273,4280,4286,4293,4302,4310,4317, -+ 4323,4333,4340,4346,4354,4363,4371,4377,4384,4390, -+}; -+static const int alpha_syscall_s2i_i[] = { -+ 319,99,502,33,51,439,366,338,300,104, -+ 17,368,369,12,15,16,61,499,312,6, -+ 98,306,308,373,41,90,487,407,486,408, -+ 474,409,478,485,25,59,1,405,462,413, -+ 480,494,495,13,124,461,123,453,92,447, -+ 387,390,131,2,393,384,91,427,455,329, -+ 95,130,394,454,309,430,467,473,367,305, -+ 377,89,79,87,361,64,141,233,63,100, -+ 372,344,144,364,234,150,118,378,359,385, -+ 47,20,24,307,445,444,489,446,402,399, -+ 400,398,401,54,443,442,448,441,37,208, -+ 386,9,458,106,388,389,406,392,19,383, -+ 68,426,75,429,449,375,136,451,14,452, -+ 314,316,71,302,472,74,437,436,432,435, -+ 434,433,341,200,201,202,203,217,315,317, -+ 73,497,340,342,303,321,45,498,450,140, -+ 258,181,188,187,163,252,253,34,11,169, -+ 35,261,248,161,243,214,159,165,164,18, -+ 142,86,49,184,117,256,116,223,77,260, -+ 78,21,65,240,215,213,216,30,158,31, -+ 32,29,27,28,245,246,8,62,81,146, -+ 40,5,46,109,139,110,108,38,72,115, -+ 84,149,247,153,154,107,237,44,244,55, -+ 56,69,222,93,43,239,143,83,50,257, -+ 122,209,218,48,238,112,157,70,160,255, -+ 259,199,0,241,85,242,251,250,220,219, -+ 138,207,7,236,376,345,346,493,324,42, -+ 488,374,94,464,348,349,490,496,504,505, -+ 463,26,350,491,347,148,3,379,58,460, -+ 120,311,102,125,479,113,410,391,128,457, -+ 440,412,137,352,354,353,356,351,357,355, -+ 492,335,336,396,331,333,337,395,330,332, -+ 334,358,204,205,206,101,370,503,114,133, -+ 431,466,411,166,326,325,132,80,301,88, -+ 362,501,39,82,96,127,371,343,126,145, -+ 147,105,360,23,382,210,211,212,134,156, -+ 235,476,484,52,103,111,97,135,468,67, -+ 425,328,304,322,57,459,36,469,500,254, -+ 318,310,470,424,477,481,483,482,323,381, -+ 129,397,60,22,339,10,456,465,313,327, -+ 475,363,66,76,471,428,365,438,4,121, -+}; -+static int alpha_syscall_s2i(const char *s, int *value) { -+ size_t len, i; -+ len = strlen(s); -+ { char copy[len + 1]; -+ for (i = 0; i < len; i++) { -+ char c = s[i]; -+ copy[i] = GT_ISUPPER(c) ? c - 'A' + 'a' : c; -+ } -+ copy[i] = 0; -+ return s2i__(alpha_syscall_strings, alpha_syscall_s2i_s, alpha_syscall_s2i_i, 410, copy, value); -+ } -+} -+static const unsigned alpha_syscall_i2s_direct[] = { -+ 2788,302,458,3165,4384,2202,140,2918,2129,1046, -+ 4286,1613,95,376,1194,101,107,77,1765,1114, -+ 835,1928,4273,3928,843,278,3121,2071,2084,2057, -+ 2000,2023,2040,23,1601,1637,4123,1024,2302,3821, -+ 2188,187,3015,2528,2441,1454,2215,827,2669,1807, -+ 2603,30,4014,-1u,978,2473,2484,4105,3180,295, -+ 4267,113,2143,708,676,1938,4340,4071,1130,2495, -+ 2729,1223,2315,1385,1245,1144,4346,1891,1916,644, -+ 3776,2157,3829,2589,2346,2812,1793,654,3793,630, -+ 191,486,415,2517,3037,518,3837,4046,146,8, -+ 716,3653,3213,4025,72,3904,1058,2415,2287,2233, -+ 2268,4035,2700,3236,3676,2331,1860,1831,787,-1u, -+ 3200,4390,2631,399,383,3218,3878,3849,3273,4250, -+ 524,452,3769,3684,3964,4053,1180,3317,2895,2250, -+ 1484,688,1779,2575,748,3887,2173,3897,3156,2359, -+ 775,-1u,-1u,2385,2399,-1u,3973,2713,2012,1719, -+ 2738,1678,-1u,1560,1755,1737,3737,-1u,-1u,1624, -+ -1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u, -+ -1u,1512,-1u,-1u,1820,-1u,-1u,1541,1526,-1u, -+ -1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u,2777, -+ 1332,1339,1346,1353,3633,3640,3647,2906,1029,2648, -+ 3944,3951,3957,1977,1700,1966,1988,1360,2658,2879, -+ 2863,-1u,2504,1877,-1u,-1u,-1u,-1u,-1u,-1u, -+ -1u,-1u,-1u,700,768,3983,2928,2425,2685,2555, -+ 1949,2800,2822,1690,2452,2097,2113,2372,1664,-1u, -+ 2851,2833,1578,1590,4151,2749,1845,2616,1496,2765, -+ 1904,1650,-1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u, -+ -1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u, -+ -1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u, -+ -1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u,-1u, -+ 64,3786,1228,1431,4090,610,154,851,168,550, -+ 4165,3206,134,4310,1208,1366,1214,1374,4157,0, -+ -1u,1444,4098,4238,3003,3760,3751,4317,4083,510, -+ 3580,3506,3595,3521,3614,3442,3465,3540,52,4280, -+ 1410,1325,1420,3868,738,2956,2971,3143,3048,3054, -+ 3128,3381,3323,3350,3336,3408,3365,3394,3626,805, -+ 3915,666,3805,4333,758,4371,43,603,81,88, -+ 3658,3858,728,182,3026,1172,2939,619,798,3170, -+ -1u,4244,3935,1120,476,818,1036,431,1065,1075, -+ 441,3261,1101,463,534,3562,3488,4259,959,935, -+ 946,968,925,-1u,-1u,307,1086,201,228,250, -+ 3244,3721,3301,328,-1u,-1u,-1u,-1u,-1u,-1u, -+ -1u,-1u,-1u,-1u,4176,4076,1136,492,4363,1152, -+ 566,3691,1278,1315,1302,1286,1268,1254,4377,35, -+ 3289,1017,995,984,881,863,908,421,1006,1158, -+ 1477,1186,1200,406,540,500,4293,3280,1051,4113, -+ 3189,390,318,3112,3042,4302,3705,580,4064,4128, -+ 4172,4354,1234,596,238,4323,3995,4183,261,3227, -+ 338,4191,4222,4206,4004,269,214,196,3020,894, -+ 3060,3135,3424,2987,348,362,3067,1392,1459,120, -+ 4144,3815,15,3667,3077,3094, -+}; -+static const char *alpha_syscall_i2s(int v) { -+ return i2s_direct__(alpha_syscall_strings, alpha_syscall_i2s_direct, 0, 505, v); -+} -diff --git a/lib/armeb_tables.h b/lib/armeb_tables.h -new file mode 100644 -index 0000000..dd2bf5f ---- /dev/null -+++ b/lib/armeb_tables.h -@@ -0,0 +1,165 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char armeb_syscall_strings[] = "accept\0accept4\0access\0acct\0add_key\0adjtimex\0alarm\0bdflush\0bind\0brk\0" -+ "capget\0capset\0chdir\0chmod\0chown\0chown32\0chroot\0clock_adjtime\0clock_getres\0clock_gettime\0" -+ "clock_nanosleep\0clock_settime\0clone\0close\0connect\0creat\0delete_module\0dup\0dup2\0dup3\0" -+ "epoll_create\0epoll_create1\0epoll_ctl\0epoll_wait\0eventfd\0eventfd2\0execve\0exit\0exit_group\0faccessat\0" -+ "fadvise64_64\0fallocate\0fanotify_init\0fanotify_mark\0fchdir\0fchmod\0fchmodat\0fchown\0fchown32\0fchownat\0" -+ "fcntl\0fcntl64\0fdatasync\0fgetxattr\0finit_module\0flistxattr\0flock\0fork\0fremovexattr\0fsetxattr\0" -+ "fstat\0fstat64\0fstatat64\0fstatfs\0fstatfs64\0fsync\0ftruncate\0ftruncate64\0futex\0futimesat\0" -+ "get_mempolicy\0get_robust_list\0getcpu\0getcwd\0getdents\0getdents64\0getegid\0getegid32\0geteuid\0geteuid32\0" -+ "getgid\0getgid32\0getgroups\0getgroups32\0getitimer\0getpeername\0getpgid\0getpgrp\0getpid\0getppid\0" -+ "getpriority\0getresgid\0getresgid32\0getresuid\0getresuid32\0getrlimit\0getrusage\0getsid\0getsockname\0getsockopt\0" -+ "gettid\0gettimeofday\0getuid\0getuid32\0getxattr\0init_module\0inotify_add_watch\0inotify_init\0inotify_init1\0inotify_rm_watch\0" -+ "io_cancel\0io_destroy\0io_getevents\0io_setup\0io_submit\0ioctl\0ioprio_get\0ioprio_set\0ipc\0kcmp\0" -+ "kexec_load\0keyctl\0kill\0lchown\0lchown32\0lgetxattr\0link\0linkat\0listen\0listxattr\0" -+ "llistxattr\0llseek\0lookup_dcookie\0lremovexattr\0lseek\0lsetxattr\0lstat\0lstat64\0madvise\0mbind\0" -+ "mincore\0mkdir\0mkdirat\0mknod\0mknodat\0mlock\0mlockall\0mmap\0mmap2\0mount\0" -+ "move_pages\0mprotect\0mq_getsetattr\0mq_notify\0mq_open\0mq_timedreceive\0mq_timedsend\0mq_unlink\0mremap\0msgctl\0" -+ "msgget\0msgrcv\0msgsnd\0msync\0munlock\0munlockall\0munmap\0name_to_handle_at\0nanosleep\0newselect\0" -+ "nfsservctl\0nice\0open\0open_by_handle_at\0openat\0pause\0pciconfig_iobase\0pciconfig_read\0pciconfig_write\0perf_event_open\0" -+ "personality\0pipe\0pipe2\0pivot_root\0poll\0prctl\0pread64\0preadv\0prlimit64\0process_vm_readv\0" -+ "process_vm_writev\0ptrace\0pwrite64\0pwritev\0quotactl\0read\0readahead\0readdir\0readlink\0readlinkat\0" -+ "readv\0reboot\0recv\0recvfrom\0recvmmsg\0recvmsg\0remap_file_pages\0removexattr\0rename\0renameat\0" -+ "request_key\0restart_syscall\0rmdir\0rt_sigaction\0rt_sigpending\0rt_sigprocmask\0rt_sigqueueinfo\0rt_sigreturn\0rt_sigsuspend\0rt_sigtimedwait\0" -+ "rt_tgsigqueueinfo\0sched_get_priority_max\0sched_get_priority_min\0sched_getaffinity\0sched_getparam\0sched_getscheduler\0sched_rr_get_interval\0sched_setaffinity\0sched_setparam\0sched_setscheduler\0" -+ "sched_yield\0select\0semctl\0semget\0semop\0semtimedop\0send\0sendfile\0sendfile64\0sendmmsg\0" -+ "sendmsg\0sendto\0set_mempolicy\0set_robust_list\0set_tid_address\0setdomainname\0setfsgid\0setfsgid32\0setfsuid\0setfsuid32\0" -+ "setgid\0setgid32\0setgroups\0setgroups32\0sethostname\0setitimer\0setns\0setpgid\0setpriority\0setregid\0" -+ "setregid32\0setresgid\0setresgid32\0setresuid\0setresuid32\0setreuid\0setreuid32\0setrlimit\0setsid\0setsockopt\0" -+ "settimeofday\0setuid\0setuid32\0setxattr\0shmat\0shmctl\0shmdt\0shmget\0shutdown\0sigaction\0" -+ "sigaltstack\0signalfd\0signalfd4\0sigpending\0sigprocmask\0sigreturn\0sigsuspend\0socket\0socketcall\0socketpair\0" -+ "splice\0stat\0stat64\0statfs\0statfs64\0stime\0swapoff\0swapon\0symlink\0symlinkat\0" -+ "sync\0sync_file_range\0syncfs\0syscall\0sysctl\0sysfs\0sysinfo\0syslog\0tee\0tgkill\0" -+ "time\0timer_create\0timer_delete\0timer_getoverrun\0timer_gettime\0timer_settime\0timerfd_create\0timerfd_gettime\0timerfd_settime\0times\0" -+ "tkill\0truncate\0truncate64\0ugetrlimit\0umask\0umount\0umount2\0uname\0unlink\0unlinkat\0" -+ "unshare\0uselib\0ustat\0utime\0utimensat\0utimes\0vfork\0vhangup\0vmsplice\0vserver\0" -+ "wait4\0waitid\0write\0writev"; -+static const unsigned armeb_syscall_s2i_s[] = { -+ 0,7,15,22,27,35,44,50,58,63, -+ 67,74,81,87,93,99,107,114,128,141, -+ 155,171,185,191,197,205,211,225,229,234, -+ 239,252,266,276,287,295,304,311,316,327, -+ 337,350,360,374,388,395,402,411,418,427, -+ 436,442,450,460,470,483,494,500,505,518, -+ 528,534,542,552,560,570,576,586,598,604, -+ 614,628,644,651,658,667,678,686,696,704, -+ 714,721,730,740,752,762,774,782,790,797, -+ 805,817,827,839,849,861,871,881,888,900, -+ 911,918,931,938,947,956,968,986,999,1013, -+ 1030,1040,1051,1064,1073,1083,1089,1100,1111,1115, -+ 1120,1131,1138,1143,1150,1159,1169,1174,1181,1188, -+ 1198,1209,1216,1231,1244,1250,1260,1266,1274,1282, -+ 1288,1296,1302,1310,1316,1324,1330,1339,1344,1350, -+ 1356,1367,1376,1390,1400,1408,1424,1437,1447,1454, -+ 1461,1468,1475,1482,1488,1496,1507,1514,1532,1542, -+ 1552,1563,1568,1573,1591,1598,1604,1621,1636,1652, -+ 1668,1680,1685,1691,1702,1707,1713,1721,1728,1738, -+ 1755,1773,1780,1789,1797,1806,1811,1821,1829,1838, -+ 1849,1855,1862,1867,1876,1885,1893,1910,1922,1929, -+ 1938,1950,1966,1972,1985,1999,2014,2030,2043,2057, -+ 2073,2091,2114,2137,2155,2170,2189,2211,2229,2244, -+ 2263,2275,2282,2289,2296,2302,2313,2318,2327,2338, -+ 2347,2355,2362,2376,2392,2408,2422,2431,2442,2451, -+ 2462,2469,2478,2488,2500,2512,2522,2528,2536,2548, -+ 2557,2568,2578,2590,2600,2612,2621,2632,2642,2649, -+ 2660,2673,2680,2689,2698,2704,2711,2717,2724,2733, -+ 2743,2755,2764,2774,2785,2797,2807,2818,2825,2836, -+ 2847,2854,2859,2866,2873,2882,2888,2896,2903,2911, -+ 2921,2926,2942,2949,2957,2964,2970,2978,2985,2989, -+ 2996,3001,3014,3027,3044,3058,3072,3087,3103,3119, -+ 3125,3131,3140,3151,3162,3168,3175,3183,3189,3196, -+ 3205,3213,3220,3226,3232,3242,3249,3255,3263,3272, -+ 3280,3286,3293,3299, -+}; -+static const int armeb_syscall_s2i_i[] = { -+ 285,366,33,51,309,124,27,134,282,45, -+ 184,185,12,15,182,212,61,372,264,263, -+ 265,262,120,6,283,8,129,41,63,358, -+ 250,357,251,252,351,356,11,1,248,334, -+ 270,352,367,368,133,94,333,95,207,325, -+ 55,221,148,231,379,234,143,2,237,228, -+ 108,197,327,100,267,118,93,194,240,326, -+ 320,339,345,183,141,217,50,202,49,201, -+ 47,200,80,205,105,287,132,65,20,64, -+ 96,171,211,165,209,76,77,147,286,295, -+ 224,78,24,199,229,128,317,316,360,318, -+ 247,244,245,243,246,54,315,314,117,378, -+ 347,311,37,16,198,230,9,330,284,232, -+ 233,140,249,236,19,227,107,196,220,319, -+ 219,39,323,14,324,150,152,90,192,21, -+ 344,125,279,278,274,277,276,275,163,304, -+ 303,302,301,144,151,153,91,370,162,142, -+ 169,34,5,371,322,29,271,272,273,364, -+ 136,42,359,218,168,172,180,361,369,376, -+ 377,26,181,362,131,3,225,89,85,332, -+ 145,88,291,292,365,297,253,235,38,329, -+ 310,0,40,174,176,175,178,173,179,177, -+ 363,159,160,242,155,157,161,241,154,156, -+ 158,82,300,299,298,312,289,187,239,374, -+ 296,290,321,338,256,121,139,216,138,215, -+ 46,214,81,206,74,104,375,57,97,71, -+ 204,170,210,164,208,70,203,75,66,294, -+ 79,23,213,226,305,308,306,307,293,67, -+ 186,349,355,73,126,119,72,281,102,288, -+ 340,106,195,99,266,25,115,87,83,331, -+ 36,341,373,113,149,135,116,103,342,268, -+ 13,257,261,260,259,258,350,354,353,43, -+ 238,92,193,191,60,22,52,122,10,328, -+ 337,86,62,30,348,269,190,111,343,313, -+ 114,280,4,146, -+}; -+static int armeb_syscall_s2i(const char *s, int *value) { -+ size_t len, i; -+ len = strlen(s); -+ { char copy[len + 1]; -+ for (i = 0; i < len; i++) { -+ char c = s[i]; -+ copy[i] = GT_ISUPPER(c) ? c - 'A' + 'a' : c; -+ } -+ copy[i] = 0; -+ return s2i__(armeb_syscall_strings, armeb_syscall_s2i_s, armeb_syscall_s2i_i, 344, copy, value); -+ } -+} -+static const unsigned armeb_syscall_i2s_direct[] = { -+ 1950,311,500,1806,3293,1568,191,-1u,205,1169, -+ 3189,304,81,2996,1310,87,1143,-1u,-1u,1244, -+ 790,1350,3168,2673,931,2882,1773,44,-1u,1598, -+ 3226,-1u,-1u,15,1563,-1u,2921,1138,1922,1296, -+ 1966,225,1680,3119,-1u,63,2462,714,-1u,696, -+ 678,22,3175,-1u,1083,436,-1u,2528,-1u,-1u, -+ 3162,107,3220,229,797,782,2642,2733,-1u,-1u, -+ 2612,2548,2807,2774,2500,2632,861,871,918,2660, -+ 730,2478,2275,2903,-1u,1829,3213,2896,1855,1821, -+ 1339,1507,3131,576,395,411,805,2536,-1u,2866, -+ 552,-1u,2825,2978,2512,752,2854,1260,528,-1u, -+ -1u,3255,-1u,2949,3280,2888,2970,1111,570,2797, -+ 185,2408,3183,-1u,35,1367,2785,-1u,956,211, -+ -1u,1797,774,388,50,2964,1668,-1u,2442,2422, -+ 1209,658,1542,494,1482,1849,3299,881,450,2957, -+ 1324,1488,1330,1496,2229,2155,2244,2170,2263,2091, -+ 2114,2189,1532,1447,2590,839,-1u,-1u,1702,1552, -+ 2568,817,1707,2030,1972,1999,1985,2057,2014,2043, -+ 1713,1780,93,651,67,74,2743,2318,-1u,-1u, -+ 3249,3151,1344,3140,586,2859,1266,534,1150,938, -+ 721,704,686,2621,2557,740,2488,418,2600,849, -+ 2578,827,99,2680,2469,2451,2431,667,1691,1288, -+ 1274,442,-1u,-1u,911,1811,2689,1250,518,947, -+ 1159,460,1188,1198,483,1910,1231,505,3125,2327, -+ 598,2211,2137,1064,1040,1051,1073,1030,316,1216, -+ 239,266,276,1893,-1u,-1u,2392,3001,3058,3044, -+ 3027,3014,171,141,128,155,2873,560,2989,3242, -+ 337,1604,1621,1636,1400,1437,1424,1408,1390,1376, -+ 3286,2818,58,197,1181,0,888,762,2836,2313, -+ 2355,1862,1867,2724,2649,900,2347,1885,2296,2289, -+ 2282,1475,1468,1461,1454,2698,2711,2717,2704,27, -+ 1938,1131,2302,3272,1100,1089,986,968,1013,1282, -+ 614,2362,1591,1302,1316,427,604,542,3196,1929, -+ 1174,2911,1838,402,327,-1u,-1u,3205,2376,628, -+ 2847,2926,2985,3263,1356,644,-1u,1120,3232,2755, -+ 3072,287,350,3103,3087,2764,295,252,234,1685, -+ 999,1721,1789,2073,1652,1876,7,360,374,1728, -+ 1514,1573,114,2942,2338,2522,1738,1755,1115,470, -+}; -+static const char *armeb_syscall_i2s(int v) { -+ return i2s_direct__(armeb_syscall_strings, armeb_syscall_i2s_direct, 0, 379, v); -+} -diff --git a/lib/errtabs.h b/lib/errtabs.h -new file mode 100644 -index 0000000..53deac2 ---- /dev/null -+++ b/lib/errtabs.h -@@ -0,0 +1,78 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char err_strings[] = "E2BIG\0EACCES\0EADDRINUSE\0EADDRNOTAVAIL\0EADV\0EAFNOSUPPORT\0EAGAIN\0EALREADY\0EBADE\0EBADF\0" -+ "EBADFD\0EBADMSG\0EBADR\0EBADRQC\0EBADSLT\0EBFONT\0EBUSY\0ECANCELED\0ECHILD\0ECHRNG\0" -+ "ECOMM\0ECONNABORTED\0ECONNREFUSED\0ECONNRESET\0EDEADLK\0EDEADLOCK\0EDESTADDRREQ\0EDOM\0EDOTDOT\0EDQUOT\0" -+ "EEXIST\0EFAULT\0EFBIG\0EHOSTDOWN\0EHOSTUNREACH\0EIDRM\0EILSEQ\0EINPROGRESS\0EINTR\0EINVAL\0" -+ "EIO\0EISCONN\0EISDIR\0EISNAM\0EKEYEXPIRED\0EKEYREJECTED\0EKEYREVOKED\0EL2HLT\0EL2NSYNC\0EL3HLT\0" -+ "EL3RST\0ELIBACC\0ELIBBAD\0ELIBEXEC\0ELIBMAX\0ELIBSCN\0ELNRNG\0ELOOP\0EMEDIUMTYPE\0EMFILE\0" -+ "EMLINK\0EMSGSIZE\0EMULTIHOP\0ENAMETOOLONG\0ENAVAIL\0ENETDOWN\0ENETRESET\0ENETUNREACH\0ENFILE\0ENOANO\0" -+ "ENOBUFS\0ENOCSI\0ENODATA\0ENODEV\0ENOENT\0ENOEXEC\0ENOKEY\0ENOLCK\0ENOLINK\0ENOMEDIUM\0" -+ "ENOMEM\0ENOMSG\0ENONET\0ENOPKG\0ENOPROTOOPT\0ENOSPC\0ENOSR\0ENOSTR\0ENOSYS\0ENOTBLK\0" -+ "ENOTCONN\0ENOTDIR\0ENOTEMPTY\0ENOTNAM\0ENOTRECOVERABLE\0ENOTSOCK\0ENOTTY\0ENOTUNIQ\0ENXIO\0EOPNOTSUPP\0" -+ "EOVERFLOW\0EOWNERDEAD\0EPERM\0EPFNOSUPPORT\0EPIPE\0EPROTO\0EPROTONOSUPPORT\0EPROTOTYPE\0ERANGE\0EREMCHG\0" -+ "EREMOTE\0EREMOTEIO\0ERESTART\0EROFS\0ESHUTDOWN\0ESOCKTNOSUPPORT\0ESPIPE\0ESRCH\0ESRMNT\0ESTALE\0" -+ "ESTRPIPE\0ETIME\0ETIMEDOUT\0ETOOMANYREFS\0ETXTBSY\0EUCLEAN\0EUNATCH\0EUSERS\0EWOULDBLOCK\0EXDEV\0" -+ "EXFULL"; -+static const unsigned err_s2i_s[] = { -+ 0,6,13,24,38,43,56,63,72,78, -+ 84,91,99,105,113,121,128,134,144,151, -+ 158,164,177,190,201,209,219,232,237,245, -+ 252,259,266,272,282,295,301,308,320,326, -+ 333,337,345,352,359,371,384,396,403,412, -+ 419,426,434,442,451,459,467,474,480,492, -+ 499,506,515,525,538,546,555,565,577,584, -+ 591,599,606,614,621,628,636,643,650,658, -+ 668,675,682,689,696,708,715,721,728,735, -+ 743,752,760,770,778,794,803,810,819,825, -+ 836,846,857,863,876,882,889,905,916,923, -+ 931,939,949,958,964,974,990,997,1003,1010, -+ 1017,1026,1032,1042,1055,1063,1071,1079,1086,1098, -+ 1104, -+}; -+static const int err_s2i_i[] = { -+ 7,13,98,99,68,97,11,114,52,9, -+ 77,74,53,56,57,59,16,125,10,44, -+ 70,103,111,104,35,35,89,33,73,122, -+ 17,14,27,112,113,43,84,115,4,22, -+ 5,106,21,120,127,129,128,51,45,46, -+ 47,79,80,83,82,81,48,40,124,24, -+ 31,90,72,36,119,100,102,101,23,55, -+ 105,50,61,19,2,8,126,37,67,123, -+ 12,42,64,65,92,28,63,60,38,15, -+ 107,20,39,118,131,88,25,76,6,95, -+ 75,130,1,96,32,71,93,91,34,78, -+ 66,121,85,30,108,94,29,3,69,116, -+ 86,62,110,109,26,117,49,87,11,18, -+ 54, -+}; -+static int err_s2i(const char *s, int *value) { -+ size_t len, i; -+ len = strlen(s); -+ { char copy[len + 1]; -+ for (i = 0; i < len; i++) { -+ char c = s[i]; -+ copy[i] = GT_ISLOWER(c) ? c - 'a' + 'A' : c; -+ } -+ copy[i] = 0; -+ return s2i__(err_strings, err_s2i_s, err_s2i_i, 131, copy, value); -+ } -+} -+static const unsigned err_i2s_direct[] = { -+ 857,621,997,320,333,819,0,628,78,144, -+ 56,668,6,259,735,128,252,1098,614,752, -+ 345,326,577,492,803,1055,266,708,990,958, -+ 499,876,232,916,201,525,643,728,760,474, -+ -1u,675,295,151,403,412,419,467,1071,599, -+ 396,72,99,1104,584,105,113,-1u,121,721, -+ 606,1026,715,682,689,931,650,38,1003,158, -+ 882,515,237,91,836,810,84,923,426,434, -+ 459,451,442,301,949,1017,1079,794,219,506, -+ 905,696,889,974,825,863,43,13,24,546, -+ 565,555,164,190,591,337,743,964,1042,1032, -+ 177,272,282,63,308,1010,1063,770,538,352, -+ 939,245,658,480,134,636,359,384,371,846, -+ 778, -+}; -+static const char *err_i2s(int v) { -+ return i2s_direct__(err_strings, err_i2s_direct, 1, 131, v); -+} -diff --git a/lib/fieldtabs.h b/lib/fieldtabs.h -new file mode 100644 -index 0000000..fb50e08 ---- /dev/null -+++ b/lib/fieldtabs.h -@@ -0,0 +1,49 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char field_strings[] = "a0\0a1\0a2\0a3\0arch\0auid\0devmajor\0devminor\0dir\0egid\0" -+ "euid\0exit\0field_compare\0filetype\0fsgid\0fsuid\0gid\0inode\0key\0loginuid\0" -+ "msgtype\0obj_gid\0obj_lev_high\0obj_lev_low\0obj_role\0obj_type\0obj_uid\0obj_user\0path\0perm\0" -+ "pers\0pid\0ppid\0sgid\0subj_clr\0subj_role\0subj_sen\0subj_type\0subj_user\0success\0" -+ "suid\0uid"; -+static const unsigned field_s2i_s[] = { -+ 0,3,6,9,12,17,22,31,40,44, -+ 49,54,59,73,82,88,94,98,104,108, -+ 117,125,133,146,158,167,176,184,193,198, -+ 203,208,212,217,222,231,241,250,260,270, -+ 278,283, -+}; -+static const int field_s2i_i[] = { -+ 200,201,202,203,11,9,100,101,107,6, -+ 2,103,111,108,8,4,5,102,210,9, -+ 12,110,23,22,20,21,109,19,105,106, -+ 10,0,18,7,17,14,16,15,13,104, -+ 3,1, -+}; -+static int field_s2i(const char *s, int *value) { -+ size_t len, i; -+ len = strlen(s); -+ { char copy[len + 1]; -+ for (i = 0; i < len; i++) { -+ char c = s[i]; -+ copy[i] = GT_ISUPPER(c) ? c - 'A' + 'a' : c; -+ } -+ copy[i] = 0; -+ return s2i__(field_strings, field_s2i_s, field_s2i_i, 42, copy, value); -+ } -+} -+static const int field_i2s_i[] = { -+ 0,1,2,3,4,5,6,7,8,9, -+ 10,11,12,13,14,15,16,17,18,19, -+ 20,21,22,23,100,101,102,103,104,105, -+ 106,107,108,109,110,111,200,201,202,203, -+ 210, -+}; -+static const unsigned field_i2s_s[] = { -+ 208,283,49,278,88,94,44,217,82,17, -+ 203,12,117,260,231,250,241,222,212,184, -+ 158,167,146,133,22,31,98,54,270,193, -+ 198,40,73,176,125,59,0,3,6,9, -+ 104, -+}; -+static const char *field_i2s(int v) { -+ return i2s_bsearch__(field_strings, field_i2s_i, field_i2s_s, 41, v); -+} -diff --git a/lib/flagtabs.h b/lib/flagtabs.h -new file mode 100644 -index 0000000..e191db3 ---- /dev/null -+++ b/lib/flagtabs.h -@@ -0,0 +1,26 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char flag_strings[] = "entry\0exclude\0exit\0task\0user"; -+static const unsigned flag_s2i_s[] = { -+ 0,6,14,19,24, -+}; -+static const int flag_s2i_i[] = { -+ 2,5,4,1,0, -+}; -+static int flag_s2i(const char *s, int *value) { -+ size_t len, i; -+ len = strlen(s); -+ { char copy[len + 1]; -+ for (i = 0; i < len; i++) { -+ char c = s[i]; -+ copy[i] = GT_ISUPPER(c) ? c - 'A' + 'a' : c; -+ } -+ copy[i] = 0; -+ return s2i__(flag_strings, flag_s2i_s, flag_s2i_i, 5, copy, value); -+ } -+} -+static const unsigned flag_i2s_direct[] = { -+ 24,19,0,-1u,14,6, -+}; -+static const char *flag_i2s(int v) { -+ return i2s_direct__(flag_strings, flag_i2s_direct, 0, 5, v); -+} -diff --git a/lib/ftypetabs.h b/lib/ftypetabs.h -new file mode 100644 -index 0000000..04aaa46 ---- /dev/null -+++ b/lib/ftypetabs.h -@@ -0,0 +1,29 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char ftype_strings[] = "block\0character\0dir\0fifo\0file\0link\0socket"; -+static const unsigned ftype_s2i_s[] = { -+ 0,6,16,20,25,30,35, -+}; -+static const int ftype_s2i_i[] = { -+ 24576,8192,16384,4096,32768,40960,49152, -+}; -+static int ftype_s2i(const char *s, int *value) { -+ size_t len, i; -+ len = strlen(s); -+ { char copy[len + 1]; -+ for (i = 0; i < len; i++) { -+ char c = s[i]; -+ copy[i] = GT_ISUPPER(c) ? c - 'A' + 'a' : c; -+ } -+ copy[i] = 0; -+ return s2i__(ftype_strings, ftype_s2i_s, ftype_s2i_i, 7, copy, value); -+ } -+} -+static const int ftype_i2s_i[] = { -+ 4096,8192,16384,24576,32768,40960,49152, -+}; -+static const unsigned ftype_i2s_s[] = { -+ 20,6,16,0,25,30,35, -+}; -+static const char *ftype_i2s(int v) { -+ return i2s_bsearch__(ftype_strings, ftype_i2s_i, ftype_i2s_s, 7, v); -+} -diff --git a/lib/i386_tables.h b/lib/i386_tables.h -new file mode 100644 -index 0000000..6703ffc ---- /dev/null -+++ b/lib/i386_tables.h -@@ -0,0 +1,163 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char i386_syscall_strings[] = "_llseek\0_newselect\0_sysctl\0access\0acct\0add_key\0adjtimex\0afs_syscall\0alarm\0bdflush\0" -+ "break\0brk\0capget\0capset\0chdir\0chmod\0chown\0chown32\0chroot\0clock_adjtime\0" -+ "clock_getres\0clock_gettime\0clock_nanosleep\0clock_settime\0clone\0close\0creat\0create_module\0delete_module\0dup\0" -+ "dup2\0dup3\0epoll_create\0epoll_create1\0epoll_ctl\0epoll_pwait\0epoll_wait\0eventfd\0eventfd2\0execve\0" -+ "exit\0exit_group\0faccessat\0fadvise64\0fadvise64_64\0fallocate\0fanotify_init\0fanotify_mark\0fchdir\0fchmod\0" -+ "fchmodat\0fchown\0fchown32\0fchownat\0fcntl\0fcntl64\0fdatasync\0fgetxattr\0finit_module\0flistxattr\0" -+ "flock\0fork\0fremovexattr\0fsetxattr\0fstat\0fstat64\0fstatat64\0fstatfs\0fstatfs64\0fsync\0" -+ "ftime\0ftruncate\0ftruncate64\0futex\0futimesat\0get_kernel_syms\0get_mempolicy\0get_robust_list\0get_thread_area\0getcpu\0" -+ "getcwd\0getdents\0getdents64\0getegid\0getegid32\0geteuid\0geteuid32\0getgid\0getgid32\0getgroups\0" -+ "getgroups32\0getitimer\0getpgid\0getpgrp\0getpid\0getpmsg\0getppid\0getpriority\0getresgid\0getresgid32\0" -+ "getresuid\0getresuid32\0getrlimit\0getrusage\0getsid\0gettid\0gettimeofday\0getuid\0getuid32\0getxattr\0" -+ "gtty\0idle\0init_module\0inotify_add_watch\0inotify_init\0inotify_init1\0inotify_rm_watch\0io_cancel\0io_destroy\0io_getevents\0" -+ "io_setup\0io_submit\0ioctl\0ioperm\0iopl\0ioprio_get\0ioprio_set\0ipc\0kcmp\0keyctl\0" -+ "kill\0lchown\0lchown32\0lgetxattr\0link\0linkat\0listxattr\0llistxattr\0lock\0lookup_dcookie\0" -+ "lremovexattr\0lseek\0lsetxattr\0lstat\0lstat64\0madvise\0madvise1\0mbind\0migrate_pages\0mincore\0" -+ "mkdir\0mkdirat\0mknod\0mknodat\0mlock\0mlockall\0mmap\0mmap2\0modify_ldt\0mount\0" -+ "move_pages\0mprotect\0mpx\0mq_getsetattr\0mq_notify\0mq_open\0mq_timedreceive\0mq_timedsend\0mq_unlink\0mremap\0" -+ "msync\0munlock\0munlockall\0munmap\0name_to_handle_at\0nanosleep\0nfsservctl\0nice\0oldfstat\0oldlstat\0" -+ "oldolduname\0oldstat\0olduname\0open\0open_by_handle_at\0openat\0pause\0perf_event_open\0personality\0pipe\0" -+ "pipe2\0pivot_root\0poll\0ppoll\0prctl\0pread64\0preadv\0prlimit64\0process_vm_readv\0process_vm_writev\0" -+ "prof\0profil\0pselect6\0ptrace\0putpmsg\0pwrite64\0pwritev\0query_module\0quotactl\0read\0" -+ "readahead\0readdir\0readlink\0readlinkat\0readv\0reboot\0recvmmsg\0remap_file_pages\0removexattr\0rename\0" -+ "renameat\0request_key\0restart_syscall\0rmdir\0rt_sigaction\0rt_sigpending\0rt_sigprocmask\0rt_sigqueueinfo\0rt_sigreturn\0rt_sigsuspend\0" -+ "rt_sigtimedwait\0rt_tgsigqueueinfo\0sched_get_priority_max\0sched_get_priority_min\0sched_getaffinity\0sched_getparam\0sched_getscheduler\0sched_rr_get_interval\0sched_setaffinity\0sched_setparam\0" -+ "sched_setscheduler\0sched_yield\0select\0sendfile\0sendfile64\0sendmmsg\0set_mempolicy\0set_robust_list\0set_thread_area\0set_tid_address\0" -+ "setdomainname\0setfsgid\0setfsgid32\0setfsuid\0setfsuid32\0setgid\0setgid32\0setgroups\0setgroups32\0sethostname\0" -+ "setitimer\0setns\0setpgid\0setpriority\0setregid\0setregid32\0setresgid\0setresgid32\0setresuid\0setresuid32\0" -+ "setreuid\0setreuid32\0setrlimit\0setsid\0settimeofday\0setuid\0setuid32\0setxattr\0sgetmask\0sigaction\0" -+ "sigaltstack\0signal\0signalfd\0signalfd4\0sigpending\0sigprocmask\0sigreturn\0sigsuspend\0socketcall\0splice\0" -+ "ssetmask\0stat\0stat64\0statfs\0statfs64\0stime\0stty\0swapoff\0swapon\0symlink\0" -+ "symlinkat\0sync\0sync_file_range\0syncfs\0sys_kexec_load\0sysfs\0sysinfo\0syslog\0tee\0tgkill\0" -+ "time\0timer_create\0timer_delete\0timer_getoverrun\0timer_gettime\0timer_settime\0timerfd\0timerfd_gettime\0timerfd_settime\0times\0" -+ "tkill\0truncate\0truncate64\0ugetrlimit\0ulimit\0umask\0umount\0umount2\0uname\0unlink\0" -+ "unlinkat\0unshare\0uselib\0ustat\0utime\0utimensat\0utimes\0vfork\0vhangup\0vm86\0" -+ "vm86old\0vmsplice\0vserver\0wait4\0waitid\0waitpid\0write\0writev"; -+static const unsigned i386_syscall_s2i_s[] = { -+ 0,8,19,27,34,39,47,56,68,74, -+ 82,88,92,99,106,112,118,124,132,139, -+ 153,166,180,196,210,216,222,228,242,256, -+ 260,265,270,283,297,307,319,330,338,347, -+ 354,359,370,380,390,403,413,427,441,448, -+ 455,464,471,480,489,495,503,513,523,536, -+ 547,553,558,571,581,587,595,605,613,623, -+ 629,635,645,657,663,673,689,703,719,735, -+ 742,749,758,769,777,787,795,805,812,821, -+ 831,843,853,861,869,876,884,892,904,914, -+ 926,936,948,958,968,975,982,995,1002,1011, -+ 1020,1025,1030,1042,1060,1073,1087,1104,1114,1125, -+ 1138,1147,1157,1163,1170,1175,1186,1197,1201,1206, -+ 1213,1218,1225,1234,1244,1249,1256,1266,1277,1282, -+ 1297,1310,1316,1326,1332,1340,1348,1357,1363,1377, -+ 1385,1391,1399,1405,1413,1419,1428,1433,1439,1450, -+ 1456,1467,1476,1480,1494,1504,1512,1528,1541,1551, -+ 1558,1564,1572,1583,1590,1608,1618,1629,1634,1643, -+ 1652,1664,1672,1681,1686,1704,1711,1717,1733,1745, -+ 1750,1756,1767,1772,1778,1784,1792,1799,1809,1826, -+ 1844,1849,1856,1865,1872,1880,1889,1897,1910,1919, -+ 1924,1934,1942,1951,1962,1968,1975,1984,2001,2013, -+ 2020,2029,2041,2057,2063,2076,2090,2105,2121,2134, -+ 2148,2164,2182,2205,2228,2246,2261,2280,2302,2320, -+ 2335,2354,2366,2373,2382,2393,2402,2416,2432,2448, -+ 2464,2478,2487,2498,2507,2518,2525,2534,2544,2556, -+ 2568,2578,2584,2592,2604,2613,2624,2634,2646,2656, -+ 2668,2677,2688,2698,2705,2718,2725,2734,2743,2752, -+ 2762,2774,2781,2790,2800,2811,2823,2833,2844,2855, -+ 2862,2871,2876,2883,2890,2899,2905,2910,2918,2925, -+ 2933,2943,2948,2964,2971,2986,2992,3000,3007,3011, -+ 3018,3023,3036,3049,3066,3080,3094,3102,3118,3134, -+ 3140,3146,3155,3166,3177,3184,3190,3197,3205,3211, -+ 3218,3227,3235,3242,3248,3254,3264,3271,3277,3285, -+ 3290,3298,3307,3315,3321,3328,3336,3342, -+}; -+static const int i386_syscall_s2i_i[] = { -+ 140,142,149,33,51,286,124,137,27,134, -+ 17,45,184,185,12,15,182,212,61,343, -+ 266,265,267,264,120,6,8,127,129,41, -+ 63,330,254,329,255,319,256,323,328,11, -+ 1,252,307,250,272,324,338,339,133,94, -+ 306,95,207,298,55,221,148,231,350,234, -+ 143,2,237,228,108,197,300,100,269,118, -+ 35,93,194,240,299,130,275,312,244,318, -+ 183,141,220,50,202,49,201,47,200,80, -+ 205,105,132,65,20,188,64,96,171,211, -+ 165,209,76,77,147,224,78,24,199,229, -+ 32,112,128,292,291,332,293,249,246,247, -+ 245,248,54,101,110,290,289,117,349,288, -+ 37,16,198,230,9,303,232,233,53,253, -+ 236,19,227,107,196,219,219,274,294,218, -+ 39,296,14,297,150,152,90,192,123,21, -+ 317,125,56,282,281,277,280,279,278,163, -+ 144,151,153,91,341,162,169,34,28,84, -+ 59,18,109,5,342,295,29,336,136,42, -+ 331,217,168,309,172,180,333,340,347,348, -+ 44,98,308,26,189,181,334,167,131,3, -+ 225,89,85,305,145,88,337,257,235,38, -+ 302,287,0,40,174,176,175,178,173,179, -+ 177,335,159,160,242,155,157,161,241,154, -+ 156,158,82,187,239,345,276,311,243,258, -+ 121,139,216,138,215,46,214,81,206,74, -+ 104,346,57,97,71,204,170,210,164,208, -+ 70,203,75,66,79,23,213,226,68,67, -+ 186,48,321,327,73,126,119,72,102,313, -+ 69,106,195,99,268,25,31,115,87,83, -+ 304,36,314,344,283,135,116,103,315,270, -+ 13,259,263,262,261,260,322,326,325,43, -+ 238,92,193,191,58,60,22,52,122,10, -+ 301,310,86,62,30,320,271,190,111,166, -+ 113,316,273,114,284,7,4,146, -+}; -+static int i386_syscall_s2i(const char *s, int *value) { -+ size_t len, i; -+ len = strlen(s); -+ { char copy[len + 1]; -+ for (i = 0; i < len; i++) { -+ char c = s[i]; -+ copy[i] = GT_ISUPPER(c) ? c - 'A' + 'a' : c; -+ } -+ copy[i] = 0; -+ return s2i__(i386_syscall_strings, i386_syscall_s2i_s, i386_syscall_s2i_i, 348, copy, value); -+ } -+} -+static const unsigned i386_syscall_i2s_direct[] = { -+ 2041,354,553,1919,3336,1681,216,3328,222,1244, -+ 3211,347,106,3018,1399,112,1218,82,1664,1310, -+ 869,1450,3190,2718,995,2899,1865,68,1634,1711, -+ 3248,2905,1020,27,1629,629,2943,1213,2013,1385, -+ 2057,256,1745,3134,1844,88,2518,805,2774,787, -+ 769,34,3197,1277,1157,489,1476,2584,3177,1652, -+ 3184,132,3242,260,884,861,2698,2752,2743,2862, -+ 2668,2604,2833,2800,2556,2688,948,958,982,2705, -+ 821,2534,2366,2925,1643,1942,3235,2918,1968,1934, -+ 1428,1583,3146,635,448,464,892,2592,1849,2883, -+ 605,1163,2844,3000,2568,843,2871,1326,581,1672, -+ 1170,3277,1025,3290,3315,2910,2992,1197,623,2823, -+ 210,2464,3205,1439,47,1467,2811,228,1030,242, -+ 673,1910,853,441,74,2986,1733,56,2498,2478, -+ 0,749,8,547,1558,1962,3342,968,503,19, -+ 1413,1564,1419,1572,2320,2246,2335,2261,2354,2182, -+ 2205,2280,1608,1551,2646,926,3285,1897,1767,1618, -+ 2624,904,1778,2121,2063,2090,2076,2148,2105,2134, -+ 1784,1880,118,742,92,99,2762,2373,876,1872, -+ 3271,3166,1433,3155,645,2876,1332,587,1225,1002, -+ 812,795,777,2677,2613,831,2544,471,2656,936, -+ 2634,914,124,2725,2525,2507,2487,1756,1377,1340, -+ 758,495,-1u,-1u,975,1924,2734,1316,571,1011, -+ 1234,513,1256,1266,536,2001,1297,558,3140,2382, -+ 657,2302,2228,2432,719,1138,1114,1125,1147,1104, -+ 380,-1u,359,1282,270,297,319,1984,2448,3023, -+ 3080,3066,3049,3036,196,166,153,180,2890,613, -+ 3011,3264,390,3307,1357,689,2402,1504,1541,1528, -+ 1512,1494,1480,2971,3321,-1u,39,2029,1206,1186, -+ 1175,1060,1042,1087,1363,1704,1391,1405,480,663, -+ 595,3218,2020,1249,2933,1951,455,370,1856,1772, -+ 3227,2416,703,2855,2948,3007,3298,1456,735,307, -+ 3254,2781,3094,330,403,3118,3102,2790,338,283, -+ 265,1750,1073,1792,1889,2164,1717,1975,413,427, -+ 1799,1590,1686,139,2964,2393,2578,1809,1826,1201, -+ 523, -+}; -+static const char *i386_syscall_i2s(int v) { -+ return i2s_direct__(i386_syscall_strings, i386_syscall_i2s_direct, 0, 350, v); -+} -diff --git a/lib/ia64_tables.h b/lib/ia64_tables.h -new file mode 100644 -index 0000000..9e127a0 ---- /dev/null -+++ b/lib/ia64_tables.h -@@ -0,0 +1,147 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char ia64_syscall_strings[] = "_sysctl\0accept\0accept4\0access\0acct\0add_key\0adjtimex\0afs_syscall\0bdflush\0bind\0" -+ "brk\0capget\0capset\0chdir\0chmod\0chown\0chroot\0clock_adjtime\0clock_getres\0clock_gettime\0" -+ "clock_nanosleep\0clock_settime\0clone\0clone2\0close\0connect\0creat\0delete_module\0dup\0dup2\0" -+ "dup3\0epoll_create\0epoll_create1\0epoll_ctl\0epoll_pwait\0epoll_wait\0eventfd\0eventfd2\0execve\0exit\0" -+ "exit_group\0faccessat\0fadvise64\0fallocate\0fanotify_init\0fanotify_mark\0fchdir\0fchmod\0fchmodat\0fchown\0" -+ "fchownat\0fcntl\0fdatasync\0fgetxattr\0finit_module\0flistxattr\0flock\0fremovexattr\0fsetxattr\0fstat\0" -+ "fstatfs\0fstatfs64\0fsync\0ftruncate\0futex\0futimesat\0get_mempolicy\0get_robust_list\0getcpu\0getcwd\0" -+ "getdents\0getdents64\0getegid\0geteuid\0getgid\0getgroups\0getitimer\0getpeername\0getpgid\0getpid\0" -+ "getpmsg\0getppid\0getpriority\0getresgid\0getresuid\0getrlimit\0getrusage\0getsid\0getsockname\0getsockopt\0" -+ "gettid\0gettimeofday\0getuid\0getunwind\0getxattr\0init_module\0inotify_add_watch\0inotify_init\0inotify_init1\0inotify_rm_watch\0" -+ "io_cancel\0io_destroy\0io_getevents\0io_setup\0io_submit\0ioctl\0ioprio_get\0ioprio_set\0kexec_load\0keyctl\0" -+ "kill\0lchown\0lgetxattr\0link\0linkat\0listen\0listxattr\0llistxattr\0lookup_dcookie\0lremovexattr\0" -+ "lseek\0lsetxattr\0lstat\0madvise\0mbind\0migrate_pages\0mincore\0mkdir\0mkdirat\0mknod\0" -+ "mknodat\0mlock\0mlockall\0mmap\0mmap2\0mount\0mprotect\0mq_getsetattr\0mq_notify\0mq_open\0" -+ "mq_timedreceive\0mq_timedsend\0mq_unlink\0mremap\0msgctl\0msgget\0msgrcv\0msgsnd\0msync\0munlock\0" -+ "munlockall\0munmap\0name_to_handle_at\0nanosleep\0newfstatat\0nfsservctl\0ni_syscall\0open\0open_by_handle_at\0openat\0" -+ "pciconfig_read\0pciconfig_write\0perfmonctl\0personality\0pipe\0pipe2\0pivot_root\0poll\0ppoll\0prctl\0" -+ "pread64\0preadv\0prlimit64\0process_vm_readv\0process_vm_writev\0pselect\0ptrace\0putpmsg\0pwrite64\0pwritev\0" -+ "quotactl\0read\0readahead\0readlink\0readlinkat\0readv\0reboot\0recv\0recvfrom\0recvmmsg\0" -+ "recvmsg\0remap_file_pages\0removexattr\0rename\0renameat\0request_key\0restart_syscall\0rmdir\0rt_sigaction\0rt_sigpending\0" -+ "rt_sigprocmask\0rt_sigqueueinfo\0rt_sigreturn\0rt_sigsuspend\0rt_sigtimedwait\0rt_tgsigqueueinfo\0sched_get_priority_max\0sched_get_priority_min\0sched_getaffinity\0sched_getparam\0" -+ "sched_getscheduler\0sched_rr_get_interval\0sched_setaffinity\0sched_setparam\0sched_setscheduler\0sched_yield\0select\0semctl\0semget\0semop\0" -+ "semtimedop\0send\0sendfile\0sendmmsg\0sendmsg\0sendto\0set_mempolicy\0set_robust_list\0set_tid_address\0set_zone_reclaim\0" -+ "setdomainname\0setfsgid\0setfsuid\0setgid\0setgroups\0sethostname\0setitimer\0setns\0setpgid\0setpriority\0" -+ "setregid\0setresgid\0setresuid\0setreuid\0setrlimit\0setsid\0setsockopt\0settimeofday\0setuid\0setxattr\0" -+ "shmat\0shmctl\0shmdt\0shmget\0shutdown\0sigaltstack\0signalfd\0signalfd4\0socket\0socketpair\0" -+ "splice\0stat\0statfs\0statfs64\0swapoff\0swapon\0symlink\0symlinkat\0sync\0sync_file_range\0" -+ "syncfs\0sysfs\0sysinfo\0syslog\0tee\0tgkill\0timer_create\0timer_delete\0timer_getoverrun\0timer_gettime\0" -+ "timer_settime\0timerfd\0timerfd_create\0timerfd_gettime\0timerfd_settime\0times\0tkill\0truncate\0tux\0umask\0" -+ "umount\0uname\0unlink\0unlinkat\0unshare\0uselib\0ustat\0utimensat\0utimes\0vhangup\0" -+ "vmsplice\0vserver\0wait4\0waitid\0write\0writev"; -+static const unsigned ia64_syscall_s2i_s[] = { -+ 0,8,15,23,30,35,43,52,64,72, -+ 77,81,88,95,101,107,113,120,134,147, -+ 161,177,191,197,204,210,218,224,238,242, -+ 247,252,265,279,289,301,312,320,329,336, -+ 341,352,362,372,382,396,410,417,424,433, -+ 440,449,455,465,475,488,499,505,518,528, -+ 534,542,552,558,568,574,584,598,614,621, -+ 628,637,648,656,664,671,681,691,703,711, -+ 718,726,734,746,756,766,776,786,793,805, -+ 816,823,836,843,853,862,874,892,905,919, -+ 936,946,957,970,979,989,995,1006,1017,1028, -+ 1035,1040,1047,1057,1062,1069,1076,1086,1097,1112, -+ 1125,1131,1141,1147,1155,1161,1175,1183,1189,1197, -+ 1203,1211,1217,1226,1231,1237,1243,1252,1266,1276, -+ 1284,1300,1313,1323,1330,1337,1344,1351,1358,1364, -+ 1372,1383,1390,1408,1418,1429,1440,1451,1456,1474, -+ 1481,1496,1512,1523,1535,1540,1546,1557,1562,1568, -+ 1574,1582,1589,1599,1616,1634,1642,1649,1657,1666, -+ 1674,1683,1688,1698,1707,1718,1724,1731,1736,1745, -+ 1754,1762,1779,1791,1798,1807,1819,1835,1841,1854, -+ 1868,1883,1899,1912,1926,1942,1960,1983,2006,2024, -+ 2039,2058,2080,2098,2113,2132,2144,2151,2158,2165, -+ 2171,2182,2187,2196,2205,2213,2220,2234,2250,2266, -+ 2283,2297,2306,2315,2322,2332,2344,2354,2360,2368, -+ 2380,2389,2399,2409,2418,2428,2435,2446,2459,2466, -+ 2475,2481,2488,2494,2501,2510,2522,2531,2541,2548, -+ 2559,2566,2571,2578,2587,2595,2602,2610,2620,2625, -+ 2641,2648,2654,2662,2669,2673,2680,2693,2706,2723, -+ 2737,2751,2759,2774,2790,2806,2812,2818,2827,2831, -+ 2837,2844,2850,2857,2866,2874,2881,2887,2897,2904, -+ 2912,2921,2929,2935,2942,2948, -+}; -+static const int ia64_syscall_s2i_i[] = { -+ 1150,1194,1334,1049,1064,1271,1131,1141,1138,1191, -+ 1060,1185,1186,1034,1038,1039,1068,1328,1255,1254, -+ 1256,1253,1128,1213,1029,1192,1030,1134,1057,1070, -+ 1316,1243,1315,1244,1305,1245,1309,1314,1033,1025, -+ 1236,1293,1234,1303,1323,1324,1035,1099,1292,1100, -+ 1284,1066,1052,1222,1335,1225,1145,1228,1219,1212, -+ 1104,1257,1051,1098,1230,1285,1260,1299,1304,1184, -+ 1144,1214,1063,1047,1062,1077,1119,1196,1079,1041, -+ 1188,1042,1101,1075,1073,1085,1086,1082,1195,1204, -+ 1105,1087,1046,1215,1220,1133,1278,1277,1318,1279, -+ 1242,1239,1240,1238,1241,1065,1275,1274,1268,1273, -+ 1053,1124,1221,1031,1289,1193,1223,1224,1237,1227, -+ 1040,1218,1211,1209,1259,1280,1208,1055,1282,1037, -+ 1283,1153,1154,1151,1172,1043,1155,1267,1266,1262, -+ 1265,1264,1263,1156,1112,1109,1111,1110,1157,1158, -+ 1159,1152,1326,1168,1286,1169,1024,1028,1327,1281, -+ 1173,1174,1175,1140,1058,1317,1207,1090,1295,1170, -+ 1148,1319,1325,1332,1333,1294,1048,1189,1149,1320, -+ 1137,1026,1216,1092,1291,1146,1096,1200,1201,1322, -+ 1206,1125,1226,1054,1288,1272,1246,1056,1177,1178, -+ 1179,1180,1181,1182,1183,1321,1165,1166,1232,1160, -+ 1162,1167,1231,1161,1163,1164,1089,1108,1106,1107, -+ 1247,1198,1187,1331,1205,1199,1261,1298,1233,1276, -+ 1129,1143,1142,1061,1078,1083,1118,1330,1080,1102, -+ 1072,1076,1074,1071,1084,1081,1203,1088,1045,1217, -+ 1114,1116,1115,1113,1202,1176,1307,1313,1190,1197, -+ 1297,1210,1103,1258,1095,1094,1091,1290,1050,1300, -+ 1329,1139,1127,1117,1301,1235,1248,1252,1251,1250, -+ 1249,1308,1310,1312,1311,1059,1229,1097,1120,1067, -+ 1044,1130,1032,1287,1296,1093,1069,1306,1036,1123, -+ 1302,1269,1126,1270,1027,1147, -+}; -+static int ia64_syscall_s2i(const char *s, int *value) { -+ size_t len, i; -+ len = strlen(s); -+ { char copy[len + 1]; -+ for (i = 0; i < len; i++) { -+ char c = s[i]; -+ copy[i] = GT_ISUPPER(c) ? c - 'A' + 'a' : c; -+ } -+ copy[i] = 0; -+ return s2i__(ia64_syscall_strings, ia64_syscall_s2i_s, ia64_syscall_s2i_i, 306, copy, value); -+ } -+} -+static const unsigned ia64_syscall_i2s_direct[] = { -+ 1440,336,1683,2942,1451,204,218,1057,2850,329, -+ 95,410,2897,1197,101,107,1125,711,726,1237, -+ 2837,2459,836,656,1642,23,2620,552,455,1035, -+ 1791,1183,1835,238,1535,2806,77,2315,664,648, -+ 30,989,449,2831,113,2881,242,2409,2380,756, -+ 2399,746,2389,671,2322,703,2360,2428,786,2332, -+ 2418,766,776,823,2446,2144,1557,2602,1698,2874, -+ 2595,2587,1724,2818,558,417,433,734,2368,2571, -+ 534,816,2158,2165,2151,1337,1351,1344,1330,2494, -+ 2475,2488,2481,2662,2344,681,2827,-1u,-1u,2904, -+ 1040,1762,2929,2654,191,2283,2844,43,-1u,862, -+ 224,-1u,-1u,1674,64,2648,1523,52,2306,2297, -+ 628,499,1718,2948,1574,1657,0,1226,1383,1211, -+ 1217,1243,1323,1358,1364,1372,2024,2098,2039,2113, -+ 2132,1960,1983,2058,1408,1429,1568,-1u,1231,1481, -+ 1496,1512,2510,1841,1854,1868,1883,1899,1912,1926, -+ 621,81,88,2187,718,1649,2541,72,210,1069, -+ 8,793,691,2548,2182,2213,1731,1736,2501,2435, -+ 805,2205,1754,1546,1175,1147,2566,1141,528,197, -+ 637,843,1688,2466,1131,518,853,1047,465,1076, -+ 1086,488,1779,1112,505,2812,568,2080,2006,2250, -+ 362,2673,341,1097,970,946,957,979,936,252, -+ 279,301,1819,2171,2680,2737,2723,2706,2693,177, -+ 147,134,161,542,2578,1155,584,2220,1276,1313, -+ 1300,1284,1266,1252,1017,2921,2935,35,1807,1028, -+ 1006,995,2266,892,874,919,1161,1474,1189,1203, -+ 440,574,1418,2857,1798,1062,2610,1707,424,352, -+ 1634,1562,2866,2559,2234,598,2625,2669,2912,372, -+ 614,289,2887,2522,2751,312,2759,2790,2774,2531, -+ 320,265,247,1540,905,1582,1666,1942,1745,382, -+ 396,1589,1390,1456,120,2641,2354,2196,1599,1616, -+ 15,475, -+}; -+static const char *ia64_syscall_i2s(int v) { -+ return i2s_direct__(ia64_syscall_strings, ia64_syscall_i2s_direct, 1024, 1335, v); -+} -diff --git a/lib/machinetabs.h b/lib/machinetabs.h -new file mode 100644 -index 0000000..ec2d033 ---- /dev/null -+++ b/lib/machinetabs.h -@@ -0,0 +1,26 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char machine_strings[] = "i386\0i486\0i586\0i686\0ia64\0ppc\0ppc64\0s390\0s390x\0x86_64"; -+static const unsigned machine_s2i_s[] = { -+ 0,5,10,15,20,25,29,35,40,46, -+}; -+static const int machine_s2i_i[] = { -+ 0,0,0,0,2,4,3,6,5,1, -+}; -+static int machine_s2i(const char *s, int *value) { -+ size_t len, i; -+ len = strlen(s); -+ { char copy[len + 1]; -+ for (i = 0; i < len; i++) { -+ char c = s[i]; -+ copy[i] = GT_ISUPPER(c) ? c - 'A' + 'a' : c; -+ } -+ copy[i] = 0; -+ return s2i__(machine_strings, machine_s2i_s, machine_s2i_i, 10, copy, value); -+ } -+} -+static const unsigned machine_i2s_direct[] = { -+ 0,46,20,29,25,40,35, -+}; -+static const char *machine_i2s(int v) { -+ return i2s_direct__(machine_strings, machine_i2s_direct, 0, 6, v); -+} -diff --git a/lib/msg_typetabs.h b/lib/msg_typetabs.h -new file mode 100644 -index 0000000..770ec21 ---- /dev/null -+++ b/lib/msg_typetabs.h -@@ -0,0 +1,104 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char msg_type_strings[] = "ADD_GROUP\0ADD_USER\0ANOM_ABEND\0ANOM_ACCESS_FS\0ANOM_ADD_ACCT\0ANOM_AMTU_FAIL\0ANOM_CRYPTO_FAIL\0ANOM_DEL_ACCT\0ANOM_EXEC\0ANOM_LINK\0" -+ "ANOM_LOGIN_ACCT\0ANOM_LOGIN_FAILURES\0ANOM_LOGIN_LOCATION\0ANOM_LOGIN_SESSIONS\0ANOM_LOGIN_TIME\0ANOM_MAX_DAC\0ANOM_MAX_MAC\0ANOM_MK_EXEC\0ANOM_MOD_ACCT\0ANOM_PROMISCUOUS\0" -+ "ANOM_RBAC_FAIL\0ANOM_RBAC_INTEGRITY_FAIL\0ANOM_ROOT_TRANS\0AVC\0AVC_PATH\0BPRM_FCAPS\0CAPSET\0CHGRP_ID\0CHUSER_ID\0CONFIG_CHANGE\0" -+ "CRED_ACQ\0CRED_DISP\0CRED_REFR\0CRYPTO_FAILURE_USER\0CRYPTO_KEY_USER\0CRYPTO_LOGIN\0CRYPTO_LOGOUT\0CRYPTO_PARAM_CHANGE_USER\0CRYPTO_REPLAY_USER\0CRYPTO_SESSION\0" -+ "CRYPTO_TEST_USER\0CWD\0DAC_CHECK\0DAEMON_ABORT\0DAEMON_ACCEPT\0DAEMON_CLOSE\0DAEMON_CONFIG\0DAEMON_END\0DAEMON_RESUME\0DAEMON_ROTATE\0" -+ "DAEMON_START\0DEL_GROUP\0DEL_USER\0DEV_ALLOC\0DEV_DEALLOC\0EOE\0EXECVE\0FD_PAIR\0FS_RELABEL\0GRP_AUTH\0" -+ "INTEGRITY_DATA\0INTEGRITY_HASH\0INTEGRITY_METADATA\0INTEGRITY_PCR\0INTEGRITY_RULE\0INTEGRITY_STATUS\0IPC\0IPC_SET_PERM\0KERNEL\0KERNEL_OTHER\0" -+ "LABEL_LEVEL_CHANGE\0LABEL_OVERRIDE\0LIST_RULES\0LOGIN\0MAC_CIPSOV4_ADD\0MAC_CIPSOV4_DEL\0MAC_CONFIG_CHANGE\0MAC_IPSEC_ADDSA\0MAC_IPSEC_ADDSPD\0MAC_IPSEC_DELSA\0" -+ "MAC_IPSEC_DELSPD\0MAC_IPSEC_EVENT\0MAC_MAP_ADD\0MAC_MAP_DEL\0MAC_POLICY_LOAD\0MAC_STATUS\0MAC_UNLBL_ALLOW\0MAC_UNLBL_STCADD\0MAC_UNLBL_STCDEL\0MMAP\0" -+ "MQ_GETSETATTR\0MQ_NOTIFY\0MQ_OPEN\0MQ_SENDRECV\0NETFILTER_CFG\0NETFILTER_PKT\0OBJ_PID\0PATH\0RESP_ACCT_LOCK\0RESP_ACCT_LOCK_TIMED\0" -+ "RESP_ACCT_REMOTE\0RESP_ACCT_UNLOCK_TIMED\0RESP_ALERT\0RESP_ANOMALY\0RESP_EXEC\0RESP_HALT\0RESP_KILL_PROC\0RESP_SEBOOL\0RESP_SINGLE\0RESP_TERM_ACCESS\0" -+ "RESP_TERM_LOCK\0ROLE_ASSIGN\0ROLE_MODIFY\0ROLE_REMOVE\0SECCOMP\0SELINUX_ERR\0SERVICE_START\0SERVICE_STOP\0SOCKADDR\0SOCKETCALL\0" -+ "SYSCALL\0SYSTEM_BOOT\0SYSTEM_RUNLEVEL\0SYSTEM_SHUTDOWN\0TEST\0TRUSTED_APP\0TTY\0TTY_GET\0TTY_SET\0USER\0" -+ "USER_ACCT\0USER_AUTH\0USER_AVC\0USER_CHAUTHTOK\0USER_CMD\0USER_END\0USER_ERR\0USER_LABELED_EXPORT\0USER_LOGIN\0USER_LOGOUT\0" -+ "USER_MAC_POLICY_LOAD\0USER_MGMT\0USER_ROLE_CHANGE\0USER_SELINUX_ERR\0USER_START\0USER_TTY\0USER_UNLABELED_EXPORT\0USYS_CONFIG\0VIRT_CONTROL\0VIRT_MACHINE_ID\0" -+ "VIRT_RESOURCE"; -+static const unsigned msg_type_s2i_s[] = { -+ 0,10,19,30,45,59,74,91,105,115, -+ 125,141,161,181,201,217,230,243,256,270, -+ 287,302,327,343,347,356,367,374,383,393, -+ 407,416,426,436,456,472,485,499,524,543, -+ 558,575,579,589,602,616,629,643,654,668, -+ 682,695,705,714,724,736,740,747,755,766, -+ 775,790,805,824,838,853,870,874,887,894, -+ 907,926,941,952,958,974,990,1008,1024,1041, -+ 1057,1074,1090,1102,1114,1130,1141,1157,1174,1191, -+ 1196,1210,1220,1228,1240,1254,1268,1276,1281,1296, -+ 1317,1334,1357,1368,1381,1391,1401,1416,1428,1440, -+ 1457,1472,1484,1496,1508,1516,1528,1542,1555,1564, -+ 1575,1583,1595,1611,1627,1632,1644,1648,1656,1664, -+ 1669,1679,1689,1698,1713,1722,1731,1740,1760,1771, -+ 1783,1804,1814,1831,1848,1859,1868,1890,1902,1915, -+ 1931, -+}; -+static const int msg_type_s2i_i[] = { -+ 1116,1114,1701,2111,2114,2107,2110,2115,2112,1702, -+ 2103,2100,2104,2102,2101,2105,2106,2113,2116,1700, -+ 2108,2109,2117,1400,1402,1321,1322,1119,1125,1305, -+ 1103,1104,1110,2405,2404,2402,2403,2401,2406,2407, -+ 2400,1307,1118,1202,1207,1208,1203,1201,1206,1205, -+ 1200,1117,1115,2307,2308,1320,1309,1317,2309,1126, -+ 1800,1803,1801,1804,1805,1802,1303,1311,2000,1316, -+ 2304,2303,1013,1006,1407,1408,1405,1411,1413,1412, -+ 1414,1415,1409,1410,1403,1404,1406,1416,1417,1323, -+ 1315,1314,1312,1313,1325,1324,1318,1302,2207,2205, -+ 2204,2206,2201,2200,2210,2212,2202,2209,2211,2203, -+ 2208,2301,2311,2302,1326,1401,1130,1131,1306,1304, -+ 1300,1127,1129,1128,1120,1121,1319,1016,1017,1005, -+ 1101,1100,1107,1108,1123,1106,1109,2305,1112,1113, -+ 2310,1102,2300,1122,1105,1124,2306,1111,2500,2502, -+ 2501, -+}; -+static int msg_type_s2i(const char *s, int *value) { -+ size_t len, i; -+ len = strlen(s); -+ { char copy[len + 1]; -+ for (i = 0; i < len; i++) { -+ char c = s[i]; -+ copy[i] = GT_ISLOWER(c) ? c - 'a' + 'A' : c; -+ } -+ copy[i] = 0; -+ return s2i__(msg_type_strings, msg_type_s2i_s, msg_type_s2i_i, 151, copy, value); -+ } -+} -+static const int msg_type_i2s_i[] = { -+ 1005,1006,1013,1016,1017,1100,1101,1102,1103,1104, -+ 1105,1106,1107,1108,1109,1110,1111,1112,1113,1114, -+ 1115,1116,1117,1118,1119,1120,1121,1122,1123,1124, -+ 1125,1126,1127,1128,1129,1130,1131,1200,1201,1202, -+ 1203,1205,1206,1207,1208,1300,1302,1303,1304,1305, -+ 1306,1307,1309,1311,1312,1313,1314,1315,1316,1317, -+ 1318,1319,1320,1321,1322,1323,1324,1325,1326,1400, -+ 1401,1402,1403,1404,1405,1406,1407,1408,1409,1410, -+ 1411,1412,1413,1414,1415,1416,1417,1700,1701,1702, -+ 1800,1801,1802,1803,1804,1805,2000,2100,2101,2102, -+ 2103,2104,2105,2106,2107,2108,2109,2110,2111,2112, -+ 2113,2114,2115,2116,2117,2200,2201,2202,2203,2204, -+ 2205,2206,2207,2208,2209,2210,2211,2212,2300,2301, -+ 2302,2303,2304,2305,2306,2307,2308,2309,2310,2311, -+ 2400,2401,2402,2403,2404,2405,2406,2407,2500,2501, -+ 2502, -+}; -+static const unsigned msg_type_i2s_s[] = { -+ 1664,952,941,1648,1656,1679,1669,1804,407,416, -+ 1848,1722,1689,1698,1731,426,1890,1760,1771,10, -+ 705,0,695,579,374,1627,1632,1831,1713,1859, -+ 383,766,1583,1611,1595,1528,1542,682,643,589, -+ 629,668,654,602,616,1575,1276,870,1564,393, -+ 1555,575,740,874,1220,1228,1210,1196,894,747, -+ 1268,1644,736,356,367,1191,1254,1240,1508,343, -+ 1516,347,1114,1130,990,1141,958,974,1090,1102, -+ 1008,1041,1024,1057,1074,1157,1174,270,19,115, -+ 775,805,853,790,824,838,887,141,201,181, -+ 125,161,217,230,59,287,302,74,30,105, -+ 243,45,91,256,327,1368,1357,1401,1440,1317, -+ 1296,1334,1281,1457,1416,1381,1428,1391,1814,1472, -+ 1496,926,907,1740,1868,714,724,755,1783,1484, -+ 558,499,472,485,456,436,524,543,1902,1931, -+ 1915, -+}; -+static const char *msg_type_i2s(int v) { -+ return i2s_bsearch__(msg_type_strings, msg_type_i2s_i, msg_type_i2s_s, 151, v); -+} -diff --git a/lib/optabs.h b/lib/optabs.h -new file mode 100644 -index 0000000..d79b665 ---- /dev/null -+++ b/lib/optabs.h -@@ -0,0 +1,11 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char op_strings[] = "!=\0&\0&=\0<\0<=\0=\0>\0>="; -+static const int op_i2s_i[] = { -+ 134217728,268435456,536870912,805306368,1073741824,1207959552,1342177280,1610612736, -+}; -+static const unsigned op_i2s_s[] = { -+ 3,8,15,0,13,5,10,17, -+}; -+static const char *op_i2s(int v) { -+ return i2s_bsearch__(op_strings, op_i2s_i, op_i2s_s, 8, v); -+} -diff --git a/lib/ppc_tables.h b/lib/ppc_tables.h -new file mode 100644 -index 0000000..778fae3 ---- /dev/null -+++ b/lib/ppc_tables.h -@@ -0,0 +1,163 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char ppc_syscall_strings[] = "_llseek\0_newselect\0_sysctl\0accept\0accept4\0access\0acct\0add_key\0adjtimex\0afs_syscall\0" -+ "alarm\0bdflush\0bind\0break\0brk\0capget\0capset\0chdir\0chmod\0chown\0" -+ "chroot\0clock_adjtime\0clock_getres\0clock_gettime\0clock_nanosleep\0clock_settime\0clone\0close\0connect\0creat\0" -+ "create_module\0delete_module\0dup\0dup2\0dup3\0epoll_create\0epoll_create1\0epoll_ctl\0epoll_pwait\0epoll_wait\0" -+ "eventfd\0eventfd2\0execve\0exit\0exit_group\0faccessat\0fadvise64\0fadvise64_64\0fallocate\0fanotify_init\0" -+ "fanotify_mark\0fchdir\0fchmod\0fchmodat\0fchown\0fchownat\0fcntl\0fcntl64\0fdatasync\0fgetxattr\0" -+ "finit_module\0flistxattr\0flock\0fork\0fremovexattr\0fsetxattr\0fstat\0fstat64\0fstatat\0fstatfs\0" -+ "fstatfs64\0fsync\0ftime\0ftruncate\0ftruncate64\0futex\0futimesat\0get_kernel_syms\0get_robust_list\0getcpu\0" -+ "getcwd\0getdents\0getdents64\0getegid\0geteuid\0getgid\0getgroups\0getitimer\0getpeername\0getpgid\0" -+ "getpgrp\0getpid\0getpmsg\0getppid\0getpriority\0getresgid\0getresuid\0getrlimit\0getrusage\0getsid\0" -+ "getsockname\0getsockopt\0gettid\0gettimeofday\0getuid\0getxattr\0gtty\0idle\0init_module\0inotify_add_watch\0" -+ "inotify_init\0inotify_init1\0inotify_rm_watch\0io_cancel\0io_destroy\0io_getevents\0io_setup\0io_submit\0ioctl\0ioperm\0" -+ "iopl\0ioprio_get\0ioprio_set\0ipc\0kcmp\0kexec_load\0keyctl\0kill\0lchown\0lgetxattr\0" -+ "link\0linkat\0listen\0listxattr\0llistxattr\0lock\0lookup_dcookie\0lremovexattr\0lseek\0lsetxattr\0" -+ "lstat\0lstat64\0madvise\0mincore\0mkdir\0mkdirat\0mknod\0mknodat\0mlock\0mlockall\0" -+ "mmap\0mmap2\0modify_ldt\0mount\0move_pages\0mprotect\0mpx\0mq_getsetattr\0mq_notify\0mq_open\0" -+ "mq_timedreceive\0mq_timedsend\0mq_unlink\0mremap\0msync\0multiplexer\0munlock\0munlockall\0munmap\0name_to_handle_at\0" -+ "nanosleep\0nfsservctl\0nice\0oldfstat\0oldlstat\0oldolduname\0oldstat\0olduname\0open\0open_by_handle_at\0" -+ "openat\0pause\0pciconfig_iobase\0pciconfig_read\0pciconfig_write\0perf_counter_open\0personality\0pipe\0pipe2\0pivot_root\0" -+ "poll\0ppoll\0prctl\0pread\0preadv\0prlimit64\0process_vm_readv\0process_vm_writev\0prof\0profil\0" -+ "pselect6\0ptrace\0putpmsg\0pwrite\0pwritev\0query_module\0quotactl\0read\0readahead\0readdir\0" -+ "readlink\0readlinkat\0readv\0reboot\0recv\0recvfrom\0recvmmsg\0recvmsg\0remap_file_pages\0removexattr\0" -+ "rename\0renameat\0request_key\0rmdir\0rt_sigaction\0rt_sigpending\0rt_sigprocmask\0rt_sigqueueinfo\0rt_sigreturn\0rt_sigsuspend\0" -+ "rt_sigtimedwait\0rt_tgsigqueueinfo\0rtas\0sched_get_priority_max\0sched_get_priority_min\0sched_getaffinity\0sched_getparam\0sched_getscheduler\0sched_rr_get_interval\0sched_setaffinity\0" -+ "sched_setparam\0sched_setscheduler\0sched_yield\0select\0send\0sendfile\0sendfile64\0sendmmsg\0sendmsg\0sendto\0" -+ "set_robust_list\0set_tid_address\0setdomainname\0setfsgid\0setfsuid\0setgid\0setgroups\0sethostname\0setitimer\0setns\0" -+ "setpgid\0setpriority\0setregid\0setresgid\0setresuid\0setreuid\0setrlimit\0setsid\0setsockopt\0settimeofday\0" -+ "setuid\0setxattr\0sgetmask\0shutdown\0sigaction\0sigaltstack\0signal\0signalfd\0signalfd4\0sigpending\0" -+ "sigprocmask\0sigreturn\0sigsuspend\0socket\0socketcall\0socketpair\0splice\0spu_create\0spu_run\0ssetmask\0" -+ "stat\0stat64\0statfs\0statfs64\0stime\0stty\0subpage_prot\0swapcontext\0swapoff\0swapon\0" -+ "symlink\0symlinkat\0sync\0sync_file_range2\0syncfs\0sysfs\0sysinfo\0syslog\0tee\0tgkill\0" -+ "time\0timer_create\0timer_delete\0timer_getoverrun\0timer_gettime\0timer_settime\0timerfd\0timerfd_gettime\0timerfd_settime\0times\0" -+ "tkill\0truncate\0truncate64\0tuxcall\0ugetrlimit\0ulimit\0umask\0umount\0umount2\0uname\0" -+ "unlink\0unlinkat\0unshare\0uselib\0ustat\0utime\0utimensat\0utimes\0vfork\0vhangup\0" -+ "vm86\0vmsplice\0wait4\0waitid\0waitpid\0write\0writev"; -+static const unsigned ppc_syscall_s2i_s[] = { -+ 0,8,19,27,34,42,49,54,62,71, -+ 83,89,97,102,108,112,119,126,132,138, -+ 144,151,165,178,192,208,222,228,234,242, -+ 248,262,276,280,285,290,303,317,327,339, -+ 350,358,367,374,379,390,400,410,423,433, -+ 447,461,468,475,484,491,500,506,514,524, -+ 534,547,558,564,569,582,592,598,606,614, -+ 622,632,638,644,654,666,672,682,698,714, -+ 721,728,737,748,756,764,771,781,791,803, -+ 811,819,826,834,842,854,864,874,884,894, -+ 901,913,924,931,944,951,960,965,970,982, -+ 1000,1013,1027,1044,1054,1065,1078,1087,1097,1103, -+ 1110,1115,1126,1137,1141,1146,1157,1164,1169,1176, -+ 1186,1191,1198,1205,1215,1226,1231,1246,1259,1265, -+ 1275,1281,1289,1297,1305,1311,1319,1325,1333,1339, -+ 1348,1353,1359,1370,1376,1387,1396,1400,1414,1424, -+ 1432,1448,1461,1471,1478,1484,1496,1504,1515,1522, -+ 1540,1550,1561,1566,1575,1584,1596,1604,1613,1618, -+ 1636,1643,1649,1666,1681,1697,1715,1727,1732,1738, -+ 1749,1754,1760,1766,1772,1779,1789,1806,1824,1829, -+ 1836,1845,1852,1860,1867,1875,1888,1897,1902,1912, -+ 1920,1929,1940,1946,1953,1958,1967,1976,1984,2001, -+ 2013,2020,2029,2041,2047,2060,2074,2089,2105,2118, -+ 2132,2148,2166,2171,2194,2217,2235,2250,2269,2291, -+ 2309,2324,2343,2355,2362,2367,2376,2387,2396,2404, -+ 2411,2427,2443,2457,2466,2475,2482,2492,2504,2514, -+ 2520,2528,2540,2549,2559,2569,2578,2588,2595,2606, -+ 2619,2626,2635,2644,2653,2663,2675,2682,2691,2701, -+ 2712,2724,2734,2745,2752,2763,2774,2781,2792,2800, -+ 2809,2814,2821,2828,2837,2843,2848,2861,2873,2881, -+ 2888,2896,2906,2911,2928,2935,2941,2949,2956,2960, -+ 2967,2972,2985,2998,3015,3029,3043,3051,3067,3083, -+ 3089,3095,3104,3115,3123,3134,3141,3147,3154,3162, -+ 3168,3175,3184,3192,3199,3205,3211,3221,3228,3234, -+ 3242,3247,3256,3262,3269,3277,3283, -+}; -+static const int ppc_syscall_s2i_i[] = { -+ 140,142,149,330,344,33,51,269,124,137, -+ 27,134,327,17,45,183,184,12,15,181, -+ 61,347,247,246,248,245,120,6,328,8, -+ 127,129,41,63,316,236,315,237,303,238, -+ 307,314,11,1,234,298,233,254,309,323, -+ 324,133,94,297,95,289,55,204,148,214, -+ 353,217,143,2,220,211,108,197,291,100, -+ 253,118,35,93,194,221,290,130,299,302, -+ 182,141,202,50,49,47,80,105,332,132, -+ 65,20,187,64,96,170,165,76,77,147, -+ 331,340,207,78,24,212,32,112,128,276, -+ 275,318,277,231,228,229,227,230,54,101, -+ 110,274,273,117,354,268,271,37,16,213, -+ 9,294,329,215,216,53,235,219,19,210, -+ 107,196,205,206,39,287,14,288,150,152, -+ 90,192,123,21,301,125,56,267,266,262, -+ 265,264,263,163,144,201,151,153,91,345, -+ 162,168,34,28,84,59,18,109,5,346, -+ 286,29,200,198,199,319,136,42,317,203, -+ 167,281,171,179,320,325,351,352,44,98, -+ 280,26,188,180,321,166,131,3,191,89, -+ 85,296,145,88,336,337,343,342,239,218, -+ 38,293,270,40,173,175,174,177,172,178, -+ 176,322,255,159,160,223,155,157,161,222, -+ 154,156,158,82,334,186,226,349,341,335, -+ 300,232,121,139,138,46,81,74,104,350, -+ 57,97,71,169,164,70,75,66,339,79, -+ 23,209,68,338,67,185,48,305,313,73, -+ 126,119,72,326,102,333,283,279,278,69, -+ 106,195,99,252,25,31,310,249,115,87, -+ 83,295,36,308,348,135,116,103,284,250, -+ 13,240,244,243,242,241,306,312,311,43, -+ 208,92,193,225,190,58,60,22,52,122, -+ 10,292,282,86,62,30,304,251,189,111, -+ 113,285,114,272,7,4,146, -+}; -+static int ppc_syscall_s2i(const char *s, int *value) { -+ size_t len, i; -+ len = strlen(s); -+ { char copy[len + 1]; -+ for (i = 0; i < len; i++) { -+ char c = s[i]; -+ copy[i] = GT_ISUPPER(c) ? c - 'A' + 'a' : c; -+ } -+ copy[i] = 0; -+ return s2i__(ppc_syscall_strings, ppc_syscall_s2i_s, ppc_syscall_s2i_i, 347, copy, value); -+ } -+} -+static const unsigned ppc_syscall_i2s_direct[] = { -+ 374,564,1897,3277,1613,228,3269,242,1186,3168, -+ 367,126,2967,1319,132,1169,102,1596,1259,819, -+ 1370,3147,2619,944,2837,1845,83,1566,1643,3205, -+ 2843,960,42,1561,638,2906,1164,2013,1305,2041, -+ 276,1727,3083,1824,108,2475,764,2675,756,748, -+ 49,3154,1226,1097,500,1396,2520,3134,1584,3141, -+ 144,3199,280,834,811,2588,2653,2635,2800,2569, -+ 2540,2734,2701,2492,2578,874,884,931,2606,771, -+ 2482,2355,2888,1575,1920,3192,2881,1946,1912,1348, -+ 1515,3095,644,468,484,842,2528,1829,2821,614, -+ 1103,2752,2949,2504,781,2809,1275,592,1604,1110, -+ 3234,965,3242,3256,2873,2941,1137,632,2724,222, -+ 2443,3162,1359,62,1387,2712,248,970,262,682, -+ 1888,803,461,89,2935,1715,71,2466,2457,0, -+ 728,8,558,1478,1940,3283,894,514,19,1333, -+ 1496,1339,1504,2309,2235,2324,2250,2343,2171,2194, -+ 2269,1540,1471,2559,864,1875,1749,1550,2549,854, -+ 1760,2105,2047,2074,2060,2132,2089,2118,1766,1860, -+ 138,721,112,119,2663,2367,826,1852,3228,3123, -+ 1902,1353,3104,654,2814,1281,598,1666,1681,1649, -+ 1484,737,1738,506,1289,1297,924,3089,2626,1265, -+ 582,951,1176,524,1205,1215,547,2001,1246,569, -+ 666,2291,2217,-1u,3115,2376,1078,1054,1065,1087, -+ 1044,2427,400,379,1231,290,317,339,1984,2972, -+ 3029,3015,2998,2985,208,178,165,192,2861,2960, -+ 3221,2828,622,410,2166,-1u,-1u,-1u,-1u,-1u, -+ -1u,1424,1461,1448,1432,1414,1400,1146,54,2029, -+ 1157,3262,1126,1115,1000,982,1027,2792,2781,1836, -+ 1754,3184,2774,2956,3247,1636,1311,1325,491,672, -+ 606,3175,2020,1191,2896,1929,475,390,698,2411, -+ 1376,714,327,3211,2682,3043,350,2911,423,2848, -+ 3067,3051,2691,358,303,285,1732,1013,1697,1772, -+ 1867,2148,433,447,1779,2745,97,234,1198,27, -+ 901,791,2763,2362,2404,1953,1958,2644,2595,913, -+ 2396,1976,1967,34,1522,1618,151,2928,2387,2514, -+ 1789,1806,534,1141, -+}; -+static const char *ppc_syscall_i2s(int v) { -+ return i2s_direct__(ppc_syscall_strings, ppc_syscall_i2s_direct, 1, 354, v); -+} -diff --git a/lib/s390_tables.h b/lib/s390_tables.h -new file mode 100644 -index 0000000..218482e ---- /dev/null -+++ b/lib/s390_tables.h -@@ -0,0 +1,153 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char s390_syscall_strings[] = "_llseek\0_newselect\0_sysctl\0access\0acct\0add_key\0adjtimex\0afs_syscall\0alarm\0bdflush\0" -+ "brk\0capget\0capset\0chdir\0chmod\0chown\0chown32\0chroot\0clock_adjtime\0clock_getres\0" -+ "clock_gettime\0clock_nanosleep\0clock_settime\0clone\0close\0creat\0create_module\0delete_module\0dup\0dup2\0" -+ "dup3\0epoll_create\0epoll_create1\0epoll_ctl\0epoll_pwait\0epoll_wait\0eventfd\0eventfd2\0execve\0exit\0" -+ "exit_group\0faccessat\0fadvise64\0fadvise64_64\0fallocate\0fanotify_init\0fanotify_mark\0fchdir\0fchmod\0fchmodat\0" -+ "fchown\0fchown32\0fchownat\0fcntl\0fcntl64\0fdatasync\0fgetxattr\0finit_module\0flistxattr\0flock\0" -+ "fork\0fremovexattr\0fsetxattr\0fstat\0fstat64\0fstatat\0fstatfs\0fstatfs64\0fsync\0ftruncate\0" -+ "ftruncate64\0futex\0futimesat\0get_kernel_syms\0get_robust_list\0getcpu\0getcwd\0getdents\0getdents64\0getegid\0" -+ "getegid32\0geteuid\0geteuid32\0getgid\0getgid32\0getgroups\0getgroups32\0getitimer\0getpgid\0getpgrp\0" -+ "getpid\0getpmsg\0getppid\0getpriority\0getresgid\0getresgid32\0getresuid\0getresuid32\0getrlimit\0getrusage\0" -+ "getsid\0gettid\0gettimeofday\0getuid\0getuid32\0getxattr\0idle\0init_module\0inotify_add_watch\0inotify_init\0" -+ "inotify_init1\0inotify_rm_watch\0io_cancel\0io_destroy\0io_getevents\0io_setup\0io_submit\0ioctl\0ioperm\0ioprio_get\0" -+ "ioprio_set\0ipc\0kcmp\0kexec_load\0keyctl\0kill\0lchown\0lchown32\0lgetxattr\0link\0" -+ "linkat\0listxattr\0llistxattr\0lremovexattr\0lseek\0lsetxattr\0lstat\0lstat64\0madvise\0mincore\0" -+ "mkdir\0mkdirat\0mknod\0mknodat\0mlock\0mlockall\0mmap\0mmap2\0mount\0mprotect\0" -+ "mq_getsetattr\0mq_notify\0mq_open\0mq_timedreceive\0mq_timedsend\0mq_unlink\0mremap\0msync\0munlock\0munlockall\0" -+ "munmap\0name_to_handle_at\0nanosleep\0nfsservctl\0nice\0open\0open_by_handle_at\0openat\0pause\0perf_event_open\0" -+ "personality\0pipe\0pipe2\0pivot_root\0poll\0ppoll\0prctl\0pread\0preadv\0prlimit64\0" -+ "process_vm_readv\0process_vm_writev\0pselect6\0ptrace\0putpmsg\0pwrite\0pwritev\0query_module\0quotactl\0read\0" -+ "readahead\0readdir\0readlink\0readlinkat\0readv\0reboot\0remap_file_pages\0removexattr\0rename\0renameat\0" -+ "request_key\0rmdir\0rt_sigaction\0rt_sigpending\0rt_sigprocmask\0rt_sigqueueinfo\0rt_sigreturn\0rt_sigsuspend\0rt_sigtimedwait\0rt_tgsigqueueinfo\0" -+ "s390_runtime_instr\0sched_get_priority_max\0sched_get_priority_min\0sched_getaffinity\0sched_getparam\0sched_getscheduler\0sched_rr_get_interval\0sched_setaffinity\0sched_setparam\0sched_setscheduler\0" -+ "sched_yield\0sendfile\0sendfile64\0set_robust_list\0set_tid_address\0setdomainname\0setfsgid\0setfsgid32\0setfsuid\0setfsuid32\0" -+ "setgid\0setgid32\0setgroups\0setgroups32\0sethostname\0setitimer\0setns\0setpgid\0setpriority\0setregid\0" -+ "setregid32\0setresgid\0setresgid32\0setresuid\0setresuid32\0setreuid\0setreuid32\0setrlimit\0setsid\0settimeofday\0" -+ "setuid\0setuid32\0setxattr\0sigaction\0sigaltstack\0signal\0signalfd\0signalfd4\0sigpending\0sigprocmask\0" -+ "sigreturn\0sigsuspend\0socketcall\0splice\0stat\0stat64\0statfs\0statfs64\0stime\0swapoff\0" -+ "swapon\0symlink\0symlinkat\0sync\0sync_file_range\0syncfs\0sysfs\0sysinfo\0syslog\0tee\0" -+ "tgkill\0time\0timer_create\0timer_delete\0timer_getoverrun\0timer_gettime\0timer_settime\0timerfd\0timerfd_create\0timerfd_gettime\0" -+ "timerfd_settime\0times\0tkill\0truncate\0truncate64\0ugetrlimit\0umask\0umount\0umount2\0uname\0" -+ "unlink\0unlinkat\0unshare\0uselib\0ustat\0utime\0utimensat\0utimes\0vfork\0vhangup\0" -+ "vmsplice\0wait4\0waitid\0write\0writev"; -+static const unsigned s390_syscall_s2i_s[] = { -+ 0,8,19,27,34,39,47,56,68,74, -+ 82,86,93,100,106,112,118,126,133,147, -+ 160,174,190,204,210,216,222,236,250,254, -+ 259,264,277,291,301,313,324,332,341,348, -+ 353,364,374,384,397,407,421,435,442,449, -+ 458,465,474,483,489,497,507,517,530,541, -+ 547,552,565,575,581,589,597,605,615,621, -+ 631,643,649,659,675,691,698,705,714,725, -+ 733,743,751,761,768,777,787,799,809,817, -+ 825,832,840,848,860,870,882,892,904,914, -+ 924,931,938,951,958,967,976,981,993,1011, -+ 1024,1038,1055,1065,1076,1089,1098,1108,1114,1121, -+ 1132,1143,1147,1152,1163,1170,1175,1182,1191,1201, -+ 1206,1213,1223,1234,1247,1253,1263,1269,1277,1285, -+ 1293,1299,1307,1313,1321,1327,1336,1341,1347,1353, -+ 1362,1376,1386,1394,1410,1423,1433,1440,1446,1454, -+ 1465,1472,1490,1500,1511,1516,1521,1539,1546,1552, -+ 1568,1580,1585,1591,1602,1607,1613,1619,1625,1632, -+ 1642,1659,1677,1686,1693,1701,1708,1716,1729,1738, -+ 1743,1753,1761,1770,1781,1787,1794,1811,1823,1830, -+ 1839,1851,1857,1870,1884,1899,1915,1928,1942,1958, -+ 1976,1995,2018,2041,2059,2074,2093,2115,2133,2148, -+ 2167,2179,2188,2199,2215,2231,2245,2254,2265,2274, -+ 2285,2292,2301,2311,2323,2335,2345,2351,2359,2371, -+ 2380,2391,2401,2413,2423,2435,2444,2455,2465,2472, -+ 2485,2492,2501,2510,2520,2532,2539,2548,2558,2569, -+ 2581,2591,2602,2613,2620,2625,2632,2639,2648,2654, -+ 2662,2669,2677,2687,2692,2708,2715,2721,2729,2736, -+ 2740,2747,2752,2765,2778,2795,2809,2823,2831,2846, -+ 2862,2878,2884,2890,2899,2910,2921,2927,2934,2942, -+ 2948,2955,2964,2972,2979,2985,2991,3001,3008,3014, -+ 3022,3031,3037,3044,3050, -+}; -+static const int s390_syscall_s2i_i[] = { -+ 140,142,149,33,51,278,124,137,27,134, -+ 45,184,185,12,15,182,212,61,337,261, -+ 260,262,259,120,6,8,127,129,41,63, -+ 326,249,327,250,312,251,318,323,11,1, -+ 248,300,253,264,314,332,333,133,94,299, -+ 95,207,291,55,221,148,229,344,232,143, -+ 2,235,226,108,197,293,100,266,118,93, -+ 194,238,292,130,305,311,183,141,220,50, -+ 202,49,201,47,200,80,205,105,132,65, -+ 20,188,64,96,171,211,165,209,76,77, -+ 147,236,78,24,199,227,112,128,285,284, -+ 324,286,247,244,245,243,246,54,101,283, -+ 282,117,343,277,280,37,16,198,228,9, -+ 296,230,231,234,19,225,107,196,219,218, -+ 39,289,14,290,150,152,90,192,21,125, -+ 276,275,271,274,273,272,163,144,151,153, -+ 91,335,162,169,34,5,336,288,29,331, -+ 136,42,325,217,168,302,172,180,328,334, -+ 340,341,301,26,189,181,329,167,131,3, -+ 222,89,85,298,145,88,267,233,38,295, -+ 279,40,174,176,175,178,173,179,177,330, -+ 342,159,160,240,155,157,161,239,154,156, -+ 158,187,223,304,252,121,139,216,138,215, -+ 46,214,81,206,74,104,339,57,97,71, -+ 204,170,210,164,208,70,203,75,66,79, -+ 23,213,224,67,186,48,316,322,73,126, -+ 119,72,102,306,106,195,99,265,25,115, -+ 87,83,297,36,307,338,135,116,103,308, -+ 241,13,254,258,257,256,255,317,319,321, -+ 320,43,237,92,193,191,60,22,52,122, -+ 10,294,303,86,62,30,315,313,190,111, -+ 309,114,281,4,146, -+}; -+static int s390_syscall_s2i(const char *s, int *value) { -+ size_t len, i; -+ len = strlen(s); -+ { char copy[len + 1]; -+ for (i = 0; i < len; i++) { -+ char c = s[i]; -+ copy[i] = GT_ISUPPER(c) ? c - 'A' + 'a' : c; -+ } -+ copy[i] = 0; -+ return s2i__(s390_syscall_strings, s390_syscall_s2i_s, s390_syscall_s2i_i, 315, copy, value); -+ } -+} -+static const unsigned s390_syscall_i2s_direct[] = { -+ 348,547,1738,3044,1516,210,-1u,216,1201,2948, -+ 341,100,2747,1307,106,1175,-1u,-1u,1247,825, -+ 1347,2927,2485,951,2648,1686,68,-1u,1546,2985, -+ -1u,-1u,27,1511,-1u,2687,1170,1823,1293,1851, -+ 250,1580,2878,-1u,82,2285,761,2532,743,725, -+ 34,2934,-1u,1108,483,-1u,2351,-1u,-1u,2921, -+ 126,2979,254,840,817,2465,2510,-1u,-1u,2435, -+ 2371,2591,2558,2323,2455,904,914,938,2472,777, -+ 2301,-1u,2669,-1u,1761,2972,2662,1787,1753,1336, -+ 1465,2890,621,442,458,848,2359,-1u,2632,597, -+ 1114,2602,2729,2335,799,2620,1263,575,-1u,-1u, -+ 3014,976,-1u,3031,2654,2721,1143,615,2581,204, -+ 2231,2942,-1u,47,1353,2569,222,981,236,659, -+ 1729,809,435,74,2715,1568,56,2265,2245,0, -+ 705,8,541,1440,1781,3050,924,497,19,1321, -+ 1446,1327,1454,2133,2059,2148,2074,2167,1995,2018, -+ 2093,1490,1433,2413,882,-1u,1716,1602,1500,2391, -+ 860,1613,1915,1857,1884,1870,1942,1899,1928,1619, -+ 1701,112,698,86,93,2520,2179,832,1693,3008, -+ 2910,1341,2899,631,2625,1269,581,1182,958,768, -+ 751,733,2444,2380,787,2311,465,2423,892,2401, -+ 870,118,2492,2292,2274,2254,1591,1285,1277,714, -+ 489,1743,2188,2501,1253,565,967,1191,507,1213, -+ 1223,530,1811,1234,552,931,2884,643,2115,2041, -+ 2740,-1u,1089,1065,1076,1098,1055,353,264,291, -+ 313,2215,374,2752,2809,2795,2778,2765,190,160, -+ 147,174,-1u,384,2639,605,1794,-1u,-1u,-1u, -+ 1386,1423,1410,1394,1376,1362,1152,39,1839,1163, -+ 3037,1132,1121,1011,993,1038,-1u,1539,1299,1313, -+ 474,649,589,2955,1830,1206,2677,1770,449,364, -+ 1677,1607,2964,2199,675,2613,2692,2736,3022,-1u, -+ 691,301,3001,397,2991,2539,2823,324,2831,2862, -+ 2846,2548,332,1024,1585,259,277,1625,1708,1958, -+ 1552,407,421,1632,1472,1521,133,2708,2345,1642, -+ 1659,1976,1147,517, -+}; -+static const char *s390_syscall_i2s(int v) { -+ return i2s_direct__(s390_syscall_strings, s390_syscall_i2s_direct, 1, 344, v); -+} -diff --git a/lib/s390x_tables.h b/lib/s390x_tables.h -new file mode 100644 -index 0000000..36099fc ---- /dev/null -+++ b/lib/s390x_tables.h -@@ -0,0 +1,144 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char s390x_syscall_strings[] = "_sysctl\0access\0acct\0add_key\0adjtimex\0afs_syscall\0alarm\0bdflush\0brk\0capget\0" -+ "capset\0chdir\0chmod\0chown\0chroot\0clock_adjtime\0clock_getres\0clock_gettime\0clock_nanosleep\0clock_settime\0" -+ "clone\0close\0creat\0create_module\0delete_module\0dup\0dup2\0dup3\0epoll_create\0epoll_create1\0" -+ "epoll_ctl\0epoll_pwait\0epoll_wait\0eventfd\0eventfd2\0execve\0exit\0exit_group\0faccessat\0fadvise64\0" -+ "fallocate\0fanotify_init\0fanotify_mark\0fchdir\0fchmod\0fchmodat\0fchown\0fchownat\0fcntl\0fdatasync\0" -+ "fgetxattr\0finit_module\0flistxattr\0flock\0fork\0fremovexattr\0fsetxattr\0fstat\0fstatfs\0fstatfs64\0" -+ "fsync\0ftruncate\0futex\0futimesat\0get_kernel_syms\0get_robust_list\0getcpu\0getcwd\0getdents\0getegid\0" -+ "geteuid\0getgid\0getgroups\0getitimer\0getpgid\0getpgrp\0getpid\0getpmsg\0getppid\0getpriority\0" -+ "getresgid\0getresuid\0getrlimit\0getrusage\0getsid\0gettid\0gettimeofday\0getuid\0getxattr\0idle\0" -+ "init_module\0inotify_add_watch\0inotify_init\0inotify_init1\0inotify_rm_watch\0io_cancel\0io_destroy\0io_getevents\0io_setup\0io_submit\0" -+ "ioctl\0ioprio_get\0ioprio_set\0ipc\0kcmp\0kexec_load\0keyctl\0kill\0lchown\0lgetxattr\0" -+ "link\0linkat\0listxattr\0llistxattr\0lremovexattr\0lseek\0lsetxattr\0lstat\0madvise\0mincore\0" -+ "mkdir\0mkdirat\0mknod\0mknodat\0mlock\0mlockall\0mmap\0mount\0mprotect\0mq_getsetattr\0" -+ "mq_notify\0mq_open\0mq_timedreceive\0mq_timedsend\0mq_unlink\0mremap\0msync\0munlock\0munlockall\0munmap\0" -+ "name_to_handle_at\0nanosleep\0newfstatat\0nfsservctl\0nice\0open\0open_by_handle_at\0openat\0pause\0perf_event_open\0" -+ "personality\0pipe\0pipe2\0pivot_root\0poll\0ppoll\0prctl\0pread\0preadv\0prlimit64\0" -+ "process_vm_readv\0process_vm_writev\0pselect6\0ptrace\0putpmsg\0pwrite\0pwritev\0query_module\0quotactl\0read\0" -+ "readahead\0readdir\0readlink\0readlinkat\0readv\0reboot\0remap_file_pages\0removexattr\0rename\0renameat\0" -+ "request_key\0rmdir\0rt_sigaction\0rt_sigpending\0rt_sigprocmask\0rt_sigqueueinfo\0rt_sigreturn\0rt_sigsuspend\0rt_sigtimedwait\0rt_tgsigqueueinfo\0" -+ "s390_runtime_instr\0sched_get_priority_max\0sched_get_priority_min\0sched_getaffinity\0sched_getparam\0sched_getscheduler\0sched_rr_get_interval\0sched_setaffinity\0sched_setparam\0sched_setscheduler\0" -+ "sched_yield\0select\0sendfile\0set_robust_list\0set_tid_address\0setdomainname\0setfsgid\0setfsuid\0setgid\0setgroups\0" -+ "sethostname\0setitimer\0setns\0setpgid\0setpriority\0setregid\0setresgid\0setresuid\0setreuid\0setrlimit\0" -+ "setsid\0settimeofday\0setuid\0setxattr\0sigaction\0sigaltstack\0signal\0signalfd\0signalfd4\0sigpending\0" -+ "sigprocmask\0sigreturn\0sigsuspend\0socketcall\0splice\0stat\0statfs\0statfs64\0swapoff\0swapon\0" -+ "symlink\0symlinkat\0sync\0sync_file_range\0syncfs\0sysfs\0sysinfo\0syslog\0tee\0tgkill\0" -+ "timer_create\0timer_delete\0timer_getoverrun\0timer_gettime\0timer_settime\0timerfd\0timerfd_create\0timerfd_gettime\0timerfd_settime\0times\0" -+ "tkill\0truncate\0umask\0umount\0umount2\0uname\0unlink\0unlinkat\0unshare\0uselib\0" -+ "ustat\0utime\0utimensat\0utimes\0vfork\0vhangup\0vmsplice\0wait4\0waitid\0write\0" -+ "writev"; -+static const unsigned s390x_syscall_s2i_s[] = { -+ 0,8,15,20,28,37,49,55,63,67, -+ 74,81,87,93,99,106,120,133,147,163, -+ 177,183,189,195,209,223,227,232,237,250, -+ 264,274,286,297,305,314,321,326,337,347, -+ 357,367,381,395,402,409,418,425,434,440, -+ 450,460,473,484,490,495,508,518,524,532, -+ 542,548,558,564,574,590,606,613,620,629, -+ 637,645,652,662,672,680,688,695,703,711, -+ 723,733,743,753,763,770,777,790,797,806, -+ 811,823,841,854,868,885,895,906,919,928, -+ 938,944,955,966,970,975,986,993,998,1005, -+ 1015,1020,1027,1037,1048,1061,1067,1077,1083,1091, -+ 1099,1105,1113,1119,1127,1133,1142,1147,1153,1162, -+ 1176,1186,1194,1210,1223,1233,1240,1246,1254,1265, -+ 1272,1290,1300,1311,1322,1327,1332,1350,1357,1363, -+ 1379,1391,1396,1402,1413,1418,1424,1430,1436,1443, -+ 1453,1470,1488,1497,1504,1512,1519,1527,1540,1549, -+ 1554,1564,1572,1581,1592,1598,1605,1622,1634,1641, -+ 1650,1662,1668,1681,1695,1710,1726,1739,1753,1769, -+ 1787,1806,1829,1852,1870,1885,1904,1926,1944,1959, -+ 1978,1990,1997,2006,2022,2038,2052,2061,2070,2077, -+ 2087,2099,2109,2115,2123,2135,2144,2154,2164,2173, -+ 2183,2190,2203,2210,2219,2229,2241,2248,2257,2267, -+ 2278,2290,2300,2311,2322,2329,2334,2341,2350,2358, -+ 2365,2373,2383,2388,2404,2411,2417,2425,2432,2436, -+ 2443,2456,2469,2486,2500,2514,2522,2537,2553,2569, -+ 2575,2581,2590,2596,2603,2611,2617,2624,2633,2641, -+ 2648,2654,2660,2670,2677,2683,2691,2700,2706,2713, -+ 2719, -+}; -+static const int s390x_syscall_s2i_i[] = { -+ 149,33,51,278,124,137,27,134,45,184, -+ 185,12,15,212,61,337,261,260,262,259, -+ 120,6,8,127,129,41,63,326,249,327, -+ 250,312,251,318,323,11,1,248,300,253, -+ 314,332,333,133,94,299,207,291,55,148, -+ 229,344,232,143,2,235,226,108,100,266, -+ 118,93,238,292,130,305,311,183,141,202, -+ 201,200,205,105,132,65,20,188,64,96, -+ 211,209,191,77,147,236,78,199,227,112, -+ 128,285,284,324,286,247,244,245,243,246, -+ 54,283,282,117,343,277,280,37,198,228, -+ 9,296,230,231,234,19,225,107,219,218, -+ 39,289,14,290,150,152,90,21,125,276, -+ 275,271,274,273,272,163,144,151,153,91, -+ 335,162,293,169,34,5,336,288,29,331, -+ 136,42,325,217,168,302,172,180,328,334, -+ 340,341,301,26,189,181,329,167,131,3, -+ 222,89,85,298,145,88,267,233,38,295, -+ 279,40,174,176,175,178,173,179,177,330, -+ 342,159,160,240,155,157,161,239,154,156, -+ 158,142,187,304,252,121,216,215,214,206, -+ 74,104,339,57,97,204,210,208,203,75, -+ 66,79,213,224,67,186,48,316,322,73, -+ 126,119,72,102,306,106,99,265,115,87, -+ 83,297,36,307,338,135,116,103,308,241, -+ 254,258,257,256,255,317,319,321,320,43, -+ 237,92,60,22,52,122,10,294,303,86, -+ 62,30,315,313,190,111,309,114,281,4, -+ 146, -+}; -+static int s390x_syscall_s2i(const char *s, int *value) { -+ size_t len, i; -+ len = strlen(s); -+ { char copy[len + 1]; -+ for (i = 0; i < len; i++) { -+ char c = s[i]; -+ copy[i] = GT_ISUPPER(c) ? c - 'A' + 'a' : c; -+ } -+ copy[i] = 0; -+ return s2i__(s390x_syscall_strings, s390x_syscall_s2i_s, s390x_syscall_s2i_i, 281, copy, value); -+ } -+} -+static const unsigned s390x_syscall_i2s_direct[] = { -+ 321,490,1549,2713,1327,183,-1u,189,1015,2617, -+ 314,81,-1u,1113,87,-1u,-1u,-1u,1061,688, -+ 1147,2596,-1u,-1u,-1u,1497,49,-1u,1357,2654, -+ -1u,-1u,8,1322,-1u,2383,993,1634,1099,1662, -+ 223,1391,2569,-1u,63,-1u,-1u,2241,-1u,-1u, -+ 15,2603,-1u,938,434,-1u,2115,-1u,-1u,2590, -+ 99,2648,227,703,680,2183,2219,-1u,-1u,-1u, -+ -1u,2300,2267,2087,2173,-1u,753,777,2190,-1u, -+ -1u,-1u,2365,-1u,1572,2641,2358,1598,1564,1142, -+ 1265,2581,548,402,-1u,711,2123,-1u,2334,524, -+ -1u,2311,2425,2099,662,2329,1077,518,-1u,-1u, -+ 2683,806,-1u,2700,2350,2417,966,542,2290,177, -+ 2038,2611,-1u,28,1153,2278,195,811,209,574, -+ 1540,672,395,55,2411,1379,37,-1u,-1u,-1u, -+ 620,1990,484,1240,1592,2719,763,440,0,1127, -+ 1246,1133,1254,1944,1870,1959,1885,1978,1806,1829, -+ 1904,1290,1233,-1u,-1u,-1u,1527,1413,1311,-1u, -+ -1u,1424,1726,1668,1695,1681,1753,1710,1739,1430, -+ 1512,-1u,613,67,74,2229,1997,695,1504,2677, -+ 743,-1u,-1u,-1u,-1u,-1u,-1u,998,790,645, -+ 637,629,2164,2135,652,2077,418,2154,733,2144, -+ 723,93,2203,2070,2061,2052,1402,1091,1083,-1u, -+ -1u,1554,-1u,2210,1067,508,797,1005,450,1027, -+ 1037,473,1622,1048,495,770,2575,558,1926,1852, -+ 2436,-1u,919,895,906,928,885,326,237,264, -+ 286,2022,347,2443,2500,2486,2469,2456,163,133, -+ 120,147,-1u,-1u,2341,532,1605,-1u,-1u,-1u, -+ 1186,1223,1210,1194,1176,1162,975,20,1650,986, -+ 2706,955,944,841,823,868,-1u,1350,1105,1119, -+ 425,564,1300,2624,1641,1020,2373,1581,409,337, -+ 1488,1418,2633,2006,590,2322,2388,2432,2691,-1u, -+ 606,274,2670,357,2660,2248,2514,297,2522,2553, -+ 2537,2257,305,854,1396,232,250,1436,1519,1769, -+ 1363,367,381,1443,1272,1332,106,2404,2109,1453, -+ 1470,1787,970,460, -+}; -+static const char *s390x_syscall_i2s(int v) { -+ return i2s_direct__(s390x_syscall_strings, s390x_syscall_i2s_direct, 1, 344, v); -+} -diff --git a/lib/x86_64_tables.h b/lib/x86_64_tables.h -new file mode 100644 -index 0000000..d2a5673 ---- /dev/null -+++ b/lib/x86_64_tables.h -@@ -0,0 +1,150 @@ -+/* This is a generated file, see Makefile.am for its inputs. */ -+static const char x86_64_syscall_strings[] = "_sysctl\0accept\0accept4\0access\0acct\0add_key\0adjtimex\0afs_syscall\0alarm\0arch_prctl\0" -+ "bind\0brk\0capget\0capset\0chdir\0chmod\0chown\0chroot\0clock_adjtime\0clock_getres\0" -+ "clock_gettime\0clock_nanosleep\0clock_settime\0clone\0close\0connect\0creat\0create_module\0delete_module\0dup\0" -+ "dup2\0dup3\0epoll_create\0epoll_create1\0epoll_ctl\0epoll_ctl_old\0epoll_pwait\0epoll_wait\0epoll_wait_old\0eventfd\0" -+ "eventfd2\0execve\0exit\0exit_group\0faccessat\0fadvise64\0fallocate\0fanotify_init\0fanotify_mark\0fchdir\0" -+ "fchmod\0fchmodat\0fchown\0fchownat\0fcntl\0fdatasync\0fgetxattr\0finit_module\0flistxattr\0flock\0" -+ "fork\0fremovexattr\0fsetxattr\0fstat\0fstatfs\0fsync\0ftruncate\0futex\0futimesat\0get_kernel_syms\0" -+ "get_mempolicy\0get_robust_list\0get_thread_area\0getcpu\0getcwd\0getdents\0getdents64\0getegid\0geteuid\0getgid\0" -+ "getgroups\0getitimer\0getpeername\0getpgid\0getpgrp\0getpid\0getpmsg\0getppid\0getpriority\0getresgid\0" -+ "getresuid\0getrlimit\0getrusage\0getsid\0getsockname\0getsockopt\0gettid\0gettimeofday\0getuid\0getxattr\0" -+ "init_module\0inotify_add_watch\0inotify_init\0inotify_init1\0inotify_rm_watch\0io_cancel\0io_destroy\0io_getevents\0io_setup\0io_submit\0" -+ "ioctl\0ioperm\0iopl\0ioprio_get\0ioprio_set\0kcmp\0kexec_load\0keyctl\0kill\0lchown\0" -+ "lgetxattr\0link\0linkat\0listen\0listxattr\0llistxattr\0lookup_dcookie\0lremovexattr\0lseek\0lsetxattr\0" -+ "lstat\0madvise\0mbind\0migrate_pages\0mincore\0mkdir\0mkdirat\0mknod\0mknodat\0mlock\0" -+ "mlockall\0mmap\0modify_ldt\0mount\0move_pages\0mprotect\0mq_getsetattr\0mq_notify\0mq_open\0mq_timedreceive\0" -+ "mq_timedsend\0mq_unlink\0mremap\0msgctl\0msgget\0msgrcv\0msgsnd\0msync\0munlock\0munlockall\0" -+ "munmap\0name_to_handle_at\0nanosleep\0newfstatat\0nfsservctl\0open\0open_by_handle_at\0openat\0pause\0perf_event_open\0" -+ "personality\0pipe\0pipe2\0pivot_root\0poll\0ppoll\0prctl\0pread\0preadv\0prlimit64\0" -+ "process_vm_readv\0process_vm_writev\0pselect6\0ptrace\0putpmsg\0pwrite\0pwritev\0query_module\0quotactl\0read\0" -+ "readahead\0readlink\0readlinkat\0readv\0reboot\0recvfrom\0recvmmsg\0recvmsg\0remap_file_pages\0removexattr\0" -+ "rename\0renameat\0request_key\0restart_syscall\0rmdir\0rt_sigaction\0rt_sigpending\0rt_sigprocmask\0rt_sigqueueinfo\0rt_sigreturn\0" -+ "rt_sigsuspend\0rt_sigtimedwait\0rt_tgsigqueueinfo\0sched_get_priority_max\0sched_get_priority_min\0sched_getaffinity\0sched_getparam\0sched_getscheduler\0sched_rr_get_interval\0sched_setaffinity\0" -+ "sched_setparam\0sched_setscheduler\0sched_yield\0security\0select\0semctl\0semget\0semop\0semtimedop\0sendfile\0" -+ "sendmmsg\0sendmsg\0sendto\0set_mempolicy\0set_robust_list\0set_thread_area\0set_tid_address\0setdomainname\0setfsgid\0setfsuid\0" -+ "setgid\0setgroups\0sethostname\0setitimer\0setns\0setpgid\0setpriority\0setregid\0setresgid\0setresuid\0" -+ "setreuid\0setrlimit\0setsid\0setsockopt\0settimeofday\0setuid\0setxattr\0shmat\0shmctl\0shmdt\0" -+ "shmget\0shutdown\0sigaltstack\0signalfd\0signalfd4\0socket\0socketpair\0splice\0stat\0statfs\0" -+ "swapoff\0swapon\0symlink\0symlinkat\0sync\0sync_file_range\0syncfs\0sysfs\0sysinfo\0syslog\0" -+ "tee\0tgkill\0time\0timer_create\0timer_delete\0timer_getoverrun\0timer_gettime\0timer_settime\0timerfd\0timerfd_gettime\0" -+ "timerfd_settime\0times\0tkill\0truncate\0tuxcall\0umask\0umount2\0uname\0unlink\0unlinkat\0" -+ "unshare\0uselib\0ustat\0utime\0utimensat\0utimes\0vfork\0vhangup\0vmsplice\0vserver\0" -+ "wait4\0waitid\0write\0writev"; -+static const unsigned x86_64_syscall_s2i_s[] = { -+ 0,8,15,23,30,35,43,52,64,70, -+ 81,86,90,97,104,110,116,122,129,143, -+ 156,170,186,200,206,212,220,226,240,254, -+ 258,263,268,281,295,305,319,331,342,357, -+ 365,374,381,386,397,407,417,427,441,455, -+ 462,469,478,485,494,500,510,520,533,544, -+ 550,555,568,578,584,592,598,608,614,624, -+ 640,654,670,686,693,700,709,720,728,736, -+ 743,753,763,775,783,791,798,806,814,826, -+ 836,846,856,866,873,885,896,903,916,923, -+ 932,944,962,975,989,1006,1016,1027,1040,1049, -+ 1059,1065,1072,1077,1088,1099,1104,1115,1122,1127, -+ 1134,1144,1149,1156,1163,1173,1184,1199,1212,1218, -+ 1228,1234,1242,1248,1262,1270,1276,1284,1290,1298, -+ 1304,1313,1318,1329,1335,1346,1355,1369,1379,1387, -+ 1403,1416,1426,1433,1440,1447,1454,1461,1467,1475, -+ 1486,1493,1511,1521,1532,1543,1548,1566,1573,1579, -+ 1595,1607,1612,1618,1629,1634,1640,1646,1652,1659, -+ 1669,1686,1704,1713,1720,1728,1735,1743,1756,1765, -+ 1770,1780,1789,1800,1806,1813,1822,1831,1839,1856, -+ 1868,1875,1884,1896,1912,1918,1931,1945,1960,1976, -+ 1989,2003,2019,2037,2060,2083,2101,2116,2135,2157, -+ 2175,2190,2209,2221,2230,2237,2244,2251,2257,2268, -+ 2277,2286,2294,2301,2315,2331,2347,2363,2377,2386, -+ 2395,2402,2412,2424,2434,2440,2448,2460,2469,2479, -+ 2489,2498,2508,2515,2526,2539,2546,2555,2561,2568, -+ 2574,2581,2590,2602,2611,2621,2628,2639,2646,2651, -+ 2658,2666,2673,2681,2691,2696,2712,2719,2725,2733, -+ 2740,2744,2751,2756,2769,2782,2799,2813,2827,2835, -+ 2851,2867,2873,2879,2888,2896,2902,2910,2916,2923, -+ 2932,2940,2947,2953,2959,2969,2976,2982,2990,2999, -+ 3007,3013,3020,3026, -+}; -+static const int x86_64_syscall_s2i_i[] = { -+ 156,43,288,21,163,248,159,183,37,158, -+ 49,12,125,126,80,90,92,161,305,229, -+ 228,230,227,56,3,42,85,174,176,32, -+ 33,292,213,291,233,214,281,232,215,284, -+ 290,59,60,231,269,221,285,300,301,81, -+ 91,268,93,260,72,75,193,313,196,73, -+ 57,199,190,5,138,74,77,202,261,177, -+ 239,274,211,309,79,78,217,108,107,104, -+ 115,36,52,121,111,39,181,110,140,120, -+ 118,97,98,124,51,55,186,96,102,191, -+ 175,254,253,294,255,210,207,208,206,209, -+ 16,173,172,252,251,312,246,250,62,94, -+ 192,86,265,50,194,195,212,198,8,189, -+ 6,28,237,256,27,83,258,133,259,149, -+ 151,9,154,165,279,10,245,244,240,243, -+ 242,241,25,71,68,70,69,26,150,152, -+ 11,303,35,262,180,2,304,257,34,298, -+ 135,22,293,155,7,271,157,17,295,302, -+ 310,311,270,101,182,18,296,178,179,0, -+ 187,89,267,19,169,45,299,47,216,197, -+ 82,264,249,219,84,13,127,14,129,15, -+ 130,128,297,146,147,204,143,145,148,203, -+ 142,144,24,185,23,66,64,65,220,40, -+ 307,46,44,238,273,205,218,171,123,122, -+ 106,116,170,38,308,109,141,114,119,117, -+ 113,160,112,54,164,105,188,30,31,67, -+ 29,48,131,282,289,41,53,275,4,137, -+ 168,167,88,266,162,277,306,139,99,103, -+ 276,234,201,222,226,225,224,223,283,287, -+ 286,100,200,76,184,95,166,63,87,263, -+ 272,134,136,132,280,235,58,153,278,236, -+ 61,247,1,20, -+}; -+static int x86_64_syscall_s2i(const char *s, int *value) { -+ size_t len, i; -+ len = strlen(s); -+ { char copy[len + 1]; -+ for (i = 0; i < len; i++) { -+ char c = s[i]; -+ copy[i] = GT_ISUPPER(c) ? c - 'A' + 'a' : c; -+ } -+ copy[i] = 0; -+ return s2i__(x86_64_syscall_strings, x86_64_syscall_s2i_s, x86_64_syscall_s2i_i, 314, copy, value); -+ } -+} -+static const unsigned x86_64_syscall_i2s_direct[] = { -+ 1765,3020,1543,206,2646,578,1228,1629,1212,1313, -+ 1346,1486,86,1918,1945,1976,1059,1646,1728,1800, -+ 3026,23,1607,2230,2209,1426,1461,1262,1234,2574, -+ 2555,2561,254,258,1573,1511,753,64,2424,791, -+ 2268,2621,212,8,2294,1813,2286,1831,2581,81, -+ 1156,873,763,2628,2515,885,200,550,2976,374, -+ 381,3007,1122,2910,2244,2251,2237,2568,1440,1454, -+ 1447,1433,494,544,592,500,2879,598,700,693, -+ 104,455,1868,1270,1912,220,1144,2916,2673,1780, -+ 110,462,116,478,1127,2896,903,846,856,2725, -+ 2867,1713,916,2733,736,2539,2395,728,720,2440, -+ 806,783,2508,2489,2460,743,2402,2479,836,2469, -+ 826,775,2386,2377,866,90,97,1931,2003,1960, -+ 1989,2590,2953,1284,2940,1595,2947,2651,584,2719, -+ 814,2448,2175,2101,2190,2116,2037,2060,2135,1298, -+ 1467,1304,1475,2982,1318,1618,0,1640,70,43, -+ 2498,122,2691,30,2526,1329,2902,2666,2658,1806, -+ 2412,2363,1072,1065,226,932,240,624,1743,1756, -+ 1532,798,1720,52,2888,2221,896,1770,2546,1218, -+ 568,923,1134,510,1163,1173,533,1856,1199,555, -+ 2873,2751,608,2157,2083,2331,1040,1016,1027,1049, -+ 1006,670,1184,268,305,342,1839,709,2347,1896, -+ 2257,407,2756,2813,2799,2782,2769,186,156,143, -+ 170,386,331,295,2744,2969,2999,1242,2301,640, -+ 1379,1416,1403,1387,1369,1355,1104,3013,35,1884, -+ 1115,1088,1077,962,944,989,1248,1566,1276,1290, -+ 485,614,1521,2923,1875,1149,2681,1789,469,397, -+ 1704,1634,2932,2315,654,2639,2740,2696,2990,1335, -+ 2959,319,2602,2827,357,417,2851,2835,15,2611, -+ 365,281,263,1612,975,1652,1735,2019,1579,1822, -+ 427,441,1659,1493,1548,129,2712,2277,2434,686, -+ 1669,1686,1099,520, -+}; -+static const char *x86_64_syscall_i2s(int v) { -+ return i2s_direct__(x86_64_syscall_strings, x86_64_syscall_i2s_direct, 0, 313, v); -+} --- -1.7.9.5 - diff --git a/meta-agl/meta-security/recipes-security/audit/audit/audit-python-configure.patch b/meta-agl/meta-security/recipes-security/audit/audit/audit-python-configure.patch deleted file mode 100644 index f90e2133..00000000 --- a/meta-agl/meta-security/recipes-security/audit/audit/audit-python-configure.patch +++ /dev/null @@ -1,27 +0,0 @@ -From cace630b0eb42418dea4f3d98c69d0d777bfc1be Mon Sep 17 00:00:00 2001 -From: Xin Ouyang -Date: Wed, 20 Jun 2012 16:34:19 +0800 -Subject: [PATCH] audit: python cross-compile - -Signed-off-by: Xin Ouyang ---- - configure.ac | 3 ++- - 1 files changed, 2 insertions(+), 1 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 3db7d45..9a07db6 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -90,7 +90,8 @@ if test x$use_python = xno ; then - else - AC_MSG_RESULT(testing) - AM_PATH_PYTHON --if test -f /usr/include/python${am_cv_python_version}/Python.h ; then -+PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'` -+if test -f $PY_PREFIX/include/python${am_cv_python_version}/Python.h ; then - python_found="yes" - AC_MSG_NOTICE(Python bindings will be built) - else --- -1.7.7 - diff --git a/meta-agl/meta-security/recipes-security/audit/audit/audit-python.patch b/meta-agl/meta-security/recipes-security/audit/audit/audit-python.patch deleted file mode 100644 index 78fce019..00000000 --- a/meta-agl/meta-security/recipes-security/audit/audit/audit-python.patch +++ /dev/null @@ -1,31 +0,0 @@ -Remove hard coded python include directory - -Signed-off-by: Mark Hatle - -diff -ur audit-2.1.3.orig/bindings/python/Makefile.am audit-2.1.3/bindings/python/Makefile.am ---- audit-2.1.3.orig/bindings/python/Makefile.am 2011-08-15 12:31:01.000000000 -0500 -+++ audit-2.1.3/bindings/python/Makefile.am 2012-01-30 12:19:54.533959225 -0600 -@@ -25,7 +25,9 @@ - - pyexec_LTLIBRARIES = auparse.la - -+PYINC ?= /usr/include/python$(PYTHON_VERSION) -+ - auparse_la_SOURCES = auparse_python.c --auparse_la_CPPFLAGS = -I$(top_srcdir)/auparse $(AM_CPPFLAGS) -I/usr/include/python$(PYTHON_VERSION) -fno-strict-aliasing -+auparse_la_CPPFLAGS = -I$(top_srcdir)/auparse $(AM_CPPFLAGS) -I$(PYINC) -fno-strict-aliasing - auparse_la_LDFLAGS = -module -avoid-version -Wl,-z,relro - auparse_la_LIBADD = ../../auparse/libauparse.la ../../lib/libaudit.la -diff -ur audit-2.1.3.orig/swig/Makefile.am audit-2.1.3/swig/Makefile.am ---- audit-2.1.3.orig/swig/Makefile.am 2011-08-15 12:31:03.000000000 -0500 -+++ audit-2.1.3/swig/Makefile.am 2012-01-30 12:28:09.574834697 -0600 -@@ -23,7 +23,8 @@ - CONFIG_CLEAN_FILES = *.loT *.rej *.orig - AM_CFLAGS = -fPIC -DPIC -fno-strict-aliasing - PYLIBVER ?= python$(PYTHON_VERSION) --INCLUDES = -I. -I$(top_builddir) -I${top_srcdir}/lib -I/usr/include/$(PYLIBVER) -+PYINC ?= /usr/include/$(PYLIBVER) -+INCLUDES = -I. -I$(top_builddir) -I${top_srcdir}/lib -I$(PYINC) - LIBS = $(top_builddir)/lib/libaudit.la - pyexec_PYTHON = audit.py - pyexec_LTLIBRARIES = _audit.la diff --git a/meta-agl/meta-security/recipes-security/audit/audit/auditd b/meta-agl/meta-security/recipes-security/audit/audit/auditd index fcd96c9d..cda2e43d 100755 --- a/meta-agl/meta-security/recipes-security/audit/audit/auditd +++ b/meta-agl/meta-security/recipes-security/audit/audit/auditd @@ -30,7 +30,7 @@ SCRIPTNAME=/etc/init.d/"$NAME" . /etc/default/rcS -. /etc/init.d/functions +. /etc/init.d/functions # # Function that starts the daemon/service diff --git a/meta-agl/meta-security/recipes-security/audit/audit/disable-ldap.patch b/meta-agl/meta-security/recipes-security/audit/audit/disable-ldap.patch deleted file mode 100644 index 1d683c29..00000000 --- a/meta-agl/meta-security/recipes-security/audit/audit/disable-ldap.patch +++ /dev/null @@ -1,59 +0,0 @@ -Disable LDAP support - -Signed-off-by: Mark Hatle - -Disable LDAP support - -Signed-off-by: Mark Hatle - -Index: audit-2.3.2/audisp/plugins/Makefile.am -=================================================================== ---- audit-2.3.2.orig/audisp/plugins/Makefile.am -+++ audit-2.3.2/audisp/plugins/Makefile.am -@@ -22,8 +22,10 @@ - - CONFIG_CLEAN_FILES = *.loT *.rej *.orig - --SUBDIRS = builtins zos-remote remote --#SUBDIRS = builtins zos-remote -+SUBDIRS = builtins remote -+if HAVE_LDAP -+SUBDIRS += zos-remote -+endif - if HAVE_PRELUDE - SUBDIRS += prelude - endif -Index: audit-2.3.2/configure.ac -=================================================================== ---- audit-2.3.2.orig/configure.ac -+++ audit-2.3.2/configure.ac -@@ -241,6 +241,12 @@ else - fi - AM_CONDITIONAL(HAVE_PRELUDE, test x$have_prelude = xyes) - -+AC_ARG_WITH(ldap, -+AS_HELP_STRING([--with-ldap],[enable zos-remote plugin, which requires ldap]), -+use_ldap=$withval, -+use_ldap=no) -+AM_CONDITIONAL(HAVE_LDAP, test x$have_ldap = xyes) -+ - AC_MSG_CHECKING(whether to use libwrap) - AC_ARG_WITH(libwrap, - [ --with-libwrap[=PATH] Compile in libwrap (tcp_wrappers) support.], -Index: audit-2.3.2/docs/Makefile.am -=================================================================== ---- audit-2.3.2.orig/docs/Makefile.am -+++ audit-2.3.2/docs/Makefile.am -@@ -53,7 +53,9 @@ ausearch_add_expression.3 ausearch_add_t - ausearch_clear.3 \ - ausearch_next_event.3 ausearch_set_stop.3 \ - autrace.8 get_auditfail_action.3 set_aumessage_mode.3 \ --audispd.8 audispd.conf.5 audispd-zos-remote.8 libaudit.conf.5 \ --augenrules.8 \ --zos-remote.conf.5 -+audispd.8 audispd.conf.5 libaudit.conf.5 \ -+augenrules.8 - -+if HAVE_LDAP -+man_MANS += audispd-zos-remote.8 zos-remote.conf.5 -+endif diff --git a/meta-agl/meta-security/recipes-security/audit/audit/fix-swig-host-contamination.patch b/meta-agl/meta-security/recipes-security/audit/audit/fix-swig-host-contamination.patch deleted file mode 100644 index 16bb173a..00000000 --- a/meta-agl/meta-security/recipes-security/audit/audit/fix-swig-host-contamination.patch +++ /dev/null @@ -1,48 +0,0 @@ -audit: Fixed swig host contamination issue - -The audit build uses swig to generate a python wrapper. -Unfortunately, the swig info file references host include -directories. Some of these were previously noticed and -eliminated, but the one fixed here was not. - -Upstream Status: pending - -Signed-off-by: Anders Hedlund -Signed-off-by: Joe Slater - -Index: audit-2.2.1/swig/Makefile.am -=================================================================== ---- audit-2.2.1.orig/swig/Makefile.am -+++ audit-2.2.1/swig/Makefile.am -@@ -25,6 +25,7 @@ AM_CFLAGS = -fPIC -DPIC -fno-strict-alia - PYLIBVER ?= python$(PYTHON_VERSION) - PYINC ?= /usr/include/$(PYLIBVER) - INCLUDES = -I. -I$(top_builddir) -I${top_srcdir}/lib -I$(PYINC) -+STDINC ?= /usr/include - LIBS = $(top_builddir)/lib/libaudit.la - pyexec_PYTHON = audit.py - pyexec_LTLIBRARIES = _audit.la -@@ -34,7 +35,7 @@ _audit_la_HEADERS: $(top_builddir)/confi - _audit_la_DEPENDENCIES =${top_srcdir}/lib/libaudit.h ${top_builddir}/lib/libaudit.la - nodist__audit_la_SOURCES = audit_wrap.c - audit.py audit_wrap.c: ${srcdir}/auditswig.i -- swig -o audit_wrap.c -python ${INCLUDES} ${srcdir}/auditswig.i -+ swig -o audit_wrap.c -python ${INCLUDES} -I$(STDINC) ${srcdir}/auditswig.i - - CLEANFILES = audit.py* audit_wrap.c *~ - -Index: audit-2.2.1/swig/auditswig.i -=================================================================== ---- audit-2.2.1.orig/swig/auditswig.i -+++ audit-2.2.1/swig/auditswig.i -@@ -37,8 +37,8 @@ signed - #define __attribute(X) /*nothing*/ - typedef unsigned __u32; - typedef unsigned uid_t; --%include "/usr/include/linux/audit.h" -+%include "linux/audit.h" - #define __extension__ /*nothing*/ --%include "/usr/include/stdint.h" -+%include "stdint.h" - %include "../lib/libaudit.h" - diff --git a/meta-agl/meta-security/recipes-security/audit/audit_2.3.2.bb b/meta-agl/meta-security/recipes-security/audit/audit_2.3.2.bb deleted file mode 100644 index 1d7ea0f0..00000000 --- a/meta-agl/meta-security/recipes-security/audit/audit_2.3.2.bb +++ /dev/null @@ -1,102 +0,0 @@ -SUMMARY = "User space tools for kernel auditing" -DESCRIPTION = "The audit package contains the user space utilities for \ -storing and searching the audit records generated by the audit subsystem \ -in the Linux kernel." -HOMEPAGE = "http://people.redhat.com/sgrubb/audit/" -SECTION = "base" -PR = "r8" -LICENSE = "GPLv2+ & LGPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" - -SRC_URI = "http://people.redhat.com/sgrubb/audit/audit-${PV}.tar.gz \ - file://disable-ldap.patch \ - file://audit-python.patch \ - file://audit-python-configure.patch \ - file://audit-for-cross-compiling.patch \ - file://auditd \ - file://fix-swig-host-contamination.patch \ - file://auditd.service \ - file://audit-volatile.conf \ -" -SRC_URI_append_arm = "file://add-system-call-table-for-ARM.patch" - -inherit autotools pythonnative update-rc.d systemd - -UPDATERCPN = "auditd" -INITSCRIPT_NAME = "auditd" -INITSCRIPT_PARAMS = "defaults" - -SYSTEMD_SERVICE_${PN} = "auditd.service" - -SRC_URI[md5sum] = "4e8d065b5cc16b77b9b61e93a9ed160e" -SRC_URI[sha256sum] = "8872e0b5392888789061db8034164305ef0e1b34543e1e7004d275f039081d29" - -DEPENDS += "python tcp-wrappers libcap-ng linux-libc-headers (>= 2.6.30)" - -EXTRA_OECONF += "--without-prelude \ - --with-libwrap \ - --enable-gssapi-krb5=no \ - --without-ldap \ - --with-libcap-ng=yes \ - --with-python=yes \ - --libdir=${base_libdir} \ - --sbindir=${base_sbindir} \ - " -EXTRA_OECONF_append_arm = " --with-armeb=yes" - -EXTRA_OEMAKE += "PYLIBVER='python${PYTHON_BASEVERSION}' \ - PYINC='${STAGING_INCDIR}/$(PYLIBVER)' \ - pyexecdir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \ - STDINC='${STAGING_INCDIR}' \ - " - -SUMMARY_audispd-plugins = "Plugins for the audit event dispatcher" -DESCRIPTION_audispd-plugins = "The audispd-plugins package provides plugins for the real-time \ -interface to the audit system, audispd. These plugins can do things \ -like relay events to remote machines or analyze events for suspicious \ -behavior." - -PACKAGES =+ "audispd-plugins" -PACKAGES += "auditd ${PN}-python" - -FILES_${PN} = "${sysconfdir}/libaudit.conf ${base_libdir}/libaudit.so.1* ${base_libdir}/libauparse.so.*" -FILES_auditd += "${bindir}/* ${base_sbindir}/* ${sysconfdir}/*" -FILES_audispd-plugins += "${sysconfdir}/audisp/audisp-remote.conf \ - ${sysconfdir}/audisp/plugins.d/au-remote.conf \ - ${sbindir}/audisp-remote ${localstatedir}/spool/audit \ - " -FILES_${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/*/.debug" -FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}" -FILES_${PN}-dev += "${base_libdir}/*.so ${base_libdir}/*.la" - -CONFFILES_auditd += "${sysconfdir}/audit/audit.rules" -RDEPENDS_auditd += "bash" - -do_install_append() { - rm -f ${D}/${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.a - rm -f ${D}/${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.la - - # reuse auditd config - [ ! -e ${D}/etc/default ] && mkdir ${D}/etc/default - mv ${D}/etc/sysconfig/auditd ${D}/etc/default - rmdir ${D}/etc/sysconfig/ - - # replace init.d - install -D -m 0755 ${S}/../auditd ${D}/etc/init.d/auditd - rm -rf ${D}/etc/rc.d - - if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then - install -d ${D}${sysconfdir}/tmpfiles.d/ - install -m 0644 ${WORKDIR}/audit-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ - fi - - # install systemd unit files - install -d ${D}${systemd_unitdir}/system - install -m 0644 ${WORKDIR}/auditd.service ${D}${systemd_unitdir}/system - - chmod 750 ${D}/etc/audit ${D}/etc/audit/rules.d - chmod 640 ${D}/etc/audit/auditd.conf ${D}/etc/audit/rules.d/audit.rules - - # Based on the audit.spec "Copy default rules into place on new installation" - cp ${D}/etc/audit/rules.d/audit.rules ${D}/etc/audit/audit.rules -} diff --git a/meta-agl/meta-security/recipes-security/audit/audit_2.8.5.bb b/meta-agl/meta-security/recipes-security/audit/audit_2.8.5.bb new file mode 100644 index 00000000..af36ed5e --- /dev/null +++ b/meta-agl/meta-security/recipes-security/audit/audit_2.8.5.bb @@ -0,0 +1,106 @@ +SUMMARY = "User space tools for kernel auditing" +DESCRIPTION = "The audit package contains the user space utilities for \ +storing and searching the audit records generated by the audit subsystem \ +in the Linux kernel." +HOMEPAGE = "http://people.redhat.com/sgrubb/audit/" +SECTION = "base" +LICENSE = "GPLv2+ & LGPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" + +SRC_URI = "git://github.com/linux-audit/${BPN}-userspace.git;branch=2.8_maintenance \ + file://Add-substitue-functions-for-strndupa-rawmemchr.patch \ + file://Fixed-swig-host-contamination-issue.patch \ + file://0001-lib-i386_table.h-add-new-syscall.patch \ + file://auditd \ + file://auditd.service \ + file://audit-volatile.conf \ +" + +S = "${WORKDIR}/git" +SRCREV = "5fae55c1ad15b3cefe6890eba7311af163e9133c" + +inherit autotools python3native update-rc.d systemd + +UPDATERCPN = "auditd" +INITSCRIPT_NAME = "auditd" +INITSCRIPT_PARAMS = "defaults" + +SYSTEMD_PACKAGES = "auditd" +SYSTEMD_SERVICE_auditd = "auditd.service" + +DEPENDS += "python3 tcp-wrappers libcap-ng linux-libc-headers swig-native" + +EXTRA_OECONF += "--without-prelude \ + --with-libwrap \ + --enable-gssapi-krb5=no \ + --with-libcap-ng=yes \ + --with-python3=yes \ + --libdir=${base_libdir} \ + --sbindir=${base_sbindir} \ + --without-python \ + --without-golang \ + --disable-zos-remote \ + " +EXTRA_OECONF_append_arm = " --with-arm=yes" +EXTRA_OECONF_append_aarch64 = " --with-aarch64=yes" + +EXTRA_OEMAKE += "PYLIBVER='python${PYTHON_BASEVERSION}' \ + PYINC='${STAGING_INCDIR}/$(PYLIBVER)' \ + pyexecdir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \ + STDINC='${STAGING_INCDIR}' \ + pkgconfigdir=${libdir}/pkgconfig \ + " + +SUMMARY_audispd-plugins = "Plugins for the audit event dispatcher" +DESCRIPTION_audispd-plugins = "The audispd-plugins package provides plugins for the real-time \ +interface to the audit system, audispd. These plugins can do things \ +like relay events to remote machines or analyze events for suspicious \ +behavior." + +PACKAGES =+ "audispd-plugins" +PACKAGES += "auditd ${PN}-python" + +FILES_${PN} = "${sysconfdir}/libaudit.conf ${base_libdir}/libaudit.so.1* ${base_libdir}/libauparse.so.*" +FILES_auditd += "${bindir}/* ${base_sbindir}/* ${sysconfdir}/*" +FILES_audispd-plugins += "${sysconfdir}/audisp/audisp-remote.conf \ + ${sysconfdir}/audisp/plugins.d/au-remote.conf \ + ${sbindir}/audisp-remote ${localstatedir}/spool/audit \ + " +FILES_${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/*/.debug" +FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}" + +CONFFILES_auditd += "${sysconfdir}/audit/audit.rules" +RDEPENDS_auditd += "bash" + +do_install_append() { + rm -f ${D}/${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.a + rm -f ${D}/${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.la + + # reuse auditd config + [ ! -e ${D}/etc/default ] && mkdir ${D}/etc/default + mv ${D}/etc/sysconfig/auditd ${D}/etc/default + rmdir ${D}/etc/sysconfig/ + + # replace init.d + install -D -m 0755 ${WORKDIR}/auditd ${D}/etc/init.d/auditd + rm -rf ${D}/etc/rc.d + + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -d ${D}${sysconfdir}/tmpfiles.d/ + install -m 0644 ${WORKDIR}/audit-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ + fi + + # install systemd unit files + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/auditd.service ${D}${systemd_unitdir}/system + + # audit-2.5 doesn't install any rules by default, so we do that here + mkdir -p ${D}/etc/audit ${D}/etc/audit/rules.d + cp ${S}/rules/10-base-config.rules ${D}/etc/audit/rules.d/audit.rules + + chmod 750 ${D}/etc/audit ${D}/etc/audit/rules.d + chmod 640 ${D}/etc/audit/auditd.conf ${D}/etc/audit/rules.d/audit.rules + + # Based on the audit.spec "Copy default rules into place on new installation" + cp ${D}/etc/audit/rules.d/audit.rules ${D}/etc/audit/audit.rules +} diff --git a/meta-agl/meta-security/recipes-security/cynagora/cynagora_2.0.bb b/meta-agl/meta-security/recipes-security/cynagora/cynagora_2.0.bb index fef21c64..b34cb7d7 100644 --- a/meta-agl/meta-security/recipes-security/cynagora/cynagora_2.0.bb +++ b/meta-agl/meta-security/recipes-security/cynagora/cynagora_2.0.bb @@ -3,7 +3,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://Apache-2.0;md5=3b83ef96387f14655fc854ddc3c6bd57" SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/cynagora;protocol=https;branch=${AGL_BRANCH}" -SRCREV = "d73ac5e96eeb2f76081af3d944b30ed8e29cac39" +SRCREV = "218dad2eddcbedaede44753e64ea7c30b73b00aa" PV = "2.0+git${SRCPV}" S = "${WORKDIR}/git" diff --git a/meta-agl/meta-security/recipes-security/keyutils/keyutils/keyutils-arm-remove-m32-m64.patch b/meta-agl/meta-security/recipes-security/keyutils/keyutils/keyutils-arm-remove-m32-m64.patch deleted file mode 100644 index a049fd23..00000000 --- a/meta-agl/meta-security/recipes-security/keyutils/keyutils/keyutils-arm-remove-m32-m64.patch +++ /dev/null @@ -1,19 +0,0 @@ -Index: keyutils-1.5.5/Makefile -=================================================================== ---- keyutils-1.5.5.orig/Makefile 2011-12-20 11:05:10.000000000 +0200 -+++ keyutils-1.5.5/Makefile 2011-12-20 11:06:27.000000000 +0200 -@@ -58,12 +58,12 @@ - LNS := ln -sf - - ifeq ($(BUILDFOR),32-bit) --CFLAGS += -m32 -+#CFLAGS += -m32 - LIBDIR := /usr/lib - USRLIBDIR := /usr/lib - else - ifeq ($(BUILDFOR),64-bit) --CFLAGS += -m64 -+#CFLAGS += -m64 - LIBDIR := /usr/lib - USRLIBDIR := /usr/lib - endif diff --git a/meta-agl/meta-security/recipes-security/keyutils/keyutils/keyutils_fix_library_install.patch b/meta-agl/meta-security/recipes-security/keyutils/keyutils/keyutils_fix_library_install.patch deleted file mode 100644 index adf06430..00000000 --- a/meta-agl/meta-security/recipes-security/keyutils/keyutils/keyutils_fix_library_install.patch +++ /dev/null @@ -1,30 +0,0 @@ -Index: keyutils-1.5.5/Makefile -=================================================================== ---- keyutils-1.5.5.orig/Makefile 2011-11-30 17:27:43.000000000 +0200 -+++ keyutils-1.5.5/Makefile 2011-12-21 16:05:53.000000000 +0200 -@@ -59,13 +59,13 @@ - - ifeq ($(BUILDFOR),32-bit) - CFLAGS += -m32 --LIBDIR := /lib -+LIBDIR := /usr/lib - USRLIBDIR := /usr/lib - else - ifeq ($(BUILDFOR),64-bit) - CFLAGS += -m64 --LIBDIR := /lib64 --USRLIBDIR := /usr/lib64 -+LIBDIR := /usr/lib -+USRLIBDIR := /usr/lib - endif - endif - -@@ -152,7 +152,7 @@ - $(INSTALL) -D $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME) - $(LNS) $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SONAME) - mkdir -p $(DESTDIR)$(USRLIBDIR) -- $(LNS) $(LIBDIR)/$(SONAME) $(DESTDIR)$(USRLIBDIR)/$(DEVELLIB) -+ $(LNS) $(SONAME) $(DESTDIR)$(USRLIBDIR)/$(DEVELLIB) - $(INSTALL) -D keyctl $(DESTDIR)$(BINDIR)/keyctl - $(INSTALL) -D request-key $(DESTDIR)$(SBINDIR)/request-key - $(INSTALL) -D request-key-debug.sh $(DESTDIR)$(SHAREDIR)/request-key-debug.sh diff --git a/meta-agl/meta-security/recipes-security/keyutils/keyutils/keyutils_fix_x86-64_cflags.patch b/meta-agl/meta-security/recipes-security/keyutils/keyutils/keyutils_fix_x86-64_cflags.patch deleted file mode 100644 index 8dd22450..00000000 --- a/meta-agl/meta-security/recipes-security/keyutils/keyutils/keyutils_fix_x86-64_cflags.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: git/Makefile -=================================================================== ---- git.orig/Makefile 2012-11-16 15:40:05.258723425 +0200 -+++ git/Makefile 2012-11-16 15:41:08.978725491 +0200 -@@ -53,7 +53,7 @@ - ############################################################################### - LIBDIR := $(shell ldd /usr/bin/make | grep '\(/libc\)' | sed -e 's!.*\(/.*\)/libc[.].*!\1!') - USRLIBDIR := $(patsubst /lib/%,/usr/lib/%,$(LIBDIR)) --BUILDFOR := $(shell file /usr/bin/make | sed -e 's!.*ELF \(32\|64\)-bit.*!\1!')-bit -+BUILDFOR := 64-bit - - LNS := ln -sf - diff --git a/meta-agl/meta-security/recipes-security/keyutils/keyutils/keyutils_fix_x86_cflags.patch b/meta-agl/meta-security/recipes-security/keyutils/keyutils/keyutils_fix_x86_cflags.patch deleted file mode 100644 index 573c429b..00000000 --- a/meta-agl/meta-security/recipes-security/keyutils/keyutils/keyutils_fix_x86_cflags.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: git/Makefile -=================================================================== ---- git.orig/Makefile 2012-11-16 15:40:05.258723425 +0200 -+++ git/Makefile 2012-11-16 15:41:08.978725491 +0200 -@@ -53,7 +53,7 @@ - ############################################################################### - LIBDIR := $(shell ldd /usr/bin/make | grep '\(/libc\)' | sed -e 's!.*\(/.*\)/libc[.].*!\1!') - USRLIBDIR := $(patsubst /lib/%,/usr/lib/%,$(LIBDIR)) --BUILDFOR := $(shell file /usr/bin/make | sed -e 's!.*ELF \(32\|64\)-bit.*!\1!')-bit -+BUILDFOR := 32-bit - - LNS := ln -sf - diff --git a/meta-agl/meta-security/recipes-security/keyutils/keyutils_1.5.8.bb b/meta-agl/meta-security/recipes-security/keyutils/keyutils_1.5.8.bb deleted file mode 100644 index 46b2b622..00000000 --- a/meta-agl/meta-security/recipes-security/keyutils/keyutils_1.5.8.bb +++ /dev/null @@ -1,44 +0,0 @@ -SUMMARY = "Linux Key Management Utilities" -DESCRIPTION = "Keyutils is a set of utilities for managing the key retention \ -facility in the kernel, which can be used by filesystems, block devices and \ -more to gain and retain the authorization and encryption keys required to \ -perform secure operations." -SECTION = "base" -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://LICENCE.GPL;md5=5f6e72824f5da505c1f4a7197f004b45" - -PR = "r1" - -SRCREV = "dd64114721edca5808872190e7e2e927ee2e994c" - -SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/keyutils.git;protocol=git \ - file://keyutils_fix_library_install.patch \ - " -SRC_URI_append_arm = " file://keyutils-arm-remove-m32-m64.patch" -SRC_URI_append_x86 = " file://keyutils_fix_x86_cflags.patch" -SRC_URI_append_x86-64 = " file://keyutils_fix_x86-64_cflags.patch" - -S = "${WORKDIR}/git" - -INSTALL_FLAGS = " \ -BINDIR=${bindir} \ -SBINDIR=${sbindir} \ -INCLUDEDIR=${includedir} \ -ETCDIR=${sysconfdir} \ -LIBDIR=${libdir} \ -USRLIBDIR=${libdir} \ -SHAREDIR=${datadir} \ -MAN1=${mandir}/man1 \ -MAN3=${mandir}/man3 \ -MAN5=${mandir}/man5 \ -MAN8=${mandir}/man8 \ -DESTDIR=${D}" - -do_install() { - cd ${S} && oe_runmake ${INSTALL_FLAGS} install - - # Debugging script of unknown value, not packaged. - rm -f "${D}${datadir}/request-key-debug.sh" -} - -BBCLASSEXTEND = "native" diff --git a/meta-agl/meta-security/recipes-security/security-manager/security-manager.inc b/meta-agl/meta-security/recipes-security/security-manager/security-manager.inc index fdc5083e..e1d1f401 100644 --- a/meta-agl/meta-security/recipes-security/security-manager/security-manager.inc +++ b/meta-agl/meta-security/recipes-security/security-manager/security-manager.inc @@ -36,7 +36,7 @@ EXTRA_OECMAKE = " \ inherit systemd SYSTEMD_SERVICE_${PN} = "security-manager.service" -inherit distro_features_check +inherit features_check REQUIRED_DISTRO_FEATURES += "smack" # The upstream source code contains the Tizen-specific policy configuration files. diff --git a/meta-agl/meta-security/recipes-security/smacknet/smacknet.bb b/meta-agl/meta-security/recipes-security/smacknet/smacknet.bb index 553456ae..250cdb13 100644 --- a/meta-agl/meta-security/recipes-security/smacknet/smacknet.bb +++ b/meta-agl/meta-security/recipes-security/smacknet/smacknet.bb @@ -12,7 +12,7 @@ S = "${WORKDIR}" inherit systemd -inherit distro_features_check +inherit features_check REQUIRED_DISTRO_FEATURES = "smack" #netlabel configuration service diff --git a/meta-agl/meta-security/recipes-security/xmlsec1/xmlsec1_%.bbappend b/meta-agl/meta-security/recipes-security/xmlsec1/xmlsec1_%.bbappend deleted file mode 100644 index 9c6080fc..00000000 --- a/meta-agl/meta-security/recipes-security/xmlsec1/xmlsec1_%.bbappend +++ /dev/null @@ -1,3 +0,0 @@ -# remove the EXTRA_OECONF from the recipe to -# avoid an build error in >= YP SUMO -EXTRA_OECONF = "" diff --git a/meta-agl/scripts/ias_image_app b/meta-agl/scripts/ias_image_app deleted file mode 100755 index 6a9b55f3..00000000 --- a/meta-agl/scripts/ias_image_app +++ /dev/null @@ -1,191 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2012, Intel Corporation. -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# -# The CRC is a python translation of c code generated by (available under MIT license) -# pycrc 0.7.1 (http://www.tty1.net/pycrc/). Command line used: -# './pycrc.py --model=crc-32c --generate c --algorithm=table-driven' -# - -import argparse -import os -import struct -import errno - -__version__ = "0.0.1a" - -#======================================================================== -# IAS image creation -#======================================================================== - -MAGIC = 0x2E6B7069 -HEADER = struct.Struct('IIIIIII') - -def image (payload, ext_hdr=''): - - payload_len = round_up(len(payload)) - image_len = HEADER.size + len(ext_hdr) + payload_len + 4 - bytes = bytearray (image_len) - - type = 0x30000 - version = 0 - length = payload_len - offset = HEADER.size + len(ext_hdr) - uncomp = length ## compression not supported (yet) - hcrc = 0 - HEADER.pack_into (bytes, 0, - MAGIC, type, version, length, offset, uncomp, hcrc) - crc = crc32c_buf (bytes[0:24]) - struct.pack_into ('I', bytes, 24, crc) - - bytes[HEADER.size:offset] = ext_hdr - bytes[offset:offset+len(payload)] = payload - crc = crc32c_buf(bytes[HEADER.size:offset+length]) - struct.pack_into ('I', bytes, offset+length, crc) - - return bytes - -def multi_image (files): - - nfile = len(files) - - subimg = [] - o = 0 - for f in files: - l = len(f) - subimg.append((o, l)) - o += round_up(l) - - sizes = bytearray(4*nfile) - payload = bytearray(o) - for i in range(nfile): - o, l = subimg[i] - struct.pack_into ('I', sizes, 4*i, l) - payload[o:o+l] = files[i] - - return image (payload, sizes) - -# ======================================================================== -# Support functions. -# ======================================================================== - -def round_up (value, div=4): - """Round VALUE up to the next multiple of DIV (a power of two).""" - return (value + div - 1) & ~(div - 1) - -# ======================================================================== -# -# CRC32C -# -# Prehashed table of value to speed script execution -# -_CRC32C_TABLE = ( - - 0x00000000, 0xF26B8303, 0xE13B70F7, 0x1350F3F4, 0xC79A971F, 0x35F1141C, 0x26A1E7E8, 0xD4CA64EB, - 0x8AD958CF, 0x78B2DBCC, 0x6BE22838, 0x9989AB3B, 0x4D43CFD0, 0xBF284CD3, 0xAC78BF27, 0x5E133C24, - 0x105EC76F, 0xE235446C, 0xF165B798, 0x030E349B, 0xD7C45070, 0x25AFD373, 0x36FF2087, 0xC494A384, - 0x9A879FA0, 0x68EC1CA3, 0x7BBCEF57, 0x89D76C54, 0x5D1D08BF, 0xAF768BBC, 0xBC267848, 0x4E4DFB4B, - 0x20BD8EDE, 0xD2D60DDD, 0xC186FE29, 0x33ED7D2A, 0xE72719C1, 0x154C9AC2, 0x061C6936, 0xF477EA35, - 0xAA64D611, 0x580F5512, 0x4B5FA6E6, 0xB93425E5, 0x6DFE410E, 0x9F95C20D, 0x8CC531F9, 0x7EAEB2FA, - 0x30E349B1, 0xC288CAB2, 0xD1D83946, 0x23B3BA45, 0xF779DEAE, 0x05125DAD, 0x1642AE59, 0xE4292D5A, - 0xBA3A117E, 0x4851927D, 0x5B016189, 0xA96AE28A, 0x7DA08661, 0x8FCB0562, 0x9C9BF696, 0x6EF07595, - 0x417B1DBC, 0xB3109EBF, 0xA0406D4B, 0x522BEE48, 0x86E18AA3, 0x748A09A0, 0x67DAFA54, 0x95B17957, - 0xCBA24573, 0x39C9C670, 0x2A993584, 0xD8F2B687, 0x0C38D26C, 0xFE53516F, 0xED03A29B, 0x1F682198, - 0x5125DAD3, 0xA34E59D0, 0xB01EAA24, 0x42752927, 0x96BF4DCC, 0x64D4CECF, 0x77843D3B, 0x85EFBE38, - 0xDBFC821C, 0x2997011F, 0x3AC7F2EB, 0xC8AC71E8, 0x1C661503, 0xEE0D9600, 0xFD5D65F4, 0x0F36E6F7, - 0x61C69362, 0x93AD1061, 0x80FDE395, 0x72966096, 0xA65C047D, 0x5437877E, 0x4767748A, 0xB50CF789, - 0xEB1FCBAD, 0x197448AE, 0x0A24BB5A, 0xF84F3859, 0x2C855CB2, 0xDEEEDFB1, 0xCDBE2C45, 0x3FD5AF46, - 0x7198540D, 0x83F3D70E, 0x90A324FA, 0x62C8A7F9, 0xB602C312, 0x44694011, 0x5739B3E5, 0xA55230E6, - 0xFB410CC2, 0x092A8FC1, 0x1A7A7C35, 0xE811FF36, 0x3CDB9BDD, 0xCEB018DE, 0xDDE0EB2A, 0x2F8B6829, - 0x82F63B78, 0x709DB87B, 0x63CD4B8F, 0x91A6C88C, 0x456CAC67, 0xB7072F64, 0xA457DC90, 0x563C5F93, - 0x082F63B7, 0xFA44E0B4, 0xE9141340, 0x1B7F9043, 0xCFB5F4A8, 0x3DDE77AB, 0x2E8E845F, 0xDCE5075C, - 0x92A8FC17, 0x60C37F14, 0x73938CE0, 0x81F80FE3, 0x55326B08, 0xA759E80B, 0xB4091BFF, 0x466298FC, - 0x1871A4D8, 0xEA1A27DB, 0xF94AD42F, 0x0B21572C, 0xDFEB33C7, 0x2D80B0C4, 0x3ED04330, 0xCCBBC033, - 0xA24BB5A6, 0x502036A5, 0x4370C551, 0xB11B4652, 0x65D122B9, 0x97BAA1BA, 0x84EA524E, 0x7681D14D, - 0x2892ED69, 0xDAF96E6A, 0xC9A99D9E, 0x3BC21E9D, 0xEF087A76, 0x1D63F975, 0x0E330A81, 0xFC588982, - 0xB21572C9, 0x407EF1CA, 0x532E023E, 0xA145813D, 0x758FE5D6, 0x87E466D5, 0x94B49521, 0x66DF1622, - 0x38CC2A06, 0xCAA7A905, 0xD9F75AF1, 0x2B9CD9F2, 0xFF56BD19, 0x0D3D3E1A, 0x1E6DCDEE, 0xEC064EED, - 0xC38D26C4, 0x31E6A5C7, 0x22B65633, 0xD0DDD530, 0x0417B1DB, 0xF67C32D8, 0xE52CC12C, 0x1747422F, - 0x49547E0B, 0xBB3FFD08, 0xA86F0EFC, 0x5A048DFF, 0x8ECEE914, 0x7CA56A17, 0x6FF599E3, 0x9D9E1AE0, - 0xD3D3E1AB, 0x21B862A8, 0x32E8915C, 0xC083125F, 0x144976B4, 0xE622F5B7, 0xF5720643, 0x07198540, - 0x590AB964, 0xAB613A67, 0xB831C993, 0x4A5A4A90, 0x9E902E7B, 0x6CFBAD78, 0x7FAB5E8C, 0x8DC0DD8F, - 0xE330A81A, 0x115B2B19, 0x020BD8ED, 0xF0605BEE, 0x24AA3F05, 0xD6C1BC06, 0xC5914FF2, 0x37FACCF1, - 0x69E9F0D5, 0x9B8273D6, 0x88D28022, 0x7AB90321, 0xAE7367CA, 0x5C18E4C9, 0x4F48173D, 0xBD23943E, - 0xF36E6F75, 0x0105EC76, 0x12551F82, 0xE03E9C81, 0x34F4F86A, 0xC69F7B69, 0xD5CF889D, 0x27A40B9E, - 0x79B737BA, 0x8BDCB4B9, 0x988C474D, 0x6AE7C44E, 0xBE2DA0A5, 0x4C4623A6, 0x5F16D052, 0xAD7D5351 -) - -def crc32c (byte, crc=0xffffffff): - - crc = (crc >> 8) ^ _CRC32C_TABLE[(crc ^ byte) & 0xff] - return crc - -def crc32c_buf (buf, crc=0xffffffff): - - for b in buf: - crc = crc32c (b, crc) - return crc - -# ======================================================================== - -#======================================================================== -# Main program: Argument handling. -#======================================================================== - -def parse_args(): - """Parse the command line and return an argparse.Namespace object.""" - - parser = argparse.ArgumentParser(description='Create a NON SIGNED IAS image to be used with DEVEL-ABL.') - - parser.add_argument ('-V', '--version', - action='version', version='%(prog)s ' + __version__) - parser.add_argument ('-o', '--output', - default='image.bin', - help='write final image to OUTPUT') - parser.add_argument ('-i', '--ignore', - default='', - help='provided for script compatibility with full featured ias_image_app',) - - parser.add_argument ('file', - help='add FILE to payload of IMAGE being created', - nargs='+', - metavar='file') - - return parser.parse_args() - -# ------------------------------------------------------------------------ - -def main(): - - a = parse_args() - try: - data = [open(f, 'rb').read() for f in a.file] - except IOError: - print ('error: Cannot open', a.file) - exit (1) - print ('Creating NON signed Linux Kernel for ABL') - img = multi_image(data) - try: - open (a.output, 'wb').write (img) - except IOError as err: - print ('error: Cannot open for write', a.output) - exit (2) - -if __name__ == '__main__': - main() - -# ======================================================================== diff --git a/meta-agl/scripts/mkabl-agl.sh b/meta-agl/scripts/mkabl-agl.sh deleted file mode 100755 index 611c08fb..00000000 --- a/meta-agl/scripts/mkabl-agl.sh +++ /dev/null @@ -1,507 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2012, Intel Corporation. -# All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -# the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# Modification from mkefidisk.sh provided by the Yocto project by Dominig -# to install Automotive Grade Linux (AGL) on -# Intel platforms equipped with the Automotive Linux Boot (ABL) -# -# Dependencies: -# Relies on the Intel iasImage tool to pakage the Kernel and the initrd in ABL format -# -# changes -# - simpler use model -# - keep initrd if present -# - does not allocate swap -# - accept .hddimg, wic and wic.xz as sources -# - -LANG=C - -# Set to 1 to enable additional output -DEBUG=0 -exec 3>/dev/null - -# -# Defaults -# -# 100 Mb for the boot partition -BOOT_SIZE=100 -# min available space on TMP_DIR for uncompressing xz image in kB e.g. 5G (5000000) -TMP_SIZE_MIN=5000000 -# TMP_DIR directory use for holding image file for uncompression (e.g. /tmp or $HOME) -TMP_DIR=/tmp -# -MRB_DEBUG_TTY="ttyS2,115200n8" -MRB_HDMI="HDMI-A-1:e" -# -IAS_PATH="" -IAS_EXE="ias_image_app" -IAS_CMD_LINE=/tmp/iasCommandLine.cmd - -# Cleanup after die() -cleanup() { - debug "Syncing and unmounting devices" - # Unmount anything we mounted - unmount $ROOTFS_MNT || error "Failed to unmount $ROOTFS_MNT" - unmount $BOOTFS_MNT || error "Failed to unmount $BOOTFS_MNT" - unmount $HDDIMG_ROOTFS_MNT || error "Failed to unmount $HDDIMG_ROOTFS_MNT" - unmount $HDDIMG_MNT || error "Failed to unmount $HDDIMG_MNT" - if [ "$IMG_TYPE" = "DISK" ]; then - debug "de-attaching loop devices" - for LOOP_DEVICE in `losetup --list |grep $HDDIMG | cut -d" " -f1` ; do - losetup -d $LOOP_DEVICE 1>&3 2>&1 || error "Detaching $LOOP_DEVICE from $HDDIMG failled" - done - fi - # Remove the TMPDIR - debug "Removing temporary files" - if [ -d "$TMPDIR" ]; then - rm -rf $TMPDIR || error "Failed to remove $TMPDIR" - fi - [ -f "$TMP_DIR/TMP-AGL-wic-image.wic" ] || rm -f $TMP_DIR/TMP-AGL-wic-image.wic -} - -trap 'die "Signal Received, Aborting..."' HUP INT TERM - -# Logging routines -WARNINGS=0 -ERRORS=0 -CLEAR="$(tput sgr0)" -INFO="$(tput bold)" -RED="$(tput setaf 1)$(tput bold)" -GREEN="$(tput setaf 2)$(tput bold)" -YELLOW="$(tput setaf 3)$(tput bold)" -info() { - echo "${INFO}$1${CLEAR}" -} -error() { - ERRORS=$((ERRORS+1)) - echo "${RED}$1${CLEAR}" -} -warn() { - WARNINGS=$((WARNINGS+1)) - echo "${YELLOW}$1${CLEAR}" -} -success() { - echo "${GREEN}$1${CLEAR}" -} -die() { - error "$1" - cleanup - exit 1 -} -debug() { - if [ $DEBUG -eq 1 ]; then - echo "$1" - fi -} - -usage() { - echo "Install AGL on a removable device to boot ABL based computer" - echo "ABL on the target must accept non signed development Linux kernel" - echo "In particular is can create USB or SD bootable support for Intel MRB" - echo "" - echo "Usage: $(basename $0) [-v] [-p path_to_iasImage_tool] HDDIMG REMOVABLE_DEVICE" - echo " -v: Verbose debug" - echo " path_to_iasImage_tool: path the iasImage tool provided by Intel." - echo " HDDIMG: The hddimg file to generate the efi disk from" - echo " Supported formats are .hddimg, .wic .wic.xz" - echo " REMOVABLE_DEVICE: The block device to write the image to, e.g. /dev/sdh" - echo "ex:" - echo " mkabl-agl.sh agl-demo-platform-intel-corei7-64.wic.xz /dev/sdd" - echo " mkabl-agl.sh agl-demo-platform-intel-corei7-64.hddimg /dev/sdd" - - echo " assuming that iasImage is accessible via your default path" - exit 1 -} - -image_details() { - IMG=$1 - info "Image details" - echo " image: $(stat --printf '%N\n' $IMG)" - echo " size: $(stat -L --printf '%s bytes\n' $IMG)" - echo " modified: $(stat -L --printf '%y\n' $IMG)" - echo " type: $(file -L -b $IMG)" - echo "" -} - -device_details() { - DEV=$1 - BLOCK_SIZE=512 - - info "Device details" - echo " device: $DEVICE" - if [ -f "/sys/class/block/$DEV/device/vendor" ]; then - echo " vendor: $(cat /sys/class/block/$DEV/device/vendor)" - else - echo " vendor: UNKOWN" - fi - if [ -f "/sys/class/block/$DEV/device/model" ]; then - echo " model: $(cat /sys/class/block/$DEV/device/model)" - else - echo " model: UNKNOWN" - fi - if [ -f "/sys/class/block/$DEV/size" ]; then - echo " size: $(($(cat /sys/class/block/$DEV/size) * $BLOCK_SIZE)) bytes" - else - echo " size: UNKNOWN" - fi - echo "" -} - -unmount_device() { - grep -q $DEVICE /proc/mounts - if [ $? -eq 0 ]; then - warn "$DEVICE listed in /proc/mounts, attempting to unmount" - umount $DEVICE* 2>/dev/null - ! grep -q $DEVICE /proc/mounts && info "Unmounted successfully" - return $? - fi - return 0 -} - -unmount() { - if [ "$1" = "" ] ; then - return 0 - fi - grep -q $1 /proc/mounts - if [ $? -eq 0 ]; then - debug "Unmounting $1" - umount $1 - ! grep -q $1 /proc/mounts # check if unmounted successfully - return $? - fi - return 0 -} - -# -# Parse and validate arguments -# - -if [ "$1" = "-v" ] ; then - DEBUG=1 - exec 3>&1 - shift -fi - -if [ "$1" = "-p" ] ; then - IAS_PATH="$2""/" - shift 2 -fi - -if [ $# -ne 2 ]; then - usage -fi - -IAS_IMAGE_TOOL="$IAS_PATH$IAS_EXE" -debug "iasImage tool is: $IAS_IMAGE_TOOL" -which $IAS_IMAGE_TOOL > IAS_IMAGE_TOOL_PATH -if [ ! -x "$(command -v $IAS_IMAGE_TOOL)" ]; then - die "$IAS_IMAGE_TOOL not found pointed by the path via 'sudo; use -p option'" -fi - -HDDIMG=$1 -DEVICE=$2 - -LINK=$(readlink $DEVICE) -if [ $? -eq 0 ]; then - DEVICE="$LINK" -fi - -if [ ! -w "$DEVICE" ]; then - if [ ! -e "${DEVICE}" ] ; then - die "Device $DEVICE cannot be found" - else - die "Device $DEVICE is not writable (need to run under sudo?)" - fi -fi - -if [ ! -e "$HDDIMG" ]; then - die "HDDIMG $HDDIMG does not exist" -fi -HDDIMG_EXT=${HDDIMG##*.} -case $HDDIMG_EXT in - hddimg) - IMG_TYPE="MOUNT" - IMG_COMPRESS="NO" - debug "Detected: uncompressed image type .hddimg" - ;; - wic) - IMG_TYPE="DISK" - IMG_COMPRESS="NO" - debug "Detected: uncompressed image type .wic" - ;; - xz) - IMG_TYPE="DISK" - IMG_COMPRESS="YES" - debug "Detected: xz compressed image type .wic" - command -v xz >/dev/null 2>&1 || { die "xz command is not available, pleaes install xz package"; } - TMP_SIZE=`df -k $TMP_DIR | awk '/[0-9]%/{print $(NF-2)}'` - if [ "$TMP_SIZE" -lt "$TMP_SIZE_MIN" ]; then - die "Available space on $TMP_DIR must be at least $TMP_SIZE_MIN kB" - fi - printf "Starting decompression of the image. It may take some time ..." - xz --decompress --keep --format=auto --force --threads=0 --stdout > $TMP_DIR/TMP-AGL-wic-image.wic $HDDIMG|| \ - die "xz command failled: xz --decompress --keep --format=auto --force --threads=0 --stdout > $TMP_DIR/TMP-AGL-wic-image.wic" - HDDIMG="$TMP_DIR/TMP-AGL-wic-image.wic" - echo "Image uncompressed, starting doing real work ..." - ;; - *) - die "Unsupported image format: $HDDIMG_EXT Supported format are .hddimg .wic wic.xz" - ;; -esac -# -# Ensure the hddimg is not mounted -# -debug "will now try to umount /detach previous images" -case $IMG_TYPE in - MOUNT) - unmount "$HDDIMG" || die "Failed to unmount $HDDIMG" - ;; - DISK) - [ `losetup --list |grep $HDDIMG | wc -l ` -gt 1 ] && die "Image mounted more than once, manual cleaning required see: losetup --list" - debug "ready to attach the wic image to aloop device" - LOOP_DEVICE=`losetup --find --show $HDDIMG` && ( losetup -d $LOOP_DEVICE 1>&3 2>&1 || die "Detaching $LOOP_DEVICE from $HDDIMG failled") - ;; - *) - die "unknown image format $IMG_TYPE" - ;; -esac -# -# Check if any $DEVICE partitions are mounted -# -unmount_device || die "Failed to unmount $DEVICE" - -# -# Confirm device with user -# -image_details $HDDIMG -device_details $(basename $DEVICE) -echo -n "${INFO}Prepare ABL image on $DEVICE [y/N]?${CLEAR} " -read RESPONSE -if [ "$RESPONSE" != "y" ]; then - echo "Image creation aborted" - exit 0 -fi - - -# -# Prepare the temporary working space -# -TMPDIR=$(mktemp -d mkabldisk-XXX) || die "Failed to create temporary mounting directory." -HDDIMG_MNT=$TMPDIR/hddimg -debug "TEMPDIR is: $TMPDIR" -HDDIMG_ROOTFS_MNT=$TMPDIR/hddimg_rootfs -ROOTFS_MNT=$TMPDIR/rootfs -BOOTFS_MNT=$TMPDIR/bootfs -mkdir $HDDIMG_MNT || die "Failed to create $HDDIMG_MNT" -mkdir $HDDIMG_ROOTFS_MNT || die "Failed to create $HDDIMG_ROOTFS_MNT" -mkdir $ROOTFS_MNT || die "Failed to create $ROOTFS_MNT" -mkdir $BOOTFS_MNT || die "Failed to create $BOOTFS_MNT" - - -# -# Partition $DEVICE -# -DEVICE_SIZE=$(parted -s $DEVICE unit mb print | grep ^Disk | cut -d" " -f 3 | sed -e "s/MB//") -# If the device size is not reported there may not be a valid label -if [ "$DEVICE_SIZE" = "" ] ; then - parted -s $DEVICE mklabel msdos || die "Failed to create MSDOS partition table" - DEVICE_SIZE=$(parted -s $DEVICE unit mb print | grep ^Disk | cut -d" " -f 3 | sed -e "s/MB//") -fi -ROOTFS_SIZE=$((DEVICE_SIZE-BOOT_SIZE)) -ROOTFS_START=$((BOOT_SIZE)) -ROOTFS_END=$((ROOTFS_START+ROOTFS_SIZE)) - -# MMC devices use a partition prefix character 'p' -PART_PREFIX="" -if [ ! "${DEVICE#/dev/mmcblk}" = "${DEVICE}" ] || [ ! "${DEVICE#/dev/loop}" = "${DEVICE}" ]; then - PART_PREFIX="p" -fi -BOOTFS=$DEVICE${PART_PREFIX}1 -ROOTFS=$DEVICE${PART_PREFIX}2 - -TARGET_PART_PREFIX="" -if [ ! "${TARGET_DEVICE#/dev/mmcblk}" = "${TARGET_DEVICE}" ]; then - TARGET_PART_PREFIX="p" -fi -TARGET_ROOTFS=$TARGET_DEVICE${TARGET_PART_PREFIX}2 - -echo "" -info "Boot partition size: $BOOT_SIZE MB ($BOOTFS)" -info "ROOTFS partition size: $ROOTFS_SIZE MB ($ROOTFS)" -echo "" - -# Use MSDOS by default as GPT cannot be reliably distributed in disk image form -# as it requires the backup table to be on the last block of the device, which -# of course varies from device to device. - -info "Partitioning installation media ($DEVICE)" - -debug "Deleting partition table on $DEVICE" -dd if=/dev/zero of=$DEVICE bs=512 count=2 1>&3 2>&1 || die "Failed to zero beginning of $DEVICE" - -debug "Creating new partition table (MSDOS) on $DEVICE" -parted -s $DEVICE mklabel msdos 1>&3 2>&1 || die "Failed to create MSDOS partition table" - -debug "Creating boot partition on $BOOTFS" -parted -s $DEVICE mkpart primary 0% $BOOT_SIZE 1>&3 2>&1 || die "Failed to create BOOT partition" - -debug "Enabling boot flag on $BOOTFS" -parted -s $DEVICE set 1 boot on 1>&3 2>&1 || die "Failed to enable boot flag" - -debug "Creating ROOTFS partition on $ROOTFS" -parted -s $DEVICE mkpart primary $ROOTFS_START $ROOTFS_END 1>&3 2>&1 || die "Failed to create ROOTFS partition" - -# as blkid does not provide PARTUUID on Ubuntu LTS 14.04 we myst hack via fdisk -#ROOTFS_PARTUUID=$(blkid |grep -e "$ROOTFS" |sed -n 's/^.*PARTUUID=/PARTUUID=/p') -export LC_ALL=C -ROOTFS_DISKID=$(fdisk -l "$DEVICE" | grep -e "Disk identifier" | sed -n 's/^.*Disk identifier: 0x/PARTUUID=/p') -if [ $ROOTFS_DISKID = "" ]; then - die "Failed to read DISKID" -fi -BOOTFS_PARTUUID="$ROOTFS_DISKID-01" -ROOTFS_PARTUUID="$ROOTFS_DISKID-02" -debug "PARTUUID for ROOTFS is $ROOTFS_PARTUUID" - -if [ $DEBUG -eq 1 ]; then - parted -s $DEVICE print -fi - - -# -# Check if any $DEVICE partitions are mounted after partitioning -# -unmount_device || die "Failed to unmount $DEVICE partitions" - - -# -# Format $DEVICE partitions -# -info "Formatting partitions" -debug "Formatting $BOOTFS as ext2" -mkfs.ext2 -F -F -L BOOT $BOOTFS 1>&3 2>&1 || die "Failed to format $BOOTFS" - -debug "Formatting $ROOTFS as ext4" -mkfs.ext4 -F $ROOTFS -L "ROOT" 1>&3 2>&1 || die "Failed to format $ROOTFS" - - -# Mounting image file system on loop devices -# -case $IMG_TYPE in - - MOUNT) - debug "Mounting images and device in preparation for installation" - mount -o loop $HDDIMG $HDDIMG_MNT 1>&3 2>&1 || die "Failed to mount $HDDIMG" - mount -o loop $HDDIMG_MNT/rootfs.img $HDDIMG_ROOTFS_MNT 1>&3 2>&1 || die "Failed to mount rootfs.img" - ;; - DISK) - debug "Attaching image and mounting partitions then device in preparation for installation" - LOOP_DEVICE=`losetup --find` || die "Failled to find an available loop device see: losetup --find" - losetup -P $LOOP_DEVICE $HDDIMG 1>&3 2>&1 || die "Attaching $LOOP_DEVICE from $HDDIMG failled" - mount "$LOOP_DEVICE"p2 $HDDIMG_ROOTFS_MNT 1>&3 2>&1 || die "Failed to mount $LOOP_DEVICEp1 on $HDDIMG_ROOTFS_MNT" - mount "$LOOP_DEVICE"p1 $HDDIMG_MNT 1>&3 2>&1 || die "Failed to mount $LOOP_DEVICEp2 on $HDDIMG_MNT" - ;; - *) - die "unknown image format $IMG_TYPE" - ;; -esac - -mount $ROOTFS $ROOTFS_MNT 1>&3 2>&1 || die "Failed to mount $ROOTFS on $ROOTFS_MNT" -mount $BOOTFS $BOOTFS_MNT 1>&3 2>&1 || die "Failed to mount $BOOTFS on $BOOTFS_MNT" - -info "Preparing boot partition" -# create the config file for iasImage -# Remove any existing root= kernel parameters and: -# o Add a root= parameter with the target rootfs -# o Specify ro so fsck can be run during boot -# o Specify rootwait in case the target media is an asyncronous block device -# such as MMC or USB disks -# o Specify "quiet" to minimize boot time when using slow serial consoles - -# iasImage command line file creation -echo "root=$ROOTFS_PARTUUID" > $IAS_CMD_LINE -echo "console=$MRB_DEBUG_TTY" >> $IAS_CMD_LINE -echo "earlycon=uart8250,mmio32,0xfc000000,115200n8" >> $IAS_CMD_LINE -echo "rootwait" >> $IAS_CMD_LINE -echo "video=$MRB_HDMI" >> $IAS_CMD_LINE -echo "i915.enable_initial_modeset=1" >> $IAS_CMD_LINE -debug "temp config for iasImage is $IAS_CMD_LINE" - -if [ -f $HDDIMG_MNT/vmlinuz ]; then - KERNEL_TYPE="vmlinuz" - debug "kernel is vmlinuz" -fi -if [ -f $HDDIMG_MNT/bzimage ]; then - KERNEL_TYPE="bzimage" - debug "kernel is bzimage -> vmlinuz" -fi -if [ -f $HDDIMG_MNT/microcode.cpio ]; then - warn "initrd=microcode.cpio is not a supported configuration, microcode.cpio has been ignored" -fi -[ -z $KERNEL_TYPE ] && die "Linux kernel type in $HDDIMG is unsupported" - -if [ -f $HDDIMG_MNT/initrd ]; - then - info "creating ABL image with initramsfs" - debug "$IAS_IMAGE_TOOL -o $BOOTFS_MNT/iasImage -i 0x30000 $IAS_CMD_LINE $HDDIMG_MNT/$KERNEL_TYPE $HDDIMG_MNT/initrd" - $IAS_IMAGE_TOOL -o $BOOTFS_MNT/iasImage -i 0x30000 $IAS_CMD_LINE $HDDIMG_MNT/$KERNEL_TYPE $HDDIMG_MNT/initrd - else - info "creating ABL image without initramfs" - debug "$IAS_IMAGE_TOOL -o $BOOTFS_MNT/iasImage -i 0x30000 $IAS_CMD_LINE $HDDIMG_MNT/$KERNEL_TYPE" - $IAS_IMAGE_TOOL -o $BOOTFS_MNT/iasImage -i 0x30000 $IAS_CMD_LINE $HDDIMG_MNT/$KERNEL_TYPE -fi - -printf "Copying ROOTFS files ... " -command -v rsync >/dev/null 2>&1 # check if rsync exists -if [ $DEBUG -eq 1 ] && [ $? -eq 0 ]; then - rsync --info=progress2 -h -aHAXW --no-compress $HDDIMG_ROOTFS_MNT/* $ROOTFS_MNT 1>&3 2>&1 || die "Root FS copy failed" -else - cp -a $HDDIMG_ROOTFS_MNT/* $ROOTFS_MNT 1>&3 2>&1 || die "Root FS copy failed" -fi - -debug "removing any swap entry in /etc/fstab" -sed --in-place '/swap/d' $ROOTFS_MNT/etc/fstab -debug "fixing PARTUUID for /boot" -sed --in-place -e "s#PARTUUID=[0-9a-z-]\+\t/boot#${BOOTFS_PARTUUID}\t/boot#" $ROOTFS_MNT/etc/fstab - -printf "flushing data on removable device. May take a while ... " -sync --file-system $ROOTFS_MNT -echo done - -# We dont want udev to mount our root device while we're booting... -if [ -d $ROOTFS_MNT/etc/udev/ ] ; then - echo "$TARGET_DEVICE" >> $ROOTFS_MNT/etc/udev/mount.blacklist -fi - - -# Call cleanup to unmount devices and images and remove the TMPDIR -cleanup - -echo "" -if [ $WARNINGS -ne 0 ] && [ $ERRORS -eq 0 ]; then - echo "${YELLOW}Installation completed with warnings${CLEAR}" - echo "${YELLOW}Warnings: $WARNINGS${CLEAR}" -elif [ $ERRORS -ne 0 ]; then - echo "${RED}Installation encountered errors${CLEAR}" - echo "${RED}Errors: $ERRORS${CLEAR}" - echo "${YELLOW}Warnings: $WARNINGS${CLEAR}" -else - success "Installation completed successfully" -fi -echo "" diff --git a/meta-agl/scripts/mkefi-agl.sh b/meta-agl/scripts/mkefi-agl.sh deleted file mode 100755 index c44ecedd..00000000 --- a/meta-agl/scripts/mkefi-agl.sh +++ /dev/null @@ -1,531 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2012, Intel Corporation. -# All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -# the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# Modification from mkefidisk.sh provided by the Yocto project by Dominig -# to install Automotive Grade Linux (AGL) on Minnowboard and any PC with UEFI boot -# -# changes -# - simpler use model -# - keep initrd if present -# - create a grub config with PARTUID to ease boot from various devices automaticaly -# - add a UEFI startup.nsh script for autoboot -# - remove any configured swap is fstab -# - accept .hddimg, wic and wic.xz as sources - -LANG=C - -# Set to 1 to enable additional output -DEBUG=0 -exec 3>/dev/null - -# -# Defaults -# -# 100 Mb for the boot partition -BOOT_SIZE=100 -# min available space on TMP_DIR for uncompressing xz image in kB e.g. 5G (5000000) -TMP_SIZE_MIN=5000000 -# TMP_DIR directory use for holding image file for uncompression (e.g. /tmp or $HOME) -TMP_DIR=/tmp - -# Cleanup after die() -cleanup() { - debug "Syncing and unmounting devices" - # Unmount anything we mounted - unmount $ROOTFS_MNT || error "Failed to unmount $ROOTFS_MNT" - unmount $BOOTFS_MNT || error "Failed to unmount $BOOTFS_MNT" - unmount $HDDIMG_ROOTFS_MNT || error "Failed to unmount $HDDIMG_ROOTFS_MNT" - unmount $HDDIMG_MNT || error "Failed to unmount $HDDIMG_MNT" - if [ "$IMG_TYPE" = "DISK" ]; then - debug "de-attaching loop devices" - for LOOP_DEVICE in `losetup --list |grep $HDDIMG | cut -d" " -f1` ; do - losetup -d $LOOP_DEVICE 1>&3 2>&1 || error "Detaching $LOOP_DEVICE from $HDDIMG failled" - done - fi - - # Remove the TMPDIR - debug "Removing temporary files" - if [ -d "$TMPDIR" ]; then - rm -rf "$TMPDIR" || error "Failed to remove $TMPDIR" - fi - [ -f "$TMP_DIR/TMP-AGL-wic-image.wic" ] && rm -f $TMP_DIR/TMP-AGL-wic-image.wic -} - -trap 'die "Signal Received, Aborting..."' HUP INT TERM - -# Logging routines -WARNINGS=0 -ERRORS=0 -CLEAR="$(tput sgr0)" -INFO="$(tput bold)" -RED="$(tput setaf 1)$(tput bold)" -GREEN="$(tput setaf 2)$(tput bold)" -YELLOW="$(tput setaf 3)$(tput bold)" -info() { - echo "${INFO}$1${CLEAR}" -} -error() { - ERRORS=$((ERRORS+1)) - echo "${RED}$1${CLEAR}" -} -warn() { - WARNINGS=$((WARNINGS+1)) - echo "${YELLOW}$1${CLEAR}" -} -success() { - echo "${GREEN}$1${CLEAR}" -} -die() { - error "$1" - cleanup - exit 1 -} -debug() { - if [ $DEBUG -eq 1 ]; then - echo "$1" - fi -} - -usage() { - echo "Install AGL on a removable device to boot on IA UEFI based computer" - echo "In particular is can create USB or SD bootable support for Minnowboard" - echo "" - echo "Usage: $(basename $0) [-v] IDSK_IMAGE REMOVABLE_DEVICE" - echo " -v: Verbose debug" - echo " HDDIMG: The DISK_IMAGE file generated by Yocto the efi disk from" - echo " Supported formats are .hddimg, .wic .wic.xz" - echo " REMOVABLE_DEVICE: The block device to write the image to, e.g. /dev/sdh" - echo "ex:" - echo " mkefi-agl.sh agl-demo-platform-intel-corei7-64.hddimg /dev/sdd" - echo " mkefi-agl.sh agl-demo-platform-intel-corei7-64.wic.xz /dev/sdd" - exit 1 -} - -image_details() { - IMG=$1 - info "Image details" - echo " image: $(stat --printf '%N\n' $IMG)" - echo " size: $(stat -L --printf '%s bytes\n' $IMG)" - echo " modified: $(stat -L --printf '%y\n' $IMG)" - echo " type: $(file -L -b $IMG)" - echo "" -} - -device_details() { - DEV=$1 - BLOCK_SIZE=512 - - info "Device details" - echo " device: $DEVICE" - if [ -f "/sys/class/block/$DEV/device/vendor" ]; then - echo " vendor: $(cat /sys/class/block/$DEV/device/vendor)" - else - echo " vendor: UNKOWN" - fi - if [ -f "/sys/class/block/$DEV/device/model" ]; then - echo " model: $(cat /sys/class/block/$DEV/device/model)" - else - echo " model: UNKNOWN" - fi - if [ -f "/sys/class/block/$DEV/size" ]; then - echo " size: $(($(cat /sys/class/block/$DEV/size) * $BLOCK_SIZE)) bytes" - else - echo " size: UNKNOWN" - fi - echo "" -} - -unmount_device() { - grep -q $DEVICE /proc/mounts - if [ $? -eq 0 ]; then - warn "$DEVICE listed in /proc/mounts, attempting to unmount" - umount $DEVICE* 2>/dev/null - ! grep -q $DEVICE /proc/mounts && info "Unmounted successfully" - return $? - fi - return 0 -} - -unmount() { - if [ "$1" = "" ] ; then - return 0 - fi - grep -q $1 /proc/mounts - if [ $? -eq 0 ]; then - debug "Unmounting $1" - umount $1 - ! grep -q $1 /proc/mounts # check if unmounted successfully - return $? - fi - return 0 -} - -# -# Parse and validate arguments -# -if [ "$1" != "-v" ] && [ $# -ne 2 ]; then - usage -fi -if [ "$1" = "-v" ] && [ $# -ne 3 ]; then - usage -fi - -if [ "$1" = "-v" ] ; then - DEBUG=1 - exec 3>&1 - shift -fi - -HDDIMG=$1 -DEVICE=$2 - -LINK=$(readlink $DEVICE) -if [ $? -eq 0 ]; then - DEVICE="$LINK" -fi - -if [ ! -w "$DEVICE" ]; then - if [ ! -e "${DEVICE}" ] ; then - die "Device $DEVICE cannot be found" - else - die "Device $DEVICE is not writable (need to run under sudo?)" - fi -fi - -if [ ! -e "$HDDIMG" ]; then - die "HDDIMG $HDDIMG does not exist" -fi -HDDIMG_EXT=${HDDIMG##*.} -case $HDDIMG_EXT in - hddimg) - IMG_TYPE="MOUNT" - IMG_COMPRESS="NO" - debug "Detected: uncompressed image type .hddimg" - ;; - wic) - IMG_TYPE="DISK" - IMG_COMPRESS="NO" - debug "Detected: uncompressed image type .wic" - ;; - xz) - IMG_TYPE="DISK" - IMG_COMPRESS="YES" - debug "Detected: xz compressed image type .wic" - command -v xz >/dev/null 2>&1 || { die "xz command is not available, pleaes install xz package"; } - TMP_SIZE=`df -k $TMP_DIR | awk '/[0-9]%/{print $(NF-2)}'` - if [ "$TMP_SIZE" -lt "$TMP_SIZE_MIN" ]; then - die "Available space on $TMP_DIR must be at least $TMP_SIZE_MIN kB" - fi - printf "Starting decompression of the image. It may take some time ..." - xz --decompress --keep --format=auto --force --threads=0 --stdout > $TMP_DIR/TMP-AGL-wic-image.wic $HDDIMG|| \ - die "xz command failled: xz --decompress --keep --format=auto --force --threads=0 --stdout > $TMP_DIR/TMP-AGL-wic-image.wic" - HDDIMG="$TMP_DIR/TMP-AGL-wic-image.wic" - echo "Image uncompressed, starting doing real work ..." - ;; - *) - die "Unsupported image format: $HDDIMG_EXT Supported format are .hddimg .wic wic.xz" - ;; -esac - -# -# Ensure the hddimg is not mounted -# -debug "will now try to umount /detach previous images" -case $IMG_TYPE in - MOUNT) - unmount "$HDDIMG" || die "Failed to unmount $HDDIMG" - ;; - DISK) - [ `losetup --list |grep $HDDIMG | wc -l ` -gt 1 ] && die "Image mounted more than once, manual cleaning required see: losetup --list" - debug "ready to attach the wic image to aloop device" - LOOP_DEVICE=`losetup --find --show $HDDIMG` && ( losetup -d $LOOP_DEVICE 1>&3 2>&1 || die "Detaching $LOOP_DEVICE from $HDDIMG failled") - ;; - *) - die "unknown image format $IMG_TYPE" - ;; -esac - -# -# Check if any $DEVICE partitions are mounted -# -unmount_device || die "Failed to unmount $DEVICE" - -# -# Confirm device with user -# -image_details $HDDIMG -device_details $(basename $DEVICE) -echo -n "${INFO}Prepare EFI image on $DEVICE [y/N]?${CLEAR} " -read RESPONSE -if [ "$RESPONSE" != "y" ]; then - die "Image creation aborted" -fi - - -# -# Prepare the temporary working space -# -TMPDIR=$(mktemp -d mkefidisk-XXX) || die "Failed to create temporary mounting directory." -HDDIMG_MNT=$TMPDIR/hddimg -HDDIMG_ROOTFS_MNT=$TMPDIR/hddimg_rootfs -ROOTFS_MNT=$TMPDIR/rootfs -BOOTFS_MNT=$TMPDIR/bootfs -mkdir $HDDIMG_MNT || die "Failed to create $HDDIMG_MNT" -mkdir $HDDIMG_ROOTFS_MNT || die "Failed to create $HDDIMG_ROOTFS_MNT" -mkdir $ROOTFS_MNT || die "Failed to create $ROOTFS_MNT" -mkdir $BOOTFS_MNT || die "Failed to create $BOOTFS_MNT" - - -# -# Partition $DEVICE -# -DEVICE_SIZE=$(parted -s $DEVICE unit mb print | grep ^Disk | cut -d" " -f 3 | sed -e "s/MB//") -# If the device size is not reported there may not be a valid label -if [ "$DEVICE_SIZE" = "" ] ; then - parted -s $DEVICE mklabel msdos || die "Failed to create MSDOS partition table" - DEVICE_SIZE=$(parted -s $DEVICE unit mb print | grep ^Disk | cut -d" " -f 3 | sed -e "s/MB//") -fi -ROOTFS_SIZE=$((DEVICE_SIZE-BOOT_SIZE)) -ROOTFS_START=$((BOOT_SIZE)) -ROOTFS_END=$((ROOTFS_START+ROOTFS_SIZE)) - -# MMC devices use a partition prefix character 'p' -PART_PREFIX="" -if [ ! "${DEVICE#/dev/mmcblk}" = "${DEVICE}" ] || [ ! "${DEVICE#/dev/nvme0n}" = "${DEVICE}" ] || [ ! "${DEVICE#/dev/loop}" = "${DEVICE}" ]; then - PART_PREFIX="p" -fi -BOOTFS=$DEVICE${PART_PREFIX}1 -ROOTFS=$DEVICE${PART_PREFIX}2 - -TARGET_PART_PREFIX="" -if [ ! "${TARGET_DEVICE#/dev/mmcblk}" = "${TARGET_DEVICE}" ] || [ ! "${TARGET_DEVICE#/dev/nvme0n}" = "${TARGET_DEVICE}" ]; then - TARGET_PART_PREFIX="p" -fi -TARGET_ROOTFS=$TARGET_DEVICE${TARGET_PART_PREFIX}2 - -echo "" -info "Boot partition size: $BOOT_SIZE MB ($BOOTFS)" -info "ROOTFS partition size: $ROOTFS_SIZE MB ($ROOTFS)" -echo "" - -# Use MSDOS by default as GPT cannot be reliably distributed in disk image form -# as it requires the backup table to be on the last block of the device, which -# of course varies from device to device. - -info "Partitioning installation media ($DEVICE)" - -debug "Deleting partition table on $DEVICE" -dd if=/dev/zero of=$DEVICE bs=512 count=2 1>&3 2>&1 || die "Failed to zero beginning of $DEVICE" - -debug "Creating new partition table (MSDOS) on $DEVICE" -parted -s $DEVICE mklabel msdos 1>&3 2>&1 || die "Failed to create MSDOS partition table" - -debug "Creating boot partition on $BOOTFS" -parted -s $DEVICE mkpart primary 0% $BOOT_SIZE 1>&3 2>&1 || die "Failed to create BOOT partition" - -debug "Enabling boot flag on $BOOTFS" -parted -s $DEVICE set 1 boot on 1>&3 2>&1 || die "Failed to enable boot flag" - -debug "Creating ROOTFS partition on $ROOTFS" -parted -s $DEVICE mkpart primary $ROOTFS_START $ROOTFS_END 1>&3 2>&1 || die "Failed to create ROOTFS partition" - -# as blkid does not provide PARTUUID on Ubuntu LTS 14.04 we myst hack via fdisk -#ROOTFS_PARTUUID=$(blkid |grep -e "$ROOTFS" |sed -n 's/^.*PARTUUID=/PARTUUID=/p') -export LC_ALL=C -ROOTFS_DISKID=$(fdisk -l "$DEVICE" | grep -e "Disk identifier" | sed -n 's/^.*Disk identifier: 0x/PARTUUID=/p') -if [ $ROOTFS_DISKID = "" ]; then - die "Failed to read DISKID" -fi -BOOTFS_PARTUUID="$ROOTFS_DISKID-01" -ROOTFS_PARTUUID="$ROOTFS_DISKID-02" -debug "PARTUUID for ROOTFS is $ROOTFS_PARTUUID" - -if [ $DEBUG -eq 1 ]; then - parted -s $DEVICE print -fi - - -# -# Check if any $DEVICE partitions are mounted after partitioning -# -unmount_device || die "Failed to unmount $DEVICE partitions" - - -# -# Format $DEVICE partitions -# -info "Formatting partitions" -debug "Formatting $BOOTFS as vfat" -if [ ! "${DEVICE#/dev/loop}" = "${DEVICE}" ]; then - mkfs.vfat -I $BOOTFS -n "EFI" 1>&3 2>&1 || die "Failed to format $BOOTFS" -else - mkfs.vfat $BOOTFS -n "EFI" 1>&3 2>&1 || die "Failed to format $BOOTFS" -fi - -debug "Formatting $ROOTFS as ext4" -mkfs.ext4 -F $ROOTFS -L "ROOT" 1>&3 2>&1 || die "Failed to format $ROOTFS" - - -# -# Mounting image file system on loop devices -# -case $IMG_TYPE in - - MOUNT) - debug "Mounting images and device in preparation for installation" - mount -o loop $HDDIMG $HDDIMG_MNT 1>&3 2>&1 || die "Failed to mount $HDDIMG" - mount -o loop $HDDIMG_MNT/rootfs.img $HDDIMG_ROOTFS_MNT 1>&3 2>&1 || die "Failed to mount rootfs.img" - ;; - DISK) - debug "Attaching image and mounting partitions then device in preparation for installation" - LOOP_DEVICE=`losetup --find` || die "Failled to find an available loop device see: losetup --find" - losetup -P $LOOP_DEVICE $HDDIMG 1>&3 2>&1 || die "Attaching $LOOP_DEVICE from $HDDIMG failled" - mount "$LOOP_DEVICE"p2 $HDDIMG_ROOTFS_MNT 1>&3 2>&1 || die "Failed to mount $LOOP_DEVICEp1 on $HDDIMG_ROOTFS_MNT" - mount "$LOOP_DEVICE"p1 $HDDIMG_MNT 1>&3 2>&1 || die "Failed to mount $LOOP_DEVICEp2 on $HDDIMG_MNT" - ;; - *) - die "unknown image format $IMG_TYPE" - ;; -esac -# Mount removable device - mount $ROOTFS $ROOTFS_MNT 1>&3 2>&1 || die "Failed to mount $ROOTFS on $ROOTFS_MNT" - mount $BOOTFS $BOOTFS_MNT 1>&3 2>&1 || die "Failed to mount $BOOTFS on $BOOTFS_MNT" - - -info "Preparing boot partition" -EFIDIR="$BOOTFS_MNT/EFI/BOOT" -if [ -f $HDDIMG_MNT/vmlinuz ]; then - cp $HDDIMG_MNT/vmlinuz $BOOTFS_MNT 1>&3 2>&1 || die "Failed to copy vmlinuz" - KERNEL_TYPE="VMLINUZ" - debug "kernel is vmlinuz" -fi -if [ -f $HDDIMG_MNT/bzimage ]; then - cp $HDDIMG_MNT/bzimage $BOOTFS_MNT 1>&3 2>&1 || die "Failed to copy bzimage" - KERNEL_TYPE="BZIMAGE" - debug "kernel is bzimage" -fi -if [ -f $HDDIMG_MNT/microcode.cpio ]; then - cp $HDDIMG_MNT/microcode.cpio $BOOTFS_MNT 1>&3 2>&1 || die "Failed to copy microcode.cpio" - debug "microcode.cpio copied" -fi -[ -z $KERNEL_TYPE ] && die "Linux kernel type in $HDDIMG is unsupported" - -if [ -f $HDDIMG_MNT/initrd ] - then - echo "initrd detected" - cp $HDDIMG_MNT/initrd $BOOTFS_MNT 1>&3 2>&1 || die "Failed to copy initrd" - else - warn "initrd missing" -fi -echo "bootx64.efi" > $BOOTFS_MNT/startup.nsh || die "Failed to create startup.nsh" -# Copy the efi loader and configs (booti*.efi and grub.cfg if it exists) -cp -r $HDDIMG_MNT/EFI $BOOTFS_MNT 1>&3 2>&1 || die "Failed to copy EFI dir" -# Silently ignore a missing systemd-boot or gummiboot loader dir (we might just be a GRUB image) -cp -r $HDDIMG_MNT/loader $BOOTFS_MNT 1>&3 2>&1 - -# Update the boot loaders configurations for an installed image -# Remove any existing root= kernel parameters and: -# o Add a root= parameter with the target rootfs -# o Specify ro so fsck can be run during boot -# o Specify rootwait in case the target media is an asyncronous block device -# such as MMC or USB disks -# o Specify "quiet" to minimize boot time when using slow serial consoles - -# Look for a GRUB installation -GRUB_CFG="$EFIDIR/grub.cfg" -if [ -e "$GRUB_CFG" ]; then - info "Configuring GRUB" - # Delete the install entry - sed -i "/menuentry 'install'/,/^}/d" $GRUB_CFG - # Delete any LABEL= strings - sed -i "s/ LABEL=[^ ]*/ /" $GRUB_CFG - # detect config initrd=microcode.cpio - if grep -q microcode $GRUB_CFG; then - warn "initrd=microcode.cpio detected, might not work on all boot configurations" - fi - sed -i "s@ root=[^ ]*@ @" $GRUB_CFG - sed -i "s@vmlinuz @vmlinuz root=$ROOTFS_PARTUUID @" $GRUB_CFG -fi - -# look for a systemd-boot loader.conf file and create a default boot entry -SYSTEMDBOOT_CFG="$BOOTFS_MNT/loader/loader.conf" -if [ -e "$SYSTEMDBOOT_CFG" ]; then - info "Configuring SYSTEMD-BOOT" - SYSTEMDBOOT_BOOT="$BOOTFS_MNT/loader/entries/boot.conf" - SYSTEMDBOOT_DEBUG="$BOOTFS_MNT/loader/entries/debug.conf" - # Delete the install entry - sed -i "/menuentry 'install'/,/^}/d" $SYSTEMDBOOT_CFG - rm -rf "$BOOTFS_MNT/loader/entries/install.conf" 1>&3 2>&1 - # Add PARTUUID to the boot entry file - if [ ! -e "$SYSTEMDBOOT_BOOT" ]; then - die "no boot.conf entry found in systemd-boot directories" - fi - # Delete any LABEL= strings - sed -i "s/ LABEL=[^ ]*/ /" $SYSTEMDBOOT_BOOT - # detect config initrd=microcode.cpio - if grep -q microcode $SYSTEMDBOOT_BOOT; then - warn "initrd=microcode.cpio detected, might not work on all boot configurations" - fi - sed -i "s@ root=[^ ]*@ @" $SYSTEMDBOOT_BOOT - sed -i "s@options @options root=$ROOTFS_PARTUUID @" $SYSTEMDBOOT_BOOT -fi - - -# Ensure we have at least one EFI bootloader configured -if [ ! -e $GRUB_CFG ] && [ ! -e $SYSTEMDBOOT_CFG ] ; then - die "No EFI bootloader configuration found" -fi - -printf "Copying ROOTFS files ... " -command -v rsync >/dev/null 2>&1 # check if rsync exists -if [ $DEBUG -eq 1 ] && [ $? -eq 0 ]; then - rsync --info=progress2 -h -aHAXW --no-compress $HDDIMG_ROOTFS_MNT/* $ROOTFS_MNT 1>&3 2>&1 || die "Root FS copy failed" -else - cp -a $HDDIMG_ROOTFS_MNT/* $ROOTFS_MNT 1>&3 2>&1 || die "Root FS copy failed" -fi -debug "removing any swap entry in /etc/fstab" -sed --in-place '/swap/d' $ROOTFS_MNT/etc/fstab -debug "fixing PARTUUID for /boot" -sed --in-place -e "s#PARTUUID=[0-9a-z-]\+\t/boot#${BOOTFS_PARTUUID}\t/boot#" $ROOTFS_MNT/etc/fstab - -printf "flushing data on removable device. May take a while ... " -sync --file-system $ROOTFS_MNT -echo done - -# We dont want udev to mount our root device while we're booting... -if [ -d $ROOTFS_MNT/etc/udev/ ] ; then - echo "$TARGET_DEVICE" >> $ROOTFS_MNT/etc/udev/mount.blacklist -fi - - -# Call cleanup to unmount devices and images and remove the TMPDIR -cleanup - -echo "" -if [ $WARNINGS -ne 0 ] && [ $ERRORS -eq 0 ]; then - echo "${YELLOW}Installation completed with warnings${CLEAR}" - echo "${YELLOW}Warnings: $WARNINGS${CLEAR}" -elif [ $ERRORS -ne 0 ]; then - echo "${RED}Installation encountered errors${CLEAR}" - echo "${RED}Errors: $ERRORS${CLEAR}" - echo "${YELLOW}Warnings: $WARNINGS${CLEAR}" -else - success "Installation completed successfully" -fi -echo "" diff --git a/meta-agl/templates/base/99_local.conf.inc b/meta-agl/templates/base/99_local.conf.inc index 871ea0eb..c4f43998 100644 --- a/meta-agl/templates/base/99_local.conf.inc +++ b/meta-agl/templates/base/99_local.conf.inc @@ -17,3 +17,17 @@ # Additional free disk space created in the image in Kbytes. #IMAGE_ROOTFS_EXTRA_SPACE="524288" +# meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init.bbappend +# AGL's compositor is started instead of weston like so +# AGL_DEFAULT_WESTONSTART ?= "/usr/bin/agl-compositor --config ${sysconfdir}/xdg/weston/weston.ini" +# you can redefine it using this variable to go back to weston, +# but be careful that this needs further changes to work ! +# Especially the AGL demo apps will not work as-is. +#AGL_DEFAULT_WESTONSTART = "/usr/bin/weston" + +# meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtwayland_%.bbappend +# This defines the QT integration. We default to xdg-shell +# AGL_DEFAULT_WM_SHELL ?= "xdg-shell" +# you can redefine it using this variable to e.g. use ivi-shell +# but be careful that this needs further changes to work ! +#AGL_DEFAULT_WM_SHELL = "" diff --git a/meta-agl/templates/base/conf-notes.txt b/meta-agl/templates/base/conf-notes.txt index 02e04678..ed020184 100644 --- a/meta-agl/templates/base/conf-notes.txt +++ b/meta-agl/templates/base/conf-notes.txt @@ -1,26 +1,45 @@ Common targets are: - - meta-agl: (core system) - - agl-profile-core: - agl-image-boot - agl-image-minimal - agl-image-minimal-qa - - - agl-profile-graphical: - agl-image-weston - - - agl-profile-graphical-qt5: - agl-image-graphical-qt5 - agl-image-graphical-qt5-crosssdk - - - agl-profile-graphical-html5 - agl-demo-platform-html5 - - - meta-agl-demo: (demo with UI) - agl-image-ivi (base for ivi targets) - agl-image-ivi-qa - agl-image-ivi-crosssdk - - agl-demo-platform (* default demo target) - agl-demo-platform-qa - agl-demo-platform-crosssdk +- meta-agl layer: + - included by default + * agl-image-boot (just enough to boot) + * agl-image-minimal (minimal filesystem with APIs) + * agl-image-minimal-crosssdk (crosssdk for ^^) + + - with 'agl-profile-graphical' + * agl-image-weston (minimal filesystem with weston) + + - with 'agl-profile-graphical-qt5' + * agl-image-graphical-qt5 (weston plus qt5 framework libs) + * agl-image-graphical-qt5-crosssdk (crosssdk for ^^) + + - with 'agl-profile-graphical-html5' + * agl-image-graphical-html5 (weston plus chromium for html5) + + - with 'agl-profile-cluster' + * agl-image-cluster (minimal image with APIs for cluster) + + - with 'agl-profile-cluster-qt5' + * agl-image-cluster-qt5 (image with QT5 and APIs for cluster) + + - with 'agl-profile-telematics' + * agl-image-telematics (image with APIs for telematics) + +- meta-agl-cluster-demo layer: (Instrument Cluster demo with UI) + - with 'agl-cluster-demo' + * agl-cluster-demo-platform (cluster demo image) + * agl-cluster-demo-platform-crosssdk (sdk for ^^) + * agl-cluster-demo-qtcompositor (cluster demo using own compositor) + +- meta-agl-telematics-demo layer: (Telematics demo w/o UI) + - with 'agl-telematics-demo' + * agl-telematics-demo-platform (telematics demo image) + * agl-telematics-demo-platform-crosssdk (sdk for ^^) + +- meta-agl-demo: (IVI demo with UI) + - with 'agl-demo' + * agl-image-ivi (base for IVI targets) + * agl-image-ivi-crosssdk (sdk for ^^) + + * agl-demo-platform (* default IVI demo target *) + * agl-demo-platform-crosssdk (sdk for ^^) diff --git a/meta-agl/templates/base/local.conf.sample b/meta-agl/templates/base/local.conf.sample index 365b6eb2..d506c818 100644 --- a/meta-agl/templates/base/local.conf.sample +++ b/meta-agl/templates/base/local.conf.sample @@ -28,14 +28,14 @@ # There are also the following hardware board target machines included for # demonstration purposes: # -#MACHINE ?= "beaglebone" +#MACHINE ?= "beaglebone-yocto" #MACHINE ?= "genericx86" #MACHINE ?= "genericx86-64" #MACHINE ?= "mpc8315e-rdb" #MACHINE ?= "edgerouter" # -# This sets the default machine to be qemux86 if no other machine is selected: -MACHINE ??= "qemux86" +# This sets the default machine to be qemux86-64 if no other machine is selected: +MACHINE ??= "qemux86-64" # # Where to place downloads @@ -124,6 +124,8 @@ PACKAGE_CLASSES ?= "package_rpm" # variable can contain the following options: # "dbg-pkgs" - add -dbg packages for all installed packages # (adds symbol information for debugging/profiling) +# "src-pkgs" - add -src packages for all installed packages +# (adds source code for debugging) # "dev-pkgs" - add -dev packages for all installed packages # (useful if you want to develop against libs in the image) # "ptest-pkgs" - add -ptest packages for all ptest-enabled packages @@ -149,7 +151,6 @@ EXTRA_IMAGE_FEATURES ?= "debug-tweaks" # - 'buildstats' collect build statistics # - 'image-mklibs' to reduce shared library files size for an image # - 'image-prelink' in order to prelink the filesystem image -# - 'image-swab' to perform host system intrusion detection # NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink # NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended USER_CLASSES ?= "buildstats image-mklibs image-prelink" @@ -158,10 +159,12 @@ USER_CLASSES ?= "buildstats image-mklibs image-prelink" # Runtime testing of images # # The build system can test booting virtual machine images under qemu (an emulator) -# after any root filesystems are created and run tests against those images. To -# enable this uncomment this line. See classes/testimage(-auto).bbclass for -# further details. -#TEST_IMAGE = "1" +# after any root filesystems are created and run tests against those images. It can also +# run tests against any SDK that are built. To enable this uncomment these lines. +# See classes/test{image,sdk}.bbclass for further details. +#IMAGE_CLASSES += "testimage testsdk" +#TESTIMAGE_AUTO_qemuall = "1" + # # Interactive shell configuration # @@ -191,7 +194,7 @@ PATCHRESOLVE = "noop" # files and damages the build in ways which may not be easily recoverable. # It's necesary to monitor /tmp, if there is no space left the build will fail # with very exotic errors. -BB_DISKMON_DIRS = "\ +BB_DISKMON_DIRS ??= "\ STOPTASKS,${TMPDIR},1G,100K \ STOPTASKS,${DL_DIR},1G,100K \ STOPTASKS,${SSTATE_DIR},1G,100K \ @@ -219,17 +222,120 @@ BB_DISKMON_DIRS = "\ #file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \ #file://.* file:///some/local/dir/sstate/PATH" +# +# AGL Project SState Mirror +# +# The AGL Project has prebuilt artefacts available for its releases, you can enable +# use of these by uncommenting the following line. This will mean the build uses +# the network to check for artefacts at the start of builds, which does slow it down +# equally, it will also speed up the builds by not having to build things if they are +# present in the cache. It assumes you can download something faster than you can build it +# which will depend on your network. +# +#SSTATE_MIRRORS ?= "file://.* http://sstate.yoctoproject.org/2.5/PATH;downloadfilename=PATH" +# For AGL: +#SSTATE_MIRRORS += "file://.* http://download.automotivelinux.org/sstate-mirror/${AGL_BRANCH}/${DEFAULTTUNE}/PATH;downloadfilename=PATH" # # Qemu configuration # -# By default qemu will build with a builtin VNC server where graphical output can be -# seen. The two lines below enable the SDL backend too. By default libsdl-native will -# be built, if you want to use your host's libSDL instead of the minimal libsdl built -# by libsdl-native then uncomment the ASSUME_PROVIDED line below. -PACKAGECONFIG_append_pn-qemu-native = " sdl" -PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl" -#ASSUME_PROVIDED += "libsdl-native" +# By default native qemu will build with a builtin VNC server where graphical output can be +# seen. The line below enables the SDL UI frontend too. +PACKAGECONFIG_append_pn-qemu-system-native = " sdl" +# By default libsdl2-native will be built, if you want to use your host's libSDL instead of +# the minimal libsdl built by libsdl2-native then uncomment the ASSUME_PROVIDED line below. +#ASSUME_PROVIDED += "libsdl2-native" + +# You can also enable the Gtk UI frontend, which takes somewhat longer to build, but adds +# a handy set of menus for controlling the emulator. +#PACKAGECONFIG_append_pn-qemu-system-native = " gtk+" + +# +# Parallelism Options +# +# These two options control how much parallelism BitBake should use. The first +# option determines how many tasks bitbake should run in parallel: +# +#BB_NUMBER_THREADS ?= "4" +# +# Default to setting automatically based on cpu count +#BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}" +# +# The second option controls how many processes make should run in parallel when +# running compile tasks: +# +#PARALLEL_MAKE ?= "-j 4" +# +# Default to setting automatically based on cpu count +#PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count()}" +# +# For a quad-core machine, BB_NUMBER_THREADS = "4", PARALLEL_MAKE = "-j 4" would +# be appropriate for example. + +# +# Hash Equivalence +# +# Enable support for automatically running a local hash equivalence server and +# instruct bitbake to use a hash equivalence aware signature generator. Hash +# equivalence improves reuse of sstate by detecting when a given sstate +# artifact can be reused as equivalent, even if the current task hash doesn't +# match the one that generated the artifact. +# +# A shared hash equivalent server can be set with ":" format +# +#BB_HASHSERVE = "auto" +#BB_SIGNATURE_HANDLER = "OEEquivHash" + + +# The network based PR service host and port +# Uncomment the following lines to enable PRservice. +# Set PRSERV_HOST to 'localhost:0' to automatically +# start local PRService. +# Set to other values to use remote PRService. +#PRSERV_HOST = "localhost:0" + + +# Archive the source and put them to ${DEPLOY_DIR}/sources/. +# +#INHERIT += "archiver" +# +# The tarball for the patched source will be created by default, and you +# can configure the archiver as follow: +# +# Create archive for: +# 1) original (or unpacked) source: +#ARCHIVER_MODE[src] = "original" +# 2) patched source: (default) +#ARCHIVER_MODE[src] = "patched" +# 3) configured source: +#ARCHIVER_MODE[src] = "configured" +# +# 4) the patches between do_unpack and do_patch: +#ARCHIVER_MODE[diff] = "1" +# set the files that you'd like to exclude from the diff: +#ARCHIVER_MODE[diff-exclude] ?= ".pc autom4te.cache patches" +# +# 5) the environment data, similar to 'bitbake -e recipe': +#ARCHIVER_MODE[dumpdata] = "1" +# +# 6) the recipe (.bb and .inc): +#ARCHIVER_MODE[recipe] = "1" +# +# 7) Whether output the .src.rpm package: +#ARCHIVER_MODE[srpm] = "1" +# +# 8) Filter the license, the recipe whose license in +# COPYLEFT_LICENSE_INCLUDE will be included, and in +# COPYLEFT_LICENSE_EXCLUDE will be excluded. +#COPYLEFT_LICENSE_INCLUDE = 'GPL* LGPL*' +#COPYLEFT_LICENSE_EXCLUDE = 'CLOSED Proprietary' +# +# 9) Config the recipe type that will be archived, the type can be +# target, native, nativesdk, cross, crosssdk and cross-canadian, +# you can set one or more types. Archive all types by default. +#COPYLEFT_RECIPE_TYPES = 'target' +# + # CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to # track the version of this file when it was generated. This can safely be ignored if diff --git a/meta-agl/templates/feature/agl-archiver/.50_FEATURE.md.swp b/meta-agl/templates/feature/agl-archiver/.50_FEATURE.md.swp deleted file mode 100644 index b9384551..00000000 Binary files a/meta-agl/templates/feature/agl-archiver/.50_FEATURE.md.swp and /dev/null differ diff --git a/meta-agl/templates/feature/agl-archiver/50_local.conf.inc b/meta-agl/templates/feature/agl-archiver/50_local.conf.inc index 946c262d..6ff284cd 100644 --- a/meta-agl/templates/feature/agl-archiver/50_local.conf.inc +++ b/meta-agl/templates/feature/agl-archiver/50_local.conf.inc @@ -1,2 +1,4 @@ INHERIT += "archiver" ARCHIVER_MODE[src] = "original" +COPYLEFT_LICENSE_INCLUDE = "*" +COPYLEFT_LICENSE_EXCLUDE += "CLOSED Proprietary Custom Firmware-* Freescale-* NXP-* TI TI-*" diff --git a/meta-agl/templates/feature/agl-ci-change-features-nogfx/included.dep b/meta-agl/templates/feature/agl-ci-change-features-nogfx/included.dep index c0e72005..64e2103c 100644 --- a/meta-agl/templates/feature/agl-ci-change-features-nogfx/included.dep +++ b/meta-agl/templates/feature/agl-ci-change-features-nogfx/included.dep @@ -1 +1 @@ -agl-demo agl-devel agl-netboot agl-pipewire agl-buildstats agl-ptest \ No newline at end of file +agl-demo agl-devel agl-netboot agl-pipewire agl-cloudproxy agl-buildstats agl-ptest diff --git a/meta-agl/templates/feature/agl-ci-change-features/included.dep b/meta-agl/templates/feature/agl-ci-change-features/included.dep index 27e9852f..64e2103c 100644 --- a/meta-agl/templates/feature/agl-ci-change-features/included.dep +++ b/meta-agl/templates/feature/agl-ci-change-features/included.dep @@ -1 +1 @@ -agl-demo agl-devel agl-netboot agl-pipewire agl-buildstats agl-ptest +agl-demo agl-devel agl-netboot agl-pipewire agl-cloudproxy agl-buildstats agl-ptest diff --git a/meta-agl/templates/feature/agl-ci/99_local.conf.inc b/meta-agl/templates/feature/agl-ci/99_local.conf.inc index 5386671b..8f6f697c 100644 --- a/meta-agl/templates/feature/agl-ci/99_local.conf.inc +++ b/meta-agl/templates/feature/agl-ci/99_local.conf.inc @@ -1 +1,4 @@ DISTRO_FEATURES_append = " AGLCI" +# opencv seems to have a parallel make bug +# ...contrib/modules/xfeatures2d/test/test_features2d.cpp:51:10: fatal error: features2d/test/test_detectors_regression.impl.hpp: No such file or directory +PARALLEL_MAKE_pn-opencv = "-j 1" diff --git a/meta-agl/templates/feature/agl-compositor/50_local.conf.inc b/meta-agl/templates/feature/agl-compositor/50_local.conf.inc deleted file mode 100644 index 4bddfb6e..00000000 --- a/meta-agl/templates/feature/agl-compositor/50_local.conf.inc +++ /dev/null @@ -1,15 +0,0 @@ -DISTRO_FEATURES_append = " agl-compositor" - -# note that these are for testing only, should be removed once the changes -# land in their respective repositories - -# shell client -AGL_BRANCH_pn-homescreen = "sandbox/mvlad/agl-compositor" -DEPENDS_append_pn-homescreen = " wayland-native wayland qtwayland qtwayland-native" - -# normal apps -AGL_BRANCH_pn-launcher = "sandbox/mvlad/agl-compositor" -AGL_BRANCH_pn-hvac = "sandbox/mvlad/agl-compositor" -DEPENDS_append_pn-hvac = " libafb-helpers-qt" -AGL_BRANCH_pn-navigation-demo = "sandbox/mvlad/agl-compositor" -AGL_BRANCH_pn-mediaplayer = "sandbox/mvlad/agl-compositor" diff --git a/meta-agl/templates/feature/agl-compositor/README_feature_agl-compositor.md b/meta-agl/templates/feature/agl-compositor/README_feature_agl-compositor.md deleted file mode 100644 index 4b5211ee..00000000 --- a/meta-agl/templates/feature/agl-compositor/README_feature_agl-compositor.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -description: Feature agl-compositor -authors: Daniel Stone ---- - -### Feature agl-compositor - -_agl-compositor_ is a new Wayland display server framework, based on the -existing libweston library. It provides AGL users an extensible framework for -window/input/output management within the display server. - -It is included as a technology preview, and is not currently ready for -production use. diff --git a/meta-agl/templates/feature/agl-egvirt/50_local.conf.inc b/meta-agl/templates/feature/agl-egvirt/50_local.conf.inc deleted file mode 100644 index 48590c40..00000000 --- a/meta-agl/templates/feature/agl-egvirt/50_local.conf.inc +++ /dev/null @@ -1,9 +0,0 @@ -#see meta-agl-devel/meta-egvirt/conf/include/agl_egvirt.inc -require conf/include/agl_egvirt.inc - -# In order to enable the agl virtualization features (agl-egvirt), -# each supported board needs to add in one of its configuration -# files (see for instance meta-agl/meta-agl-bsp/conf/include) -# the following line: -# -# MACHINE_FEATURES += "agl-egvirt" diff --git a/meta-agl/templates/feature/agl-egvirt/README_feature_agl-egvirt.md b/meta-agl/templates/feature/agl-egvirt/README_feature_agl-egvirt.md deleted file mode 100644 index 658b39f8..00000000 --- a/meta-agl/templates/feature/agl-egvirt/README_feature_agl-egvirt.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -description: Feature agl-egvirt -authors: Jan-Simon Möller ---- - -### Feature agl-egvirt - -*Description is missing - please complete file meta-agl/templates/feature/agl-egvirt/README_feature_agl-egvirt.md* - diff --git a/meta-agl/templates/feature/agl-pipewire/50_bblayers.conf.inc b/meta-agl/templates/feature/agl-pipewire/50_bblayers.conf.inc new file mode 100644 index 00000000..e05cd409 --- /dev/null +++ b/meta-agl/templates/feature/agl-pipewire/50_bblayers.conf.inc @@ -0,0 +1,7 @@ + +BBLAYERS =+ " \ + ${METADIR}/meta-agl/meta-pipewire \ + " + +# we ship our own pipewire +BBMASK += "meta-openembedded/meta-oe/recipes-multimedia/pipewire/" diff --git a/meta-agl/templates/feature/agl-pipewire/50_local.conf.inc b/meta-agl/templates/feature/agl-pipewire/50_local.conf.inc new file mode 100644 index 00000000..33838b08 --- /dev/null +++ b/meta-agl/templates/feature/agl-pipewire/50_local.conf.inc @@ -0,0 +1,2 @@ +#see meta-agl-devel/meta-pipewire/conf/include/agl-pipewire.inc +require conf/include/agl-pipewire.inc diff --git a/meta-agl/templates/feature/agl-pipewire/README_feature_agl-pipewire.md b/meta-agl/templates/feature/agl-pipewire/README_feature_agl-pipewire.md new file mode 100644 index 00000000..55e1931c --- /dev/null +++ b/meta-agl/templates/feature/agl-pipewire/README_feature_agl-pipewire.md @@ -0,0 +1,9 @@ +--- +description: Feature agl-pipewire +authors: George Kiagiadakis +--- + +### Feature agl-pipewire + +*Description is missing - please complete file meta-agl-devel/templates/feature/agl-pipewire/README_feature_agl-pipewire.md* + diff --git a/meta-agl/templates/feature/agl-profile-graphical-html5/50_bblayers.conf.inc b/meta-agl/templates/feature/agl-profile-graphical-html5/50_bblayers.conf.inc new file mode 100644 index 00000000..a35f93fb --- /dev/null +++ b/meta-agl/templates/feature/agl-profile-graphical-html5/50_bblayers.conf.inc @@ -0,0 +1,6 @@ + +BBLAYERS =+ " \ + ${METADIR}/meta-agl/meta-agl-profile-graphical-html5 \ + ${METADIR}/external/meta-python2 \ + " + diff --git a/meta-agl/templates/feature/agl-profile-graphical-html5/50_local.conf.inc b/meta-agl/templates/feature/agl-profile-graphical-html5/50_local.conf.inc new file mode 100644 index 00000000..0b2d7002 --- /dev/null +++ b/meta-agl/templates/feature/agl-profile-graphical-html5/50_local.conf.inc @@ -0,0 +1,3 @@ + +IMAGE_INSTALL_append = " packagegroup-agl-profile-graphical-html5" + diff --git a/meta-agl/templates/feature/agl-profile-graphical-html5/README_feature_agl-profile-graphical-html5.md b/meta-agl/templates/feature/agl-profile-graphical-html5/README_feature_agl-profile-graphical-html5.md new file mode 100644 index 00000000..dc00f94c --- /dev/null +++ b/meta-agl/templates/feature/agl-profile-graphical-html5/README_feature_agl-profile-graphical-html5.md @@ -0,0 +1,8 @@ +--- +description: Feature agl-profile-graphical-html5 +authors: Jacobo Aragunde Pérez +--- + +### Feature agl-profile-graphical-html5 + +Packages required to run web applications in AGL. The provided image agl-image-graphical-html5 includes the minimum set of packages required for this purpose. diff --git a/meta-agl/templates/feature/agl-profile-graphical-html5/included.dep b/meta-agl/templates/feature/agl-profile-graphical-html5/included.dep new file mode 100644 index 00000000..032609b8 --- /dev/null +++ b/meta-agl/templates/feature/agl-profile-graphical-html5/included.dep @@ -0,0 +1 @@ +agl-profile-graphical diff --git a/meta-agl/templates/feature/agl-ptest/90_local.conf.inc b/meta-agl/templates/feature/agl-ptest/90_local.conf.inc index bee38fab..4c546e70 100644 --- a/meta-agl/templates/feature/agl-ptest/90_local.conf.inc +++ b/meta-agl/templates/feature/agl-ptest/90_local.conf.inc @@ -2,8 +2,8 @@ # Enabling ptest in image ... OVERRIDES .= ":agl-ptest" -EXTRA_OECMAKE_append = " -DBUILD_TEST_WGT=TRUE" DISTRO_FEATURES_append = " ptest" EXTRA_IMAGE_FEATURES_append = " ptest-pkgs" +IMAGE_INSTALL_append = " lua-ptest xmlsec1-ptest libxml2-ptest" # / ptest diff --git a/meta-agl/templates/feature/agl-sign-wgts/50_local.conf.inc b/meta-agl/templates/feature/agl-sign-wgts/50_local.conf.inc new file mode 100644 index 00000000..fb1f6ab1 --- /dev/null +++ b/meta-agl/templates/feature/agl-sign-wgts/50_local.conf.inc @@ -0,0 +1,2 @@ +#see meta-agl/meta-agl/conf/include/agl-sign-wgts.inc +require conf/include/agl-sign-wgts.inc diff --git a/meta-agl/templates/feature/agl-sign-wgts/README_feature_agl-sign-wgts.md b/meta-agl/templates/feature/agl-sign-wgts/README_feature_agl-sign-wgts.md new file mode 100644 index 00000000..5e3b4b12 --- /dev/null +++ b/meta-agl/templates/feature/agl-sign-wgts/README_feature_agl-sign-wgts.md @@ -0,0 +1,8 @@ +--- +description: Feature agl-sign-wgts +authors: José Bollo , +--- + +### Feature agl-sign-wgts + +Activation of the signature of wgt files diff --git a/meta-agl/templates/feature/agl-sota/50_bblayers.conf.inc b/meta-agl/templates/feature/agl-sota/50_bblayers.conf.inc index 48655fdc..f3623354 100644 --- a/meta-agl/templates/feature/agl-sota/50_bblayers.conf.inc +++ b/meta-agl/templates/feature/agl-sota/50_bblayers.conf.inc @@ -1,6 +1,3 @@ BBLAYERS =+ " \ ${METADIR}/external/meta-updater \ - ${METADIR}/external/meta-openembedded/meta-filesystems \ - ${METADIR}/external/meta-openembedded/meta-python \ " - diff --git a/meta-agl/templates/feature/agl-sota/50_local.conf.inc b/meta-agl/templates/feature/agl-sota/50_local.conf.inc index 35ab3f9a..3ceb04df 100644 --- a/meta-agl/templates/feature/agl-sota/50_local.conf.inc +++ b/meta-agl/templates/feature/agl-sota/50_local.conf.inc @@ -1,10 +1,8 @@ -#see meta-updater/conf/distro/sota.conf.inc +# See meta-updater/conf/distro/sota.conf.inc INHERIT += "sota" DISTRO_FEATURES_append = " sota usrmerge" DISTRO_FEATURES_NATIVE_append = " sota" AGL_DEFAULT_INITRAMFS_FSTYPES = "cpio.gz" -# rpi4 and recent rpi3 firmwares need dtb in /boot partition -# so that they can be read by the firmware. This fixes UART -# issues for Raspberry Pi 3. For branches based on release -# Thud this fix is not present in meta-updater. -IMAGE_BOOT_FILES_append_rpi = "${@make_dtb_boot_files(d)}" +# Netboot is not obeying usrmerge distro feature +# therefore it is not compatible with agl-sota +CONFLICT_DISTRO_FEATURES += "netboot" diff --git a/meta-agl/templates/feature/agl-virt-guest-xen/50_local.conf.inc b/meta-agl/templates/feature/agl-virt-guest-xen/50_local.conf.inc new file mode 100644 index 00000000..07950559 --- /dev/null +++ b/meta-agl/templates/feature/agl-virt-guest-xen/50_local.conf.inc @@ -0,0 +1,3 @@ +# Set Xen flag + +AGL_XEN_GUEST_WANTED = "1" diff --git a/meta-agl/templates/feature/agl-weston-remoting/50_local.conf.inc b/meta-agl/templates/feature/agl-weston-remoting/50_local.conf.inc new file mode 100644 index 00000000..da1ddb3a --- /dev/null +++ b/meta-agl/templates/feature/agl-weston-remoting/50_local.conf.inc @@ -0,0 +1 @@ +DISTRO_FEATURES_append = " weston-remoting" diff --git a/meta-agl/templates/feature/agl-weston-remoting/README_feature_agl-weston-remoting.md b/meta-agl/templates/feature/agl-weston-remoting/README_feature_agl-weston-remoting.md new file mode 100644 index 00000000..03b05d49 --- /dev/null +++ b/meta-agl/templates/feature/agl-weston-remoting/README_feature_agl-weston-remoting.md @@ -0,0 +1,9 @@ +--- +description: Feature agl-weston-remoting +authors: Scott Murray +--- + +### Feature agl-weston-remoting + +Enables secondary remote display configuration using Weston's remoting feaure. + diff --git a/meta-agl/templates/feature/agl-weston-remoting/included.dep b/meta-agl/templates/feature/agl-weston-remoting/included.dep new file mode 100644 index 00000000..032609b8 --- /dev/null +++ b/meta-agl/templates/feature/agl-weston-remoting/included.dep @@ -0,0 +1 @@ +agl-profile-graphical diff --git a/meta-agl/templates/machine/bbe/50_bblayers.conf.inc b/meta-agl/templates/machine/bbe/50_bblayers.conf.inc index 0b42c9bf..b2fffb9d 100644 --- a/meta-agl/templates/machine/bbe/50_bblayers.conf.inc +++ b/meta-agl/templates/machine/bbe/50_bblayers.conf.inc @@ -1,4 +1,5 @@ BBLAYERS =+ " \ + ${METADIR}/bsp/meta-arm/meta-arm \ ${METADIR}/bsp/meta-ti \ ${METADIR}/bsp/meta-sancloud \ ${METADIR}/bsp/meta-rtlwifi \ diff --git a/meta-agl/templates/machine/bbe/README_machine_bbe.md b/meta-agl/templates/machine/bbe/README_machine_bbe.md index c32f23d4..3161a019 100644 --- a/meta-agl/templates/machine/bbe/README_machine_bbe.md +++ b/meta-agl/templates/machine/bbe/README_machine_bbe.md @@ -1,9 +1,12 @@ --- -description: Machine bbe -authors: Paul Barker +description: SanCloud BeagleBone Enhanced (BBE) +authors: SanCloud Ltd --- -### Machine bbe - -*Description is missing - please complete file meta-agl/templates/machine/bbe/README_machine_bbe.md* +### SanCloud BeagleBone Enhanced (BBE) +* [SanCloud website](https://www.sancloud.co.uk/) + +* [BeagleBone Enhanced Description](https://www.sancloud.co.uk/beaglebone-enhanced-bbe) + +* [Sancloud repositories on GitHub](https://github.com/SanCloudLtd) diff --git a/meta-agl/templates/machine/beaglebone/50_bblayers.conf.inc b/meta-agl/templates/machine/beaglebone/50_bblayers.conf.inc index f116ca28..6b932326 100644 --- a/meta-agl/templates/machine/beaglebone/50_bblayers.conf.inc +++ b/meta-agl/templates/machine/beaglebone/50_bblayers.conf.inc @@ -1 +1,4 @@ -BBLAYERS =+ "${METADIR}/bsp/meta-ti" +BBLAYERS =+ "\ + ${METADIR}/bsp/meta-arm/meta-arm \ + ${METADIR}/bsp/meta-ti \ + " diff --git a/meta-agl/templates/machine/dra7xx-evm/50_bblayers.conf.inc b/meta-agl/templates/machine/dra7xx-evm/50_bblayers.conf.inc index f116ca28..6b932326 100644 --- a/meta-agl/templates/machine/dra7xx-evm/50_bblayers.conf.inc +++ b/meta-agl/templates/machine/dra7xx-evm/50_bblayers.conf.inc @@ -1 +1,4 @@ -BBLAYERS =+ "${METADIR}/bsp/meta-ti" +BBLAYERS =+ "\ + ${METADIR}/bsp/meta-arm/meta-arm \ + ${METADIR}/bsp/meta-ti \ + " diff --git a/meta-agl/templates/machine/dragonboard-410c/50_bblayers.conf.inc b/meta-agl/templates/machine/dragonboard-410c/50_bblayers.conf.inc index 4a3cae0f..41fe3671 100644 --- a/meta-agl/templates/machine/dragonboard-410c/50_bblayers.conf.inc +++ b/meta-agl/templates/machine/dragonboard-410c/50_bblayers.conf.inc @@ -1,2 +1,2 @@ BBLAYERS =+ "${METADIR}/bsp/meta-qcom" -BBMASK .= "|bsp/meta-qcom/openembedded-layer/recipes-navigation/gpsd" +BBMASK += "bsp/meta-qcom/openembedded-layer/recipes-navigation/gpsd" diff --git a/meta-agl/templates/machine/ebisu/50_bblayers.conf.inc b/meta-agl/templates/machine/ebisu/50_bblayers.conf.inc index 7b0db440..16397c2e 100644 --- a/meta-agl/templates/machine/ebisu/50_bblayers.conf.inc +++ b/meta-agl/templates/machine/ebisu/50_bblayers.conf.inc @@ -1,3 +1,3 @@ BBLAYERS =+ "\ - ${METADIR}/bsp/meta-renesas-rcar-gen3/meta-rcar-gen3 \ + ${METADIR}/bsp/meta-renesas/meta-rcar-gen3 \ " diff --git a/meta-agl/templates/machine/ebisu/50_local.conf.inc b/meta-agl/templates/machine/ebisu/50_local.conf.inc index e780501a..c62dec4a 100644 --- a/meta-agl/templates/machine/ebisu/50_local.conf.inc +++ b/meta-agl/templates/machine/ebisu/50_local.conf.inc @@ -1,6 +1,3 @@ MACHINE = "ebisu" #see meta-agl/meta-agl-bsp/conf/include/agl_ebisu.inc require conf/include/agl_ebisu.inc - -#see meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc -#require conf/include/rcar-gen3-adas.inc diff --git a/meta-agl/templates/machine/ebisu/50_setup.sh b/meta-agl/templates/machine/ebisu/50_setup.sh index 502c2275..188da6e5 100644 --- a/meta-agl/templates/machine/ebisu/50_setup.sh +++ b/meta-agl/templates/machine/ebisu/50_setup.sh @@ -1,7 +1,7 @@ # setup proprietary gfx drivers and multimedia packages pushd $METADIR 2>/dev/null -COPY_SCRIPT="$METADIR/bsp/meta-renesas-rcar-gen3/meta-rcar-gen3/docs/sample/copyscript/copy_proprietary_softwares.sh" +COPY_SCRIPT="$METADIR/bsp/meta-renesas/meta-rcar-gen3/docs/sample/copyscript/copy_proprietary_softwares.sh" EXTRACT_DIR=$METADIR/binary-tmp #EBISU_BIN_PATH should contain the path where the .zip archive of E3 binaries is. #CUSTOM_RENESAS_CONFIG_SCRIPT should contain the custom script needed for setup. If not filled, do not failed, just warn. @@ -24,7 +24,7 @@ if [ -f $COPY_SCRIPT ]; then unzip -q -o $PROPRIETARY_BIN -d $EXTRACT_DIR done - cd $METADIR/bsp/meta-renesas-rcar-gen3/ + cd $METADIR/bsp/meta-renesas/ $COPY_SCRIPT $EXTRACT_DIR cd .. diff --git a/meta-agl/templates/machine/h3-salvator-x/50_bblayers.conf.inc b/meta-agl/templates/machine/h3-salvator-x/50_bblayers.conf.inc index 7b0db440..16397c2e 100644 --- a/meta-agl/templates/machine/h3-salvator-x/50_bblayers.conf.inc +++ b/meta-agl/templates/machine/h3-salvator-x/50_bblayers.conf.inc @@ -1,3 +1,3 @@ BBLAYERS =+ "\ - ${METADIR}/bsp/meta-renesas-rcar-gen3/meta-rcar-gen3 \ + ${METADIR}/bsp/meta-renesas/meta-rcar-gen3 \ " diff --git a/meta-agl/templates/machine/h3-salvator-x/README_machine_h3-salvator-x.md b/meta-agl/templates/machine/h3-salvator-x/README_machine_h3-salvator-x.md index 2dcdcd42..9cd793f7 100644 --- a/meta-agl/templates/machine/h3-salvator-x/README_machine_h3-salvator-x.md +++ b/meta-agl/templates/machine/h3-salvator-x/README_machine_h3-salvator-x.md @@ -1,9 +1,11 @@ --- description: Machine h3-salvator-x -authors: Jan-Simon Möller , Martin Kelly +authors: Jan-Simon Möller , Martin Kelly , Ronan Le Martret Duy Dang --- - + ### Machine h3-salvator-x - -*Description is missing - please complete file meta-agl/templates/machine/h3-salvator-x/README_machine_h3-salvator-x.md* +salvator-x board with an h3 SoC. + +* [R-Car H3 and M3 Starter Kit website](https://www.renesas.com/br/en/solutions/automotive/adas/solution-kits/r-car-starter-kit.html) +* [elinux H3 Salvator-X](https://elinux.org/R-Car/Boards/Salvator-X) diff --git a/meta-agl/templates/machine/h3ulcb-kf/50_bblayers.conf.inc b/meta-agl/templates/machine/h3ulcb-kf/50_bblayers.conf.inc new file mode 100644 index 00000000..61d472ab --- /dev/null +++ b/meta-agl/templates/machine/h3ulcb-kf/50_bblayers.conf.inc @@ -0,0 +1,4 @@ +BBLAYERS =+ "\ + ${METADIR}/bsp/meta-renesas/meta-rcar-gen3 \ + ${METADIR}/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas \ + " diff --git a/meta-agl/templates/machine/h3ulcb-kf/50_local.conf.inc b/meta-agl/templates/machine/h3ulcb-kf/50_local.conf.inc new file mode 100644 index 00000000..43e11737 --- /dev/null +++ b/meta-agl/templates/machine/h3ulcb-kf/50_local.conf.inc @@ -0,0 +1,7 @@ +MACHINE = "h3ulcb" +#see meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb.inc +require conf/include/agl_h3ulcb.inc + +#see meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc +require conf/include/rcar-gen3-adas.inc + diff --git a/meta-agl/templates/machine/h3ulcb-kf/50_setup.sh b/meta-agl/templates/machine/h3ulcb-kf/50_setup.sh new file mode 100644 index 00000000..abd2a33a --- /dev/null +++ b/meta-agl/templates/machine/h3ulcb-kf/50_setup.sh @@ -0,0 +1,10 @@ +# setup proprietary gfx drivers and multimedia packages +pushd $METADIR 2>/dev/null + +SETUP_MM_SCRIPT=$METADIR/meta-agl/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh +if [ -f $SETUP_MM_SCRIPT ]; then + . $SETUP_MM_SCRIPT + copy_mm_packages +fi + +popd 2>/dev/null diff --git a/meta-agl/templates/machine/h3ulcb-kf/README_machine_h3ulcb-kf.md b/meta-agl/templates/machine/h3ulcb-kf/README_machine_h3ulcb-kf.md new file mode 100644 index 00000000..cdef9afa --- /dev/null +++ b/meta-agl/templates/machine/h3ulcb-kf/README_machine_h3ulcb-kf.md @@ -0,0 +1,12 @@ +--- +description: Machine h3ulcb-kf +authors: Jan-Simon Möller , Ronan Le Martret +--- + +### Machine h3ulcb-kf + +Renesas RCar Gen3 "h3ulcb" board with Kingfisher baseboard. + +* [R-Car H3 and M3 Starter Kit website](https://www.renesas.com/br/en/solutions/automotive/adas/solution-kits/r-car-starter-kit.html) +* [elinux H3 Starter Kit](https://elinux.org/R-Car/Boards/H3SK) +* [R-Car/Boards/Kingfisher](https://elinux.org/R-Car/Boards/Kingfisher) diff --git a/meta-agl/templates/machine/h3ulcb-nogfx/50_bblayers.conf.inc b/meta-agl/templates/machine/h3ulcb-nogfx/50_bblayers.conf.inc index 5f410f0f..16397c2e 100644 --- a/meta-agl/templates/machine/h3ulcb-nogfx/50_bblayers.conf.inc +++ b/meta-agl/templates/machine/h3ulcb-nogfx/50_bblayers.conf.inc @@ -1,4 +1,3 @@ BBLAYERS =+ "\ - ${METADIR}/bsp/meta-renesas-rcar-gen3/meta-rcar-gen3 \ - ${METADIR}/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas \ + ${METADIR}/bsp/meta-renesas/meta-rcar-gen3 \ " diff --git a/meta-agl/templates/machine/h3ulcb-nogfx/50_local.conf.inc b/meta-agl/templates/machine/h3ulcb-nogfx/50_local.conf.inc index 4403e6ea..2f7cd6b3 100644 --- a/meta-agl/templates/machine/h3ulcb-nogfx/50_local.conf.inc +++ b/meta-agl/templates/machine/h3ulcb-nogfx/50_local.conf.inc @@ -1,7 +1,3 @@ MACHINE = "h3ulcb" #see meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb-nogfx.inc require conf/include/agl_h3ulcb-nogfx.inc - -# custom inclusion of cogent layer -#see meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc -require conf/include/rcar-gen3-adas.inc diff --git a/meta-agl/templates/machine/h3ulcb-nogfx/README_machine_h3ulcb-nogfx.md b/meta-agl/templates/machine/h3ulcb-nogfx/README_machine_h3ulcb-nogfx.md index da5d9b73..a1f3b9f6 100644 --- a/meta-agl/templates/machine/h3ulcb-nogfx/README_machine_h3ulcb-nogfx.md +++ b/meta-agl/templates/machine/h3ulcb-nogfx/README_machine_h3ulcb-nogfx.md @@ -2,8 +2,10 @@ description: Machine h3ulcb-nogfx authors: Jan-Simon Möller , Kevin Hilman , Ronan Le Martret , Yannick Gicquel --- - + ### Machine h3ulcb-nogfx - -*Description is missing - please complete file meta-agl/templates/machine/m3ulcb-nogfx/README_machine_h3ulcb-nogfx.md* +This is a "h3ulcb" machine without proprietary graphics driver support. + +* [R-Car H3 and M3 Starter Kit website](https://www.renesas.com/br/en/solutions/automotive/adas/solution-kits/r-car-starter-kit.html) +* [elinux H3 Starter Kit](https://elinux.org/R-Car/Boards/H3SK) diff --git a/meta-agl/templates/machine/h3ulcb/50_bblayers.conf.inc b/meta-agl/templates/machine/h3ulcb/50_bblayers.conf.inc index 5f410f0f..16397c2e 100644 --- a/meta-agl/templates/machine/h3ulcb/50_bblayers.conf.inc +++ b/meta-agl/templates/machine/h3ulcb/50_bblayers.conf.inc @@ -1,4 +1,3 @@ BBLAYERS =+ "\ - ${METADIR}/bsp/meta-renesas-rcar-gen3/meta-rcar-gen3 \ - ${METADIR}/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas \ + ${METADIR}/bsp/meta-renesas/meta-rcar-gen3 \ " diff --git a/meta-agl/templates/machine/h3ulcb/50_local.conf.inc b/meta-agl/templates/machine/h3ulcb/50_local.conf.inc index 43e11737..4bb2a821 100644 --- a/meta-agl/templates/machine/h3ulcb/50_local.conf.inc +++ b/meta-agl/templates/machine/h3ulcb/50_local.conf.inc @@ -2,6 +2,3 @@ MACHINE = "h3ulcb" #see meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb.inc require conf/include/agl_h3ulcb.inc -#see meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc -require conf/include/rcar-gen3-adas.inc - diff --git a/meta-agl/templates/machine/h3ulcb/README_machine_h3ulcb.md b/meta-agl/templates/machine/h3ulcb/README_machine_h3ulcb.md index be3aa0f6..fffad09b 100644 --- a/meta-agl/templates/machine/h3ulcb/README_machine_h3ulcb.md +++ b/meta-agl/templates/machine/h3ulcb/README_machine_h3ulcb.md @@ -2,8 +2,10 @@ description: Machine h3ulcb authors: Jan-Simon Möller , Ronan Le Martret --- - + ### Machine h3ulcb - -*Description is missing - please complete file meta-agl/templates/machine/h3ulcb/README_machine_h3ulcb.md* +Renesas RCar Gen3 "h3ulcb" board. + +* [R-Car H3 and M3 Starter Kit website](https://www.renesas.com/br/en/solutions/automotive/adas/solution-kits/r-car-starter-kit.html) +* [elinux H3 Starter Kit](https://elinux.org/R-Car/Boards/H3SK) diff --git a/meta-agl/templates/machine/imx8mqevk-viv/40_bblayers.conf.inc b/meta-agl/templates/machine/imx8mqevk-viv/40_bblayers.conf.inc new file mode 100644 index 00000000..edcb6a3a --- /dev/null +++ b/meta-agl/templates/machine/imx8mqevk-viv/40_bblayers.conf.inc @@ -0,0 +1,5 @@ +# This must be parsed after qt5, etc. layers so that they are correctly +# recognized by meta-freescale/dynamic-layers +BBLAYERS =+ "\ + ${METADIR}/bsp/meta-freescale \ + " diff --git a/meta-agl/templates/machine/imx8mqevk-viv/50_local.conf.inc b/meta-agl/templates/machine/imx8mqevk-viv/50_local.conf.inc new file mode 100644 index 00000000..e9668c30 --- /dev/null +++ b/meta-agl/templates/machine/imx8mqevk-viv/50_local.conf.inc @@ -0,0 +1,3 @@ +MACHINE = "imx8mqevk" +#see meta-agl/meta-agl-bsp/conf/include/agl_imx8mqevk-viv.inc +require conf/include/agl_imx8mqevk-viv.inc diff --git a/meta-agl/templates/machine/imx8mqevk-viv/50_setup.sh b/meta-agl/templates/machine/imx8mqevk-viv/50_setup.sh new file mode 100644 index 00000000..eefd1eb7 --- /dev/null +++ b/meta-agl/templates/machine/imx8mqevk-viv/50_setup.sh @@ -0,0 +1,2 @@ +find_and_ack_eula $METADIR/bsp/meta-freescale EULA +export EULA_FLAG_NAME="ACCEPT_FSL_EULA" diff --git a/meta-agl/templates/machine/imx8mqevk-viv/README_machine_imx8mqevk-viv.md b/meta-agl/templates/machine/imx8mqevk-viv/README_machine_imx8mqevk-viv.md new file mode 100644 index 00000000..be30e00f --- /dev/null +++ b/meta-agl/templates/machine/imx8mqevk-viv/README_machine_imx8mqevk-viv.md @@ -0,0 +1,9 @@ +--- +description: i.MX8MQ EVK with Vivante GPU driver +authors: Scott Murray +--- + +### Machine imx8mqevk-viv + +i.MX8MQ EVK and EVKB boards with Vivante GPU driver support. + diff --git a/meta-agl/templates/machine/imx8mqevk/40_bblayers.conf.inc b/meta-agl/templates/machine/imx8mqevk/40_bblayers.conf.inc new file mode 100644 index 00000000..edcb6a3a --- /dev/null +++ b/meta-agl/templates/machine/imx8mqevk/40_bblayers.conf.inc @@ -0,0 +1,5 @@ +# This must be parsed after qt5, etc. layers so that they are correctly +# recognized by meta-freescale/dynamic-layers +BBLAYERS =+ "\ + ${METADIR}/bsp/meta-freescale \ + " diff --git a/meta-agl/templates/machine/imx8mqevk/50_local.conf.inc b/meta-agl/templates/machine/imx8mqevk/50_local.conf.inc new file mode 100644 index 00000000..5f9b9594 --- /dev/null +++ b/meta-agl/templates/machine/imx8mqevk/50_local.conf.inc @@ -0,0 +1,3 @@ +MACHINE = "imx8mqevk" +#see meta-agl/meta-agl-bsp/conf/include/agl_imx8mqevk.inc +require conf/include/agl_imx8mqevk.inc diff --git a/meta-agl/templates/machine/imx8mqevk/50_setup.sh b/meta-agl/templates/machine/imx8mqevk/50_setup.sh new file mode 100644 index 00000000..eefd1eb7 --- /dev/null +++ b/meta-agl/templates/machine/imx8mqevk/50_setup.sh @@ -0,0 +1,2 @@ +find_and_ack_eula $METADIR/bsp/meta-freescale EULA +export EULA_FLAG_NAME="ACCEPT_FSL_EULA" diff --git a/meta-agl/templates/machine/imx8mqevk/README_machine_imx8mqevk.md b/meta-agl/templates/machine/imx8mqevk/README_machine_imx8mqevk.md new file mode 100644 index 00000000..5d2bcbd3 --- /dev/null +++ b/meta-agl/templates/machine/imx8mqevk/README_machine_imx8mqevk.md @@ -0,0 +1,13 @@ +--- +description: i.MX8MQ EVK with etnaviv GPU driver +authors: Scott Murray +--- + +### Machine imx8mqevk + +i.MX8MQ EVK and EVKB boards with etnaviv GPU driver support. +Note that etnaviv on the GC7000L GPU in the i.MX8MQ is currently still +a work in progress, the imx8mqevk-viv template using the NXP Vivante +driver may be a better choice for those not interested in etnaviv +debugging and development. + diff --git a/meta-agl/templates/machine/intel-corei7-64 b/meta-agl/templates/machine/intel-corei7-64 new file mode 120000 index 00000000..9d468439 --- /dev/null +++ b/meta-agl/templates/machine/intel-corei7-64 @@ -0,0 +1 @@ +qemux86-64 \ No newline at end of file diff --git a/meta-agl/templates/machine/intel-corei7-64/50_bblayers.conf.inc b/meta-agl/templates/machine/intel-corei7-64/50_bblayers.conf.inc deleted file mode 100644 index 8fd7af53..00000000 --- a/meta-agl/templates/machine/intel-corei7-64/50_bblayers.conf.inc +++ /dev/null @@ -1 +0,0 @@ -BBLAYERS =+ "${METADIR}/bsp/meta-intel" diff --git a/meta-agl/templates/machine/intel-corei7-64/50_local.conf.inc b/meta-agl/templates/machine/intel-corei7-64/50_local.conf.inc deleted file mode 100644 index 48d26c56..00000000 --- a/meta-agl/templates/machine/intel-corei7-64/50_local.conf.inc +++ /dev/null @@ -1,3 +0,0 @@ -MACHINE = "intel-corei7-64" -#see meta-agl/meta-agl-bsp/conf/include/agl_intel-corei7-64.inc -require conf/include/agl_intel-corei7-64.inc diff --git a/meta-agl/templates/machine/intel-corei7-64/README_machine_intel-corei7-64.md b/meta-agl/templates/machine/intel-corei7-64/README_machine_intel-corei7-64.md deleted file mode 100644 index 5cab9e8f..00000000 --- a/meta-agl/templates/machine/intel-corei7-64/README_machine_intel-corei7-64.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -description: Machine intel-corei7-64 -authors: Dominig ar Foll (Intel Open Source) , Jan-Simon Moeller , Jan-Simon Möller , Ronan Le Martret , Stephane Desneux ---- - -### Machine intel-corei7-64 - -*Description is missing - please complete file meta-agl/templates/machine/intel-corei7-64/README_machine_intel-corei7-64.md* - diff --git a/meta-agl/templates/machine/m3-salvator-x/50_bblayers.conf.inc b/meta-agl/templates/machine/m3-salvator-x/50_bblayers.conf.inc new file mode 100644 index 00000000..16397c2e --- /dev/null +++ b/meta-agl/templates/machine/m3-salvator-x/50_bblayers.conf.inc @@ -0,0 +1,3 @@ +BBLAYERS =+ "\ + ${METADIR}/bsp/meta-renesas/meta-rcar-gen3 \ + " diff --git a/meta-agl/templates/machine/m3-salvator-x/50_local.conf.inc b/meta-agl/templates/machine/m3-salvator-x/50_local.conf.inc new file mode 100644 index 00000000..82766fd5 --- /dev/null +++ b/meta-agl/templates/machine/m3-salvator-x/50_local.conf.inc @@ -0,0 +1,4 @@ +MACHINE = "salvator-x" +#see meta-agl/meta-agl-bsp/conf/include/agl_m3-salvator-x.inc +require conf/include/agl_m3-salvator-x.inc + diff --git a/meta-agl/templates/machine/m3-salvator-x/50_setup.sh b/meta-agl/templates/machine/m3-salvator-x/50_setup.sh new file mode 100644 index 00000000..abd2a33a --- /dev/null +++ b/meta-agl/templates/machine/m3-salvator-x/50_setup.sh @@ -0,0 +1,10 @@ +# setup proprietary gfx drivers and multimedia packages +pushd $METADIR 2>/dev/null + +SETUP_MM_SCRIPT=$METADIR/meta-agl/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh +if [ -f $SETUP_MM_SCRIPT ]; then + . $SETUP_MM_SCRIPT + copy_mm_packages +fi + +popd 2>/dev/null diff --git a/meta-agl/templates/machine/m3-salvator-x/README_machine_m3-salvator-x.md b/meta-agl/templates/machine/m3-salvator-x/README_machine_m3-salvator-x.md new file mode 100644 index 00000000..99c9dffb --- /dev/null +++ b/meta-agl/templates/machine/m3-salvator-x/README_machine_m3-salvator-x.md @@ -0,0 +1,11 @@ +--- +description: Machine m3-salvator-x +authors: Jan-Simon Möller , Ronan Le Martret Duy Dang +--- + +### Machine m3-salvator-x + +salvator-x board with an m3 SoC. + +* [R-Car H3 and M3 Starter Kit website](https://www.renesas.com/br/en/solutions/automotive/adas/solution-kits/r-car-starter-kit.html) +* [elinux H3 Salvator-X](https://elinux.org/R-Car/Boards/Salvator-X) diff --git a/meta-agl/templates/machine/m3ulcb-kf/50_bblayers.conf.inc b/meta-agl/templates/machine/m3ulcb-kf/50_bblayers.conf.inc new file mode 100644 index 00000000..61d472ab --- /dev/null +++ b/meta-agl/templates/machine/m3ulcb-kf/50_bblayers.conf.inc @@ -0,0 +1,4 @@ +BBLAYERS =+ "\ + ${METADIR}/bsp/meta-renesas/meta-rcar-gen3 \ + ${METADIR}/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas \ + " diff --git a/meta-agl/templates/machine/m3ulcb-kf/50_local.conf.inc b/meta-agl/templates/machine/m3ulcb-kf/50_local.conf.inc new file mode 100644 index 00000000..e2fe41a8 --- /dev/null +++ b/meta-agl/templates/machine/m3ulcb-kf/50_local.conf.inc @@ -0,0 +1,6 @@ +MACHINE = "m3ulcb" +#see meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb.inc +require conf/include/agl_m3ulcb.inc + +#see meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc +require conf/include/rcar-gen3-adas.inc diff --git a/meta-agl/templates/machine/m3ulcb-kf/50_setup.sh b/meta-agl/templates/machine/m3ulcb-kf/50_setup.sh new file mode 100644 index 00000000..abd2a33a --- /dev/null +++ b/meta-agl/templates/machine/m3ulcb-kf/50_setup.sh @@ -0,0 +1,10 @@ +# setup proprietary gfx drivers and multimedia packages +pushd $METADIR 2>/dev/null + +SETUP_MM_SCRIPT=$METADIR/meta-agl/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh +if [ -f $SETUP_MM_SCRIPT ]; then + . $SETUP_MM_SCRIPT + copy_mm_packages +fi + +popd 2>/dev/null diff --git a/meta-agl/templates/machine/m3ulcb-kf/README_machine_m3ulcb-kf.md b/meta-agl/templates/machine/m3ulcb-kf/README_machine_m3ulcb-kf.md new file mode 100644 index 00000000..075c203f --- /dev/null +++ b/meta-agl/templates/machine/m3ulcb-kf/README_machine_m3ulcb-kf.md @@ -0,0 +1,12 @@ +--- +description: Machine m3ulcb +authors: Jan-Simon Möller , Ronan Le Martret , Yannick Gicquel +--- + +### Machine m3ulcb + +Renesas RCar Gen3 "m3ulcb" board with Kingfisher baseboard. + +* [R-Car H3 and M3 Starter Kit website](https://www.renesas.com/br/en/solutions/automotive/adas/solution-kits/r-car-starter-kit.html) +* [elinux H3 Starter Kit](https://elinux.org/R-Car/Boards/H3SK) +* [R-Car/Boards/Kingfisher](https://elinux.org/R-Car/Boards/Kingfisher) diff --git a/meta-agl/templates/machine/m3ulcb-nogfx/50_bblayers.conf.inc b/meta-agl/templates/machine/m3ulcb-nogfx/50_bblayers.conf.inc index 5f410f0f..16397c2e 100644 --- a/meta-agl/templates/machine/m3ulcb-nogfx/50_bblayers.conf.inc +++ b/meta-agl/templates/machine/m3ulcb-nogfx/50_bblayers.conf.inc @@ -1,4 +1,3 @@ BBLAYERS =+ "\ - ${METADIR}/bsp/meta-renesas-rcar-gen3/meta-rcar-gen3 \ - ${METADIR}/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas \ + ${METADIR}/bsp/meta-renesas/meta-rcar-gen3 \ " diff --git a/meta-agl/templates/machine/m3ulcb-nogfx/50_local.conf.inc b/meta-agl/templates/machine/m3ulcb-nogfx/50_local.conf.inc index 3fd5d6ee..521dedb4 100644 --- a/meta-agl/templates/machine/m3ulcb-nogfx/50_local.conf.inc +++ b/meta-agl/templates/machine/m3ulcb-nogfx/50_local.conf.inc @@ -1,6 +1,3 @@ MACHINE = "m3ulcb" #see meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb-nogfx.inc require conf/include/agl_m3ulcb-nogfx.inc - -#see meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc -require conf/include/rcar-gen3-adas.inc diff --git a/meta-agl/templates/machine/m3ulcb-nogfx/README_machine_m3ulcb-nogfx.md b/meta-agl/templates/machine/m3ulcb-nogfx/README_machine_m3ulcb-nogfx.md index 1e5140c2..5c87986d 100644 --- a/meta-agl/templates/machine/m3ulcb-nogfx/README_machine_m3ulcb-nogfx.md +++ b/meta-agl/templates/machine/m3ulcb-nogfx/README_machine_m3ulcb-nogfx.md @@ -2,8 +2,10 @@ description: Machine m3ulcb-nogfx authors: Jan-Simon Möller , Kevin Hilman , Ronan Le Martret , Yannick Gicquel --- - + ### Machine m3ulcb-nogfx - -*Description is missing - please complete file meta-agl/templates/machine/m3ulcb-nogfx/README_machine_m3ulcb-nogfx.md* +This is a "m3ulcb" machine without proprietary graphics driver support. + +* [R-Car H3 and M3 Starter Kit website](https://www.renesas.com/br/en/solutions/automotive/adas/solution-kits/r-car-starter-kit.html) +* [elinux H3 Starter Kit](https://elinux.org/R-Car/Boards/H3SK) diff --git a/meta-agl/templates/machine/m3ulcb/50_bblayers.conf.inc b/meta-agl/templates/machine/m3ulcb/50_bblayers.conf.inc index 5f410f0f..16397c2e 100644 --- a/meta-agl/templates/machine/m3ulcb/50_bblayers.conf.inc +++ b/meta-agl/templates/machine/m3ulcb/50_bblayers.conf.inc @@ -1,4 +1,3 @@ BBLAYERS =+ "\ - ${METADIR}/bsp/meta-renesas-rcar-gen3/meta-rcar-gen3 \ - ${METADIR}/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas \ + ${METADIR}/bsp/meta-renesas/meta-rcar-gen3 \ " diff --git a/meta-agl/templates/machine/m3ulcb/50_local.conf.inc b/meta-agl/templates/machine/m3ulcb/50_local.conf.inc index e2fe41a8..c75bc531 100644 --- a/meta-agl/templates/machine/m3ulcb/50_local.conf.inc +++ b/meta-agl/templates/machine/m3ulcb/50_local.conf.inc @@ -1,6 +1,3 @@ MACHINE = "m3ulcb" #see meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb.inc require conf/include/agl_m3ulcb.inc - -#see meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc -require conf/include/rcar-gen3-adas.inc diff --git a/meta-agl/templates/machine/m3ulcb/README_machine_m3ulcb.md b/meta-agl/templates/machine/m3ulcb/README_machine_m3ulcb.md index 3b5e0f45..07034a6d 100644 --- a/meta-agl/templates/machine/m3ulcb/README_machine_m3ulcb.md +++ b/meta-agl/templates/machine/m3ulcb/README_machine_m3ulcb.md @@ -2,8 +2,10 @@ description: Machine m3ulcb authors: Jan-Simon Möller , Ronan Le Martret , Yannick Gicquel --- - + ### Machine m3ulcb - -*Description is missing - please complete file meta-agl/templates/machine/m3ulcb/README_machine_m3ulcb.md* +Renesas RCar Gen3 "m3ulcb" board. + +* [R-Car H3 and M3 Starter Kit website](https://www.renesas.com/br/en/solutions/automotive/adas/solution-kits/r-car-starter-kit.html) +* [elinux H3 Starter Kit](https://elinux.org/R-Car/Boards/H3SK) diff --git a/meta-agl/templates/machine/raspberrypi4/50_local.conf.inc b/meta-agl/templates/machine/raspberrypi4/50_local.conf.inc index 4c14d14b..e5556f27 100644 --- a/meta-agl/templates/machine/raspberrypi4/50_local.conf.inc +++ b/meta-agl/templates/machine/raspberrypi4/50_local.conf.inc @@ -1,8 +1,4 @@ -MACHINE = "raspberrypi4" -#see meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi3.inc -require conf/include/agl_raspberrypi3.inc +MACHINE = "raspberrypi4-64" -#use the "Image" format for 64-bit AGL image for Raspberry Pi 4 -KERNEL_IMAGETYPE = "Image" -KERNEL_IMAGETYPE_UBOOT = "Image" -KERNEL_IMAGETYPE_DIRECT = "Image" +#see meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi3.inc +require conf/include/agl_raspberrypi4.inc -- cgit 1.2.3-korg