From 4509e6f826350c86f8da4e5e29c2a341474d34dd Mon Sep 17 00:00:00 2001 From: Nisha Agarwal Date: Sun, 6 Sep 2015 23:38:16 -0700 Subject: [PATCH] Add a new element hpdsa This element enables creation of Ubuntu deploy ramdisk and user images which could be used to deploy the HP Proliant Servers with Dynamic Smart Array Controllers. Without this driver the disk with the Dynamic Smart Array Controller is not visible to the ramdisk. Closes bug: #1492803 Change-Id: Ibb3b298cd379cd7333279484df6ae30e9d7f6aaa --- elements/hpdsa/README.rst | 16 ++++++++++++++++ elements/hpdsa/package-installs.yaml | 5 +++++ elements/hpdsa/post-install.d/95-hpdsa | 14 ++++++++++++++ .../hpdsa/post-install.d/98-hpdsa-post-dkms | 11 +++++++++++ elements/hpdsa/pre-install.d/06-hpdsa | 14 ++++++++++++++ elements/hpdsa/root.d/10-hpdsa-check-distro | 17 +++++++++++++++++ 6 files changed, 77 insertions(+) create mode 100644 elements/hpdsa/README.rst create mode 100644 elements/hpdsa/package-installs.yaml create mode 100755 elements/hpdsa/post-install.d/95-hpdsa create mode 100755 elements/hpdsa/post-install.d/98-hpdsa-post-dkms create mode 100755 elements/hpdsa/pre-install.d/06-hpdsa create mode 100755 elements/hpdsa/root.d/10-hpdsa-check-distro 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