Commit 5c211032 authored by David Johnson's avatar David Johnson

Add megaraid_sas driver.

parent dc8c0de7
......@@ -3,10 +3,10 @@ PKGTYPE ?= $(shell scripts/osstuff.sh -p)
DRIVERS =
ifeq ($(PKGTYPE),deb)
DRIVERS = e1000e igb i40e i40evf ixgbe ixgbevf mpt3sas mlnx-ofed-src
DRIVERS = e1000e igb i40e i40evf ixgbe ixgbevf mpt3sas megaraid_sas mlnx-ofed-src
endif
ifeq ($(PKGTYPE),rpm)
DRIVERS = i40e i40evf ixgbe ixgbevf mpt3sas
DRIVERS = i40e i40evf ixgbe ixgbevf mpt3sas megaraid_sas
endif
INSTALL_DRIVERS := $(addsuffix -install,$(DRIVERS))
......
NAME = megaraid_sas
PKGNAME = $(NAME)-dkms
ALTPKGNAME = megaraid-sas-dkms
VERSION ?= 07.705.04.00
PKGVERSION ?= $(VERSION)-0
BUILDDIR = build
SOURCEDIR = $(BUILDDIR)/$(NAME)-$(VERSION)
FILENAME = $(NAME)-$(VERSION)-src.tar.gz
TARBALLDIR = ../../tarballs
TARBALL = $(TARBALLDIR)/$(FILENAME)
FETCH = ../../scripts/fetch.sh
DEBPKGDIR = ..
DEBPKGNAME = $(ALTPKGNAME)_$(PKGVERSION)_all.deb
DEBPKGPATH = $(DEBPKGDIR)/$(DEBPKGNAME)
RPMPKGPATH = $(BUILDDIR)/RPMS/noarch/$(PKGNAME)-$(PKGVERSION).noarch.rpm
all:
clean: deb-clean rpm-clean
$(TARBALL):
$(FETCH) $(TARBALLDIR) $(FILENAME)
$(SOURCEDIR): $(TARBALL)
if [ -d $(SOURCEDIR) ]; then rm -rf $(SOURCEDIR); fi
mkdir -p $(BUILDDIR)
tar -xzf $(TARBALL) -C $(BUILDDIR)
touch $(SOURCEDIR)
$(DEBPKGPATH): | $(SOURCEDIR)
dpkg-buildpackage -us -uc
deb: $(DEBPKGPATH)
deb-install: deb
dpkg -i $(DEBPKGPATH)
deb-clean:
rm -rf $(SOURCEDIR) $(DEBPKGPATH) $(DEBPKGDIR)/$(PKGNAME)_*
$(BUILDDIR)/SOURCES/$(FILENAME): $(TARBALL)
mkdir -p $(BUILDDIR)/SOURCES
cp -p $(TARBALL) $(BUILDDIR)/SOURCES/$(FILENAME)
cp -p dkms.conf $(BUILDDIR)/SOURCES
$(RPMPKGPATH): rpm/$(PKGNAME).spec $(BUILDDIR)/SOURCES/$(FILENAME)
mkdir -p $(BUILDDIR)/{BUILD,RPMS/noarch}
rpmbuild --define "_topdir "$(shell readlink -f $(BUILDDIR)) -ba rpm/$(PKGNAME).spec
rpm: $(RPMPKGPATH)
rpm-clean:
rm -rf $(RPMPKGPATH) $(BUILDDIR)/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
rpm-install: rpm
rpm -iv $(RPMPKGPATH)
.PHONY: all clean deb deb-install deb-clean
megaraid-sas-dkms (07.705.04.00-0) unstable; urgency=medium
* megaraid_sas 07.705.04.00 DKMS package.
-- David M. Johnson <johnsond@flux.utah.edu> Wed, 06 Mar 2019 08:30:28 -0700
Source: megaraid-sas-dkms
Maintainer: Testbed Operations <testbed-ops@flux.utah.edu>
Build-Depends: debhelper (>= 9), dkms
Package: megaraid-sas-dkms
Architecture: all
Depends: ${misc:Depends}
Description: DKMS source for the megaraid_sas driver
#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk
%:
dh $@ --with dkms
override_dh_install:
dh_install \
build/megaraid_sas-$(DEB_VERSION_UPSTREAM)/{Makefile,*.c,*.h} \
usr/src/megaraid_sas-dkms-$(DEB_VERSION_UPSTREAM)
override_dh_dkms:
dh_dkms -V $(DEB_VERSION_UPSTREAM) -- dkms.conf
override_dh_auto_configure:
override_dh_auto_build:
override_dh_auto_test:
override_dh_auto_install:
override_dh_auto_clean:
PACKAGE_NAME="megaraid_sas-dkms"
PACKAGE_VERSION="#MODULE_VERSION#"
BUILT_MODULE_NAME[0]="megaraid_sas"
DEST_MODULE_LOCATION[0]="/updates/dkms"
AUTOINSTALL="YES"
REMAKE_INITRD="YES"
%define module megaraid_sas
%define name %{module}-dkms
%define version 07.705.04.00
%define release 0
%define srcdirname %{module}-%{version}
Source: http://www.emulab.net/downloads/linux-dkms/%{module}-%{version}-src.tar.gz
Summary: DKMS version of the megaraid_sas kernel module
Name: %{name}
Version: %{version}
License: GPLv2
Release: 0
BuildArch: noarch
Requires: dkms gcc kernel-devel
%description
DKMS version of the megaraid_sas kernel module.
%prep
%setup -n %{srcdirname}
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/usr/src/%{module}-%{version}/
cp -pR %{_builddir}/%{srcdirname}/* %{buildroot}/usr/src/%{module}-%{version}/
cp -p %{_sourcedir}/dkms.conf %{buildroot}/usr/src/%{module}-%{version}/
%clean
rm -rf %{buildroot}
%files
%defattr(0644,root,root)
%attr(0755,root,root) /usr/src/%{module}-%{version}/
%post
occurrences=`/usr/sbin/dkms status | grep "%{module}" | grep "%{version}" | wc -l`
if [ $occurrences -eq 0 ]; then
/usr/sbin/dkms add -m %{module} -v %{version}
fi
/usr/sbin/dkms build -m %{module} -v %{version}
/usr/sbin/dkms install -m %{module} -v %{version}
exit 0
%preun
/usr/sbin/dkms remove -m %{module} -v %{version} --all
exit 0
%changelog
* Wed Mar 06 2019 David M. Johnson <johnsond@flux.utah.edu> 07.705.04.00-0
- Initial release of DKMS version of the megaraid_sas kernel module.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment