From Mageia wiki
Jump to: navigation, search
this page is a draft.
It requires improvements. If you want to improve it, simply log in and click on the Edit tab.

Please remove this {{Draft}}template, when you're sure the page is complete and correct.


View the other draft pages, or other pages to improve and maintain.

Description

A product id is a string identifying a Mandriva distribution, release, product or media.

We need this in order to setup a catalog of our products in a web service. Our web apps will then cooperate on the same ids to deliver specific services, per product. System applications may use it too.

This id is stored in Mandriva Linux systems in the /etc/product.id file. It will likely be referenced/used by several web apps (see Mirrors API, Web_API).

This specification has been first written in June 2006, somehow implemented in 2007.0 and 2007.1, and has been consolidated in March, 2007.

Format definition

The id is a lowercase string of ASCII characters.

You may use uppercase characters if you like, but the string comparison/match MUST be done on a lower-cased string. That is, when querying any service (local or remote) lowercase characters values must be used.

The format used is a LDAP-like one, describing a tree with the following attributes.

attribute name short name sample values
vendor vendor Mandriva, PLF, other
distribution d Mandriva Linux
type t Base, Corporate, Corporate Server, Corporate Desktop
version v 10.2, 2006.0, 2007.1, 4.0
branch b devel, beta, rc 2, final
arch a i586, x86_64, x86_32, pcc, etc.
product p One, Free, Flash, Discovery, Powerpack, Powerpack+, MNF, Cluster, Desktop, Server, ...
media m main/release, backports/testing
build build 12612

A release is a published branch and is described as a (distribution name, version, type, branch, arch) set.

Defined objects have specific attributes, which may be fetched from a query to the product API (TODO).

All attributes are optional. Still, depending on those you use, you may have a valid, or invalid id. Depending on your query, you may need to set these or not.

Some of existing product ids

Note this list may be incomplete and is here for documentation purpose at this time.

  • Mandriva Linux 2007 Spring
    • vendor=mandriva,distribution=mandriva linux,type=base,version=2007.1,branch=final,arch=i586
    • vendor=mandriva,distribution=mandriva linux,type=base,version=2007.1,branch=final,arch=x86_64
  • Mandriva Linux 2008
  • Mandriva Linux 2009
  • Mandriva Linux 2010
  • Enterprise Server 5
    • vendor=Mandriva,distribution=Mandriva Linux,type=Enterprise,version=5,branch=Official,release=1,arch=i586,product=Server
    • vendor=Mandriva,distribution=Mandriva Linux,type=Enterprise,version=5.1,branch=Official,release=1,arch=i586,product=Server

Other, sample ids

Not necessarily used

vendor=Mandriva,d=Mandriva Linux,t=Base,v=2008.0,b=devel represents a cooker (branch=devel) 2008.0.

vendor=Mandriva,d=Mandriva Linux,t=Corporate Desktop,v=4.0,b=Beta 2,a=i586,m=main/release describes the main/release media for Corporate Desktop 4.0 Beta 2 for the i586 architecture.

vendor=Mandriva,d=Mandriva Linux,t=Base,v=2007.0,b=final,p=Flash describes the Flash system (not the hardware bundle), without specifying the target system architecture. If we were to describe the full product with the embed product, we would use: vendor=mandriva,d=mandriva linux,t=base,v=2007.0,b=final,p=flash,hardware=usb key,capacity=2gb

vendor=plf,d=mandriva linux,t=base,v=2006.0,b=final,a=i586,m=free/release would describe a 3rd party media.

Remind that the goal is the system may query web services, sending this full string, so to identify itself and retrieve information as accurate as possible for itself.

Attributes details

vendor

Typically the name of the entity publishing the object. Will mostly be "Mandriva" here, but may be a third-party as well.

distribution

The base name of the object (distribution here) is, or is about. "Mandriva Linux" in our case. May be should we rename it "object"?

type

Type of particular object. Here, "Base" for the historical line of the Mandriva Linux distribution (9.2, 10.1, 2006.0, 2007.1), "Corporate Desktop" and "Corporate Server" as for now.

Note that 2007.0 (and hence Flash) use "Basic" instead of "Base", as the spec was not definitive at the time.

version

The version of the object. Supposed to be a float, but may be a string.

branch

A particular branch of the object, which could be: "devel", "beta", "beta #", "rc", "rc #", "final".

Note that some products (2007.x, CS4, CD4) may use the "official" branch instead of "final". This is because at the time this spec was not specific enough, and the old "official" terminology was used.

arch

What system architecture this object is made for. May be an arch name (i586, x86_64, x86_32) or "noarch".

product

Specific product name. May be "One", "Free", "Flash", "Discovery", "Powerpack", "Powerpack+", "MNF", "Cluster". It is not supposed to match the full commercial name of the end-product, which is not in the product id scope (but in the product directory one - that is not set up yet).

media

Describe the software repository. Requires a fully defined system release before to be meaningful (that is, attributes vendor, distribution, type, version, branch and arch have to be set). Must be the name of an available media (main/release, contrib/updates, etc.).

build

Any incremental version number representation allowing to compare same products with different builds. The value representation is free provided it is consistent for the same product. However, if you are not sure, it is recommended to use a decimal timestamp or a ISO 8601 date time representation, possibly in UTC (for instance: 2008-11-22T06:00:00Z).

Expected usage, behaviour

  • programs (and system) must rely on this id to query webservices and identify themselves; that is, instead of using/sending the /etc/release string alone, they should use this one;
  • programs must rely on this id and to its related description to have detailed information about the product; the description will be published on a webservice, but the same description should be embedded along the product id on the system so offline operations are available; online and embedded descriptions must be the same; this could be media.cfg, but this is not xml...
  • if the product id is invalid, no valid answer from any service should be expected (from the service point of view, it would be just a bad request).

