Updated on 2024-09-14 GMT+08:00

Evaluating Software Compatibility

Scanning Methods

The x2hce-ca tool can:

  • Scan a single application package or multiple application packages on the source OS.
  • Scan all application packages in a given directory or multiple directories on the source OS.

Procedure

  1. Log in as or switch to user root.
  2. Scan the application packages to check for compatibility.
    x2hce-ca scan <option> [-os_name Source OS name] [-target_os_name Target OS name]

    Run the following command to verify the default Java version:

    java -version

    • If Java 1.8.0 has been installed on the target host, subsequent scanning is automatically performed.
    • If Java 1.8.0 is not installed on the target host, perform the following operations (which vary depending on the OS):
      • If the OS is HCE 2.0, the missing Java dependencies java-1.8.0-openjdk-devel, java-1.8.0-openjdk, and java-1.8.0-openjdk-headless are automatically installed.
      • If the OS is not HCE 2.0, an error message is displayed to remind you of installing the missing Java dependencies. Run the following command to install the Java dependencies:

        yum -y install java-1.8.0-openjdk-devel

    • If the Java version on the target host is earlier than 1.8.0, run the following command and then manually set the Java version to 1.8.0:

      update-alternatives --config java

    <option> has the following settings:

    • Dir_Name/App_Name: scans a single application software package.

      The following uses the x86 and Arm OS architectures as examples:

      For example, if you want to scan application package NetworkManager-1.18.8-1.el7.x86_64.rpm (x86) in the /mnt/ directory, run the following command:

      x2hce-ca scan /mnt/NetworkManager-1.18.8-1.el7.x86_64.rpm -os_name centos7.9 -target_os_name hce2.0

      For example, if you want to scan application package NetworkManager-1.18.8-1.el7.aarch64.rpm (Arm) in the /mnt/ directory, run the following command:

      x2hce-ca scan /mnt/NetworkManager-1.18.8-1.el7.aarch64.rpm -os_name EulerOSV2.0SP8arm -target_os_name hce2.0arm -arch aarch64
    • Dir_Name1/App_Name1 Dir_Name2/App_Name2: scans multiple application software packages.

      The following uses the x86 architecture as an example:

      For example, if you want to scan the application software package grep-3.4-0.h3.r3.eulerosv2r9.x86_64.rpm in /opt/x2hce-ca/scan/ and the application software package groff-1.22.4-5.h1.eulerosv2r9.x86_64.rpm (x86) in /opt/x2hce-ca/scan/rpm/, run the following command:

      x2hce-ca scan /opt/x2hce-ca/scan/grep-3.4-0.h3.r3.eulerosv2r9.x86_64.rpm /opt/x2hce-ca/scan/rpm/groff-1.22.4-5.h1.eulerosv2r9.x86_64.rpm -os_name centos7.9 -target_os_name hce2.0

      The default value of -arch is x86_64.

    • -b Dir_Name: scans all application packages in a single directory.

      For example, if you want to scan all application packages in directory1, run the following command:

      x2hce-ca scan -b directory1 -os_name centos7.9  -target_os_name hce2.0
    • -b Dir_Name1 Dir_Name2: scans all application packages in multiple directories.

      For example, if you want to scan all application packages in directory1 and directory2, run the following command:

      x2hce-ca scan -b directory1 directory2 -os_name centos7.9 -target_os_name hce2.0

      A single directory can contain a maximum of 750 files of up to 900 MB. Excessive software packages may cause tool failures.

    Parameter

    Type

    Description

    -os_name

    String

    Source OS.

    This parameter is optional. The default value is centos7.9.

    For example, if this parameter is set to centos8.2, CentOS 8.2 is selected as the source OS.

    -target_os_name

    String

    Target OS.

    This parameter is optional. The default value is hce2.0.

    For example, if this parameter is set to -target_os_name hce1.1, the target OS is Huawei Cloud EulerOS 1.1.

  3. Analyze the evaluation results.

    For example, after the x2hce-ca tool scans three RPM packages in the /tmp/x2hce-ca_test directory, it displays the following outputs:

    • Download the compatibility evaluation reports from the /opt/x2hce-ca/output/software/ directory.
      • If the software package is compatible with the target OS, the following message is displayed:

        If the software package is not compatible with the target OS, the following message is displayed:

      • For details about the compatible dependency packages and APIs, see the Excel file with the same name as the software package.

    • If application packages fail the check, view the Excel report in the /opt/x2hce-ca/output/software/ directory.