openSUSE Leap 15.1 on Fujitsu PRIMERGY RX2540 M4/M5

I heard a customer who would like to use openSUSE Leap on PRIMERGY RX2540 M4/M5. Although it's not officially supported, since SUSE Linux Enterprise Server (SLE or SLES) 15 is supported, openSUSE Leap should work.

I quickly tested openSUSE Leap 15.1 on RX2540 M4 with ServerView Suite (ServerView Agent for Linux and ServerView RAID Manager), and everything seems to work ok.
One thing to check is the onboard X722 network port driver (i40e). Fujitsu provides the OEM driver (i40e 2.10.19.30) for SLES 15 SP1 and this is required to use the latest firmware for X722, but this driver cannot be used for openSUSE Leap 15.1 as the driver is not built for the openSUSE kernel. That means you need to build the i40e driver 2.10.19.30 from the source code. You can obtain the source code from the Intel download site, or from Sourceforge (https://sourceforge.net/projects/e1000/files/i40e%20stable/2.10.19.30/).

When compiling the i40e driver, you probably see the following errors:

$ make
expr: non-integer argument
make[1]: Entering directory '/usr/src/linux-4.12.14-lp151.28.48'
make[2]: Entering directory '/usr/src/linux-4.12.14-lp151.28.48-obj/x86_64/default'
  CC [M]  /home/mmurayama/i40e-2.10.19.30/src/i40e_main.o
In file included from /home/mmurayama/i40e-2.10.19.30/src/i40e.h:33:0,
                 from /home/mmurayama/i40e-2.10.19.30/src/i40e_main.c:8:
/home/mmurayama/i40e-2.10.19.30/src/kcompat.h:881:31: error: operator '&&' has no right operand
         SLE_LOCALVERSION_CODE >= KERNEL_VERSION(92,0,0) && \
                               ^~
/home/mmurayama/i40e-2.10.19.30/src/kcompat.h:892:31: error: operator '==' has no left operand
        (SLE_LOCALVERSION_CODE == KERNEL_VERSION(6,33,0) || \
                               ^~
/home/mmurayama/i40e-2.10.19.30/src/kcompat.h:905:31: error: operator '==' has no left operand
        (SLE_LOCALVERSION_CODE == KERNEL_VERSION(94,41,0) || \
                               ^~
/home/mmurayama/i40e-2.10.19.30/src/kcompat.h:911:31: error: operator '==' has no left operand
        (SLE_LOCALVERSION_CODE == KERNEL_VERSION(23,0,0) || \
                               ^~
/home/mmurayama/i40e-2.10.19.30/src/kcompat.h:924:30: error: operator '&&' has no right operand
        SLE_LOCALVERSION_CODE >= KERNEL_VERSION(25,23,0))
                              ^~
In file included from /home/mmurayama/i40e-2.10.19.30/src/i40e.h:33:0,
                 from /home/mmurayama/i40e-2.10.19.30/src/i40e_main.c:8:
/home/mmurayama/i40e-2.10.19.30/src/kcompat.h: In function ‘_kc_macvlan_accel_priv’:
/home/mmurayama/i40e-2.10.19.30/src/kcompat.h:6370:18: error: ‘struct macvlan_dev’ has no member named ‘fwd_priv’; did you mean ‘accel_priv’?
  return macvlan->fwd_priv;
                  ^~~~~~~~
                  accel_priv
/home/mmurayama/i40e-2.10.19.30/src/kcompat.h: In function ‘_kc_macvlan_release_l2fw_offload’:
/home/mmurayama/i40e-2.10.19.30/src/kcompat.h:6380:11: error: ‘struct macvlan_dev’ has no member named ‘fwd_priv’; did you mean ‘accel_priv’?
  macvlan->fwd_priv = NULL;
           ^~~~~~~~
           accel_priv
/home/mmurayama/i40e-2.10.19.30/src/i40e_main.c: In function ‘i40e_setup_tc’:
/home/mmurayama/i40e-2.10.19.30/src/i40e_main.c:7565:6: error: ‘tc’ undeclared (first use in this function); did you mean ‘tm’?
  if (tc > i40e_pf_get_num_tc(pf)) {
      ^~
      tm
/home/mmurayama/i40e-2.10.19.30/src/i40e_main.c:7565:6: note: each undeclared identifier is reported only once for each function it appears in
/home/mmurayama/i40e-2.10.19.30/src/i40e_main.c: At top level:
/home/mmurayama/i40e-2.10.19.30/src/i40e_main.c:8150:14: warning: ‘struct tc_to_netdev’ declared inside parameter list will not be visible outside of this definition or declaration
       struct tc_to_netdev *tc)
              ^~~~~~~~~~~~
/home/mmurayama/i40e-2.10.19.30/src/i40e_main.c: In function ‘__i40e_setup_tc’:
/home/mmurayama/i40e-2.10.19.30/src/i40e_main.c:8162:36: error: dereferencing pointer to incomplete type ‘struct tc_to_netdev’
  struct tc_mqprio_qopt *mqprio = tc->mqprio;
                                    ^~
In file included from /home/mmurayama/i40e-2.10.19.30/src/i40e.h:33:0,
                 from /home/mmurayama/i40e-2.10.19.30/src/i40e_main.c:8:
/home/mmurayama/i40e-2.10.19.30/src/kcompat.h:6258:31: error: ‘TC_SETUP_MQPRIO’ undeclared (first use in this function); did you mean ‘TC_SETUP_QDISC_PRIO’?
 #define TC_SETUP_QDISC_MQPRIO TC_SETUP_MQPRIO
                               ^
/home/mmurayama/i40e-2.10.19.30/src/i40e_main.c:8168:7: note: in expansion of macro ‘TC_SETUP_QDISC_MQPRIO’
  case TC_SETUP_QDISC_MQPRIO:
       ^~~~~~~~~~~~~~~~~~~~~
/home/mmurayama/i40e-2.10.19.30/src/i40e_main.c:8169:32: error: ‘type_data’ undeclared (first use in this function); did you mean ‘node_data’?
   return i40e_setup_tc(netdev, type_data);
                                ^~~~~~~~~
                                node_data
/home/mmurayama/i40e-2.10.19.30/src/i40e_main.c:8171:10: error: implicit declaration of function ‘flow_block_cb_setup_simple’; did you mean ‘flow_block_binder_type’? [-Werror=implicit-function-declaration]
   return flow_block_cb_setup_simple(type_data,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~
          flow_block_binder_type
/home/mmurayama/i40e-2.10.19.30/src/i40e_main.c:8162:25: warning: unused variable ‘mqprio’ [-Wunused-variable]
  struct tc_mqprio_qopt *mqprio = tc->mqprio;
                         ^~~~~~
/home/mmurayama/i40e-2.10.19.30/src/i40e_main.c: At top level:
/home/mmurayama/i40e-2.10.19.30/src/i40e_main.c:13024:19: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .ndo_setup_tc  = __i40e_setup_tc,
                   ^~~~~~~~~~~~~~~
/home/mmurayama/i40e-2.10.19.30/src/i40e_main.c:13024:19: note: (near initialization for ‘i40e_netdev_ops.ndo_setup_tc’)
/home/mmurayama/i40e-2.10.19.30/src/i40e_main.c:16322:3: error: ‘const struct pci_error_handlers’ has no member named ‘reset_notify’; did you mean ‘reset_done’?
  .reset_notify = i40e_pci_error_reset_notify,
   ^~~~~~~~~~~~
   reset_done
/home/mmurayama/i40e-2.10.19.30/src/i40e_main.c:16322:18: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .reset_notify = i40e_pci_error_reset_notify,
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mmurayama/i40e-2.10.19.30/src/i40e_main.c:16322:18: note: (near initialization for ‘i40e_err_handler.reset_prepare’)
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-4.12.14-lp151.28.48/scripts/Makefile.build:325: /home/mmurayama/i40e-2.10.19.30/src/i40e_main.o] Error 1
make[2]: *** [/usr/src/linux-4.12.14-lp151.28.48/Makefile:1569: _module_/home/mmurayama/i40e-2.10.19.30/src] Error 2
make[2]: Leaving directory '/usr/src/linux-4.12.14-lp151.28.48-obj/x86_64/default'
make[1]: *** [Makefile:152: sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-4.12.14-lp151.28.48'
make: *** [Makefile:69: default] Error 2

To avoid this error, add an openSUSE Leap support to common.mk like this:

$ diff -Naur i40e-2.10.19.30.orig/ i40e-2.10.19.30/
diff -Naur i40e-2.10.19.30.orig/src/common.mk i40e-2.10.19.30/src/common.mk
--- i40e-2.10.19.30.orig/src/common.mk  2019-09-19 08:11:08.000000000 -0700
+++ i40e-2.10.19.30/src/common.mk       2020-07-07 12:40:49.211185781 -0700
@@ -176,6 +176,19 @@
 ifeq (1,$(shell ${CC} -E -dM ${CONFIG_FILE} 2> /dev/null |\
           grep -m 1 CONFIG_SUSE_KERNEL | awk '{ print $$3 }'))

+ifeq (1,$(shell ${CC} -E -dM ${CONFIG_FILE} 2> /dev/null |\
+          grep -m 1 CONFIG_SUSE_PRODUCT_OPENSUSE_LEAP | awk '{ print $$3 }'))
+
+  LOCALVERSION := $(shell ${CC} -E -dM ${CONFIG_FILE} 2> /dev/null |\
+                    grep -m 1 CONFIG_LOCALVERSION | awk '{ print $$3 }' |\
+                    cut -d'-' -f2 | sed 's/\.g[[:xdigit:]]\{7\}//')
+  LOCALVER_A := $(shell echo ${LOCALVERSION} | sed 's/^lp//' | cut -d'.' -f1)
+  LOCALVER_B := $(shell echo ${LOCALVERSION} | cut -s -d'.' -f2)
+  LOCALVER_C := $(shell echo ${LOCALVERSION} | cut -s -d'.' -f3)
+  SLE_LOCALVERSION_CODE := $(shell expr ${LOCALVER_A} \* 65536 + \
+                                        0${LOCALVER_B} \* 256 + 0${LOCALVER_C})
+  EXTRA_CFLAGS += -DSLE_LOCALVERSION_CODE=${SLE_LOCALVERSION_CODE}
+else
 ifneq (10,$(shell ${CC} -E -dM ${CONFIG_FILE} 2> /dev/null |\
          grep -m 1 CONFIG_SLE_VERSION | awk '{ print $$3 }'))

@@ -190,6 +203,7 @@
   EXTRA_CFLAGS += -DSLE_LOCALVERSION_CODE=${SLE_LOCALVERSION_CODE}
 endif
 endif
+endif

 EXTRA_CFLAGS += ${CFLAGS_EXTRA}

Then run "make".

$ make
make[1]: Entering directory '/usr/src/linux-4.12.14-lp151.28.48'
make[2]: Entering directory '/usr/src/linux-4.12.14-lp151.28.48-obj/x86_64/default'
  CC [M]  /home/mmurayama/i40e-2.10.19.30/src/i40e_main.o
  CC [M]  /home/mmurayama/i40e-2.10.19.30/src/i40e_ethtool.o
  CC [M]  /home/mmurayama/i40e-2.10.19.30/src/i40e_adminq.o
  CC [M]  /home/mmurayama/i40e-2.10.19.30/src/i40e_common.o
  CC [M]  /home/mmurayama/i40e-2.10.19.30/src/i40e_hmc.o
  CC [M]  /home/mmurayama/i40e-2.10.19.30/src/i40e_lan_hmc.o
  CC [M]  /home/mmurayama/i40e-2.10.19.30/src/i40e_nvm.o
  CC [M]  /home/mmurayama/i40e-2.10.19.30/src/i40e_debugfs.o
  CC [M]  /home/mmurayama/i40e-2.10.19.30/src/i40e_diag.o
  CC [M]  /home/mmurayama/i40e-2.10.19.30/src/i40e_txrx.o
  CC [M]  /home/mmurayama/i40e-2.10.19.30/src/i40e_ptp.o
  CC [M]  /home/mmurayama/i40e-2.10.19.30/src/i40e_filters.o
  CC [M]  /home/mmurayama/i40e-2.10.19.30/src/i40e_ddp.o
  CC [M]  /home/mmurayama/i40e-2.10.19.30/src/i40e_client.o
  CC [M]  /home/mmurayama/i40e-2.10.19.30/src/i40e_virtchnl_pf.o
  CC [M]  /home/mmurayama/i40e-2.10.19.30/src/i40e_dcb.o
  CC [M]  /home/mmurayama/i40e-2.10.19.30/src/i40e_dcb_nl.o
  CC [M]  /home/mmurayama/i40e-2.10.19.30/src/kcompat.o
  CC [M]  /home/mmurayama/i40e-2.10.19.30/src/kcompat_vfd.o
  LD [M]  /home/mmurayama/i40e-2.10.19.30/src/i40e.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/mmurayama/i40e-2.10.19.30/src/i40e.mod.o
  LD [M]  /home/mmurayama/i40e-2.10.19.30/src/i40e.ko
make[2]: Leaving directory '/usr/src/linux-4.12.14-lp151.28.48-obj/x86_64/default'
make[1]: Leaving directory '/usr/src/linux-4.12.14-lp151.28.48'
This time, it finishes without errors. You can then install the driver with "make install".
$ sudo make install
make[1]: Entering directory '/usr/src/linux-4.12.14-lp151.28.48'
make[2]: Entering directory '/usr/src/linux-4.12.14-lp151.28.48-obj/x86_64/default'
  Building modules, stage 2.
  MODPOST 1 modules
make[2]: Leaving directory '/usr/src/linux-4.12.14-lp151.28.48-obj/x86_64/default'
make[1]: Leaving directory '/usr/src/linux-4.12.14-lp151.28.48'
Installing modules...
make[1]: Entering directory '/usr/src/linux-4.12.14-lp151.28.48'
make[2]: Entering directory '/usr/src/linux-4.12.14-lp151.28.48-obj/x86_64/default'
  INSTALL /home/mmurayama/i40e-2.10.19.30/src/i40e.ko
  DEPMOD  4.12.14-lp151.28.48-default
make[2]: Leaving directory '/usr/src/linux-4.12.14-lp151.28.48-obj/x86_64/default'
make[1]: Leaving directory '/usr/src/linux-4.12.14-lp151.28.48'
/sbin/depmod -e -F /boot/System.map-4.12.14-lp151.28.48-default  -a 4.12.14-lp151.28.48-default
Updating initramfs...
dracut: Executing: /usr/bin/dracut --force
dracut: *** Including module: bash ***
dracut: *** Including module: systemd ***
dracut: *** Including module: warpclock ***
dracut: *** Including module: systemd-initrd ***
dracut: *** Including module: i18n ***
dracut: Could not find FONT_MAP none!
dracut: *** Including module: drm ***
dracut: *** Including module: plymouth ***
dracut: *** Including module: dm ***
dracut: Skipping udev rule: 64-device-mapper.rules
dracut: Skipping udev rule: 60-persistent-storage-dm.rules
dracut: Skipping udev rule: 55-dm.rules
dracut: *** Including module: kernel-modules ***
dracut: *** Including module: lvm ***
dracut: Skipping udev rule: 64-device-mapper.rules
dracut: Skipping udev rule: 56-lvm.rules
dracut: Skipping udev rule: 60-persistent-storage-lvm.rules
dracut: *** Including module: resume ***
dracut: *** Including module: rootfs-block ***
dracut: *** Including module: suse-btrfs ***
dracut: *** Including module: suse-xfs ***
dracut: *** Including module: terminfo ***
dracut: *** Including module: udev-rules ***
dracut: Skipping udev rule: 40-redhat.rules
dracut: Skipping udev rule: 50-firmware.rules
dracut: Skipping udev rule: 50-udev.rules
dracut: Skipping udev rule: 91-permissions.rules
dracut: Skipping udev rule: 80-drivers-modprobe.rules
dracut: *** Including module: dracut-systemd ***
dracut: *** Including module: haveged ***
dracut: *** Including module: usrmount ***
dracut: *** Including module: base ***
dracut: *** Including module: fs-lib ***
dracut: *** Including module: shutdown ***
dracut: *** Including module: suse ***
dracut: *** Including modules done ***
dracut: *** Installing kernel module dependencies and firmware ***
dracut: *** Installing kernel module dependencies and firmware done ***
dracut: *** Resolving executable dependencies ***
dracut: *** Resolving executable dependencies done***
dracut: *** Hardlinking files ***
dracut: *** Hardlinking files done ***
dracut: *** Stripping files ***
dracut: *** Stripping files done ***
dracut: *** Generating early-microcode cpio image ***
dracut: *** Constructing GenuineIntel.bin ****
dracut: *** Store current command line parameters ***
dracut: Stored kernel commandline:
dracut:  rd.lvm.lv=system/swap
 rd.lvm.lv=system/root
dracut:  resume=/dev/mapper/system-swap
dracut:  root=/dev/mapper/system-root rootfstype=xfs rootflags=rw,relatime,attr2,inode64,noquota
dracut: *** Creating image file '/boot/initrd-4.12.14-lp151.28.48-default' ***
dracut: *** Creating initramfs image file '/boot/initrd-4.12.14-lp151.28.48-default' done ***
make mandocs_install
make[1]: Entering directory '/home/mmurayama/i40e-2.10.19.30/src'
Copying manpages...
make[1]: Leaving directory '/home/mmurayama/i40e-2.10.19.30/src'
Check if the i40e driver is updated.
$ modinfo i40e
filename:       /lib/modules/4.12.14-lp151.28.48-default/updates/drivers/net/ethernet/intel/i40e/i40e.ko
version:        2.10.19.30
license:        GPL
description:    Intel(R) 40-10 Gigabit Ethernet Connection Network Driver
author:         Intel Corporation, 
suserelease:    openSUSE Leap 15.1
srcversion:     9EB781BDF574D047F098566
alias:          pci:v00008086d0000158Bsv*sd*bc*sc*i*
alias:          pci:v00008086d0000158Asv*sd*bc*sc*i*
alias:          pci:v00008086d000037D3sv*sd*bc*sc*i*
alias:          pci:v00008086d000037D2sv*sd*bc*sc*i*
alias:          pci:v00008086d000037D1sv*sd*bc*sc*i*
alias:          pci:v00008086d000037D0sv*sd*bc*sc*i*
alias:          pci:v00008086d000037CFsv*sd*bc*sc*i*
alias:          pci:v00008086d000037CEsv*sd*bc*sc*i*
alias:          pci:v00008086d00000D58sv*sd*bc*sc*i*
alias:          pci:v00008086d00000CF8sv*sd*bc*sc*i*
alias:          pci:v00008086d00001588sv*sd*bc*sc*i*
alias:          pci:v00008086d00001587sv*sd*bc*sc*i*
alias:          pci:v00008086d0000104Fsv*sd*bc*sc*i*
alias:          pci:v00008086d0000104Esv*sd*bc*sc*i*
alias:          pci:v00008086d000015FFsv*sd*bc*sc*i*
alias:          pci:v00008086d00001589sv*sd*bc*sc*i*
alias:          pci:v00008086d00001586sv*sd*bc*sc*i*
alias:          pci:v00008086d00001585sv*sd*bc*sc*i*
alias:          pci:v00008086d00001584sv*sd*bc*sc*i*
alias:          pci:v00008086d00001583sv*sd*bc*sc*i*
alias:          pci:v00008086d00001581sv*sd*bc*sc*i*
alias:          pci:v00008086d00001580sv*sd*bc*sc*i*
alias:          pci:v00008086d00001574sv*sd*bc*sc*i*
alias:          pci:v00008086d00001572sv*sd*bc*sc*i*
depends:        ptp
retpoline:      Y
vermagic:       4.12.14-lp151.28.48-default SMP mod_unload modversions
parm:           debug:Debug level (0=none,...,16=all) (int)
$ sudo ethtool -i eth0
driver: i40e
version: 2.10.19.30
firmware-version: 4.11 0x80001dd7 1.2527.0
expansion-rom-version:
bus-info: 0000:3d:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: yes
$ sudo lspci -s 0000:3d:00.0
3d:00.0 Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GbE SFP+ (rev 09)

Good Bye, Folks!

As you may have heard, Fujitsu has completely discontinued Data Center Products and Solutions business in North America on April 1st, 2021. ...