ca594ef20f
There is a bug where the init scripts element incorrectly munges the install path making it useless. Also removing the dep on rsync since this occurs from inside the chroot. Change-Id: I8f2717d36d7d2ff4b195ec21e91afeaf30a1d803
26 lines
747 B
Bash
Executable file
26 lines
747 B
Bash
Executable file
#!/bin/bash
|
|
# Note that this relies on the detail that all elements share one dir inside
|
|
# the chroot. This will copy all the files that elements have added to
|
|
# element/static into the image. Mode, symlinks etc will be respected.
|
|
|
|
if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
|
|
set -x
|
|
fi
|
|
set -eu
|
|
set -o pipefail
|
|
|
|
scripts_dir="$(dirname $0)/../init-scripts/$DIB_INIT_SYSTEM/"
|
|
if [ -d "$scripts_dir" ]; then
|
|
dest=
|
|
case $DIB_INIT_SYSTEM in
|
|
upstart) dest=/etc/init/ ;;
|
|
systemd) dest=/usr/lib/systemd/system/ ;;
|
|
sysv) dest=/etc/init.d/ ;;
|
|
esac
|
|
|
|
if [ -z "$dest" ]; then
|
|
echo "ERROR: DIB_INIT_SYSTEM ($DIB_INIT_SYSTEM) is not an unknown type"
|
|
exit 1
|
|
fi
|
|
cp -RP $scripts_dir. $dest || true
|
|
fi
|