-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Tizen] Add Tizen Studio CLI to docker images
This commit adds Tizen Studio CLI into the Tizen docker image. Also, it setups app's author certificate for signing the application. With that setup it will be possible to pack Tizen application into the tpk package as follows: tizen package -t tpk --sign CHIP -- <TizenAppBuildDir>
- Loading branch information
Showing
9 changed files
with
179 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,37 +14,71 @@ RUN set -x \ | |
&& : # last line | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Install toolchain | ||
# Install dependencies | ||
RUN set -x \ | ||
&& apt-get update \ | ||
&& apt-get install -fy --no-install-recommends obs-build=20180831-3ubuntu1 cpio=2.13+dfsg-2 \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ | ||
cpio=2.13+dfsg-2 \ | ||
obs-build=20180831-3ubuntu1 \ | ||
openjdk-8-jre-headless \ | ||
zip \ | ||
# Cleanup | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& : # last line | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Install tizen SDK | ||
ENV TIZEN_HOME /opt/tizen_sdk | ||
ENV TIZEN_ROOTSTRAP_VERSION 6.0 | ||
ENV TIZEN_ROOTSTRAPS mobile-$TIZEN_ROOTSTRAP_VERSION-rs-device.core_0.0.123_ubuntu-64 | ||
ENV DNS_LIBS libnsd-dns-sd.so* | ||
ENV TIZEN_SDK_ROOT /opt/tizen-sdk | ||
ENV TIZEN_SDK_SYSROOT $TIZEN_SDK_ROOT/sysroot | ||
ENV TIZEN_VERSION 6.0 | ||
|
||
WORKDIR $TIZEN_HOME | ||
WORKDIR /tmp/workdir | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Get tizen studio CLI | ||
RUN set -x \ | ||
&& mkdir -p $TIZEN_SDK_ROOT \ | ||
# Download | ||
&& wget --progress=dot:giga \ | ||
http://download.tizen.org/sdk/tizenstudio/official/binary/certificate-encryptor_1.0.7_ubuntu-64.zip \ | ||
http://download.tizen.org/sdk/tizenstudio/official/binary/certificate-generator_0.1.3_ubuntu-64.zip \ | ||
http://download.tizen.org/sdk/tizenstudio/official/binary/new-common-cli_2.5.7_ubuntu-64.zip \ | ||
http://download.tizen.org/sdk/tizenstudio/official/binary/new-native-cli_2.5.7_ubuntu-64.zip \ | ||
# Install tizen studio CLI | ||
&& unzip -o '*.zip' \ | ||
&& mv data/tools $TIZEN_SDK_ROOT \ | ||
&& echo "TIZEN_SDK_INSTALLED_PATH=$TIZEN_SDK_ROOT" > $TIZEN_SDK_ROOT/sdk.info \ | ||
&& echo "TIZEN_SDK_DATA_PATH=$USER_HOME/tizen-sdk-data" >> $TIZEN_SDK_ROOT/sdk.info \ | ||
&& ln -sf $USER_HOME/.tizen-cli-config $TIZEN_SDK_ROOT/tools/.tizen-cli-config \ | ||
# Cleanup | ||
&& rm -rf /tmp/workdir \ | ||
&& : # last line | ||
|
||
COPY secret-tool.py $TIZEN_SDK_ROOT/tools/certificate-encryptor/secret-tool | ||
ENV PATH="$TIZEN_SDK_ROOT/tools/ide/bin:$PATH" | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Get toolchain | ||
RUN set -x \ | ||
&& wget --progress=dot:giga http://download.tizen.org/sdk/tizenstudio/official/binary/$TIZEN_ROOTSTRAPS.zip \ | ||
&& unzip $TIZEN_ROOTSTRAPS.zip \ | ||
&& mv data/platforms/tizen-$TIZEN_ROOTSTRAP_VERSION/mobile/rootstraps/mobile-$TIZEN_ROOTSTRAP_VERSION-device.core/usr . \ | ||
&& mv data/platforms/tizen-$TIZEN_ROOTSTRAP_VERSION/mobile/rootstraps/mobile-$TIZEN_ROOTSTRAP_VERSION-device.core/lib . \ | ||
&& rm -rf usr/lib/$DNS_LIBS \ | ||
&& rm -rf data \ | ||
&& rm -rf mobile-$TIZEN_ROOTSTRAP_VERSION-rs-device.* \ | ||
&& rm pkginfo.manifest \ | ||
&& mkdir -p $TIZEN_SDK_ROOT \ | ||
# Download | ||
&& wget --progress=dot:giga http://download.tizen.org/sdk/tizenstudio/official/binary/cross-arm-gcc-9.2_0.1.9_ubuntu-64.zip \ | ||
# Install toolchain | ||
&& unzip -o '*.zip' \ | ||
&& cp -rf data/tools/arm-linux-gnueabi-gcc-9.2 $TIZEN_SDK_ROOT/tools/arm-linux-gnueabi \ | ||
# Cleanup | ||
&& rm -rf /tmp/workdir \ | ||
&& : # last line | ||
|
||
ENV PATH="$TIZEN_SDK_ROOT/tools/arm-linux-gnueabi/bin:$PATH" | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Get tizen packages | ||
# Get tizen sysroot | ||
RUN set -x \ | ||
&& mkdir -p $TIZEN_SDK_SYSROOT \ | ||
# Base sysroot | ||
&& wget --progress=dot:giga http://download.tizen.org/sdk/tizenstudio/official/binary/mobile-$TIZEN_VERSION-rs-device.core_0.0.123_ubuntu-64.zip \ | ||
# Base packages | ||
&& wget -r -nd --no-parent -q -A 'pcre-devel-*.armv7l.rpm' http://download.tizen.org/releases/milestone/tizen/base/latest/repos/standard/packages/armv7l/ \ | ||
&& wget -r -nd --no-parent -q -A 'libffi-devel-*.armv7l.rpm' http://download.tizen.org/releases/milestone/tizen/base/latest/repos/standard/packages/armv7l/ \ | ||
|
@@ -67,26 +101,33 @@ RUN set -x \ | |
&& wget -r -nd --no-parent -q -A 'capi-network-nsd-*.armv7l.rpm' http://download.tizen.org/snapshots/tizen/unified/latest/repos/standard/packages/armv7l/ \ | ||
&& wget -r -nd --no-parent -q -A 'libnsd-dns-sd-*.armv7l.rpm' http://download.tizen.org/snapshots/tizen/unified/latest/repos/standard/packages/armv7l/ \ | ||
&& wget -r -nd --no-parent -q -A 'capi-network-thread-*.armv7l.rpm' http://download.tizen.org/snapshots/tizen/unified/latest/repos/standard/packages/armv7l/ \ | ||
&& unrpm ./*.rpm \ | ||
&& cp usr/lib/pkgconfig/openssl1.1.pc usr/lib/pkgconfig/openssl.pc \ | ||
&& rm usr/lib/libdns_sd.so \ | ||
&& cp usr/lib/libdns_sd.so.878.* usr/lib/libdns_sd.so \ | ||
&& rm ./*.rpm \ | ||
&& : # last line | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Get toolchain | ||
RUN set -x \ | ||
&& wget --progress=dot:giga http://download.tizen.org/sdk/tizenstudio/official/binary/cross-arm-gcc-9.2_0.1.9_ubuntu-64.zip \ | ||
&& unzip cross-arm-gcc-9.2_0.1.9_ubuntu-64.zip \ | ||
&& cp -rf data/tools/arm-linux-gnueabi-gcc-9.2/* . \ | ||
&& rm pkginfo.manifest \ | ||
&& rm changelog \ | ||
&& rm -rf data \ | ||
&& rm cross-arm-gcc-9.2_0.1.9_ubuntu-64.zip \ | ||
# Install base sysroot | ||
&& unzip -o '*.zip' \ | ||
&& mv data/platforms/tizen-$TIZEN_VERSION/mobile/rootstraps/mobile-$TIZEN_VERSION-device.core/lib $TIZEN_SDK_SYSROOT \ | ||
&& mv data/platforms/tizen-$TIZEN_VERSION/mobile/rootstraps/mobile-$TIZEN_VERSION-device.core/usr $TIZEN_SDK_SYSROOT \ | ||
&& cp $TIZEN_SDK_SYSROOT/usr/lib/pkgconfig/openssl1.1.pc $TIZEN_SDK_SYSROOT/usr/lib/pkgconfig/openssl.pc \ | ||
# Install packages | ||
&& unrpm *.rpm \ | ||
&& ln -sf libcap.so.2 usr/lib/libcap.so \ | ||
&& ln -sf libdns_sd.so.878.70.2 usr/lib/libdns_sd.so \ | ||
&& ln -sf libdns_sd.so.878.70.2 usr/lib/libdns_sd.so.878 \ | ||
&& cp -rf lib $TIZEN_SDK_SYSROOT \ | ||
&& cp -rf usr $TIZEN_SDK_SYSROOT \ | ||
# Cleanup | ||
&& rm -rf /tmp/workdir \ | ||
&& : # last line | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Switch to the non-root user | ||
USER $USER_NAME | ||
WORKDIR $USER_HOME | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Setup tizen studio CLI | ||
RUN set -x \ | ||
# Generate author certificate | ||
&& tizen certificate --alias=CHIP --name=CHIP [email protected] --password=chiptizen \ | ||
# Add new security profile | ||
&& tizen security-profiles add --active --name=CHIP --author=$HOME/tizen-sdk-data/keystore/author/author.p12 --password=chiptizen \ | ||
# Cleanup | ||
&& : # last line |
77 changes: 77 additions & 0 deletions
77
integrations/docker/images/chip-build-tizen/secret-tool.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/usr/bin/python3 | ||
# Dummy Password Manager for Tizen Studio CLI | ||
|
||
import os | ||
import pickle | ||
import sys | ||
from argparse import ArgumentParser | ||
|
||
|
||
class Secrets: | ||
|
||
def __init__(self, filename: str): | ||
self.filename = filename | ||
self.secrets = {} | ||
|
||
@staticmethod | ||
def _build_key(label: str, **kw): | ||
return label + ":" + str(tuple(sorted(kw.items()))) | ||
|
||
def load(self): | ||
try: | ||
with open(self.filename, "rb") as f: | ||
self.secrets = pickle.load(f) | ||
except (IOError, ValueError) as e: | ||
print("ERROR: " + str(e), file=sys.stderr) | ||
|
||
def save(self): | ||
try: | ||
with open(self.filename, "wb") as f: | ||
pickle.dump(self.secrets, f) | ||
except IOError as e: | ||
print("ERROR: " + str(e), file=sys.stderr) | ||
|
||
def clear(self, label: str, **kw): | ||
key = self._build_key(label, **kw) | ||
self.secrets.pop(key, None) | ||
|
||
def store(self, label: str, password: str, **kw): | ||
key = self._build_key(label, **kw) | ||
self.secrets[key] = password | ||
|
||
def lookup(self, label: str, **kw): | ||
key = self._build_key(label, **kw) | ||
return self.secrets.get(key, "") | ||
|
||
|
||
parser = ArgumentParser() | ||
subparsers = parser.add_subparsers(dest='command', required=True) | ||
|
||
parser_clear = subparsers.add_parser("clear") | ||
parser_clear.add_argument("-l", "--label", action='store', required=True) | ||
parser_clear.add_argument("kw", nargs='*') | ||
|
||
parser_store = subparsers.add_parser("store") | ||
parser_store.add_argument("-l", "--label", action='store', required=True) | ||
parser_store.add_argument("-p", "--password", action='store', required=True) | ||
parser_store.add_argument("kw", nargs='*') | ||
|
||
parser_lookup = subparsers.add_parser("lookup") | ||
parser_lookup.add_argument("-l", "--label", action='store', required=True) | ||
parser_lookup.add_argument("kw", nargs='*') | ||
|
||
args = parser.parse_args() | ||
kw = dict(zip(args.kw[:: 2], args.kw[1:: 2])) | ||
|
||
secrets = Secrets(os.path.expanduser("~/.secretsdb")) | ||
secrets.load() | ||
|
||
if args.command == "clear": | ||
secrets.clear(args.label, **kw) | ||
secrets.save() | ||
elif args.command == "store": | ||
secrets.store(args.label, args.password, **kw) | ||
secrets.save() | ||
elif args.command == "lookup": | ||
password = secrets.lookup(args.label, **kw) | ||
print(password) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.5.64 Version bump reason: Update nRF Connect SDK | ||
0.5.65 Version bump reason: [Tizen] Add Tizen Studio CLI to Tizen docker image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters