SDB:Generating YaST Installation Sources

From openSUSE


Version: 9.0 - 10.0

Contents

Situation

You want to offer an installation source for a SUSE LINUX version.

Procedure

There are two types of installation sources for YaST, plain cache and "real" YaST sources.

Plain Cache Sources

A Plain Cache source is a directory containing RPM files. For YaST to recognize a directory as plain cache source, you must create a file (IS_PLAINcache) that contains the RPM header information of the available RPM packages. YaST needs the package data (name, version, dependencies, etc.) from the .rpm file in order to avoid reading the file over and over again. For large packages, this would result in extremely long transfer times, even if you do not want to install the package. Therefore, the needed package data is extracted from the packages and stored in a file.

This file can be create with the genIS_PLAINcache utility, which is included in the package yast2-packagemanager starting from SUSE LINUX 9.0.

Advantages
  • Easy to generate
Disadvantages
  • Source RPMs (src.rpm) are not supported
  • Multiple architectures (i586, i686, noarch, ppc, etc.) are not supported
  • No description of the installation source in YaST
  • genIS_PLAINcache is a binary (not a script) that only runs on SUSE systems
Example

You have a directory with a number of binary RPM files on your server and want to make it available as YaST installation source via HTTP or FTP.

/srv/www/htdocs/suse/RPMS/
                          `- software1-1.0-1.i686.rpm
                          `- software2-1.0-1.i686.rpm
                          `- software3-1.0-1.i686.rpm
                          `- test/
                                  `- test1-0.99-1.i686.rpm
                                  `- test2-0.99-1.i686.rpm
                                  `- test3-0.99-1.i686.rpm

Run the following commands in order to generate a plain cache source:

cd /srv/www/htdocs/suse/RPMS/
genIS_PLAINcache -f -r .
gzip genIS_PLAINcache

Subsequently, you can add the directory as installation source in YaST -> Change Source of Installation. Note the restrictions mentioned above.

YaST Sources

A "real" YaST source consists of several files and directories that describe the installation source and its content: binary RPM files for various architectures and the respective source RPM files. Some of the descriptive files can be generated with the create_package_descr script, which is available in the package autoyast2-utils starting from SUSE LINUX 9.0.

Advantages
  • Source RPMs are supported
  • Multiple architectures are supported
  • The description of the installation source is displayed in YaST
Disadvantages
  • Not so easy to generate

The description of the installation source is split in several files:

  • media.1/
       `- media
  • content
  • directory.yast
  • setup/descr/
           `- packages
           `- packages.DU
           `- packages.en
media.1/media

The file media.1/media contains a medium description consisting of the following components:

File: media.1/media
Content: <Author>
<Date of creation (YYYYMMDDHHMMSS)>
<Number of media>

Example:

Packman
20040027150052
1

Tip: The date string can be generated with the date utility: date +%Y%m%d%H%M%S

content

The content file contains a medium content description consisting of the following components:

Key Content
PRODUCT Product name
VERSION Product version
VENDOR Product vendor
LABEL Source designation to be used in YaST
ARCH.<base> Supported architectures for the base architecture
DEFAULTBASE Default base architecture, in case the base architecture cannot be determined by YaST
DESCRDIR The directory containing the package descriptions
DATADIR The directory containing the packages

Example:

PRODUCT Packman
VERSION 9.0-0
LABEL Packman (SUSE LINUX 9.0)
VENDOR Packman Packager Team
ARCH.i686 i686 i586 i486 i386 noarch
ARCH.i586 i586 i486 i386 noarch
DEFAULTBASE i586
DESCRDIR setup/descr
DATADIR RPMS
directory.yast

YaST uses the file if the installation source is addressed by means of a protocol that does not support directory listing (such as HTTP). This file can easily be generated with the ls utility:

ls -A1 > directory.yast

Example:

RPMS
content
directory.yast
media.1
setup
setup/descr/*

These files can be generated with the create_package_descr script. They contain the dependencies, the size, and the package descriptions of all packages in the installation source.

Example

Your FTP server has a directory containing binary and source RPM packages for SUSE LINUX. Most binary RPM packages are available for two architectures (i586/i686). Moreover, some scripts are packed in architecture-independent RPM packages (noarch). You want to offer this directory as YaST installation source for SUSE LINUX 9.0.

/srv/ftp/pub/linux/suse/9.0/RPMS/
                                `- i586/
                                |      `- software1-1.0-1.i586.rpm
                                |      `- software2-1.0-1.i586.rpm
                                `- i686/
                                |      `- software1-1.0-1.i686.rpm
                                |      `- software2-1.0-1.i686.rpm
                                `- noarch/
                                |        `- script1-1.0-1.noarch.rpm
                                |        `- script2-1.0-1.noarch.rpm
                                `- src/
                                      `- software1-1.0-1.src.rpm
                                      `- software2-1.0-1.src.rpm
                                      `- script1-1.0-1.src.rpm
                                      `- script2-1.0-1.src.rpm

To generate a "real" YaST source from this directory, execute the following commands:

cd /srv/ftp/pub/linux/suse/9.0/
mkdir media.1
touch media.1/media
touch content
ls -A1 > directory.yast
create_package_descr -d RPMS/

Further Documentation

Further documentation regarding the YaST installation sources is available in the package yast2-packagemanager-devel.