Skip to content

Installation Media Types

Ladislav Slezák edited this page Jun 21, 2021 · 21 revisions

💿 The Online and Full Installation Media

The SUSE Linux systems are distributed as ISO images, there are basically these media types (for SLE15-SP2 or newer):

  • Standard - the medium contains one big repository with all packages (the old SLE-12 and older media or the current openSUSE Leap/Tumbleweed media)
  • Online - the medium does not contain any repository at all, the repositories are added from a registration server (SCC/SMT/RMT) after registering a base product
  • Full - the medium contains several repositories with base products and several addons, each repository is in a separate subdirectory. The base product repositories only contain the product packages, to have a working system at least the Basesystem module needs to be added.

Details

💻 The Online Medium

The online medium is very small and contains only the files needed for booting the system (kernel + initrd) and starting the installer (the inst-sys images with the YaST installer and needed tools). There are no RPMs to install.

The Base Products on the Online Medium

Usually the available base products are read from some package repository on the installation medium. But as the online medium does not contain any repository we have to use another source.

Currently the available base products are hard-coded in the control.xml, that is not optimal as it does not allow to change the products easily and we need to keep the products (and their versions) in sync with the SCC manually. In the future the base products should be read directly from the registration server, that will keep the products in sync and even allow to change the set of products after the release.

The Online Media EULA

The EULA (the product license) is read from a tarball archive from the media root. The expected tarball name is license-<product>.tar.gz.

The Specific Online Media Features

The system must be first registered to have access to some repositories and packages. This is quite unusual as normally YaST have access to the packages very early in the installation process. That required some changes in the code and postponing several steps which require an installation repository.

The AutoYaST Support

When using AutoYaST with the Online medium make sure the registration section is present in the XML installation profile, otherwise there will be no available package to install.

Example:

<suse_register>
<do_registration config:type="boolean">true</do_registration>
    <email>[email protected]</email>
    <install_updates config:type="boolean">true</install_updates>
    <reg_code>my-secret-registration-code</reg_code>
    <addons config:type="list">
      <addon>
        <name>sle-module-web-scripting</name>
        <version>15.2</version>
        <arch>x86_64</arch>
        <release_type>nil</release_type>
        <reg_code/>
      </addon>
    </addons>
</suse_register>

💿 The Full Medium

The full medium contains the installation system (the very same as the Online medium) and several repositories with base products and addons in separate subdirectories.

The Base Products on the Full Medium

To find the base products on the medium we need to scan all repositories (subdirectories) and find which products are there. The medium can contain more than twenty repositories, it turned out that using libzypp for this is very slow. Therefore we use libsolv directly for parsing and evaluating the metadata in the repositories.

The Full Media EULA

The EULA for the selected base product is read from the <product>-release RPM package from the product repository after adding it. (The license is stored in the /usr/share/licenses/product/<product> directory in the RPM, it is also available in the installed system.)

The Specific Full Media Features

The base products on the Full medium are stored in separate repositories (subdirectories). That means we can add the respective repository only after the user selects a base product to install. The other base product repositories must not be added to the system because the product packages would cause conflicts.

The base product repositories contain only the base product data (the <product>-release and release-notes-<product> RPM packages), the other packages needed for system installation are included in the modules. That means you need to at least add the Basesystem Module otherwise there is nothing to install. And we should offer the available addons automatically to the users.

User Notes

  • When upgrading from SLE15 the installed modules are preselected when selecting the modules for upgrade.
  • When upgrading from older releases some modules might not be preselected (most likely the ones which have been renamed or merged with some other module), it might include even the required Basesystem module. These might need to be selected manually.

The AutoYaST Support

When using the AutoYaST installation with the Full medium make sure the XML profile contains at least the Basesystem module add-on, otherwise the installer cannot install even the minimal system.

Example:

<add-on>
  <add_on_products config:type="list">
    <listentry>
      <name>Basesystem</name>
      <product>sle-module-basesystem</product>
      <product_dir>/Module-Basesystem</product_dir>
      <media_url>relurl://</media_url>
    </listentry>
  </add_on_products>
</add-on>

The Code

Here are some common code snippets and examples related to the Online and Full installation media.

Checking the Type of the Medium

Because there are some fundamental differences between the installation media sometimes we need to do an action only on some specific medium type.

# available since yast2-packager-4.2.25
require "y2packager/medium_type"

if Y2Packager::MediumType.online?
  # do something specific only on the online installation medium,
  # similarly there are `offline?` and `standard?` methods.
end

# when you need to handle all cases use Y2Packager::MediumType.type
case Y2Packager::MediumType.type
when :online
  # code for the online medium
when :offline
  # code for the full medium
when :standard
  # code for the standard medium
else
  # just in case there is a new media type added in the future
  log.error "Unknown installation medium type: #{Y2Packager::MediumType.type}"
end

Note: the media type detection does not make sense in an installed system, if the code can be possibly executed outside the installation workflow then add the Stage.initial condition:

if Stage.initial && Y2Packager::MediumType.online?
  # do something
end

The Installation Workflow

The control.xml file which drives the installation process is the same for both Online and Full media. But in some cases we need to change the order of the installer steps, run additional steps or skip some steps depending on the installation medium type. E.g. run the registration on the Online medium, but skip it on the Full medium.

There is no generic support in the WorkflowManager module, each module needs to be specifically adapted.

Examples

A snippet from the control.xml file:

<module>
    <label>Registration</label>
    <name>scc</name>
    <!-- only on the Online installation medium -->
    <arguments>
        <only>online</only>
    </arguments>
</module>

The only tag can contain multiple values separated by commas, e.g. <only>online,offline</only>. Alternatively you can use <skip> tag which has the opposite meaning, the step is skipped on the matching medium, e.g. <skip>online</skip> will skip the client on the online medium, it will run on the other media.

A snippet from the respective YaST client:

# inst_scc.rb client code
require "y2packager/medium_type"

# this evaluates the current installation medium type and the "only" and "skip"
# arguments and returns `true` if the current step should be skipped
if Y2Packager::MediumType.skip_step?
  log.info "Skipping the client on the #{Y2Packager::MediumType.type} medium"
  return :auto
end

The Implementation Details

Links to the Online/Full media related classes and methods:

The Pull Requests

ℹ️ For you reference here is the list of the pull requests which implemented the basic support for the Online and Full media. The list might not be complete, there might be some more pull requests with later fixes or enhancements.

The Online Medium Pull Requests

Installation
Upgrade
AutoYaST
AutoUpgrade

The Full Medium Pull Requests

Installation
Upgrade
AutoYaST

The Generic Pull Requests

Clone this wiki locally