Linuxrc/Creating Modified Installation System

From openSUSE

Contents

About

We have been having a new installation system since openSUSE 11.0 Alpha2. Until that version, installation system had been just one file or directory (forget the root.fonts file :))

  • Q: What is the modified installation system good for?
  • A: Very often it is the only way how to test and develop new installation features and how to test bugs and their fixes.

This article has been written as a new version of the Creating customized installation source article because although the old article doesn't work for openSUSE 11.0 and later, it is still valid for openSUSE 10.3 and other products based on openSUSE before 11.0.

Current Installation System

The current installation system is made of these squashfs images:

  • inst-sys directory, e.g. /boot/<arch>/
    • config - describes all the installation parts and how should they behave
    • directory.yast - lists all files in the directory (for HTTP, FTP, ... sources)
    • common - part of the installation system which is used for both root and rescue
    • root or rescue - only one of them is used according to which mode has been selected in Linuxrc
    • root.<lang> - several parts that contain translations (loaded on-the-fly only when needed)
    • root.fonts - fonts used for installation

How the inst-sys made of particular pieces is described in the config file.

  • image - image is mandatory
  • ?image - image is optional, it is loaded if it exists
  • image.<lang> - image matches the currently selected language

Unpacking the Installation System

All images are currently compressed as squashfs images. At first copy all the needed file from installation media /boot/<arch>/ directory somewhere to the installation server. The easiest one is a NFS server but it, for instance, works well for HTTP or FTP server too.

Our example uses /install directory for unpacking the installation system but you can use whichever you want, e.g., /srv directory.

 mount /dev/sr0 /media/DVD
 mkdir -pv /install/modified-inst-sys
 cp -rv /media/DVD/boot/i386/. /install/modified-inst-sys/

Now, you have all the stuff copied to /install/modified-inst-sys/ which will be used as an instsys parameter for Linuxrc.

Modifying the Installation Images

The most important images are common and root because they contain the vitally important files for installation system. Our example describes modifying the root but it works similarly for all other squashfs images.

The config file describes that root file (or directory) should be loaded in case of installation. There are several possible options how to modify the inst-sys directory but we will describe only two: Unpacked root file and Repacked root file with modifications.

Of course, the root file can be renamed to any name but we would have to change the config file accordingly. Our example does not want to change the config file.

Unpacking the root file

Unpacked installation system works for NFS installation sources, for HTTP or FTP use the next paragraph (Repacked root file).

This example describes how to unpack the root squashfs image to a directory with the very same name root.

 cd /install/modified-inst-sys/
 mv -v root root.old
 mkdir -pv mounted_root
 mount -o loop -t squashfs root.old mounted_root
 mkdir -pv root
 cp -rv mounted_root/. root/
 umount mounted_root

Now you have the image unpacked under the root directory and you can modify it.

Repacking the root file

Repacking the root file is needed for HTTP or FTP-based installations.

This example is similar to the one described above but it additionally creates the root squashfs image again.

 cd /install/modified-inst-sys/
 mv -v root root.old
 mkdir -pv mounted_root
 mount -o loop -t squashfs root.old mounted_root
 mkdir -pv root_copy
 cp -rv mounted_root/. root_copy/
 umount mounted_root

Now, modify the installation system unpacked and copied under the root_copy directory and pack in again. The file will be created as executable and not readable by group and 'others'. Please, change that by chmod.

 mksquashfs root_copy/ root
 chmod -x root
 chmod +r root

Binary mksquashfs is part of the squashfs RPM package.

Installation Server

To make the modified installation system available, you will need to configure your system to offer the /install or /install/modified-inst-sys/ via some server.

There are several severs that can be configured by YaST: NFS Server, HTTP Server, FTP Server, Samba Server ... You will find the in YaST Control Center (but you will have to install them first).

Example how Linuxrc can be configured to use the new installation system:

 # NFS Server
 instsys=nfs://your.server/install/modified-inst-sys/root
 
 # HTTP server with /install exported as directory root
 instsys=http://your.server/modified-inst-sys/root