2. Working with ISO Images

This section will explain how to extract an ISO image provided by Red Hat, and how to create a new kicking image containing changes y'all made post-obit other procedures in this volume.

2.2. Creating a product.img File

A product.img epitome file is an archive containing files which replace existing files or add new ones in the installer runtime. During boot, Anaconda loads this file from the images/ directory on the boot media. Then, it uses files nowadays within this file to supervene upon identically named files in the installer's file system; this is necessary to customize the installer (for example, for replacing default images with custom ones). The product.img image must comprise a directory structure identical to the installer.

Specifically, two topics discussed in this guide require you to create a product image. The tabular array below lists the correct locations inside the image file directory structure:

Tabular array ane. Locations of Add-ons and Anaconda Visuals

Type of custom content File arrangement location
Pixmaps (logo, side bar, top bar, etc.) /usr/share/anaconda/pixmaps/
Banners for the installation progress screen /usr/share/anaconda/pixmaps/rnotes/en/
GUI stylesheet /usr/share/anaconda/anaconda-gtk.css
Installclasses (for irresolute the production name) /run/install/production/pyanaconda/installclasses/
Anaconda add-ons /usr/share/anaconda/addons/

The procedure beneath explains how to create a valid product.img file.

Procedure two. Creating product.img

  1. Navigate to a working directory such every bit /tmp, and create a subdirectory named product/:

                                $                            cd /tmp                          
                                $                            mkdir product/                          
  2. Create a directory structure which is identical to the location of the file you desire to supercede. For example, if you want to test an add-on, which belongs in the /usr/share/anaconda/addons directory on the installation organization; create the same structure in your working directory:

                                $                            mkdir -p product/usr/share/anaconda/addons                          

    You can browse the installer'southward runtime file organisation by booting the installation, switching to virtual console i ( Ctrl + Alt + F1 ) and and so switching to the 2nd tmux window ( Ctrl + b 2 ). This opens a shell prompt which you can utilise to scan the file system.

  3. Identify your customized files (in this example, custom improver for Anaconda ) into the newly created directory:

                                $                            cp -r                              ~/path/to/custom/addon/                              product/usr/share/anaconda/addons/                          
  4. Repeat the two steps above (create a directory structure and motility modified files into information technology) for every file you desire to add together to the installer.

  5. Create a .buildstamp file in the root of the directory which will get the product.img file. The .buildstamp file describes the arrangement version and several other parameters. The following is an case of a .buildstamp file from Red Hat Enterprise Linux 7.four:

    [Main] Product=Ruby Hat Enterprise Linux Version=7.4 BugURL=https://bugzilla.redhat.com/ IsFinal=True UUID=201707110057.x86_64 [Compose] Lorax=19.half dozen.92-1                          

    Note the IsFinal parameter, which specifies whether the paradigm is for a release (GA) version of the product (True), or a pre-release such every bit Alpha, Beta, or an internal milestone (False).

  6. Modify into the product/ directory, and create the product.img archive:

                                $                            cd product                          
                                $                            detect . | cpio -c -o | gzip -9cv > ../product.img                          

    This creates a product.img file i level above the production/ directory.

  7. Move the product.img file to the images/ directory of the extracted ISO epitome.

After finishing this procedure, your customizations are placed in the correct directory. Y'all can continue with Section 2.iii, "Creating Custom Boot Images" to create a new bootable ISO image with your changes included. The production.img file will be automatically loaded when starting the installer.

Instead of adding the product.img file on the boot media, you tin can identify this file into a unlike location and employ the inst.updates= boot option at the boot menu to load it. In that case, the image file can have any proper name, and information technology can be placed in whatsoever location (USB flash drive, difficult disk, HTTP, FTP or NFS server), as long as this location is reachable from the installation organisation.

2.3. Creating Custom Boot Images

When yous cease customizing kicking images provided by Cherry-red Lid, yous must create a new image which includes changes you fabricated. To exercise this, follow the procedure below.

Procedure three. Creating ISO Images

  1. Make sure that all of your changes are included in the working directory. For example, if you are testing an add-on, brand sure to place the product.img in the images/ directory.

  2. Brand sure your current working directory is the top-level directory of the extracted ISO image - e.grand. /tmp/ISO/iso.

  3. Create the new ISO image using genisoimage:

                                #                            genisoimage -U -r -5 -T -J -joliet-long -V "RHEL-seven.i Server.x86_64" -volset "RHEL-7.1 Server.x86_64" -A "RHEL-7.i Server.x86_64" -b isolinux/isolinux.bin -c isolinux/kick.cat -no-emul-boot -boot-load-size iv -boot-info-table -eltorito-alt-boot -eastward images/efiboot.img -no-emul-kick -o                              ../NEWISO.iso                              .                          

    In the above example:

    • Make certain that values for the -V, -volset, and -A options match the paradigm's kicking loader configuration, if you are using the LABEL= directive for options which require a location to load a file on the same disk. If your boot loader configuration (isolinux/isolinux.cfg for BIOS and EFI/Boot/grub.cfg for UEFI) uses the inst.stage2=LABEL=disk_label stanza to load the second stage of the installer from the same deejay, then the deejay labels must match.

      In boot loader configuration files, replace all spaces in disk labels with \x20. For example, if you create an ISO image with a label of RHEL seven.1, boot loader configuration should use RHEL\x207.1 to refer to this label.

    • Supercede the value of the -o pick (-o ../NEWISO.iso) with the file proper noun of your new image. The value in the instance will create file NEWISO.iso in the directory above the current one.

    For more information well-nigh this command, encounter the genisoimage(1) man page.

  4. Implant an MD5 checksum into the epitome. Without performing this step, image verification check (the rd.live.check pick in the boot loader configuration) will fail and you lot will not exist able to continue with the installation.

                                #                            implantisomd5                              ../NEWISO.iso                                                      

    In the above example, supplant ../NEWISO.iso with the file name and location of the ISO paradigm you have created in the previous footstep.

After finishing this procedure, y'all can write the new ISO image to physical media or a network server to boot it on physical hardware, or y'all tin can utilise it to start installing a virtual machine. See the Ruby Chapeau Enterprise Linux 7 Installation Guide for instructions on preparing boot media or network server, and the Red Lid Enterprise Linux vii Virtualization Getting Started Guide for instructions on creating virtual machines with ISO images.