From 07c22185bd1e207b22330657324c5bebc2e5d636 Mon Sep 17 00:00:00 2001 From: James Slagle Date: Mon, 21 Jul 2014 16:25:47 -0400 Subject: [PATCH] Use package-installs in more elements Updates additional elements in diskimage-builder to use the declarative package install support provided by the package-installs element. package-installs does not yet support the pkg-map functionality, so elements using pkg-map are not migrated. That support will come in the near future. Change-Id: I3d36adad317ba44326eabd95243d45807e2a8a16 --- elements/deploy-baremetal/element-deps | 1 + .../install.d/51-deploy-baremetal-install-tgt | 6 ------ .../install.d/52-deploy-baremetal-install-busybox | 6 ------ .../install.d/package-installs-deploy-baremetal | 2 ++ elements/deploy-ironic/element-deps | 1 + .../install.d/51-deploy-ironic-install-tgt | 6 ------ .../install.d/52-deploy-ironic-install-busybox | 6 ------ elements/deploy-ironic/install.d/53-install-curl | 6 ------ .../install.d/package-installs-deploy-ironic | 3 +++ elements/deploy-kexec/element-deps | 1 + elements/deploy-kexec/install.d/53-install-kexec | 6 ------ .../install.d/package-installs-deploy-kexec | 1 + elements/dracut-network/element-deps | 1 + .../install.d/10-install-dracut-network | 6 ------ .../install.d/package-installs-dracut-network | 2 ++ elements/hwdiscovery/element-deps | 1 + elements/hwdiscovery/install.d/10-hwinfo | 8 -------- .../install.d/package-installs-hwdiscovery | 1 + elements/opensuse/element-deps | 1 + .../opensuse/install.d/00-opensuse-setup-installs | 11 ----------- elements/opensuse/install.d/package-installs-opensuse | 6 ++++++ elements/redhat-common/element-deps | 1 + ...01-install-deps => package-installs-redhat-common} | 11 ++++------- elements/redhat-common/pre-install.d/15-remove-grub | 3 +-- .../pre-install.d/package-installs-redhat-common | 5 +++++ elements/source-repositories/element-deps | 1 + ...ositories => package-installs-source-repositories} | 8 +------- elements/stable-interface-names/element-deps | 1 + .../install.d/02-stable-interface-names | 2 -- .../install.d/package-installs-stable-interface-names | 1 + 30 files changed, 36 insertions(+), 79 deletions(-) create mode 100644 elements/deploy-baremetal/element-deps delete mode 100755 elements/deploy-baremetal/install.d/51-deploy-baremetal-install-tgt delete mode 100755 elements/deploy-baremetal/install.d/52-deploy-baremetal-install-busybox create mode 100644 elements/deploy-baremetal/install.d/package-installs-deploy-baremetal create mode 100644 elements/deploy-ironic/element-deps delete mode 100755 elements/deploy-ironic/install.d/51-deploy-ironic-install-tgt delete mode 100755 elements/deploy-ironic/install.d/52-deploy-ironic-install-busybox delete mode 100755 elements/deploy-ironic/install.d/53-install-curl create mode 100644 elements/deploy-ironic/install.d/package-installs-deploy-ironic delete mode 100755 elements/deploy-kexec/install.d/53-install-kexec create mode 100644 elements/deploy-kexec/install.d/package-installs-deploy-kexec delete mode 100755 elements/dracut-network/install.d/10-install-dracut-network create mode 100644 elements/dracut-network/install.d/package-installs-dracut-network create mode 100644 elements/hwdiscovery/element-deps delete mode 100755 elements/hwdiscovery/install.d/10-hwinfo create mode 100644 elements/hwdiscovery/install.d/package-installs-hwdiscovery delete mode 100755 elements/opensuse/install.d/00-opensuse-setup-installs create mode 100644 elements/opensuse/install.d/package-installs-opensuse create mode 100644 elements/redhat-common/element-deps rename elements/redhat-common/install.d/{01-install-deps => package-installs-redhat-common} (56%) mode change 100755 => 100644 create mode 100644 elements/redhat-common/pre-install.d/package-installs-redhat-common rename elements/source-repositories/install.d/{01-source-repositories => package-installs-source-repositories} (78%) mode change 100755 => 100644 create mode 100644 elements/stable-interface-names/element-deps create mode 100644 elements/stable-interface-names/install.d/package-installs-stable-interface-names diff --git a/elements/deploy-baremetal/element-deps b/elements/deploy-baremetal/element-deps new file mode 100644 index 00000000..7076aba9 --- /dev/null +++ b/elements/deploy-baremetal/element-deps @@ -0,0 +1 @@ +package-installs diff --git a/elements/deploy-baremetal/install.d/51-deploy-baremetal-install-tgt b/elements/deploy-baremetal/install.d/51-deploy-baremetal-install-tgt deleted file mode 100755 index ac546ea2..00000000 --- a/elements/deploy-baremetal/install.d/51-deploy-baremetal-install-tgt +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -eu -set -o pipefail - -install-packages tgt diff --git a/elements/deploy-baremetal/install.d/52-deploy-baremetal-install-busybox b/elements/deploy-baremetal/install.d/52-deploy-baremetal-install-busybox deleted file mode 100755 index f50b56c2..00000000 --- a/elements/deploy-baremetal/install.d/52-deploy-baremetal-install-busybox +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -eu -set -o pipefail - -install-packages busybox diff --git a/elements/deploy-baremetal/install.d/package-installs-deploy-baremetal b/elements/deploy-baremetal/install.d/package-installs-deploy-baremetal new file mode 100644 index 00000000..a2b9d709 --- /dev/null +++ b/elements/deploy-baremetal/install.d/package-installs-deploy-baremetal @@ -0,0 +1,2 @@ +busybox +tgt diff --git a/elements/deploy-ironic/element-deps b/elements/deploy-ironic/element-deps new file mode 100644 index 00000000..7076aba9 --- /dev/null +++ b/elements/deploy-ironic/element-deps @@ -0,0 +1 @@ +package-installs diff --git a/elements/deploy-ironic/install.d/51-deploy-ironic-install-tgt b/elements/deploy-ironic/install.d/51-deploy-ironic-install-tgt deleted file mode 100755 index ac546ea2..00000000 --- a/elements/deploy-ironic/install.d/51-deploy-ironic-install-tgt +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -eu -set -o pipefail - -install-packages tgt diff --git a/elements/deploy-ironic/install.d/52-deploy-ironic-install-busybox b/elements/deploy-ironic/install.d/52-deploy-ironic-install-busybox deleted file mode 100755 index f50b56c2..00000000 --- a/elements/deploy-ironic/install.d/52-deploy-ironic-install-busybox +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -eu -set -o pipefail - -install-packages busybox diff --git a/elements/deploy-ironic/install.d/53-install-curl b/elements/deploy-ironic/install.d/53-install-curl deleted file mode 100755 index 0871746e..00000000 --- a/elements/deploy-ironic/install.d/53-install-curl +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -eu -set -o pipefail - -install-packages curl diff --git a/elements/deploy-ironic/install.d/package-installs-deploy-ironic b/elements/deploy-ironic/install.d/package-installs-deploy-ironic new file mode 100644 index 00000000..8948f65c --- /dev/null +++ b/elements/deploy-ironic/install.d/package-installs-deploy-ironic @@ -0,0 +1,3 @@ +busybox +curl +tgt diff --git a/elements/deploy-kexec/element-deps b/elements/deploy-kexec/element-deps index b30556c6..28da007c 100644 --- a/elements/deploy-kexec/element-deps +++ b/elements/deploy-kexec/element-deps @@ -1 +1,2 @@ deploy-baremetal +package-installs diff --git a/elements/deploy-kexec/install.d/53-install-kexec b/elements/deploy-kexec/install.d/53-install-kexec deleted file mode 100755 index 17a2815b..00000000 --- a/elements/deploy-kexec/install.d/53-install-kexec +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -eu -set -o pipefail - -install-packages kexec-tools diff --git a/elements/deploy-kexec/install.d/package-installs-deploy-kexec b/elements/deploy-kexec/install.d/package-installs-deploy-kexec new file mode 100644 index 00000000..148df5eb --- /dev/null +++ b/elements/deploy-kexec/install.d/package-installs-deploy-kexec @@ -0,0 +1 @@ +kexec-tools diff --git a/elements/dracut-network/element-deps b/elements/dracut-network/element-deps index 93eaa4f1..8c3ffe52 100644 --- a/elements/dracut-network/element-deps +++ b/elements/dracut-network/element-deps @@ -1 +1,2 @@ +package-installs select-boot-kernel-initrd diff --git a/elements/dracut-network/install.d/10-install-dracut-network b/elements/dracut-network/install.d/10-install-dracut-network deleted file mode 100755 index c01f26ea..00000000 --- a/elements/dracut-network/install.d/10-install-dracut-network +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -eu -set -o pipefail - -install-packages dracut-network patch diff --git a/elements/dracut-network/install.d/package-installs-dracut-network b/elements/dracut-network/install.d/package-installs-dracut-network new file mode 100644 index 00000000..443c70fc --- /dev/null +++ b/elements/dracut-network/install.d/package-installs-dracut-network @@ -0,0 +1,2 @@ +dracut-network +patch diff --git a/elements/hwdiscovery/element-deps b/elements/hwdiscovery/element-deps new file mode 100644 index 00000000..7076aba9 --- /dev/null +++ b/elements/hwdiscovery/element-deps @@ -0,0 +1 @@ +package-installs diff --git a/elements/hwdiscovery/install.d/10-hwinfo b/elements/hwdiscovery/install.d/10-hwinfo deleted file mode 100755 index 21588eaa..00000000 --- a/elements/hwdiscovery/install.d/10-hwinfo +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# Support for hard ware discovery - -set -eu -set -o pipefail -set -o xtrace - -install-packages hwinfo diff --git a/elements/hwdiscovery/install.d/package-installs-hwdiscovery b/elements/hwdiscovery/install.d/package-installs-hwdiscovery new file mode 100644 index 00000000..edd07ff6 --- /dev/null +++ b/elements/hwdiscovery/install.d/package-installs-hwdiscovery @@ -0,0 +1 @@ +hwinfo diff --git a/elements/opensuse/element-deps b/elements/opensuse/element-deps index 4c2b56c3..14ee0a47 100644 --- a/elements/opensuse/element-deps +++ b/elements/opensuse/element-deps @@ -1,3 +1,4 @@ cache-url dib-run-parts +package-installs zypper diff --git a/elements/opensuse/install.d/00-opensuse-setup-installs b/elements/opensuse/install.d/00-opensuse-setup-installs deleted file mode 100755 index 7ef24bf2..00000000 --- a/elements/opensuse/install.d/00-opensuse-setup-installs +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# Install requirments needed to build the image. -set -eu -set -o pipefail - -# install kernel package needed by dkms. -install-packages kernel-devel - -# sudo and lsb not included by default. -# so install them. -install-packages sudo lsb-release diff --git a/elements/opensuse/install.d/package-installs-opensuse b/elements/opensuse/install.d/package-installs-opensuse new file mode 100644 index 00000000..7cd8381d --- /dev/null +++ b/elements/opensuse/install.d/package-installs-opensuse @@ -0,0 +1,6 @@ +# sudo is not included by default. +sudo +# install kernel package needed by dkms. +kernel-devel +# lsb-release is not included by default. +lsb-release diff --git a/elements/redhat-common/element-deps b/elements/redhat-common/element-deps new file mode 100644 index 00000000..7076aba9 --- /dev/null +++ b/elements/redhat-common/element-deps @@ -0,0 +1 @@ +package-installs diff --git a/elements/redhat-common/install.d/01-install-deps b/elements/redhat-common/install.d/package-installs-redhat-common old mode 100755 new mode 100644 similarity index 56% rename from elements/redhat-common/install.d/01-install-deps rename to elements/redhat-common/install.d/package-installs-redhat-common index 7f48cf63..c91322e8 --- a/elements/redhat-common/install.d/01-install-deps +++ b/elements/redhat-common/install.d/package-installs-redhat-common @@ -1,9 +1,6 @@ -#!/bin/bash - -set -eu -set -o pipefail - # Install any packages in this file that may not be in the base cloud # image but could reasonably be expected - -install-packages which tcpdump traceroute lsof +lsof +tcpdump +traceroute +which diff --git a/elements/redhat-common/pre-install.d/15-remove-grub b/elements/redhat-common/pre-install.d/15-remove-grub index 3958baaf..60203ae6 100755 --- a/elements/redhat-common/pre-install.d/15-remove-grub +++ b/elements/redhat-common/pre-install.d/15-remove-grub @@ -3,9 +3,8 @@ set -eu set -o pipefail +# Must manually remove grub2 here, otherwise the download below does not work. yum remove -y grub2 -# Install grub2 dependencies to minimise packages installed during finalise. -install-packages grub2-tools gettext os-prober system-logos # Remove all old versions of grub2 from the yum cache and then ensure the # latest version is in the cache. diff --git a/elements/redhat-common/pre-install.d/package-installs-redhat-common b/elements/redhat-common/pre-install.d/package-installs-redhat-common new file mode 100644 index 00000000..51043b14 --- /dev/null +++ b/elements/redhat-common/pre-install.d/package-installs-redhat-common @@ -0,0 +1,5 @@ +gettext +-grub2 +grub2-tools +os-prober +system-logos diff --git a/elements/source-repositories/element-deps b/elements/source-repositories/element-deps index a8ec56bb..abf46968 100644 --- a/elements/source-repositories/element-deps +++ b/elements/source-repositories/element-deps @@ -1,2 +1,3 @@ cache-url manifests +package-installs diff --git a/elements/source-repositories/install.d/01-source-repositories b/elements/source-repositories/install.d/package-installs-source-repositories old mode 100755 new mode 100644 similarity index 78% rename from elements/source-repositories/install.d/01-source-repositories rename to elements/source-repositories/install.d/package-installs-source-repositories index 47d37891..fd6b19e8 --- a/elements/source-repositories/install.d/01-source-repositories +++ b/elements/source-repositories/install.d/package-installs-source-repositories @@ -1,11 +1,5 @@ -#!/bin/bash - -set -uex -set -o pipefail - # Git isn't a dependency of this element, but is a dependency of pbr # if you are doing pip install on a git cloned directoy, because this # looks to be a fairly common pattern it makes sense to have git on the # target image -install-packages git - +git diff --git a/elements/stable-interface-names/element-deps b/elements/stable-interface-names/element-deps new file mode 100644 index 00000000..7076aba9 --- /dev/null +++ b/elements/stable-interface-names/element-deps @@ -0,0 +1 @@ +package-installs diff --git a/elements/stable-interface-names/install.d/02-stable-interface-names b/elements/stable-interface-names/install.d/02-stable-interface-names index 6cfa587c..ba16b8a3 100755 --- a/elements/stable-interface-names/install.d/02-stable-interface-names +++ b/elements/stable-interface-names/install.d/02-stable-interface-names @@ -8,5 +8,3 @@ NET_NAME_SLOT_FILE="/etc/udev/rules.d/80-net-name-slot.rules" if [ -h $NET_NAME_SLOT_FILE ]; then rm $NET_NAME_SLOT_FILE fi - -install-packages biosdevname diff --git a/elements/stable-interface-names/install.d/package-installs-stable-interface-names b/elements/stable-interface-names/install.d/package-installs-stable-interface-names new file mode 100644 index 00000000..9fd202f2 --- /dev/null +++ b/elements/stable-interface-names/install.d/package-installs-stable-interface-names @@ -0,0 +1 @@ +biosdevname