diskimage-builder/diskimage_builder/elements/dib-run-parts/root.d/90-base-dib-run-parts
Ian Wienand d65678678e Move dib-run-parts into diskimage-builder
Move dib-run-parts from dib-utils into diskimage-builder directly.

For calling outside the chroot, we provide a standard entry-point
script.  However, as noted in the warning comment, the underlying
script is still copied directly into the chroot by the dib-run-parts
element.  I believe this to be the KISS approach.

This removes the dependency on dib-utils.  We have discussed this
previously and nobody seemed to think retiring dib-utils was going to
be an issue.

This also updates the documentation to not mention dib-utils, or using
disk-image-create via $PATH setup, but rather gives instructions on
installing from pip with a virtualenv.

Change-Id: Ic1e22ba498d2c368da7d72e2e2b70ff34324feb8
2016-11-04 17:07:37 +11:00

20 lines
447 B
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
# Abort early if dib-run-parts is not found to prevent a meaningless
# error message from the subsequent install command
DIB_RUN_PARTS=${_LIB}/dib-run-parts
if [ ! -f ${DIB_RUN_PARTS} ]; then
echo "Can't find dib-run-parts script!"
fi
exec sudo install -m 0755 -o root -g root -D \
$DIB_RUN_PARTS \
$TARGET_ROOT/usr/local/bin/dib-run-parts