aboutsummaryrefslogtreecommitdiffstats
path: root/meta-ivi
diff options
context:
space:
mode:
authorholger <holger.behrens@windriver.com>2014-05-09 17:14:40 +0200
committerHolger Behrens <holger.behrens@windriver.com>2014-05-09 17:20:43 +0200
commit4092e7f224c51164037b405497aadb3f571a92f7 (patch)
treec83ec8e888db7c87cf981925b1d2d824c10be8c6 /meta-ivi
parent4de27ff3f95703de73d326bf6791a1fe02f0572e (diff)
downloadmeta-ivi-4092e7f224c51164037b405497aadb3f571a92f7.tar.gz
meta-ivi-4092e7f224c51164037b405497aadb3f571a92f7.tar.bz2
meta-ivi-4092e7f224c51164037b405497aadb3f571a92f7.zip
meta-ivi: refactor layer structure
Signed-off-by: Holger Behrens <holger.behrens@windriver.com>
Diffstat (limited to 'meta-ivi')
-rw-r--r--meta-ivi/COPYING.MIT17
-rw-r--r--meta-ivi/conf/bblayers.conf.sample19
-rw-r--r--meta-ivi/conf/conf-notes.txt3
-rw-r--r--meta-ivi/conf/distro/include/default-providers-ivi.inc8
-rw-r--r--meta-ivi/conf/distro/poky-ivi-systemd.conf90
-rw-r--r--meta-ivi/conf/layer.conf15
-rw-r--r--meta-ivi/conf/local.conf.sample226
-rw-r--r--meta-ivi/recipes-connectivity/bluez5/bluez5_%.bbappend7
-rw-r--r--meta-ivi/recipes-connectivity/connman/connman_1.23.bbappend6
-rw-r--r--meta-ivi/recipes-connectivity/libpcap/libpcap_1.5.3.bbappend4
-rw-r--r--meta-ivi/recipes-connectivity/ofono/ofono_1.14.bbappend4
-rw-r--r--meta-ivi/recipes-core-ivi/base-passwd/base-passwd/add-default-root-pass.patch10
-rw-r--r--meta-ivi/recipes-core-ivi/base-passwd/base-passwd_3.5.29.bbappend6
-rw-r--r--meta-ivi/recipes-core-ivi/busybox/busybox-1.21.1/defconfig1012
-rw-r--r--meta-ivi/recipes-core-ivi/busybox/busybox_1.22.1.bbappend2
-rw-r--r--meta-ivi/recipes-core-ivi/dbus/dbus/dbus-DBusMessage-add-support-for-custom-marshaling.patch267
-rw-r--r--meta-ivi/recipes-core-ivi/dbus/dbus/dbus_1.6-add-afbus-support.patch3201
-rw-r--r--meta-ivi/recipes-core-ivi/dbus/dbus_1.6.18.bbappend18
-rw-r--r--meta-ivi/recipes-core-ivi/eglibc/eglibc/eglibc_2.18_add_af_bus_support.patch130
-rw-r--r--meta-ivi/recipes-core-ivi/eglibc/eglibc_2.19.bbappend14
-rw-r--r--meta-ivi/recipes-extended/common-api/common-api-c++-dbus_2.1.4.bb11
-rw-r--r--meta-ivi/recipes-extended/common-api/common-api-c++_2.1.4.bb11
-rw-r--r--meta-ivi/recipes-extended/dlt-daemon/dlt-daemon/0001-Fix-build-with-systemd-209.patch29
-rw-r--r--meta-ivi/recipes-extended/dlt-daemon/dlt-daemon/modify_systemd_config_dir.patch13
-rw-r--r--meta-ivi/recipes-extended/dlt-daemon/dlt-daemon_2.9.1.bb55
-rw-r--r--meta-ivi/recipes-extended/itzamc/libitzam/libitzam_pc.patch13
-rw-r--r--meta-ivi/recipes-extended/itzamc/libitzam_6.0.4.bb25
-rw-r--r--meta-ivi/recipes-extended/node-health-monitor/node-health-monitor/fix-no-libsystemd-daemon.patch13
-rw-r--r--meta-ivi/recipes-extended/node-health-monitor/node-health-monitor_1.3.3.bb21
-rw-r--r--meta-ivi/recipes-extended/node-startup-controller/node-startup-controller/fix-no-libsystemd-daemon.patch13
-rw-r--r--meta-ivi/recipes-extended/node-startup-controller/node-startup-controller/use-systemd-unit-dir.patch26
-rw-r--r--meta-ivi/recipes-extended/node-startup-controller/node-startup-controller_1.0.2.bb60
-rw-r--r--meta-ivi/recipes-extended/node-startup-controller/node-startup-controller_git.bb53
-rw-r--r--meta-ivi/recipes-extended/node-state-manager/node-state-manager/nsm-fix-no-libsystemd-daemon.patch13
-rw-r--r--meta-ivi/recipes-extended/node-state-manager/node-state-manager/nsm-fix-systemd-service-dep.patch15
-rw-r--r--meta-ivi/recipes-extended/node-state-manager/node-state-manager_2.0.0.bb45
-rw-r--r--meta-ivi/recipes-extended/persistence-client-library/persistence-client-library_0.9.0.bb21
-rw-r--r--meta-ivi/recipes-extended/shadow-securetty/shadow-securetty/vexpressa9/securetty-vea97
-rw-r--r--meta-ivi/recipes-extended/shadow-securetty/shadow-securetty_4.1.4.3.bbappend7
-rw-r--r--meta-ivi/recipes-graphics/layer-management/layer-management-git/include-unistd-for-alarm-in-example.patch12
-rw-r--r--meta-ivi/recipes-graphics/layer-management/layer-management-git/include-unistd-for-usleep-in-OpenGLES2App.patch18
-rw-r--r--meta-ivi/recipes-graphics/layer-management/layer-management-git/point-to-internal-CMakeVersions.patch13
-rw-r--r--meta-ivi/recipes-graphics/layer-management/layer-management/layermanager.service14
-rw-r--r--meta-ivi/recipes-graphics/layer-management/layer-management_1.1.bb57
-rw-r--r--meta-ivi/recipes-graphics/layer-management/layer-management_git.bb56
-rw-r--r--meta-ivi/recipes-graphics/wayland/wayland-ivi-extension/use_sysroot_dir.patch13
-rw-r--r--meta-ivi/recipes-graphics/wayland/wayland-ivi-extension_1.2.0_rc1.bb21
-rw-r--r--meta-ivi/recipes-graphics/wayland/weston_1.4.0.bbappend14
-rwxr-xr-xmeta-ivi/recipes-graphics/xorg-xserver/xserver-xorg/X.service10
-rw-r--r--meta-ivi/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend14
-rw-r--r--meta-ivi/recipes-multimedia/audiomanager/audiomanager/AudioManager.service16
-rwxr-xr-xmeta-ivi/recipes-multimedia/audiomanager/audiomanager/setup_amgr.sh7
-rw-r--r--meta-ivi/recipes-multimedia/audiomanager/audiomanager_4.2.bb43
-rw-r--r--meta-ivi/recipes-multimedia/audiomanager/audiomanager_git.bb44
-rw-r--r--meta-ivi/recipes-multimedia/pulseaudio/pulseaudio/pulseaudio.service14
-rw-r--r--meta-ivi/recipes-multimedia/pulseaudio/pulseaudio_5.0.bbappend39
-rw-r--r--meta-ivi/recipes-qt/qt4/qt4-embedded_4.8.5.bbappend22
-rw-r--r--meta-ivi/recipes-support-ivi/ecryptfs-utils/ecryptfs-utils/ecryptfs-fix-disable-nss.patch222
-rw-r--r--meta-ivi/recipes-support-ivi/ecryptfs-utils/ecryptfs-utils/ecryptfs.service10
-rw-r--r--meta-ivi/recipes-support-ivi/ecryptfs-utils/ecryptfs-utils_104.bb44
-rw-r--r--meta-ivi/recipes-support-ivi/fuse/files/aarch64.patch33
-rw-r--r--meta-ivi/recipes-support-ivi/fuse/files/gold-unversioned-symbol.patch92
-rw-r--r--meta-ivi/recipes-support-ivi/fuse/fuse_2.9.3.bb43
-rw-r--r--meta-ivi/recipes-support-ivi/keyutils/keyutils/keyutils-arm-remove-m32-m64.patch19
-rw-r--r--meta-ivi/recipes-support-ivi/keyutils/keyutils/keyutils_fix_library_install.patch30
-rw-r--r--meta-ivi/recipes-support-ivi/keyutils/keyutils/keyutils_fix_x86-64_cflags.patch13
-rw-r--r--meta-ivi/recipes-support-ivi/keyutils/keyutils/keyutils_fix_x86_cflags.patch13
-rw-r--r--meta-ivi/recipes-support-ivi/keyutils/keyutils_1.5.8.bb29
-rw-r--r--meta-ivi/recipes-yocto-ivi/images/ivi-image.bb12
-rw-r--r--meta-ivi/recipes-yocto-ivi/images/ivi-image.inc19
-rw-r--r--meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-abstract-component-p1.bb23
-rw-r--r--meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-abstract-component-p2.bb20
-rw-r--r--meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-core-boot-genivi.bb49
-rw-r--r--meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-placeholder-component-p1.bb18
-rw-r--r--meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-specific-component-p1.bb38
-rw-r--r--meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-specific-component-p2.bb25
-rw-r--r--meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-xserver-ivi.bb19
77 files changed, 6708 insertions, 0 deletions
diff --git a/meta-ivi/COPYING.MIT b/meta-ivi/COPYING.MIT
new file mode 100644
index 0000000..fb950dc
--- /dev/null
+++ b/meta-ivi/COPYING.MIT
@@ -0,0 +1,17 @@
+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.
diff --git a/meta-ivi/conf/bblayers.conf.sample b/meta-ivi/conf/bblayers.conf.sample
new file mode 100644
index 0000000..1eeff9d
--- /dev/null
+++ b/meta-ivi/conf/bblayers.conf.sample
@@ -0,0 +1,19 @@
+# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
+# changes incompatibly
+LCONF_VERSION = "6"
+
+BBPATH = "${TOPDIR}"
+BBFILES ?= ""
+
+BBLAYERS ?= " \
+ ##OEROOT##/meta \
+ ##OEROOT##/meta-yocto \
+ ##OEROOT##/meta-yocto-bsp \
+ ##OEROOT##/../meta-ivi/meta-ivi \
+ ##OEROOT##/../meta-ivi/meta-ivi-bsp \
+ "
+BBLAYERS_NON_REMOVABLE ?= " \
+ ##OEROOT##/meta \
+ ##OEROOT##/meta-yocto \
+ ##OEROOT##/../meta-ivi/meta-ivi \
+ "
diff --git a/meta-ivi/conf/conf-notes.txt b/meta-ivi/conf/conf-notes.txt
new file mode 100644
index 0000000..b6cee3f
--- /dev/null
+++ b/meta-ivi/conf/conf-notes.txt
@@ -0,0 +1,3 @@
+Common target is:
+ ivi-image
+
diff --git a/meta-ivi/conf/distro/include/default-providers-ivi.inc b/meta-ivi/conf/distro/include/default-providers-ivi.inc
new file mode 100644
index 0000000..d236983
--- /dev/null
+++ b/meta-ivi/conf/distro/include/default-providers-ivi.inc
@@ -0,0 +1,8 @@
+#
+# Default virtual providers
+#
+PREFERRED_PROVIDER_virtual/arm-oe-linux-gnueabi-depmod ?= "kmod-cross"
+PREFERRED_PROVIDER_udev ?= "systemd"
+PREFERRED_PROVIDER_udev-utils ?= "systemd"
+PREFERRED_PROVIDER_node-state-manager ?= "node-state-manager"
+
diff --git a/meta-ivi/conf/distro/poky-ivi-systemd.conf b/meta-ivi/conf/distro/poky-ivi-systemd.conf
new file mode 100644
index 0000000..8998d2a
--- /dev/null
+++ b/meta-ivi/conf/distro/poky-ivi-systemd.conf
@@ -0,0 +1,90 @@
+DISTRO = "poky-ivi-systemd"
+DISTRO_NAME = "Yocto GENIVI Baseline (Poky/meta-ivi)"
+DISTRO_VERSION = "6.0+snapshot-${DATE}"
+DISTRO_CODENAME ="horizon"
+
+MAINTAINER = "meta-ivi <genivi-meta-ivi@lists.genivi.org>"
+
+TARGET_VENDOR = "-poky"
+
+LAYER_CONF_VERSION ?= "6"
+
+include conf/distro/include/default-providers-ivi.inc
+
+VIRTUAL-RUNTIME_init_manager = "systemd"
+VIRTUAL-RUNTIME_initscripts = ""
+
+DISTRO_FEATURES_append = " bluetooth systemd opengl wayland pam"
+DISTRO_FEATURES_remove = "x11"
+DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
+
+PREFERRED_VERSION_linux-yocto ?= "3.10%"
+PREFERRED_VERSION_linux-yocto_qemux86 ?= "3.10%"
+PREFERRED_VERSION_linux-yocto_qemux86-64 ?= "3.10%"
+PREFERRED_VERSION_linux-yocto_qemuarm ?= "3.10%"
+PREFERRED_VERSION_linux-yocto_vexpressa9 ?= "3.10%"
+
+PREFERRED_PROVIDER_jpeg = "jpeg"
+PREFERRED_PROVIDER_jpeg-native = "jpeg-native"
+
+TCLIBCAPPEND = ""
+
+QEMU_TARGETS ?= "arm i386 x86_64"
+
+XSERVER ?= "xserver-xorg \
+ xserver-xf86-config \
+ xserver-xorg-extension-dbe \
+ xserver-xorg-extension-dri \
+ xserver-xorg-extension-dri2 \
+ xserver-xorg-extension-extmod \
+ xserver-xorg-extension-glx \
+ xf86-input-evdev \
+ xf86-input-mouse \
+ xf86-input-keyboard \
+ mesa-driver-swrast \
+ ${@base_contains("MACHINE_ARCH", "qemux86", "xf86-video-vmware", "", d)} \
+ ${@base_contains("MACHINE_ARCH", "qemux86_64", "xf86-video-vmware", "", d)} \
+ ${@base_contains("MACHINE_ARCH", "vexpressa9", "xf86-video-fbdev", "", d)} \
+ "
+
+PREMIRRORS ??= "\
+bzr://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+cvs://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+git://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+hg://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+osc://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+p4://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+svk://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+svn://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n"
+
+MIRRORS =+ "\
+ftp://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+http://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+https://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n"
+
+# The CONNECTIVITY_CHECK_URI's are used to test whether we can succesfully
+# fetch from the network (and warn you if not). To disable the test set
+# the variable to be empty.
+# Git example url: git://git.yoctoproject.org/yocto-firewall-test;protocol=git;rev=HEAD
+
+CONNECTIVITY_CHECK_URIS ?= " \
+ https://eula-downloads.yoctoproject.org/index.php \
+ http://bugs.genivi.org/report.cgi"
+
+# Default hash policy for distro
+BB_SIGNATURE_HANDLER ?= 'OEBasicHash'
+#
+# OELAYOUT_ABI allows us to notify users when the format of TMPDIR changes in
+# an incompatible way. Such changes should usually be detailed in the commit
+# that breaks the format and have been previously discussed on the mailing list
+# with general agreement from the core team.
+#
+OELAYOUT_ABI = "8"
+
+# QA check settings - a little stricter than the OE-Core defaults
+WARN_QA = "textrel files-invalid incompatible-license xorg-driver-abi libdir"
+ERROR_QA = "dev-so debug-deps dev-deps debug-files arch pkgconfig la perms \
+ useless-rpaths rpaths staticdev ldflags pkgvarcheck already-stripped \
+ compile-host-path dep-cmp installed-vs-shipped install-host-path \
+ packages-list perm-config perm-line perm-link pkgv-undefined \
+ pn-overrides split-strip var-undefined"
diff --git a/meta-ivi/conf/layer.conf b/meta-ivi/conf/layer.conf
new file mode 100644
index 0000000..346cc0e
--- /dev/null
+++ b/meta-ivi/conf/layer.conf
@@ -0,0 +1,15 @@
+BBPATH ?= ""
+# We add conf directory to BBPATH
+BBPATH .= ":${LAYERDIR}"
+
+# We have a recipes directory containing .bb and .bbappend files, add to BBFILES
+BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
+ ${LAYERDIR}/recipes-*/*/*.bbappend"
+
+BBFILE_COLLECTIONS += "ivi"
+BBFILE_PATTERN_ivi := "^${LAYERDIR}/"
+BBFILE_PRIORITY_ivi = "7"
+
+# Define a similar VARIABLE to COREBASE in order to get a reference to
+# top directory easily
+IVI_COREBASE := '${@os.path.normpath("${LAYERDIR}/../")}'
diff --git a/meta-ivi/conf/local.conf.sample b/meta-ivi/conf/local.conf.sample
new file mode 100644
index 0000000..9ab2def
--- /dev/null
+++ b/meta-ivi/conf/local.conf.sample
@@ -0,0 +1,226 @@
+#
+# This file is your local configuration file and is where all local user settings
+# are placed. The comments in this file give some guide to the options a new user
+# to the system might want to change but pretty much any configuration option can
+# be set in this file. More adventurous users can look at local.conf.extended
+# which contains other examples of configuration which can be placed in this file
+# but new users likely won't need any of them initially.
+#
+# Lines starting with the '#' character are commented out and in some cases the
+# default values are provided as comments to show people example syntax. Enabling
+# the option is a question of removing the # character and making any change to the
+# variable as required.
+
+#
+# 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"
+#
+# The second option controls how many processes make should run in parallel when
+# running compile tasks:
+#
+#PARALLEL_MAKE ?= "-j 4"
+#
+# For a quad-core machine, BB_NUMBER_THREADS = "4", PARALLEL_MAKE = "-j 4" would
+# be appropriate for example.
+
+#
+# Machine Selection
+#
+# You need to select a specific machine to target the build with. There are a selection
+# of emulated machines available which can boot and run in the QEMU emulator:
+#
+#MACHINE ?= "qemux86"
+#MACHINE ?= "qemux86-64"
+#MACHINE ?= "vexpressa9"
+#
+# There are also the following hardware board target machines included for
+# demonstration purposes:
+#
+#MACHINE ?= "beagleboard"
+#
+# This sets the default machine to be vexpressa9 if no other machine is selected:
+MACHINE ??= "vexpressa9"
+
+#
+# Where to place downloads
+#
+# During a first build the system will download many different source code tarballs
+# from various upstream projects. This can take a while, particularly if your network
+# connection is slow. These are all stored in DL_DIR. When wiping and rebuilding you
+# can preserve this directory to speed up this part of subsequent builds. This directory
+# is safe to share between multiple builds on the same machine too.
+#
+# The default is a downloads directory under TOPDIR which is the build directory.
+#
+#DL_DIR ?= "${TOPDIR}/downloads"
+
+#
+# Where to place shared-state files
+#
+# BitBake has the capability to accelerate builds based on previously built output.
+# This is done using "shared state" files which can be thought of as cache objects
+# and this option determines where those files are placed.
+#
+# You can wipe out TMPDIR leaving this directory intact and the build would regenerate
+# from these files if no changes were made to the configuration. If changes were made
+# to the configuration, only shared state files where the state was still valid would
+# be used (done using checksums).
+#
+# The default is a sstate-cache directory under TOPDIR.
+#
+#SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
+
+#
+# Where to place the build output
+#
+# This option specifies where the bulk of the building work should be done and
+# where BitBake should place its temporary files and output. Keep in mind that
+# this includes the extraction and compilation of many applications and the toolchain
+# which can use Gigabytes of hard disk space.
+#
+# The default is a tmp directory under TOPDIR.
+#
+#TMPDIR = "${TOPDIR}/tmp"
+
+#
+# Default policy config
+#
+# The distribution setting controls which policy settings are used as defaults.
+# The default value is fine for general Yocto GENIVI Baseline project use, at
+# least initially.
+# Ultimately when creating custom policy, people will likely end up subclassing
+# these defaults.
+#
+DISTRO ?= "poky-ivi-systemd"
+INCOMPATIBLE_LICENSE ?= "GPLv3"
+
+#
+# Package Management configuration
+#
+# This variable lists which packaging formats to enable. Multiple package backends
+# can be enabled at once and the first item listed in the variable will be used
+# to generate the root filesystems.
+# Options are:
+# - 'package_deb' for debian style deb files
+# - 'package_ipk' for ipk files are used by opkg (a debian style embedded package manager)
+# - 'package_rpm' for rpm style packages
+# E.g.: PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk"
+# We default to rpm:
+PACKAGE_CLASSES ?= "package_rpm"
+
+#
+# SDK/ADT target architecture
+#
+# This variable specifies the architecture to build SDK/ADT items for and means
+# you can build the SDK packages for architectures other than the machine you are
+# running the build on (i.e. building i686 packages on an x86_64 host).
+# Supported values are i686 and x86_64
+#SDKMACHINE ?= "i686"
+
+#
+# Extra image configuration defaults
+#
+# The EXTRA_IMAGE_FEATURES variable allows extra packages to be added to the generated
+# images. Some of these options are added to certain image types automatically. The
+# variable can contain the following options:
+# "dbg-pkgs" - add -dbg packages for all installed packages
+# (adds symbol information for debugging/profiling)
+# "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
+# (useful if you want to run the package test suites)
+# "tools-sdk" - add development tools (gcc, make, pkgconfig etc.)
+# "tools-debug" - add debugging tools (gdb, strace)
+# "eclipse-debug" - add Eclipse remote debugging support
+# "tools-profile" - add profiling tools (oprofile, exmap, lttng, valgrind)
+# "tools-testapps" - add useful testing tools (ts_print, aplay, arecord etc.)
+# "debug-tweaks" - make an image suitable for development
+# e.g. ssh root access has a blank password
+# There are other application targets that can be used here too, see
+# meta/classes/image.bbclass and meta/classes/core-image.bbclass for more details.
+# We default to enabling the debugging tweaks.
+EXTRA_IMAGE_FEATURES = "debug-tweaks"
+
+#
+# Additional image features
+#
+# The following is a list of additional classes to use when building images which
+# enable extra features. Some available options which can be included in this variable
+# are:
+# - '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"
+
+#
+# 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"
+#
+# Interactive shell configuration
+#
+# Under certain circumstances the system may need input from you and to do this it
+# can launch an interactive shell. It needs to do this since the build is
+# multithreaded and needs to be able to handle the case where more than one parallel
+# process may require the user's attention. The default is iterate over the available
+# terminal types to find one that works.
+#
+# Examples of the occasions this may happen are when resolving patches which cannot
+# be applied, to use the devshell or the kernel menuconfig
+#
+# Supported values are auto, gnome, xfce, rxvt, screen, konsole (KDE 3.x only), none
+# Note: currently, Konsole support only works for KDE 3.x due to the way
+# newer Konsole versions behave
+#OE_TERMINAL = "auto"
+# By default disable interactive patch resolution (tasks will just fail instead):
+PATCHRESOLVE = "noop"
+
+#
+# Disk Space Monitoring during the build
+#
+# Monitor the disk space during the build. If there is less that 1GB of space or less
+# than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully
+# shutdown the build. If there is less that 100MB or 1K inodes, perform a hard abort
+# of the build. The reason for this is that running completely out of space can corrupt
+# files and damages the build in ways which may not be easily recoverable.
+BB_DISKMON_DIRS = "\
+ STOPTASKS,${TMPDIR},1G,100K \
+ STOPTASKS,${DL_DIR},1G,100K \
+ STOPTASKS,${SSTATE_DIR},1G,100K \
+ ABORT,${TMPDIR},100M,1K \
+ ABORT,${DL_DIR},100M,1K \
+ ABORT,${SSTATE_DIR},100M,1K"
+
+#
+# Shared-state files from other locations
+#
+# As mentioned above, shared state files are prebuilt cache data objects which can
+# used to accelerate build time. This variable can be used to configure the system
+# to search other mirror locations for these objects before it builds the data itself.
+#
+# This can be a filesystem directory, or a remote url such as http or ftp. These
+# would contain the sstate-cache results from previous builds (possibly from other
+# machines). This variable works like fetcher MIRRORS/PREMIRRORS and points to the
+# cache locations to check for the shared objects.
+# NOTE: if the mirror uses the same structure as SSTATE_DIR, you need to add PATH
+# at the end as shown in the examples below. This will be substituted with the
+# correct path within the directory structure.
+#SSTATE_MIRRORS ?= "\
+#file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \
+#file://.* file:///some/local/dir/sstate/PATH"
+
+# 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
+# this doesn't mean anything to you.
+CONF_VERSION = "1"
diff --git a/meta-ivi/recipes-connectivity/bluez5/bluez5_%.bbappend b/meta-ivi/recipes-connectivity/bluez5/bluez5_%.bbappend
new file mode 100644
index 0000000..713ddef
--- /dev/null
+++ b/meta-ivi/recipes-connectivity/bluez5/bluez5_%.bbappend
@@ -0,0 +1,7 @@
+SRCREV = "f76472e7983e52580afbf3a47f2f2e29e26514b9"
+
+SRC_URI_remove = "http://kernel.org/pub/linux/bluetooth/bluez-5.15.tar.xz"
+SRC_URI_append = "git://git.gitorious.org/bluez/vudentzs-clone.git;protocol=http;branch=for-upstream"
+S = "${WORKDIR}/git"
+
+PR = "r1" \ No newline at end of file
diff --git a/meta-ivi/recipes-connectivity/connman/connman_1.23.bbappend b/meta-ivi/recipes-connectivity/connman/connman_1.23.bbappend
new file mode 100644
index 0000000..d2f8e8e
--- /dev/null
+++ b/meta-ivi/recipes-connectivity/connman/connman_1.23.bbappend
@@ -0,0 +1,6 @@
+PACKAGECONFIG_remove = "bluetooth"
+PACKAGECONFIG[bluetooth] = "--enable-bluetooth, --disable-bluetooth, bluez5"
+RDEPENDS_${PN}_remove = "bluez4"
+RDEPENDS_${PN} += "${@base_contains('PACKAGECONFIG', 'bluetooth', 'bluez5', '', d)}"
+
+PR = "r1" \ No newline at end of file
diff --git a/meta-ivi/recipes-connectivity/libpcap/libpcap_1.5.3.bbappend b/meta-ivi/recipes-connectivity/libpcap/libpcap_1.5.3.bbappend
new file mode 100644
index 0000000..1c09005
--- /dev/null
+++ b/meta-ivi/recipes-connectivity/libpcap/libpcap_1.5.3.bbappend
@@ -0,0 +1,4 @@
+PACKAGECONFIG_remove = "bluetooth"
+PACKAGECONFIG[bluetooth] = "--enable-bluetooth, --disable-bluetooth, bluez5"
+
+PR = "r1" \ No newline at end of file
diff --git a/meta-ivi/recipes-connectivity/ofono/ofono_1.14.bbappend b/meta-ivi/recipes-connectivity/ofono/ofono_1.14.bbappend
new file mode 100644
index 0000000..71db9c1
--- /dev/null
+++ b/meta-ivi/recipes-connectivity/ofono/ofono_1.14.bbappend
@@ -0,0 +1,4 @@
+DEPENDS_remove = "bluez4"
+DEPENDS_append = " bluez5"
+
+PR = "r1" \ No newline at end of file
diff --git a/meta-ivi/recipes-core-ivi/base-passwd/base-passwd/add-default-root-pass.patch b/meta-ivi/recipes-core-ivi/base-passwd/base-passwd/add-default-root-pass.patch
new file mode 100644
index 0000000..320841e
--- /dev/null
+++ b/meta-ivi/recipes-core-ivi/base-passwd/base-passwd/add-default-root-pass.patch
@@ -0,0 +1,10 @@
+Index: base-passwd/passwd.master
+===================================================================
+--- base-passwd.orig/passwd.master 2012-03-15 16:45:58.149968908 +0200
++++ base-passwd/passwd.master 2012-03-15 16:47:26.094468934 +0200
+@@ -1,4 +1,4 @@
+-root::0:0:root:/root:/bin/sh
++root:\$1\$1DO/lR8M\$f8JOOu4W8GBZzdNzCgSW40:0:0:root:/root:/bin/sh
+ daemon:*:1:1:daemon:/usr/sbin:/bin/sh
+ bin:*:2:2:bin:/bin:/bin/sh
+ sys:*:3:3:sys:/dev:/bin/sh
diff --git a/meta-ivi/recipes-core-ivi/base-passwd/base-passwd_3.5.29.bbappend b/meta-ivi/recipes-core-ivi/base-passwd/base-passwd_3.5.29.bbappend
new file mode 100644
index 0000000..58ec8f9
--- /dev/null
+++ b/meta-ivi/recipes-core-ivi/base-passwd/base-passwd_3.5.29.bbappend
@@ -0,0 +1,6 @@
+FILESEXTRAPATHS := "${THISDIR}/${PN}"
+
+# Set "root" as password for user "root"
+SRC_URI += " \
+ file://add-default-root-pass.patch \
+ "
diff --git a/meta-ivi/recipes-core-ivi/busybox/busybox-1.21.1/defconfig b/meta-ivi/recipes-core-ivi/busybox/busybox-1.21.1/defconfig
new file mode 100644
index 0000000..6094166
--- /dev/null
+++ b/meta-ivi/recipes-core-ivi/busybox/busybox-1.21.1/defconfig
@@ -0,0 +1,1012 @@
+#
+# Automatically generated make config: don't edit
+# Busybox version: 1.20.2
+# Mon Dec 10 14:08:34 2012
+#
+CONFIG_HAVE_DOT_CONFIG=y
+
+#
+# Busybox Settings
+#
+
+#
+# General Configuration
+#
+# CONFIG_DESKTOP is not set
+# CONFIG_EXTRA_COMPAT is not set
+# CONFIG_INCLUDE_SUSv2 is not set
+# CONFIG_USE_PORTABLE_CODE is not set
+CONFIG_PLATFORM_LINUX=y
+CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
+# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set
+# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
+CONFIG_SHOW_USAGE=y
+# CONFIG_FEATURE_VERBOSE_USAGE is not set
+CONFIG_FEATURE_COMPRESS_USAGE=y
+# CONFIG_FEATURE_INSTALLER is not set
+# CONFIG_INSTALL_NO_USR is not set
+# CONFIG_LOCALE_SUPPORT is not set
+# CONFIG_UNICODE_SUPPORT is not set
+# CONFIG_UNICODE_USING_LOCALE is not set
+# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
+CONFIG_SUBST_WCHAR=0
+CONFIG_LAST_SUPPORTED_WCHAR=0
+# CONFIG_UNICODE_COMBINING_WCHARS is not set
+# CONFIG_UNICODE_WIDE_WCHARS is not set
+# CONFIG_UNICODE_BIDI_SUPPORT is not set
+# CONFIG_UNICODE_NEUTRAL_TABLE is not set
+# CONFIG_UNICODE_PRESERVE_BROKEN is not set
+CONFIG_LONG_OPTS=y
+CONFIG_FEATURE_DEVPTS=y
+# CONFIG_FEATURE_CLEAN_UP is not set
+# CONFIG_FEATURE_UTMP is not set
+# CONFIG_FEATURE_WTMP is not set
+CONFIG_FEATURE_PIDFILE=y
+CONFIG_FEATURE_SUID=y
+CONFIG_FEATURE_SUID_CONFIG=y
+CONFIG_FEATURE_SUID_CONFIG_QUIET=y
+# CONFIG_SELINUX is not set
+# CONFIG_FEATURE_PREFER_APPLETS is not set
+CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe"
+# CONFIG_FEATURE_SYSLOG is not set
+# CONFIG_FEATURE_HAVE_RPC is not set
+
+#
+# Build Options
+#
+# CONFIG_STATIC is not set
+# CONFIG_PIE is not set
+# CONFIG_NOMMU is not set
+# CONFIG_BUILD_LIBBUSYBOX is not set
+# CONFIG_FEATURE_INDIVIDUAL is not set
+# CONFIG_FEATURE_SHARED_BUSYBOX is not set
+# CONFIG_LFS is not set
+CONFIG_CROSS_COMPILER_PREFIX="arm-oe-linux-gnueabi-"
+CONFIG_SYSROOT=""
+CONFIG_EXTRA_CFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types"
+CONFIG_EXTRA_LDFLAGS=""
+CONFIG_EXTRA_LDLIBS=""
+
+#
+# Debugging Options
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PESSIMIZE is not set
+# CONFIG_WERROR is not set
+CONFIG_NO_DEBUG_LIB=y
+# CONFIG_DMALLOC is not set
+# CONFIG_EFENCE is not set
+
+#
+# Installation Options ("make install" behavior)
+#
+CONFIG_INSTALL_APPLET_SYMLINKS=y
+# CONFIG_INSTALL_APPLET_HARDLINKS is not set
+# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set
+# CONFIG_INSTALL_APPLET_DONT is not set
+# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set
+# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set
+# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set
+CONFIG_PREFIX="./_install"
+
+#
+# Busybox Library Tuning
+#
+CONFIG_FEATURE_SYSTEMD=y
+CONFIG_FEATURE_RTMINMAX=y
+CONFIG_PASSWORD_MINLEN=6
+CONFIG_MD5_SMALL=1
+CONFIG_FEATURE_FAST_TOP=y
+# CONFIG_FEATURE_ETC_NETWORKS is not set
+CONFIG_FEATURE_USE_TERMIOS=y
+CONFIG_FEATURE_EDITING=y
+CONFIG_FEATURE_EDITING_MAX_LEN=1024
+# CONFIG_FEATURE_EDITING_VI is not set
+CONFIG_FEATURE_EDITING_HISTORY=15
+CONFIG_FEATURE_EDITING_SAVEHISTORY=y
+# CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is not set
+# CONFIG_FEATURE_REVERSE_SEARCH is not set
+CONFIG_FEATURE_TAB_COMPLETION=y
+CONFIG_FEATURE_USERNAME_COMPLETION=y
+CONFIG_FEATURE_EDITING_FANCY_PROMPT=y
+# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set
+CONFIG_FEATURE_NON_POSIX_CP=y
+# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set
+CONFIG_FEATURE_COPYBUF_KB=4
+CONFIG_FEATURE_SKIP_ROOTFS=y
+CONFIG_MONOTONIC_SYSCALL=y
+CONFIG_IOCTL_HEX2STR_ERROR=y
+CONFIG_FEATURE_HWIB=y
+
+#
+# Applets
+#
+
+#
+# Archival Utilities
+#
+# CONFIG_FEATURE_SEAMLESS_XZ is not set
+CONFIG_FEATURE_SEAMLESS_LZMA=y
+CONFIG_FEATURE_SEAMLESS_BZ2=y
+CONFIG_FEATURE_SEAMLESS_GZ=y
+CONFIG_FEATURE_SEAMLESS_Z=y
+CONFIG_AR=y
+# CONFIG_FEATURE_AR_LONG_FILENAMES is not set
+# CONFIG_FEATURE_AR_CREATE is not set
+CONFIG_BUNZIP2=y
+# CONFIG_BZIP2 is not set
+CONFIG_CPIO=y
+# CONFIG_FEATURE_CPIO_O is not set
+# CONFIG_FEATURE_CPIO_P is not set
+# CONFIG_DPKG is not set
+# CONFIG_DPKG_DEB is not set
+# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set
+CONFIG_GUNZIP=y
+CONFIG_GZIP=y
+# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set
+CONFIG_GZIP_FAST=0
+# CONFIG_LZOP is not set
+# CONFIG_LZOP_COMPR_HIGH is not set
+# CONFIG_RPM2CPIO is not set
+# CONFIG_RPM is not set
+CONFIG_TAR=y
+CONFIG_FEATURE_TAR_CREATE=y
+CONFIG_FEATURE_TAR_AUTODETECT=y
+CONFIG_FEATURE_TAR_FROM=y
+CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y
+# CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set
+CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
+# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set
+# CONFIG_FEATURE_TAR_TO_COMMAND is not set
+# CONFIG_FEATURE_TAR_UNAME_GNAME is not set
+# CONFIG_FEATURE_TAR_NOPRESERVE_TIME is not set
+# CONFIG_FEATURE_TAR_SELINUX is not set
+# CONFIG_UNCOMPRESS is not set
+# CONFIG_UNLZMA is not set
+# CONFIG_FEATURE_LZMA_FAST is not set
+# CONFIG_LZMA is not set
+# CONFIG_UNXZ is not set
+# CONFIG_XZ is not set
+CONFIG_UNZIP=y
+
+#
+# Coreutils
+#
+CONFIG_BASENAME=y
+CONFIG_CAT=y
+CONFIG_DATE=y
+# CONFIG_FEATURE_DATE_ISOFMT is not set
+# CONFIG_FEATURE_DATE_NANO is not set
+CONFIG_FEATURE_DATE_COMPAT=y
+# CONFIG_HOSTID is not set
+CONFIG_ID=y
+CONFIG_GROUPS=y
+CONFIG_TEST=y
+CONFIG_FEATURE_TEST_64=y
+CONFIG_TOUCH=y
+CONFIG_FEATURE_TOUCH_SUSV3=y
+CONFIG_TR=y
+CONFIG_FEATURE_TR_CLASSES=y
+# CONFIG_FEATURE_TR_EQUIV is not set
+# CONFIG_BASE64 is not set
+# CONFIG_WHO is not set
+# CONFIG_USERS is not set
+# CONFIG_CAL is not set
+# CONFIG_CATV is not set
+CONFIG_CHGRP=y
+CONFIG_CHMOD=y
+CONFIG_CHOWN=y
+# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set
+CONFIG_CHROOT=y
+# CONFIG_CKSUM is not set
+# CONFIG_COMM is not set
+CONFIG_CP=y
+# CONFIG_FEATURE_CP_LONG_OPTIONS is not set
+CONFIG_CUT=y
+CONFIG_DD=y
+CONFIG_FEATURE_DD_SIGNAL_HANDLING=y
+# CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set
+# CONFIG_FEATURE_DD_IBS_OBS is not set
+CONFIG_DF=y
+# CONFIG_FEATURE_DF_FANCY is not set
+CONFIG_DIRNAME=y
+# CONFIG_DOS2UNIX is not set
+# CONFIG_UNIX2DOS is not set
+CONFIG_DU=y
+CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y
+CONFIG_ECHO=y
+CONFIG_FEATURE_FANCY_ECHO=y
+CONFIG_ENV=y
+CONFIG_FEATURE_ENV_LONG_OPTIONS=y
+# CONFIG_EXPAND is not set
+# CONFIG_FEATURE_EXPAND_LONG_OPTIONS is not set
+CONFIG_EXPR=y
+CONFIG_EXPR_MATH_SUPPORT_64=y
+CONFIG_FALSE=y
+# CONFIG_FOLD is not set
+# CONFIG_FSYNC is not set
+CONFIG_HEAD=y
+# CONFIG_FEATURE_FANCY_HEAD is not set
+# CONFIG_INSTALL is not set
+# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set
+CONFIG_LN=y
+CONFIG_LOGNAME=y
+CONFIG_LS=y
+CONFIG_FEATURE_LS_FILETYPES=y
+CONFIG_FEATURE_LS_FOLLOWLINKS=y
+CONFIG_FEATURE_LS_RECURSIVE=y
+CONFIG_FEATURE_LS_SORTFILES=y
+CONFIG_FEATURE_LS_TIMESTAMPS=y
+CONFIG_FEATURE_LS_USERNAME=y
+CONFIG_FEATURE_LS_COLOR=y
+# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set
+CONFIG_MD5SUM=y
+CONFIG_MKDIR=y
+CONFIG_FEATURE_MKDIR_LONG_OPTIONS=y
+CONFIG_MKFIFO=y
+# CONFIG_MKNOD is not set
+CONFIG_MV=y
+# CONFIG_FEATURE_MV_LONG_OPTIONS is not set
+# CONFIG_NICE is not set
+CONFIG_NOHUP=y
+CONFIG_OD=y
+# CONFIG_PRINTENV is not set
+CONFIG_PRINTF=y
+CONFIG_PWD=y
+CONFIG_READLINK=y
+CONFIG_FEATURE_READLINK_FOLLOW=y
+CONFIG_REALPATH=y
+CONFIG_RM=y
+CONFIG_RMDIR=y
+# CONFIG_FEATURE_RMDIR_LONG_OPTIONS is not set
+CONFIG_SEQ=y
+# CONFIG_SHA1SUM is not set
+# CONFIG_SHA256SUM is not set
+# CONFIG_SHA512SUM is not set
+CONFIG_SLEEP=y
+CONFIG_FEATURE_FANCY_SLEEP=y
+# CONFIG_FEATURE_FLOAT_SLEEP is not set
+CONFIG_SORT=y
+CONFIG_FEATURE_SORT_BIG=y
+# CONFIG_SPLIT is not set
+# CONFIG_FEATURE_SPLIT_FANCY is not set
+CONFIG_STAT=y
+CONFIG_FEATURE_STAT_FORMAT=y
+CONFIG_STTY=y
+# CONFIG_SUM is not set
+CONFIG_SYNC=y
+# CONFIG_TAC is not set
+CONFIG_TAIL=y
+CONFIG_FEATURE_FANCY_TAIL=y
+CONFIG_TEE=y
+# CONFIG_FEATURE_TEE_USE_BLOCK_IO is not set
+CONFIG_TRUE=y
+CONFIG_TTY=y
+CONFIG_UNAME=y
+# CONFIG_UNEXPAND is not set
+# CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS is not set
+CONFIG_UNIQ=y
+CONFIG_USLEEP=y
+# CONFIG_UUDECODE is not set
+# CONFIG_UUENCODE is not set
+CONFIG_WC=y
+# CONFIG_FEATURE_WC_LARGE is not set
+CONFIG_WHOAMI=y
+CONFIG_YES=y
+
+#
+# Common options for cp and mv
+#
+# CONFIG_FEATURE_PRESERVE_HARDLINKS is not set
+
+#
+# Common options for ls, more and telnet
+#
+CONFIG_FEATURE_AUTOWIDTH=y
+
+#
+# Common options for df, du, ls
+#
+CONFIG_FEATURE_HUMAN_READABLE=y
+
+#
+# Common options for md5sum, sha1sum, sha256sum, sha512sum
+#
+CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y
+
+#
+# Console Utilities
+#
+CONFIG_CHVT=y
+# CONFIG_FGCONSOLE is not set
+CONFIG_CLEAR=y
+CONFIG_DEALLOCVT=y
+CONFIG_DUMPKMAP=y
+# CONFIG_KBD_MODE is not set
+CONFIG_LOADFONT=y
+CONFIG_LOADKMAP=y
+CONFIG_OPENVT=y
+CONFIG_RESET=y
+# CONFIG_RESIZE is not set
+# CONFIG_FEATURE_RESIZE_PRINT is not set
+CONFIG_SETCONSOLE=y
+# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set
+# CONFIG_SETFONT is not set
+# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set
+CONFIG_DEFAULT_SETFONT_DIR=""
+# CONFIG_SETKEYCODES is not set
+# CONFIG_SETLOGCONS is not set
+# CONFIG_SHOWKEY is not set
+
+#
+# Common options for loadfont and setfont
+#
+# CONFIG_FEATURE_LOADFONT_PSF2 is not set
+# CONFIG_FEATURE_LOADFONT_RAW is not set
+
+#
+# Debian Utilities
+#
+CONFIG_MKTEMP=y
+# CONFIG_PIPE_PROGRESS is not set
+CONFIG_RUN_PARTS=y
+CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=y
+# CONFIG_FEATURE_RUN_PARTS_FANCY is not set
+# CONFIG_START_STOP_DAEMON is not set
+# CONFIG_FEATURE_START_STOP_DAEMON_FANCY is not set
+# CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS is not set
+CONFIG_WHICH=y
+
+#
+# Editors
+#
+# CONFIG_PATCH is not set
+CONFIG_VI=y
+CONFIG_FEATURE_VI_MAX_LEN=1024
+CONFIG_FEATURE_VI_8BIT=y
+CONFIG_FEATURE_VI_COLON=y
+CONFIG_FEATURE_VI_YANKMARK=y
+CONFIG_FEATURE_VI_SEARCH=y
+# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
+CONFIG_FEATURE_VI_USE_SIGNALS=y
+# CONFIG_FEATURE_VI_DOT_CMD is not set
+# CONFIG_FEATURE_VI_READONLY is not set
+# CONFIG_FEATURE_VI_SETOPTS is not set
+# CONFIG_FEATURE_VI_SET is not set
+CONFIG_FEATURE_VI_WIN_RESIZE=y
+# CONFIG_FEATURE_VI_ASK_TERMINAL is not set
+CONFIG_FEATURE_VI_OPTIMIZE_CURSOR=y
+CONFIG_AWK=y
+# CONFIG_FEATURE_AWK_LIBM is not set
+CONFIG_CMP=y
+CONFIG_DIFF=y
+# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set
+CONFIG_FEATURE_DIFF_DIR=y
+# CONFIG_ED is not set
+CONFIG_SED=y
+CONFIG_FEATURE_ALLOW_EXEC=y
+
+#
+# Finding Utilities
+#
+CONFIG_FIND=y
+CONFIG_FEATURE_FIND_PRINT0=y
+CONFIG_FEATURE_FIND_MTIME=y
+CONFIG_FEATURE_FIND_MMIN=y
+CONFIG_FEATURE_FIND_PERM=y
+CONFIG_FEATURE_FIND_TYPE=y
+CONFIG_FEATURE_FIND_XDEV=y
+CONFIG_FEATURE_FIND_MAXDEPTH=y
+CONFIG_FEATURE_FIND_NEWER=y
+# CONFIG_FEATURE_FIND_INUM is not set
+CONFIG_FEATURE_FIND_EXEC=y
+CONFIG_FEATURE_FIND_USER=y
+CONFIG_FEATURE_FIND_GROUP=y
+CONFIG_FEATURE_FIND_NOT=y
+CONFIG_FEATURE_FIND_DEPTH=y
+CONFIG_FEATURE_FIND_PAREN=y
+CONFIG_FEATURE_FIND_SIZE=y
+CONFIG_FEATURE_FIND_PRUNE=y
+# CONFIG_FEATURE_FIND_DELETE is not set
+CONFIG_FEATURE_FIND_PATH=y
+CONFIG_FEATURE_FIND_REGEX=y
+# CONFIG_FEATURE_FIND_CONTEXT is not set
+# CONFIG_FEATURE_FIND_LINKS is not set
+CONFIG_GREP=y
+CONFIG_FEATURE_GREP_EGREP_ALIAS=y
+CONFIG_FEATURE_GREP_FGREP_ALIAS=y
+CONFIG_FEATURE_GREP_CONTEXT=y
+CONFIG_XARGS=y
+# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_QUOTES is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM is not set
+
+#
+# Init Utilities
+#
+# CONFIG_BOOTCHARTD is not set
+# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set
+# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set
+# CONFIG_HALT is not set
+# CONFIG_FEATURE_CALL_TELINIT is not set
+CONFIG_TELINIT_PATH=""
+# CONFIG_INIT is not set
+# CONFIG_FEATURE_USE_INITTAB is not set
+# CONFIG_FEATURE_KILL_REMOVED is not set
+CONFIG_FEATURE_KILL_DELAY=0
+# CONFIG_FEATURE_INIT_SCTTY is not set
+# CONFIG_FEATURE_INIT_SYSLOG is not set
+# CONFIG_FEATURE_EXTRA_QUIET is not set
+# CONFIG_FEATURE_INIT_COREDUMPS is not set
+# CONFIG_FEATURE_INITRD is not set
+CONFIG_INIT_TERMINAL_TYPE=""
+# CONFIG_MESG is not set
+# CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP is not set
+
+#
+# Login/Password Management Utilities
+#
+# CONFIG_ADD_SHELL is not set
+# CONFIG_REMOVE_SHELL is not set
+# CONFIG_FEATURE_SHADOWPASSWDS is not set
+# CONFIG_USE_BB_PWD_GRP is not set
+# CONFIG_USE_BB_SHADOW is not set
+# CONFIG_USE_BB_CRYPT is not set
+# CONFIG_USE_BB_CRYPT_SHA is not set
+# CONFIG_ADDUSER is not set
+# CONFIG_FEATURE_ADDUSER_LONG_OPTIONS is not set
+# CONFIG_FEATURE_CHECK_NAMES is not set
+CONFIG_FIRST_SYSTEM_ID=0
+CONFIG_LAST_SYSTEM_ID=0
+# CONFIG_ADDGROUP is not set
+# CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS is not set
+# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set
+# CONFIG_DELUSER is not set
+# CONFIG_DELGROUP is not set
+# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set
+# CONFIG_GETTY is not set
+# CONFIG_LOGIN is not set
+# CONFIG_LOGIN_SESSION_AS_CHILD is not set
+# CONFIG_PAM is not set
+# CONFIG_LOGIN_SCRIPTS is not set
+# CONFIG_FEATURE_NOLOGIN is not set
+# CONFIG_FEATURE_SECURETTY is not set
+# CONFIG_PASSWD is not set
+# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set
+# CONFIG_CRYPTPW is not set
+# CONFIG_CHPASSWD is not set
+CONFIG_FEATURE_DEFAULT_PASSWD_ALGO=""
+# CONFIG_SU is not set
+# CONFIG_FEATURE_SU_SYSLOG is not set
+# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set
+# CONFIG_SULOGIN is not set
+# CONFIG_VLOCK is not set
+
+#
+# Linux Ext2 FS Progs
+#
+CONFIG_CHATTR=y
+CONFIG_FSCK=y
+# CONFIG_LSATTR is not set
+# CONFIG_TUNE2FS is not set
+
+#
+# Linux Module Utilities
+#
+# CONFIG_MODINFO is not set
+# CONFIG_MODPROBE_SMALL is not set
+# CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE is not set
+# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set
+# CONFIG_INSMOD is not set
+# CONFIG_RMMOD is not set
+# CONFIG_LSMOD is not set
+# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set
+# CONFIG_MODPROBE is not set
+# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set
+# CONFIG_DEPMOD is not set
+
+#
+# Options common to multiple modutils
+#
+# CONFIG_FEATURE_2_4_MODULES is not set
+# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set
+# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
+# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
+# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set
+# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set
+# CONFIG_FEATURE_MODUTILS_ALIAS is not set
+# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set
+CONFIG_DEFAULT_MODULES_DIR=""
+CONFIG_DEFAULT_DEPMOD_FILE=""
+
+#
+# Linux System Utilities
+#
+# CONFIG_BLOCKDEV is not set
+# CONFIG_MDEV is not set
+# CONFIG_FEATURE_MDEV_CONF is not set
+# CONFIG_FEATURE_MDEV_RENAME is not set
+# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set
+# CONFIG_FEATURE_MDEV_EXEC is not set
+# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set
+# CONFIG_REV is not set
+# CONFIG_ACPID is not set
+# CONFIG_FEATURE_ACPID_COMPAT is not set
+# CONFIG_BLKID is not set
+# CONFIG_FEATURE_BLKID_TYPE is not set
+# CONFIG_DMESG is not set
+# CONFIG_FEATURE_DMESG_PRETTY is not set
+CONFIG_FBSET=y
+CONFIG_FEATURE_FBSET_FANCY=y
+CONFIG_FEATURE_FBSET_READMODE=y
+# CONFIG_FDFLUSH is not set
+# CONFIG_FDFORMAT is not set
+CONFIG_FDISK=y
+CONFIG_FDISK_SUPPORT_LARGE_DISKS=y
+CONFIG_FEATURE_FDISK_WRITABLE=y
+# CONFIG_FEATURE_AIX_LABEL is not set
+# CONFIG_FEATURE_SGI_LABEL is not set
+# CONFIG_FEATURE_SUN_LABEL is not set
+# CONFIG_FEATURE_OSF_LABEL is not set
+# CONFIG_FEATURE_GPT_LABEL is not set
+# CONFIG_FEATURE_FDISK_ADVANCED is not set
+# CONFIG_FINDFS is not set
+CONFIG_FLOCK=y
+# CONFIG_FREERAMDISK is not set
+# CONFIG_FSCK_MINIX is not set
+# CONFIG_MKFS_EXT2 is not set
+# CONFIG_MKFS_MINIX is not set
+# CONFIG_FEATURE_MINIX2 is not set
+# CONFIG_MKFS_REISER is not set
+# CONFIG_MKFS_VFAT is not set
+# CONFIG_GETOPT is not set
+# CONFIG_FEATURE_GETOPT_LONG is not set
+CONFIG_HEXDUMP=y
+# CONFIG_FEATURE_HEXDUMP_REVERSE is not set
+# CONFIG_HD is not set
+CONFIG_HWCLOCK=y
+CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS=y
+CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS=y
+# CONFIG_IPCRM is not set
+# CONFIG_IPCS is not set
+# CONFIG_LOSETUP is not set
+# CONFIG_LSPCI is not set
+# CONFIG_LSUSB is not set
+# CONFIG_MKSWAP is not set
+# CONFIG_FEATURE_MKSWAP_UUID is not set
+CONFIG_MORE=y
+# CONFIG_MOUNT is not set
+# CONFIG_FEATURE_MOUNT_FAKE is not set
+# CONFIG_FEATURE_MOUNT_VERBOSE is not set
+# CONFIG_FEATURE_MOUNT_HELPERS is not set
+# CONFIG_FEATURE_MOUNT_LABEL is not set
+# CONFIG_FEATURE_MOUNT_NFS is not set
+# CONFIG_FEATURE_MOUNT_CIFS is not set
+# CONFIG_FEATURE_MOUNT_FLAGS is not set
+# CONFIG_FEATURE_MOUNT_FSTAB is not set
+CONFIG_PIVOT_ROOT=y
+# CONFIG_RDATE is not set
+# CONFIG_RDEV is not set
+# CONFIG_READPROFILE is not set
+# CONFIG_RTCWAKE is not set
+# CONFIG_SCRIPT is not set
+# CONFIG_SCRIPTREPLAY is not set
+# CONFIG_SETARCH is not set
+# CONFIG_SWAPONOFF is not set
+# CONFIG_FEATURE_SWAPON_PRI is not set
+CONFIG_SWITCH_ROOT=y
+# CONFIG_UMOUNT is not set
+# CONFIG_FEATURE_UMOUNT_ALL is not set
+# CONFIG_FEATURE_MOUNT_LOOP is not set
+# CONFIG_FEATURE_MOUNT_LOOP_CREATE is not set
+# CONFIG_FEATURE_MTAB_SUPPORT is not set
+# CONFIG_VOLUMEID is not set
+# CONFIG_FEATURE_VOLUMEID_EXT is not set
+# CONFIG_FEATURE_VOLUMEID_BTRFS is not set
+# CONFIG_FEATURE_VOLUMEID_REISERFS is not set
+# CONFIG_FEATURE_VOLUMEID_FAT is not set
+# CONFIG_FEATURE_VOLUMEID_HFS is not set
+# CONFIG_FEATURE_VOLUMEID_JFS is not set
+# CONFIG_FEATURE_VOLUMEID_XFS is not set
+# CONFIG_FEATURE_VOLUMEID_NTFS is not set
+# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set
+# CONFIG_FEATURE_VOLUMEID_UDF is not set
+# CONFIG_FEATURE_VOLUMEID_LUKS is not set
+# CONFIG_FEATURE_VOLUMEID_LINUXSWAP is not set
+# CONFIG_FEATURE_VOLUMEID_CRAMFS is not set
+# CONFIG_FEATURE_VOLUMEID_ROMFS is not set
+# CONFIG_FEATURE_VOLUMEID_SYSV is not set
+# CONFIG_FEATURE_VOLUMEID_OCFS2 is not set
+# CONFIG_FEATURE_VOLUMEID_LINUXRAID is not set
+
+#
+# Miscellaneous Utilities
+#
+# CONFIG_CONSPY is not set
+CONFIG_LESS=y
+CONFIG_FEATURE_LESS_MAXLINES=9999999
+CONFIG_FEATURE_LESS_BRACKETS=y
+CONFIG_FEATURE_LESS_FLAGS=y
+# CONFIG_FEATURE_LESS_MARKS is not set
+# CONFIG_FEATURE_LESS_REGEXP is not set
+# CONFIG_FEATURE_LESS_WINCH is not set
+# CONFIG_FEATURE_LESS_ASK_TERMINAL is not set
+# CONFIG_FEATURE_LESS_DASHCMD is not set
+# CONFIG_FEATURE_LESS_LINENUMS is not set
+# CONFIG_NANDWRITE is not set
+# CONFIG_NANDDUMP is not set
+# CONFIG_SETSERIAL is not set
+# CONFIG_UBIATTACH is not set
+# CONFIG_UBIDETACH is not set
+# CONFIG_UBIMKVOL is not set
+# CONFIG_UBIRMVOL is not set
+# CONFIG_UBIRSVOL is not set
+# CONFIG_UBIUPDATEVOL is not set
+# CONFIG_ADJTIMEX is not set
+# CONFIG_BBCONFIG is not set
+# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set
+# CONFIG_BEEP is not set
+CONFIG_FEATURE_BEEP_FREQ=0
+CONFIG_FEATURE_BEEP_LENGTH_MS=0
+# CONFIG_CHAT is not set
+# CONFIG_FEATURE_CHAT_NOFAIL is not set
+# CONFIG_FEATURE_CHAT_TTY_HIFI is not set
+# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set
+# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set
+# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set
+# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set
+# CONFIG_FEATURE_CHAT_CLR_ABORT is not set
+# CONFIG_CHRT is not set
+# CONFIG_CROND is not set
+# CONFIG_FEATURE_CROND_D is not set
+# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
+CONFIG_FEATURE_CROND_DIR=""
+# CONFIG_CRONTAB is not set
+CONFIG_DC=y
+# CONFIG_FEATURE_DC_LIBM is not set
+# CONFIG_DEVFSD is not set
+# CONFIG_DEVFSD_MODLOAD is not set
+# CONFIG_DEVFSD_FG_NP is not set
+# CONFIG_DEVFSD_VERBOSE is not set
+# CONFIG_FEATURE_DEVFS is not set
+# CONFIG_DEVMEM is not set
+# CONFIG_EJECT is not set
+# CONFIG_FEATURE_EJECT_SCSI is not set
+# CONFIG_FBSPLASH is not set
+# CONFIG_FLASHCP is not set
+# CONFIG_FLASH_LOCK is not set
+# CONFIG_FLASH_UNLOCK is not set
+# CONFIG_FLASH_ERASEALL is not set
+# CONFIG_IONICE is not set
+# CONFIG_INOTIFYD is not set
+# CONFIG_LAST is not set
+# CONFIG_FEATURE_LAST_SMALL is not set
+# CONFIG_FEATURE_LAST_FANCY is not set
+# CONFIG_HDPARM is not set
+# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set
+# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set
+# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set
+# CONFIG_MAKEDEVS is not set
+# CONFIG_FEATURE_MAKEDEVS_LEAF is not set
+# CONFIG_FEATURE_MAKEDEVS_TABLE is not set
+# CONFIG_MAN is not set
+CONFIG_MICROCOM=y
+# CONFIG_MOUNTPOINT is not set
+# CONFIG_MT is not set
+# CONFIG_RAIDAUTORUN is not set
+# CONFIG_READAHEAD is not set
+CONFIG_RFKILL=y
+# CONFIG_RUNLEVEL is not set
+# CONFIG_RX is not set
+# CONFIG_SETSID is not set
+CONFIG_STRINGS=y
+# CONFIG_TASKSET is not set
+# CONFIG_FEATURE_TASKSET_FANCY is not set
+CONFIG_TIME=y
+# CONFIG_TIMEOUT is not set
+# CONFIG_TTYSIZE is not set
+# CONFIG_VOLNAME is not set
+# CONFIG_WALL is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Networking Utilities
+#
+# CONFIG_NAMEIF is not set
+# CONFIG_FEATURE_NAMEIF_EXTENDED is not set
+# CONFIG_NBDCLIENT is not set
+CONFIG_NC=y
+# CONFIG_NC_SERVER is not set
+# CONFIG_NC_EXTRA is not set
+# CONFIG_NC_110_COMPAT is not set
+CONFIG_PING=y
+CONFIG_PING6=y
+CONFIG_FEATURE_FANCY_PING=y
+# CONFIG_WHOIS is not set
+CONFIG_FEATURE_IPV6=y
+# CONFIG_FEATURE_UNIX_LOCAL is not set
+CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y
+# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set
+# CONFIG_ARP is not set
+# CONFIG_ARPING is not set
+# CONFIG_BRCTL is not set
+# CONFIG_FEATURE_BRCTL_FANCY is not set
+# CONFIG_FEATURE_BRCTL_SHOW is not set
+# CONFIG_DNSD is not set
+# CONFIG_ETHER_WAKE is not set
+# CONFIG_FAKEIDENTD is not set
+# CONFIG_FTPD is not set
+# CONFIG_FEATURE_FTP_WRITE is not set
+# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set
+# CONFIG_FTPGET is not set
+# CONFIG_FTPPUT is not set
+# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set
+CONFIG_HOSTNAME=y
+# CONFIG_HTTPD is not set
+# CONFIG_FEATURE_HTTPD_RANGES is not set
+# CONFIG_FEATURE_HTTPD_USE_SENDFILE is not set
+# CONFIG_FEATURE_HTTPD_SETUID is not set
+# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set
+# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
+# CONFIG_FEATURE_HTTPD_CGI is not set
+# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set
+# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set
+# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set
+# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set
+# CONFIG_FEATURE_HTTPD_PROXY is not set
+# CONFIG_FEATURE_HTTPD_GZIP is not set
+CONFIG_IFCONFIG=y
+CONFIG_FEATURE_IFCONFIG_STATUS=y
+# CONFIG_FEATURE_IFCONFIG_SLIP is not set
+# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set
+CONFIG_FEATURE_IFCONFIG_HW=y
+# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set
+# CONFIG_IFENSLAVE is not set
+# CONFIG_IFPLUGD is not set
+CONFIG_IFUPDOWN=y
+CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate"
+# CONFIG_FEATURE_IFUPDOWN_IP is not set
+# CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN is not set
+CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN=y
+CONFIG_FEATURE_IFUPDOWN_IPV4=y
+CONFIG_FEATURE_IFUPDOWN_IPV6=y
+CONFIG_FEATURE_IFUPDOWN_MAPPING=y
+# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set
+# CONFIG_INETD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set
+# CONFIG_FEATURE_INETD_RPC is not set
+CONFIG_IP=y
+CONFIG_FEATURE_IP_ADDRESS=y
+CONFIG_FEATURE_IP_LINK=y
+CONFIG_FEATURE_IP_ROUTE=y
+CONFIG_FEATURE_IP_TUNNEL=y
+# CONFIG_FEATURE_IP_RULE is not set
+# CONFIG_FEATURE_IP_SHORT_FORMS is not set
+# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set
+# CONFIG_IPADDR is not set
+# CONFIG_IPLINK is not set
+# CONFIG_IPROUTE is not set
+# CONFIG_IPTUNNEL is not set
+# CONFIG_IPRULE is not set
+# CONFIG_IPCALC is not set
+# CONFIG_FEATURE_IPCALC_FANCY is not set
+# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set
+CONFIG_NETSTAT=y
+# CONFIG_FEATURE_NETSTAT_WIDE is not set
+# CONFIG_FEATURE_NETSTAT_PRG is not set
+CONFIG_NSLOOKUP=y
+# CONFIG_NTPD is not set
+# CONFIG_FEATURE_NTPD_SERVER is not set
+# CONFIG_PSCAN is not set
+CONFIG_ROUTE=y
+# CONFIG_SLATTACH is not set
+# CONFIG_TCPSVD is not set
+# CONFIG_TELNET is not set
+# CONFIG_FEATURE_TELNET_TTYPE is not set
+# CONFIG_FEATURE_TELNET_AUTOLOGIN is not set
+# CONFIG_TELNETD is not set
+# CONFIG_FEATURE_TELNETD_STANDALONE is not set
+# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set
+# CONFIG_TFTP is not set
+# CONFIG_TFTPD is not set
+# CONFIG_FEATURE_TFTP_GET is not set
+# CONFIG_FEATURE_TFTP_PUT is not set
+# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set
+# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set
+# CONFIG_TFTP_DEBUG is not set
+CONFIG_TRACEROUTE=y
+# CONFIG_TRACEROUTE6 is not set
+# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set
+# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set
+# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set
+# CONFIG_TUNCTL is not set
+# CONFIG_FEATURE_TUNCTL_UG is not set
+# CONFIG_UDHCPC6 is not set
+# CONFIG_UDHCPD is not set
+# CONFIG_DHCPRELAY is not set
+# CONFIG_DUMPLEASES is not set
+# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set
+# CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set
+CONFIG_DHCPD_LEASES_FILE=""
+# CONFIG_UDHCPC is not set
+# CONFIG_FEATURE_UDHCPC_ARPING is not set
+# CONFIG_FEATURE_UDHCP_PORT is not set
+CONFIG_UDHCP_DEBUG=0
+# CONFIG_FEATURE_UDHCP_RFC3397 is not set
+# CONFIG_FEATURE_UDHCP_8021Q is not set
+CONFIG_UDHCPC_DEFAULT_SCRIPT=""
+CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=0
+CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS=""
+# CONFIG_UDPSVD is not set
+# CONFIG_VCONFIG is not set
+CONFIG_WGET=y
+CONFIG_FEATURE_WGET_STATUSBAR=y
+CONFIG_FEATURE_WGET_AUTHENTICATION=y
+CONFIG_FEATURE_WGET_LONG_OPTIONS=y
+CONFIG_FEATURE_WGET_TIMEOUT=y
+# CONFIG_ZCIP is not set
+
+#
+# Print Utilities
+#
+# CONFIG_LPD is not set
+# CONFIG_LPR is not set
+# CONFIG_LPQ is not set
+
+#
+# Mail Utilities
+#
+# CONFIG_MAKEMIME is not set
+CONFIG_FEATURE_MIME_CHARSET=""
+# CONFIG_POPMAILDIR is not set
+# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set
+# CONFIG_REFORMIME is not set
+# CONFIG_FEATURE_REFORMIME_COMPAT is not set
+# CONFIG_SENDMAIL is not set
+
+#
+# Process Utilities
+#
+# CONFIG_IOSTAT is not set
+# CONFIG_LSOF is not set
+# CONFIG_MPSTAT is not set
+# CONFIG_NMETER is not set
+# CONFIG_PMAP is not set
+# CONFIG_POWERTOP is not set
+# CONFIG_PSTREE is not set
+# CONFIG_PWDX is not set
+# CONFIG_SMEMCAP is not set
+# CONFIG_UPTIME is not set
+# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set
+# CONFIG_FREE is not set
+CONFIG_FUSER=y
+# CONFIG_KILL is not set
+# CONFIG_KILLALL is not set
+# CONFIG_KILLALL5 is not set
+# CONFIG_PGREP is not set
+CONFIG_PIDOF=y
+# CONFIG_FEATURE_PIDOF_SINGLE is not set
+# CONFIG_FEATURE_PIDOF_OMIT is not set
+# CONFIG_PKILL is not set
+# CONFIG_PS is not set
+# CONFIG_FEATURE_PS_WIDE is not set
+# CONFIG_FEATURE_PS_LONG is not set
+# CONFIG_FEATURE_PS_TIME is not set
+# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set
+# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set
+CONFIG_RENICE=y
+# CONFIG_BB_SYSCTL is not set
+# CONFIG_TOP is not set
+# CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE is not set
+# CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS is not set
+# CONFIG_FEATURE_TOP_SMP_CPU is not set
+# CONFIG_FEATURE_TOP_DECIMALS is not set
+# CONFIG_FEATURE_TOP_SMP_PROCESS is not set
+# CONFIG_FEATURE_TOPMEM is not set
+# CONFIG_FEATURE_SHOW_THREADS is not set
+# CONFIG_WATCH is not set
+
+#
+# Runit Utilities
+#
+# CONFIG_RUNSV is not set
+# CONFIG_RUNSVDIR is not set
+# CONFIG_FEATURE_RUNSVDIR_LOG is not set
+# CONFIG_SV is not set
+CONFIG_SV_DEFAULT_SERVICE_DIR=""
+# CONFIG_SVLOGD is not set
+# CONFIG_CHPST is not set
+# CONFIG_SETUIDGID is not set
+# CONFIG_ENVUIDGID is not set
+# CONFIG_ENVDIR is not set
+# CONFIG_SOFTLIMIT is not set
+# CONFIG_CHCON is not set
+# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set
+# CONFIG_GETENFORCE is not set
+# CONFIG_GETSEBOOL is not set
+# CONFIG_LOAD_POLICY is not set
+# CONFIG_MATCHPATHCON is not set
+# CONFIG_RESTORECON is not set
+# CONFIG_RUNCON is not set
+# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set
+# CONFIG_SELINUXENABLED is not set
+# CONFIG_SETENFORCE is not set
+# CONFIG_SETFILES is not set
+# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set
+# CONFIG_SETSEBOOL is not set
+# CONFIG_SESTATUS is not set
+
+#
+# Shells
+#
+CONFIG_ASH=y
+CONFIG_ASH_BASH_COMPAT=y
+# CONFIG_ASH_IDLE_TIMEOUT is not set
+CONFIG_ASH_JOB_CONTROL=y
+CONFIG_ASH_ALIAS=y
+CONFIG_ASH_GETOPTS=y
+CONFIG_ASH_BUILTIN_ECHO=y
+CONFIG_ASH_BUILTIN_PRINTF=y
+CONFIG_ASH_BUILTIN_TEST=y
+# CONFIG_ASH_CMDCMD is not set
+# CONFIG_ASH_MAIL is not set
+CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
+# CONFIG_ASH_RANDOM_SUPPORT is not set
+CONFIG_ASH_EXPAND_PRMT=y
+# CONFIG_CTTYHACK is not set
+# CONFIG_HUSH is not set
+# CONFIG_HUSH_BASH_COMPAT is not set
+# CONFIG_HUSH_BRACE_EXPANSION is not set
+# CONFIG_HUSH_HELP is not set
+# CONFIG_HUSH_INTERACTIVE is not set
+# CONFIG_HUSH_SAVEHISTORY is not set
+# CONFIG_HUSH_JOB is not set
+# CONFIG_HUSH_TICK is not set
+# CONFIG_HUSH_IF is not set
+# CONFIG_HUSH_LOOPS is not set
+# CONFIG_HUSH_CASE is not set
+# CONFIG_HUSH_FUNCTIONS is not set
+# CONFIG_HUSH_LOCAL is not set
+# CONFIG_HUSH_RANDOM_SUPPORT is not set
+# CONFIG_HUSH_EXPORT_N is not set
+# CONFIG_HUSH_MODE_X is not set
+# CONFIG_MSH is not set
+CONFIG_FEATURE_SH_IS_ASH=y
+# CONFIG_FEATURE_SH_IS_HUSH is not set
+# CONFIG_FEATURE_SH_IS_NONE is not set
+# CONFIG_FEATURE_BASH_IS_ASH is not set
+# CONFIG_FEATURE_BASH_IS_HUSH is not set
+CONFIG_FEATURE_BASH_IS_NONE=y
+CONFIG_SH_MATH_SUPPORT=y
+# CONFIG_SH_MATH_SUPPORT_64 is not set
+CONFIG_FEATURE_SH_EXTRA_QUIET=y
+# CONFIG_FEATURE_SH_STANDALONE is not set
+# CONFIG_FEATURE_SH_NOFORK is not set
+CONFIG_FEATURE_SH_HISTFILESIZE=y
+
+#
+# System Logging Utilities
+#
+# CONFIG_SYSLOGD is not set
+# CONFIG_FEATURE_ROTATE_LOGFILE is not set
+# CONFIG_FEATURE_REMOTE_LOG is not set
+# CONFIG_FEATURE_SYSLOGD_DUP is not set
+# CONFIG_FEATURE_SYSLOGD_CFG is not set
+CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=0
+# CONFIG_FEATURE_IPC_SYSLOG is not set
+CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0
+# CONFIG_LOGREAD is not set
+# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set
+# CONFIG_KLOGD is not set
+# CONFIG_FEATURE_KLOGD_KLOGCTL is not set
+# CONFIG_LOGGER is not set
diff --git a/meta-ivi/recipes-core-ivi/busybox/busybox_1.22.1.bbappend b/meta-ivi/recipes-core-ivi/busybox/busybox_1.22.1.bbappend
new file mode 100644
index 0000000..dafc6a3
--- /dev/null
+++ b/meta-ivi/recipes-core-ivi/busybox/busybox_1.22.1.bbappend
@@ -0,0 +1,2 @@
+FILESEXTRAPATHS := "${THISDIR}/${PN}-${PV}"
+SRC_URI += "file://defconfig"
diff --git a/meta-ivi/recipes-core-ivi/dbus/dbus/dbus-DBusMessage-add-support-for-custom-marshaling.patch b/meta-ivi/recipes-core-ivi/dbus/dbus/dbus-DBusMessage-add-support-for-custom-marshaling.patch
new file mode 100644
index 0000000..5f225f3
--- /dev/null
+++ b/meta-ivi/recipes-core-ivi/dbus/dbus/dbus-DBusMessage-add-support-for-custom-marshaling.patch
@@ -0,0 +1,267 @@
+From 467a2e307462b02865b35397c572b6048c2934e2 Mon Sep 17 00:00:00 2001
+From: Aleksandar Kanchev <kanchev@itestra.com>
+Date: Mon, 9 Jul 2012 18:09:04 +0200
+Subject: [PATCH] DBusMessage: add support for custom marshaling
+
+Add functions to support querying and manipulating the message body and
+signature. This is useful for code generators, which can generate custom
+marshaling functions based on a given IDL. Those functions tend to be
+optimized and faster than the generic iterator based marshaling.
+---
+ dbus/dbus-message.c | 143 +++++++++++++++++++++++++++++++++++----------------
+ dbus/dbus-message.h | 13 +++++
+ dbus/dbus-string.c | 16 ++++++
+ dbus/dbus-string.h | 4 ++
+ 4 files changed, 132 insertions(+), 44 deletions(-)
+
+diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c
+index 24ef5ac..fbacfba 100644
+--- a/dbus/dbus-message.c
++++ b/dbus/dbus-message.c
+@@ -356,50 +356,6 @@ set_or_delete_string_field (DBusMessage *message,
+ &value);
+ }
+
+-#if 0
+-/* Probably we don't need to use this */
+-/**
+- * Sets the signature of the message, i.e. the arguments in the
+- * message payload. The signature includes only "in" arguments for
+- * #DBUS_MESSAGE_TYPE_METHOD_CALL and only "out" arguments for
+- * #DBUS_MESSAGE_TYPE_METHOD_RETURN, so is slightly different from
+- * what you might expect (it does not include the signature of the
+- * entire C++-style method).
+- *
+- * The signature is a string made up of type codes such as
+- * #DBUS_TYPE_INT32. The string is terminated with nul (nul is also
+- * the value of #DBUS_TYPE_INVALID). The macros such as
+- * #DBUS_TYPE_INT32 evaluate to integers; to assemble a signature you
+- * may find it useful to use the string forms, such as
+- * #DBUS_TYPE_INT32_AS_STRING.
+- *
+- * An "unset" or #NULL signature is considered the same as an empty
+- * signature. In fact dbus_message_get_signature() will never return
+- * #NULL.
+- *
+- * @param message the message
+- * @param signature the type signature or #NULL to unset
+- * @returns #FALSE if no memory
+- */
+-static dbus_bool_t
+-_dbus_message_set_signature (DBusMessage *message,
+- const char *signature)
+-{
+- _dbus_return_val_if_fail (message != NULL, FALSE);
+- _dbus_return_val_if_fail (!message->locked, FALSE);
+- _dbus_return_val_if_fail (signature == NULL ||
+- _dbus_check_is_valid_signature (signature));
+- /* can't delete the signature if you have a message body */
+- _dbus_return_val_if_fail (_dbus_string_get_length (&message->body) == 0 ||
+- signature != NULL);
+-
+- return set_or_delete_string_field (message,
+- DBUS_HEADER_FIELD_SIGNATURE,
+- DBUS_TYPE_SIGNATURE,
+- signature);
+-}
+-#endif
+-
+ /* Message Cache
+ *
+ * We cache some DBusMessage to reduce the overhead of allocating
+@@ -3370,6 +3326,47 @@ dbus_message_get_sender (DBusMessage *message)
+ }
+
+ /**
++ * Sets the signature of the message, i.e. the arguments in the
++ * message payload. The signature includes only "in" arguments for
++ * #DBUS_MESSAGE_TYPE_METHOD_CALL and only "out" arguments for
++ * #DBUS_MESSAGE_TYPE_METHOD_RETURN, so is slightly different from
++ * what you might expect (it does not include the signature of the
++ * entire C++-style method).
++ *
++ * The signature is a string made up of type codes such as
++ * #DBUS_TYPE_INT32. The string is terminated with nul (nul is also
++ * the value of #DBUS_TYPE_INVALID). The macros such as
++ * #DBUS_TYPE_INT32 evaluate to integers; to assemble a signature you
++ * may find it useful to use the string forms, such as
++ * #DBUS_TYPE_INT32_AS_STRING.
++ *
++ * An "unset" or #NULL signature is considered the same as an empty
++ * signature. In fact dbus_message_get_signature() will never return
++ * #NULL.
++ *
++ * @param message the message
++ * @param signature the type signature or #NULL to unset
++ * @returns #FALSE if no memory
++ */
++dbus_bool_t
++dbus_message_set_signature (DBusMessage *message,
++ const char *signature)
++{
++ _dbus_return_val_if_fail (message != NULL, FALSE);
++ _dbus_return_val_if_fail (!message->locked, FALSE);
++ _dbus_return_val_if_fail (signature == NULL ||
++ _dbus_check_is_valid_signature (signature), FALSE);
++ /* can't delete the signature if you have a message body */
++ _dbus_return_val_if_fail (_dbus_string_get_length (&message->body) == 0 ||
++ signature != NULL, FALSE);
++
++ return set_or_delete_string_field (message,
++ DBUS_HEADER_FIELD_SIGNATURE,
++ DBUS_TYPE_SIGNATURE,
++ signature);
++}
++
++/**
+ * Gets the type signature of the message, i.e. the arguments in the
+ * message payload. The signature includes only "in" arguments for
+ * #DBUS_MESSAGE_TYPE_METHOD_CALL and only "out" arguments for
+@@ -4519,6 +4516,64 @@ dbus_message_type_to_string (int type)
+ }
+
+ /**
++ * Returns pointer to the buffer used to store the message body.
++ *
++ * @param message the message
++ * @return pointer to the message body memory
++ */
++char*
++dbus_message_get_body (DBusMessage *message) {
++ _dbus_return_val_if_fail (message != NULL, NULL);
++
++ return _dbus_string_get_data(&(message->body));
++}
++
++/**
++ * Adjust the length of the message body buffer. The memory will be reallocated
++ * if the new length is bigger than the already allocated size.
++ *
++ * @see dbus_message_get_body_allocated
++ * @param message the message
++ * @param length the new length of the body
++ * @return #TRUE if successful
++ */
++dbus_bool_t
++dbus_message_set_body_length (DBusMessage *message,
++ int length) {
++ _dbus_return_val_if_fail (message != NULL, FALSE);
++ _dbus_return_val_if_fail (length >= 0, FALSE);
++
++ return _dbus_string_set_length(&(message->body), length);
++}
++
++/**
++ * Gets the length of the message body buffer.
++ *
++ * @param message the message
++ * @param length the new length of the body
++ * @return the length of the body buffer
++ */
++int
++dbus_message_get_body_length (DBusMessage *message) {
++ _dbus_return_val_if_fail (message != NULL, 0);
++
++ return _dbus_string_get_length(&(message->body));
++}
++
++/**
++ * Gets the allocated memory size used to hold the message body.
++ *
++ * @param message the message
++ * @return size of the allocated message body memory
++ */
++int
++dbus_message_get_body_allocated (DBusMessage *message) {
++ _dbus_return_val_if_fail (message != NULL, 0);
++
++ return _dbus_string_get_allocated(&(message->body));
++}
++
++/**
+ * Turn a DBusMessage into the marshalled form as described in the D-Bus
+ * specification.
+ *
+diff --git a/dbus/dbus-message.h b/dbus/dbus-message.h
+index 5500492..55388ac 100644
+--- a/dbus/dbus-message.h
++++ b/dbus/dbus-message.h
+@@ -138,6 +138,9 @@ dbus_bool_t dbus_message_set_sender (DBusMessage *message,
+ DBUS_EXPORT
+ const char* dbus_message_get_sender (DBusMessage *message);
+ DBUS_EXPORT
++dbus_bool_t dbus_message_set_signature (DBusMessage *message,
++ const char *signature);
++DBUS_EXPORT
+ const char* dbus_message_get_signature (DBusMessage *message);
+ DBUS_EXPORT
+ void dbus_message_set_no_reply (DBusMessage *message,
+@@ -264,6 +267,16 @@ void dbus_message_iter_abandon_container (DBusMessageIter *iter,
+ DBusMessageIter *sub);
+
+ DBUS_EXPORT
++char* dbus_message_get_body (DBusMessage *message);
++DBUS_EXPORT
++dbus_bool_t dbus_message_set_body_length (DBusMessage *message,
++ int length);
++DBUS_EXPORT
++int dbus_message_get_body_length (DBusMessage *message);
++DBUS_EXPORT
++int dbus_message_get_body_allocated (DBusMessage *message);
++
++DBUS_EXPORT
+ void dbus_message_lock (DBusMessage *message);
+
+ DBUS_EXPORT
+diff --git a/dbus/dbus-string.c b/dbus/dbus-string.c
+index e2eb93b..d8628ba 100644
+--- a/dbus/dbus-string.c
++++ b/dbus/dbus-string.c
+@@ -848,6 +848,22 @@ _dbus_string_get_length (const DBusString *str)
+ }
+ #endif /* !_dbus_string_get_length */
+
++/* Only have the function if we don't have the macro */
++#ifndef _dbus_string_get_allocated
++/**
++ * Gets the allocated length of a string (not including nul termination).
++ *
++ * @returns the allocated length.
++ */
++int
++_dbus_string_get_allocated(const DBusString *str)
++{
++ DBUS_CONST_STRING_PREAMBLE (str);
++
++ return real->allocated;
++}
++#endif /* !_dbus_string_get_allocated */
++
+ /**
+ * Makes a string longer by the given number of bytes. Checks whether
+ * adding additional_length to the current length would overflow an
+diff --git a/dbus/dbus-string.h b/dbus/dbus-string.h
+index 2f1ed31..490aea6 100644
+--- a/dbus/dbus-string.h
++++ b/dbus/dbus-string.h
+@@ -62,6 +62,7 @@ struct DBusString
+ */
+ #define _dbus_string_get_data(s) ((char*)(((DBusString*)(s))->dummy1))
+ #define _dbus_string_get_length(s) (((DBusString*)(s))->dummy2)
++#define _dbus_string_get_allocated(s) (((DBusString*)(s))->dummy3 - _DBUS_STRING_ALLOCATION_PADDING)
+ #define _dbus_string_set_byte(s, i, b) ((((unsigned char*)(((DBusString*)(s))->dummy1))[(i)]) = (unsigned char) (b))
+ #define _dbus_string_get_byte(s, i) (((const unsigned char*)(((DBusString*)(s))->dummy1))[(i)])
+ #define _dbus_string_get_const_data(s) ((const char*)(((DBusString*)(s))->dummy1))
+@@ -131,6 +132,9 @@ void _dbus_string_copy_to_buffer_with_nul (const DBusString *str,
+ #ifndef _dbus_string_get_length
+ int _dbus_string_get_length (const DBusString *str);
+ #endif /* !_dbus_string_get_length */
++#ifndef _dbus_string_get_allocated
++int _dbus_string_get_allocated (const DBusString *str);
++#endif /* !_dbus_string_get_allocated */
+
+ dbus_bool_t _dbus_string_lengthen (DBusString *str,
+ int additional_length);
+--
+1.7.10.2
+
diff --git a/meta-ivi/recipes-core-ivi/dbus/dbus/dbus_1.6-add-afbus-support.patch b/meta-ivi/recipes-core-ivi/dbus/dbus/dbus_1.6-add-afbus-support.patch
new file mode 100644
index 0000000..2e91507
--- /dev/null
+++ b/meta-ivi/recipes-core-ivi/dbus/dbus/dbus_1.6-add-afbus-support.patch
@@ -0,0 +1,3201 @@
+diff --git a/bus/Makefile.am b/bus/Makefile.am
+index 6cbc09a..cf3a962 100644
+--- a/bus/Makefile.am
++++ b/bus/Makefile.am
+@@ -63,6 +63,15 @@ endif
+ endif
+ endif
+
++if HAVE_AFBUS
++AFBUS_SOURCE = \
++ driver-afbus.c \
++ driver-afbus.h \
++ $(NULL)
++else
++AFBUS_SOURCE =
++endif
++
+ BUS_SOURCES= \
+ activation.c \
+ activation.h \
+@@ -83,6 +92,7 @@ BUS_SOURCES= \
+ dispatch.h \
+ driver.c \
+ driver.h \
++ $(AFBUS_SOURCE) \
+ expirelist.c \
+ expirelist.h \
+ policy.c \
+diff --git a/bus/bus.c b/bus/bus.c
+index e80e708..5038958 100644
+--- a/bus/bus.c
++++ b/bus/bus.c
+@@ -52,11 +52,20 @@ struct BusContext
+ char *type;
+ char *servicehelper;
+ char *address;
++
++ /* if we are in AF_BUS compat mode, contains the AF_BUS address */
++ char *main_address;
++
+ char *pidfile;
+ char *user;
+ char *log_prefix;
+ DBusLoop *loop;
+ DBusList *servers;
++
++ /* One of the servers may be a AF_BUS server. We can have at most only one
++ * AF_BUS server. */
++ DBusServer *main_afbus_server;
++
+ BusConnections *connections;
+ BusActivation *activation;
+ BusRegistry *registry;
+@@ -207,6 +216,29 @@ free_server_data (void *data)
+ dbus_free (bd);
+ }
+
++static void
++shutdown_server (BusContext *context,
++ DBusServer *server)
++{
++ if (server == NULL ||
++ !dbus_server_get_is_connected (server))
++ return;
++
++ if (!dbus_server_set_watch_functions (server,
++ NULL, NULL, NULL,
++ context,
++ NULL))
++ _dbus_assert_not_reached ("setting watch functions to NULL failed");
++
++ if (!dbus_server_set_timeout_functions (server,
++ NULL, NULL, NULL,
++ context,
++ NULL))
++ _dbus_assert_not_reached ("setting timeout functions to NULL failed");
++
++ dbus_server_disconnect (server);
++}
++
+ static dbus_bool_t
+ setup_server (BusContext *context,
+ DBusServer *server,
+@@ -275,6 +307,7 @@ process_config_first_time_only (BusContext *context,
+ DBusString log_prefix;
+ DBusList *link;
+ DBusList **addresses;
++ DBusList **addresses_if_possible;
+ const char *user, *pidfile;
+ char **auth_mechanisms;
+ DBusList **auth_mechanisms_list;
+@@ -448,6 +481,7 @@ process_config_first_time_only (BusContext *context,
+ while (link != NULL)
+ {
+ DBusServer *server;
++ dbus_bool_t is_afbus;
+
+ server = dbus_server_listen (link->data, error);
+ if (server == NULL)
+@@ -455,17 +489,78 @@ process_config_first_time_only (BusContext *context,
+ _DBUS_ASSERT_ERROR_IS_SET (error);
+ goto failed;
+ }
+- else if (!setup_server (context, server, auth_mechanisms, error))
++ is_afbus = dbus_server_is_afbus (server);
++
++ /* Only accept one AF_BUS server */
++ if (is_afbus && context->main_afbus_server != NULL)
+ {
++ dbus_server_disconnect (server);
++ dbus_server_unref (server);
++ dbus_set_error (error,
++ DBUS_ERROR_MULTIPLE_AFBUS,
++ "Cannot listen on multiple AF_BUS address");
++ goto failed;
++ }
++
++ if (!setup_server (context, server, auth_mechanisms, error))
++ {
++ shutdown_server (context, server);
++ dbus_server_unref (server);
+ _DBUS_ASSERT_ERROR_IS_SET (error);
+ goto failed;
+ }
++ if (is_afbus)
++ context->main_afbus_server = server;
+
+ if (!_dbus_list_append (&context->servers, server))
+ goto oom;
+
+ link = _dbus_list_get_next_link (addresses, link);
+ }
++
++ addresses_if_possible =
++ bus_config_parser_get_addresses_if_possible (parser);
++
++ link = _dbus_list_get_first_link (addresses_if_possible);
++ while (link != NULL)
++ {
++ DBusServer *server;
++ dbus_bool_t is_afbus;
++
++ server = dbus_server_listen (link->data, NULL);
++ if (server == NULL)
++ {
++ link = _dbus_list_get_next_link (addresses_if_possible, link);
++ continue;
++ }
++ is_afbus = dbus_server_is_afbus (server);
++
++ /* Only accept one AF_BUS server */
++ if (is_afbus && context->main_afbus_server != NULL)
++ {
++ dbus_server_disconnect (server);
++ dbus_server_unref (server);
++
++ link = _dbus_list_get_next_link (addresses_if_possible, link);
++ continue;
++ }
++
++ if (!setup_server (context, server, auth_mechanisms, NULL))
++ {
++ shutdown_server (context, server);
++ dbus_server_unref (server);
++
++ link = _dbus_list_get_next_link (addresses_if_possible, link);
++ continue;
++ }
++ if (is_afbus)
++ context->main_afbus_server = server;
++
++ if (!_dbus_list_append (&context->servers, server))
++ goto oom;
++
++ link = _dbus_list_get_next_link (addresses_if_possible, link);
++ }
+ }
+
+ context->fork = bus_config_parser_get_fork (parser);
+@@ -499,6 +594,7 @@ process_config_every_time (BusContext *context,
+ DBusError *error)
+ {
+ DBusString full_address;
++ DBusString main_address;
+ DBusList *link;
+ DBusList **dirs;
+ char *addr;
+@@ -518,6 +614,12 @@ process_config_every_time (BusContext *context,
+ return FALSE;
+ }
+
++ if (!_dbus_string_init (&main_address))
++ {
++ BUS_SET_OOM (error);
++ return FALSE;
++ }
++
+ /* get our limits and timeout lengths */
+ bus_config_parser_get_limits (parser, &context->limits);
+
+@@ -554,6 +656,18 @@ process_config_every_time (BusContext *context,
+ goto failed;
+ }
+
++ if (dbus_server_is_afbus (link->data))
++ {
++ /* There must be at most one AF_BUS server */
++ _dbus_assert (_dbus_string_get_length (&main_address) == 0);
++
++ if (!_dbus_string_append (&main_address, addr))
++ {
++ BUS_SET_OOM (error);
++ goto failed;
++ }
++ }
++
+ dbus_free (addr);
+ addr = NULL;
+
+@@ -561,7 +675,10 @@ process_config_every_time (BusContext *context,
+ }
+
+ if (is_reload)
+- dbus_free (context->address);
++ {
++ dbus_free (context->address);
++ dbus_free (context->main_address);
++ }
+
+ if (!_dbus_string_copy_data (&full_address, &context->address))
+ {
+@@ -569,6 +686,12 @@ process_config_every_time (BusContext *context,
+ goto failed;
+ }
+
++ if (!_dbus_string_copy_data (&main_address, &context->main_address))
++ {
++ BUS_SET_OOM (error);
++ goto failed;
++ }
++
+ /* get the service directories */
+ dirs = bus_config_parser_get_service_dirs (parser);
+
+@@ -609,6 +732,7 @@ process_config_every_time (BusContext *context,
+
+ failed:
+ _dbus_string_free (&full_address);
++ _dbus_string_free (&main_address);
+
+ if (addr)
+ dbus_free (addr);
+@@ -990,29 +1114,6 @@ bus_context_reload_config (BusContext *context,
+ return ret;
+ }
+
+-static void
+-shutdown_server (BusContext *context,
+- DBusServer *server)
+-{
+- if (server == NULL ||
+- !dbus_server_get_is_connected (server))
+- return;
+-
+- if (!dbus_server_set_watch_functions (server,
+- NULL, NULL, NULL,
+- context,
+- NULL))
+- _dbus_assert_not_reached ("setting watch functions to NULL failed");
+-
+- if (!dbus_server_set_timeout_functions (server,
+- NULL, NULL, NULL,
+- context,
+- NULL))
+- _dbus_assert_not_reached ("setting timeout functions to NULL failed");
+-
+- dbus_server_disconnect (server);
+-}
+-
+ void
+ bus_context_shutdown (BusContext *context)
+ {
+@@ -1099,6 +1200,7 @@ bus_context_unref (BusContext *context)
+ dbus_free (context->log_prefix);
+ dbus_free (context->type);
+ dbus_free (context->address);
++ dbus_free (context->main_address);
+ dbus_free (context->user);
+ dbus_free (context->servicehelper);
+
+@@ -1134,6 +1236,12 @@ bus_context_get_address (BusContext *context)
+ }
+
+ const char*
++bus_context_get_main_address (BusContext *context)
++{
++ return context->main_address;
++}
++
++const char*
+ bus_context_get_servicehelper (BusContext *context)
+ {
+ return context->servicehelper;
+diff --git a/bus/bus.h b/bus/bus.h
+index 3597884..f2a55f2 100644
+--- a/bus/bus.h
++++ b/bus/bus.h
+@@ -88,6 +88,7 @@ dbus_bool_t bus_context_get_id (BusContext
+ DBusString *uuid);
+ const char* bus_context_get_type (BusContext *context);
+ const char* bus_context_get_address (BusContext *context);
++const char* bus_context_get_main_address (BusContext *context);
+ const char* bus_context_get_servicehelper (BusContext *context);
+ dbus_bool_t bus_context_get_systemd_activation (BusContext *context);
+ BusRegistry* bus_context_get_registry (BusContext *context);
+diff --git a/bus/config-parser-common.c b/bus/config-parser-common.c
+index c522ff4..8747835 100644
+--- a/bus/config-parser-common.c
++++ b/bus/config-parser-common.c
+@@ -63,6 +63,10 @@ bus_config_parser_element_name_to_type (const char *name)
+ {
+ return ELEMENT_LISTEN;
+ }
++ else if (strcmp (name, "listen_if_possible") == 0)
++ {
++ return ELEMENT_LISTEN_IF_POSSIBLE;
++ }
+ else if (strcmp (name, "auth") == 0)
+ {
+ return ELEMENT_AUTH;
+@@ -145,6 +149,8 @@ bus_config_parser_element_type_to_name (ElementType type)
+ return "user";
+ case ELEMENT_LISTEN:
+ return "listen";
++ case ELEMENT_LISTEN_IF_POSSIBLE:
++ return "listen_if_possible";
+ case ELEMENT_AUTH:
+ return "auth";
+ case ELEMENT_POLICY:
+diff --git a/bus/config-parser-common.h b/bus/config-parser-common.h
+index 186bf4c..6ea509c 100644
+--- a/bus/config-parser-common.h
++++ b/bus/config-parser-common.h
+@@ -31,6 +31,7 @@ typedef enum
+ ELEMENT_INCLUDE,
+ ELEMENT_USER,
+ ELEMENT_LISTEN,
++ ELEMENT_LISTEN_IF_POSSIBLE,
+ ELEMENT_AUTH,
+ ELEMENT_POLICY,
+ ELEMENT_LIMIT,
+diff --git a/bus/config-parser.c b/bus/config-parser.c
+index 07e8fbb..fffc0e1 100644
+--- a/bus/config-parser.c
++++ b/bus/config-parser.c
+@@ -96,6 +96,8 @@ struct BusConfigParser
+
+ DBusList *listen_on; /**< List of addresses to listen to */
+
++ DBusList *listen_on_if_possible; /**< List of addresses to listen to, but continue on failure */
++
+ DBusList *mechanisms; /**< Auth mechanisms */
+
+ DBusList *service_dirs; /**< Directories to look for session services in */
+@@ -327,6 +329,9 @@ merge_included (BusConfigParser *parser,
+ while ((link = _dbus_list_pop_first_link (&included->listen_on)))
+ _dbus_list_append_link (&parser->listen_on, link);
+
++ while ((link = _dbus_list_pop_first_link (&included->listen_on_if_possible)))
++ _dbus_list_append_link (&parser->listen_on_if_possible, link);
++
+ while ((link = _dbus_list_pop_first_link (&included->mechanisms)))
+ _dbus_list_append_link (&parser->mechanisms, link);
+
+@@ -497,6 +502,12 @@ bus_config_parser_unref (BusConfigParser *parser)
+
+ _dbus_list_clear (&parser->listen_on);
+
++ _dbus_list_foreach (&parser->listen_on_if_possible,
++ (DBusForeachFunction) dbus_free,
++ NULL);
++
++ _dbus_list_clear (&parser->listen_on_if_possible);
++
+ _dbus_list_foreach (&parser->service_dirs,
+ (DBusForeachFunction) dbus_free,
+ NULL);
+@@ -774,6 +785,19 @@ start_busconfig_child (BusConfigParser *parser,
+
+ return TRUE;
+ }
++ else if (element_type == ELEMENT_LISTEN_IF_POSSIBLE)
++ {
++ if (!check_no_attributes (parser, "listen_if_possible", attribute_names, attribute_values, error))
++ return FALSE;
++
++ if (push_element (parser, ELEMENT_LISTEN_IF_POSSIBLE) == NULL)
++ {
++ BUS_SET_OOM (error);
++ return FALSE;
++ }
++
++ return TRUE;
++ }
+ else if (element_type == ELEMENT_AUTH)
+ {
+ if (!check_no_attributes (parser, "auth", attribute_names, attribute_values, error))
+@@ -2018,6 +2042,7 @@ bus_config_parser_end_element (BusConfigParser *parser,
+ case ELEMENT_USER:
+ case ELEMENT_CONFIGTYPE:
+ case ELEMENT_LISTEN:
++ case ELEMENT_LISTEN_IF_POSSIBLE:
+ case ELEMENT_PIDFILE:
+ case ELEMENT_AUTH:
+ case ELEMENT_SERVICEDIR:
+@@ -2518,6 +2543,24 @@ bus_config_parser_content (BusConfigParser *parser,
+ }
+ break;
+
++ case ELEMENT_LISTEN_IF_POSSIBLE:
++ {
++ char *s;
++
++ e->had_content = TRUE;
++
++ if (!_dbus_string_copy_data (content, &s))
++ goto nomem;
++
++ if (!_dbus_list_append (&parser->listen_on_if_possible,
++ s))
++ {
++ dbus_free (s);
++ goto nomem;
++ }
++ }
++ break;
++
+ case ELEMENT_AUTH:
+ {
+ char *s;
+@@ -2646,6 +2689,12 @@ bus_config_parser_get_addresses (BusConfigParser *parser)
+ }
+
+ DBusList**
++bus_config_parser_get_addresses_if_possible (BusConfigParser *parser)
++{
++ return &parser->listen_on_if_possible;
++}
++
++DBusList**
+ bus_config_parser_get_mechanisms (BusConfigParser *parser)
+ {
+ return &parser->mechanisms;
+@@ -3123,6 +3172,9 @@ config_parsers_equal (const BusConfigParser *a,
+ if (!lists_of_c_strings_equal (a->listen_on, b->listen_on))
+ return FALSE;
+
++ if (!lists_of_c_strings_equal (a->listen_on_if_possible, b->listen_on_if_possible))
++ return FALSE;
++
+ if (!lists_of_c_strings_equal (a->mechanisms, b->mechanisms))
+ return FALSE;
+
+diff --git a/bus/config-parser.h b/bus/config-parser.h
+index ba5bf74..f8a3c07 100644
+--- a/bus/config-parser.h
++++ b/bus/config-parser.h
+@@ -61,6 +61,7 @@ dbus_bool_t bus_config_parser_finished (BusConfigParser *parser,
+ const char* bus_config_parser_get_user (BusConfigParser *parser);
+ const char* bus_config_parser_get_type (BusConfigParser *parser);
+ DBusList** bus_config_parser_get_addresses (BusConfigParser *parser);
++DBusList** bus_config_parser_get_addresses_if_possible (BusConfigParser *parser);
+ DBusList** bus_config_parser_get_mechanisms (BusConfigParser *parser);
+ dbus_bool_t bus_config_parser_get_fork (BusConfigParser *parser);
+ dbus_bool_t bus_config_parser_get_allow_anonymous (BusConfigParser *parser);
+diff --git a/bus/connection.c b/bus/connection.c
+index d69758c..2d68c84 100644
+--- a/bus/connection.c
++++ b/bus/connection.c
+@@ -30,9 +30,16 @@
+ #include "signals.h"
+ #include "expirelist.h"
+ #include "selinux.h"
++#include "driver-afbus.h"
+ #include <dbus/dbus-list.h>
+ #include <dbus/dbus-hash.h>
+ #include <dbus/dbus-timeout.h>
++#ifdef HAVE_AFBUS
++#include <dbus/dbus-transport-afbus.h>
++#endif
++
++#include <sys/types.h> /* See NOTES */
++#include <sys/socket.h>
+
+ /* Trim executed commands to this length; we want to keep logs readable */
+ #define MAX_LOG_COMMAND_LEN 50
+@@ -94,6 +101,13 @@ typedef struct
+ char *cached_loginfo_string;
+ BusSELinuxID *selinux_id;
+
++ dbus_bool_t peer_address_set;
++ struct sockaddr_storage peer_address;
++ socklen_t peer_addrlen;
++ DBusConnection *proxy_connection; /**< If this is a compat connection,
++ proxy_connection is the proxy
++ connection to AF_BUS */
++
+ long connection_tv_sec; /**< Time when we connected (seconds component) */
+ long connection_tv_usec; /**< Time when we connected (microsec component) */
+ int stamp; /**< connections->stamp last time we were traversed */
+@@ -184,12 +198,33 @@ adjust_connections_for_uid (BusConnections *connections,
+ }
+ }
+
++static DBusHandlerResult
++proxy_connection_message_filter (DBusConnection *connection,
++ DBusMessage *message,
++ void *user_data)
++{
++ DBusConnection *source_connection = user_data;
++
++ if (dbus_message_get_destination (message) == NULL &&
++ dbus_message_is_signal (message,
++ DBUS_INTERFACE_LOCAL,
++ "Disconnected"))
++ {
++ dbus_connection_close (source_connection);
++ return DBUS_HANDLER_RESULT_HANDLED;
++ }
++
++ dbus_connection_send (source_connection, message, NULL);
++ return DBUS_HANDLER_RESULT_HANDLED;
++}
++
+ void
+ bus_connection_disconnected (DBusConnection *connection)
+ {
+ BusConnectionData *d;
+ BusService *service;
+ BusMatchmaker *matchmaker;
++ DBusError error;
+
+ d = BUS_CONNECTION_DATA (connection);
+ _dbus_assert (d != NULL);
+@@ -197,6 +232,20 @@ bus_connection_disconnected (DBusConnection *connection)
+ _dbus_verbose ("%s disconnected, dropping all service ownership and releasing\n",
+ d->name ? d->name : "(inactive)");
+
++ if (d->proxy_connection)
++ {
++ dbus_connection_remove_filter (d->proxy_connection,
++ proxy_connection_message_filter, connection);
++ dbus_connection_close (d->proxy_connection);
++ dbus_connection_unref (d->proxy_connection);
++ d->proxy_connection = NULL;
++ }
++
++ dbus_error_init (&error);
++
++ if (!bus_driver_afbus_disconnected(connection, &error))
++ dbus_error_free (&error);
++
+ /* Delete our match rules */
+ if (d->n_match_rules > 0)
+ {
+@@ -309,6 +358,18 @@ bus_connection_disconnected (DBusConnection *connection)
+ dbus_connection_unref (connection);
+ }
+
++DBusConnection *
++bus_connection_get_proxy_connection (DBusConnection *connection)
++{
++ BusConnectionData *d;
++
++ d = BUS_CONNECTION_DATA (connection);
++
++ _dbus_assert (d != NULL);
++
++ return d->proxy_connection;
++}
++
+ static dbus_bool_t
+ add_connection_watch (DBusWatch *watch,
+ void *data)
+@@ -588,6 +649,52 @@ oom:
+ return FALSE;
+ }
+
++#ifdef HAVE_AFBUS
++static dbus_bool_t
++bus_connections_setup_proxy_connection (BusConnections *connections,
++ DBusConnection *connection,
++ const char *main_address)
++{
++ BusConnectionData *d = BUS_CONNECTION_DATA (connection);
++ DBusError error;
++ dbus_bool_t retval = FALSE;
++
++ dbus_error_init (&error);
++
++ d->proxy_connection
++ = dbus_connection_open_private (main_address, &error);
++ if (dbus_error_is_set (&error))
++ {
++ dbus_error_free (&error);
++ goto out;
++ }
++
++ dbus_connection_set_route_peer_messages (d->proxy_connection, TRUE);
++
++ dbus_connection_set_dispatch_status_function (d->proxy_connection,
++ dispatch_status_function,
++ bus_context_get_loop (connections->context), NULL);
++
++ if (!dbus_connection_add_filter(d->proxy_connection,
++ proxy_connection_message_filter, connection, NULL))
++ goto out;
++
++
++ if (!dbus_connection_set_watch_functions (d->proxy_connection,
++ add_connection_watch,
++ remove_connection_watch,
++ toggle_connection_watch,
++ connection,
++ NULL))
++ goto out;
++
++ return TRUE;
++
++out:
++ return retval;
++}
++#endif
++
+ dbus_bool_t
+ bus_connections_setup_connection (BusConnections *connections,
+ DBusConnection *connection)
+@@ -596,7 +703,6 @@ bus_connections_setup_connection (BusConnections *connections,
+ BusConnectionData *d;
+ dbus_bool_t retval;
+ DBusError error;
+-
+
+ d = dbus_new0 (BusConnectionData, 1);
+
+@@ -622,8 +728,32 @@ bus_connections_setup_connection (BusConnections *connections,
+ dbus_connection_set_route_peer_messages (connection, TRUE);
+
+ retval = FALSE;
+-
+ dbus_error_init (&error);
++
++#ifdef HAVE_AFBUS
++ d->peer_addrlen = sizeof(d->peer_address);
++ d->peer_address_set = dbus_connection_get_peer_address (connection,
++ &d->peer_address, (long int *)&d->peer_addrlen);
++
++ /* If this connection is not AF_BUS, and we have a AF_BUS
++ * server, we are in compat mode and we need to setup a
++ * new connection */
++ if (d->peer_address_set &&
++ ((struct sockaddr *)&d->peer_address)->sa_family != AF_BUS)
++ {
++ const char *main_address;
++ main_address = bus_context_get_main_address (connections->context);
++ if (main_address && main_address[0] != '\0')
++ {
++ if (!bus_connections_setup_proxy_connection (connections, connection,
++ main_address))
++ {
++ goto out;
++ }
++ }
++ }
++#endif
++
+ d->selinux_id = bus_selinux_init_connection_id (connection,
+ &error);
+ if (dbus_error_is_set (&error))
+@@ -2383,3 +2513,21 @@ bus_connection_get_peak_bus_names (DBusConnection *connection)
+ return d->peak_bus_names;
+ }
+ #endif /* DBUS_ENABLE_STATS */
++
++int
++bus_connection_get_peer_address (DBusConnection *connection,
++ struct sockaddr **peer_address,
++ socklen_t *peer_addrlen)
++{
++ BusConnectionData *d;
++
++ d = BUS_CONNECTION_DATA (connection);
++
++ if (!d->peer_address_set)
++ return FALSE;
++
++ *peer_address = (struct sockaddr *) &d->peer_address;
++ *peer_addrlen = d->peer_addrlen;
++
++ return TRUE;
++}
+diff --git a/bus/connection.h b/bus/connection.h
+index c936021..95856f3 100644
+--- a/bus/connection.h
++++ b/bus/connection.h
+@@ -24,6 +24,8 @@
+ #ifndef BUS_CONNECTION_H
+ #define BUS_CONNECTION_H
+
++#include <sys/types.h>
++#include <sys/socket.h>
+ #include <dbus/dbus.h>
+ #include <dbus/dbus-list.h>
+ #include "bus.h"
+@@ -103,8 +105,9 @@ dbus_bool_t bus_connection_complete (DBusConnection *connection,
+ const DBusString *name,
+ DBusError *error);
+
+-/* called by dispatch.c when the connection is dropped */
+-void bus_connection_disconnected (DBusConnection *connection);
++/* called by dispatch.c */
++void bus_connection_disconnected (DBusConnection *connection);
++DBusConnection *bus_connection_get_proxy_connection (DBusConnection *connection);
+
+ dbus_bool_t bus_connection_is_in_unix_group (DBusConnection *connection,
+ unsigned long gid);
+@@ -151,4 +154,9 @@ int bus_connections_get_peak_bus_names_per_conn (BusConnections *connections);
+ int bus_connection_get_peak_match_rules (DBusConnection *connection);
+ int bus_connection_get_peak_bus_names (DBusConnection *connection);
+
++/* called by driver-afbus.c */
++int bus_connection_get_peer_address (DBusConnection *connection,
++ struct sockaddr **peer_address,
++ socklen_t *peer_addrlen);
++
+ #endif /* BUS_CONNECTION_H */
+diff --git a/bus/dispatch.c b/bus/dispatch.c
+index 7a96f9d..4feae05 100644
+--- a/bus/dispatch.c
++++ b/bus/dispatch.c
+@@ -27,6 +27,7 @@
+ #include "dispatch.h"
+ #include "connection.h"
+ #include "driver.h"
++#include "driver-afbus.h"
+ #include "services.h"
+ #include "activation.h"
+ #include "utils.h"
+@@ -129,6 +130,18 @@ bus_dispatch_matches (BusTransaction *transaction,
+ BUS_SET_OOM (error);
+ return FALSE;
+ }
++
++ /* If using AF_BUS and the message came to the daemon, the client sending
++ * the message doesn't yet know the address for this service, so notify
++ * it of the address associated with the service. */
++ if (!bus_driver_afbus_emit_forwarded (transaction,
++ sender,
++ addressed_recipient,
++ dbus_message_get_destination (message)))
++ {
++ _dbus_verbose ("bus_driver_afbus_emit_forwarded() failed\n");
++ return FALSE;
++ }
+ }
+
+ /* Now dispatch to others who look interested in this message */
+@@ -180,6 +193,7 @@ bus_dispatch (DBusConnection *connection,
+ BusContext *context;
+ DBusHandlerResult result;
+ DBusConnection *addressed_recipient;
++ DBusConnection *proxy_connection;
+
+ result = DBUS_HANDLER_RESULT_HANDLED;
+
+@@ -241,6 +255,15 @@ bus_dispatch (DBusConnection *connection,
+ }
+ }
+
++ /* Directly send the message to the proxy without analysing it */
++ proxy_connection = bus_connection_get_proxy_connection (connection);
++ if (proxy_connection)
++ {
++ if (!dbus_connection_send (proxy_connection, message, NULL))
++ BUS_SET_OOM (&error);
++ goto out;
++ }
++
+ /* Create our transaction */
+ transaction = bus_transaction_new (context);
+ if (transaction == NULL)
+diff --git a/bus/driver-afbus.c b/bus/driver-afbus.c
+new file mode 100644
+index 0000000..70edafb
+--- /dev/null
++++ b/bus/driver-afbus.c
+@@ -0,0 +1,345 @@
++/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
++/* driver.c Bus client, AF_BUS bits (driver)
++ *
++ * Copyright (C) 2012 Collabora 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 <config.h>
++
++#include "driver-afbus.h"
++
++#include <unistd.h>
++#include <sys/types.h>
++#include <sys/socket.h>
++#include <asm/types.h>
++#include <errno.h>
++#include <linux/netlink.h>
++#include <linux/rtnetlink.h>
++#include <linux/connector.h>
++#include <dbus/dbus-transport-afbus.h>
++
++#define CN_IDX_NFDBUS 0xA /* netfilter D-Bus */
++#define CN_VAL_NFDBUS 0x1
++
++#define NFDBUS_CMD_ADDMATCH 0x01
++#define NFDBUS_CMD_REMOVEMATCH 0x02
++#define NFDBUS_CMD_REMOVEALLMATCH 0x03
++
++struct nfdbus_nl_cfg_req {
++ __u32 cmd;
++ __u32 len;
++ struct sockaddr_bus addr;
++ __u64 pad;
++ unsigned char data[0];
++};
++
++struct nfdbus_nl_cfg_reply {
++ __u32 ret_code;
++};
++
++static int
++ensure_nl_sock(DBusError *error)
++{
++ static int nlsock = 0;
++
++ struct sockaddr_nl l_local;
++ int fd;
++ int ret;
++
++ if (nlsock > 0)
++ return nlsock;
++
++ fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR);
++ if (fd == -1) {
++ dbus_set_error (error, DBUS_ERROR_NETLINK,
++ "Couldn't use the netlink socket: %s",
++ strerror(errno));
++ return -1;
++ }
++
++ if (!_dbus_set_fd_nonblocking (fd, error))
++ {
++ _dbus_close_socket (fd, NULL);
++ return -1;
++ }
++
++ l_local.nl_family = AF_NETLINK;
++ l_local.nl_groups = 0;
++ l_local.nl_pid = 0;
++ ret = bind(fd, (struct sockaddr *)&l_local, sizeof(struct sockaddr_nl));
++ if (ret == -1) {
++ close(fd);
++ dbus_set_error (error, DBUS_ERROR_NETLINK,
++ "Couldn't bind the netlink socket: %s",
++ strerror(errno));
++ return -1;
++ }
++
++ nlsock = fd;
++ return nlsock;
++}
++
++static int netlink_send(int nlsock, struct cn_msg *msg, int seq)
++{
++ struct nlmsghdr *nlh;
++ unsigned int size;
++ char buf[4096];
++ struct cn_msg *m;
++
++ size = NLMSG_SPACE(sizeof(struct cn_msg) + msg->len);
++
++ nlh = (struct nlmsghdr *)buf;
++ nlh->nlmsg_seq = seq;
++ nlh->nlmsg_pid = getpid();
++ nlh->nlmsg_type = NLMSG_DONE;
++ nlh->nlmsg_len = NLMSG_LENGTH(size - sizeof(*nlh));
++ nlh->nlmsg_flags = 0;
++
++ m = NLMSG_DATA(nlh);
++ memcpy(m, msg, sizeof(*m) + msg->len);
++
++ return send(nlsock, nlh, size, 0);
++}
++
++static dbus_bool_t
++bus_driver_afbus_upload_match_rule (DBusConnection *connection,
++ const char *rule,
++ int cmd,
++ DBusError *error)
++{
++ static int seq;
++
++ int nlsock;
++ int ret;
++
++ char buf[sizeof(struct cn_msg) + sizeof(struct nfdbus_nl_cfg_req) + 1024];
++
++ struct cn_msg *data;
++ struct nlmsghdr *reply;
++ struct nfdbus_nl_cfg_req *req;
++ //struct nfdbus_nl_cfg_reply *req_reply;
++
++ struct sockaddr_storage *address;
++ socklen_t addrlen = sizeof(address);
++
++ if (!bus_connection_get_peer_address(connection,
++ (struct sockaddr **) &address, &addrlen))
++ return TRUE;
++
++ if (((struct sockaddr*)address)->sa_family != AF_BUS)
++ return TRUE;
++
++ nlsock = ensure_nl_sock (error);
++ if (nlsock == -1)
++ return FALSE;
++
++ memset(buf, 0, sizeof(buf));
++
++ data = (struct cn_msg *)buf;
++
++ data->id.idx = CN_IDX_NFDBUS;
++ data->id.val = CN_VAL_NFDBUS;
++ data->seq = seq++;
++ data->ack = 0;
++ data->len = sizeof(struct nfdbus_nl_cfg_req) + strlen(rule) + 1;
++ req = (struct nfdbus_nl_cfg_req *) data->data;
++
++ req->cmd = cmd;
++ req->len = strlen(rule) + 1;
++ req->addr = *(struct sockaddr_bus *)address;
++ strcpy((char *)req->data, rule);
++
++ ret = netlink_send(nlsock, data, seq++);
++ if (ret <= 0)
++ {
++ }
++
++ memset(buf, 0, sizeof(buf));
++ ret = recv(nlsock, buf, sizeof(buf), 0);
++ if (ret <= 0)
++ {
++ }
++
++ reply = (struct nlmsghdr *)buf;
++ if (reply->nlmsg_type != NLMSG_DONE)
++ {
++ }
++
++ return TRUE;
++}
++
++dbus_bool_t
++bus_driver_afbus_add_match_rule (DBusConnection *connection,
++ const char *rule,
++ DBusError *error)
++{
++ if (bus_driver_afbus_upload_match_rule (connection, rule, NFDBUS_CMD_ADDMATCH, error))
++ {
++ /* Check if the match rule is for eavesdropping, and set the socket
++ * to allow receiving all messages if so */
++ if (strstr (rule, "eavesdrop=true"))
++ {
++ int fd;
++
++ if (dbus_connection_get_socket (connection, &fd))
++ {
++ if (setsockopt (fd, SOL_BUS, BUS_SET_EAVESDROP, NULL, 0) == 0)
++ return TRUE;
++ else
++ {
++ dbus_set_error (error,
++ _dbus_error_from_errno (errno),
++ "Failed to setsockopt on socket %d: %s",
++ fd, _dbus_strerror (errno));
++ }
++ }
++ else
++ dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
++ }
++ else
++ return TRUE;
++ }
++
++ return FALSE;
++}
++
++dbus_bool_t
++bus_driver_afbus_remove_match_rule (DBusConnection *connection,
++ const char *rule,
++ DBusError *error)
++{
++ return bus_driver_afbus_upload_match_rule (connection, rule, NFDBUS_CMD_REMOVEMATCH, error);
++}
++
++dbus_bool_t
++bus_driver_afbus_append_unique_name (DBusConnection *connection,
++ DBusString *str)
++{
++ struct sockaddr_bus address;
++ long len = sizeof(address);
++
++ memset (&address, 0, sizeof (address));
++ if (!dbus_connection_get_peer_address(connection, &address, &len) ||
++ address.sbus_family != AF_BUS)
++ return FALSE;
++
++ if (!_dbus_string_append (str, "AF-BUS."))
++ return FALSE;
++
++ if (!_dbus_string_append_uint (str, address.sbus_addr.s_addr))
++ return FALSE;
++
++ return TRUE;
++}
++
++dbus_bool_t
++bus_driver_afbus_emit_forwarded (BusTransaction *transaction,
++ DBusConnection *connection,
++ DBusConnection *addressed_recipient,
++ const char *service_name)
++{
++ struct sockaddr_bus address;
++ long len = sizeof (address);
++ DBusMessage *message;
++ dbus_bool_t result = FALSE;
++
++ memset (&address, 0, sizeof (address));
++ if (!dbus_connection_get_peer_address (addressed_recipient, &address, &len) ||
++ address.sbus_family != AF_BUS)
++ {
++ /* Don't return an error if it is not a AF_BUS socket */
++ return TRUE;
++ }
++
++ /* Prepare the message to be sent */
++ message = dbus_message_new_signal (DBUS_PATH_AFBUS,
++ DBUS_INTERFACE_AFBUS,
++ "Forwarded");
++ if (message == NULL)
++ {
++ _dbus_verbose ("Could not allocate AF_BUS.Forwarded signal message\n");
++ return FALSE;
++ }
++
++ if (!dbus_message_set_sender (message, DBUS_SERVICE_DBUS))
++ {
++ _dbus_verbose ("Could not set sender for AF_BUS.Forwarded signal message\n");
++ goto out;
++ }
++
++ if (!dbus_message_append_args (message,
++ DBUS_TYPE_STRING, &service_name,
++ DBUS_TYPE_UINT64, &address.sbus_addr.s_addr,
++ DBUS_TYPE_INVALID))
++ {
++ _dbus_verbose ("Could not append arguments for AF_BUS.Forwarded signal message\n");
++ goto out;
++ }
++
++ if (bus_transaction_send (transaction, connection, message))
++ result = TRUE;
++ else
++ _dbus_verbose ("Could not send AF_BUS.Forwarded signal message\n");
++
++ out:
++ dbus_message_unref (message);
++
++ return result;
++}
++
++dbus_bool_t
++bus_driver_afbus_assign_address (DBusConnection *connection)
++{
++ struct sockaddr_bus address;
++ long len = sizeof (address);
++ int fd;
++ static dbus_uint64_t next_address = 0x1111000000000001ULL;
++
++ memset (&address, 0, sizeof (address));
++ if (!dbus_connection_get_peer_address (connection, &address, &len) ||
++ ((struct sockaddr *) &address)->sa_family != AF_BUS)
++ {
++ /* Don't return an error if it is not a AF_BUS socket */
++ return TRUE;
++ }
++
++ if (!dbus_connection_get_unix_fd (connection, &fd))
++ {
++ return FALSE;
++ }
++
++ address.sbus_addr.s_addr = next_address;
++ if (setsockopt (fd, SOL_BUS, BUS_ADD_ADDR, &address, sizeof (address)) != 0)
++ {
++ return FALSE;
++ }
++
++ next_address++;
++
++ return TRUE;
++}
++
++dbus_bool_t
++bus_driver_afbus_disconnected (DBusConnection *connection,
++ DBusError *error)
++{
++ return bus_driver_afbus_upload_match_rule (connection, "",
++ NFDBUS_CMD_REMOVEALLMATCH, error);
++}
+diff --git a/bus/driver-afbus.h b/bus/driver-afbus.h
+new file mode 100644
+index 0000000..9c40111
+--- /dev/null
++++ b/bus/driver-afbus.h
+@@ -0,0 +1,96 @@
++/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
++/* driver-afbus.h Bus client, AF_BUS bits (driver)
++ *
++ * Copyright (C) 2012 Collabora 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_DRIVER_AFBUS_H
++#define BUS_DRIVER_AFBUS_H
++
++#include <config.h>
++#include <sys/socket.h>
++#include <dbus/dbus.h>
++#include "connection.h"
++
++#if HAVE_AFBUS
++dbus_bool_t bus_driver_afbus_add_match_rule (DBusConnection *connection,
++ const char *rule,
++ DBusError *error);
++dbus_bool_t bus_driver_afbus_remove_match_rule (DBusConnection *connection,
++ const char *rule,
++ DBusError *error);
++dbus_bool_t bus_driver_afbus_append_unique_name (DBusConnection *connection,
++ DBusString *str);
++dbus_bool_t bus_driver_afbus_emit_forwarded (BusTransaction *transaction,
++ DBusConnection *connection,
++ DBusConnection *addressed_recipient,
++ const char *service_name);
++dbus_bool_t bus_driver_afbus_assign_address (DBusConnection *connection);
++dbus_bool_t bus_driver_afbus_disconnected (DBusConnection *connection,
++ DBusError *error);
++#else
++static inline
++dbus_bool_t bus_driver_afbus_add_match_rule (DBusConnection *connection,
++ const char *rule,
++ DBusError *error)
++{
++ return TRUE;
++}
++
++static inline
++dbus_bool_t bus_driver_afbus_remove_match_rule (DBusConnection *connection,
++ const char *rule,
++ DBusError *error)
++{
++ return TRUE;
++}
++
++static inline
++dbus_bool_t bus_driver_afbus_append_unique_name (DBusConnection *connection,
++ DBusString *str)
++{
++ return TRUE;
++}
++
++static inline
++dbus_bool_t bus_driver_afbus_emit_forwarded (BusTransaction *transaction,
++ DBusConnection *connection,
++ DBusConnection *addressed_recipient,
++ const char *service_name)
++{
++ return TRUE;
++}
++
++static inline
++dbus_bool_t bus_driver_afbus_assign_address (DBusConnection *connection)
++{
++ return TRUE;
++}
++
++static inline
++dbus_bool_t bus_driver_afbus_disconnected (DBusConnection *connection,
++ DBusError *error)
++{
++ return TRUE;
++}
++
++#endif
++
++#endif /* BUS_DRIVER_AFBUS_H */
+diff --git a/bus/driver.c b/bus/driver.c
+index 574e0f3..11767c8 100644
+--- a/bus/driver.c
++++ b/bus/driver.c
+@@ -26,6 +26,7 @@
+ #include "activation.h"
+ #include "connection.h"
+ #include "driver.h"
++#include "driver-afbus.h"
+ #include "dispatch.h"
+ #include "services.h"
+ #include "selinux.h"
+@@ -182,8 +183,9 @@ bus_driver_send_service_acquired (DBusConnection *connection,
+ }
+
+ static dbus_bool_t
+-create_unique_client_name (BusRegistry *registry,
+- DBusString *str)
++create_unique_client_name (DBusConnection *connection,
++ BusRegistry *registry,
++ DBusString *str)
+ {
+ /* We never want to use the same unique client name twice, because
+ * we want to guarantee that if you send a message to a given unique
+@@ -214,19 +216,23 @@ create_unique_client_name (BusRegistry *registry,
+ _dbus_assert (next_major_number > 0);
+ _dbus_assert (next_minor_number >= 0);
+
+- /* appname:MAJOR-MINOR */
++ /* unique name:
++ * :[AF-BUS.BUS-ADDRESS.]MAJOR.MINOR */
+
+ if (!_dbus_string_append (str, ":"))
+ return FALSE;
+
+- if (!_dbus_string_append_int (str, next_major_number))
+- return FALSE;
++ if (!bus_driver_afbus_append_unique_name (connection, str))
++ {
++ if (!_dbus_string_append_int (str, next_major_number))
++ return FALSE;
+
+- if (!_dbus_string_append (str, "."))
+- return FALSE;
++ if (!_dbus_string_append (str, "."))
++ return FALSE;
+
+- if (!_dbus_string_append_int (str, next_minor_number))
+- return FALSE;
++ if (!_dbus_string_append_int (str, next_minor_number))
++ return FALSE;
++ }
+
+ next_minor_number += 1;
+
+@@ -287,7 +293,7 @@ bus_driver_handle_hello (DBusConnection *connection,
+
+ registry = bus_connection_get_registry (connection);
+
+- if (!create_unique_client_name (registry, &unique_name))
++ if (!create_unique_client_name (connection, registry, &unique_name))
+ {
+ BUS_SET_OOM (error);
+ goto out_0;
+@@ -610,6 +616,13 @@ bus_driver_handle_acquire_service (DBusConnection *connection,
+ goto out;
+ }
+
++ /* If using AF_BUS, assign an address to this peer */
++ if (!bus_driver_afbus_assign_address (connection))
++ {
++ BUS_SET_OOM (error);
++ goto out;
++ }
++
+ retval = TRUE;
+
+ out:
+@@ -988,6 +1001,9 @@ bus_driver_handle_add_match (DBusConnection *connection,
+ if (rule == NULL)
+ goto failed;
+
++ if (!bus_driver_afbus_add_match_rule (connection, text, error))
++ goto failed;
++
+ matchmaker = bus_connection_get_matchmaker (connection);
+
+ if (!bus_matchmaker_add_rule (matchmaker, rule))
+@@ -1051,6 +1067,9 @@ bus_driver_handle_remove_match (DBusConnection *connection,
+ message, error))
+ goto failed;
+
++ if (!bus_driver_afbus_remove_match_rule (connection, text, error))
++ goto failed;
++
+ matchmaker = bus_connection_get_matchmaker (connection);
+
+ if (!bus_matchmaker_remove_rule_by_value (matchmaker, rule, error))
+@@ -1779,6 +1798,13 @@ static InterfaceHandler interface_handlers[] = {
+ { DBUS_INTERFACE_INTROSPECTABLE, introspectable_message_handlers, NULL },
+ #ifdef DBUS_ENABLE_STATS
+ { BUS_INTERFACE_STATS, stats_message_handlers, NULL },
++#ifdef HAVE_AFBUS
++ { DBUS_INTERFACE_AFBUS, NULL,
++ " <signal name=\"AF_BUS.Forwarded\">\n"
++ " <arg type=\"s\"/>\n"
++ " <arg type=\"t\"/>\n"
++ " </signal>\n" },
++#endif
+ #endif
+ { NULL, NULL, NULL }
+ };
+diff --git a/bus/session.conf.in b/bus/session.conf.in
+index e121ff9..09a7ecf 100644
+--- a/bus/session.conf.in
++++ b/bus/session.conf.in
+@@ -12,7 +12,8 @@
+ the behavior of child processes. -->
+ <keep_umask/>
+
+- <listen>@DBUS_SESSION_BUS_DEFAULT_ADDRESS@</listen>
++ <listen_if_possible>afbus:tmpdir=/tmp</listen_if_possible>
++ <listen>unix:tmpdir=/tmp</listen>
+
+ <standard_session_servicedirs />
+
+diff --git a/bus/system.conf.in b/bus/system.conf.in
+index 92f4cc4..515509f 100644
+--- a/bus/system.conf.in
++++ b/bus/system.conf.in
+@@ -39,6 +39,7 @@
+ means use abstract namespace, don't really create filesystem
+ file; only Linux supports this. Use path=/whatever on other
+ systems.) -->
++ <listen_if_possible>afbus:@DBUS_SYSTEM_SOCKET@.afbus</listen_if_possible>
+ <listen>@DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@</listen>
+
+ <policy context="default">
+diff --git a/configure.ac b/configure.ac
+index 4f86e9d..51a48fd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1509,6 +1509,20 @@ if test "x$with_systemdsystemunitdir" != xno; then
+ fi
+ AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
+
++## Check for AF_DBUS
++AC_MSG_CHECKING([for AF_BUS socket family])
++AC_COMPILE_IFELSE(
++ [AC_LANG_PROGRAM(
++ [[#include <sys/socket.h>]],
++ [[return socket (PF_BUS, SOCK_STREAM, 0);]])],
++ [have_afbus=yes],
++ [have_afbus=no])
++AC_MSG_RESULT([$have_afbus])
++if test "x$have_afbus" = "xyes"; then
++ AC_DEFINE(HAVE_AFBUS, 1, [Define if AF_BUS is available])
++fi
++AM_CONDITIONAL(HAVE_AFBUS, test "x$have_afbus" = "xyes")
++
+ ##### Set up location for system bus socket
+ if ! test -z "$with_system_socket"; then
+ DBUS_SYSTEM_SOCKET=$with_system_socket
+@@ -1648,7 +1662,11 @@ AC_SUBST(TEST_SOCKET_DIR)
+ AC_DEFINE_UNQUOTED(DBUS_TEST_SOCKET_DIR, "$TEST_SOCKET_DIR", [Where to put test sockets])
+
+ if test "x$dbus_unix" = xyes; then
+- TEST_LISTEN="unix:tmpdir=$TEST_SOCKET_DIR"
++ if test "x$have_afbus" = "xyes"; then
++ TEST_LISTEN="afbus:tmpdir=$TEST_SOCKET_DIR"
++ else
++ TEST_LISTEN="unix:tmpdir=$TEST_SOCKET_DIR"
++ fi
+ else
+ TEST_LISTEN="tcp:host=localhost"
+ fi
+@@ -1668,6 +1686,8 @@ if test x$dbus_win = xyes; then
+ DBUS_SESSION_BUS_DEFAULT_ADDRESS="$with_dbus_session_bus_default_address"
+ elif test x$have_launchd = xyes; then
+ DBUS_SESSION_BUS_DEFAULT_ADDRESS="launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET"
++elif test x$have_afbus = xyes; then
++ DBUS_SESSION_BUS_DEFAULT_ADDRESS="afbus:tmpdir=$DBUS_SESSION_SOCKET_DIR"
+ else
+ DBUS_SESSION_BUS_DEFAULT_ADDRESS="unix:tmpdir=$DBUS_SESSION_SOCKET_DIR"
+ fi
+diff --git a/dbus/Makefile.am b/dbus/Makefile.am
+index bb5ccca..b925419 100644
+--- a/dbus/Makefile.am
++++ b/dbus/Makefile.am
+@@ -87,6 +87,16 @@ else
+ launchd_source =
+ endif
+
++if HAVE_AFBUS
++afbus_source = \
++ dbus-server-afbus.c \
++ dbus-server-afbus.h \
++ dbus-transport-afbus.c \
++ dbus-transport-afbus.h
++else
++afbus_source =
++endif
++
+ DBUS_LIB_arch_sources = \
+ dbus-uuidgen.c \
+ dbus-uuidgen.h \
+@@ -95,6 +105,7 @@ DBUS_LIB_arch_sources = \
+
+ DBUS_SHARED_arch_sources = \
+ $(launchd_source) \
++ $(afbus_source) \
+ dbus-file-unix.c \
+ dbus-pipe-unix.c \
+ dbus-sysdeps-unix.c \
+diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c
+index ee33b6c..5f3a459 100644
+--- a/dbus/dbus-connection.c
++++ b/dbus/dbus-connection.c
+@@ -45,6 +45,8 @@
+ #include "dbus-bus.h"
+ #include "dbus-marshal-basic.h"
+
++#include <sys/socket.h>
++
+ #ifdef DBUS_DISABLE_CHECKS
+ #define TOOK_LOCK_CHECK(connection)
+ #define RELEASING_LOCK_CHECK(connection)
+@@ -2054,9 +2056,15 @@ _dbus_connection_send_preallocated_and_unlock (DBusConnection *connection,
+ dbus_uint32_t *client_serial)
+ {
+ DBusDispatchStatus status;
++ const char *sender;
+
+ HAVE_LOCK_CHECK (connection);
+-
++
++ /* Set the sender field */
++ sender = dbus_bus_get_unique_name (connection);
++ if (sender)
++ dbus_message_set_sender (message, sender);
++
+ _dbus_connection_send_preallocated_unlocked_no_update (connection,
+ preallocated,
+ message, client_serial);
+@@ -3359,6 +3367,7 @@ dbus_connection_send_with_reply (DBusConnection *connection,
+ DBusPendingCall *pending;
+ dbus_int32_t serial = -1;
+ DBusDispatchStatus status;
++ const char *sender;
+
+ _dbus_return_val_if_fail (connection != NULL, FALSE);
+ _dbus_return_val_if_fail (message != NULL, FALSE);
+@@ -3401,6 +3410,11 @@ dbus_connection_send_with_reply (DBusConnection *connection,
+ return FALSE;
+ }
+
++ /* Set the sender field */
++ sender = dbus_bus_get_unique_name (connection);
++ if (sender)
++ dbus_message_set_sender (message, sender);
++
+ /* Assign a serial to the message */
+ serial = dbus_message_get_serial (message);
+ if (serial == 0)
+@@ -5439,6 +5453,27 @@ dbus_connection_set_route_peer_messages (DBusConnection *connection,
+ CONNECTION_UNLOCK (connection);
+ }
+
++dbus_bool_t
++dbus_connection_get_peer_address (DBusConnection *connection,
++ void *addr,
++ long *len)
++{
++ dbus_bool_t res;
++ int fd;
++ socklen_t _len = *len;
++
++ _dbus_return_val_if_fail (connection != NULL, FALSE);
++
++ res = _dbus_transport_get_socket_fd (connection->transport, &fd);
++ if (!res)
++ return res;
++
++ res = getpeername(fd, (struct sockaddr *) addr, &_len) == 0;
++ if (res)
++ *len = _len;
++ return res;
++}
++
+ /**
+ * Adds a message filter. Filters are handlers that are run on all
+ * incoming messages, prior to the objects registered with
+diff --git a/dbus/dbus-connection.h b/dbus/dbus-connection.h
+index fe4d04e..81fe9f1 100644
+--- a/dbus/dbus-connection.h
++++ b/dbus/dbus-connection.h
+@@ -287,6 +287,10 @@ void dbus_connection_set_allow_anonymous (DBusConnection
+ DBUS_EXPORT
+ void dbus_connection_set_route_peer_messages (DBusConnection *connection,
+ dbus_bool_t value);
++DBUS_EXPORT
++dbus_bool_t dbus_connection_get_peer_address (DBusConnection *connection,
++ void *addr,
++ long *len);
+
+
+ /* Filters */
+diff --git a/dbus/dbus-protocol.h b/dbus/dbus-protocol.h
+index 60605ab..71c2870 100644
+--- a/dbus/dbus-protocol.h
++++ b/dbus/dbus-protocol.h
+@@ -458,6 +458,12 @@ extern "C" {
+ /** XML document type declaration of the introspection format version 1.0 */
+ #define DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE "<!DOCTYPE node PUBLIC \"" DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER "\"\n\"" DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER "\">\n"
+
++/* AF_BUS errors */
++
++/** Tried to use a netlink socket and it failed. */
++#define DBUS_ERROR_NETLINK "org.freedesktop.DBus.Error.NetLink"
++#define DBUS_ERROR_MULTIPLE_AFBUS "org.freedesktop.DBus.Error.MultipleAFBUS"
++
+ /** @} */
+
+ #ifdef __cplusplus
+diff --git a/dbus/dbus-server-afbus.c b/dbus/dbus-server-afbus.c
+new file mode 100644
+index 0000000..1d8e9bd
+--- /dev/null
++++ b/dbus/dbus-server-afbus.c
+@@ -0,0 +1,397 @@
++/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
++/* dbus-server-unix.c Server implementation for Unix network protocols.
++ *
++ * Copyright (C) 2012 Collabora 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 <config.h>
++#include <errno.h>
++#include <sys/socket.h>
++#include "dbus-connection-internal.h"
++#include "dbus-server-afbus.h"
++#include "dbus-server-protected.h"
++#include "dbus-string.h"
++#include "dbus-sysdeps.h"
++#include "dbus-transport.h"
++#include "dbus-transport-afbus.h"
++
++/**
++ * @defgroup DBusServerAfbus DBusServer implementation for AF_BUS sockets
++ * @ingroup DBusInternals
++ * @brief Implementation details of DBusServer for AF_BUS sockets
++ *
++ * @{
++ */
++/**
++ * Opaque object representing a AF_BUS-based server implementation.
++ */
++typedef struct DBusServerAfbus DBusServerAfbus;
++
++/**
++ * Implementation details of DBusServerAfbus. All members
++ * are private.
++ */
++struct DBusServerAfbus
++{
++ DBusServer base; /**< Parent class members. */
++ int fd; /**< File descriptor. */
++ DBusWatch *watch; /**< File descriptor watch. */
++ DBusString address; /**< The server address */
++};
++
++static void
++afbus_finalize (DBusServer *server)
++{
++ DBusServerAfbus *afbus_server = (DBusServerAfbus *) server;
++
++ _dbus_server_finalize_base (server);
++
++ if (afbus_server->watch != NULL)
++ {
++ _dbus_watch_unref (afbus_server->watch);
++ afbus_server->watch = NULL;
++ }
++
++ dbus_free (server);
++}
++
++static void
++afbus_disconnect (DBusServer *server)
++{
++ DBusServerAfbus *afbus_server = (DBusServerAfbus *) server;
++
++ HAVE_LOCK_CHECK (server);
++
++ if (afbus_server->watch)
++ {
++ _dbus_server_remove_watch (server, afbus_server->watch);
++ _dbus_watch_invalidate (afbus_server->watch);
++ _dbus_watch_unref (afbus_server->watch);
++ afbus_server->watch = NULL;
++ }
++
++ _dbus_close_socket (afbus_server->fd, NULL);
++ afbus_server->fd = -1;
++
++ HAVE_LOCK_CHECK (server);
++}
++
++static const DBusServerVTable afbus_vtable = {
++ afbus_finalize,
++ afbus_disconnect
++};
++
++static dbus_bool_t
++handle_new_client (DBusServer *server,
++ int client_fd)
++{
++ DBusTransport *transport;
++ DBusConnection *connection;
++ DBusNewConnectionFunction new_connection_function;
++ void *new_connection_data;
++
++ _dbus_verbose ("Creating new client connection with fd %d\n", client_fd);
++
++ if (!_dbus_set_fd_nonblocking (client_fd, NULL))
++ {
++ SERVER_UNLOCK (server);
++ return TRUE;
++ }
++
++ transport = _dbus_transport_new_for_afbus (client_fd, &server->guid_hex, NULL);
++ if (transport == NULL)
++ {
++ _dbus_close_socket (client_fd, NULL);
++ SERVER_UNLOCK (server);
++ return FALSE;
++ }
++
++ if (!_dbus_transport_set_auth_mechanisms (transport,
++ (const char **) server->auth_mechanisms))
++ {
++ _dbus_transport_unref (transport);
++ SERVER_UNLOCK (server);
++ return FALSE;
++ }
++
++ /* note that client_fd is now owned by the transport, and will be
++ * closed on transport disconnection/finalization
++ */
++ connection = _dbus_connection_new_for_transport (transport);
++ _dbus_transport_unref (transport);
++ transport = NULL; /* now under the connection lock */
++
++ if (connection == NULL)
++ {
++ SERVER_UNLOCK (server);
++ return FALSE;
++ }
++
++ /* See if someone wants to handle this new connection, self-referencing
++ * for paranoia.
++ */
++ new_connection_function = server->new_connection_function;
++ new_connection_data = server->new_connection_data;
++
++ _dbus_server_ref_unlocked (server);
++ SERVER_UNLOCK (server);
++
++ if (new_connection_function)
++ {
++ (* new_connection_function) (server, connection,
++ new_connection_data);
++ }
++ dbus_server_unref (server);
++
++ /* If no one grabbed a reference, the connection will die. */
++ _dbus_connection_close_if_only_one_ref (connection);
++ dbus_connection_unref (connection);
++
++ return TRUE;
++}
++
++static dbus_bool_t
++afbus_handle_watch (DBusWatch *watch,
++ unsigned int flags,
++ void *data)
++{
++ DBusServerAfbus *afbus_server = (DBusServerAfbus *) data;
++ DBusServer *server = (DBusServer *) data;
++
++ SERVER_LOCK (server);
++
++#ifndef DBUS_DISABLE_ASSERT
++ _dbus_assert (afbus_server->watch == watch);
++#endif
++
++ _dbus_verbose ("Handling client connection, flags 0x%x\n", flags);
++
++ if (flags & DBUS_WATCH_READABLE)
++ {
++ int client_fd;
++
++ client_fd = _dbus_accept (afbus_server->fd);
++ if (client_fd < 0)
++ {
++ /* EINTR handled for us */
++
++ if (_dbus_get_is_errno_eagain_or_ewouldblock ())
++ _dbus_verbose ("No client available to accept after all\n");
++ else
++ _dbus_verbose ("Failed to accept a client connection: %s\n",
++ _dbus_strerror_from_errno ());
++
++ SERVER_UNLOCK (server);
++ }
++ else
++ {
++ if (!handle_new_client (server, client_fd))
++ _dbus_verbose ("Rejected client connection due to lack of memory\n");
++ }
++ }
++
++ if (flags & DBUS_WATCH_ERROR)
++ _dbus_verbose ("Error on server listening socket\n");
++
++ if (flags & DBUS_WATCH_HANGUP)
++ _dbus_verbose ("Hangup on server listening socket\n");
++
++ return TRUE;
++}
++
++static DBusServer *
++_dbus_server_new_for_afbus (int fd, const char *path, DBusError *error)
++{
++ DBusServerAfbus *afbus_server;
++ DBusServer *server;
++ struct sockaddr_bus sock_address;
++
++ afbus_server = dbus_new0 (DBusServerAfbus, 1);
++ if (afbus_server == NULL)
++ return NULL;
++
++ if (!_dbus_string_init (&afbus_server->address) ||
++ !_dbus_string_append (&afbus_server->address, "afbus:path=") ||
++ !_dbus_string_append (&afbus_server->address, path))
++ {
++ dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
++ goto failed_1;
++ }
++
++ afbus_server->fd = fd;
++
++ sock_address.sbus_family = AF_BUS;
++ strcpy (sock_address.sbus_path, path);
++ if (bind (afbus_server->fd, (struct sockaddr *) &sock_address, sizeof (sock_address)) < 0)
++ {
++ dbus_set_error (error, _dbus_error_from_errno (errno),
++ "Failed to bind socket \"%s\": %s",
++ path, _dbus_strerror (errno));
++ goto failed_1;
++ }
++
++ if (listen (afbus_server->fd, 30 /* backlog */) < 0)
++ {
++ dbus_set_error (error, _dbus_error_from_errno (errno),
++ "Failed to listen on AF_BUS socket: %s",
++ _dbus_strerror (errno));
++ goto failed_1;
++ }
++
++ afbus_server->watch = _dbus_watch_new (fd,
++ DBUS_WATCH_READABLE,
++ TRUE,
++ afbus_handle_watch, afbus_server,
++ NULL);
++ if (afbus_server->watch == NULL)
++ goto failed_1;
++
++ if (!_dbus_server_init_base (&afbus_server->base,
++ &afbus_vtable, &afbus_server->address))
++ goto failed_2;
++
++ server = (DBusServer *) afbus_server;
++ server->is_afbus = TRUE;
++
++
++ SERVER_LOCK (server);
++
++ if (!_dbus_server_add_watch (&afbus_server->base,
++ afbus_server->watch))
++ {
++ SERVER_UNLOCK (server);
++ _dbus_server_finalize_base (&afbus_server->base);
++
++ goto failed_2;
++ }
++
++ SERVER_UNLOCK (server);
++
++ _dbus_server_trace_ref (&afbus_server->base, 0, 1, "new_for_afbus");
++ return (DBusServer *) afbus_server;
++
++ failed_2:
++ _dbus_watch_unref (afbus_server->watch);
++
++ failed_1:
++ _dbus_close_socket (afbus_server->fd, NULL);
++ dbus_free (afbus_server);
++
++ return NULL;
++}
++
++/**
++ * Starts a DBusServer listening on AF_BUS socket.
++ * Sets error if the result is not OK.
++ *
++ * @param entry an address entry
++ * @param server_p location to store a new DBusServer, or #NULL on failure.
++ * @param error location to store rationale for failure on bad address
++ * @returns the outcome
++ *
++ */
++DBusServerListenResult
++_dbus_server_listen_afbus (DBusAddressEntry *entry,
++ DBusServer **server_p,
++ DBusError *error)
++{
++ const char *method, *path, *tmpdir;
++ int listen_fd;
++
++ *server_p = NULL;
++
++ method = dbus_address_entry_get_method (entry);
++ if (strcmp (method, "afbus") != 0)
++ {
++ /* If we don't handle the method, we return NULL with the
++ * error unset
++ */
++ _DBUS_ASSERT_ERROR_IS_CLEAR(error);
++ return DBUS_SERVER_LISTEN_NOT_HANDLED;
++ }
++
++ path = dbus_address_entry_get_value (entry, "path");
++ tmpdir = dbus_address_entry_get_value (entry, "tmpdir");
++
++ if (path == NULL && tmpdir == NULL)
++ {
++ _dbus_set_bad_address(error, "unix",
++ "path or tmpdir",
++ NULL);
++ return DBUS_SERVER_LISTEN_BAD_ADDRESS;
++ }
++
++ if (path && tmpdir)
++ {
++ _dbus_set_bad_address(error, NULL, NULL,
++ "cannot specify both \"path\" and \"tmpdir\" at the same time");
++ return DBUS_SERVER_LISTEN_BAD_ADDRESS;
++ }
++
++ if (!_dbus_open_socket (&listen_fd, PF_BUS, SOCK_SEQPACKET, BUS_PROTO_DBUS, error))
++ return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
++
++ if (!_dbus_set_fd_nonblocking (listen_fd, error))
++ goto failed_1;
++
++ if (tmpdir != NULL)
++ {
++ DBusString full_path;
++ DBusString filename;
++
++ if (!_dbus_string_init (&full_path))
++ {
++ dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
++ return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
++ }
++
++ if (!_dbus_string_init (&filename))
++ {
++ _dbus_string_free (&full_path);
++ dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
++ return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
++ }
++
++ if (!_dbus_string_append (&filename,
++ "dbus-") ||
++ !_dbus_generate_random_ascii (&filename, 10) ||
++ !_dbus_string_append (&full_path, tmpdir) ||
++ !_dbus_concat_dir_and_file (&full_path, &filename))
++ {
++ _dbus_string_free (&full_path);
++ _dbus_string_free (&filename);
++ dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
++ return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
++ }
++
++ path = _dbus_string_get_const_data (&full_path);
++ }
++
++ *server_p = _dbus_server_new_for_afbus (listen_fd, path, error);
++ if (*server_p == NULL)
++ goto failed_1;
++
++ return DBUS_SERVER_LISTEN_OK;
++
++ failed_1:
++ _dbus_close_socket (listen_fd, NULL);
++
++ return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
++}
+diff --git a/dbus/dbus-server-afbus.h b/dbus/dbus-server-afbus.h
+new file mode 100644
+index 0000000..8e5ad31
+--- /dev/null
++++ b/dbus/dbus-server-afbus.h
+@@ -0,0 +1,36 @@
++/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
++/* dbus-server-unix.h Server implementation for Unix network protocols.
++ *
++ * Copyright (C) 2012 Collabora 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 DBUS_SERVER_AFBUS_H
++#define DBUS_SERVER_AFBUS_H
++
++#include "dbus-server-protected.h"
++
++DBUS_BEGIN_DECLS
++
++DBusServerListenResult _dbus_server_listen_afbus (DBusAddressEntry *entry,
++ DBusServer **server_p,
++ DBusError *error);
++
++DBUS_END_DECLS
++
++#endif
+diff --git a/dbus/dbus-server-protected.h b/dbus/dbus-server-protected.h
+index dd5234b..b423cb9 100644
+--- a/dbus/dbus-server-protected.h
++++ b/dbus/dbus-server-protected.h
+@@ -89,6 +89,9 @@ struct DBusServer
+ #ifndef DBUS_DISABLE_CHECKS
+ unsigned int have_server_lock : 1; /**< Does someone have the server mutex locked */
+ #endif
++#ifdef HAVE_AFBUS
++ unsigned int is_afbus : 1; /**< TRUE if this server listen on a AF_BUS socket */
++#endif
+ };
+
+ dbus_bool_t _dbus_server_init_base (DBusServer *server,
+diff --git a/dbus/dbus-server.c b/dbus/dbus-server.c
+index b62c2b4..2a23252 100644
+--- a/dbus/dbus-server.c
++++ b/dbus/dbus-server.c
+@@ -25,6 +25,9 @@
+ #include "dbus-server.h"
+ #include "dbus-server-unix.h"
+ #include "dbus-server-socket.h"
++#ifdef HAVE_AFBUS
++#include "dbus-server-afbus.h"
++#endif
+ #include "dbus-string.h"
+ #ifdef DBUS_BUILD_TESTS
+ #include "dbus-server-debug-pipe.h"
+@@ -529,6 +532,9 @@ static const struct {
+ } listen_funcs[] = {
+ { _dbus_server_listen_socket }
+ , { _dbus_server_listen_platform_specific }
++#ifdef HAVE_AFBUS
++ , { _dbus_server_listen_afbus }
++#endif
+ #ifdef DBUS_BUILD_TESTS
+ , { _dbus_server_listen_debug_pipe }
+ #endif
+@@ -844,6 +850,30 @@ dbus_server_get_address (DBusServer *server)
+ }
+
+ /**
++ * Returns TRUE if the server listens on an AF_BUS address
++ *
++ * @param server the server
++ * @returns TRUE if the server listens on an AF_BUS address
++ */
++dbus_bool_t
++dbus_server_is_afbus (DBusServer *server)
++{
++ dbus_bool_t retval;
++
++ _dbus_return_val_if_fail (server != NULL, FALSE);
++
++#ifdef HAVE_AFBUS
++ SERVER_LOCK (server);
++ retval = server->is_afbus;
++ SERVER_UNLOCK (server);
++#else
++ retval = FALSE;
++#endif
++
++ return retval;
++}
++
++/**
+ * Returns the unique ID of the server, as a newly-allocated
+ * string which must be freed by the caller. This ID is
+ * normally used by clients to tell when two #DBusConnection
+diff --git a/dbus/dbus-server.h b/dbus/dbus-server.h
+index bdbefa0..49cb9cf 100644
+--- a/dbus/dbus-server.h
++++ b/dbus/dbus-server.h
+@@ -62,6 +62,8 @@ dbus_bool_t dbus_server_get_is_connected (DBusServer *server);
+ DBUS_EXPORT
+ char* dbus_server_get_address (DBusServer *server);
+ DBUS_EXPORT
++dbus_bool_t dbus_server_is_afbus (DBusServer *server);
++DBUS_EXPORT
+ char* dbus_server_get_id (DBusServer *server);
+ DBUS_EXPORT
+ void dbus_server_set_new_connection_function (DBusServer *server,
+diff --git a/dbus/dbus-shared.h b/dbus/dbus-shared.h
+index 6a57670..b6b29b3 100644
+--- a/dbus/dbus-shared.h
++++ b/dbus/dbus-shared.h
+@@ -80,6 +80,10 @@ typedef enum
+ #define DBUS_PATH_DBUS "/org/freedesktop/DBus"
+ /** The object path used in local/in-process-generated messages. */
+ #define DBUS_PATH_LOCAL "/org/freedesktop/DBus/Local"
++#ifdef HAVE_AFBUS
++/** The object path used for AF_BUS sockets. */
++#define DBUS_PATH_AFBUS "/org/freedesktop/DBus/AF_BUS"
++#endif
+
+ /* Interfaces, these #define don't do much other than
+ * catch typos at compile time
+@@ -92,6 +96,10 @@ typedef enum
+ #define DBUS_INTERFACE_PROPERTIES "org.freedesktop.DBus.Properties"
+ /** The interface supported by most dbus peers */
+ #define DBUS_INTERFACE_PEER "org.freedesktop.DBus.Peer"
++#ifdef HAVE_AFBUS
++/** The interface supported by AF_BUS transport */
++#define DBUS_INTERFACE_AFBUS "org.freedesktop.DBus.AF_BUS"
++#endif
+
+ /** This is a special interface whose methods can only be invoked
+ * by the local implementation (messages from remote apps aren't
+diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
+index cef8bd3..26e3d00 100644
+--- a/dbus/dbus-sysdeps-unix.c
++++ b/dbus/dbus-sysdeps-unix.c
+@@ -122,7 +122,7 @@
+
+ #endif /* Solaris */
+
+-static dbus_bool_t
++dbus_bool_t
+ _dbus_open_socket (int *fd_p,
+ int domain,
+ int type,
+diff --git a/dbus/dbus-sysdeps.h b/dbus/dbus-sysdeps.h
+index 4052cda..a589486 100644
+--- a/dbus/dbus-sysdeps.h
++++ b/dbus/dbus-sysdeps.h
+@@ -125,6 +125,11 @@ typedef unsigned long dbus_gid_t;
+ *
+ */
+
++dbus_bool_t _dbus_open_socket (int *fd_p,
++ int domain,
++ int type,
++ int protocol,
++ DBusError *error);
+ dbus_bool_t _dbus_close_socket (int fd,
+ DBusError *error);
+ int _dbus_read_socket (int fd,
+diff --git a/dbus/dbus-transport-afbus.c b/dbus/dbus-transport-afbus.c
+new file mode 100644
+index 0000000..9574bca
+--- /dev/null
++++ b/dbus/dbus-transport-afbus.c
+@@ -0,0 +1,394 @@
++/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
++/* dbus-transport-socket.h Socket subclasses of DBusTransport
++ *
++ * Copyright (C) 212 Collabora 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 <config.h>
++#include <errno.h>
++#include <sys/socket.h>
++#include "dbus-connection-internal.h"
++#include "dbus-hash.h"
++#include "dbus-transport-afbus.h"
++#include "dbus-transport-socket.h"
++#include "dbus-watch.h"
++
++static DBusHashTable *wkn_addresses_cache = NULL;
++
++/**
++ * @defgroup DBusTransportAfbus AF_BUS-based DBusTransport implementation
++ * @ingroup DBusInternals
++ * @brief Implementation details of DBusTransport on AF_BUS sockets
++ *
++ * @{
++ */
++
++/**
++ * Opaque object representing a AF_BUS-based transport.
++ */
++typedef struct DBusTransportAfbus DBusTransportAfbus;
++
++/**
++ * Implementation details of DBusTransportAfbus. All members are private.
++ */
++struct DBusTransportAfbus
++{
++ DBusTransportSocket base; /**< Parent instance */
++};
++
++static dbus_bool_t
++get_write_destination (int fd,
++ DBusMessage *message,
++ struct sockaddr_bus *sock)
++{
++ socklen_t addrlen;
++ const char *destination;
++ const char *sender;
++
++ /* if the sender is the bus driver, don't set the sockaddr, just let the
++ * message be delivered to the peer socket
++ */
++ sender = dbus_message_get_sender (message);
++ if (sender && strcmp (sender, DBUS_SERVICE_DBUS) == 0)
++ {
++ return FALSE;
++ }
++
++ addrlen = sizeof(struct sockaddr_bus);
++ if (getsockname (fd, (struct sockaddr *) sock, &addrlen) != 0)
++ return FALSE;
++ if (addrlen != sizeof(struct sockaddr_bus))
++ return FALSE;
++ if (sock->sbus_family != AF_BUS)
++ return FALSE;
++
++ destination = dbus_message_get_destination (message);
++ if (destination && strcmp (destination, DBUS_SERVICE_DBUS) == 0)
++ {
++ /* a message for the bus driver */
++ sock->sbus_addr.s_addr = 0;
++ return TRUE;
++ }
++
++ if (destination != NULL && strlen (destination) > 0)
++ {
++ dbus_uint64_t peer = 0x0000000000000000ULL;
++
++ /* If destination is a unique name, just retrieve the peer address from it */
++ if (strncmp (destination, ":AF-BUS.", 8) == 0)
++ {
++ DBusString tmp;
++
++ _dbus_string_init_const (&tmp, &destination[8]);
++ if (!_dbus_string_parse_uint (&tmp, 0, (unsigned long *) &peer, NULL))
++ peer = 0x0000000000000000ULL;
++ _dbus_string_free (&tmp);
++ }
++ else
++ {
++ /* a message for a well known name */
++ if (wkn_addresses_cache != NULL)
++ {
++ dbus_uint64_t *peer_pointer;
++
++ peer_pointer = (dbus_uint64_t *) _dbus_hash_table_lookup_string (wkn_addresses_cache, destination);
++ if (peer_pointer != NULL)
++ peer = *peer_pointer;
++ }
++ }
++
++ sock->sbus_addr.s_addr = peer;
++
++ return TRUE;
++ }
++ else
++ {
++ /* a multicast message */
++ sock->sbus_addr.s_addr = 0x0000ffffffffffffULL;
++ return TRUE;
++ }
++
++ return FALSE;
++}
++
++static int
++afbus_write_socket (DBusTransportSocket *socket_transport,
++ DBusMessage *message,
++ const DBusString *buffer,
++ int start,
++ int len)
++{
++ int fd, bytes_written;
++ struct sockaddr_bus sock;
++
++ if (!_dbus_transport_get_socket_fd ((DBusTransport *) socket_transport, &fd))
++ {
++ _dbus_verbose ("Couldn't get socket's file descriptor\n");
++ return -1;
++ }
++
++ if (get_write_destination (fd, message, &sock))
++ {
++ const char *data;
++
++ /* Send the data to specific address */
++ data = _dbus_string_get_const_data_len (buffer, start, len);
++
++ bytes_written = sendto (fd, data, len, MSG_NOSIGNAL,
++ (struct sockaddr *) &sock, sizeof (struct sockaddr_bus));
++ }
++ else
++ bytes_written = _dbus_write_socket (fd, buffer, start, len);
++
++ return bytes_written;
++}
++
++static int
++afbus_write_socket_two (DBusTransportSocket *socket_transport,
++ DBusMessage *message,
++ const DBusString *header,
++ int header_start,
++ int header_len,
++ const DBusString *body,
++ int body_start,
++ int body_len)
++{
++ int fd, bytes_written;
++ struct sockaddr_bus sock;
++
++ if (!_dbus_transport_get_socket_fd ((DBusTransport *) socket_transport, &fd))
++ {
++ _dbus_verbose ("Couldn't get socket's file descriptor\n");
++ return -1;
++ }
++
++ if (get_write_destination (fd, message, &sock))
++ {
++ struct iovec vectors[2];
++ const char *data1, *data2;
++ struct msghdr m;
++
++ data1 = _dbus_string_get_const_data_len (header, header_start, header_len);
++ if (body != NULL)
++ data2 = _dbus_string_get_const_data_len (body, body_start, body_len);
++ else
++ {
++ data2 = NULL;
++ body_start = body_len = 0;
++ }
++
++ vectors[0].iov_base = (char *) data1;
++ vectors[0].iov_len = header_len;
++ vectors[1].iov_base = (char *) data2;
++ vectors[1].iov_len = body_len;
++
++ _DBUS_ZERO(m);
++ m.msg_iov = vectors;
++ m.msg_iovlen = data2 ? 2 : 1;
++ m.msg_name = &sock;
++ m.msg_namelen = sizeof (sock);
++
++ again:
++ bytes_written = sendmsg (fd, &m, MSG_NOSIGNAL);
++ if (bytes_written < 0 && errno == EINTR)
++ goto again;
++ }
++ else
++ bytes_written = _dbus_write_socket_two (fd, header, header_start, header_len, body, body_start, body_len);
++
++ return bytes_written;
++}
++
++static void
++afbus_authenticated (DBusTransportSocket *socket_transport)
++{
++ if (socket_transport->base.is_server)
++ {
++ /* Make the client join the bus when authenticated, so that it can send
++ * unicast messages to peers other than the daemon */
++ if (setsockopt (socket_transport->fd, SOL_BUS, BUS_JOIN_BUS, NULL, 0) != 0)
++ {
++ _dbus_verbose ("Could not join client to the bus\n");
++ }
++ }
++}
++
++static void
++afbus_message_received (DBusTransportSocket *socket_transport,
++ DBusMessage *message)
++{
++ if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_SIGNAL)
++ {
++ const char *path, *interface, *member;
++
++ path = dbus_message_get_path (message);
++ interface = dbus_message_get_interface (message);
++ member = dbus_message_get_member (message);
++
++ if (strcmp (path, DBUS_PATH_AFBUS) == 0
++ && strcmp (interface, DBUS_INTERFACE_AFBUS) == 0
++ && strcmp (member, "Forwarded") == 0)
++ {
++ char *wkn;
++ dbus_uint64_t peer;
++ dbus_uint64_t *peer_pointer;
++
++ /* Update the cache */
++ if (wkn_addresses_cache == NULL)
++ {
++ wkn_addresses_cache = _dbus_hash_table_new (DBUS_HASH_STRING,
++ dbus_free,
++ dbus_free);
++ if (wkn_addresses_cache == NULL)
++ return;
++ }
++
++ dbus_message_get_args (message, NULL,
++ DBUS_TYPE_STRING, &wkn,
++ DBUS_TYPE_UINT64, &peer,
++ DBUS_TYPE_INVALID);
++
++ peer_pointer = dbus_new (dbus_uint64_t, 1);
++ *peer_pointer = peer;
++ _dbus_hash_table_insert_string (wkn_addresses_cache,
++ _dbus_strdup (wkn),
++ (void *) peer_pointer);
++ }
++ }
++}
++
++static const DBusTransportSocketVTable afbus_vtable = {
++ afbus_write_socket,
++ afbus_write_socket_two,
++ afbus_authenticated,
++ afbus_message_received
++};
++
++/**
++ * Creates a new AF_BUS-based transport for the given socket descriptor.
++ *
++ * @param fd the file descriptor.
++ * @param server_guid non-#NULL if this transport is on the server side of a connection
++ * @param address the transport's address
++ * @returns the new transport, or #NULL if no memory.
++ */
++DBusTransport*
++_dbus_transport_new_for_afbus (int fd,
++ const DBusString *server_guid,
++ const DBusString *address)
++{
++ DBusTransportAfbus *afbus_transport;
++
++ afbus_transport = dbus_new0 (DBusTransportAfbus, 1);
++ if (afbus_transport == NULL)
++ return NULL;
++
++ if (!_dbus_transport_socket_init_base (&afbus_transport->base,
++ fd,
++ &afbus_vtable,
++ server_guid, address))
++ goto failed_1;
++
++ return (DBusTransport *) afbus_transport;
++
++ failed_1:
++ dbus_free (afbus_transport);
++
++ return NULL;
++}
++
++/**
++ * Opens a AF_BUS-based transport.
++ *
++ * @param entry the address entry to try opening as a tcp transport.
++ * @param transport_p return location for the opened transport
++ * @param error error to be set
++ * @returns result of the attempt
++ */
++DBusTransportOpenResult
++_dbus_transport_open_afbus (DBusAddressEntry *entry,
++ DBusTransport **transport_p,
++ DBusError *error)
++{
++ const char *method, *path;
++ DBusString address;
++ int fd;
++ struct sockaddr_bus sock_address;
++
++ method = dbus_address_entry_get_method (entry);
++ if (strcmp (method, "afbus") != 0)
++ {
++ _DBUS_ASSERT_ERROR_IS_CLEAR (error);
++ return DBUS_TRANSPORT_OPEN_NOT_HANDLED;
++ }
++
++ path = dbus_address_entry_get_value (entry, "path");
++ if (path == NULL)
++ {
++ _dbus_set_bad_address (error, "afbus",
++ "path or tmpdir",
++ NULL);
++ return DBUS_TRANSPORT_OPEN_BAD_ADDRESS;
++ }
++
++ if (!_dbus_string_init (&address) ||
++ !_dbus_string_append (&address, "afbus:path=") ||
++ !_dbus_string_append (&address, path))
++ {
++ dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
++ return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
++ }
++
++ if (!_dbus_open_socket (&fd, PF_BUS, SOCK_SEQPACKET, BUS_PROTO_DBUS, error))
++ goto failed_1;
++
++ if (!_dbus_set_fd_nonblocking (fd, error))
++ goto failed_2;
++
++ sock_address.sbus_family = AF_BUS;
++ strcpy (sock_address.sbus_path, path);
++ if (connect (fd, (struct sockaddr *) &sock_address, sizeof (sock_address)) < 0)
++ {
++ dbus_set_error (error,
++ _dbus_error_from_errno (errno),
++ "Failed to connect to socket %s: %s",
++ path, _dbus_strerror (errno));
++ goto failed_2;
++ }
++
++ *transport_p = _dbus_transport_new_for_afbus (fd, NULL, &address);
++ if (*transport_p == NULL)
++ {
++ dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
++ goto failed_2;
++ }
++
++ _dbus_string_free (&address);
++
++ return DBUS_TRANSPORT_OPEN_OK;
++
++ failed_2:
++ _dbus_close_socket (fd, NULL);
++
++ failed_1:
++ _dbus_string_free (&address);
++
++ return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
++}
+diff --git a/dbus/dbus-transport-afbus.h b/dbus/dbus-transport-afbus.h
+new file mode 100644
+index 0000000..c94e32d
+--- /dev/null
++++ b/dbus/dbus-transport-afbus.h
+@@ -0,0 +1,41 @@
++/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
++/* dbus-transport-socket.h Socket subclasses of DBusTransport
++ *
++ * Copyright (C) 212 Collabora 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 DBUS_TRANSPORT_AFBUS_H
++#define DBUS_TRANSPORT_AFBUS_H
++
++#include <sys/socket.h>
++#include <sys/bus.h>
++#include <dbus/dbus-transport-protected.h>
++
++DBUS_BEGIN_DECLS
++
++DBusTransport *_dbus_transport_new_for_afbus (int fd,
++ const DBusString *server_guid,
++ const DBusString *address);
++DBusTransportOpenResult _dbus_transport_open_afbus (DBusAddressEntry *entry,
++ DBusTransport **transport_p,
++ DBusError *error);
++
++DBUS_END_DECLS
++
++#endif
+diff --git a/dbus/dbus-transport-protected.h b/dbus/dbus-transport-protected.h
+index 44b9d78..9becbdb 100644
+--- a/dbus/dbus-transport-protected.h
++++ b/dbus/dbus-transport-protected.h
+@@ -69,6 +69,10 @@ struct DBusTransportVTable
+ dbus_bool_t (* get_socket_fd) (DBusTransport *transport,
+ int *fd_p);
+ /**< Get socket file descriptor */
++
++ void (* process_incoming_message) (DBusTransport *transport,
++ DBusMessage *message);
++ /**> Method to allow transport to filter messages */
+ };
+
+ /**
+diff --git a/dbus/dbus-transport-socket.c b/dbus/dbus-transport-socket.c
+index 544d00a..a3951ef 100644
+--- a/dbus/dbus-transport-socket.c
++++ b/dbus/dbus-transport-socket.c
+@@ -22,6 +22,7 @@
+ */
+
+ #include <config.h>
++#include <sys/ioctl.h>
+ #include "dbus-internals.h"
+ #include "dbus-connection-internal.h"
+ #include "dbus-nonce.h"
+@@ -38,43 +39,13 @@
+ * @{
+ */
+
+-/**
+- * Opaque object representing a socket file descriptor transport.
+- */
+-typedef struct DBusTransportSocket DBusTransportSocket;
+-
+-/**
+- * Implementation details of DBusTransportSocket. All members are private.
+- */
+-struct DBusTransportSocket
+-{
+- DBusTransport base; /**< Parent instance */
+- int fd; /**< File descriptor. */
+- DBusWatch *read_watch; /**< Watch for readability. */
+- DBusWatch *write_watch; /**< Watch for writability. */
+-
+- int max_bytes_read_per_iteration; /**< To avoid blocking too long. */
+- int max_bytes_written_per_iteration; /**< To avoid blocking too long. */
+-
+- int message_bytes_written; /**< Number of bytes of current
+- * outgoing message that have
+- * been written.
+- */
+- DBusString encoded_outgoing; /**< Encoded version of current
+- * outgoing message.
+- */
+- DBusString encoded_incoming; /**< Encoded version of current
+- * incoming data.
+- */
+-};
+-
+ static void
+ free_watches (DBusTransport *transport)
+ {
+ DBusTransportSocket *socket_transport = (DBusTransportSocket*) transport;
+
+ _dbus_verbose ("start\n");
+-
++
+ if (socket_transport->read_watch)
+ {
+ if (transport->connection)
+@@ -104,7 +75,7 @@ socket_finalize (DBusTransport *transport)
+ DBusTransportSocket *socket_transport = (DBusTransportSocket*) transport;
+
+ _dbus_verbose ("\n");
+-
++
+ free_watches (transport);
+
+ _dbus_string_free (&socket_transport->encoded_outgoing);
+@@ -136,7 +107,16 @@ check_write_watch (DBusTransport *transport)
+ _dbus_transport_ref (transport);
+
+ if (_dbus_transport_get_is_authenticated (transport))
+- needed = _dbus_connection_has_messages_to_send_unlocked (transport->connection);
++ {
++ if (!socket_transport->auth_notified &&
++ socket_transport->vtable->authenticated != NULL)
++ {
++ socket_transport->auth_notified = TRUE;
++ socket_transport->vtable->authenticated (socket_transport);
++ }
++
++ needed = _dbus_connection_has_messages_to_send_unlocked (transport->connection);
++ }
+ else
+ {
+ if (transport->send_credentials_pending)
+@@ -146,7 +126,7 @@ check_write_watch (DBusTransport *transport)
+ DBusAuthState auth_state;
+
+ auth_state = _dbus_auth_do_work (transport->auth);
+-
++
+ /* If we need memory we install the write watch just in case,
+ * if there's no need for it, it will get de-installed
+ * next time we try reading.
+@@ -191,9 +171,18 @@ check_read_watch (DBusTransport *transport)
+ _dbus_transport_ref (transport);
+
+ if (_dbus_transport_get_is_authenticated (transport))
+- need_read_watch =
+- (_dbus_counter_get_size_value (transport->live_messages) < transport->max_live_messages_size) &&
+- (_dbus_counter_get_unix_fd_value (transport->live_messages) < transport->max_live_messages_unix_fds);
++ {
++ if (!socket_transport->auth_notified &&
++ socket_transport->vtable->authenticated != NULL)
++ {
++ socket_transport->auth_notified = TRUE;
++ socket_transport->vtable->authenticated (socket_transport);
++ }
++
++ need_read_watch =
++ (_dbus_counter_get_size_value (transport->live_messages) < transport->max_live_messages_size) &&
++ (_dbus_counter_get_unix_fd_value (transport->live_messages) < transport->max_live_messages_unix_fds);
++ }
+ else
+ {
+ if (transport->receive_credentials_pending)
+@@ -489,6 +478,59 @@ do_authentication (DBusTransport *transport,
+ return TRUE;
+ }
+
++static int
++_write_socket (DBusTransportSocket *socket_transport,
++ DBusMessage *message,
++ const DBusString *buffer,
++ int start,
++ int len)
++{
++ int bytes_written;
++
++ if (socket_transport->vtable->write_socket != NULL)
++ {
++ bytes_written = socket_transport->vtable->write_socket (socket_transport,
++ message,
++ buffer, start, len);
++ }
++ else
++ {
++ bytes_written = _dbus_write_socket (socket_transport->fd,
++ buffer,
++ start, len);
++ }
++
++ return bytes_written;
++}
++
++static int
++_write_socket_two (DBusTransportSocket *socket_transport,
++ DBusMessage *message,
++ const DBusString *header,
++ int header_start,
++ int header_len,
++ const DBusString *body,
++ int body_start,
++ int body_len)
++{
++ int bytes_written;
++
++ if (socket_transport->vtable->write_socket_two != NULL)
++ {
++ bytes_written = socket_transport->vtable->write_socket_two (socket_transport, message,
++ header, header_start, header_len,
++ body, body_start, body_len);
++ }
++ else
++ {
++ bytes_written = _dbus_write_socket_two (socket_transport->fd,
++ header, header_start, header_len,
++ body, body_start, body_len);
++ }
++
++ return bytes_written;
++}
++
+ /* returns false on oom */
+ static dbus_bool_t
+ do_writing (DBusTransport *transport)
+@@ -579,12 +621,13 @@ do_writing (DBusTransport *transport)
+ _dbus_verbose ("encoded message is %d bytes\n",
+ total_bytes_to_write);
+ #endif
+-
++
+ bytes_written =
+- _dbus_write_socket (socket_transport->fd,
+- &socket_transport->encoded_outgoing,
+- socket_transport->message_bytes_written,
+- total_bytes_to_write - socket_transport->message_bytes_written);
++ _write_socket (socket_transport,
++ message,
++ &socket_transport->encoded_outgoing,
++ socket_transport->message_bytes_written,
++ total_bytes_to_write - socket_transport->message_bytes_written);
+ }
+ else
+ {
+@@ -623,21 +666,23 @@ do_writing (DBusTransport *transport)
+ if (socket_transport->message_bytes_written < header_len)
+ {
+ bytes_written =
+- _dbus_write_socket_two (socket_transport->fd,
+- header,
+- socket_transport->message_bytes_written,
+- header_len - socket_transport->message_bytes_written,
+- body,
+- 0, body_len);
++ _write_socket_two (socket_transport,
++ message,
++ header,
++ socket_transport->message_bytes_written,
++ header_len - socket_transport->message_bytes_written,
++ body,
++ 0, body_len);
+ }
+ else
+ {
+ bytes_written =
+- _dbus_write_socket (socket_transport->fd,
+- body,
+- (socket_transport->message_bytes_written - header_len),
+- body_len -
+- (socket_transport->message_bytes_written - header_len));
++ _write_socket (socket_transport,
++ message,
++ body,
++ (socket_transport->message_bytes_written - header_len),
++ body_len -
++ (socket_transport->message_bytes_written - header_len));
+ }
+ }
+ }
+@@ -696,7 +741,7 @@ do_reading (DBusTransport *transport)
+ {
+ DBusTransportSocket *socket_transport = (DBusTransportSocket*) transport;
+ DBusString *buffer;
+- int bytes_read;
++ int bytes_read, bytes_available;
+ int total;
+ dbus_bool_t oom;
+
+@@ -730,7 +775,12 @@ do_reading (DBusTransport *transport)
+
+ if (!dbus_watch_get_enabled (socket_transport->read_watch))
+ return TRUE;
+-
++
++ if (ioctl (socket_transport->fd, FIONREAD, &bytes_available) < 0)
++ bytes_available = socket_transport->max_bytes_read_per_iteration;
++ else if (bytes_available < socket_transport->max_bytes_read_per_iteration)
++ bytes_available = socket_transport->max_bytes_read_per_iteration;
++
+ if (_dbus_auth_needs_decoding (transport->auth))
+ {
+ /* Does fd passing even make sense with encoded data? */
+@@ -741,7 +791,7 @@ do_reading (DBusTransport *transport)
+ else
+ bytes_read = _dbus_read_socket (socket_transport->fd,
+ &socket_transport->encoded_incoming,
+- socket_transport->max_bytes_read_per_iteration);
++ bytes_available);
+
+ _dbus_assert (_dbus_string_get_length (&socket_transport->encoded_incoming) ==
+ bytes_read);
+@@ -796,7 +846,7 @@ do_reading (DBusTransport *transport)
+
+ bytes_read = _dbus_read_socket_with_unix_fds(socket_transport->fd,
+ buffer,
+- socket_transport->max_bytes_read_per_iteration,
++ bytes_available,
+ fds, &n_fds);
+
+ if (bytes_read >= 0 && n_fds > 0)
+@@ -808,7 +858,7 @@ do_reading (DBusTransport *transport)
+ #endif
+ {
+ bytes_read = _dbus_read_socket (socket_transport->fd,
+- buffer, socket_transport->max_bytes_read_per_iteration);
++ buffer, bytes_available);
+ }
+
+ _dbus_message_loader_return_buffer (transport->loader,
+@@ -1207,6 +1257,19 @@ socket_get_socket_fd (DBusTransport *transport,
+ return TRUE;
+ }
+
++static void
++socket_process_incoming_message (DBusTransport *transport,
++ DBusMessage *message)
++{
++ DBusTransportSocket *socket_transport = (DBusTransportSocket*) transport;
++
++ if (socket_transport->vtable->message_received != NULL)
++ {
++ (* socket_transport->vtable->message_received) (socket_transport,
++ message);
++ }
++}
++
+ static const DBusTransportVTable socket_vtable = {
+ socket_finalize,
+ socket_handle_watch,
+@@ -1214,37 +1277,40 @@ static const DBusTransportVTable socket_vtable = {
+ socket_connection_set,
+ socket_do_iteration,
+ socket_live_messages_changed,
+- socket_get_socket_fd
++ socket_get_socket_fd,
++ socket_process_incoming_message
+ };
+
+ /**
+- * Creates a new transport for the given socket file descriptor. The file
+- * descriptor must be nonblocking (use _dbus_set_fd_nonblocking() to
+- * make it so). This function is shared by various transports that
+- * boil down to a full duplex file descriptor.
++ * Initializes the base class members of DBusTransportSocket. Chained up to
++ * by subclasses in their constructor. The server GUID is the
++ * globally unique ID for the server creating this connection
++ * and will be #NULL for the client side of a connection. The GUID
++ * is in hex format.
+ *
+- * @param fd the file descriptor.
++ * @param socket_transport the transport being created.
++ * @param fd The socket for this transport
++ * @param vtable the subclass vtable.
+ * @param server_guid non-#NULL if this transport is on the server side of a connection
+- * @param address the transport's address
+- * @returns the new transport, or #NULL if no memory.
++ * @param address the address of the transport
++ * @returns #TRUE on success.
+ */
+-DBusTransport*
+-_dbus_transport_new_for_socket (int fd,
+- const DBusString *server_guid,
+- const DBusString *address)
++dbus_bool_t
++_dbus_transport_socket_init_base (DBusTransportSocket *socket_transport,
++ int fd,
++ const DBusTransportSocketVTable *vtable,
++ const DBusString *server_guid,
++ const DBusString *address)
+ {
+- DBusTransportSocket *socket_transport;
+-
+- socket_transport = dbus_new0 (DBusTransportSocket, 1);
+- if (socket_transport == NULL)
+- return NULL;
+-
+ if (!_dbus_string_init (&socket_transport->encoded_outgoing))
+ goto failed_0;
+
+ if (!_dbus_string_init (&socket_transport->encoded_incoming))
+ goto failed_1;
+-
++
++ socket_transport->auth_notified = FALSE;
++ socket_transport->vtable = vtable;
++
+ socket_transport->write_watch = _dbus_watch_new (fd,
+ DBUS_WATCH_WRITABLE,
+ FALSE,
+@@ -1275,7 +1341,7 @@ _dbus_transport_new_for_socket (int fd,
+ socket_transport->max_bytes_read_per_iteration = 2048;
+ socket_transport->max_bytes_written_per_iteration = 2048;
+
+- return (DBusTransport*) socket_transport;
++ return TRUE;
+
+ failed_4:
+ _dbus_watch_invalidate (socket_transport->read_watch);
+@@ -1288,8 +1354,46 @@ _dbus_transport_new_for_socket (int fd,
+ failed_1:
+ _dbus_string_free (&socket_transport->encoded_outgoing);
+ failed_0:
+- dbus_free (socket_transport);
+- return NULL;
++
++ return FALSE;
++}
++
++/**
++ * Creates a new transport for the given socket file descriptor. The file
++ * descriptor must be nonblocking (use _dbus_set_fd_nonblocking() to
++ * make it so). This function is shared by various transports that
++ * boil down to a full duplex file descriptor.
++ *
++ * @param fd the file descriptor.
++ * @param server_guid non-#NULL if this transport is on the server side of a connection
++ * @param address the transport's address
++ * @returns the new transport, or #NULL if no memory.
++ */
++DBusTransport*
++_dbus_transport_new_for_socket (int fd,
++ const DBusString *server_guid,
++ const DBusString *address)
++{
++ DBusTransportSocket *socket_transport;
++ static const DBusTransportSocketVTable vtable = {
++ NULL
++ };
++
++ socket_transport = dbus_new0 (DBusTransportSocket, 1);
++ if (socket_transport == NULL)
++ return NULL;
++
++ if (!_dbus_transport_socket_init_base (socket_transport,
++ fd,
++ &vtable,
++ server_guid,
++ address))
++ {
++ dbus_free (socket_transport);
++ return NULL;
++ }
++
++ return (DBusTransport *) socket_transport;
+ }
+
+ /**
+diff --git a/dbus/dbus-transport-socket.h b/dbus/dbus-transport-socket.h
+index 8aefae3..ed7fdcc 100644
+--- a/dbus/dbus-transport-socket.h
++++ b/dbus/dbus-transport-socket.h
+@@ -27,6 +27,80 @@
+
+ DBUS_BEGIN_DECLS
+
++/**
++ * Opaque object representing a socket file descriptor transport.
++ */
++typedef struct DBusTransportSocket DBusTransportSocket;
++
++/**
++ * The virtual table that must be implemented to
++ * create a socket-based transport.
++ */
++typedef struct DBusTransportSocketVTable DBusTransportSocketVTable;
++
++struct DBusTransportSocketVTable
++{
++ int (* write_socket) (DBusTransportSocket *socket_transport,
++ DBusMessage *message,
++ const DBusString *buffer,
++ int start,
++ int len);
++ /**< Write part of a message to the transport */
++
++ int (* write_socket_two) (DBusTransportSocket *socket_transport,
++ DBusMessage *message,
++ const DBusString *header,
++ int header_start,
++ int header_len,
++ const DBusString *body,
++ int body_start,
++ int body_len);
++ /**< Write header and body to the transport */
++
++ void (* authenticated) (DBusTransportSocket *socket_transport);
++ /**< Notification of authentication successful */
++
++ void (* message_received) (DBusTransportSocket *socket_transport,
++ DBusMessage *message);
++ /**< Notification of a message received */
++};
++
++/**
++ * Implementation details of DBusTransportSocket. All members are private.
++ */
++struct DBusTransportSocket
++{
++ DBusTransport base; /**< Parent instance */
++ int fd; /**< File descriptor. */
++ DBusWatch *read_watch; /**< Watch for readability. */
++ DBusWatch *write_watch; /**< Watch for writability. */
++
++ int max_bytes_read_per_iteration; /**< To avoid blocking too long. */
++ int max_bytes_written_per_iteration; /**< To avoid blocking too long. */
++
++ int message_bytes_written; /**< Number of bytes of current
++ * outgoing message that have
++ * been written.
++ */
++ DBusString encoded_outgoing; /**< Encoded version of current
++ * outgoing message.
++ */
++ DBusString encoded_incoming; /**< Encoded version of current
++ * incoming data.
++ */
++ dbus_bool_t auth_notified; /**< Have we notified subclasses
++ * we are authenticated?
++ */
++ const DBusTransportSocketVTable *vtable; /**< Virtual table of transport methods. */
++};
++
++dbus_bool_t _dbus_transport_socket_init_base (DBusTransportSocket *socket_transport,
++ int fd,
++ const DBusTransportSocketVTable *vtable,
++ const DBusString *server_guid,
++ const DBusString *address);
++void _dbus_transport_socket_finalize_base (DBusTransportSocket *socket_transport);
++
+ DBusTransport* _dbus_transport_new_for_socket (int fd,
+ const DBusString *server_guid,
+ const DBusString *address);
+diff --git a/dbus/dbus-transport.c b/dbus/dbus-transport.c
+index 6b58fda..44923da 100644
+--- a/dbus/dbus-transport.c
++++ b/dbus/dbus-transport.c
+@@ -25,6 +25,9 @@
+ #include "dbus-transport-protected.h"
+ #include "dbus-transport-unix.h"
+ #include "dbus-transport-socket.h"
++#ifdef HAVE_AFBUS
++#include "dbus-transport-afbus.h"
++#endif
+ #include "dbus-connection-internal.h"
+ #include "dbus-watch.h"
+ #include "dbus-auth.h"
+@@ -348,6 +351,9 @@ static const struct {
+ { _dbus_transport_open_socket },
+ { _dbus_transport_open_platform_specific },
+ { _dbus_transport_open_autolaunch }
++#ifdef HAVE_AFBUS
++ , { _dbus_transport_open_afbus }
++#endif
+ #ifdef DBUS_BUILD_TESTS
+ , { _dbus_transport_open_debug_pipe }
+ #endif
+@@ -980,6 +986,28 @@ _dbus_transport_do_iteration (DBusTransport *transport,
+ _dbus_verbose ("end\n");
+ }
+
++/**
++ * Allows transports to process incoming messages
++ *
++ * @param transport the transport.
++ * @param message the message to be filtered
++ */
++void
++_dbus_transport_process_incoming_message (DBusTransport *transport,
++ DBusMessage *message)
++{
++ _dbus_verbose ("Transport message filtering\n");
++
++ if (transport->vtable->process_incoming_message != NULL)
++ {
++ _dbus_transport_ref (transport);
++ (* transport->vtable->process_incoming_message) (transport, message);
++ _dbus_transport_unref (transport);
++ }
++
++ _dbus_verbose ("end\n");
++}
++
+ static dbus_bool_t
+ recover_unused_bytes (DBusTransport *transport)
+ {
+@@ -1134,6 +1162,7 @@ _dbus_transport_queue_messages (DBusTransport *transport)
+ _dbus_assert (link != NULL);
+
+ message = link->data;
++ _dbus_transport_process_incoming_message (transport, message);
+
+ _dbus_verbose ("queueing received message %p\n", message);
+
+diff --git a/dbus/dbus-transport.h b/dbus/dbus-transport.h
+index 4b82151..194b2c6 100644
+--- a/dbus/dbus-transport.h
++++ b/dbus/dbus-transport.h
+@@ -52,6 +52,8 @@ dbus_bool_t _dbus_transport_set_connection (DBusTransport
+ void _dbus_transport_do_iteration (DBusTransport *transport,
+ unsigned int flags,
+ int timeout_milliseconds);
++void _dbus_transport_process_incoming_message (DBusTransport *transport,
++ DBusMessage *message);
+ DBusDispatchStatus _dbus_transport_get_dispatch_status (DBusTransport *transport);
+ dbus_bool_t _dbus_transport_queue_messages (DBusTransport *transport);
+
+diff --git a/test/data/valid-config-files/basic.conf b/test/data/valid-config-files/basic.conf
+index 5297097..af46d8b 100644
+--- a/test/data/valid-config-files/basic.conf
++++ b/test/data/valid-config-files/basic.conf
+@@ -4,6 +4,8 @@
+ <user>mybususer</user>
+ <listen>unix:path=/foo/bar</listen>
+ <listen>tcp:port=1234</listen>
++ <listen_if_possible>tcp:port=1235</listen_if_possible>
++ <listen_if_possible>pigeon:port=carrier,speed=110mph</listen_if_possible>
+ <includedir>basic.d</includedir>
+ <servicedir>/usr/share/foo</servicedir>
+ <include ignore_missing="yes">nonexistent.conf</include>
diff --git a/meta-ivi/recipes-core-ivi/dbus/dbus_1.6.18.bbappend b/meta-ivi/recipes-core-ivi/dbus/dbus_1.6.18.bbappend
new file mode 100644
index 0000000..8f0fe64
--- /dev/null
+++ b/meta-ivi/recipes-core-ivi/dbus/dbus_1.6.18.bbappend
@@ -0,0 +1,18 @@
+FILESEXTRAPATHS := "${THISDIR}/${PN}"
+
+# add support for GENIVI AF_Bus D-Bus Optimization
+# - http://projects.genivi.org/afbus-dbus-optimization/
+SRC_URI_AFBUS = ""
+# currently disabled in preparation of the move to kdbus
+# uncomment the next line to reenable
+#SRC_URI_AFBUS = "file://dbus_1.6-add-afbus-support.patch"
+
+# add support for GENIVI CommonAPI D-Bus runtime
+# - http://projects.genivi.org/commonapi/
+SRC_URI_COMMONAPI = "file://dbus-DBusMessage-add-support-for-custom-marshaling.patch"
+
+SRC_URI_append = "\
+ ${SRC_URI_AFBUS} \
+ ${SRC_URI_COMMONAPI} \
+"
+
diff --git a/meta-ivi/recipes-core-ivi/eglibc/eglibc/eglibc_2.18_add_af_bus_support.patch b/meta-ivi/recipes-core-ivi/eglibc/eglibc/eglibc_2.18_add_af_bus_support.patch
new file mode 100644
index 0000000..48e8f5c
--- /dev/null
+++ b/meta-ivi/recipes-core-ivi/eglibc/eglibc/eglibc_2.18_add_af_bus_support.patch
@@ -0,0 +1,130 @@
+Index: libc/Makefile
+===================================================================
+--- libc.orig/Makefile
++++ libc/Makefile
+@@ -317,7 +317,7 @@ installed-headers = argp/argp.h assert/a
+ resource/sys/vtimes.h resource/ulimit.h rt/aio.h \
+ rt/mqueue.h setjmp/setjmp.h shadow/shadow.h \
+ signal/signal.h signal/sys/signal.h socket/sys/socket.h \
+- socket/sys/un.h stdio-common/printf.h \
++ socket/sys/un.h socket/sys/bus.h stdio-common/printf.h \
+ stdio-common/stdio_ext.h stdlib/stdlib.h stdlib/alloca.h \
+ stdlib/monetary.h stdlib/fmtmsg.h stdlib/ucontext.h \
+ sysdeps/generic/inttypes.h sysdeps/generic/stdint.h \
+Index: libc/include/sys/bus.h
+===================================================================
+--- /dev/null
++++ libc/include/sys/bus.h
+@@ -0,0 +1 @@
++#include <socket/sys/bus.h>
+Index: libc/socket/Makefile
+===================================================================
+--- libc.orig/socket/Makefile
++++ libc/socket/Makefile
+@@ -21,7 +21,7 @@
+ #
+ subdir := socket
+
+-headers := sys/socket.h sys/un.h bits/sockaddr.h bits/socket.h \
++headers := sys/socket.h sys/bus.h sys/un.h bits/sockaddr.h bits/socket.h \
+ bits/socket2.h sys/socketvar.h net/if.h
+
+ routines := accept bind connect getpeername getsockname getsockopt \
+Index: libc/socket/sys/bus.h
+===================================================================
+--- /dev/null
++++ libc/socket/sys/bus.h
+@@ -0,0 +1,57 @@
++/* Copyright (C) 1991, 1995, 1996, 2001 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library 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
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, see
++ <http://www.gnu.org/licenses/>. */
++
++#ifndef _SYS_BUS_H
++#define _SYS_BUS_H 1
++
++#include <sys/cdefs.h>
++
++/* Get the definition of the macro to define the common sockaddr members. */
++#include <bits/sockaddr.h>
++
++__BEGIN_DECLS
++
++/* 'protocol' to use in socket(AF_BUS, SOCK_SEQPACKET, protocol) */
++#define BUS_PROTO_NONE 0
++#define BUS_PROTO_DBUS 1
++#define BUS_PROTO_MAX 1
++
++/* setsockopt() operations */
++#define SOL_BUS 280
++#define BUS_ADD_ADDR 1
++#define BUS_JOIN_BUS 2
++#define BUS_DEL_ADDR 3
++#define BUS_SET_EAVESDROP 4
++#define BUS_UNSET_EAVESDROP 5
++
++/* Bus address */
++struct bus_addr
++ {
++ __uint64_t s_addr; /* 16-bit prefix + 48-bit client address */
++ };
++
++/* Structure describing an AF_BUS socket address. */
++struct sockaddr_bus
++ {
++ __SOCKADDR_COMMON (sbus_); /* AF_BUS */
++ struct bus_addr sbus_addr; /* bus address */
++ char sbus_path[108]; /* pathname */
++ };
++
++__END_DECLS
++
++#endif /* sys/bus.h */
+Index: libc/socket/sys/socket.h
+===================================================================
+--- libc.orig/socket/sys/socket.h
++++ libc/socket/sys/socket.h
+@@ -86,7 +86,8 @@ enum
+ __SOCKADDR_ONETYPE (sockaddr_iso) \
+ __SOCKADDR_ONETYPE (sockaddr_ns) \
+ __SOCKADDR_ONETYPE (sockaddr_un) \
+- __SOCKADDR_ONETYPE (sockaddr_x25)
++ __SOCKADDR_ONETYPE (sockaddr_x25) \
++ __SOCKADDR_ONETYPE (sockaddr_bus)
+
+ # define __SOCKADDR_ONETYPE(type) struct type *__restrict __##type##__;
+ typedef union { __SOCKADDR_ALLTYPES
+Index: libc/sysdeps/unix/sysv/linux/bits/socket.h
+===================================================================
+--- libc.orig/sysdeps/unix/sysv/linux/bits/socket.h
++++ libc/sysdeps/unix/sysv/linux/bits/socket.h
+@@ -80,7 +80,8 @@
+ #define PF_ALG 38 /* Algorithm sockets. */
+ #define PF_NFC 39 /* NFC sockets. */
+ #define PF_VSOCK 40 /* vSockets. */
+-#define PF_MAX 41 /* For now.. */
++#define PF_BUS 41 /* AF_BUS sockets */
++#define PF_MAX 42 /* For now.. */
+
+ /* Address families. */
+ #define AF_UNSPEC PF_UNSPEC
+@@ -125,6 +126,7 @@
+ #define AF_ALG PF_ALG
+ #define AF_NFC PF_NFC
+ #define AF_VSOCK PF_VSOCK
++#define AF_BUS PF_BUS
+ #define AF_MAX PF_MAX
+
+ /* Socket level values. Others are defined in the appropriate headers.
diff --git a/meta-ivi/recipes-core-ivi/eglibc/eglibc_2.19.bbappend b/meta-ivi/recipes-core-ivi/eglibc/eglibc_2.19.bbappend
new file mode 100644
index 0000000..fe9a29b
--- /dev/null
+++ b/meta-ivi/recipes-core-ivi/eglibc/eglibc_2.19.bbappend
@@ -0,0 +1,14 @@
+# Use local $PN directory
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+# add support for GENIVI AF_Bus D-Bus Optimization
+# - http://projects.genivi.org/afbus-dbus-optimization/
+SRC_URI_AFBUS = ""
+# currently disabled in preparation of the move to kdbus
+# uncomment the next line to reenable
+#SRC_URI_AFBUS = "file://eglibc_2.18_add_af_bus_support.patch"
+
+SRC_URI_append = "\
+ ${SRC_URI_AFBUS} \
+"
+
diff --git a/meta-ivi/recipes-extended/common-api/common-api-c++-dbus_2.1.4.bb b/meta-ivi/recipes-extended/common-api/common-api-c++-dbus_2.1.4.bb
new file mode 100644
index 0000000..d408f83
--- /dev/null
+++ b/meta-ivi/recipes-extended/common-api/common-api-c++-dbus_2.1.4.bb
@@ -0,0 +1,11 @@
+SUMMARY = "CommonAPI-DBus"
+SECTION = "libs"
+LICENSE = "MPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=815ca599c9df247a0c7f619bab123dad"
+PR = "r0"
+
+SRC_URI = "git://git.projects.genivi.org/ipc/common-api-dbus-runtime.git;protocol=http;tag=${PV}"
+S = "${WORKDIR}/git"
+
+DEPENDS = "common-api2 dbus"
+inherit autotools lib_package pkgconfig \ No newline at end of file
diff --git a/meta-ivi/recipes-extended/common-api/common-api-c++_2.1.4.bb b/meta-ivi/recipes-extended/common-api/common-api-c++_2.1.4.bb
new file mode 100644
index 0000000..7cb0dc6
--- /dev/null
+++ b/meta-ivi/recipes-extended/common-api/common-api-c++_2.1.4.bb
@@ -0,0 +1,11 @@
+SUMMARY = "CommonAPI"
+SECTION = "libs"
+LICENSE = "MPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=815ca599c9df247a0c7f619bab123dad"
+PROVIDES = "common-api2"
+PR = "r0"
+
+SRC_URI = "git://git.projects.genivi.org/ipc/common-api-runtime.git;protocol=http;tag=${PV}"
+S = "${WORKDIR}/git"
+
+inherit autotools lib_package pkgconfig \ No newline at end of file
diff --git a/meta-ivi/recipes-extended/dlt-daemon/dlt-daemon/0001-Fix-build-with-systemd-209.patch b/meta-ivi/recipes-extended/dlt-daemon/dlt-daemon/0001-Fix-build-with-systemd-209.patch
new file mode 100644
index 0000000..45a2deb
--- /dev/null
+++ b/meta-ivi/recipes-extended/dlt-daemon/dlt-daemon/0001-Fix-build-with-systemd-209.patch
@@ -0,0 +1,29 @@
+From 5ec45ad3942e55d83fd0b13ef4bafa39a54e0578 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Erik=20Bot=C3=B6?= <erik.boto@pelagicore.com>
+Date: Fri, 4 Apr 2014 10:59:18 +0200
+Subject: [PATCH] Fix build with systemd >= 209
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Erik Botö <erik.boto@pelagicore.com>
+---
+ src/system/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/system/CMakeLists.txt b/src/system/CMakeLists.txt
+index d78b2e9..b04e54b 100644
+--- a/src/system/CMakeLists.txt
++++ b/src/system/CMakeLists.txt
+@@ -23,7 +23,7 @@ set(dlt_system_SRCS dlt-system.c dlt-system-options.c dlt-system-process-handlin
+ dlt-system-syslog.c dlt-system-watchdog.c dlt-system-journal.c)
+ add_executable(dlt-system ${dlt_system_SRCS} ${systemd_SRCS})
+ if(WITH_SYSTEMD_JOURNAL)
+- target_link_libraries(dlt-system dlt z systemd-journal systemd-id128)
++ target_link_libraries(dlt-system dlt z systemd)
+ else(WITH_SYSTEMD_JOURNAL)
+ target_link_libraries(dlt-system dlt z)
+ endif(WITH_SYSTEMD_JOURNAL)
+--
+1.9.1
+
diff --git a/meta-ivi/recipes-extended/dlt-daemon/dlt-daemon/modify_systemd_config_dir.patch b/meta-ivi/recipes-extended/dlt-daemon/dlt-daemon/modify_systemd_config_dir.patch
new file mode 100644
index 0000000..b1c3ea2
--- /dev/null
+++ b/meta-ivi/recipes-extended/dlt-daemon/dlt-daemon/modify_systemd_config_dir.patch
@@ -0,0 +1,13 @@
+Index: git/systemd/CMakeLists.txt
+===================================================================
+--- git.orig/systemd/CMakeLists.txt 2013-12-03 21:32:52.000000000 +0200
++++ git/systemd/CMakeLists.txt 2013-12-03 21:33:26.000000000 +0200
+@@ -16,7 +16,7 @@
+
+ if(WITH_SYSTEMD)
+
+- set(SYSTEMD_CONFIGURATIONS_FILES_DIR ${CMAKE_INSTALL_PREFIX}/lib/systemd/system )
++ set(SYSTEMD_CONFIGURATIONS_FILES_DIR /lib/systemd/system )
+
+ if(WITH_SYSTEMD_WATCHDOG)
+ set( DLT_WatchdogSec 2 )
diff --git a/meta-ivi/recipes-extended/dlt-daemon/dlt-daemon_2.9.1.bb b/meta-ivi/recipes-extended/dlt-daemon/dlt-daemon_2.9.1.bb
new file mode 100644
index 0000000..73abdb1
--- /dev/null
+++ b/meta-ivi/recipes-extended/dlt-daemon/dlt-daemon_2.9.1.bb
@@ -0,0 +1,55 @@
+SUMMARY = "Diagnostic Log and Trace"
+DESCRIPTION = "This component provides a standardised log and trace interface, based on \
+ thestandardised protocol specified in the AUTOSAR standard 4.0 DLT.This \
+ component can be used by GENIVI components and other applications aslogging \
+ facility providing \
+ - the DLT shared library \
+ - the DLT daemon, including startup scripts \
+ - the DLT daemon adaptors- the DLT client console utilities \
+ - the DLT test applications \
+ "
+HOMEPAGE = "https://www.genivi.org/"
+SECTION = "console/utils"
+
+inherit gzipnative
+
+LICENSE = "MPLv2"
+LIC_FILES_CHKSUM = " \
+ file://LICENSE.txt;md5=99ba60c3fad7eaf8c56bca6dd75cba09 \
+ file://MPL.txt;md5=ccdb2761cef70c8b2612624c323f89dc \
+ "
+
+DEPENDS = "zlib"
+
+SRCREV = "6ab10c022d4464628fc2b848b5a56bf1eaafe857"
+PR = "r2"
+
+SRC_URI = "git://git.projects.genivi.org/${PN}.git \
+ file://modify_systemd_config_dir.patch \
+ file://0001-Fix-build-with-systemd-209.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+inherit autotools gettext cmake
+
+FILES_${PN}-doc += "/usr/share/*"
+FILES_${PN}-systemd += "${systemd_unitdir}/system/"
+
+PACKAGES =+ "${PN}-systemd"
+
+EXTRA_OECMAKE = "-DWITH_SYSTEMD=ON"
+
+# Remove "User=genivi" option from systemd services
+# as there is no such username
+do_install_append() {
+ sed -i '/User/d' ${D}/${systemd_unitdir}/system/*.service
+
+ if [ ${@base_contains('EXTRA_OECMAKE', '-DWITH_SYSTEMD=ON', 'yes', 'no', d)} = yes ]; then
+ # Install the required systemd services links
+ install -d ${D}${base_libdir}/systemd/system/basic.target.wants
+ ln -sf ../dlt.service ${D}${base_libdir}/systemd/system/basic.target.wants/dlt.service
+ ln -sf ../dlt-system.service ${D}${base_libdir}/systemd/system/basic.target.wants/dlt-system.service
+ fi
+
+}
diff --git a/meta-ivi/recipes-extended/itzamc/libitzam/libitzam_pc.patch b/meta-ivi/recipes-extended/itzamc/libitzam/libitzam_pc.patch
new file mode 100644
index 0000000..076eaff
--- /dev/null
+++ b/meta-ivi/recipes-extended/itzamc/libitzam/libitzam_pc.patch
@@ -0,0 +1,13 @@
+Index: libitzam-6.0.4/configure.ac
+===================================================================
+--- libitzam-6.0.4.orig/configure.ac 2011-09-17 20:16:04.000000000 +0300
++++ libitzam-6.0.4/configure.ac 2014-02-24 13:43:02.000000000 +0200
+@@ -1,7 +1,7 @@
+ AC_INIT(src/itzam.h)
+ AC_CONFIG_MACRO_DIR([m4])
+
+-GENERIC_LIBRARY_NAME=libitzam
++GENERIC_LIBRARY_NAME=itzam
+
+ #release versioning
+ GENERIC_MAJOR_VERSION=6
diff --git a/meta-ivi/recipes-extended/itzamc/libitzam_6.0.4.bb b/meta-ivi/recipes-extended/itzamc/libitzam_6.0.4.bb
new file mode 100644
index 0000000..db31aac
--- /dev/null
+++ b/meta-ivi/recipes-extended/itzamc/libitzam_6.0.4.bb
@@ -0,0 +1,25 @@
+SUMMARY = "itzam/C"
+
+HOMEPAGE = "https://www.genivi.org/"
+SECTION = "base"
+
+LICENSE = "Simplified BSD"
+LIC_FILES_CHKSUM = "file://LicenseOpenSource.txt;md5=757d512d8e160c938b85a8b6487cd126"
+
+SRC_URI = "http://coyotegulch.scottrobertladd.net/products/itzam/c/libitzam-6.0.4.tar.gz \
+ file://libitzam_pc.patch \
+ "
+
+SRC_URI[md5sum] = "333f680c21037e32b4000933eae27721"
+SRC_URI[sha256sum] = "d5b565a9d96275e3bf39ea2dd0b121a92b578819650a09fc5add4f4113df734d"
+
+PR = "r2"
+
+inherit autotools
+
+do_install_prepend() {
+ mkdir -p ${D}/usr/lib/pkgconfig
+ cp ${B}/libitzam.pc ${D}/usr/lib/pkgconfig
+}
+
+FILES_${PN}-dev += "/usr/lib/pkgconfig/*"
diff --git a/meta-ivi/recipes-extended/node-health-monitor/node-health-monitor/fix-no-libsystemd-daemon.patch b/meta-ivi/recipes-extended/node-health-monitor/node-health-monitor/fix-no-libsystemd-daemon.patch
new file mode 100644
index 0000000..3a7e4ac
--- /dev/null
+++ b/meta-ivi/recipes-extended/node-health-monitor/node-health-monitor/fix-no-libsystemd-daemon.patch
@@ -0,0 +1,13 @@
+Index: git/configure.ac
+===================================================================
+--- git.orig/configure.ac 2014-04-04 09:16:53.000000000 +0300
++++ git/configure.ac 2014-04-04 09:17:17.000000000 +0300
+@@ -43,7 +43,7 @@
+ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.30.0 ])
+ PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.30.0 ])
+ PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.4.10 ])
+-PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon >= 187 ])
++PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 187 ])
+ PKG_CHECK_MODULES([NSM], [node-state-manager >= 1.2.0.0])
+ PKG_CHECK_MODULES([PCL], [persistence_client_library >= 0.6.0 ])
+
diff --git a/meta-ivi/recipes-extended/node-health-monitor/node-health-monitor_1.3.3.bb b/meta-ivi/recipes-extended/node-health-monitor/node-health-monitor_1.3.3.bb
new file mode 100644
index 0000000..86d1419
--- /dev/null
+++ b/meta-ivi/recipes-extended/node-health-monitor/node-health-monitor_1.3.3.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Genivi NodeHealthMonitor"
+DESCRIPTION = "Monitor to observe system health."
+LICENSE = "MPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=815ca599c9df247a0c7f619bab123dad"
+PR = "r1"
+
+SRCREV = "e8ec4787395986599cc2c816ac2bbe56d3c85764"
+
+SRC_URI = "git://git.projects.genivi.org/lifecycle/node-health-monitor.git \
+ file://fix-no-libsystemd-daemon.patch \
+ "
+S = "${WORKDIR}/git"
+
+DEPENDS = "dlt-daemon glib-2.0 node-state-manager persistence-client-library"
+
+inherit autotools-brokensep
+
+FILES_${PN} += "\
+ ${datadir}/dbus-1/* \
+ ${systemd_unitdir}/system/* \
+ "
diff --git a/meta-ivi/recipes-extended/node-startup-controller/node-startup-controller/fix-no-libsystemd-daemon.patch b/meta-ivi/recipes-extended/node-startup-controller/node-startup-controller/fix-no-libsystemd-daemon.patch
new file mode 100644
index 0000000..27386c0
--- /dev/null
+++ b/meta-ivi/recipes-extended/node-startup-controller/node-startup-controller/fix-no-libsystemd-daemon.patch
@@ -0,0 +1,13 @@
+Index: git/configure.ac
+===================================================================
+--- git.orig/configure.ac 2014-03-26 09:25:49.000000000 +0200
++++ git/configure.ac 2014-03-26 09:26:54.000000000 +0200
+@@ -86,7 +86,7 @@
+ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.30.0])
+ PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.30.0])
+ PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0 >= 2.30.0])
+-PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon >= 183])
++PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd >= 183])
+ PKG_CHECK_MODULES([DLT], [automotive-dlt >= 2.2.0])
+
+ dnl *********************************************
diff --git a/meta-ivi/recipes-extended/node-startup-controller/node-startup-controller/use-systemd-unit-dir.patch b/meta-ivi/recipes-extended/node-startup-controller/node-startup-controller/use-systemd-unit-dir.patch
new file mode 100644
index 0000000..2520563
--- /dev/null
+++ b/meta-ivi/recipes-extended/node-startup-controller/node-startup-controller/use-systemd-unit-dir.patch
@@ -0,0 +1,26 @@
+Index: git/node-startup-controller/Makefile.am
+===================================================================
+--- git.orig/node-startup-controller/Makefile.am 2012-10-24 17:46:02.781473364 +0300
++++ git/node-startup-controller/Makefile.am 2012-10-24 17:46:36.329472165 +0300
+@@ -79,7 +79,7 @@
+
+ dbus_service_DATA = $(dbus_service_in_files:.service.in=.service)
+
+-systemd_servicedir = $(libdir)/systemd/system
++systemd_servicedir = $(systemd_unitdir)/system
+
+ systemd_service_in_files = \
+ node-startup-controller.service.in
+Index: git/nsm-dummy/Makefile.am
+===================================================================
+--- git.orig/nsm-dummy/Makefile.am 2012-10-24 17:46:16.925472859 +0300
++++ git/nsm-dummy/Makefile.am 2012-10-24 17:46:47.705471753 +0300
+@@ -56,7 +56,7 @@
+
+ dbus_service_DATA = $(dbus_service_in_files:.service.in=.service)
+
+-systemd_servicedir = ${libdir}/systemd/system
++systemd_servicedir = $(systemd_unitdir)/system
+
+ systemd_service_in_files = \
+ nsm-dummy.service.in
diff --git a/meta-ivi/recipes-extended/node-startup-controller/node-startup-controller_1.0.2.bb b/meta-ivi/recipes-extended/node-startup-controller/node-startup-controller_1.0.2.bb
new file mode 100644
index 0000000..04b0620
--- /dev/null
+++ b/meta-ivi/recipes-extended/node-startup-controller/node-startup-controller_1.0.2.bb
@@ -0,0 +1,60 @@
+DEFAULT_PREFERENCE = "-1"
+
+SUMMARY = "GENIVI Node Startup Controller"
+DESCRIPTION = "The GENIVI Node Startup Controller \
+ - manages the Last User Context (LUC) \
+ - monitors node startup \
+ and \
+ - manages legacy applications within a node \
+ "
+
+HOMEPAGE = "https://www.genivi.org/"
+SECTION = "base"
+
+LICENSE = "MPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=815ca599c9df247a0c7f619bab123dad"
+
+SRCREV = "717e743c84ef9c168501dcbc012c4212f1903581"
+PR = "r4"
+
+SRC_URI = "git://git.projects.genivi.org/lifecycle/node-startup-controller.git;branch=genivi-excalibur \
+ file://use-systemd-unit-dir.patch \
+ file://fix-no-libsystemd-daemon.patch \
+ "
+
+DEPENDS = "glib-2.0 dlt-daemon systemd"
+
+S = "${WORKDIR}/git"
+
+inherit autotools gtk-doc systemd
+do_configure_prepend () {
+ mkdir -p ${S}/m4
+}
+
+PACKAGES =+ "${PN}-nsm-dummy ${PN}-nsm-dummy-dbg"
+
+SYSTEMD_SERVICE = "node-startup-controller.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+FILES_${PN} += "\
+ ${libdir}/${PN}-1/${PN} \
+ ${libdir}/${PN}-1/legacy-app-handler \
+ ${datadir}/dbus-1/system-services/org.genivi.NodeStartupController1.service \
+ ${sysconfdir}/dbus-1/system.d/org.genivi.NodeStartupController1.conf \
+ ${systemd_unitdir}/system/node-startup-controller.service \
+ "
+
+FILES_${PN}-dbg += "\
+ ${libdir}/${PN}-1/.debug/*ler \
+ "
+
+FILES_${PN}-nsm-dummy = "\
+ ${libdir}/${PN}-1/nsm-dummy \
+ ${datadir}/dbus-1/system-services/org.genivi.NodeStateManager.* \
+ ${sysconfdir}/dbus-1/system.d/org.genivi.NodeStateManager.conf \
+ ${systemd_unitdir}/system/nsm-dummy.service \
+ "
+
+FILES_${PN}-nsm-dummy-dbg = "\
+ ${libdir}/${PN}-1/.debug/nsm-dummy \
+ "
diff --git a/meta-ivi/recipes-extended/node-startup-controller/node-startup-controller_git.bb b/meta-ivi/recipes-extended/node-startup-controller/node-startup-controller_git.bb
new file mode 100644
index 0000000..0d3b90c
--- /dev/null
+++ b/meta-ivi/recipes-extended/node-startup-controller/node-startup-controller_git.bb
@@ -0,0 +1,53 @@
+SUMMARY = "GENIVI Node Startup Controller"
+DESCRIPTION = "The GENIVI Node Startup Controller \
+ - manages the Last User Context (LUC) \
+ - monitors node startup \
+ and \
+ - manages legacy applications within a node \
+ "
+
+HOMEPAGE = "https://www.genivi.org/"
+SECTION = "base"
+
+LICENSE = "MPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=815ca599c9df247a0c7f619bab123dad"
+
+SRCREV = "958e5ab2bc93ac0d885ca75f4f33988cbdd3e758"
+PV = "1.0.0+git${SRCPV}"
+PR = "r2"
+
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI = "git://git.projects.genivi.org/lifecycle/node-startup-controller.git;protocol=git"
+
+DEPENDS = "glib-2.0 dlt-daemon systemd"
+
+S = "${WORKDIR}/git"
+
+inherit autotools gtk-doc
+do_configure_prepend () {
+ mkdir m4
+}
+
+PACKAGES =+ "${PN}-nsm-dummy ${PN}-nsm-dummy-dbg"
+
+RRECOMMENDS_${PN} += "${PN}-nsm-dummy"
+
+
+FILES_${PN} += "\
+ ${libdir}/${PN}-1/${PN} \
+ ${libdir}/${PN}-1/legacy-app-handler \
+ ${libdir}/systemd/system/${PN}.service \
+ ${datadir}/dbus-1/system-services/org.genivi.NodeStartupController1.service \
+ "
+FILES_${PN}-dbg += "\
+ ${libdir}/${PN}-1/.debug/*ler \
+ "
+FILES_${PN}-nsm-dummy = "\
+ ${libdir}/${PN}-1/nsm-dummy \
+ ${libdir}/systemd/system/nsm-dummy.service \
+ ${datadir}/dbus-1/system-services/org.genivi.NodeStateManager.* \
+ "
+FILES_${PN}-nsm-dummy-dbg = "\
+ ${libdir}/${PN}-1/.debug/nsm-dummy \
+ "
diff --git a/meta-ivi/recipes-extended/node-state-manager/node-state-manager/nsm-fix-no-libsystemd-daemon.patch b/meta-ivi/recipes-extended/node-state-manager/node-state-manager/nsm-fix-no-libsystemd-daemon.patch
new file mode 100644
index 0000000..b21ad55
--- /dev/null
+++ b/meta-ivi/recipes-extended/node-state-manager/node-state-manager/nsm-fix-no-libsystemd-daemon.patch
@@ -0,0 +1,13 @@
+Index: git/configure.ac
+===================================================================
+--- git.orig/configure.ac 2014-03-26 09:20:19.000000000 +0200
++++ git/configure.ac 2014-03-26 09:21:04.000000000 +0200
+@@ -44,7 +44,7 @@
+ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.30.0])
+ PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.30.0])
+ PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.4.10])
+-PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon >= 37 ])
++PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 37 ])
+ PKG_CHECK_MODULES([PCL], [persistence_client_library >= 0.6.0 ])
+
+ # Derive path for storing systemd service files (e. g. /lib/systemd/system)
diff --git a/meta-ivi/recipes-extended/node-state-manager/node-state-manager/nsm-fix-systemd-service-dep.patch b/meta-ivi/recipes-extended/node-state-manager/node-state-manager/nsm-fix-systemd-service-dep.patch
new file mode 100644
index 0000000..9f616f5
--- /dev/null
+++ b/meta-ivi/recipes-extended/node-state-manager/node-state-manager/nsm-fix-systemd-service-dep.patch
@@ -0,0 +1,15 @@
+Index: git/NodeStateManager/config/nodestatemanager-daemon.service.in
+===================================================================
+--- git.orig/NodeStateManager/config/nodestatemanager-daemon.service.in 2014-02-24 19:19:44.000000000 +0200
++++ git/NodeStateManager/config/nodestatemanager-daemon.service.in 2014-02-24 19:22:08.000000000 +0200
+@@ -11,8 +11,8 @@
+
+ [Unit]
+ Description=NodeStateManager to provide system states, session and shutdown handling
+-Wants=dbus.service dlt-daemon.service pas-daemon.service
+-After=dbus.service dlt-daemon.service pas-daemon.service
++Wants=dbus.service dlt.service
++After=dbus.service dlt.service
+
+ # Start up very early, because it doesn't need anything to run prior to it:
+ DefaultDependencies=no
diff --git a/meta-ivi/recipes-extended/node-state-manager/node-state-manager_2.0.0.bb b/meta-ivi/recipes-extended/node-state-manager/node-state-manager_2.0.0.bb
new file mode 100644
index 0000000..d222adf
--- /dev/null
+++ b/meta-ivi/recipes-extended/node-state-manager/node-state-manager_2.0.0.bb
@@ -0,0 +1,45 @@
+SUMMARY = "GENIVI Node State Manager"
+DESCRIPTION = "The GENIVI Node State Manager \
+ - is the central repository for information \
+ - regarding the states/sessions \
+ - inside the node. \
+ "
+
+HOMEPAGE = "https://www.genivi.org/"
+SECTION = "base"
+
+LICENSE = "MPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=815ca599c9df247a0c7f619bab123dad"
+
+SRCREV = "dd4a86b9459537d2e85489b36abf80f34d12f098"
+
+SRC_URI = "git://git.projects.genivi.org/lifecycle/node-state-manager.git \
+ file://nsm-fix-systemd-service-dep.patch \
+ file://nsm-fix-no-libsystemd-daemon.patch \
+ "
+
+PR = "r1"
+
+EXTRA_OECONF = "${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '', d)}"
+
+DEPENDS = "dbus glib-2.0 dlt-daemon persistence-client-library systemd"
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep systemd
+
+SYSTEMD_SERVICE = "nodestatemanager-daemon.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+
+do_configure_prepend() {
+ mkdir -p m4
+ mkdir -p NodeStateAccess/doc
+ mkdir -p NodeStateAccess/generated
+}
+
+FILES_${PN} += "\
+ ${datadir}/dbus-1/system-services/org.genivi.NodeStateManager.LifeCycleControl.service \
+ ${systemd_unitdir}/system/nodestatemanager-daemon.service \
+ "
+FILES_${PN}-dev += "${datadir}/dbus-1/interfaces/"
diff --git a/meta-ivi/recipes-extended/persistence-client-library/persistence-client-library_0.9.0.bb b/meta-ivi/recipes-extended/persistence-client-library/persistence-client-library_0.9.0.bb
new file mode 100644
index 0000000..6a265ca
--- /dev/null
+++ b/meta-ivi/recipes-extended/persistence-client-library/persistence-client-library_0.9.0.bb
@@ -0,0 +1,21 @@
+SUMMARY = "GENIVI Persistence Client Library"
+
+HOMEPAGE = "https://www.genivi.org/"
+SECTION = "base"
+
+LICENSE = "MPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6161c6840f21a000e9b52af81d2ca823"
+
+SRCREV = "0934ba263e69be8453cc3150f997dad28489f0c7"
+
+SRC_URI = "git://git.projects.genivi.org/persistence/persistence-client-library.git \
+ "
+PR = "r2"
+
+DEPENDS = "dbus dlt-daemon libitzam"
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep
+PARALLEL_MAKE = ""
+
diff --git a/meta-ivi/recipes-extended/shadow-securetty/shadow-securetty/vexpressa9/securetty-vea9 b/meta-ivi/recipes-extended/shadow-securetty/shadow-securetty/vexpressa9/securetty-vea9
new file mode 100644
index 0000000..64d71cb
--- /dev/null
+++ b/meta-ivi/recipes-extended/shadow-securetty/shadow-securetty/vexpressa9/securetty-vea9
@@ -0,0 +1,7 @@
+
+# vexpress A9 ports
+ttyAMA0
+ttyAMA1
+ttyAMA2
+ttyAMA3
+
diff --git a/meta-ivi/recipes-extended/shadow-securetty/shadow-securetty_4.1.4.3.bbappend b/meta-ivi/recipes-extended/shadow-securetty/shadow-securetty_4.1.4.3.bbappend
new file mode 100644
index 0000000..48a3f78
--- /dev/null
+++ b/meta-ivi/recipes-extended/shadow-securetty/shadow-securetty_4.1.4.3.bbappend
@@ -0,0 +1,7 @@
+FILESEXTRAPATHS := "${THISDIR}/${PN}"
+
+SRC_URI_append_vexpressa9 = " file://securetty-vea9"
+
+do_configure_prepend_vexpressa9 () {
+ cat ${WORKDIR}/securetty-vea9 >> ${WORKDIR}/securetty
+}
diff --git a/meta-ivi/recipes-graphics/layer-management/layer-management-git/include-unistd-for-alarm-in-example.patch b/meta-ivi/recipes-graphics/layer-management/layer-management-git/include-unistd-for-alarm-in-example.patch
new file mode 100644
index 0000000..20896b4
--- /dev/null
+++ b/meta-ivi/recipes-graphics/layer-management/layer-management-git/include-unistd-for-alarm-in-example.patch
@@ -0,0 +1,12 @@
+Index: git/LayerManagerExamples/LayerManagerControl/src/commands.cpp
+===================================================================
+--- git.orig/LayerManagerExamples/LayerManagerControl/src/commands.cpp 2012-07-12 16:51:49.695274924 +0300
++++ git/LayerManagerExamples/LayerManagerControl/src/commands.cpp 2012-07-12 16:52:03.231275452 +0300
+@@ -21,6 +21,7 @@
+ #include "ExpressionInterpreter.h"
+ #include <iostream>
+ #include <signal.h> // signal
++#include <unistd.h>
+
+ using namespace std;
+
diff --git a/meta-ivi/recipes-graphics/layer-management/layer-management-git/include-unistd-for-usleep-in-OpenGLES2App.patch b/meta-ivi/recipes-graphics/layer-management/layer-management-git/include-unistd-for-usleep-in-OpenGLES2App.patch
new file mode 100644
index 0000000..87a9379
--- /dev/null
+++ b/meta-ivi/recipes-graphics/layer-management/layer-management-git/include-unistd-for-usleep-in-OpenGLES2App.patch
@@ -0,0 +1,18 @@
+Include unistd.h in OpenGLES2App.cpp as usleep is used in code
+
+Signed-off-by: Andrei Gherzan <andrei.gherzan@windriver.com>
+Upstream-status: Pending
+
+Index: git/LayerManagerExamples/EGLX11MockNavigation/src/OpenGLES2App.cpp
+===================================================================
+--- git.orig/LayerManagerExamples/EGLX11MockNavigation/src/OpenGLES2App.cpp 2012-05-16 13:52:30.114057234 +0300
++++ git/LayerManagerExamples/EGLX11MockNavigation/src/OpenGLES2App.cpp 2012-05-16 13:52:46.674056640 +0300
+@@ -28,6 +28,8 @@
+ #include <math.h>
+ #include <sys/time.h>
+
++#include <unistd.h>
++
+ #define RUNTIME_IN_MS() (GetTickCount() - startTimeInMS)
+
+ // Max width and height of the window
diff --git a/meta-ivi/recipes-graphics/layer-management/layer-management-git/point-to-internal-CMakeVersions.patch b/meta-ivi/recipes-graphics/layer-management/layer-management-git/point-to-internal-CMakeVersions.patch
new file mode 100644
index 0000000..5fd080f
--- /dev/null
+++ b/meta-ivi/recipes-graphics/layer-management/layer-management-git/point-to-internal-CMakeVersions.patch
@@ -0,0 +1,13 @@
+Index: git/CMakeLists.txt
+===================================================================
+--- git.orig/CMakeLists.txt 2012-02-16 13:02:02.257718578 +0200
++++ git/CMakeLists.txt 2012-02-16 13:02:20.217968698 +0200
+@@ -22,7 +22,7 @@
+
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
+
+-include(${CMAKE_MODULE_PATH}/CMakeVersions.txt)
++include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/CMakeVersions.txt)
+
+ # set default build type, if not defined by user
+ if (NOT CMAKE_BUILD_TYPE)
diff --git a/meta-ivi/recipes-graphics/layer-management/layer-management/layermanager.service b/meta-ivi/recipes-graphics/layer-management/layer-management/layermanager.service
new file mode 100644
index 0000000..1540d79
--- /dev/null
+++ b/meta-ivi/recipes-graphics/layer-management/layer-management/layermanager.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=LayerManager Service from Genivi
+Requires=X.service
+After=X.service
+
+[Service]
+Type=dbus
+BusName=org.genivi.layermanagementservice
+ExecStartPre=/bin/sleep 1
+ExecStart=/usr/bin/LayerManagerService
+TimeoutSec=2s
+
+[Install]
+WantedBy=multi-user.target.wants \ No newline at end of file
diff --git a/meta-ivi/recipes-graphics/layer-management/layer-management_1.1.bb b/meta-ivi/recipes-graphics/layer-management/layer-management_1.1.bb
new file mode 100644
index 0000000..3b6e706
--- /dev/null
+++ b/meta-ivi/recipes-graphics/layer-management/layer-management_1.1.bb
@@ -0,0 +1,57 @@
+DESCRIPTION = "LayerManager"
+HOMEPAGE = "https://www.genivi.org/"
+SECTION = "environment/base"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=071e6b9a5eb9fc5868edf57ce153e5b9"
+
+DEPENDS = "virtual/egl dbus libxcomposite libxdamage"
+
+SRCREV = "5e2f490b40b8b60a0efbd2b244be44d93bc081f6"
+PR = "r1"
+
+SRC_URI = " \
+ git://git.projects.genivi.org/layer_management.git;protocol=git \
+ file://layermanager.service \
+ "
+
+S = "${WORKDIR}/git"
+
+inherit gettext cmake systemd
+
+SYSTEMD_SERVICE = "layermanager.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+EXTRA_OECMAKE += "-DWITH_EXAMPLE_SCENE_PROVIDER=ON"
+
+FILES_${PN} += " \
+ ${libdir}/lib* \
+ ${libdir}/layermanager/lib* \
+ ${libdir}/layermanager/communicator/lib* \
+ ${libdir}/layermanager/ipcmodules/lib* \
+ ${libdir}/layermanager/renderer/lib* \
+ ${libdir}/layermanager/renderer/renderer* \
+ ${libdir}/layermanager/sceneprovider/* \
+ ${systemd_unitdir}/system/layermanager.service \
+ "
+
+FILES_${PN}-dev = " \
+ ${includedir}/* \
+ "
+FILES_${PN}-staticdev += " \
+ ${libdir}/layermanager/static/lib* \
+ "
+FILES_${PN}-dbg += " \
+ ${libdir}/layermanager/.debug/ \
+ ${libdir}/layermanager/communicator/.debug/ \
+ ${libdir}/layermanager/ipcmodules/.debug/ \
+ ${libdir}/layermanager/renderer/.debug/ \
+ ${libdir}/layermanager/sceneprovider/.debug/ \
+ "
+
+do_install_append() {
+ if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/layermanager.service ${D}${systemd_unitdir}/system
+ fi
+}
diff --git a/meta-ivi/recipes-graphics/layer-management/layer-management_git.bb b/meta-ivi/recipes-graphics/layer-management/layer-management_git.bb
new file mode 100644
index 0000000..9af452d
--- /dev/null
+++ b/meta-ivi/recipes-graphics/layer-management/layer-management_git.bb
@@ -0,0 +1,56 @@
+DESCRIPTION = "LayerManager"
+
+HOMEPAGE = "https://www.genivi.org/"
+SECTION = "environment/base"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=249d3578d6bba1bb946148d367a28080"
+
+DEPENDS = "virtual/egl dbus libxcomposite"
+
+PR = "r3"
+
+SRCREV = "86c2dc9ef367b52fd5d05b53cbad5e21b9ab042f"
+
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI = "git://git.projects.genivi.org/layer_management.git;protocol=git \
+ file://point-to-internal-CMakeVersions.patch \
+ file://include-unistd-for-usleep-in-OpenGLES2App.patch \
+ file://include-unistd-for-alarm-in-example.patch \
+ file://layermanager.service \
+ "
+# Needed this for imx6 boards to use precompiled EGL libraries
+python () {
+ if ((d.getVar("MACHINE", True) or "").find("imx6") != -1):
+ flags = d.getVar("OECMAKE_CXX_FLAGS", True)
+ flags += " -DLINUX"
+ d.setVar('OECMAKE_CXX_FLAGS', flags)
+}
+
+S = "${WORKDIR}/git"
+
+inherit autotools gettext cmake
+
+do_install_append() {
+ install -d ${D}/${libdir}/systemd/system
+ install -m 0755 ${WORKDIR}/layermanager.service ${D}/${libdir}/systemd/system
+ install -m 0755 ${WORKDIR}/layermanager_demo.service ${D}/${libdir}/systemd/system
+}
+
+FILES_${PN} += "${libdir}/lib* \
+ ${libdir}/layermanager/lib* \
+ ${libdir}/layermanager/communicator/lib* \
+ ${libdir}/layermanager/ipcmodules/lib* \
+ ${libdir}/layermanager/renderer/lib* \
+ ${libdir}/layermanager/renderer/renderer* \
+ ${libdir}/systemd"
+
+FILES_${PN}-dev = "${includedir}/*"
+FILES_${PN}-staticdev += "${libdir}/layermanager/static/lib*"
+FILES_${PN}-dbg += "${libdir}/layermanager/.debug/ \
+ ${libdir}/layermanager/communicator/.debug/ \
+ ${libdir}/layermanager/ipcmodules/.debug/ \
+ ${libdir}/layermanager/renderer/.debug/ "
+
+WARN_QA = "ldflags useless-rpaths rpaths staticdev"
diff --git a/meta-ivi/recipes-graphics/wayland/wayland-ivi-extension/use_sysroot_dir.patch b/meta-ivi/recipes-graphics/wayland/wayland-ivi-extension/use_sysroot_dir.patch
new file mode 100644
index 0000000..8811879
--- /dev/null
+++ b/meta-ivi/recipes-graphics/wayland/wayland-ivi-extension/use_sysroot_dir.patch
@@ -0,0 +1,13 @@
+Index: git/weston-ivi-shell/CMakeLists.txt
+===================================================================
+--- git.orig/weston-ivi-shell/CMakeLists.txt 2014-04-04 00:15:43.000000000 +0300
++++ git/weston-ivi-shell/CMakeLists.txt 2014-04-04 00:16:20.000000000 +0300
+@@ -44,7 +44,7 @@
+ ${CAIRO_LIBRARY_DIRS}
+ ${WESTON_LIBRARY_DIRS}
+ ${PIXMAN_LIBRARY_DIRS}
+- ${WESTON_LIBDIR}/weston
++ =${WESTON_LIBDIR}/weston
+ )
+
+
diff --git a/meta-ivi/recipes-graphics/wayland/wayland-ivi-extension_1.2.0_rc1.bb b/meta-ivi/recipes-graphics/wayland/wayland-ivi-extension_1.2.0_rc1.bb
new file mode 100644
index 0000000..bd83aee
--- /dev/null
+++ b/meta-ivi/recipes-graphics/wayland/wayland-ivi-extension_1.2.0_rc1.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Wayland IVI Extension"
+DESCRIPTION = "LayerManagement API based on Wayland IVI Extension"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=176cedb32f48dd58f07e0c1c717b3ea4"
+
+SRCREV = "882e54daa1eafb56d0e7f0120db6bc36bd38d165"
+
+SRC_URI = "git://git.projects.genivi.org/wayland-ivi-extension.git \
+ file://use_sysroot_dir.patch \
+ "
+
+inherit cmake autotools
+
+DEPENDS = "weston"
+
+S = "${WORKDIR}/git"
+
+#WESTON_LIBDIR=
+
+FILES_${PN} += "${libdir}/weston/*"
+FILES_${PN}-dbg += "${libdir}/weston/.debug/*"
diff --git a/meta-ivi/recipes-graphics/wayland/weston_1.4.0.bbappend b/meta-ivi/recipes-graphics/wayland/weston_1.4.0.bbappend
new file mode 100644
index 0000000..7a8ba6f
--- /dev/null
+++ b/meta-ivi/recipes-graphics/wayland/weston_1.4.0.bbappend
@@ -0,0 +1,14 @@
+DESCRIPTION = "Weston is the reference implementation of a Wayland compositor. \
+This particular version we are using contains the IVI-Shell implementation."
+HOMEPAGE = "https://github.com/ntanibata/weston-ivi-shell"
+
+SRCREV = "71019824462597a82e71bee913f12165875e9fd2"
+
+SRC_URI_remove = "http://wayland.freedesktop.org/releases/weston-1.4.0.tar.xz"
+SRC_URI_prepend = "git://github.com/ntanibata/weston-ivi-shell.git;branch=weston-ivi-shell-1.4.0-v12;protocol=http "
+S = "${WORKDIR}/git"
+
+PR = "r1"
+
+FILES_${PN} += "${libdir}/weston/*"
+FILES_${PN}-dbg += "${libdir}/weston/.debug/*"
diff --git a/meta-ivi/recipes-graphics/xorg-xserver/xserver-xorg/X.service b/meta-ivi/recipes-graphics/xorg-xserver/xserver-xorg/X.service
new file mode 100755
index 0000000..5fa3bb3
--- /dev/null
+++ b/meta-ivi/recipes-graphics/xorg-xserver/xserver-xorg/X.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=X Server
+
+[Service]
+Type=simple
+ExecStartPre=-/bin/rm -rf /var/log/Xorg*
+ExecStart=/usr/bin/X
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file
diff --git a/meta-ivi/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend b/meta-ivi/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
new file mode 100644
index 0000000..28ccefe
--- /dev/null
+++ b/meta-ivi/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
@@ -0,0 +1,14 @@
+FILESEXTRAPATHS := "${THISDIR}/${PN}"
+
+inherit systemd
+
+SYSTEMD_SERVICE = "X.service"
+
+SRC_URI_append = " file://X.service \
+ "
+do_install_append() {
+ if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/X.service ${D}${systemd_unitdir}/system
+ fi
+}
diff --git a/meta-ivi/recipes-multimedia/audiomanager/audiomanager/AudioManager.service b/meta-ivi/recipes-multimedia/audiomanager/audiomanager/AudioManager.service
new file mode 100644
index 0000000..cc8164b
--- /dev/null
+++ b/meta-ivi/recipes-multimedia/audiomanager/audiomanager/AudioManager.service
@@ -0,0 +1,16 @@
+# Copyright (c) 2012 Wind River Systems, Inc.
+# AudioManager systemd service file
+
+[Unit]
+Description=AudioManager
+Requires=dbus.service
+After=dbus.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=true
+ExecStart=/lib/systemd/scripts/setup_amgr.sh
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/meta-ivi/recipes-multimedia/audiomanager/audiomanager/setup_amgr.sh b/meta-ivi/recipes-multimedia/audiomanager/audiomanager/setup_amgr.sh
new file mode 100755
index 0000000..07b6d5c
--- /dev/null
+++ b/meta-ivi/recipes-multimedia/audiomanager/audiomanager/setup_amgr.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+rm /tmp/session_amgr
+dbus-daemon --session --print-address --fork > /tmp/session_amgr
+export DBUS_SESSION_BUS_ADDRESS=`cat /tmp/session_amgr`
+AudioManager -d
+
diff --git a/meta-ivi/recipes-multimedia/audiomanager/audiomanager_4.2.bb b/meta-ivi/recipes-multimedia/audiomanager/audiomanager_4.2.bb
new file mode 100644
index 0000000..df163ec
--- /dev/null
+++ b/meta-ivi/recipes-multimedia/audiomanager/audiomanager_4.2.bb
@@ -0,0 +1,43 @@
+SUMMARY = "Genivi AudioManager"
+HOMEPAGE = "https://www.genivi.org/"
+SECTION = "multimedia"
+
+LICENSE = "MPLv2"
+LIC_FILES_CHKSUM = "file://LICENCE;md5=815ca599c9df247a0c7f619bab123dad"
+
+DEPENDS = "common-api-c++-dbus dlt-daemon sqlite3 dbus"
+
+SRCREV = "5588613179be49860ffb7000c21fb08d4580f383"
+PR = "r1"
+
+SRC_URI = "git://git.projects.genivi.org/AudioManager.git;branch=gemini_stable \
+ file://AudioManager.service file://setup_amgr.sh"
+
+S = "${WORKDIR}/git"
+inherit autotools gettext cmake pkgconfig systemd
+
+SYSTEMD_SERVICE = "AudioManager.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+EXTRA_OECMAKE += "-DWITH_TESTS=OFF -DUSE_BUILD_LIBS=OFF"
+OECMAKE_CXX_FLAGS +="-ldl"
+
+FILES_${PN} += "${libdir}/audioManager/command/*.so* \
+ ${libdir}/audioManager/control/*.so* \
+ ${libdir}/audioManager/routing/*.so* \
+ ${systemd_unitdir}/AudioManager.service \
+ ${systemd_unitdir}/scripts/setup_amgr.sh \
+"
+
+FILES_${PN}-dbg += "${libdir}/audioManager/command/.debug/* \
+ ${libdir}/audioManager/control/.debug/* \
+ ${libdir}/audioManager/routing/.debug/* \
+"
+do_install_append() {
+ if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ mkdir -p ${D}${systemd_unitdir}/scripts/
+ install -m 0755 ${WORKDIR}/setup_amgr.sh ${D}${systemd_unitdir}/scripts/setup_amgr.sh
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/AudioManager.service ${D}${systemd_unitdir}/system
+ fi
+}
diff --git a/meta-ivi/recipes-multimedia/audiomanager/audiomanager_git.bb b/meta-ivi/recipes-multimedia/audiomanager/audiomanager_git.bb
new file mode 100644
index 0000000..d103ba7
--- /dev/null
+++ b/meta-ivi/recipes-multimedia/audiomanager/audiomanager_git.bb
@@ -0,0 +1,44 @@
+SUMMARY = "Genivi AudioManager"
+HOMEPAGE = "https://www.genivi.org/"
+SECTION = "multimedia"
+
+LICENSE = "MPLv2"
+LIC_FILES_CHKSUM = "file://LICENCE;md5=815ca599c9df247a0c7f619bab123dad"
+
+PR = "r8"
+
+DEPENDS = "common-api-c++-dbus dlt-daemon sqlite3 dbus"
+
+SRC_URI = "git://git.projects.genivi.org/AudioManager.git;protocol=git;tag=67fd28399796590125e98fc589499e41e3026393 \
+ file://AudioManager.service file://setup_amgr.sh"
+
+S = "${WORKDIR}/git"
+inherit autotools gettext cmake pkgconfig systemd
+
+SYSTEMD_SERVICE = "AudioManager.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+DEFAULT_PREFERENCE = "-1"
+
+EXTRA_OECMAKE += "-DWITH_TESTS=OFF -DUSE_BUILD_LIBS=OFF"
+OECMAKE_CXX_FLAGS +="-ldl"
+
+FILES_${PN} += "${libdir}/audioManager/command/*.so* \
+ ${libdir}/audioManager/control/*.so* \
+ ${libdir}/audioManager/routing/*.so* \
+ ${systemd_unitdir}/AudioManager.service \
+ ${systemd_unitdir}/scripts/setup_amgr.sh \
+"
+
+FILES_${PN}-dbg += "${libdir}/audioManager/command/.debug/* \
+ ${libdir}/audioManager/control/.debug/* \
+ ${libdir}/audioManager/routing/.debug/* \
+"
+do_install_append() {
+ if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ mkdir -p ${D}${systemd_unitdir}/scripts/
+ install -m 0755 ${WORKDIR}/setup_amgr.sh ${D}${systemd_unitdir}/scripts/setup_amgr.sh
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/AudioManager.service ${D}${systemd_unitdir}/system
+ fi
+}
diff --git a/meta-ivi/recipes-multimedia/pulseaudio/pulseaudio/pulseaudio.service b/meta-ivi/recipes-multimedia/pulseaudio/pulseaudio/pulseaudio.service
new file mode 100644
index 0000000..6c10d5c
--- /dev/null
+++ b/meta-ivi/recipes-multimedia/pulseaudio/pulseaudio/pulseaudio.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=pulseaudio server
+Requires=dbus.service
+After=dbus.service
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/pulseaudio --log-level=0
+Restart=always
+RestartSec=5
+TimeoutSec=5
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file
diff --git a/meta-ivi/recipes-multimedia/pulseaudio/pulseaudio_5.0.bbappend b/meta-ivi/recipes-multimedia/pulseaudio/pulseaudio_5.0.bbappend
new file mode 100644
index 0000000..e32efa7
--- /dev/null
+++ b/meta-ivi/recipes-multimedia/pulseaudio/pulseaudio_5.0.bbappend
@@ -0,0 +1,39 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI_append = " file://pulseaudio.service"
+
+PR = "r1"
+
+inherit systemd
+
+SYSTEMD_PACKAGES = "${PN}-server"
+SYSTEMD_SERVICE = "pulseaudio.service"
+
+PACKAGECONFIG_remove = "bluez4"
+PACKAGECONFIG_append = " bluez5"
+
+RDEPENDS_pulseaudio-module-systemd-login =+ "systemd"
+RDEPENDS_pulseaudio-server += "\
+ ${@base_contains('DISTRO_FEATURES', 'x11', 'pulseaudio-module-systemd-login', '', d)}"
+
+python __anonymous () {
+ '''
+ If DISTRO_FEATURES include systemd use pulseaudio-module-systemd-login as a
+ replacer for pulseaudio-module-console-kit.
+ '''
+ distro_features = d.getVar('DISTRO_FEATURES', True).split()
+ if 'systemd' in distro_features:
+ new_rdeps = []
+ old_rdeps = d.getVar('RDEPENDS_pulseaudio-server', True).split()
+ for rdep in old_rdeps:
+ if rdep != 'pulseaudio-module-console-kit':
+ new_rdeps.append(rdep)
+ d.setVar('RDEPENDS_pulseaudio-server', ' '.join(new_rdeps))
+}
+
+do_install_append() {
+ if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/pulseaudio.service ${D}${systemd_unitdir}/system
+ fi
+}
diff --git a/meta-ivi/recipes-qt/qt4/qt4-embedded_4.8.5.bbappend b/meta-ivi/recipes-qt/qt4/qt4-embedded_4.8.5.bbappend
new file mode 100644
index 0000000..162c6ab
--- /dev/null
+++ b/meta-ivi/recipes-qt/qt4/qt4-embedded_4.8.5.bbappend
@@ -0,0 +1,22 @@
+OTHER_PACKAGES_ivi = "\
+ ${QT_BASE_NAME}-tools \
+ ${QT_BASE_NAME}-assistant \
+ ${QT_BASE_NAME}-common \
+ ${QT_BASE_NAME}-dbus \
+ ${QT_BASE_NAME}-designer \
+ ${QT_BASE_NAME}-fonts \
+ ${QT_BASE_NAME}-fonts-ttf-vera \
+ ${QT_BASE_NAME}-fonts-ttf-dejavu \
+ ${QT_BASE_NAME}-fonts-pfa \
+ ${QT_BASE_NAME}-fonts-pfb \
+ ${QT_BASE_NAME}-fonts-qpf \
+ ${QT_BASE_NAME}-linguist \
+ ${QT_BASE_NAME}-makeqpf \
+ ${QT_BASE_NAME}-mkspecs \
+ ${QT_BASE_NAME}-pixeltool \
+ ${QT_BASE_NAME}-qmlviewer \
+ ${QT_BASE_NAME}-xmlpatterns \
+ ${QT_BASE_NAME}-qt3to4 \
+ ${QT_BASE_NAME}-qml-plugins"
+
+RRECOMMENDS_${PN} = "${LIB_PACKAGES} ${OTHER_PACKAGES_ivi}"
diff --git a/meta-ivi/recipes-support-ivi/ecryptfs-utils/ecryptfs-utils/ecryptfs-fix-disable-nss.patch b/meta-ivi/recipes-support-ivi/ecryptfs-utils/ecryptfs-utils/ecryptfs-fix-disable-nss.patch
new file mode 100644
index 0000000..6105819
--- /dev/null
+++ b/meta-ivi/recipes-support-ivi/ecryptfs-utils/ecryptfs-utils/ecryptfs-fix-disable-nss.patch
@@ -0,0 +1,222 @@
+Index: ecryptfs-utils-93/src/libecryptfs/main.c
+===================================================================
+--- ecryptfs-utils-93.orig/src/libecryptfs/main.c 2011-10-27 18:53:07.000000000 +0300
++++ ecryptfs-utils-93/src/libecryptfs/main.c 2011-12-07 17:23:57.000000000 +0200
+@@ -21,8 +21,12 @@
+
+ #include "config.h"
+ #include <errno.h>
++#ifdef ENABLE_NSS
+ #include <nss.h>
+ #include <pk11func.h>
++#else
++#include <gcrypt.h>
++#endif /* #ifdef ENABLE_NSS */
+ #include <mntent.h>
+ #ifndef S_SPLINT_S
+ #include <stdio.h>
+@@ -74,7 +78,16 @@
+
+ int do_hash(char *src, int src_size, char *dst, int algo)
+ {
++#ifdef ENABLE_NSS
+ SECStatus err;
++#else
++ gcry_md_hd_t hd;
++ gcry_error_t err = 0;
++ unsigned char * hash;
++ unsigned int mdlen;
++#endif /* #ifdef ENABLE_NSS */
++
++#ifdef ENABLE_NSS
+
+ NSS_NoDB_Init(NULL);
+ err = PK11_HashBuf(algo, (unsigned char *)dst, (unsigned char *)src,
+@@ -86,6 +99,19 @@
+ err = -EINVAL;
+ goto out;
+ }
++#else
++ err = gcry_md_open(&hd, algo, 0);
++ mdlen = gcry_md_get_algo_dlen(algo);
++ if (err) {
++ syslog(LOG_ERR, "Failed to open hash algo [%d]: "
++ "[%d]\n", algo, err);
++ goto out;
++ }
++ gcry_md_write(hd, src, src_size);
++ hash = gcry_md_read(hd, algo);
++ memcpy(dst, hash, mdlen);
++ gcry_md_close(hd);
++#endif /* #ifdef ENABLE_NSS */
+ out:
+ return (int)err;
+ }
+@@ -214,7 +240,11 @@
+ char salt_and_passphrase[ECRYPTFS_MAX_PASSPHRASE_BYTES
+ + ECRYPTFS_SALT_SIZE];
+ int passphrase_size;
++#ifdef ENABLE_NSS
+ int alg = SEC_OID_SHA512;
++#else
++ int alg = GCRY_MD_SHA512;
++#endif /* #ifdef ENABLE_NSS */
+ int dig_len = SHA512_DIGEST_LENGTH;
+ char buf[SHA512_DIGEST_LENGTH];
+ int hash_iterations = ECRYPTFS_DEFAULT_NUM_HASH_ITERATIONS;
+Index: ecryptfs-utils-93/src/libecryptfs/key_management.c
+===================================================================
+--- ecryptfs-utils-93.orig/src/libecryptfs/key_management.c 2011-10-27 18:53:07.000000000 +0300
++++ ecryptfs-utils-93/src/libecryptfs/key_management.c 2011-12-07 17:38:46.000000000 +0200
+@@ -20,8 +20,12 @@
+
+ #include "config.h"
+ #include <errno.h>
++#ifdef ENABLE_NSS
+ #include <nss.h>
+ #include <pk11func.h>
++#else
++#include <gcrypt.h>
++#endif /* #ifdef ENABLE_NSS */
+ #include <keyutils.h>
+ #ifndef S_SPLINT_S
+ #include <stdio.h>
+@@ -295,6 +299,7 @@
+ ECRYPTFS_AES_BLOCK_SIZE + 1];
+ int encrypted_passphrase_pos = 0;
+ int decrypted_passphrase_pos = 0;
++#ifdef ENABLE_NSS
+ int tmp1_outlen = 0;
+ int tmp2_outlen = 0;
+ SECStatus err;
+@@ -303,6 +308,11 @@
+ PK11SlotInfo *slot = NULL;
+ PK11Context *enc_ctx = NULL;
+ SECItem *sec_param = NULL;
++#else
++#warning Building against gcrypt instead of nss
++ gcry_cipher_hd_t gcry_handle;
++ gcry_error_t gcry_err;
++#endif /* #ifdef ENABLE_NSS */
+ int encrypted_passphrase_bytes;
+ int decrypted_passphrase_bytes;
+ int fd;
+@@ -334,6 +344,7 @@
+ - (decrypted_passphrase_bytes
+ % ECRYPTFS_AES_BLOCK_SIZE));
+ encrypted_passphrase_bytes = decrypted_passphrase_bytes;
++#ifdef ENABLE_NSS
+ NSS_NoDB_Init(NULL);
+ slot = PK11_GetBestSlot(CKM_AES_ECB, NULL);
+ key_item.data = (unsigned char *)wrapping_key;
+@@ -394,6 +405,41 @@
+ rc = - EIO;
+ goto out;
+ }
++#else
++ if ((gcry_err = gcry_cipher_open(&gcry_handle, GCRY_CIPHER_AES,
++ GCRY_CIPHER_MODE_ECB, 0))) {
++ syslog(LOG_ERR, "Error attempting to initialize AES cipher; "
++ "gcry_error_t = [%d]\n", gcry_err);
++ rc = -EIO;
++ goto out;
++ }
++ if ((gcry_err = gcry_cipher_setkey(gcry_handle, wrapping_key,
++ ECRYPTFS_AES_KEY_BYTES))) {
++ syslog(LOG_ERR, "Error attempting to set AES key; "
++ "gcry_error_t = [%d]\n", gcry_err);
++ rc = -EIO;
++ gcry_cipher_close(gcry_handle);
++ goto out;
++ }
++ while (decrypted_passphrase_bytes > 0) {
++ if ((gcry_err = gcry_cipher_encrypt(
++ gcry_handle,
++ &encrypted_passphrase[encrypted_passphrase_pos],
++ ECRYPTFS_AES_BLOCK_SIZE,
++ &decrypted_passphrase[decrypted_passphrase_pos],
++ ECRYPTFS_AES_BLOCK_SIZE))) {
++ syslog(LOG_ERR, "Error attempting to encrypt block; "
++ "gcry_error = [%d]\n", gcry_err);
++ rc = -EIO;
++ gcry_cipher_close(gcry_handle);
++ goto out;
++ }
++ encrypted_passphrase_pos += ECRYPTFS_AES_BLOCK_SIZE;
++ decrypted_passphrase_pos += ECRYPTFS_AES_BLOCK_SIZE;
++ decrypted_passphrase_bytes -= ECRYPTFS_AES_BLOCK_SIZE;
++ }
++ gcry_cipher_close(gcry_handle);
++#endif /* #ifdef ENABLE_NSS */
+ unlink(filename);
+ if ((fd = open(filename, (O_WRONLY | O_CREAT | O_EXCL),
+ (S_IRUSR | S_IWUSR))) == -1) {
+@@ -439,6 +485,7 @@
+ char encrypted_passphrase[ECRYPTFS_MAX_PASSPHRASE_BYTES + 1];
+ int encrypted_passphrase_pos = 0;
+ int decrypted_passphrase_pos = 0;
++#ifdef ENABLE_NSS
+ int tmp1_outlen = 0;
+ int tmp2_outlen = 0;
+ SECStatus err;
+@@ -447,6 +494,10 @@
+ PK11SlotInfo *slot = NULL;
+ PK11Context *enc_ctx = NULL;
+ SECItem *sec_param = NULL;
++#else
++ gcry_cipher_hd_t gcry_handle;
++ gcry_error_t gcry_err;
++#endif /* #ifdef ENABLE_NSS */
+ int encrypted_passphrase_bytes;
+ int fd;
+ ssize_t size;
+@@ -493,6 +544,7 @@
+ goto out;
+ }
+ encrypted_passphrase_bytes = size;
++#ifdef ENABLE_NSS
+ NSS_NoDB_Init(NULL);
+ slot = PK11_GetBestSlot(CKM_AES_ECB, NULL);
+ key_item.data = (unsigned char *)wrapping_key;
+@@ -552,6 +604,41 @@
+ rc = - EIO;
+ goto out;
+ }
++#else
++ if ((gcry_err = gcry_cipher_open(&gcry_handle, GCRY_CIPHER_AES,
++ GCRY_CIPHER_MODE_ECB, 0))) {
++ syslog(LOG_ERR, "Error attempting to initialize AES cipher; "
++ "gcry_error_t = [%d]\n", gcry_err);
++ rc = -EIO;
++ goto out;
++ }
++ if ((gcry_err = gcry_cipher_setkey(gcry_handle, wrapping_key,
++ ECRYPTFS_AES_KEY_BYTES))) {
++ syslog(LOG_ERR, "Error attempting to set AES key; "
++ "gcry_error_t = [%d]\n", gcry_err);
++ rc = -EIO;
++ gcry_cipher_close(gcry_handle);
++ goto out;
++ }
++ memset(decrypted_passphrase, 0, ECRYPTFS_MAX_PASSPHRASE_BYTES + 1);
++ while (encrypted_passphrase_bytes > 0) {
++ if ((gcry_err = gcry_cipher_decrypt(
++ gcry_handle,
++ &decrypted_passphrase[encrypted_passphrase_pos],
++ ECRYPTFS_AES_BLOCK_SIZE,
++ &encrypted_passphrase[decrypted_passphrase_pos],
++ ECRYPTFS_AES_BLOCK_SIZE))) {
++ syslog(LOG_ERR, "Error attempting to decrypt block; "
++ "gcry_error = [%d]\n", gcry_err);
++ rc = -EIO;
++ gcry_cipher_close(gcry_handle);
++ goto out;
++ }
++ encrypted_passphrase_pos += ECRYPTFS_AES_BLOCK_SIZE;
++ decrypted_passphrase_pos += ECRYPTFS_AES_BLOCK_SIZE;
++ encrypted_passphrase_bytes -= ECRYPTFS_AES_BLOCK_SIZE;
++ }
++#endif /* #ifdef ENABLE_NSS */
+ out:
+ return rc;
+ }
diff --git a/meta-ivi/recipes-support-ivi/ecryptfs-utils/ecryptfs-utils/ecryptfs.service b/meta-ivi/recipes-support-ivi/ecryptfs-utils/ecryptfs-utils/ecryptfs.service
new file mode 100644
index 0000000..52f3397
--- /dev/null
+++ b/meta-ivi/recipes-support-ivi/ecryptfs-utils/ecryptfs-utils/ecryptfs.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=A userspace daemon that runs as the user perform file operations under the eCryptfs mount point
+After=udev.service
+
+[Service]
+ExecStart=/usr/bin/ecryptfsd -f
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/meta-ivi/recipes-support-ivi/ecryptfs-utils/ecryptfs-utils_104.bb b/meta-ivi/recipes-support-ivi/ecryptfs-utils/ecryptfs-utils_104.bb
new file mode 100644
index 0000000..5447527
--- /dev/null
+++ b/meta-ivi/recipes-support-ivi/ecryptfs-utils/ecryptfs-utils_104.bb
@@ -0,0 +1,44 @@
+SUMMARY = "A stacked cryptographic filesystem for Linux"
+DESCRIPTION = "eCryptfs stores cryptographic metadata in the header of each \
+file written, so that encrypted files can be copied between hosts; the file \
+will be decrypted with the proper key in the Linux kernel keyring"
+SECTION = "base"
+LICENSE = "GPLv2"
+DEPENDS = "intltool-native keyutils libgcrypt libpam openssl glib-2.0-native"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+
+SRC_URI = "https://launchpad.net/ecryptfs/trunk/${PV}/+download/${BPN}_${PV}.orig.tar.gz \
+ file://ecryptfs-fix-disable-nss.patch \
+ file://ecryptfs.service \
+ "
+SRC_URI[md5sum] = "6ae93822bcf0d15470516c30a3deee32"
+SRC_URI[sha256sum] = "4a200176542d46439c5297021f2c7fd7343b871c20c6f73f6e6c9fc4e5fd7438"
+
+inherit autotools systemd
+
+SYSTEMD_SERVICE = "ecryptfs.service"
+
+EXTRA_OECONF += "--disable-nss --disable-pywrap --enable-openssl --prefix=/ --sbindir=/sbin --datarootdir=/usr/share"
+EXTRA_OEMAKE += "'CFLAGS+= -lgcrypt '"
+
+FILES_${PN} += " \
+ ${libdir}/ecryptfs/* \
+ ${libdir}/security/pam_ecryptfs.so \
+ ${systemd_unitdir}/system/ecryptfs.service \
+ "
+
+FILES_${PN}-doc += " \
+ /share/locale/* \
+ "
+
+FILES_${PN}-dbg += "${libdir}/ecryptfs/.debug \
+ ${libdir}/security/.debug \
+ "
+do_install_append() {
+ if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/ecryptfs.service ${D}${systemd_unitdir}/system
+ fi
+}
diff --git a/meta-ivi/recipes-support-ivi/fuse/files/aarch64.patch b/meta-ivi/recipes-support-ivi/fuse/files/aarch64.patch
new file mode 100644
index 0000000..050d114
--- /dev/null
+++ b/meta-ivi/recipes-support-ivi/fuse/files/aarch64.patch
@@ -0,0 +1,33 @@
+fuse: add aarch64 support
+
+u64/u32 is not defined in sys/types.h, include linux/types.h like
+the kernel version of fuse.h does. Patch sent to upstream mailing list.
+
+Upstream-Status: Submitted
+Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ include/fuse_kernel.h | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/include/fuse_kernel.h b/include/fuse_kernel.h
+index c632b58..e804278 100644
+--- a/include/fuse_kernel.h
++++ b/include/fuse_kernel.h
+@@ -88,12 +88,7 @@
+ #ifndef _LINUX_FUSE_H
+ #define _LINUX_FUSE_H
+
+-#include <sys/types.h>
+-#define __u64 uint64_t
+-#define __s64 int64_t
+-#define __u32 uint32_t
+-#define __s32 int32_t
+-#define __u16 uint16_t
++#include <linux/types.h>
+
+ /*
+ * Version negotiation:
+--
+1.8.1.2
+
diff --git a/meta-ivi/recipes-support-ivi/fuse/files/gold-unversioned-symbol.patch b/meta-ivi/recipes-support-ivi/fuse/files/gold-unversioned-symbol.patch
new file mode 100644
index 0000000..d47f692
--- /dev/null
+++ b/meta-ivi/recipes-support-ivi/fuse/files/gold-unversioned-symbol.patch
@@ -0,0 +1,92 @@
+fuse: Fix linking issues with gold linker
+
+fuse has problems when linking with gold since it uses version
+scripts in a way thats so perticular to bfd ld
+
+/home/kraj/work/angstrom/build/tmp-angstrom_2010_x-eglibc/sysroots/x86_64-linux/usr/libexec/armv5te-angstrom-linux-gnueabi/gcc/arm-angstro
+error: symbol __fuse_exited has undefined version
+| collect2: ld returned 1 exit status
+| make[1]: *** [libfuse.la] Error 1
+| make[1]: *** Waiting for unfinished jobs....
+
+For more details
+
+http://blog.flameeyes.eu/2011/06/01/gold-readiness-obstacle-2-base-versioning
+http://sources.redhat.com/bugzilla/show_bug.cgi?id=10861
+http://comments.gmane.org/gmane.comp.file-systems.fuse.devel/9524
+http://www.airs.com/blog/archives/300
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ lib/fuse.c | 10 +++++-----
+ lib/fuse_mt.c | 2 +-
+ lib/fuse_versionscript | 3 +++
+ lib/helper.c | 6 +++---
+ 4 files changed, 12 insertions(+), 9 deletions(-)
+
+diff --git a/lib/fuse.c b/lib/fuse.c
+index 067d0dc..6d27711 100644
+--- a/lib/fuse.c
++++ b/lib/fuse.c
+@@ -4873,11 +4873,11 @@ struct fuse *fuse_new_compat1(int fd, int flags,
+ 11);
+ }
+
+-FUSE_SYMVER(".symver fuse_exited,__fuse_exited@");
+-FUSE_SYMVER(".symver fuse_process_cmd,__fuse_process_cmd@");
+-FUSE_SYMVER(".symver fuse_read_cmd,__fuse_read_cmd@");
+-FUSE_SYMVER(".symver fuse_set_getcontext_func,__fuse_set_getcontext_func@");
+-FUSE_SYMVER(".symver fuse_new_compat2,fuse_new@");
++FUSE_SYMVER(".symver fuse_exited,__fuse_exited@FUSE_UNVERSIONED");
++FUSE_SYMVER(".symver fuse_process_cmd,__fuse_process_cmd@FUSE_UNVERSIONED");
++FUSE_SYMVER(".symver fuse_read_cmd,__fuse_read_cmd@FUSE_UNVERSIONED");
++FUSE_SYMVER(".symver fuse_set_getcontext_func,__fuse_set_getcontext_func@FUSE_UNVERSIONED");
++FUSE_SYMVER(".symver fuse_new_compat2,fuse_new@FUSE_UNVERSIONED");
+ FUSE_SYMVER(".symver fuse_new_compat22,fuse_new@FUSE_2.2");
+
+ #endif /* __FreeBSD__ || __NetBSD__ */
+diff --git a/lib/fuse_mt.c b/lib/fuse_mt.c
+index f6dbe71..fd5ac23 100644
+--- a/lib/fuse_mt.c
++++ b/lib/fuse_mt.c
+@@ -119,4 +119,4 @@ int fuse_loop_mt(struct fuse *f)
+ return res;
+ }
+
+-FUSE_SYMVER(".symver fuse_loop_mt_proc,__fuse_loop_mt@");
++FUSE_SYMVER(".symver fuse_loop_mt_proc,__fuse_loop_mt@FUSE_UNVERSIONED");
+diff --git a/lib/fuse_versionscript b/lib/fuse_versionscript
+index 8d91887..de16ab2 100644
+--- a/lib/fuse_versionscript
++++ b/lib/fuse_versionscript
+@@ -1,3 +1,6 @@
++FUSE_UNVERSIONED {
++};
++
+ FUSE_2.2 {
+ global:
+ fuse_destroy;
+diff --git a/lib/helper.c b/lib/helper.c
+index b644012..c5349bf 100644
+--- a/lib/helper.c
++++ b/lib/helper.c
+@@ -436,10 +436,10 @@ int fuse_mount_compat1(const char *mountpoint, const char *args[])
+ return fuse_mount_compat22(mountpoint, NULL);
+ }
+
+-FUSE_SYMVER(".symver fuse_setup_compat2,__fuse_setup@");
++FUSE_SYMVER(".symver fuse_setup_compat2,__fuse_setup@FUSE_UNVERSIONED");
+ FUSE_SYMVER(".symver fuse_setup_compat22,fuse_setup@FUSE_2.2");
+-FUSE_SYMVER(".symver fuse_teardown,__fuse_teardown@");
+-FUSE_SYMVER(".symver fuse_main_compat2,fuse_main@");
++FUSE_SYMVER(".symver fuse_teardown,__fuse_teardown@FUSE_UNVERSIONED");
++FUSE_SYMVER(".symver fuse_main_compat2,fuse_main@FUSE_UNVERSIONED");
+ FUSE_SYMVER(".symver fuse_main_real_compat22,fuse_main_real@FUSE_2.2");
+
+ #endif /* __FreeBSD__ || __NetBSD__ */
+--
+1.8.1.2
+
diff --git a/meta-ivi/recipes-support-ivi/fuse/fuse_2.9.3.bb b/meta-ivi/recipes-support-ivi/fuse/fuse_2.9.3.bb
new file mode 100644
index 0000000..358b58e
--- /dev/null
+++ b/meta-ivi/recipes-support-ivi/fuse/fuse_2.9.3.bb
@@ -0,0 +1,43 @@
+SUMMARY = "With FUSE it is possible to implement a fully functional filesystem in a userspace program"
+DESCRIPTION = "FUSE (Filesystem in Userspace) is a simple interface for userspace \
+programs to export a virtual filesystem to the Linux kernel. FUSE \
+also aims to provide a secure method for non privileged users to \
+create and mount their own filesystem implementations. \
+"
+HOMEPAGE = "http://fuse.sf.net"
+SECTION = "libs"
+LICENSE = "GPLv2 & LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/fuse/fuse-${PV}.tar.gz \
+ file://gold-unversioned-symbol.patch \
+ file://aarch64.patch \
+"
+SRC_URI[md5sum] = "33cae22ca50311446400daf8a6255c6a"
+SRC_URI[sha256sum] = "0beb83eaf2c5e50730fc553406ef124d77bc02c64854631bdfc86bfd6437391c"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--disable-kernel-module"
+
+PACKAGES =+ "fuse-utils-dbg fuse-utils libulockmgr libulockmgr-dev libulockmgr-dbg"
+
+RRECOMMENDS_${PN} = "kernel-module-fuse"
+
+FILES_${PN} += "${libdir}/libfuse.so.*"
+FILES_${PN}-dev += "${libdir}/libfuse*.la"
+
+FILES_libulockmgr = "${libdir}/libulockmgr.so.*"
+FILES_libulockmgr-dev += "${libdir}/libulock*.la"
+FILES_libulockmgr-dbg += "${libdir}/.debug/libulock*"
+
+# Forbid auto-renaming to libfuse-utils
+FILES_fuse-utils = "${bindir} ${base_sbindir}"
+FILES_fuse-utils-dbg = "${bindir}/.debug ${base_sbindir}/.debug"
+DEBIAN_NOAUTONAME_fuse-utils = "1"
+DEBIAN_NOAUTONAME_fuse-utils-dbg = "1"
+
+do_install_append() {
+ rm -rf ${D}${base_prefix}/dev
+}
diff --git a/meta-ivi/recipes-support-ivi/keyutils/keyutils/keyutils-arm-remove-m32-m64.patch b/meta-ivi/recipes-support-ivi/keyutils/keyutils/keyutils-arm-remove-m32-m64.patch
new file mode 100644
index 0000000..a049fd2
--- /dev/null
+++ b/meta-ivi/recipes-support-ivi/keyutils/keyutils/keyutils-arm-remove-m32-m64.patch
@@ -0,0 +1,19 @@
+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-ivi/recipes-support-ivi/keyutils/keyutils/keyutils_fix_library_install.patch b/meta-ivi/recipes-support-ivi/keyutils/keyutils/keyutils_fix_library_install.patch
new file mode 100644
index 0000000..adf0643
--- /dev/null
+++ b/meta-ivi/recipes-support-ivi/keyutils/keyutils/keyutils_fix_library_install.patch
@@ -0,0 +1,30 @@
+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-ivi/recipes-support-ivi/keyutils/keyutils/keyutils_fix_x86-64_cflags.patch b/meta-ivi/recipes-support-ivi/keyutils/keyutils/keyutils_fix_x86-64_cflags.patch
new file mode 100644
index 0000000..8dd2245
--- /dev/null
+++ b/meta-ivi/recipes-support-ivi/keyutils/keyutils/keyutils_fix_x86-64_cflags.patch
@@ -0,0 +1,13 @@
+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-ivi/recipes-support-ivi/keyutils/keyutils/keyutils_fix_x86_cflags.patch b/meta-ivi/recipes-support-ivi/keyutils/keyutils/keyutils_fix_x86_cflags.patch
new file mode 100644
index 0000000..573c429
--- /dev/null
+++ b/meta-ivi/recipes-support-ivi/keyutils/keyutils/keyutils_fix_x86_cflags.patch
@@ -0,0 +1,13 @@
+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-ivi/recipes-support-ivi/keyutils/keyutils_1.5.8.bb b/meta-ivi/recipes-support-ivi/keyutils/keyutils_1.5.8.bb
new file mode 100644
index 0000000..964160d
--- /dev/null
+++ b/meta-ivi/recipes-support-ivi/keyutils/keyutils_1.5.8.bb
@@ -0,0 +1,29 @@
+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"
+
+inherit autotools
+
+INSTALL_FLAGS = "BINDIR=/usr/bin SBINDIR=/usr/sbin DESTDIR=${D}"
+
+do_install() {
+ cd ${S} && oe_runmake ${INSTALL_FLAGS} install
+}
diff --git a/meta-ivi/recipes-yocto-ivi/images/ivi-image.bb b/meta-ivi/recipes-yocto-ivi/images/ivi-image.bb
new file mode 100644
index 0000000..c4de687
--- /dev/null
+++ b/meta-ivi/recipes-yocto-ivi/images/ivi-image.bb
@@ -0,0 +1,12 @@
+# Base this image on generic IVI image
+include recipes-yocto-ivi/images/ivi-image.inc
+
+PV = "6.0.1"
+
+IMAGE_INSTALL_append = " \
+ packagegroup-abstract-component-p1 \
+ packagegroup-placeholder-component-p1 \
+ packagegroup-specific-component-p2 \
+ packagegroup-abstract-component-p2 \
+ packagegroup-specific-component-p1 \
+"
diff --git a/meta-ivi/recipes-yocto-ivi/images/ivi-image.inc b/meta-ivi/recipes-yocto-ivi/images/ivi-image.inc
new file mode 100644
index 0000000..2ec2be7
--- /dev/null
+++ b/meta-ivi/recipes-yocto-ivi/images/ivi-image.inc
@@ -0,0 +1,19 @@
+IMAGE_INSTALL = "packagegroup-core-boot-genivi ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMAGE_EXTRA_INSTALL}"
+
+EXTRA_IMAGE_FEATURES = "debug-tweaks"
+EXTRA_IMAGEDEPENDS += "qemu-native qemu-helper-native"
+
+IMAGE_LINGUAS = " "
+
+LICENSE = "MIT"
+
+inherit core-image buildhistory
+
+IMAGE_ROOTFS_SIZE = "8192"
+
+IMAGE_FEATURES += " package-management"
+
+# Create SD image symlink correctly
+IMAGE_POSTPROCESS_COMMAND_imx53qsb += "rename_symlink ; "
+
+BUILDHISTORY_COMMIT = "1"
diff --git a/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-abstract-component-p1.bb b/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-abstract-component-p1.bb
new file mode 100644
index 0000000..f092fe2
--- /dev/null
+++ b/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-abstract-component-p1.bb
@@ -0,0 +1,23 @@
+DESCRIPTION = "GENIVI P1 Abstract components (AC)"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${IVI_COREBASE}/meta-ivi/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+# Avoid hardcoding the full layer path into the checksums
+LIC_FILES_CHKSUM[vardepsexclude] += "IVI_COREBASE"
+PR = "r0"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-abstract-component-p1 \
+ "
+
+ALLOW_EMPTY_${PN} = "1"
+
+RDEPENDS_${PN} += "\
+ bluez5 \
+ bluez5-obex \
+ eglibc \
+ ofono \
+ wayland-ivi-extension \
+ weston \
+ "
diff --git a/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-abstract-component-p2.bb b/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-abstract-component-p2.bb
new file mode 100644
index 0000000..3a7abb0
--- /dev/null
+++ b/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-abstract-component-p2.bb
@@ -0,0 +1,20 @@
+DESCRIPTION = "GENIVI P2 Abstract components (AC)"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${IVI_COREBASE}/meta-ivi/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+# Avoid hardcoding the full layer path into the checksums
+LIC_FILES_CHKSUM[vardepsexclude] += "IVI_COREBASE"
+PR = "r0"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-abstract-component-p2 \
+ "
+
+ALLOW_EMPTY_${PN} = "1"
+
+
+RDEPENDS_${PN} += "\
+ node-health-monitor \
+ persistence-client-library \
+ "
diff --git a/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-core-boot-genivi.bb b/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-core-boot-genivi.bb
new file mode 100644
index 0000000..40dcaf4
--- /dev/null
+++ b/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-core-boot-genivi.bb
@@ -0,0 +1,49 @@
+#
+# Contains changes by Wind River Systems, 2013-08-08
+# Copyright (c) 2013 Wind River Systems, Inc.
+# Copyright (C) 2007 OpenedHand Ltd.
+#
+# derived from oe-core: meta/recipes-core/packagegroups/packagegroup-core-boot.bb
+
+SUMMARY = "Minimal boot requirements"
+DESCRIPTION = "The minimal set of packages required to boot the system"
+LICENSE = "MIT"
+DEPENDS = "virtual/kernel"
+PR = "r11"
+
+inherit packagegroup
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+#
+# Set by the machine configuration with packages essential for device bootup
+#
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= ""
+MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
+
+# Distro can override the following VIRTUAL-RUNTIME providers:
+VIRTUAL-RUNTIME_dev_manager ?= "udev"
+VIRTUAL-RUNTIME_login_manager ?= "busybox"
+VIRTUAL-RUNTIME_init_manager ?= "systemd"
+VIRTUAL-RUNTIME_initscripts ?= ""
+VIRTUAL-RUNTIME_keymaps ?= "keymaps"
+
+RDEPENDS_${PN} = "\
+ base-files \
+ base-passwd \
+ busybox \
+ ${@base_contains("MACHINE_FEATURES", "keyboard", "${VIRTUAL-RUNTIME_keymaps}", "", d)} \
+ netbase \
+ ${VIRTUAL-RUNTIME_login_manager} \
+ ${VIRTUAL-RUNTIME_init_manager} \
+ ${VIRTUAL-RUNTIME_initscripts} \
+ ${VIRTUAL-RUNTIME_dev_manager} \
+ ${VIRTUAL-RUNTIME_update-alternatives} \
+ ${MACHINE_ESSENTIAL_EXTRA_RDEPENDS} \
+ kmod \
+ procps \
+ util-linux-mount \
+ "
+
+RRECOMMENDS_${PN} = "\
+ ${MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS}"
diff --git a/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-placeholder-component-p1.bb b/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-placeholder-component-p1.bb
new file mode 100644
index 0000000..f4501f0
--- /dev/null
+++ b/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-placeholder-component-p1.bb
@@ -0,0 +1,18 @@
+DESCRIPTION = "GENIVI P1 Placeholder components (PC)"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${IVI_COREBASE}/meta-ivi/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+# Avoid hardcoding the full layer path into the checksums
+LIC_FILES_CHKSUM[vardepsexclude] += "IVI_COREBASE"
+PR = "r0"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-placeholder-component-p1 \
+ "
+
+ALLOW_EMPTY_${PN} = "1"
+
+
+RDEPENDS_${PN} += "\
+ "
diff --git a/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-specific-component-p1.bb b/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-specific-component-p1.bb
new file mode 100644
index 0000000..cee6149
--- /dev/null
+++ b/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-specific-component-p1.bb
@@ -0,0 +1,38 @@
+DESCRIPTION = "GENIVI P1 Specific components (SC)"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${IVI_COREBASE}/meta-ivi/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+# Avoid hardcoding the full layer path into the checksums
+LIC_FILES_CHKSUM[vardepsexclude] += "IVI_COREBASE"
+PR = "r0"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-specific-component-p1 \
+ "
+
+ALLOW_EMPTY_${PN} = "1"
+
+
+RDEPENDS_${PN} += "\
+ kernel-modules \
+ audiomanager \
+ common-api-c++ \
+ dlt-daemon \
+ dlt-daemon-systemd \
+ alsa-lib \
+ alsa-utils \
+ connman \
+ curl \
+ dbus \
+ ecryptfs-utils \
+ gstreamer \
+ gst-plugins-good \
+ gst-plugins-base \
+ libusb1 \
+ node-startup-controller \
+ node-state-manager \
+ openssl \
+ udev \
+ wpa-supplicant \
+ "
diff --git a/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-specific-component-p2.bb b/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-specific-component-p2.bb
new file mode 100644
index 0000000..c098b09
--- /dev/null
+++ b/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-specific-component-p2.bb
@@ -0,0 +1,25 @@
+DESCRIPTION = "GENIVI P2 Specific components (SC)"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${IVI_COREBASE}/meta-ivi/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+# Avoid hardcoding the full layer path into the checksums
+LIC_FILES_CHKSUM[vardepsexclude] += "IVI_COREBASE"
+PR = "r0"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-specific-component-p2 \
+ "
+
+ALLOW_EMPTY_${PN} = "1"
+
+
+RDEPENDS_${PN} += "\
+ common-api-c++-dbus \
+ fuse \
+ pulseaudio-server \
+ quota \
+ sqlite3 \
+ wireless-tools \
+ "
+
diff --git a/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-xserver-ivi.bb b/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-xserver-ivi.bb
new file mode 100644
index 0000000..2ada89e
--- /dev/null
+++ b/meta-ivi/recipes-yocto-ivi/packagegroups/packagegroup-xserver-ivi.bb
@@ -0,0 +1,19 @@
+DESCRIPTION = "Packagegroup for xserver and GPU drivers"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${IVI_COREBASE}/meta-ivi/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+# Avoid hardcoding the full layer path into the checksums
+LIC_FILES_CHKSUM[vardepsexclude] += "IVI_COREBASE"
+
+inherit packagegroup
+
+XSERVER ?= "xserver-xorg \
+ xf86-input-evdev \
+ xf86-input-mouse \
+ xf86-video-fbdev \
+ xf86-input-keyboard \
+ "
+
+RDEPENDS_${PN} = " \
+ ${XSERVER}"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"