This file should contain the same document as published by the product API for this very id. It would something like:


Parsing the product id string

TODO

Querying the product catalog

TODO

The Product API may be queried with either the full id string: http://api/product?id=[ID] or with parts of it: http://api/product?vendor=Mandriva or http://api/product?version=1503.0. Depending on the query, the results returned will differ: either a list of possible matches (for one vendor, we have many things; for one version, we have several branches, etc.), either an object (a distribution, a type, a version, a branch, a product).

To satisfy point 2. above, the id could be embedded directly in the XML document as well:

<product xmlns="http://api/product" id="...">
</product>

Other descriptive system files/ids

/etc/release

(or /etc/mandrakelinux-release, /etc/mandrake-release, /etc/mandriva-release depending on the system)

Some of existing /etc/release strings:

  • Mandriva Linux release 2006.1 for i586
  • Mandriva Linux release 2006.2 (Official) for i586
  • Mandriva Linux release 2006.1 (Cooker) for i586
  • Mandriva Linux release 2006.0 (Official) for i586
  • Mandriva Linux release 2006.0 (Official) for x86_64
  • Mandrakelinux release 10.0 (Official) for i586
  • Mandrake Linux release 9.2 (Official) for i586
  • Mandrakelinux Corporate release 3.0 () for i586
  • Mandrakelinux MNF release 2.0 () for i586

So the format regexp would be like:

/(Mandrakelinux|Mandrake Linux|Mandriva Linux|Mandrivalinux)( Corporate( Server| Desktop)?| MNF)? release ((?:\d|\.)+) (?:\((.*)\) )?for (.*)/

to return this data distribution, type, release, branch, arch .

Proposed: some programs still rely on this one, so it should not be tampered with for now, but deprecated, and generated from the new product id.

/etc/sysconfig/system#META_CLASS

(download, desktop, server or powerpack or...?

Proposed: some programs still rely on this one, so it should not be tampered with for now, but deprecated, and generated from the new product id.

/etc/version

with format Version.Minor.Subversion devel_state extra info .

Community version ends with 0 (2006.0.0), Official version ends with 1 or more (2006.0.1):

  • 2006.0.1 2.0.20060 Metal Platinum (Official 2006.0 x86_64 Powerpack)
  • 2006.1.0 0.2 (this is a 2006.1 community version beta release number 2)
  • 2006.0.1 1.0 (this is 2006.0 Official version stable version)

Proposed: some programs may still rely on this one, so it should not be tampered with for now, but deprecated, and generated from the new product id. If the product id format does not contain enough info still, please comment.


ISO disc image header fields

[romain@zebulon ~]$ isoinfo -d -i mandriva-one-2007-free-kde.iso
CD-ROM is in ISO 9660 format
System id: LINUX
Volume id: MDVCDROOT
Volume set id:
Publisher id:
Data preparer id:
Application id: MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING
Copyright File id:
Abstract File id:
Bibliographic File id:
Volume set size is: 1
Volume set sequence number is: 1
Logical block size is: 2048
Volume size is: 356684
El Torito VD version 1 found, boot catalog is in sector 42
Joliet with UCS level 3 found
Rock Ridge signatures version 1 found
Eltorito validation header:
    Hid 1
    Arch 0 (x86)
    ID 
    Key 55 AA
    Eltorito defaultboot header:
        Bootid 88 (bootable)
        Boot media 0 (No Emulation Boot)
        Load segment 0
        Sys type 0
        Nsect 4
        Bootoff 2B 43

We have the following fields we can set as ASCII strings:

Field name Max size Suggested contents
System id 32 bytes LINUX
Volume id 32 bytes Mandriva Linux 2007 Spring 2/3
Volume set id 128 bytes Mandriva Linux 2007 Spring Powerpack, code=2007S-PWP, build=4401
Publisher id 128 bytes Mandriva - http://www.mandriva.com/
Data preparer id 128 bytes username
Application id 128 bytes
Copyright File id 37 bytes
Abstract File id 37 bytes
Bibliographic File id 37 bytes

(see http://alumnus.caltech.edu/~pje/iso9660.html)

Notes:

  • System id is currently set mostly as "LINUX" for Linux-based systems. Suggested: keep it this way.
  • Volume id and Volume set id are tied (see http://docs.hp.com/en/B9106-90011/cdrom.4.html , "Volumes and Directory Hierarchies" §):
    • Volume set id gets the full commercial name of the product, the commercial product id, and iso build number. The "build=###" and "code=###" strings are mandatory. The build number should be automatically set by the script making the ISO. This string should not appear directly to the user, but may be used for other purposes (debugging, QA, others).
    • Volume id (which may be displayed as the volume name) gets the product name, optionally its index in a set of volumes; note, however, that:
      • for Windows systems, the volume name may be set in the autorun.inf file,
      • for MacOS systems, ?
      • for Linux systems, ?
  • Publisher id must be "Mandriva - http://www.mandriva.com/".
  • Data preparer id should be the user name of the person making the disk image (example: blino).
  • Copyright file id points to the LICENSE file (in English).
  • Abstract file id points to a README file?
  • Bibliographic file id: no idea what this file is for.

Then, when a product is installed, if possible, the build value should be extracted and appended to the /etc/product.id string.

See:

  • isoinfo utility (in cdrecord-isotools or cdrkit-isotools)

Discussion

Discussion about it may happen on mdv-distro-tools or web-discuss mailing lists.