diff --git a/kura/distrib/src/main/ant/build_equinox_distrib.xml b/kura/distrib/src/main/ant/build_equinox_distrib.xml
index ba53f795183..7261a9b647f 100644
--- a/kura/distrib/src/main/ant/build_equinox_distrib.xml
+++ b/kura/distrib/src/main/ant/build_equinox_distrib.xml
@@ -16,6 +16,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -31,6 +45,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -128,100 +155,100 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -229,9 +256,6 @@
value="file:${kura.install.dir}/${kura.symlink}/packages/${build.output.name}.dp" />
-
-
-
/tmp/.kura/configuration/config.ini
KURA_RUNNING=`ps ax | grep java | grep "org.eclipse.equinox"`
@@ -297,7 +321,7 @@ cd $DIR
# set up the configuration area
mkdir -p /tmp/.kura/configuration
-cp ${DIR}/framework/config.ini /tmp/.kura/configuration/
+${DIR}/bin/gen_config_ini.sh ${DIR}/framework/config.ini ${DIR}/plugins > /tmp/.kura/configuration/config.ini
KURA_RUNNING=`ps ax | grep java | grep "org.eclipse.equinox"`
@@ -354,7 +378,7 @@ cd $DIR
# set up the configuration area
mkdir -p /tmp/.kura/configuration
-cp ${DIR}/framework/config.ini /tmp/.kura/configuration/
+${DIR}/bin/gen_config_ini.sh ${DIR}/framework/config.ini ${DIR}/plugins > /tmp/.kura/configuration/config.ini
KURA_RUNNING=`ps ax | grep java | grep "org.eclipse.equinox"`
@@ -525,6 +549,10 @@ fi]]>
file="${project.build.directory}/${build.output.name}/start_kura_background.sh"
fullpath="${build.output.name}/${binary.folder}/start_kura_background.sh"
filemode="777" />
+
@@ -538,179 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-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kura/distrib/src/main/resources/common/gen_config_ini.sh b/kura/distrib/src/main/resources/common/gen_config_ini.sh
new file mode 100644
index 00000000000..37820042b55
--- /dev/null
+++ b/kura/distrib/src/main/resources/common/gen_config_ini.sh
@@ -0,0 +1,72 @@
+#!/bin/sh
+
+TEMPLATE=$1
+ROOT=$2
+
+usage() {
+ >&2 echo "Usage: gen_config_ini.sh "
+}
+
+abspath() {
+ cd "${1}" || exit 1
+ RESULT="${PWD}"
+ cd "${OLDPWD}" || exit 1
+ echo "${RESULT}"
+}
+
+if ! [ -e "${TEMPLATE}" ]
+then
+ >&2 echo "config.ini template not found"
+ usage
+ exit 1
+fi
+
+if ! [ -d "${ROOT}" ]
+then
+ >&2 echo "plugin root directory not found"
+ usage
+ exit 1
+fi
+
+ROOT=$(abspath "${ROOT}")
+
+OSGI_BUNDLES=
+
+for DIR_PATH in "${ROOT}"/*
+do
+ DIR_NAME=$(basename -- "${DIR_PATH}")
+
+ if [ "${#DIR_NAME}" = 0 ] || [ "${#DIR_NAME}" -gt 2 ] || ! [ -d "${DIR_PATH}" ]
+ then
+ continue
+ fi
+
+ if ! expr "${DIR_NAME}" : '^[0-9]\{1,\}s\{0,1\}$' > /dev/null
+ then
+ continue
+ fi
+
+ START_LEVEL="${DIR_NAME%s}"
+
+ if [ "${#DIR_NAME}" = "${#START_LEVEL}" ]
+ then
+ START=
+ else
+ START="\:start"
+ fi
+
+ for JAR in "${DIR_PATH}"/*.jar
+ do
+ if [ -n "${OSGI_BUNDLES}" ]
+ then
+ OSGI_BUNDLES="${OSGI_BUNDLES},"
+ fi
+
+ OSGI_BUNDLES="${OSGI_BUNDLES}reference\:file\:${JAR}@${START_LEVEL}${START}"
+ done
+
+done
+
+cat "${TEMPLATE}"
+echo
+echo "osgi.bundles=${OSGI_BUNDLES}"
\ No newline at end of file
diff --git a/kura/distrib/src/main/resources/docker-alpine-x86_64-nn/bin/add-config-ini b/kura/distrib/src/main/resources/docker-alpine-x86_64-nn/bin/add-config-ini
index 87025e328c4..e04e7929979 100644
--- a/kura/distrib/src/main/resources/docker-alpine-x86_64-nn/bin/add-config-ini
+++ b/kura/distrib/src/main/resources/docker-alpine-x86_64-nn/bin/add-config-ini
@@ -3,5 +3,6 @@
set -e
for i in $*; do
+ echo >> "${KURA_DIR}/framework/config.ini"
echo "$i" >> "${KURA_DIR}/framework/config.ini"
done
diff --git a/kura/distrib/src/main/resources/docker-alpine-x86_64-nn/bin/start-kura b/kura/distrib/src/main/resources/docker-alpine-x86_64-nn/bin/start-kura
index 73e46b6f2ec..d978e19ac55 100644
--- a/kura/distrib/src/main/resources/docker-alpine-x86_64-nn/bin/start-kura
+++ b/kura/distrib/src/main/resources/docker-alpine-x86_64-nn/bin/start-kura
@@ -13,7 +13,7 @@ if [ $JAVA_VERSION_NUM -gt 001008 ] ; then
fi
mkdir -p /tmp/.kura/configuration
-cp "${KURA_DIR}/framework/config.ini" /tmp/.kura/configuration/
+"${KURA_DIR}/bin/gen_config_ini.sh" "${KURA_DIR}"/framework/config.ini "${KURA_DIR}"/plugins > /tmp/.kura/configuration/config.ini
JAVA_INT_OPTS="$JAVA_INT_OPTS -XX:+IgnoreUnrecognizedVMOptions"
diff --git a/kura/distrib/src/main/resources/docker-ubi8-x86_64-nn/bin/add-config-ini b/kura/distrib/src/main/resources/docker-ubi8-x86_64-nn/bin/add-config-ini
index 87025e328c4..e04e7929979 100644
--- a/kura/distrib/src/main/resources/docker-ubi8-x86_64-nn/bin/add-config-ini
+++ b/kura/distrib/src/main/resources/docker-ubi8-x86_64-nn/bin/add-config-ini
@@ -3,5 +3,6 @@
set -e
for i in $*; do
+ echo >> "${KURA_DIR}/framework/config.ini"
echo "$i" >> "${KURA_DIR}/framework/config.ini"
done
diff --git a/kura/distrib/src/main/resources/docker-ubi8-x86_64-nn/bin/start-kura b/kura/distrib/src/main/resources/docker-ubi8-x86_64-nn/bin/start-kura
index 15c99374cf2..d423f3379e3 100644
--- a/kura/distrib/src/main/resources/docker-ubi8-x86_64-nn/bin/start-kura
+++ b/kura/distrib/src/main/resources/docker-ubi8-x86_64-nn/bin/start-kura
@@ -13,7 +13,7 @@ if [ $JAVA_VERSION_NUM -gt 001008 ] ; then
fi
mkdir -p /tmp/.kura/configuration
-cp "${KURA_DIR}/framework/config.ini" /tmp/.kura/configuration/
+"${KURA_DIR}/bin/gen_config_ini.sh" "${KURA_DIR}"/framework/config.ini "${KURA_DIR}"/plugins > /tmp/.kura/configuration/config.ini
JAVA_INT_OPTS="$JAVA_INT_OPTS -XX:+IgnoreUnrecognizedVMOptions"
diff --git a/target-platform/p2-repo-common/pom.xml b/target-platform/p2-repo-common/pom.xml
index 58d79a610cd..0c18491d92f 100644
--- a/target-platform/p2-repo-common/pom.xml
+++ b/target-platform/p2-repo-common/pom.xml
@@ -667,26 +667,28 @@
+
-
+
-
-
-
-
-
+
+
+
+
+
-
+
+
@@ -704,6 +706,7 @@
+
@@ -717,30 +720,33 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -750,7 +756,7 @@
-
+