diff options
author | Scott Moser <smoser@ubuntu.com> | 2018-02-12 15:10:25 -0700 |
---|---|---|
committer | Chad Smith <chad.smith@canonical.com> | 2018-02-12 15:10:25 -0700 |
commit | 42923ffbbf6a84819224417f0e032497af60d0cd (patch) | |
tree | 0fd47e7f95b5059d42355ca5a66df6477a8b5e34 /tools/ds-identify | |
parent | 754f54037aca0f604b8b57ab71b30dad5e5066cf (diff) | |
download | vyos-cloud-init-42923ffbbf6a84819224417f0e032497af60d0cd.tar.gz vyos-cloud-init-42923ffbbf6a84819224417f0e032497af60d0cd.zip |
ds-identify: check /writable/system-data/ for nocloud seed.
Ubuntu core seeds information to nocloud via a bind-mount of
/writable/system-data/var/lib/cloud over /var/lib/cloud.
When ds-identify runs as a systemd generator that mount is not
guaranteed to have been done. It is guaranteed at
cloud-init-local.service time, but not generator time.
Images built with 'ubuntu-image --cloud-init=user-data-file'
would have cloud-init disabled.
The fix here is just to consider the seed dir under /writable/system-data.
LP: #1747070
Diffstat (limited to 'tools/ds-identify')
-rwxr-xr-x | tools/ds-identify | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/ds-identify b/tools/ds-identify index cd268242..5f762438 100755 --- a/tools/ds-identify +++ b/tools/ds-identify @@ -470,6 +470,16 @@ check_seed_dir() { return 0 } +check_writable_seed_dir() { + # ubuntu core bind-mounts /writable/system-data/var/lib/cloud + # over the top of /var/lib/cloud, but the mount might not be done yet. + local wdir="/writable/system-data" + [ -d "${PATH_ROOT}$wdir" ] || return 1 + local sdir="${PATH_ROOT}$wdir${PATH_VAR_LIB_CLOUD#${PATH_ROOT}}" + local PATH_VAR_LIB_CLOUD="$sdir" + check_seed_dir "$@" +} + probe_floppy() { cached "${STATE_FLOPPY_PROBED}" && return "${STATE_FLOPPY_PROBED}" local fpath=/dev/floppy @@ -569,6 +579,7 @@ dscheck_NoCloud() { esac for d in nocloud nocloud-net; do check_seed_dir "$d" meta-data user-data && return ${DS_FOUND} + check_writable_seed_dir "$d" meta-data user-data && return ${DS_FOUND} done if has_fs_with_label "${fslabel}"; then return ${DS_FOUND} |