Migrating from older SDK
The purpose of this document is to help developpers for migrating their apps.
Enhancements or fixes of Rainbow involve that your apps could become incompatible
with a new version of NAS OS.
In this case, a new SDK should be available and includes the last version of Rainbow.
This guide informs you the major changes and what you need to fix to update your apps.
After this, increase the version of your apps and set the nasos_min_version
if necessary.
This document is splitted into several parts. Each of them describes the major changes of a SDK version and how you could update your apps. For more information about changes, you can refer to the SDK documentation.
From SDK 0.6 to SDK 0.7
This new SDK is compatible with apps generated from SDK 0.6.
A new API utility package is available for the NAS API v7. For backward compatibility, the version 5 of the API utility package is always available.
During the pack of apps, new warnings can appear.
If you are using a previous SDK, you can migrate to the SDK 0.7 by executing the script SDK_update-0.7.sh into your SDK.
# wget http://www.seagate.com/nasos/SDK/0.7/files/SDK_update-0.7.sh # chmod +x SDK_update-0.7.sh # ./SDK_update-0.7.sh
From SDK 0.5 to SDK 0.6
This new SDK is compatible with apps generated from SDK 0.5.
There is a new version of the buildroot container, here’s the migration table:
Old container | New container |
---|---|
org.buildroot.buildroot-1.1 | org.buildroot.buildroot-1.2 |
The toolchain for x86_64 has been changed in order to use a more compatible libc. The libc from the previous toolchain wasn’t compatible with the wheezy containers. Here’s the following migration table for the x86_64 toolchain:
Old x86_64 toolchain | New x86_64 toolchain |
---|---|
x86_64-seagate-generic-2013.11 (glibc 2.17) | x86_64-seagate-nasos-sdk (glibc 2.13) |
Except for the glibc versions, the toolchains are very similar.
From SDK 0.4 to SDK 0.5
This new SDK is compatible with apps generated from SDK 0.4.
However some containers/utilities are no more available into the SDK. If you want to rebuild your app into the new SDK, you can use the new containers/utilities according to these compatibilities:
Old container | New container |
---|---|
com.ubuntu.precise-1.0 | com.ubuntu.trusty-lamp-1.0 |
com.ubuntu.saucy-1.0 | com.ubuntu.trusty-lamp-1.0 |
org.buildroot.buildroot-1.0 | org.buildroot.buildroot-1.1 |
org.debian.wheezy-1.1 | org.debian.wheezy-lamp-1.2 |
org.debian.wheezy-1.2 | org.debian.wheezy-lamp-1.2 |
org.debian.wheezy-lamp-1.0 | org.debian.wheezy-lamp-1.2 |
org.debian.wheezy-lamp-1.1 | org.debian.wheezy-lamp-1.2 |
Old utility | New utility |
---|---|
com.nasos.unicorn_api-5.0 | com.nasos.unicorn_api-5.0.1 |
From SDK 0.3.1 to SDK 0.4
This new SDK is compatible with apps generated from SDK 0.3.1. However, please note that the SDK now enforces the use of lowercase characters for application IDs. This means that, if your app was using uppercase characters in it ID, you’ll need to change it to lowercase in order to use this version of the SDK.
Also note that the actual path for apps that use the transparent redirection
mode has changed, it was http://<nas_ip>/<app_short_name>
and is now
http://<nas_ip>/apps/<app_short_name>
. It may require some changes in your
application, if it was assuming being at the root of the web server.
From SDK 0.3 to SDK 0.3.1
This new SDK is compatible with apps generated from SDK 0.3.
From SDK 0.2 to SDK 0.3
Web apps must update their configuration with WEB_UI_PORT
and
WEB_PATH
values provided by NAS OS. This must be done at each
startup because values can change after installation.
So apps must do it in rc.local
script instead post-install
script.
For example, the following code can be added in rc.local
:
# Update config files with NAS OS informations file="/etc/apache2/sites-enabled/000-default" if grep -q "^Alias .* /var/www$" $file; then sed -i "s,^Alias .* /var/www$,Alias $RAINBOW_WEB_PATH /var/www," $file else sed "1i\Alias $RAINBOW_WEB_PATH /var/www" $file fi sed -i "s/Listen .*$/Listen 127.0.0.1:$RAINBOW_PORT_WEB_UI/" /etc/apache2/ports.conf
Minimum version for compatibility is no more associated with
the products but the NAS OS version. A Maximum version is also added.
The two parameters can be added in the package.json
file like this:
"nasos_min_version": "4.0", "nasos_max_version": null,
The value “None” is like if the variable was not specified. So if your apps don’t include these variables, they are compatible with all versions of NAS OS.
The apps must add multi-architecture support (i.e x86_64, armv7), under the form
of specific package-$arch.json
files. An example follows:
cat package-x86_64.json { "architecture": "x86_64" } cat package-armv7.json { "architecture": "armv7" }
Consequently, the metadata key ‘architecture’ disappears from package.json.