Generating a delta file

You can generate your own delta file to update your system to a target version.

To generate a delta file, you must have a version of the Red Bend tools with the same major revision (currently v8.x) as the Software Updates app used by the QNX CAR platform. The file contents are based on the source and target version trees. The source tree must match the version of software that's currently running on your system. The target tree is always the version of software that you want to upgrade to.

These instructions also assume that you're running the update-generation process on an Ubuntu Linux system; Windows hosts aren't currently supported.

Note: Before you can generate the delta file, you must first obtain a configuration file to control the delta generator (this process is described in the Red Bend Integrator's Reference manual). Step 1 in the following procedure shows how to create your own configuration file.
To generate a delta file:
  1. If necessary, create the main configuration file by copying the following content into a new XML file:
    <vrm>
        <DeltaType>update</DeltaType>
        <ComponentDeltaFileName>
            QNXCAR2-myname-from_version-to_version.mld
        </ComponentDeltaFileName>
        <RamSize>0x20000000</RamSize>
        <Statistics>stats_from_version-to_version.txt</Statistics>
        <keepinvaliddelta>1</keepinvaliddelta>
        <partition>
            <PartitionName>apps</PartitionName>
            <PartitionType>PT_FS</PartitionType>
            <MountPoint>/</MountPoint>
            <SourceVersion>source</SourceVersion>
            <TargetVersion>target</TargetVersion>
            <ExcludeSourceFilter>filter.xml</ExcludeSourceFilter>
            <ExcludeTargetFilter>filter.xml</ExcludeTargetFilter>
        </partition>
    </vrm>
    
    The listing above contains the recommended contents for the configuration file. The <ComponentDeltaFileName> tag names the delta file. The required filename format depends on whether you want to apply the update through the HMI or the command line. If you want to use the HMI, your filename must follow the format QNXCAR2-myname-from_version-to_version.mld, where:
    myname
    An optional substring you can use to make the filename more readable.
    from_version
    Decimal number of the version of the source tree.
    to_version
    Decimal number of the version of the target tree.
    Note: To find the source version number, look in /etc/os.version (it's the number next to buildNum, for example, 5346). The location of the target version number depends on your system provider. It may be in the name of the archive file that contains the filesystem image of the target version or it may be listed on your system provider's download webpage.

    If you want to use the command line to apply the update, your filename must be mydelta.mld; in this case, you don't need to include the source and target version numbers in the filename.

    In this example, the statistics file is given a name (in the <Statistics> tag) that contains the source and target version numbers, but you can assign any name to this file.

  2. If necessary, create the filter definition file that's used by the main configuration file by copying the following content into a new XML file:
    <FilterFile version=1.0>
        <ExcludeSourceFilter>dos/qnx-ifs</ExcludeSourceFilter>
        <ExcludeTargetFilter>dos/qnx-ifs</ExcludeTargetFilter>
    </FilterFile>
    

    In this example, you would name the filter definition file filter.xml so it will be picked up by the main configuration file created in Step 1.

    This additional XML file defines the filters that prevent the boot image of the DOS partition on the system's SD card from being overwritten during the update.
  3. In the directory where you plan to run the update generator, create two new subdirectories called source and target.

    The source directory will contain the filesystem image that matches what is currently running on your system. The target directory will contain the filesystem image that your system will run after the update.

    Note: When unpacking the filesystem image files, make sure to use sudo and to include the -p option when running tar. Since the permissions of some of the files in the image are owned by root, it's important not to modify them during this process.
  4. In the source directory, unpack the filesystem:
    # cd source
    # sudo tar xmzpf ../board.variant.version.tar.gz 
                base dos var/pps/qnxcar/system/info
    

    where board.variant.version.tar.gz is the name of the source filesystem image.

    Note: When listing the files to unpackage in the tar command, don't include any files from the user data partition, which is mounted to '/', except for /var/pps/qnxcar/system/info. You must prevent user data from being overwritten by the update so you can retain your preferred settings for all apps. You can specify a more restricted set of files than what's shown in the sample tar command to further narrow the scope of the update.
  5. In the target directory, unpack the filesystem image of the build that you want to update your device to:
    # cd ../target
    # sudo tar xmzpf ../board.variant.version.tar.gz 
                base dos var/pps/qnxcar/system/info
    

    where board.variant.version.tar.gz is the name of the target filesystem image.

    Note: As in Step 4, don't include any files from the user data partition in the list of files to unpackage (except for /var/pps/qnxcar/system/info).
  6. Run the update generator, using sudo privileges:
    # sudo ./vRapidMobileCMD-Linux.exe /type=vRM 
                /configuration_file=./deltaConfig.xml
    

    where deltaConfig.xml is the name of the file you created in Step 1.

    An update (delta) file with a name in the format QNXCAR2-myname-from_version-to_version.mld will be written to your current directory. You'll use this file to update your system.