Fixed sdk from local file installation
[src/xds/xds-server.git] / scripts / sdks / README.md
1 # SDKs management scripts
2
3 To support a new SDK family, you must create a new directory under
4 `scripts/sdk/xxx` where xxx is the new SDK family.
5
6 Then you must create the following scripts (or executable) :
7
8 - `add`: add a new SDK
9 - `db-dump`: returned the list of available SDKs (JSON format)
10 - `db-update`: update SDKs database
11 - `get-family-config`: returned SDK family configuration structure (JSON format)
12 - `get-sdk-info`: extract SDK info (JSON format) from a SDK file/tarball
13 - `remove`: remove an existing SDK
14
15 ## `add`
16
17 add a new SDK
18
19 This script returns code 0 when sdk is successfully installed, else returns an
20 error code.
21
22 List of parameters to implement:
23
24 - `-f|--file <filepath>` :  install a SDK using a file
25 - `--force`:                force SDK install when a SDK already in the same destination directory
26 - `-u|--url <url>` :        download SDK using this URL and then install it
27 - `-no-clean` :             don't cleanup temporary files
28 - `-h|--help` :             display help
29
30 ## `db-dump`
31
32 Returned the list all SDKs (available and installed) using JSON format.
33
34 ```json
35 [
36   {
37     "name":         "My SDK name",
38     "uuid":         "a-unique-id",
39     "description":  "A description",
40     "profile":      "profile",
41     "version":      "version",
42     "arch":         "architecture",
43     "path":         "path where sdk installed locally",
44     "url":          "https://website.url.to.download.sdk",
45     "status":       "Not Installed | Installed",
46     "date":         "2017-12-25 00:00",
47     "size":         "123 MB",
48     "md5sum":       "123456789",
49     "setupFile":    "path to file to setup SDK environment"
50   }, {
51     "name":         "My SDK name 2",
52     "description":  "A description 2",
53     ...
54   }
55   ...
56 ]
57 ```
58
59 ## `db-update`
60
61 Update sdk database that may be used by `list` command.
62
63 ## `get-family-config`
64
65 Returned SDK configuration as JSON format:
66
67 ```json
68 {
69     "familyName": "xxx",
70     "description": "bla bla",
71     "rootDir": "/yyy/zzz",
72     "envSetupFilename": "my-envfilename*",
73     "scriptsDir": "scripts_path"
74 }
75 ```
76
77 where:
78
79 - `familyName` : sdk familyName (usually same name used as xxx directory)
80 - `rootDir` : root directory where SDK are/will be  installed
81 - `envSetupFilename` : sdk files (present in each sdk) that will be sourced to
82   setup sdk environment
83
84 ## `get-sdk-info`
85
86 Extract SDK info, such as name, version, ... from a SDK tarball file (when
87 --file option is set) or from a url (when --url option is set).
88
89 This script may also be used to check that a SDK tarball file is correct in
90 order to determine for example that the SDK family.
91
92 List of parameters to implement:
93
94 - `-f|--file <filepath>` :  SDK tarball file used to get SDK info
95 - `-u|--url <url>` :        url link used to get SDK info
96 - `--md5` :                 md5sum value used to validate SDK tarball file
97 - `-h|--help` :             display help
98
99 This script returns an error (value different from 0) and potential print an
100 error message. Else when info are successfully extracted, this script must
101 returned the following JSON structure:
102
103 ```json
104 {
105     "name":         "My SDK name",
106     "uuid":         "a-unique-id",
107     "description":  "A description",
108     "profile":      "profile",
109     "version":      "version",
110     "arch":         "architecture",
111     "path":         "",
112     "url":          "https://website.url.to.download.sdk",
113     "status":       "Not Installed",
114     "date":         "2017-12-25 00:00",
115     "size":         "123 MB",
116     "md5sum":       "123456789",
117     "setupFile":    "path to file to setup SDK environment"
118 }
119 ```
120
121 ## `remove`
122
123 Remove an existing SDK
124
125 The first argument is the full path of the directory of the SDK to removed.