LTS

    Innovation Version

      isocut Usage Guide

      Introduction

      The size of an openEuler image is large, and the process of downloading or transferring an image is time-consuming. In addition, when an openEuler image is used to install the OS, all RPM packages contained in the image are installed. You cannot choose to install only the required software packages.

      In some scenarios, you do not need to install the full software package provided by the image, or you need to install additional software packages. Therefore, openEuler provides an image tailoring and customization tool. You can use this tool to customize an ISO image that contains only the required RPM packages based on an openEuler image. The software packages can be the ones contained in an official ISO image or specified in addition to meet custom requirements.

      This document describes how to install and use the openEuler image tailoring and customization tool.

      Software and Hardware Requirements

      The hardware and software requirements of the computer to make an ISO file using the openEuler tailoring and customization tool are as follows:

      • The CPU architecture is AArch64 or x86_64.
      • The operating system is openEuler 20.03 LTS SP3.
      • You are advised to reserve at least 30 GB drive space for running the tailoring and customization tool and storing the ISO image.

      Installation

      The following uses openEuler 20.03 LTS SP3 on the AArch64 architecture as an example to describe how to install the ISO image tailoring and customization tool.

      1. Ensure that openEuler 20.03 LTS SP3 has been installed on the computer.

         $ cat /etc/openEuler-release 
         openEuler release 20.03 (LTS-SP3)
        
      2. Download the ISO image (must be an everything image) of the corresponding architecture and save it to any directory (it is recommended that the available space of the directory be greater than 20 GB). In this example, the ISO image is saved to the /home/isocut_iso directory.

        The download address of the AArch64 image is as follows:

        https://repo.openeuler.org/openEuler-20.03-LTS-SP3/ISO/aarch64/openEuler-20.03-LTS-SP3-everything-aarch64-dvd.iso

        Note: The download address of the x86_64 image is as follows:

        https://repo.openeuler.org/openEuler-20.03-LTS-SP3/ISO/x86_64/openEuler-20.03-LTS-SP3-everything-x86_64-dvd.iso

      3. Create a /etc/yum.repos.d/local.repo file to configure the Yum source. The following is an example of the configuration file. baseurl is the directory for mounting the ISO image.

        [local]
        name=local
        baseurl=file:///home/isocut_mount
        gpgcheck=0
        enabled=1
        
      4. Run the following command as the root user to mount the image to the /home/isocut_mount directory (ensure that the mount directory is the same as baseurl configured in the repo file) as the Yum source:

        sudo mount -o loop /home/isocut_iso/openEuler-20.03-LTS-SP3-everything-aarch64-dvd.iso /home/isocut_mount
        
      5. Make the Yum source take effect.

        yum clean all
        yum makecache
        
      6. Install the image tailoring and customization tool as the root user.

        sudo yum install -y isocut
        
      7. Run the following command as the root user to verify that the tool has been installed successfully:

         $ sudo isocut -h
         Checking input ...
         usage: isocut [-h] [-t temporary_path] [-r rpm_path] [-k file_path] source_iso dest_iso
        
         Cut openEuler iso to small one
        
         positional arguments:
           source_iso         source iso image
           dest_iso           destination iso image
        
         optional arguments:
           -h, --help         show this help message and exit
           -t temporary_path  temporary path
           -r rpm_path        extern rpm packages path
           -k file_path       kickstart file
        

      Tailoring and Customizing an Image

      This section describes how to use the image tailoring and customization tool to create an image by tailoring or adding RPM packages to an openEuler image.

      Command Description

      Format

      Run the isocut command to use the image tailoring and customization tool. The command format is as follows:

      isocut [ --help | -h ] [ -t <temp_path> ] [ -r <rpm_path> ] < source_iso > < dest_iso >

      Parameter Description

      ParameterMandatoryDescription
      --help | -hNoQueries the help information about the command.
      -t <temp_path>NoSpecifies the temporary directory temp_path for running the tool, which is an absolute path. The default value is /tmp.
      -r <rpm_path>NoSpecifies the path of the RPM packages to be added to the ISO image.
      source_isoYesPath and name of the ISO source image to be tailored. If no path is specified, the current path is used by default.
      dest_isoYesSpecifies the path and name of the new ISO image created by the tool. If no path is specified, the current path is used by default.

      Software Package Source

      The RPM packages of the new image can be:

      • Packages contained in an official ISO image. In this case, the RPM packages to be installed are specified in the configuration file /etc/isocut/rpmlist. The configuration format is software_package_name.architecture. For example, kernel.aarch64.

      • Specified in addition. In this case, use the -r parameter to specify the path in which the RPM packages are stored when running the isocut command and add the RPM package names to the /etc/isocut/rpmlist configuration file. (See the name format above.)

        NOTE:

        • When customizing an image, if an RPM package specified in the configuration file cannot be found, the RPM package will not be added to the image.
        • If the dependency of the RPM package is incorrect, an error may be reported when running the tailoring and customization tool.

      Operation Guide

      NOTE:

      • Do not modify or delete the default configuration items in the /etc/isocut/rpmlist file.
      • All isocut operations require root permissions.
      • The source image to be tailored can be a basic image or everything image. In this example, the basic image openEuler-20.03-LTS-SP3-aarch64-dvd.iso is used.
      • In this example, assume that the new image is named new.iso and stored in the /home/result directory, the temporary directory for running the tool is /home/temp, and the additional RPM packages are stored in the /home/rpms directory.
      1. Open the configuration file /etc/isocut/rpmlist and specify the RPM packages to be installed (from the official ISO image).

         sudo vi /etc/isocut/rpmlist
        
      2. Ensure that the space of the temporary directory for running the image tailoring and customization tool is greater than 8 GB. The default temporary directory is**/tmp**. You can also use the -t parameter to specify another directory as the temporary directory. The path of the directory must be an absolute path. In this example, the /home/temp directory is used. The following command output indicates that the available drive space of the /home directory is 38 GB, which meets the requirements.

         $ df -h
         Filesystem                            Size  Used Avail Use% Mounted on
         devtmpfs                              1.2G     0  1.2G   0% /dev
         tmpfs                                 1.5G     0  1.5G   0% /dev/shm
         tmpfs                                 1.5G   23M  1.5G   2% /run
         tmpfs                                 1.5G     0  1.5G   0% /sys/fs/cgroup
         /dev/mapper/openeuler_openeuler-root   69G  2.8G   63G   5% /
         /dev/sda2                             976M  114M  796M  13% /boot
         /dev/mapper/openeuler_openeuler-home   61G   21G   38G  35% /home
        
      3. Tailor and customize the image.

        Scenario 1: All RPM packages of the new image are from the official ISO image.

        $ sudo isocut -t /home/temp /home/isocut_iso/openEuler-20.03-LTS-SP3-aarch64-dvd.iso /home/result/new.iso
          Checking input ...
          Checking user ...
          Checking necessary tools ...
          Initing workspace ...
          Copying basic part of iso image ...
          Downloading rpms ...
          Finish create yum conf
          finished
          Regenerating repodata ...
          Checking rpm deps ...
          Getting the description of iso image ...
          Remaking iso ...
          Adding checksum for iso ...
          Adding sha256sum for iso ...
          ISO cutout succeeded, enjoy your new image "/home/result/new.iso"
          isocut.lock unlocked ...
        

        If the preceding information is displayed, the custom image new.iso is successfully created.

        Scenario 2: The RPM packages of the new image are from the official ISO image and additional packages in /home/rpms.

        sudo isocut -t /home/temp -r /home/rpms /home/isocut_iso/openEuler-20.03-LTS-SP3-aarch64-dvd.iso /home/result/new.iso
        

      FAQs

      The System Fails to Be Installed Using an Image Tailored Based on the Default RPM Package List

      Context

      When isocut is used to tailor an image, the /etc/isocut/rpmlist configuration file is used to specify the software packages to be installed.

      Images of different OS versions contain different software packages. As a result, some packages may be missing during image tailoring. Therefore, the /etc/isocut/rpmlist file contains only the kernel software package by default, ensuring that the image can be successfully tailored.

      Symptom

      The ISO image is successfully tailored using the default configuration, but fails to be installed.

      An error message is displayed during the installation, indicating that packages are missing:

      Possible Cause

      The ISO image tailored based on the default RPM package list lacks necessary RPM packages during installation. The missing RPM packages are displayed in the error message, and may vary depending on the version.

      Solution

      1. Add the missing packages.

        1. Find the missing RPM packages based on the error message.
        2. Add the missing RPM packages to the /etc/isocut/rpmlist configuration file.
        3. Tailor and install the ISO image again.

        For example, if the missing packages are those in the example error message, modify the rpmlist configuration file as follows:

        $ cat /etc/isocut/rpmlist
        kernel.aarch64
        lvm2.aarch64
        chrony.aarch64
        authselect.aarch64
        shim.aarch64
        efibootmgr.aarch64
        grub2-efi-aa64.aarch64
        dosfstools.aarch64
        

      Bug Catching

      Buggy Content

      Bug Description

      Submit As Issue

      It's a little complicated....

      I'd like to ask someone.

      PR

      Just a small problem.

      I can fix it online!

      Bug Type
      Specifications and Common Mistakes

      ● Misspellings or punctuation mistakes;

      ● Incorrect links, empty cells, or wrong formats;

      ● Chinese characters in English context;

      ● Minor inconsistencies between the UI and descriptions;

      ● Low writing fluency that does not affect understanding;

      ● Incorrect version numbers, including software package names and version numbers on the UI.

      Usability

      ● Incorrect or missing key steps;

      ● Missing prerequisites or precautions;

      ● Ambiguous figures, tables, or texts;

      ● Unclear logic, such as missing classifications, items, and steps.

      Correctness

      ● Technical principles, function descriptions, or specifications inconsistent with those of the software;

      ● Incorrect schematic or architecture diagrams;

      ● Incorrect commands or command parameters;

      ● Incorrect code;

      ● Commands inconsistent with the functions;

      ● Wrong screenshots.

      Risk Warnings

      ● Lack of risk warnings for operations that may damage the system or important data.

      Content Compliance

      ● Contents that may violate applicable laws and regulations or geo-cultural context-sensitive words and expressions;

      ● Copyright infringement.

      How satisfied are you with this document

      Not satisfied at all
      Very satisfied
      Submit
      Click to create an issue. An issue template will be automatically generated based on your feedback.
      Bug Catching
      编组 3备份