PowerFlex: On-Demand Compilation Of The PowerFlex SDC Driver

Summary: This knowledge-based article describes how to enable on-demand compilation of the PowerFlex SDC driver on Linux systems.

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

This feature is intended to accommodate Application Binary Interface (ABI) changes in the Linux kernel, which may cause an SDC driver, pre-compiled for a different kernel, to fail to load.

Historically, an SDC installation package for Linux (RPM/DEB) contained several SDC kernel modules for various kernels of that Linux distribution. For users installing on distributions such as Ubuntu, which releases frequent kernel updates, there has been the option of setting up the SDC service to connect to Dell’s remote repository of SDC drivers and attempt to download an SDC from it.

With the new feature, users can compile a perfect match of the SDC driver for their running kernel without relying on the availability of a matching SDC in the driver’s repository.

Note: The self-compiled functionality is supported only on Linux systems on which the SDC is supported. See the PowerFlex support matrix for details.

Target audience: Users who frequently update their kernels for security reasons and who run specialized custom kernels may benefit from the feature.

 

Prerequisites
For the compilation procedure to succeed, the following packages must be installed on the host of the SDC service:

  • The latest version of the GNU C compiler (GCC), GCC
  • GNU make(1).
  • The kernel development package for the running kernel. This package is commonly available with the following names:
    • kernel-devel for distributions using the RPM package manager. (Red Hat, SUSE, so forth)
    • linux-headers for distributions using the Debian package manager (Debian, Ubuntu, so forth)

Automatic on-demand compilation
To allow automatic, on-demand compilation of the SDC driver, the host should meet all the prerequisites listed under the Prerequisites section, above. When bringing up the SDC driver, the SDC service attempts to compile the SDC driver if all the following conditions are met:

  • An SDC that matches the running kernel is unavailable in the driver cache.
    For details about the driver cache, see Driver Cache below.

  • A file named /etc/emc/scaleio/scini_sync/.build_scini exists.
    The file’s contents are ignored. However, users should keep it empty for possible future enhancements.
    The file can be created by running a touch(1) command.

Manual compilation
SDC driver, the compilation host should meet all the prerequisites listed under the Prerequisites section above.
To manually compile the SDC driver, follow these steps:

  1. Copy the compilation bundle from its directory in the driver cache to a temporary directory. The bundle’s location depends on the PowerFlex version and Linux distribution.
    For example, the bundle for the PowerFlex 3.6.3 SDC, for Red Hat Enterprise Linux 9-based distributions is: /bin/emc/scaleio/scini_sync/driver_cache/RHEL9/3.6.3000.128/Dell-PowerFlex-scini_builder-3.6.3000.128.x86_64.tgz
    For details about the driver cache, see Driver Cache below.

  2. Go to the temporary directory and extract the compilation bundle.
    Example:

    tar xzf Dell-PowerFlex-scini_builder-3.6.3000.128.x86_64.tgz
  3. Run the build_driver.sh script, located on the top level of the extracted content. Without arguments, the script attempts to compile the driver for the running kernel.
    To compile for a different kernel, provide the path to that kernel’s header directories with the "-o" and "-s" command-line arguments.
    For more information about invocation, run:

    build_driver.sh -h
  4. The compilation process output is printed to standard output.
    After a successful compilation, the resulting SDC driver file, scini.ko, can be found at ./ini/scini.ko.

  5. Copy the driver file from the compilation host to the target SDC host, to a directory matching the target kernel version, under the same location as the compilation bundle, in the driver cache.
    For example, for a driver complied for kernel version 5.14.0-362.24.1.el9_3.x86_64, the target path for the driver file is /bin/emc/scaleio/scini_sync/driver_cache/RHEL9/3.6.3000.128/5.14.0-362.24.1.el9_3.x86_64/scini.ko.

 

Additional Information

Driver Cache
An SDC driver successfully compiled for a specific kernel will be copied to the appropriate directory of the driver cache, and its compilation will not be triggered again.
The driver cache’s location is /bin/emc/scaleio/scini_sync/drive_cache.

Build Log
When automatic on-demand compilation is enabled, all compilation logs are appended to /bin/emc/scaleio/scini_sync/driver_build.log.
A successful compilation ends with messages similar to the following:

