From 873de0149116d6843148d32c154a9c487f79296d Mon Sep 17 00:00:00 2001 From: Ghe Rivero Date: Wed, 8 Oct 2014 07:53:31 +0000 Subject: [PATCH] Remove first-boot.d support After being deprecated two releases ago, finally remove any reference for the support of first-boot.d Change-Id: I08d67404ef48cad61db3b18fb86e970abfa5d2b6 --- README.md | 25 ++------------ bin/disk-image-create | 1 - elements/base/dib-first-boot | 12 ------- .../base/finalise.d/01-install-dib-first-boot | 7 ---- .../finalise.d/99-redhat-setup-first-boot | 34 ------------------- .../finalise.d/99-ubuntu-setup-first-boot | 22 ------------ lib/common-functions | 34 +------------------ lib/img-functions | 8 ----- 8 files changed, 4 insertions(+), 139 deletions(-) delete mode 100755 elements/base/dib-first-boot delete mode 100755 elements/base/finalise.d/01-install-dib-first-boot delete mode 100755 elements/redhat-common/finalise.d/99-redhat-setup-first-boot delete mode 100755 elements/ubuntu/finalise.d/99-ubuntu-setup-first-boot diff --git a/README.md b/README.md index 56c703b8..0223121c 100644 --- a/README.md +++ b/README.md @@ -364,13 +364,6 @@ Each element can use the following files to define or affect dependencies: file and A and C are included when building an image, then B is not used. -### First-boot files ### - -* first-boot.d: **DEPRECATED** Runs inside the image before - rc.local. Scripts from here are good for doing per-instance - configuration based on cloud metadata. **This will be removed in a - future release of diskimage-builder. The os-refresh-config element in - tripleo-image-elements is recommended as a replacement.** ### Ramdisk Elements ### @@ -435,23 +428,12 @@ possible approach to this would be to label elements as either a "driver", 10-user - common Nova user accts 50-my-pack - install packages from my PPA 60-nova - install nova and some dependencies - first-boot.d/ - 60-nova - do some post-install config for nova - In the general case, configuration should probably be handled either by the - meta-data service (eg, during first-boot.d) or via normal CM tools + meta-data service (eg, o-r-c) or via normal CM tools (eg, salt). That being said, it may occasionally be desirable to create a set of elements which express a distinct configuration of the same software - components. For example, if one were to bake a region-specific SSL cert into - the images deployed in each region, one might express it like this: - - elements/ - config-az1/ - first-boot.d/ - 20-ssl - add the az1 certificate - config-az2/ - first-boot.d/ - 20-ssl - add the az2 certificate + components. In this way, depending on the hardware and in which availability zone it is to be deployed, an image would be composed of: @@ -486,8 +468,7 @@ comma-delimited string. Some examples: * break=before-block-device-size will break before the block device size hooks are called. -* break=after-first-boot,before-pre-install will break after the first-boot - hooks and before the pre-install hooks. +* break=before-pre-install will break before the pre-install hooks. * break=after-error will break after an error during a in target hookpoint. diff --git a/bin/disk-image-create b/bin/disk-image-create index 7ea65c4d..946c2409 100755 --- a/bin/disk-image-create +++ b/bin/disk-image-create @@ -160,7 +160,6 @@ do_extra_package_install # Call install scripts to pull in the software users want. run_d_in_target install run_d_in_target post-install -prepare_first_boot # ensure we do not have a lost+found directory in the root folder # that could cause copy to fail (it will be created again later # when creating the file system, if it needs such directory) diff --git a/elements/base/dib-first-boot b/elements/base/dib-first-boot deleted file mode 100755 index 7d9e2f98..00000000 --- a/elements/base/dib-first-boot +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -eu -set -o pipefail -set -o xtrace - -touch /var/log/first-boot.d.log -chmod 0600 /var/log/first-boot.d.log - -/usr/local/bin/dib-run-parts /etc/first-boot.d >> /var/log/first-boot.d.log 2>&1 -rm -fr /etc/first-boot.d -# delete itself -rm $0 diff --git a/elements/base/finalise.d/01-install-dib-first-boot b/elements/base/finalise.d/01-install-dib-first-boot deleted file mode 100755 index 37bac737..00000000 --- a/elements/base/finalise.d/01-install-dib-first-boot +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -set -eu -set -o pipefail - -if [ -d /etc/first-boot.d ]; then - install -m 0755 -o root -g root $(dirname $0)/../dib-first-boot /usr/sbin/ -fi diff --git a/elements/redhat-common/finalise.d/99-redhat-setup-first-boot b/elements/redhat-common/finalise.d/99-redhat-setup-first-boot deleted file mode 100755 index d8db35a5..00000000 --- a/elements/redhat-common/finalise.d/99-redhat-setup-first-boot +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -set -eu -set -o pipefail - -if [ -d /etc/first-boot.d ]; then - rc_local=/etc/rc.d/rc.local - - FILE_EXISTED= - if [ -f $rc_local ]; then - FILE_EXISTED=1 - mv $rc_local $rc_local.REAL - fi - - dd of=$rc_local <> $rc_local -else - echo "rm \$0" >> $rc_local -fi - -echo "exit 0" >> $rc_local - -chmod 755 $rc_local - -# Enable the service -systemctl enable rc-local.service -fi diff --git a/elements/ubuntu/finalise.d/99-ubuntu-setup-first-boot b/elements/ubuntu/finalise.d/99-ubuntu-setup-first-boot deleted file mode 100755 index 40a7f8c4..00000000 --- a/elements/ubuntu/finalise.d/99-ubuntu-setup-first-boot +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -set -eu -set -o pipefail - -if [ -d /etc/first-boot.d ]; then - rc_local=/etc/rc.local - - mv $rc_local $rc_local.REAL - - dd of=$rc_local <