2. Working with ISO Images
2.1. Extracting Red Hat Enterprise Linux Boot Images
Procedure 1. Extracting ISO Images
- Mount the downloaded image.
mount -t iso9660 -o loop path/to/image.iso /mnt/isoReplace path/to/image.iso with the path to the downloaded ISO. Also make sure that the target directory (
/mnt/iso) exists and nothing else is currently mounted there.
- Create a working directory - a directory where you want to place the contents of the ISO image.
- Copy all contents of the mounted image to your new working directory. Make sure to use the
-poption to preserve file and directory permissions and ownership.
cp -pRf /mnt/iso /tmp/ISO
- Unmount the image.
/tmp/ISOwhere you can modify its contents. Continue with Section 3, “Customizing the Boot Menu” or Section 5, “Developing Installer Add-ons”. Once you finish making changes, create a new, modified ISO image using the instructions in Section 2.3, “Creating Custom Boot Images”.
2.2. Creating a product.img File
product.imgimage 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 present inside this file to replace 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.imgimage must contain a directory structure identical to the installer.
Table 1. Locations of Add-ons and Anaconda Visuals
|Type of custom content||File system location|
|Pixmaps (logo, side bar, top bar, etc.)|| |
|Banners for the installation progress screen|| |
|GUI stylesheet|| |
|Installclasses (for changing the product name)|| |
|Anaconda add-ons|| |
Procedure 2. Creating product.img
- Navigate to a working directory such as
/tmp, and create a subdirectory named
- Create a directory structure which is identical to the location of the file you want to replace. For example, if you want to test an add-on, which belongs in the
/usr/share/anaconda/addonsdirectory on the installation system; create the same structure in your working directory:
mkdir -p product/usr/share/anaconda/addons
NoteYou can browse the installer's runtime file system by booting the installation, switching to virtual console 1 (Ctrl+Alt+F1) and then switching to the second tmux window (Ctrl+b 2). This opens a shell prompt which you can use to browse the file system.
- Place your customized files (in this example, custom add-on for Anaconda) into the newly created directory:
cp -r ~/path/to/custom/addon/ product/usr/share/anaconda/addons/
- Repeat the two steps above (create a directory structure and move modified files into it) for every file you want to add to the installer.
- Create a
.buildstampfile in the root of the directory which will become the
.buildstampfile describes the system version and several other parameters. The following is an example of a
.buildstampfile from Red Hat Enterprise Linux 7.4:
[Main] Product=Red Hat Enterprise Linux Version=7.4 BugURL=https://bugzilla.redhat.com/ IsFinal=True UUID=201707110057.x86_64 [Compose] Lorax=19.6.92-1Note the
IsFinalparameter, which specifies whether the image is for a release (GA) version of the product (
True), or a pre-release such as Alpha, Beta, or an internal milestone (
- Change into the
product/directory, and create the
find . | cpio -c -o | gzip -9cv > ../product.imgThis creates a
product.imgfile one level above the
- Move the
product.imgfile to the
images/directory of the extracted ISO image.
product.imgfile will be automatically loaded when starting the installer.
product.imgfile on the boot media, you can place this file into a different location and use the
inst.updates=boot option at the boot menu to load it. In that case, the image file can have any name, and it can be placed in any location (USB flash drive, hard disk, HTTP, FTP or NFS server), as long as this location is reachable from the installation system.
2.3. Creating Custom Boot Images
Procedure 3. Creating ISO Images
- Make sure that all of your changes are included in the working directory. For example, if you are testing an add-on, make sure to place the
- Make sure your current working directory is the top-level directory of the extracted ISO image - e.g.
- Create the new ISO image using
genisoimage -U -r -v -T -J -joliet-long -V "RHEL-7.1 Server.x86_64" -volset "RHEL-7.1 Server.x86_64" -A "RHEL-7.1 Server.x86_64" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot -o ../NEWISO.iso .In the above example:
For more information about this command, see the
- Make sure that values for the
-Aoptions match the image's boot 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.cfgfor BIOS and
EFI/BOOT/grub.cfgfor UEFI) uses the
inst.stage2=LABEL=disk_labelstanza to load the second stage of the installer from the same disk, then the disk labels must match.
ImportantIn 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 7.1, boot loader configuration should use
RHEL\x207.1to refer to this label.
- Replace the value of the
-o ../NEWISO.iso) with the file name of your new image. The value in the example will create file
NEWISO.isoin the directory above the current one.
- Implant an MD5 checksum into the image. Without performing this step, image verification check (the
rd.live.checkoption in the boot loader configuration) will fail and you will not be able to continue with the installation.
implantisomd5 ../NEWISO.isoIn the above example, replace ../NEWISO.iso with the file name and location of the ISO image you have created in the previous step.