diff --git a/README.md b/README.md index 931fe261..72e35b2f 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,13 @@ of the element directory describing what it is for. Writing an element ----------------- +Conform to the following conventions: + +* Use the environment for overridable defaults, prefixing environment variable + names with "DIB\_". For example: DIB\_MYDEFAULT=${DIB\_MYDEFAULT:-default} + If you do not use the DIB\_ prefix you may find that your overrides are + discarded as the build environment is sanitised. + Make as many of the following subdirectories as you need, depending on what part of the process you need to customise: diff --git a/bin/disk-image-create b/bin/disk-image-create index 50456566..f45903e1 100755 --- a/bin/disk-image-create +++ b/bin/disk-image-create @@ -94,9 +94,9 @@ echo "If prompted for sudo, install sudoers.d/img-build-sudoers into /etc/sudoer ensure_nbd mk_build_dir -eval_run_d block-device-size "IMAGE_SIZE=" +eval_run_d block-device-size "DIB_IMAGE_SIZE=" -qemu-img create -f qcow2 -o preallocation=metadata $TMP_IMAGE_PATH ${IMAGE_SIZE}G +qemu-img create -f qcow2 -o preallocation=metadata $TMP_IMAGE_PATH ${DIB_IMAGE_SIZE}G # Should have a grab-next-dev helper ? NBD_DEV=/dev/nbd0 diff --git a/lib/img-defaults b/lib/img-defaults index a1350f00..0f707cc5 100644 --- a/lib/img-defaults +++ b/lib/img-defaults @@ -19,7 +19,7 @@ FS_TYPE=${FS_TYPE:-ext4} # Used to set the file extension only at this stage. IMAGE_TYPE=${IMAGE_TYPE:-qcow2} IMAGE_NAME=${IMAGE_NAME:-image} -export IMAGE_SIZE=${IMAGE_SIZE:-2} # N.B. This size is in GB +export DIB_IMAGE_SIZE=${DIB_IMAGE_SIZE:-2} # N.B. This size is in GB # Set via the CLI normally. # IMAGE_ELEMENT= _BASE_ELEMENT_DIR=$(dirname $0)/../elements