These paths are now set by the SDK installation process, but you must include environment variables to reference them. This topic gives some background on the reason for the changes, and provides a checklist you can follow to modify your environment.
/packages/mnt/package-name/*
upon installation, and symlinks were created in /opt/sdk/*
or /opt/sbin/*
. The decision on whether the files should reside in /opt/sdk
or /opt/sbin
was up to the owner of the application's manifest. In general, files for RE SDK applications were kept in /opt/sbin
, whereas files for Services SDK applications resided in /opt/sdk
.
When two different packages A and B, from two different providers, were installed on the same router, the packages were mounted at /packages/mnt/A/*
and /packages/mnt/B/*
. The symlinks were created in /opt/sbin/*
. If both A and B contained an application with the same name (AppC) and the manifest entries said it should be stored in /opt/sbin/*
, the two applications with the same name would go to the same location /opt/sbin/AppC
, causing a collision.
To address this problem, Release 9.6 creates provider-prefix-specific directories for the symlinks. For example, if package A comes from a provider with provider prefix "companyA" and package B comes from a provider with provider prefix "companyB", the symlinks are now created as follows:
/opt/sdk/companyA/opt/sbin/AppC
/opt/sdk/companyB/opt/sbin/AppC
/opt/sdk/company-A/opt/sbin/AppC
rather than /opt/sdk/companyA/AppC
because the manifest entry is store=/opt/sbin/AppC
. This means that the system prefixes /opt/sdk/provider-prefix
to the store=
value from the manifest.
/var/run/ext
and /var/log/ext
directories also change to /var/run/ext/provider-prefix
and /var/log/ext/provider-prefix
to avoid file collisions in these directories.
INSTALLDIR
and %INSTALLDIR%
are replaced internally by the location of the base package.PROVIDER_PREFIX
and %PROVIDER_PREFIX%
are replaced internally by the provider prefix from the manifest.sandbox/src/build/mk/libnames.mk
as follows:
provider-prefix.mk
.LIBJNX-ROUTESERVICE-ODL = ${OBJTOP}/lib/odl/xmltags/libjnx-routeservice-odl.a
to
LIBJNX-ROUTESERVICE-ODL = ${OBJTOP}/lib/odl/xmltags/lib${PROVIDER_PREFIX}-routeservice-odl.a
LIBJNX-ROUTESERVICE-DD = ${OBJTOP}/lib/ddl/feature/lib${PROVIDER_PREFIX}-routeservice-dd.so.1
bsd.libnames.mk
, bsd.init.mk
, and provider.prefix.mk
from the backing sandbox to your sandbox/src/build/mk
directory.sandbox/src/lib/odl/input/*.input.mk
and sandbox/src/lib/ddl/input/*.input.mk
to:
provider-prefix.mk
.INPUT_FEATURES
and INPUT_FILES
values to include the provider prefix.jnx
is replaced by the ${PROVIDER_PREFIX}
variable:
/cvs/junos-2008/junos/sdk/junos/examples/src/lib/odl/input/jnx-gateway-mgmt. input.mk,v retrieving revision 1.1 diff -u -p -r1.1 jnx-gateway-mgmt.input.mk --- jnx-gateway-mgmt.input.mk 25 Apr 2007 12:05:50 -0000 1.1 +++ jnx-gateway-mgmt.input.mk 2 Mar 2009 23:01:07 -0000 +.include <provider-prefix.mk> + # the name assigned to the desired features -INPUT_FEATURES += jnx-gateway-mgmt +INPUT_FEATURES += ${PROVIDER_PREFIX}-gateway-mgmt # the definitions for each feature -jnx-gateway-mgmt_INPUT_FILES = \ +${PROVIDER_PREFIX}-gateway-mgmt_INPUT_FILES = \ jnx-gateway-mgmt.odl
sandbox/src/release
to add the PROVIDER_PREFIX
and INSTALLDIR
variables. For example, the manifest for the ifinfod example before porting is:
%TOPDIR%/lib/odl/xmltags/libjnx-ifinfo-render.so.1 store=opt/lib/render/libjnx-ifinfo-render.so mode=444 %TOPDIR%/lib/ddl/feature/libjnx-ifinfo-dd.so.1 store=opt/lib/dd/libjnx-ifinfo-dd.so mode=444 %TOPDIR%/sbin/jnx-ifinfod/jnx-ifinfod store=opt/sbin/jnx-ifinfod mode=555 program_id=1 %TOPDIR%/lib/ddl/feature/jnx-ifinfo.dml store=opt/lib/dd/jnx-ifinfo.dml mode=444 no_copy
After porting, the manifest is:
%TOPDIR%/lib/odl/xmltags/lib\%PROVIDER_PREFIX%-ifinfo-render.so.1 store=opt/lib/render/lib\%PROVIDER_PREFIX%-ifinfo-render.so mode=444 %TOPDIR%/lib/ddl/feature/lib\%PROVIDER_PREFIX%-ifinfo-dd.so.1 store=opt/lib/dd/lib\%PROVIDER_PREFIX%-ifinfo-dd.so mode=444 %TOPDIR%/sbin/jnx-ifinfod/jnx-ifinfod store=\%INSTALLDIR%/opt/sbin/jnx-ifinfod mode=555 program_id=1 %TOPDIR%/lib/ddl/feature/jnx-ifinfo.dml store=opt/lib/dd/\%PROVIDER_PREFIX%-ifinfo.dml mode=444 no_copy
CFLAGS
paths in the application makefile for the ODL, sequence, and application output files. The paths use variables that follow the pattern:
daemon-name_ODL_H
daemon-name_OUT_H
daemon-name_SEQUENCE_H
For example, the flags are as follows in the makefile for the jnx-ifinfod sample application:
CFLAGS += -DJNX_IFINFOD_ODL_H="<xmltags/${PROVIDER_PREFIX}-ifinfo_odl.h>" CFLAGS += -DJNX_IFINFOD_OUT_H="<feature/${PROVIDER_PREFIX}-ifinfo_out.h>" CFLAGS += -DJNX_IFINFOD_SEQUENCE_H="<feature/${PROVIDER_PREFIX}-ifinfo_sequence.h>"
For the jnx-exampled sample application, the same flags look like this:
CFLAGS += -DJNX_EXAMPLED_ODL_H="<xmltags/${PROVIDER_PREFIX}-example_odl.h>" CFLAGS += -DJNX_EXAMPLED_OUT_H="<feature/${PROVIDER_PREFIX}-example_out.h>" CFLAGS += -DJNX_EXAMPLED_SEQUENCE_H="<feature/${PROVIDER_PREFIX}-example_sequence.h>"
*_odl.h
, *_out.h
, and *.sequence.h
to use the variable added in the makefile.
For example, diff output for the for the jnx-ifinfod_config.c
file in the jnx-ifinfo sample application is as follows:
-#include <feature/jnx-ifinfo_out.h> -#include <feature/jnx-ifinfo_sequence.h> + +#include JNX_IFINFOD_OUT_H +#include JNX_IFINFOD_SEQUENCE_H
<binary>
tag under the <daemon-entry>
tag. For example, add the following in the daemon XML for jnx-example:
<binary>INSTALLDIR/opt/sbin/jnx-exampled</binary>
For more information about this file, see Updating System Tables to Describe Your Application.
/opt/sbin
or /opt/lib
), you can use the following functions in libprovider, at sandbox/src/junos/lib/libprovider/h/jnx/provider_info.h
in your backing sandbox:
provider_info_get_prefix()
(or any of the related getter functions) to get the provider prefixprovider_package_get_mount_dir()
to get the package mount directoryprovider_info_get_install_dir()
to get the package install directory (INSTALLDIR
)provider_info_get_storage_dir()
to get the persistent storage directory.