diff --git a/elements/hpdsa/README.rst b/elements/hpdsa/README.rst new file mode 100644 index 00000000..3e0371ca --- /dev/null +++ b/elements/hpdsa/README.rst @@ -0,0 +1,16 @@ +===== +hpdsa +===== +This is the hpdsa element. + +This element enables the 'hpdsa' driver to be included in +the ramdisk when invoked during ramdisk/image creation. + +This driver is required for deploying the HP Proliant Servers +Gen9 with Dynamic Smart Array Controllers. + +Note: This element supports only Ubuntu image/ramdisk to be +updated with the hpdsa driver. It installs hp certificate +from https://downloads.linux.hp.com/SDR/hpPublicKey2048_key1.pub. +Since HP has released this currently only for trusty, +It has been restricted to work only for trusty. diff --git a/elements/hpdsa/package-installs.yaml b/elements/hpdsa/package-installs.yaml new file mode 100644 index 00000000..171dde77 --- /dev/null +++ b/elements/hpdsa/package-installs.yaml @@ -0,0 +1,5 @@ +build-essential: +curl: + phase: pre-install.d +linux-headers-generic: +hpdsa-dkms: diff --git a/elements/hpdsa/post-install.d/95-hpdsa b/elements/hpdsa/post-install.d/95-hpdsa new file mode 100755 index 00000000..d59e7c0d --- /dev/null +++ b/elements/hpdsa/post-install.d/95-hpdsa @@ -0,0 +1,14 @@ +#!/bin/bash + +if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then + set -x +fi +set -eu +set -o pipefail +# Blacklist the ahci driver for hpdsa to recognize the disks. +# It can also be done with element "modprobe-blacklist" which +# would add the ahci driver to /etc/modprobe.d/blacklist.conf. +# To be on safer side, blacklist the driver ahci without the +# element "modprobe-blacklist" also. +echo "blacklist ahci" >> /etc/modprobe.d/install-hpdsa.conf +echo "hpdsa" >> /etc/modules diff --git a/elements/hpdsa/post-install.d/98-hpdsa-post-dkms b/elements/hpdsa/post-install.d/98-hpdsa-post-dkms new file mode 100755 index 00000000..da1f22d0 --- /dev/null +++ b/elements/hpdsa/post-install.d/98-hpdsa-post-dkms @@ -0,0 +1,11 @@ +#!/bin/bash + +if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then + set -x +fi +set -eu +set -o pipefail + +# This is required for HPDSA driver to be included in the +# ramdisk of the image. +update-initramfs -u diff --git a/elements/hpdsa/pre-install.d/06-hpdsa b/elements/hpdsa/pre-install.d/06-hpdsa new file mode 100755 index 00000000..3dd923b8 --- /dev/null +++ b/elements/hpdsa/pre-install.d/06-hpdsa @@ -0,0 +1,14 @@ +#!/bin/bash + +if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then + set -x +fi +set -eu +set -o pipefail + +# Add hpdsa repository +echo 'deb https://downloads.linux.hp.com/SDR/repo/ubuntu-hpdsa' $DIB_RELEASE ' main' \ + >> /etc/apt/sources.list.d/ubuntu-hpdsa.list + +# Add the key +curl https://downloads.linux.hp.com/SDR/hpPublicKey2048_key1.pub | apt-key add - diff --git a/elements/hpdsa/root.d/10-hpdsa-check-distro b/elements/hpdsa/root.d/10-hpdsa-check-distro new file mode 100755 index 00000000..0ffd2ef9 --- /dev/null +++ b/elements/hpdsa/root.d/10-hpdsa-check-distro @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then + set -x +fi +set -eu +set -o pipefail + +if [ 'ubuntu' != $DISTRO_NAME ] ; then + echo "Only ubuntu is supported for hpdsa driver. The DISTRO is set to $DISTRO_NAME" + exit 1 +fi + +if [ 'trusty' != $DIB_RELEASE ] ; then + echo "Only trusty is supported for hpdsa driver. The DIB_RELEASE is set to $DIB_RELEASE" + exit 1 +fi