Linux Driver - Binary Rpm/source RPM User Guide and Known Limitation
Linux Driver - Binary Rpm/source RPM User Guide and Known Limitation
Linux Driver - Binary Rpm/source RPM User Guide and Known Limitation
TABLE OF CONTENTS
1. OVERVIEW ………………………………………..............................................................02
2. DRIVER COMPILATION STEPS ………………………………………………………………..02
3. RELEASE CONTENTS …………………………………………………………………...02
4. ERRATA/NOTES AND KNOWN LIMITATIONS …………………………………………………03
Page 1 of 11
1. OVERVIEW
Driver source code is placed inside the released driver package. And Driver source
tarball should be with below name:
megaraid_sas-<driver_version>-src.tar.gz
3) To compile the driver for distro use the helper script compile "compile.sh" bundled
inside source code:
# ./compile.sh
3. RELEASE CONTENTS
For any queries on supported OS matrix, please refer "OS_Support_list.txt" text file
bundled with each release. OS Support list file list out test coverage executed by Avago.
Megaraid_sas driver is GPLv2 open-source driver and source code level support is
possible for many Linux kernel versions. If you do not find binary level support for your
distribution in release contents, please use the source rpm method.
For any distribution or supported kernel version, there can be three possible packages:
For UEK kernels, only the KMODs RPMs are provided, not the DUDs. The
reasoning behind this is the OEL installation is using the native Red Hat kernels, not
UEK. UEK kernel RPMS can be installed after the basic installation is completed.
Please check with Oracle support team w.r.t UEK kernel installation process,
limitation and other technical queries which is more of generic and not related to MR
Drivers.
If driver RPM installation fails with kABI checks dependency failure message,
installing RPM package the user will need to use the "--nodeps" switch when
installing the binary."
RPM uses KMOD packaging dependency data to ensure the dependencies are met
before installing the binary RPM.
Red Hat maintains a whitelist of kernel symbols which RPM uses to validate against
the KMOD binaries. Some symbols may be in the kernel but not on the whitelist
which results in a failed binary RPM install.
User can use the "--nodeps" switch when installing the binary to skip those whitelist
symbol checks or any other dependency."
Known Issue:
In case of Citrix driver update disk use, where system has multiple MegaRAID
controllers (at least one MR controller which is supported by Inbox
Citrix<megaraid_sas> driver), user will not see storage behind controller which is not
supported by Inbox Driver (normally this was not expected since user expected driver
update disk will work well and it will detect all controllers).
Reason for the issue:
Since Xen Server load megaraid_sas driver from the inbox, before it asks for Driver
update disk, user can see "No Storage Disk" on some servers as explained above.
Workaround:
If you are booting from CD, when presented with the 'boot:' prompt you want to type
'shell', where you can then rmmod your driver before continuing with the installation.
Below are two commonly used packaging formats by various Linux distributions:
Please note that after install/remove driver package, the system needs to be rebooted to
get intended driver loaded or manually remove the module and insert (read man page
“rmmod” and “modprobe” for more info)
2. To verify the status of installed packages then type the following command:
# dpkg -s megaraid-sas
3. After installing megaraid_sas driver, type below command to get the currently
installed megaraid_sas driver:
# modinfo megaraid_sas
4. To use installed DEB driver loaded, restart the machine and type following
command to get currently loaded driver version:
# cat /sys/modules/megaraid_sas/version
- This version should be the same as the driver version of the installed
driver DEB package.
c. Source rpm which use generic build interface (Create initramfs internally and
does not depend upon any external tool)
If a user doesn’t know which source rpm is better for their environment, we
recommend trying #c (for any other distro other than Redhat/Novell)
A quick search of “rpm –qa | grep kmod” can provide a hint, if kmod tool support is
available or not.
To generate binary rpm from source rpm, a user should have a compilation/build
environment to create kernel module, utilities to build RPM(e.g. rpmbuild..). E.a system
where a user has yum repo configured, use below yum command to install development
tools.
Exact commands to create a build environment would be different across distros so this
document is not the right place to cover those details. Please refer OS vendor document if
needed how to create build/compilation environment for specific OS distro.
Installing above RPM will copy driver SPEC file to specific location (configured as
part of rpm package. This path can be different for each OS distribution.)
To locate SPEC file, check output logs of above source RPM installation (see blue
marked gives SPEC file location).
e.g.
2. Go to the directory where driver SPEC file is copied as part of #1. There must be
SPEC file.
e.g. megaraid_sas.spec/lsi-megaraid_sas or megaraid_sas.spec(driver SPEC file name
could be different for different distros, so check SPEC file with megaraid string in its
name). Check spec file name in the #1 command output. It provides the location and
spec filename.
3. Build binary RPM from source RPM. Run the following command:
# rpmbuild -ba <DRIVER_SPEC_FILE>
4. Binary RPMs will be available if #3 exits without any error. Go to the directory where
new binary RPM is generated.
Wrote: /root/rpmbuild/SRPMS/megaraid_sas-06.810.00.02-98.src.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/megaraid_sas-06.810.00.02-98.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/megaraid_sas-debuginfo-06.810.00.02-98.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.ZbHbmH
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd megaraid_sas-06.810.00.02
+ /usr/bin/rm -rf /root/rpmbuild/BUILDROOT/megaraid_sas-06.810.00.02-98.x86_64
+ exit 0
--
5. Create driver .deb package from binary RPM, Execute below command:
# alien -k --to-deb --scripts <GENRATED_DRIVER_RPM>
Now, Install generated binary rpms using steps mentioned at “Install/Remove/Upgrade
driver binary package”
https://docs.fedoraproject.org/en-US/Fedora/21/html/System_Administrators_Guide/sec-
Verifying_the_Initial_RAM_Disk_Image.html#bh-
Verifying_the_Initial_RAM_Disk_Image_and_Kernel_on_IBM_eServer_System_i
Canonical recommends for Ubuntu, driver support should be provided through DKMS
based driver source deb package. We provide single driver source Deb package which
should work for all Ubuntu versions supported by us.
In case you get DKMS Deb/RPM package, then install it using below commands:
# dpkg –i dkms-<version>-<release>.noarch.deb
# dpkg -i <module>-<version>-<rpmversion>.noarch.deb
With a DKMS enabled module Deb/RPM, most of the installation work done by the
RPM is handed off to DKMS within the RPM/Deb. Generally, it does the following:
Once the RPM/Deb installation is complete, you can use DKMS to understand which
module and which module version is installed on which kernels. This can be
accomplished via the command:
# dkms status
From here, you can then use the various DKMS commands (eg. add, build, install,
uninstall) to load that module onto other kernels.
1. This would require an updated GCC package with support for retpoline options.
Refer the latest GCC version released by OSV that supports retpoline options:
“-mindirect-branch” and “-mindirect-branch-register”.
2. The RPM SPEC file provided in the source RPM contains conditional build section
that can be enabled by passing “--with retpoline” option to the rpmbuild command
mentioned in step #3 above.
Eg: #rpmbuild -ba --with retpoline <DRIVER_SPEC_FILE>
3. Passing this flag through rpmbuild command will enable the below additional GCC
flags required to compile the driver source with retpoline support:
KCFLAGS='-mindirect-branch=thunk-inline -mindirect-branch-register'
4. Driver module compiled this way will expose “retpoline: Y” in modinfo output.
All Source RPMs are signed/encrypted with GnuPG public-private encryption scheme to
ensure the authenticity of the source RPMs. GPG public-private key pair is a 4k bit long
with RSA encryption algorithm and all SRPMS are signed with the same. The private key
is only held by Broadcom and associated public key is kept on the Broadcom website.
Below is the verification guide link which contains the detailed steps to verify the source
RPM and public key link to download the public key file.
VERIFICATION-GUIDE
PUBLIC-KEY
In addition to the unsigned binaries, Broadcom provides OpenSSL signed binaries for
RHEL and SLES OS for UEFI secure boot environment. Binaries are signed with
OpenSSL public-private key pair. The private key is only held by Broadcom and the
associated public key will be provided as part of the driver release package named
DCSG00411462_selfcet.der.
The release package has folders prefixed with signed for signed driver binaries
Ex.
https://drivers.suse.com/doc/Usage/Secure_Boot_Certificate.html#secure-boot-certificate