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/iso
Replace 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.
$
mkdir /tmp/ISO
- Copy all contents of the mounted image to your new working directory. Make sure to use the
-p
option to preserve file and directory permissions and ownership.#
cp -pRf /mnt/iso /tmp/ISO
- Unmount the image.
#
umount /mnt/iso
/tmp/ISO
where 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.img
image 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.img
image 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.) | /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 changing the product name) | /run/install/product/pyanaconda/installclasses/ |
Anaconda add-ons | /usr/share/anaconda/addons/ |
product.img
file.Procedure 2. Creating product.img
- Navigate to a working directory such as
/tmp
, and create a subdirectory namedproduct/
:$
cd /tmp
$
mkdir product/
- 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/addons
directory on the installation system; create the same structure in your working directory:$
mkdir -p product/usr/share/anaconda/addons
Note
You 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.
- Change into the
product/
directory, and create theproduct.img
archive:$
cd product
$
find . | cpio -c -o | gzip -9cv > ../product.img
This creates aproduct.img
file one level above theproduct/
directory. - Move the
product.img
file to theimages/
directory of the extracted ISO image.
product.img
file will be automatically loaded when starting the installer.Note
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.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
product.img
in theimages/
directory. - Make sure your current working directory is the top-level directory of the extracted ISO image - e.g.
/tmp/ISO/iso
. - Create the new ISO image using
genisoimage
:#
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:- Make sure that values for the
-V
,-volset
, and-A
options match the image's boot loader configuration, if you are using theLABEL=
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 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.Important
In boot loader configuration files, replace all spaces in disk labels with\x20
. For example, if you create an ISO image with a label ofRHEL 7.1
, boot loader configuration should useRHEL\x207.1
to refer to this label. - Replace the value of the
-o
option (-o ../NEWISO.iso
) with the file name of your new image. The value in the example will create fileNEWISO.iso
in the directory above the current one.
For more information about this command, see thegenisoimage(1)
man page. - Implant an MD5 checksum into the image. Without performing this step, image verification check (the
rd.live.check
option in the boot loader configuration) will fail and you will not be able to continue with the installation.#
implantisomd5 ../NEWISO.iso
In the above example, replace ../NEWISO.iso with the file name and location of the ISO image you have created in the previous step.
After finishing this procedure, you can 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. See the Red Hat Enterprise Linux 7 Installation Guide for instructions on preparing boot media or network server, and the Red Hat Enterprise Linux 7 Virtualization Getting Started Guide for instructions on creating virtual machines with ISO images.
from:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/anaconda_customization_guide/sect-iso-images