Novell Home

Education/Add-On Media

From Developer Community

Wherewith do you teach tomorrow?
First Add-On Media Layout.
Enlarge
First Add-On Media Layout.

The Add-On Media

The look behind: the development of the Education-DVD...


Contents


Repo-Preparation (Meta-Packages)

The pattern-education-desktop and pattern-education-server packages contain the pattern files which can be found later in CD1/suse/setup/descr/*.pat (*.pat.gz since openSUSE 10.3) and also xml-pattern files to create *.ymp files. We create the patterns "on the fly" via a couple of textfiles, which are merged dynamically during the build of the package. So we can use one central place for creating patterns for all distributions and architectures. If we add or remove a package from a pattern file, we re-submit the package to the buildservice - and all patterns for all distributions are in sync again.

A good description of the pattern content is available here.

The skelcd-education-desktop package contains all files, which are extracted on the media. For example:

  • README* (small Readme-Files)
  • autorun.inf (for users who inserted the CD on a windows client)
  • gpg-pubkey-*, pubring.gpg (the official openSUSE-Education GPG-Key - armor exported. All RPMs from openSUSE-Educaiton are signed with this key)
  • documentation in plain text
  • installation.xml which adapts the YaST2-workflow (see Creating Add-Ons)
  • ...

Currently we use /CD1/ as base directory and place all files below this directory in the same way the would be placed on the real media. So you would find the README files in /CD1/README if you install the skelcd-education package as root on your system.

As we need some adjustments for every distribution and architecture, the skelcd-education package is also checked in to the education buildservice repository. Currently we use it for creating the content-, the README- and media-files with the right strings for each distribution and arch.

But using a rpm for this gives us more options for the future. Perhaps the package can require all packages in the pattern files as build requires - so we can be shure that a package exists for a distribution _bevore_ we add it as required package in the pattern, or we ignore some packages for a specific architecture, or we replace some strings in the readme and content files in each distribution or architecture...

Unpacking the meta packages

As we don't want to place all files for all distributions in the same /CD1/ directory to create our Repositories, we use the command unrpm (a bash-script which comes with the package build) and move the package content to the right place after extraction.

You can find more information about the "meta" files on the media here.

Preparing the packages

To get all available packages right when we need them, our CD-Creation server mirrors the Education:desktop and Education:server repository for all distributions, where we want to create CDs and repositories.

So the next step, after unpacking the meta-packages to the right location is to move all build packages to their directories in the repository.

We use the Vendor target "openSUSE-Education" in all our packages, So YaST can detect packages from us and we can update them later.

As the buildservice currently doesn't support own GPG keys, we resign all packages on their new location with our own GPG key (the one you can find in the root-directory of the CD). Yes: this is a small security hole as we currently can't be shure that we get the right packages from the buildservice - but this is what we can get so far...

Now we use some scripts from the inst-source-utils package and some simple bash scripts to create the dynamic meta files on the CD.

For our examples below, we use

  • /CD1/ as root directory ROOTDIR
  • suse/setup/descr as DESCRDIR
  • suse/ as RPMDIR
  • media.1/ as MEDIADIR
  • docu/ as DOCUDIR

Create patterns file

The patterns file contains all pattern files. So YaST knows in a very early step all about the available pattern files. The creation of the patterns file is so simple that we just need a single "ls" for it:

pushd $DESCRDIR 1>/dev/null
ls -A1 *.pat* > patterns 2>/dev/null
popd 1>/dev/null

Create MD5SUMS and directory.yast files

The MD5SUMS file contains the MD5SUMS of all files in a directory. YaST compares the md5sum in this file with the downloaded file to check for transmission errors.

The file directory.yast contains the whole directory content. Some FTP-Servers don't allow directory listings - but YaST needs to know which files are available in a directory to save time (for example: have a look in the i586 directory of the openSUSE-10.3 distribution) and sometimes to redirect to another workflow (if the file licence.zip is available in media.1/media - display it; if not, search for the file licence.txt in the same directory...).

So we create the files for each needed directory:

for dir in . boot $MEDIADIR $DESCRDIR; do
    create_directory.yast $dir
fi
create_md5sums .

Create SHA1-Entries in content file

To improve security, YaST searches for SHA1-Sums for some important files in the $ROOTDIR/content file since 10.1:

  • $DESCRDIR/*
  • /gpg-pubkey*
  • /pubkey*

The script create_sha1sums.sh from inst-source-utils does this job.

Signing content and products file

Now we have to sign the $ROOTDIR/content and the $MEDIADIR/products file with our the GPG-Key.

gpg -a -b $ROOTDIR/content
gpg -a -b $MEDIADIR/products

and place our amor-exported GPG key there, too.

cp ~/gpg-pubkey $ROOTDIR/content.key
cp ~/gpg-pubkey $MEDIADIR/products.key

Create the ISO image

Last step: use mkisofs to create the ISO image. The steps above should have created a valid online-repository already (you can test it with YaST, adding the $ROOTDIR as repository). So the commandline looks like:

DIST=10.3
RELEASE=Alpha1
ISODIR=/tmp
REPODIR=/CD1/
ISONAME=openSUSE-Education-$DIST-$RELEASE.iso
mkisofs -p 'http://www.opensuse-education.org/' \
-publisher 'openSUSE-Education Team' -r -J -f -pad \
-A OSSEdu-$DIST -V Edu${DIST}.001 \
-o $ISODIR/$ISONAME \
$REPODIR

Now all together: the scripts

As you already noticed, most of the steps above are scriptable. Currenlty we've simple scritps for syncing and creating the repository. You can find them as extra directoy in our SVN: https://forgesvn1.novell.com/viewsvn/education/trunk/packages/opensuse-education-tools/trunk/opensuse-education-tools/

  • doit.sh - this is the "master" script which does all the magic by sourcing a central config file and calling all the other scripts. If everything is configured, just call this scripts and in the end you'll get your ISO-Image and the Online-Repository.
  • make_testrepo.pl - takes the sourcedir (directory containing the synced RPMs) and the targetdir (directory which should contain the repository) as arguments. Afterwards it unpacks the meta-packages found in the sourcedir and places all other packages in the standard directories (suse/<arch>/) in the targetdir. It also checks if a package is available in multiple versions and in this case just takes the newest one - and it checks that all packages have their corresponging source package.
  • rsync_repos.sh - this is a simple sync script which syncs all packages from other repositories (the buildservice) into the local sourcedir (so the make_testrepo.pl script has something to do)
  • sign - is a small wrapper script which allows to (re-)sign RPMs and also single files in a directory.
  • vc - this script is described in the Packaging section.


The development of pattern files

Patterns are responsible for the "grouping" of packages in the YaST2 Software Management. You can find the "plain text" patterns in datadir of the repository (in 10.2 they have the ending *.pat).

We currently use the patterns to provide a group of packages for:

  • education-desktop (General applications for education)
  • kids-education-desktop (Applications for small kids (up to 12 years old)
  • youth-education-desktop (Applications for teenagers (from 12 up to 18 years)
  • edu-server (Applications for the server - not selected per default)
  • kiwi-ltsp (LTSP Applications - not selected per default)
Education Patterns shown in YaST2 Software Management
Enlarge
Education Patterns shown in YaST2 Software Management

Patterns can:

  • Require other patterns or packages (they must be installable or the pattern is broken)
  • Recommend other patterns or packages (those are installed if all resolvables are fulfilled - but dropped without warning if this isn't the case)
  • Suggest other packages (they are just displayed in the packages list, but must be selected manually be the user)

Pattern development using Subversion

All Education pattern files are created as normal RPM packages and are "developed" using Subversion and a simple directory and file structure. So neither adding packages nor translating the descriptions is a big deal.

Here are some examples:

  • Suggested packages in the youth-education-desktop pattern. The packages here are shown in the "yast2 sw_single" module, but not installed per default.
  • Recommended packages in the youth-education-desktop pattern. Packages listed in this file for the pattern youth-education-desktop are installed if their dependencies are ok - without user interaction. But a user can de-select them if he wants.
  • Russian description of the pattern file shown in the YaST module.

If someone want's a new package to be installed per default if the youth-education-desktop pattern is selected, all what's left to do is to add the package name in the file for the recommended packages above.

If someone want's to translate the pattern file into his prefered language, he can checkout the english files Cat, Des and Sum, translate them and submit them back with the locale ending of his language (for example Cat.fr, Des.fr and Sum.fr for francais).

From time to time we update the "patterns-education-desktop" and "pattern-education-server" package in the Build Service with a new checkout from the subversion repository - and all changes are placed in the resulting repository more or less automatically (see above).

Novell® Making IT Work As One

© 2009 Novell, Inc. All Rights Reserved.