make: Entering directory '/usr/src/linux-headers-5.15.0-30-generic'
"Following additional compilation's conditions are defined:" 
BLK_MQ_HEADER 
BLK_DEV_MAX_SEGMENTS 
SOCKET_HAS_NET_IN_CREATE 
BIO_BI_BDEV 
BIO_BI_STATUS 
BLK_QUEUE_FLAG_FUNCS 
BLK_INITIALIZE_RMQ_FN 
WAIT_QUEUE_ENTRY_T 
HAS_SCSI_REQUEST 
HAS_SCSI_REQ 
HAS_SCSI_CMND 
HAS_SCSI_IOCTL 
HAS_SCSI_IOCTL_WITH_GENDISK 
HAS_QUEUE_FLAG_DISCARD 
HAS_DISK_LIVE_IN_GENHD 
  CC [M]  /tmp/PowerFlex_driver_build_hpoM6l/ini/./linux/api/api_main.o 
  CC [M]  /tmp/PowerFlex_driver_build_hpoM6l/ini/./linux/api/api_mos.o 
  CC [M]  /tmp/PowerFlex_driver_build_hpoM6l/ini/./linux/api/api_net.o 
  CC [M]  /tmp/PowerFlex_driver_build_hpoM6l/ini/./linux/api/api_ioctl.o 
  CC [M]  /tmp/PowerFlex_driver_build_hpoM6l/ini/./linux/api/api_blk_io.o 
  CC [M]  /tmp/PowerFlex_driver_build_hpoM6l/ini/./linux/api/api_blk_dev.o 
  LD [M]  /tmp/PowerFlex_driver_build_hpoM6l/ini/scini.o 
"Following additional compilation's conditions are defined:" 
BLK_MQ_HEADER 
BLK_DEV_MAX_SEGMENTS 
SOCKET_HAS_NET_IN_CREATE 
BIO_BI_BDEV 
BIO_BI_STATUS 
BLK_QUEUE_FLAG_FUNCS 
BLK_INITIALIZE_RMQ_FN 
WAIT_QUEUE_ENTRY_T 
HAS_SCSI_REQUEST 
HAS_SCSI_REQ 
HAS_SCSI_CMND 
HAS_SCSI_IOCTL 
HAS_SCSI_IOCTL_WITH_GENDISK 
HAS_QUEUE_FLAG_DISCARD 
HAS_DISK_LIVE_IN_GENHD 
  MODPOST /tmp/PowerFlex_driver_build_hpoM6l/ini/Module.symvers 
  CC [M]  /tmp/PowerFlex_driver_build_hpoM6l/ini/scini.mod.o 
  LD [M]  /tmp/PowerFlex_driver_build_hpoM6l/ini/scini.ko 
  BTF [M] /tmp/PowerFlex_driver_build_hpoM6l/ini/scini.ko 
Skipping BTF generation for /tmp/PowerFlex_driver_build_hpoM6l/ini/scini.ko due to unavailability of vmlinux 
make: Leaving directory '/usr/src/linux-headers-5.15.0-30-generic' 
02-Apr-2024 11:46:48 INFO: Success.

SDC init-container
The SDC init container comes preconfigured to use the feature. It includes the gcc and makes packages, and the /etc/emc/scaleio/scini_sync/.build_scini file is present. However, for compilations to succeed, the kernel headers directory for the host kernel must be mapped to the container, to /usr/src. For example, to run the container manually with docker, after installing the correct kernel-devel package on the host, add -v/usr/src:/usr/src to the command line, for the kernel headers directory to be available to the compilation script.

Limitation
There can be a situation where the GCC compiler made available on the host’s Linux distribution is not advanced enough to compile the SDC against some kernel. This situation should be rare, as it will probably involve a custom kernel and not one common to that distribution. In this case, the user has to install a more advanced GCC from a non-standard package repository, and the location of that GCC will have to be specified in $PATH. There is no automatic way to provide an alternative GCC path to the SDC service.

Versions
3.6.3 or higher
4.5.2 or higher

Video Instructions

 

Affected Products

PowerFlex rack, PowerFlex Appliance, PowerFlex Software

Products

PowerFlex custom node
Article Properties
Article Number: 000224134
Article Type: How To
Last Modified: 18 Sep 2024
Version:  6
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.