6 Replies Latest reply on Aug 3, 2017 2:27 PM by Intel Corporation

    compiling megasr.ko for my C222 RAID controller

    dolphs

      Hi,

       

      I like to set up my C222 RAID controller to be used with XenServer 7.2 but I failed.

      I managed to set it up with CentOS7.2 ( kernel 3.10 ) with the packages provided.
      But I do not succeed with XEN as it runs on CentOS7.2 but with a 4.4 kernel:

       

      1/ hardware
      00:1f.2 RAID bus controller: Intel Corporation 8 Series/C220 Series Chipset Family SATA Controller 1 [RAID mode] (rev 05)
              Subsystem: ASUSTeK Computer Inc. Device 8552
              Kernel driver in use: ahci
      # instead of ahci this should become the compiled megasr module

       

      2/ xen
      [root@tstxen ~]# cat /etc/redhat-release
      XenServer release 7.2.0 (xenenterprise)

      [root@tstxen ~]# uname -a
      Linux tstxen 4.4.0+10 #1 SMP Thu May 11 16:35:25 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux


      So I went to " http://https://downloadcenter.intel.com/ " and downloaded
      the Embedded Server RAID Technology 2 RAID Driver for Linux: "ESRT2_Linux_DRV_v17.01.2016.0216_r3.tgz"
      #for 7.3 there is another available

       

      Unpacked this on XenServer DDK ( Driver Development Kit ) VM and executed: " make -C /usr/src/kernels/4.4.0+10-x86_64 M=/tmp/megasr-raid5/shim/library/rhel7-64 "
      This resulted in modules built, but with lots of warnings ( see logs attached ).

       

      [root@localhost rhel7-64]# ls -l /tmp/megasr-raid5/shim/library/rhel7-64
      total 37496
      -rw-r--r-- 1 root root        8 Jul 30 08:34 built-in.o
      -rw-r--r-- 1 root root      248 Feb 16  2016 Makefile
      -rw-r--r-- 1 root root 12828544 Jul 30 08:34 megasr.ko
      -rw-r--r-- 1 root root 12581296 Feb 16  2016 megasr-lib.a
      -rw-r--r-- 1 root root    70110 Jul 30 08:34 megasr.mod.c
      -rw-r--r-- 1 root root   254048 Jul 30 08:34 megasr.mod.o
      -rw-r--r-- 1 root root 12576043 Jul 30 08:34 megasr.o
      -rw-r--r-- 1 root root       57 Jul 30 08:34 modules.order
      -rw-r--r-- 1 root root        0 Jul 30 08:34 Module.symvers

       


      Executing " insmod megasr.ko " results in:

      [root@localhost rhel7-64]# insmod megasr.ko
      insmod: ERROR: could not insert module megasr.ko: Unknown symbol in module

       


      Therefore can one guide me building a proper kernel module please, perhaps using dkms instead ( /tmp/megasr-raid5/RPM )?

       

      thanks

        • 1. Re: compiling megasr.ko for my C222 RAID controller
          dolphs

          another attempt failed:


          mkdir /usr/src/megasr-17.01.2016.0216
          cd /usr/src/megasr-17.01.2016.0216
          tar -xvzf /tmp/ESRT2_Linux_DRV_v17.01.2016.0216_r3.tar.gz


          installed dkms-x.x.xx.x-x.noarch.rpm

          [root@localhost RPM]# systemctl status dkms
          ‚óŹ dkms.service - Builds and install new kernel modules through DKMS
             Loaded: loaded (/usr/lib/systemd/system/dkms.service; enabled; vendor preset: enabled)
             Active: active (exited) since Sun 2017-07-30 08:59:50 UTC; 3s ago
               Docs: man:dkms(8)
            Process: 13415 ExecStart=/bin/sh -c dkms autoinstall --verbose --kernelver $(uname -r) (code=exited, status=0/SUCCESS)
          Main PID: 13415 (code=exited, status=0/SUCCESS)

          Jul 30 08:59:50 localhost systemd[1]: Starting Builds and install new kernel modules through DKMS...
          Jul 30 08:59:50 localhost systemd[1]: Started Builds and install new kernel modules through DKMS.

           


          [root@localhost RPM]# cd /usr/src/megasr-17.01.2016.0216/megasr-raid5/RPM
          [root@localhost RPM]# rpm -ivh megasr-17.01.2016.0216-1.noarch.rpm
          Preparing...                          ################################# [100%]
          Updating / installing...
             1:megasr-17.01.2016.0216-1         ################################# [100%]
          Error! Could not locate dkms.conf file.
          File: /usr/src/megasr-17.01.2016.0216/dkms.conf does not exist.
          warning: %post(megasr-17.01.2016.0216-1.noarch) scriptlet failed, exit status 4

           


          Thus created /usr/src/megasr-17.01.2016.0216/dkms.conf:

          MAKE="make -C /usr/src/kernels/4.4.0+10-x86_64 M=/usr/src/megasr-17.01.2016.0216/megasr-raid5/shim/library/rhel7-64"
          PACKAGE_NAME="megasr"
          PACKAGE_VERSION="17.01.2016.0216"
          BUILT_MODULE_NAME[0]="megasr"
          DEST_MODULE_LOCATION[0]="/kernel/drivers/scsi/"
          AUTOINSTALL="yes"

           

           

          But this did not build either:

           

          [root@localhost RPM]# rpm -ivh megasr-17.01.2016.0216-1.noarch.rpm --force


          Preparing...                          ################################# [100%]
          Updating / installing...
              1:megasr-17.01.2016.0216-1         ################################# [100%]

          Kernel preparation unnecessary for this kernel.  Skipping...

          Building module:
          cleaning build area...(bad exit status: 2)
          make -j8 KERNELRELEASE=4.4.0+10 -C /usr/src/kernels/4.4.0+10-x86_64 M=/usr/src/megasr-17.01.2016.0216/megasr-raid5/shim/library/rhel7-64...
          Error!  Build of megasr.ko failed for: 4.4.0+10 (x86_64)
          Consult the make.log in the build directory
          /var/lib/dkms/megasr/17.01.2016.0216/build/ for more information.
          warning: %post(megasr-17.01.2016.0216-1.noarch) scriptlet failed, exit status 7

           

          [root@localhost RPM]# more /var/lib/dkms/megasr/17.01.2016.0216/build/make.log
          DKMS make.log for megasr-17.01.2016.0216 for kernel 4.4.0+10 (x86_64)
          Sun Jul 30 09:35:51 UTC 2017
          make: Entering directory `/usr/src/kernels/4.4.0+10-x86_64'
             Building modules, stage 2.
             MODPOST 1 modules
          WARNING: "__stack_chk_fail" [/usr/src/megasr-17.01.2016.0216/megasr-raid5/shim/library/rhel7-64/megasr.ko] undefined!
          make: Leaving directory `/usr/src/kernels/4.4.0+10-x86_64'

           

           

           

          Would love to hear the breakthrough so I can finally start using my hardware in RAID10 ...

          thanks

          • 2. Re: compiling megasr.ko for my C222 RAID controller
            Intel Corporation
            This message was posted on behalf of Intel Corporation

            Hello dolphs,
             
            In this case, for you to get better support to set up this RAID controller to be used with XenServer 7.2 you will need to contact the OEM (Original Equipment Manufacturer), I understand that your system has an Intel® chipset but for this server system that you have the proper support will be provided by your computer manufacturer.
             
            According with the information you provided your system is an ASUS computer so I’m sure they will be able to assist you better.
             
            Somebody else with similar system is welcome to help dolphs how to set up this RAID controller with XenServer 7.2.
             
             
            Best regards,
             
             
            Ivan U.
             

            • 3. Re: compiling megasr.ko for my C222 RAID controller
              dolphs

              Hello,

               

              thanks for your response.

              ASUS answer was a bit disappointing telling me the mainboard is qualified as End of Life:

               

              "We do also offer RHEL Drivers on our Website, but only up to v6
              Later Versions we will not support due to this Motherboard is EOL."

               

               

              However I hope Intel still supports the C22x Embedded Server RAID Technology ( eg: used in S1200RP Server Boards ), considering the Embedded Server RAID Technology 2 RAID Driver for Linux: "ESRT2_Linux_DRV_v17.01.2016.0216_r3.tgz"  and "MR_SWR_Driver_1.50-17.01.2016.1107" it seems it is still active as both work with the C222 S-ATA controller.

               

              In fact I made it working with Xen 6.5, similar way as initial post but using rhel5-64 instead as XEN 6.5 uses CentOS 5.10 under the hood ( dom0 ):

               

              [root@localhost rhel5-64]# make -C /usr/src/kernels/3.10.0+2-x86_64/ M=/usr/src/megasr-raid5/shim/library/rhel5-64

               

              make: Entering directory `/usr/src/kernels/3.10.0+2-x86_64'
                LD      /usr/src/megasr-raid5/shim/library/rhel5-64/built-in.o
                CC [M]  /usr/src/megasr-raid5/shim/library/rhel5-64/../../open_source/oss/lin/lin_oss.o
              /usr/src/megasr-raid5/shim/library/rhel5-64/../../open_source/oss/lin/../../cmn_defs.h:155: warning: 'count_trailing_zeros' defined but not used
                CC [M]  /usr/src/megasr-raid5/shim/library/rhel5-64/../../open_source/osl/lin/osl_char.o
              /usr/src/megasr-raid5/shim/library/rhel5-64/../../open_source/osl/lin/../../cmn_defs.h:155: warning: 'count_trailing_zeros' defined but not used
                CC [M]  /usr/src/megasr-raid5/shim/library/rhel5-64/../../open_source/osl/lin/linux_osl.o
              /usr/src/megasr-raid5/shim/library/rhel5-64/../../open_source/osl/lin/linux_osl.c: In function 'setup_sglist_each_sg':
              /usr/src/megasr-raid5/shim/library/rhel5-64/../../open_source/osl/lin/linux_osl.c:2326: warning: comparison is always false due to limited range of data type
              /usr/src/megasr-raid5/shim/library/rhel5-64/../../open_source/osl/lin/linux_osl.c: At top level:
              /usr/src/megasr-raid5/shim/library/rhel5-64/../../open_source/osl/lin/../../cmn_defs.h:155: warning: 'count_trailing_zeros' defined but not used
              /usr/src/megasr-raid5/shim/library/rhel5-64/../../open_source/osl/lin/linux_osl.c: In function 'megasr_linux_process_low_mem_io_notify':
              /usr/src/megasr-raid5/shim/library/rhel5-64/../../open_source/osl/lin/linux_osl.c:868: warning: 'total_skip_bytes' is used uninitialized in this function
                LD [M]  /usr/src/megasr-raid5/shim/library/rhel5-64/megasr.o
                Building modules, stage 2.
                MODPOST 1 modules
                CC      /usr/src/megasr-raid5/shim/library/rhel5-64/megasr.mod.o
                LD [M]  /usr/src/megasr-raid5/shim/library/rhel5-64/megasr.ko
              make: Leaving directory `/usr/src/kernels/3.10.0+2-x86_64'

               

               

              The module built can be used for Xen 6.5 ( blacklist ahci and start using megasr ).

              This makes me wonder if it is a kernel "issue" as this version has 3.10, while 7.2 uses 4.4

              It would be great if one can help me building a proper megasr.ko module ( for long term kernels >=4.4 ).

               

              thanks

              • 4. Re: compiling megasr.ko for my C222 RAID controller
                Intel Corporation
                This message was posted on behalf of Intel Corporation

                Hello dolphs,
                 
                Honestly our support for this embedded chipset on this ASUS motherboard is limited; you will get help here if a contributor can help you with it.
                 
                Have you tried posting your question at the Citrix community, you can try here:
                https://www.citrix.com/contact/technical-support.html
                 
                Or you can try the Linux* community:
                http://www.linuxquestions.org/questions/red-hat-31/rhel-5-installation-and-megasr-driver-598656/
                 
                NOTE: These links are being offered for your convenience and should not be viewed as an endorsement by Intel of the content, products, or services offered there.
                 
                 
                Best regards,
                 
                 
                Ivan U.
                 

                • 5. Re: compiling megasr.ko for my C222 RAID controller
                  dolphs

                  Hi Ivan,

                   

                  Thanks for feedback it is appreciated.

                  Indeed focus is on building the kernel module from scratch for RedHat ( Centos )

                  Refer to initial post where make is being used and the specific 4.4 kernel source to build the module megasr.ko ( "ESRT2_Linux_DRV_v17.01.2016.0216_r3.tgz" )
                  In theory I could use the updated " MR_SWR_Driver_1.50-17.01.2016.1107 " as I noticed from that package the library " megasr-lib.a " has a different size ( and timestamp )

                  As said this resulted in the megasr.ko module built, but with lots of warnings and once  insmod-ding or modprob-ing it comes with a nice error " insmod: ERROR: could not insert module megasr.ko: Unknown symbol in module "

                   

                  there is another approach using DKMS ( 2nd post ) installing CentOS7.3, compiling driver, upgrade kernel 3.10 to 4.4 but I am not familiar with DKMS.

                   

                  For now things work on Xen 6.5 and once I will start configuring my 2nd server equipped with an Intel Server Board (S1200V3RPS ) I will give it another try.

                   

                  thanks

                  • 6. Re: compiling megasr.ko for my C222 RAID controller
                    Intel Corporation
                    This message was posted on behalf of Intel Corporation

                    You are more than welcome!
                     
                    Hopefully somebody with similar system can contribute here and I hope you can have better experience with the Intel® server board.
                     
                     
                    Best regards,
                     
                     
                    Ivan U.