From 255387a288cb2143ac2754cc4f598137b62aebcb Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Tue, 26 Nov 2013 13:59:14 -0500 Subject: [PATCH] Drop default distribution root element support Converts our existing default root element code to be just a check which exits with a failure message if no root/distribution element is found. Change-Id: I954a6abfd7871d5807b1a171a03fa98932410cff --- README.md | 18 ++++++++++-------- bin/disk-image-create | 2 ++ lib/common-functions | 12 ++++-------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 8a092327..3628da56 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ offline mode. Base images ----------- -These are cached by the standard elements - ubuntu, fedora. +These are cached by the standard elements - fedora, redhat, ubuntu. source-repositories ------------------- @@ -140,11 +140,13 @@ VM image with partition table and installed grub boot sector. The mellanox element adds support for mellanox infiniband hardware to both the deploy ramdisk and the built images. -Images start as a base ubuntu cloud image. Other distributions may be added in -future, the infrastructure deliberately makes few assumptions about the exact -operating system is use. The base image has opensshd running (a new key -generated on first boot) and accepts use keys via the cloud metadata service, -loading them into the 'ubuntu' user. +Images must specify a base distribution image element. Currently base +distribution elements exist for fedora, rhel, and ubuntu. Other +distributions may be added in future, the infrastructure deliberately +makes few assumptions about the exact operating system in use. +The base image has opensshd running (a new key generated on first boot) +and accepts keys via the cloud metadata service, loading them into the +distribution specific default user account. The goal of a built image is to have any global configuration ready to roll, but nothing that ties it to a specific cloud instance: images should be able to @@ -208,8 +210,8 @@ part of the process you need to customise: * root.d: Create or adapt the initial root filesystem content. This is where alternative distribution support is added, or customisations such as - building on an existing image. If no element configures a root, the ubuntu - element will be automatically invoked to obtain an Ubuntu image. + building on an existing image. + Runs outside the chroot on the host environment. Only one element can use this at a time unless particular care is taken not diff --git a/bin/disk-image-create b/bin/disk-image-create index 4ec0d6f8..581c0e2d 100755 --- a/bin/disk-image-create +++ b/bin/disk-image-create @@ -63,6 +63,8 @@ function show_options () { echo echo "ELEMENTS_PATH will allow you to specify multiple locations for the elements." echo + echo "NOTE: At least one distribution root element must be specified." + echo echo "Examples:" echo " ${SCRIPTNAME} -a amd64 -o ubuntu-amd64 vm ubuntu" echo " export ELEMENTS_PATH=~/source/tripleo-image-elements/elements" diff --git a/lib/common-functions b/lib/common-functions index 712f2c87..f00e06ec 100644 --- a/lib/common-functions +++ b/lib/common-functions @@ -242,14 +242,10 @@ function create_base () { # Copy data in to the root. TARGET_ROOT=$TMP_MOUNT_PATH run_d root if [ -z "$(ls $TMP_MOUNT_PATH | grep -v '^lost+found\|tmp$')" ] ; then - # Nothing copied in, use Ubuntu. Note the test above allows - # root.d elements to put things in /tmp, and still have the - # automatic Ubuntu behaviour. - echo "Adding ubuntu element as / had no contents" - IMAGE_ELEMENT=$($SCRIPT_HOME/element-info --expand-dependencies $IMAGE_ELEMENT ubuntu) - generate_hooks - echo "Now building: $IMAGE_ELEMENT" - TARGET_ROOT=$TMP_MOUNT_PATH run_d root + # No root element copied in. Note the test above allows + # root.d elements to put things in /tmp + echo "Please include at least one distribution root element." + exit 1 fi # Configure Image