diskimage-builder/elements/pkg-map/extra-data.d/10-create-pkg-map-dir
Ian Wienand 412b333bda Convert pkg-map and svc-map copies to explicit variables
Using the explicit variables, these elements don't have to walk the
path to find the files in other elements; they can extract it directly

Change-Id: I0a64b45e9f2cfa28e84b2859d76b065a6c4590f0
2016-09-08 11:10:19 +10:00

22 lines
451 B
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
sudo mkdir -p $TMP_MOUNT_PATH/usr/share/pkg-map/
eval declare -A image_elements=($(get_image_element_array))
for i in "${!image_elements[@]}"; do
element=$i
element_dir=${image_elements[$i]}
pkg_map="${element_dir}/pkg-map"
if [ -f "${pkg_map}" ]; then
sudo cp "${pkg_map}" "$TMP_MOUNT_PATH/usr/share/pkg-map/$element"
fi
done