The wikis are now using the new authentication system.
If you did not migrate your account yet, visit https://idp-portal-info.suse.com/

SDB:Creating customized installation source

Jump to: navigation, search

Introduction

This article describes how to create a customized installation source which can be later used for installation via YaST, mostly for debugging purposes.

For openSUSE 11.0 and later, please, use this article.

What Is This All About?

Suppose you want to debug something in the installation process. Or test that a bug you've reported is already fixed, but the fix is not yet included on the official media (DVDs, FTP mirrors etc.). You may have a patch you want to test, the whole fixed rpm package or you may need to add some extra packages, scripts or libraries to ease the debugging and want to use them during installation.

For all these, you need customized installation source.

How To Do It (step-by-step)

1. First of all, mirror over some existing installation source. Do e.g.

 wget -r -np -nH ftp://cool-suse-mirror.example.org/pub/suse/$build

for network installation source. Alternatively, you can download DVD iso, mount it over loopback device and copy its content to your local directory.

2. In the local directory with downloaded installation source data, do:

 cd boot/$your_arch
 mkdir inst-sys

where $your_arch stands for the architecture you want to use (i386, x86_64, ppc)

3. Mount temporarily image named boot/$your_arch/root to /mnt directory over loopback device

 mount -o loop root /mnt

Note: this mount of cramfs image is not cross-platform, i.e. you normally cannot mount and thus create inst-sys from ppc image on i386 architecture.

4. Copy the directory structure from /mnt directory to inst-sys (as hard links need to be preserved when copying, you need to use rsync; simple cp is not enough since it cannot do this).

rsync -AHPSXav /mnt/ inst-sys/

5. To make YaST prefer inst-sys directory over root image and to make rollback possible in case something fails, backup root image

 mv root root.backup

6. Now you have inst-sys directory structure ready (note it is actually similar to the one in real running system) and you can do whatever you want with it - apply patches, unpack rpm contents (use rpm's content.cpio for this purpose), edit files, create new bugs,...

7. When ready, export your local directory with customized installation source data via nfs. You may use yast2-nfs-server module for this purpose, or do it manually by editing /etc/exports file (do not forget to do exportfs -rv afterwards)

You can even create new ftp or http installation source out of it, but nfs way is the simplest one. Since the inst-sys directory accessed via http or ftp cannot be mounted, you have to recreate the root image

 mkfs.cramfs inst-sys root

8. You're almost done. Now boot your test computer e.g. from mini-iso and point its installation source to your customized one by setting this parameter on boot commandline:

 install=nfs://your.server.ip:/directory/on/your/server

(for more info on boot parameters, see Linuxrc article)

And that's it. Enjoy installation debugging and testing :-)

Making a Custom Installation ISO

A common use of this process is to take the official distribution ISO and create a custom one that adds an AutoYaST file or has a set of updated packages. Obviously, the best way to do this is to use OBS and create your own project. However, there are times when it is 'easier' to do this by modifying the distribution ISO locally (maybe because of network limitations, limitations of source, etc).

To do this, we need to: 1. Unpack the official distribution ISO

 mkdir $HOME/ISOBuild
 sudo mount -o loop openSUSE-official.iso /mnt
 rsync -AHPSXav /mnt/ $HOME/ISOBuild/

2. Make the local edits needed

This could be rebuilding the base repository with different versions of packages, changing the installer logic, updating the grub menus, etc. Example:

 cp My-AutoYaST.xml $HOME/ISOBuild/autoinst.xml

3. Pack and create the custom ISO

 xorriso -as mkisofs -no-emul-boot -boot-load-size 4 -boot-info-table -iso-level 4 -b boot/x86_64/loader/isolinux.bin -c boot/x86_64/loader/boot.cat -eltorito-alt-boot -e boot/x86_64/efi -no-emul-boot -o $HOME/openSUSE-MyCustom.iso $HOME/ISOBuild
 isohybrid -u $HOME/openSUSE-MyCustom.iso

Burn your image to whatever media you are going to use (DVD/Flash Drive/etc). Enjoy your custom installation ISO.