From 642f9064760513b5f5e038bc6bd04c8dc0b7a989 Mon Sep 17 00:00:00 2001 From: Gregory Haynes Date: Mon, 2 May 2016 01:44:04 +0000 Subject: [PATCH] Add install-bin element The various distro elements include a copy of this script which installs all files in the bin/ dir of the copied element hooks in to /usr/local/bin. Lets share code rather than repeating ourselves. Change-Id: I354382f8c42ede2e9b8c548b7df8367c03e6836e --- elements/dpkg/element-deps | 1 + elements/gentoo/element-deps | 1 + .../{01-gentoo-install => 02-gentoo-migrate-pax} | 2 -- elements/install-bin/README.rst | 6 ++++++ .../pre-install.d/01-install-bin} | 0 elements/opensuse/element-deps | 1 + elements/opensuse/pre-install.d/01-opensuse-install-bin | 9 --------- elements/package-installs/element-deps | 1 + elements/yum/element-deps | 1 + elements/yum/pre-install.d/01-yum-install-bin | 9 --------- 10 files changed, 11 insertions(+), 20 deletions(-) rename elements/gentoo/pre-install.d/{01-gentoo-install => 02-gentoo-migrate-pax} (73%) create mode 100644 elements/install-bin/README.rst rename elements/{dpkg/pre-install.d/01-dpkg-install-bin => install-bin/pre-install.d/01-install-bin} (100%) delete mode 100755 elements/opensuse/pre-install.d/01-opensuse-install-bin create mode 100644 elements/yum/element-deps delete mode 100755 elements/yum/pre-install.d/01-yum-install-bin diff --git a/elements/dpkg/element-deps b/elements/dpkg/element-deps index 0b710e7ab..a3850950b 100644 --- a/elements/dpkg/element-deps +++ b/elements/dpkg/element-deps @@ -1,2 +1,3 @@ +install-bin manifests package-installs diff --git a/elements/gentoo/element-deps b/elements/gentoo/element-deps index 25604c8e9..15aa0f9cd 100644 --- a/elements/gentoo/element-deps +++ b/elements/gentoo/element-deps @@ -1,3 +1,4 @@ cache-url dib-run-parts +install-bin package-installs diff --git a/elements/gentoo/pre-install.d/01-gentoo-install b/elements/gentoo/pre-install.d/02-gentoo-migrate-pax similarity index 73% rename from elements/gentoo/pre-install.d/01-gentoo-install rename to elements/gentoo/pre-install.d/02-gentoo-migrate-pax index f632aaab7..9d79a7f40 100755 --- a/elements/gentoo/pre-install.d/01-gentoo-install +++ b/elements/gentoo/pre-install.d/02-gentoo-migrate-pax @@ -6,8 +6,6 @@ fi set -eu set -o pipefail -install -m 0755 -o root -g root $(dirname $0)/../bin/* /usr/local/bin - # migrate pt_pax flags to xt_pax if [[ -a /usr/sbin/migrate-pax ]]; then /usr/sbin/migrate-pax -m diff --git a/elements/install-bin/README.rst b/elements/install-bin/README.rst new file mode 100644 index 000000000..84e1278da --- /dev/null +++ b/elements/install-bin/README.rst @@ -0,0 +1,6 @@ +=========== +install-bin +=========== + +Add any files in an element's bin directory to /usr/local/bin in the created +image with permissions 0755. diff --git a/elements/dpkg/pre-install.d/01-dpkg-install-bin b/elements/install-bin/pre-install.d/01-install-bin similarity index 100% rename from elements/dpkg/pre-install.d/01-dpkg-install-bin rename to elements/install-bin/pre-install.d/01-install-bin diff --git a/elements/opensuse/element-deps b/elements/opensuse/element-deps index 14ee0a470..c0fd568db 100644 --- a/elements/opensuse/element-deps +++ b/elements/opensuse/element-deps @@ -1,4 +1,5 @@ cache-url dib-run-parts +install-bin package-installs zypper diff --git a/elements/opensuse/pre-install.d/01-opensuse-install-bin b/elements/opensuse/pre-install.d/01-opensuse-install-bin deleted file mode 100755 index 59b38a01e..000000000 --- a/elements/opensuse/pre-install.d/01-opensuse-install-bin +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then - set -x -fi -set -eu -set -o pipefail - -install -m 0755 -o root -g root $(dirname $0)/../bin/* /usr/local/bin diff --git a/elements/package-installs/element-deps b/elements/package-installs/element-deps index 8ad55b95b..fd63cb988 100644 --- a/elements/package-installs/element-deps +++ b/elements/package-installs/element-deps @@ -1,2 +1,3 @@ dib-python +install-bin pkg-map diff --git a/elements/yum/element-deps b/elements/yum/element-deps new file mode 100644 index 000000000..d888ae5c2 --- /dev/null +++ b/elements/yum/element-deps @@ -0,0 +1 @@ +install-bin diff --git a/elements/yum/pre-install.d/01-yum-install-bin b/elements/yum/pre-install.d/01-yum-install-bin deleted file mode 100755 index 59b38a01e..000000000 --- a/elements/yum/pre-install.d/01-yum-install-bin +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then - set -x -fi -set -eu -set -o pipefail - -install -m 0755 -o root -g root $(dirname $0)/../bin/* /usr/local/bin