3acc866f6d
disk-image-create processes a DIB_IMAGE_CACHE variable and exports it, but there are several elements that ignore the value and wrote out the base location themselves. Use the variable everywhere so that it will get overridden everywhere. Change-Id: I00fff354d6c931ad67cf3052d055f0e4604dfdc8
16 lines
556 B
Bash
Executable file
16 lines
556 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -eu
|
|
set -o pipefail
|
|
|
|
# Don't do anything if already mounted (if disk-image-create is invoked with
|
|
# no elements specified, this hook actually fires twice, once during
|
|
# `run_d root` for the base element, then again when `run_d root` is called
|
|
# after automatically pulling in the Ubuntu element)
|
|
grep " $TMP_MOUNT_PATH/tmp/ccache" /proc/mounts && exit
|
|
|
|
DIB_CCACHE_DIR=${DIB_CCACHE_DIR:-$DIB_IMAGE_CACHE/ccache}
|
|
mkdir -p $DIB_CCACHE_DIR
|
|
|
|
sudo mkdir -p $TMP_MOUNT_PATH/tmp/ccache
|
|
sudo mount --bind $DIB_CCACHE_DIR $TMP_MOUNT_PATH/tmp/ccache
|