Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



How to upgrade OS components


Modification of an OS component

The software installer allows the replacement of binaries and data files in ROM, for instance to allow a manufacturer to fix a software issue, by means of eclipsing, but it is strictly controlled.

Eclipsing occurs when some form of path-processing logic is being applied, and a file is installed with the same name and path as an existing file - but to a different drive. Under these circumstances, therefore, the new file is used instead of the original.

The OS loader exhibits this behaviour; when an EXE or DLL is loaded, drives are searched in the order Y: to A: followed by Z:. Therefore, a binary file installed to the C: drive, (or any other drive between A: and Y:) will eclipse one with the same name and path on Z: and will be loaded instead of the original X: file.

In order to eclipse data files in ROM, an application must explicitly support this behaviour, in other words, it should not assume that data files will be located on Z:.


Eclipsing ROM files

Creating the stub SIS file

Files in ROM can only be eclipsed if the device manufacturer has added a stub SIS file, which claims ownership of these files, to the ROM. The stub SIS file must be located in Z:\system\install\ and its name is not particularly significant.

Without a relevant stub SIS file present, any attempt by the user to install a package that eclipses files in ROM will fail.

In the PKG file used to generate the stub SIS file, the source file entries are irrelevant (because no installable files are included in a stub SIS file), and are therefore specified as empty strings. For instance:

; Example STUB File
&EN
%{"Symbian Software Ltd."}
:"Symbian Software Ltd."
#{"Hello World"},(0x18000091),1,0,0
"" - "z:\sys\bin\HelloWorld.exe"
"" - "z:\resource\apps\HelloWorld.rsc"
"" - "z:\resource\apps\HelloWorld.mbm"
"" - "z:\private\10003a3f\import\apps\HelloWorld_reg.rsc"

The Wildcards * and ? can be used in file names specified in stub SIS files in the ROM, allowing licensees to define multiple files with one definition. Using wildcards means licensees do not need to list every file in the stub, and also licensees only need to create a single stub SIS file to work with all possible language variants. This can help avoid cases such as being unable to upgrade on a phone in the market due to a mismatching stub SIS file in the ROM. For example, the following entry means that all possible language variants of the application's resource files could be eclipsed.

""-"z:\resource\apps\HelloWorld.r*

The executables (exes not dlls) should always be explicitly included in the ROM stub, without wildcards. This is necessary to allow files to be installed into private directories of those applications in upgrades and to avoid getting errors due to the SID being eclipsed. This is because, when the ROM stub is processed by the SIS registry at first boot, the SIDs of executables are added to the registry entry enabling upgrades to install files into the private directories corresponding to those SIDs. However, for performance reasons, the SIS registry does not attempt to find the SID for every executable matched by the wildcard. For example if the ROM stub contains "z:\sys\bin\media_*.exe", the SID of z:\sys\bin\media_player.exe won't be added to the registry entry for the ROM stub. Consequently, you would not be able to upgrade z:\sys\bin\media_player.exe or install files into the private directory belonging to media_player.exe. For this reason, when creating installation files, MakeSIS issues a warning if wildcards are used in the \sys directory in ROM stubs.

To generate the stub SIS file, use:

> makesis –s <PKG_filename>

The stub SIS file is not signed, but it must have a package UID from the protected range. In other words, it must be selected from the range allocated to the device manufacturer by Symbian Signed.

Creating the eclipsing package

The files in the eclipsing package must be installed to the same path, and have the same filename as the files in ROM that are being eclipsed (except of course the drive is different). For instance:

;Example eclipsing package
&EN
%{"Symbian Software Ltd."}
:"Symbian Software Ltd."
#{"Hello World"},(0x18000091),1,1,0, TYPE=PU
"HelloWorld.exe"-"$:\sys\bin\HelloWorld.exe"
"HelloWorld.rsc"-"$:\resource\apps\HelloWorld.rsc"
"HelloWorld.mbm" - "$:\resource\apps\HelloWorld.mbm"
"HelloWorld_reg.rsc" - "$:\private\10003a3f\import\apps\HelloWorld_reg.rsc"

Specifying the target drive letter as $: (to denote the system drive) may be preferable to allowing the user to select it, because if the user chose to install the package to a removable drive, which was subsequently removed, the version on Z: would be in use again.

The upgrading package must have the same package UID as the stub SIS file. As this is always from the protected range, the eclipsing (and upgrading) package must have been signed by a signing authority.

The eclipsing package must either be of type PU (partial upgrade) or SP (patch). ROM files cannot be eclipsed using a standard full upgrade package, (TYPE=SA), because that would need to remove the original package in ROM.

The installer prevents a file from being eclipsed by two other files at the same time. For instance, if you install a file to C: that eclipses a ROM file, then an attempt to eclipse the file again, by installing to D:, will fail.

Eclipsing using a partial upgrade

An eclipsing package of type PU should have the same package name and global vendor name as the package it is eclipsing (because the changes made by a partial upgrade are considered to become a part of the original package). Such a package cannot be removed, although it is possible to install multiple partial upgrades with the same package name and UID, for example:

Eclipsing using partial upgrades

Eclipsing using partial upgrades

Eclipsing using a patch

Although a patch cannot overwrite files in a base package in RAM, it can eclipse files in ROM. An eclipsing package of type SP must have a different package name from the package it is eclipsing, because it subsequently can be removed separately from it. If two patches with the same package name and UID are installed, the second patch is treated as an upgrade of the first patch and will replace it entirely, for example:

Eclipsing using patches

Eclipsing using patches

[Top]


Augmentation of an OS component

An OS component can be augmented by the installation of a patch. A patch can subsequently be removed separately from the package it is augmenting.

It is possible to re-patch the package to fix any problems which the first patch may introduce. A patch can overwrite an existing patch, if both patches have the same package name.

An OS component does not necessarily need a stub SIS file in order to be patched. However, if the patch attempts to install any files to the component’s private directory, then a stub SIS file is required which specifies the relevant EXE. If the patch installs files to more than one private directory, all relevant EXEs must be specified in the stub file.

A patch (or any package) can install files to a component’s import directory (\private\<SID>\import\) without a stub SIS file present, (the purpose of the import directory is to enable other packages to install files to it). However, the import directory must already exist – the software installer will not create it.

If a stub SIS file is required, the patch must have the same package UID and non-localized vendor name as the package it is patching. The package name should be different in order to distinguish the patch from the existing component. The patch can have its own version number. The PKG file type for a patch is SP. For instance:

; Example patching package
&EN
%{"Symbian Software Ltd."}
:"Symbian Software Ltd."
#{"Hello World patch"},(0x18000091),1,0,0, TYPE=SP
; installs a file to the private directory – a stub SIS is required.
; the private directory is the SID, which in this case is not the same as the package UID
"patch.dat" - "!:\private\e800005a\patch.dat"

[Top]


Common problems

Here are some tips to avoid common problems that can occur when using ROM eclipsing.