Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 6. Completing post customization tasks
To complete the customizations made, perform the following tasks:
- Create a product.img image file (applies only for graphical customizations).
- Create a custom boot image.
This section provides information about how to create a product.img image file and to create a custom boot image.
6.1. Creating a product.img file
A product.img
image file is an archive containing new installer files that replace the existing ones at runtime.
During a system boot, Anaconda loads the product.img file from the images/ directory on the boot media. It then uses the files that are present in this directory to replace identically named files in the installer’s file system. The files when replaced customizes the installer (for example, for replacing default images with custom ones).
Note: The product.img
image must contain a directory structure identical to the installer. For more information about the installer directory structure, see the table below.
Type of custom content | File system location |
---|---|
Pixmaps (logo, sidebar, top bar, and so on.) |
|
GUI stylesheet |
|
Anaconda add-ons |
|
Product configuration files |
|
Custom configuration files |
|
Anaconda DBus service conf files |
|
Anaconda DBus service files |
|
The procedure below explains how to create a product.img
file.
Procedure
Navigate to a working directory such as
/tmp
, and create a subdirectory namedproduct/
:$
cd /tmp
Create a subdirectory product/
$
mkdir product/
Create a directory structure identical to the location of the file you want to replace. For example, if you want to test an add-on that is present in the
/usr/share/anaconda/addons
directory on the installation system, create the same structure in your working directory:$
mkdir -p product/usr/share/anaconda/addons
NoteTo view the installer’s runtime file, boot the installation and switch to virtual console 1 (Ctrl+Alt+F1) and then switch to the second tmux window (Ctrl+b+2). A shell prompt that can be used to browse a file system opens.
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 steps 3 and 4 (create a directory structure and place the custom files into it) for every file you want to add to the installer.
Create a
.buildstamp
file in the root of the directory. The.buildstamp
file describes the system version, the product and several other parameters. The following is an example of a.buildstamp
file from Red Hat Enterprise Linux 8.4:[Main] Product=Red Hat Enterprise Linux Version=8.4 BugURL=https://bugzilla.redhat.com/ IsFinal=True UUID=202007011344.x86_64 [Compose] Lorax=28.14.49-1
The
IsFinal
parameter 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 (False
).Navigate to the
product/
directory, and create theproduct.img
archive:$
cd product
$
find . | cpio -c -o | gzip -9cv > ../product.img
This creates a
product.img
file one level above theproduct/
directory.-
Move the
product.img
file to theimages/
directory of the extracted ISO image.
The product.img file is now created and the customizations that you want to make are placed in the respective directories.
Instead of adding the product.img
file 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.
6.2. Creating custom boot images
After you customize the boot images and the GUI layout, create a new image that includes the changes you made.
To create custom boot images, follow the procedure below.
Procedure
-
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
product.img
in theimages/
directory. -
Make sure your current working directory is the top-level directory of the extracted ISO image, for example,
/tmp/ISO/iso/
. Create a new ISO image using the
genisoimage
:#
genisoimage -U -r -v -T -J -joliet-long -V "RHEL-9 Server.x86_64" -volset "RHEL-9 Server.x86_64" -A "RHEL-9 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:
Make sure that the values for
-V
,-volset
, and-A
options match the image’s boot loader configuration, if you are using theLABEL=
directive for options that require a location to load a file on the same disk. If your boot loader configuration (isolinux/isolinux.cfg
for BIOS andEFI/BOOT/grub.cfg
for UEFI) uses theinst.stage2=LABEL=disk_label
stanza 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 aRHEL 9.0
label, boot loader configuration should useRHEL\x209.0
.Replace the value of the
-o
option (-o ../NEWISO.iso
) with the file name of your new image. The value in the example creates theNEWISO.iso
file in the directory above the current one.For more information about this command, see the
genisoimage(1)
man page on your system.
Implant an MD5 checksum into the image. Note that without an MD5 checksu, the image verification check might fail (the
rd.live.check
option in the boot loader configuration) and the installation can hang.#
implantisomd5 ../NEWISO.isoIn the above example, replace ../NEWISO.iso with the file name and the location of the ISO image that you have created in the previous step.
You can now write the new ISO image to physical media or a network server to boot it on physical hardware, or you can use it to start installing a virtual machine.
Additional resources
- For instructions on preparing boot media or network server, see Advanced installation boot options.
- For instructions on creating virtual machines with ISO images, see Configuring and Managing Virtualization.