-
Notifications
You must be signed in to change notification settings - Fork 44
Installation Media Types
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.
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.
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 EULA (the product license) is read from a tarball archive from the media root. The expected tarball name is license-<product>.tar.gz
.
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.
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 contains the installation system (the very same as the Online medium) and several repositories with base products and addons in separate subdirectories.
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 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 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.
- 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.
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>
Here are some common code snippets and examples related to the Online and Full installation media.
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 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.
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
Links to the Online/Full media related classes and methods:
- Detecting the medium type
- Parsing the repository metadata to find the (base) products
- Y2Packager::ProductLocation.scan - the high level scanner
- Y2Packager::RepomdDownloader - downloading the metadata
- Y2Packager::SolvablePool - loading and parsing the metadata
- Y2Packager::ProductFinder - evaluating the products
- Note: When scanning the repositories we skip the GPG signature checks to make it faster, but the selected product repositories are later added via libzypp with full checks so there is no security issue.
- Reading the products from
control.xml
- Adapting the installation workflow
ℹ️ 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.
- Medium type detection: https://github.com/yast/yast-packager/pull/472
- Tarball license support: https://github.com/yast/yast-yast2/pull/958 (https://github.com/yast/yast-yast2/pull/961)
- Reading products from the
control.xml
file: https://github.com/yast/yast-yast2/pull/962, https://github.com/yast/yast-yast2/pull/963 - Adjusted repository initialization, product license: https://github.com/yast/yast-packager/pull/474
- Adapted the registration step: https://github.com/yast/yast-registration/pull/444
- Updated product selection in the welcome screen: https://github.com/yast/yast-installation/pull/815
- Updated
control.xml
schema to allow specifying the base products: https://github.com/yast/yast-installation-control/pull/90, https://github.com/yast/yast-installation-control/pull/91 - Added the base products, updated the workflow: https://github.com/yast/skelcd-control-leanos/pull/40
- https://github.com/yast/yast-registration/pull/454
- https://github.com/yast/yast-yast2/pull/973
- https://github.com/yast/yast-installation/pull/822
- https://github.com/yast/skelcd-control-leanos/pull/46
-
control.xml
update: https://github.com/yast/skelcd-control-leanos/pull/45 - Run the registration step earlier so it can add the needed repositories from SCC (the DVD does not contain any repository): https://github.com/yast/yast-autoinstallation/pull/530
- Adapt the
Write
function in registration: https://github.com/yast/yast-registration/pull/452 (unit test fix: https://github.com/yast/yast-registration/pull/453) - fix caching partial product https://github.com/yast/yast-autoinstallation/pull/539
- skip repo init https://github.com/yast/skelcd-control-leanos/pull/47
- use proper registration target https://github.com/yast/yast-update/pull/136
- Skip the registration step on the Full medium (on online as well): https://github.com/yast/skelcd-control-SLES/pull/126
- Fixed repository initialization: https://github.com/yast/skelcd-control-leanos/pull/42
- Fixed product selector and license confirmation: https://github.com/yast/yast-packager/pull/475
- Automatically offer the addons from the medium: https://github.com/yast/yast-add-on/pull/86
- Make products compatible: https://github.com/yast/yast-packager/pull/476
- Adapt the installer for the Full medium: https://github.com/yast/yast-installation/pull/819
- Do not add the empty repo from the root: https://github.com/yast/yast-packager/pull/477
- Enable registration on the Full medium: https://github.com/yast/skelcd-control-SLES/pull/128, https://github.com/yast/skelcd-control-SLED/pull/94, https://github.com/yast/skelcd-control-SLE_RT/pull/12, https://github.com/yast/skelcd-control-SLE_HPC/pull/22
- Skip repository initialization: https://github.com/yast/yast-installation/pull/826
- Read
register_target
fromcontrol.xml
: https://github.com/yast/yast-update/pull/139 - Initialize the packager and add the base product repository from the medium: https://github.com/yast/yast-registration/pull/458
- Preselect the installed add-ons: https://github.com/yast/yast-packager/pull/487
- Support product renames (e.g. upgrade from SLES11): https://github.com/yast/yast-registration/pull/459
- Autoyast support https://github.com/yast/yast-autoinstallation/pull/537
- Updated the medium name to "Full": https://github.com/yast/skelcd-control-leanos/pull/49
- Do not allow skipping registration: https://github.com/yast/yast-registration/pull/460, improved messages: https://github.com/yast/yast-registration/pull/461