vponomaryov 572cef52e2 Add ZFS element
ZFS filesystem is going to be used for replication feature by
Manila Generic share driver.
So, add appropriate Manila image element as optional and enabled by default.

Set env var 'MANILA_ENABLE_ZFS_SUPPORT' to any value other than 'yes' to
disable its installation.

Change-Id: If58186dc03d43430c1225e77aa80a1f85a62dd1b
Closes-Bug: #1538658
2016-01-27 19:06:57 +02:00

58 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
# NOTE(vponomaryov): this approach of ZFS installation is valid for
# Ubuntu 14.04 (Trusty) and is very likely to be different for other releases.
# Also, ZFS should be installed in 'post-install.d' section because its
# dependency 'dkms' is installed in 'install.d/99-dkms'.
# Presense of 'ARCH' env var blocks DKMS from building new dynamic kernel
# modules. So, unset it temporary.
ARCH_BACKUP=$ARCH
unset ARCH
# Install 'software-properties-common' to get 'apt-add-repository' installed
apt-get install -y software-properties-common
# Register ZFS private package archive
apt-add-repository --yes ppa:zfs-native/stable
# Update list of available packages and then upgrade
apt-get -y -q update && apt-get -y -q upgrade
# 'linux-headers-*' should be installed prior to any dynamic kernel modules,
# which are 'zfs' and its dependency 'spl'.
# Same about 'build-essential', that is required for package compilations.
apt-get install -y linux-headers-generic
apt-get install -y build-essential
# Install ZFS for Ubuntu
apt-get install -y ubuntu-zfs
echo """
# Expected following template:
# %module-name%, %module-version%, %kernel-version%, %arch%: installed
#
# examples:
# spl, 0.6.5.4, 3.13.0-76-generic, x86_64: installed
# zfs, 0.6.5.4, 3.13.0-76-generic, x86_64: installed
#
# If it looks like following:
# spl, x.y.z, added
# zfs, x.y.z, added
#
# then something went wrong.
#
# List of dymanic kernel modules:
"""
dkms status
# Return back env var changes
export ARCH=$ARCH_BACKUP
unset ARCH_BACKUP