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
This commit is contained in:
Dan Prince 2013-11-26 13:59:14 -05:00
parent 39b5e5f71c
commit 255387a288
3 changed files with 16 additions and 16 deletions

View File

@ -98,7 +98,7 @@ offline mode.
Base images Base images
----------- -----------
These are cached by the standard elements - ubuntu, fedora. These are cached by the standard elements - fedora, redhat, ubuntu.
source-repositories 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 element adds support for mellanox infiniband hardware to both the deploy
ramdisk and the built images. ramdisk and the built images.
Images start as a base ubuntu cloud image. Other distributions may be added in Images must specify a base distribution image element. Currently base
future, the infrastructure deliberately makes few assumptions about the exact distribution elements exist for fedora, rhel, and ubuntu. Other
operating system is use. The base image has opensshd running (a new key distributions may be added in future, the infrastructure deliberately
generated on first boot) and accepts use keys via the cloud metadata service, makes few assumptions about the exact operating system in use.
loading them into the 'ubuntu' user. 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, 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 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 * root.d: Create or adapt the initial root filesystem content. This is where
alternative distribution support is added, or customisations such as alternative distribution support is added, or customisations such as
building on an existing image. If no element configures a root, the ubuntu building on an existing image.
element will be automatically invoked to obtain an Ubuntu image.
Runs outside the chroot on the host environment. Runs outside the chroot on the host environment.
Only one element can use this at a time unless particular care is taken not Only one element can use this at a time unless particular care is taken not

View File

@ -63,6 +63,8 @@ function show_options () {
echo echo
echo "ELEMENTS_PATH will allow you to specify multiple locations for the elements." echo "ELEMENTS_PATH will allow you to specify multiple locations for the elements."
echo echo
echo "NOTE: At least one distribution root element must be specified."
echo
echo "Examples:" echo "Examples:"
echo " ${SCRIPTNAME} -a amd64 -o ubuntu-amd64 vm ubuntu" echo " ${SCRIPTNAME} -a amd64 -o ubuntu-amd64 vm ubuntu"
echo " export ELEMENTS_PATH=~/source/tripleo-image-elements/elements" echo " export ELEMENTS_PATH=~/source/tripleo-image-elements/elements"

View File

@ -242,14 +242,10 @@ function create_base () {
# Copy data in to the root. # Copy data in to the root.
TARGET_ROOT=$TMP_MOUNT_PATH run_d root TARGET_ROOT=$TMP_MOUNT_PATH run_d root
if [ -z "$(ls $TMP_MOUNT_PATH | grep -v '^lost+found\|tmp$')" ] ; then if [ -z "$(ls $TMP_MOUNT_PATH | grep -v '^lost+found\|tmp$')" ] ; then
# Nothing copied in, use Ubuntu. Note the test above allows # No root element copied in. Note the test above allows
# root.d elements to put things in /tmp, and still have the # root.d elements to put things in /tmp
# automatic Ubuntu behaviour. echo "Please include at least one distribution root element."
echo "Adding ubuntu element as / had no contents" exit 1
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
fi fi
# Configure Image # Configure Image