diff --git a/README.md b/README.md index da0ee4af..931fe261 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,12 @@ OpenStack itself. These live in the TripleO elements repository What tools are there? --------------------- -* disk-image-create -o filename {element} [{element} ...] : Create an image of - element {element}, optionally mixing in other elements. You will usually want - to include the "base" element in your image. +* disk-image-create [-a i386|amd64|armhf] -o filename {element} [{element} ...] + Create an image of element {element}, optionally mixing in other elements. + Element dependencies are automatically included. Support for other + architectures depends on your environment being able to run binaries of that + platform. For instance, to enable armhf on Ubuntu install the qemu-user-static + package. * ramdisk-image-create -o filename {element} [{element} ...] : Create a kernel+ ramdisk pair for running maintenance on bare metal machines (deployment, @@ -108,13 +111,13 @@ part of the process you need to customise: to blindly overwrite but instead to adapt the context extracted by other elements. - * inputs: $ARCH=i386|amd64 $TARGET\_ROOT=/path/to/target/workarea + * inputs: $ARCH=i386|amd64|armhf $TARGET\_ROOT=/path/to/target/workarea * cleanup.d: Perform cleanups of the root filesystem content. For instance, temporary settings to use the image build environment HTTP proxy are removed here in the dpkg element. Runs outside the chroot on the host environment. - * inputs: $ARCH=i386|amd64 $TARGET\_ROOT=/path/to/target/workarea + * inputs: $ARCH=i386|amd64|armhf $TARGET\_ROOT=/path/to/target/workarea * block-device-size.d: Alter the size (in GB) of the disk image. This is useful when a particular element will require a certain minimum (or maximum) size. diff --git a/bin/disk-image-create b/bin/disk-image-create index f8923a02..50456566 100755 --- a/bin/disk-image-create +++ b/bin/disk-image-create @@ -32,7 +32,7 @@ source $_LIB/die function show_options () { echo "Options:" - echo " -a i386|amd64 -- set the architecture of the image" + echo " -a i386|amd64|armhf -- set the architecture of the image" echo " -o filename -- set the name of the output file" echo " -x -- turn on tracing" echo " -u -- uncompressed; do not compress the image - larger but faster" diff --git a/elements/base/install.d/00-baseline-environment b/elements/base/install.d/00-baseline-environment index d0004bb1..13b28df5 100755 --- a/elements/base/install.d/00-baseline-environment +++ b/elements/base/install.d/00-baseline-environment @@ -3,4 +3,4 @@ set -e -install-packages linux-image-generic vlan open-iscsi +install-packages vlan open-iscsi diff --git a/elements/base/install.d/99-up-to-date b/elements/base/install.d/99-up-to-date new file mode 100755 index 00000000..53f327c8 --- /dev/null +++ b/elements/base/install.d/99-up-to-date @@ -0,0 +1,7 @@ +#!/bin/bash +# Fully upgrade everything on the system (if the package manager knows how to +# do it). + +set -e + +install-packages -u diff --git a/elements/dpkg/bin/install-packages b/elements/dpkg/bin/install-packages index 097d1e72..35dc9d69 100644 --- a/elements/dpkg/bin/install-packages +++ b/elements/dpkg/bin/install-packages @@ -18,21 +18,17 @@ set -e # install-packages package [package ...] -install_deb_packages() { + +install_deb_packages () { DEBIAN_FRONTEND=noninteractive \ http_proxy=$http_proxy https_proxy=$https_proxy \ no_proxy=$no_proxy \ - apt-get --option "Dpkg::Options::=--force-confold" --assume-yes install "$@" + apt-get --option "Dpkg::Options::=--force-confold" --assume-yes "$@" } -DISTRO=`lsb_release -si` - -case $DISTRO in - 'Ubuntu'|'Debian') - install_deb_packages $@ - ;; - *) - echo "Distribution not supported" - exit 1 - ;; -esac +if [ "$1" = "-u" ] ; then + install_deb_packages dist-upgrade + exit 0 +else + install_deb_packages install $@ +fi diff --git a/elements/fedora/bin/install-packages b/elements/fedora/bin/install-packages index 0482d4c2..feb2018f 100644 --- a/elements/fedora/bin/install-packages +++ b/elements/fedora/bin/install-packages @@ -17,9 +17,14 @@ set -e +if [ "$1" = "-u" ] ; then + yum -y update + exit 0 +fi + yum -y install $(map-packages "$@") for pkg in "$@"; do - if [[ "$pkg" == "python-pip" ]] ; then + if [ "$pkg" = "python-pip" ] ; then alternatives --install /usr/bin/pip pip /usr/bin/pip-python 10 fi done