5.4.9. HOWTO Use unpack_dvd to Extract the Full OS RPM Package Set

The SIMP ISO provides a minimal set of packages.

If you require additional OS packages, you can extract them from vendor ISOs using unpack_dvd. Additionally you can extract the PXE files from the ISO to the rsync directories.

5.4.9.1. Extract the OS Packages

Unpack_dvd will, by default

  • extract OS metadata from the ISO

  • create a directory named <os-family>/<os-version> under /var/www/yum, the directory used for the yum server in simp/simp.

  • extract the files on the ISO that directory.

  • create a link /var/www/yum/<os-family>/<os-major-version> to above directory.

  • create Updates directory if it does not exist

  • create a link for all RPMs extracted from the ISO under the Updates directory.

  • run createrepo in the Updates directory.

  • If run as root, change permissions recursively on Updates and any directory with RPMs to be owned and readable by group apache

Use unpack_dvd --help to see all options available.

Note

If unpack_dvd can only determine the OS major version from the ISO metadata it will fail and ask you to supply a more detail version number using the -v option.

The following example will extract to the default location:

  1. Log on and run sudo su - root.

  2. Copy the appropriate vendor OS ISO(s) to the server.

  3. If the server where you are unpacking the vendor ISO was NOT built using the SIMP ISO , you must create /var/www/yum.

  4. unpack using unpack_dvd

    # unpack_dvd -v <os version> <full path to iso>
    unpack_dvd -v 7.8.2003 /myisodir/CentOS-7-x86_64-DVD-2003.iso
    
  5. Ensure that subsequent yum operations are aware of the new RPM packages by refreshing the system’s yum cache:

    yum clean all && yum makecache
    

Warning

At this time unpack_dvd does not work entirely with EL8 ISOs. EL8 introduced modules to repositories and unpack_dvd can not handle these. It will extract some but not all of RPMs on an EL8 ISO. The files extracted are enough to kickstart a basic EL8 system but some of the application stream files are not extracted and added to the repository correctly.

5.4.9.2. Extract PXE files

Extracting the PXE files was added to unpack_dvd in simp-utils-6.4.0. Use the -X option to tell unpack_dvd to extract the PXE files and the --no-unpack-yum option if you do not want to extract the yum files.

When PXE file extraction is enabled with the -X option, unpack_dvd will, by default,

  • extract OS version information from the ISO metadata

  • create a directory for the PXE files in the rsync directory used by simp/tftpboot in the production environment. * named <os-family>-<version>-<arch> * The default rsync directory is /var/simp/environments/production/rsync/<os-family>/Global/tftpboot/linux-install/.

  • extract the files to the created OS directory.

  • create a link <os-family>-<major-version>-<arch> to the above directory.

  • if run as root, change the permissions recursively on created directory and its contents to those of the rsync directory.

Use unpack_dvd --help for options to change some of the defaults.

The following example will extract only the PXE files to the rsync directory:

# Place the -X options after the ISO name.
sudo su - root
# copy the iso to the system
unpack_dvd -v 8.0.1905 --no-unpack-yum /myisodir/CentOS-8-x86_64-1905-dvd1.iso -X

The following example will extract both the RPMs and PXE files to alternate directories:

sudo su - root
# Make the directories.  Set the permissions as needed.
mkdir -p /my/repodir
mkdir -p /my/tftpboot
# The PXE directory must follow the -X option.
# The -d options changes the directory to extract OS files
unpack_dvd -v 8.0.1905 -d /my/repodir /myisodir/CentOS-8-x86_64-1905-dvd1.iso -X /my/tftpboot
yum clean all && yum makecache