7 Nokia Corporation - initial contribution. |
7 Nokia Corporation - initial contribution. |
8 Contributors: |
8 Contributors: |
9 --> |
9 --> |
10 <!DOCTYPE concept |
10 <!DOCTYPE concept |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
12 <concept id="GUID-36539894-580E-5774-AA79-7F640E8C59E1" xml:lang="en"><title>Central |
12 <concept id="GUID-36539894-580E-5774-AA79-7F640E8C59E1" xml:lang="en"><title>Central Repository Initialisation Files Guide</title><shortdesc>This topic describes the concepts of initialisation files |
13 Repository Initialisation Files Guide</title><shortdesc>This topic describes the concepts of initialisation files used |
13 used by the Central Repository. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
14 by the Central Repository. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
14 <section id="GUID-EAB04F5A-A208-4537-8EEF-6C6BE9F951ED"><title>Initialisation |
15 <section id="GUID-EAB04F5A-A208-4537-8EEF-6C6BE9F951ED"><title>Initialisation file properties</title> <p>The mechanisms of |
15 file properties</title> <p>The mechanisms of key spaces, capabilities |
16 key spaces, capabilities and SIDs are used to write the content of an initialisation |
16 and SIDs are used to write the content of an initialisation file. </p> <p><b>Owner </b> </p> <p>The owner of a repository (the application |
17 file. </p> <p><b>Owner </b> </p> <p>The owner of a repository (the application responsible |
17 responsible for backing it up) is identified by its SID. Example: </p> <codeblock id="GUID-3057056D-64F4-5A3D-9644-9B1417EFDC89" xml:space="preserve"> |
18 for backing it up) is identified by its SID. Example: </p> <codeblock id="GUID-3057056D-64F4-5A3D-9644-9B1417EFDC89" xml:space="preserve"> |
|
19 [owner] |
18 [owner] |
20 0x12345 |
19 0x12345 |
21 </codeblock> <p><b>Metadata </b> </p> <p>Settings of a repository are given values and also |
20 </codeblock> <p><b>Metadata </b> </p> <p>Settings of a repository are given values |
22 metadata values. The Default Metadata section of a repository gives the settings |
21 and also metadata values. The Default Metadata section of a repository |
23 global default metadata values which may be overridden by individual metadata |
22 gives the settings global default metadata values which may be overridden |
24 values assigned in the Main section. A metadata value is held as a 32 bit |
23 by individual metadata values assigned in the Main section. A metadata |
25 integer whose binary digits encode separate items of metadata. The most significant |
24 value is held as a 32 bit integer whose binary digits encode separate |
26 eight bits (most significant byte) of the integer are reserved for internal |
25 items of metadata. The most significant eight bits (most significant |
27 purposes. The other 24 bits of the integer have no reserved significance. |
26 byte) of the integer are reserved for internal purposes. The other |
28 Two of the eight bits are exposed for use by application developers. </p> <ul> |
27 24 bits of the integer have no reserved significance. Two of the eight |
|
28 bits are exposed for use by application developers. </p> <ul> |
29 <li id="GUID-65872DE7-F12A-5F1E-892C-937C81053E48"><p>The least significant |
29 <li id="GUID-65872DE7-F12A-5F1E-892C-937C81053E48"><p>The least significant |
30 bit of the most significant byte is set to 1 to indicate that a backup operation |
30 bit of the most significant byte is set to 1 to indicate that a backup |
31 applies to the setting. </p> </li> |
31 operation applies to the setting. </p> </li> |
32 <li id="GUID-A13A915F-EDBC-5E69-8557-D4FC6789CE23"><p>The second least significant |
32 <li id="GUID-A13A915F-EDBC-5E69-8557-D4FC6789CE23"><p>The second least |
33 bit of the most significant byte is set to 1 to indicate that a restore factory |
33 significant bit of the most significant byte is set to 1 to indicate |
34 settings operation applies to the setting. </p> </li> |
34 that a restore factory settings operation applies to the setting. </p> </li> |
35 </ul> <p>What is meant by least and most significant? An example may help. |
35 </ul> <p>What is meant by least and most significant? An example may |
36 A hexadecimal number such as 03020100 is stored as a single 32 bit integer. |
36 help. A hexadecimal number such as 03020100 is stored as a single |
37 The integer can be analysed as a sequence of four bytes: </p> <p>03 02 01 |
37 32 bit integer. The integer can be analysed as a sequence of four |
38 00 </p> <p>The leftmost byte, 03, is the most significant byte because it |
38 bytes: </p> <p>03 02 01 00 </p> <p>The leftmost byte, 03, is the most |
39 represents a larger quantity (03000000) than the other three (02000, 0100 |
39 significant byte because it represents a larger quantity (03000000) |
40 and 00). Each byte consists of eight bits. In binary notation they are </p> <p>00000011 |
40 than the other three (02000, 0100 and 00). Each byte consists of eight |
41 00000010 00000001 00000000 </p> <p>The rightmost bit of the leftmost byte |
41 bits. In binary notation they are </p> <p>00000011 00000010 00000001 |
42 is the least significant bit of the most significant byte because it represents |
42 00000000 </p> <p>The rightmost bit of the leftmost byte is the least |
43 a smaller quantity (1) than its neighbour to the left (10) which is the second |
43 significant bit of the most significant byte because it represents |
44 least significant bit of the most significant byte. These are the two exposed |
44 a smaller quantity (1) than its neighbour to the left (10) which is |
45 bits of the metadata value and the hexadecimal integer 03020100 has both of |
45 the second least significant bit of the most significant byte. These |
46 them set to 1. The 32 bits are sometimes referred to by number (32 for the |
46 are the two exposed bits of the metadata value and the hexadecimal |
47 leftmost down to 1 for the rightmost): thus the exposed bits are also called |
47 integer 03020100 has both of them set to 1. The 32 bits are sometimes |
48 bits 26 and 25. </p> <p>Global default metadata values consist simply of a |
48 referred to by number (32 for the leftmost down to 1 for the rightmost): |
49 32 bit integer. Default metadata values can also be applied to a range of |
49 thus the exposed bits are also called bits 26 and 25. </p> <p>Global |
50 settings by prefixing either a pair of keys representing a continuous range, |
50 default metadata values consist simply of a 32 bit integer. Default |
51 or else a partial key and a key mask prefixed by "mask=". Example: </p> <codeblock id="GUID-EC5F473A-86AB-58CF-878B-7AFD7EE69779" xml:space="preserve"> |
51 metadata values can also be applied to a range of settings by prefixing |
|
52 either a pair of keys representing a continuous range, or else a partial |
|
53 key and a key mask prefixed by "mask=". Example: </p> <codeblock id="GUID-EC5F473A-86AB-58CF-878B-7AFD7EE69779" xml:space="preserve"> |
52 [defaultMeta] |
54 [defaultMeta] |
53 0x00000010 |
55 0x00000010 |
54 0x100 0x400 0x00000020 |
56 0x100 0x400 0x00000020 |
55 0x1000 mask = 0x04 0x00000040 |
57 0x1000 mask = 0x04 0x00000040 |
56 </codeblock> </section> |
58 </codeblock> </section> |
57 <section id="GUID-04903C24-0CEC-4937-BC94-77540BFC3F7D"><title>Access policies </title> <p>An access policy grants read or |
59 <section id="GUID-04903C24-0CEC-4937-BC94-77540BFC3F7D"><title>Access |
58 write permissions on a setting or a group of settings to an application or |
60 policies </title> <p>An access policy grants read or write permissions |
59 a group of applications. Applications are identified by their SID and groups |
61 on a setting or a group of settings to an application or a group of |
|
62 applications. Applications are identified by their SID and groups |
60 of applications by their capability name. </p> <p>Decide which applications |
63 of applications by their capability name. </p> <p>Decide which applications |
61 you want to grant permissions to, and whether you are going to identify them |
64 you want to grant permissions to, and whether you are going to identify |
62 by capability or SID. SIDs are unsigned integers which identify an application |
65 them by capability or SID. SIDs are unsigned integers which identify |
63 and are assigned by Symbian Signed. Identify the settings and groups of settings |
66 an application and are assigned by Symbian Signed. Identify the settings |
64 which are to be written and read: you will need their keys and partial keys. |
67 and groups of settings which are to be written and read: you will |
65 Determine which applications need read or write permissions on which settings. </p> <p>You |
68 need their keys and partial keys. Determine which applications need |
66 create an access policy by combining these elements using the following syntax. </p> <ul> |
69 read or write permissions on which settings. </p> <p>You create an |
67 <li id="GUID-A3E78BC6-7436-59E6-8C6F-B546B638BABB"><p>A capname is one of |
70 access policy by combining these elements using the following syntax. </p> <ul> |
68 '<codeph>TCB</codeph>' '<codeph>CommDD</codeph>' etc. A caplist is two or |
71 <li id="GUID-A3E78BC6-7436-59E6-8C6F-B546B638BABB"><p>A capname is |
69 three capnames separated by a comma and whitespace. A read caps statement |
72 one of '<codeph>TCB</codeph>' '<codeph>CommDD</codeph>' etc. A caplist |
70 is "cap_rd" followed by a capname or a caplist. </p> </li> |
73 is two or three capnames separated by a comma and whitespace. A read |
|
74 caps statement is "cap_rd" followed by a capname or a caplist. </p> </li> |
71 <li id="GUID-5A76E256-BF6B-5CAD-A45C-C07140C4EEEE"><p>A read sid statement |
75 <li id="GUID-5A76E256-BF6B-5CAD-A45C-C07140C4EEEE"><p>A read sid statement |
72 is "<codeph>sid_rd</codeph> " followed by an SID. </p> </li> |
76 is "<codeph>sid_rd</codeph> " followed by an SID. </p> </li> |
73 <li id="GUID-0EE23D2A-2EED-5CEA-BF6D-7B23D11E9935"><p>A read policy is a read |
77 <li id="GUID-0EE23D2A-2EED-5CEA-BF6D-7B23D11E9935"><p>A read policy |
74 sid statement or a read caps statement or one of each separated by whitespace. |
78 is a read sid statement or a read caps statement or one of each separated |
75 A write policy is the same as a read policy with "_wr" instead of "_rd". An |
79 by whitespace. A write policy is the same as a read policy with "_wr" |
76 access policy is a read policy or a write policy or one of each separated |
80 instead of "_rd". An access policy is a read policy or a write policy |
77 by whitespace. </p> </li> |
81 or one of each separated by whitespace. </p> </li> |
78 <li id="GUID-EAB2A33E-99C2-5B40-8333-232761A7BC91"><p>Instead of granting |
82 <li id="GUID-EAB2A33E-99C2-5B40-8333-232761A7BC91"><p>Instead of granting |
79 or denying permissions to specified applications, you can create global permissions |
83 or denying permissions to specified applications, you can create global |
80 by using the words 'AlwaysPass' or 'AlwaysFail' in place of an SID. For instance, |
84 permissions by using the words 'AlwaysPass' or 'AlwaysFail' in place |
81 'sid_rd AlwaysPass' grants read permissions to all applications, 'sid_wr AlwaysFail' |
85 of an SID. For instance, 'sid_rd AlwaysPass' grants read permissions |
82 denies write permissions to all applications and so on. </p> </li> |
86 to all applications, 'sid_wr AlwaysFail' denies write permissions |
83 </ul> <p>An access policy constructed on these lines with no further qualification |
87 to all applications and so on. </p> </li> |
84 creates permissions on all the settings in a repository (this is called a |
88 </ul> <p>An access policy constructed on these lines with no further |
85 default policy). To create permissions on individual settings (a single policy) |
89 qualification creates permissions on all the settings in a repository |
86 or a group of settings (a range policy or a mask policy depending on implementation) |
90 (this is called a default policy). To create permissions on individual |
87 we use the keys of those settings. </p> <ul> |
91 settings (a single policy) or a group of settings (a range policy |
88 <li id="GUID-F86D7F23-EB24-5169-B072-EED5BEC5925D"><p>A single policy is a |
92 or a mask policy depending on implementation) we use the keys of those |
89 default policy prefixed with a key referring to a single setting. </p> </li> |
93 settings. </p> <ul> |
90 <li id="GUID-0F83526E-BF07-5914-887B-E128CFC59775"><p>A range policy is a |
94 <li id="GUID-F86D7F23-EB24-5169-B072-EED5BEC5925D"><p>A single policy |
91 default policy prefixed with two keys, the lowerkey and the upperkey. The |
95 is a default policy prefixed with a key referring to a single setting. </p> </li> |
92 policy assigns permissions on all settings with keys between the lowerkey |
96 <li id="GUID-0F83526E-BF07-5914-887B-E128CFC59775"><p>A range policy |
93 and the upperkey inclusively. </p> </li> |
97 is a default policy prefixed with two keys, the lowerkey and the upperkey. |
94 <li id="GUID-BA19291D-8F06-5D6D-932C-8F0B8554DF51"><p>A mask policy is an |
98 The policy assigns permissions on all settings with keys between the |
95 access policy prefixed with a partial key and then "mask=" and a keymask. </p> </li> |
99 lowerkey and the upperkey inclusively. </p> </li> |
96 <li id="GUID-828D372D-0297-5CDF-93E7-10A63516E698"><p>A custom policy is a |
100 <li id="GUID-BA19291D-8F06-5D6D-932C-8F0B8554DF51"><p>A mask policy |
97 single policy, a range policy or a mask policy. A policy list is a custom |
101 is an access policy prefixed with a partial key and then "mask=" and |
98 policy or several custom policies separated by whitespace. </p> </li> |
102 a keymask. </p> </li> |
99 </ul> <p>We have now defined the structure of the access policy section of |
103 <li id="GUID-828D372D-0297-5CDF-93E7-10A63516E698"><p>A custom policy |
100 an initialisation file. It consists of a line reading "[PlatSec]" followed |
104 is a single policy, a range policy or a mask policy. A policy list |
101 by a default policy or a policy list or one of each separated by whitespace. |
105 is a custom policy or several custom policies separated by whitespace. </p> </li> |
102 Where several policies in a list apply to the same key, the later policy overrides |
106 </ul> <p>We have now defined the structure of the access policy section |
103 the earlier. The read policies, each on a separate line, must precede the |
107 of an initialisation file. It consists of a line reading "[PlatSec]" |
104 write policies, each on a separate line. </p> </section> |
108 followed by a default policy or a policy list or one of each separated |
105 <section id="GUID-F2F1838D-D5A7-4720-9D10-3BEFFF64732E"><title> Initial values </title> <p>Initial values are assigned to |
109 by whitespace. Where several policies in a list apply to the same |
106 settings in the Main section of an initialisation file. Each line begins with |
110 key, the later policy overrides the earlier. The read policies, each |
107 a setting identified by an individual key or a group of settings identified |
111 on a separate line, must precede the write policies, each on a separate |
108 by a pair of keys representing a range or else a keymask and a partial key. |
112 line. </p> </section> |
109 Following the key or keys comes the data type of the setting, one of <codeph>int</codeph>, <codeph>real</codeph>, |
113 <section id="GUID-F2F1838D-D5A7-4720-9D10-3BEFFF64732E"><title> Initial |
110 string, <codeph>string8</codeph> or <codeph>binary</codeph>. Next comes the |
114 values </title> <p>Initial values are assigned to settings in the |
111 actual initial value of the setting and finally, as an optional item, the |
115 Main section of an initialisation file. Each line begins with a setting |
|
116 identified by an individual key or a group of settings identified |
|
117 by a pair of keys representing a range or else a keymask and a partial |
|
118 key. Following the key or keys comes the data type of the setting, |
|
119 one of <codeph>int</codeph>, <codeph>real</codeph>, string, <codeph>string8</codeph> or <codeph>binary</codeph>. Next comes the actual |
|
120 initial value of the setting and finally, as an optional item, the |
112 metadata value of the setting. Example: </p> <codeblock id="GUID-585347BA-219A-5372-8C62-77E927A5D690" xml:space="preserve"> |
121 metadata value of the setting. Example: </p> <codeblock id="GUID-585347BA-219A-5372-8C62-77E927A5D690" xml:space="preserve"> |
113 [main] |
122 [main] |
114 |
123 |
115 1 int 1 0 |
124 1 int 1 0 |
116 2 real 2.732 0xa |
125 2 real 2.732 0xa |
122 |
131 |
123 0x11 real 1.5 12 |
132 0x11 real 1.5 12 |
124 0x101 int 100 0 |
133 0x101 int 100 0 |
125 </codeblock> </section> |
134 </codeblock> </section> |
126 <section id="GUID-12599A2C-BE97-5B18-9BB9-EB833A40536A"><title>Initialisation |
135 <section id="GUID-12599A2C-BE97-5B18-9BB9-EB833A40536A"><title>Initialisation |
127 file format</title> <p>You use an initialisation file to register a repository |
136 file format</title> <p>You use an initialisation file to register |
128 by saving it to device memory. Ideally you do this at ROM build time and save |
137 a repository by saving it to device memory. Ideally you do this at |
129 to the directory <filepath>z:\private\10202BE9\</filepath> (this is the Central |
138 ROM build time and save to the directory <filepath>z:\private\10202BE9\</filepath> (this is the Central Repository directory, named after its UID). |
130 Repository directory, named after its UID). It is also possible to register |
139 It is also possible to register a repository after build time using |
131 a repository after build time using the Symbian Software Installer to save |
140 the Symbian Software Installer to save it to the C drive. This process |
132 it to the C drive. This process requires a signed SIS file and is explained |
141 requires a signed SIS file and is explained below. In either case, |
133 below. In either case, the file name of the repository is the same as its |
142 the file name of the repository is the same as its UID. </p> <p>A |
134 UID. </p> <p>A repository may be saved to memory as a text file. The encoding |
143 repository may be saved to memory as a text file. The encoding must |
135 must be UTF-16, no other format being supported. However, you are recommended |
144 be UTF-16, no other format being supported. However, you are recommended |
136 to convert this text file to binary format and save the binary to device memory |
145 to convert this text file to binary format and save the binary to |
137 for reasons of performance. Retrieval times are an order of magnitude faster |
146 device memory for reasons of performance. Retrieval times are an order |
138 using binary files. You convert text to binary with the tool CentRepConv.exe |
147 of magnitude faster using binary files. You convert text to binary |
139 as documented in <xref href="id1236097240207" scope="external">CenRep Converter |
148 with the tool CentRepConv.exe as documented in <xref href="GUID-53E5C9EA-0A38-54A1-AE24-95B71BFFB4B5.dita">CenRep Converter |
140 Tool Tutorial</xref>. CentRepConv.exe can also be used to convert binary files |
149 Tool Tutorial</xref>. CentRepConv.exe can also be used to convert |
141 back to text format (in a slightly lossy way due to differences in the specification |
150 binary files back to text format (in a slightly lossy way due to differences |
142 of the two formats). </p> </section> |
151 in the specification of the two formats). </p> </section> |
143 </conbody><related-links> |
152 </conbody><related-links> |
144 <link href="GUID-CBC57511-7F28-596A-9763-5674EB41BCAC.dita"><linktext>Central Repository |
153 <link href="GUID-CBC57511-7F28-596A-9763-5674EB41BCAC.dita"><linktext>Central |
145 Overview</linktext></link> |
154 Repository Overview</linktext></link> |
146 <link href="GUID-E3BE62B2-9625-5F79-84A4-0248A3F36225.dita"><linktext>Central Repository |
155 <link href="GUID-E3BE62B2-9625-5F79-84A4-0248A3F36225.dita"><linktext>Central |
147 Guide</linktext></link> |
156 Repository Guide</linktext></link> |
148 <link href="GUID-53E5C9EA-0A38-54A1-AE24-95B71BFFB4B5.dita"><linktext>CenRep Converter |
157 <link href="GUID-53E5C9EA-0A38-54A1-AE24-95B71BFFB4B5.dita"><linktext>CenRep |
149 Tool Tutorial</linktext></link> |
158 Converter Tool Tutorial</linktext></link> |
150 </related-links></concept> |
159 </related-links></concept> |