summaryrefslogtreecommitdiff
path: root/tools/ds-identify
diff options
context:
space:
mode:
authorJulien Castets <castets.j@gmail.com>2017-04-25 09:06:13 +0000
committerScott Moser <smoser@brickies.net>2017-07-17 17:10:18 -0400
commite80517ae6aea49c9ab3bd622a33fee44014f485f (patch)
treeefadd114eb7bfd655fa307b13d95b5412dc8be63 /tools/ds-identify
parentbe8e84b3639d41202a4e1ce7626b2053498fecdb (diff)
downloadvyos-cloud-init-e80517ae6aea49c9ab3bd622a33fee44014f485f.tar.gz
vyos-cloud-init-e80517ae6aea49c9ab3bd622a33fee44014f485f.zip
Scaleway: add datasource with user and vendor data for Scaleway.
Here we add and enable by default a datasource for Scaleway cloud. The datasource quickly exits unless one of three things: a.) 'Scaleway' found as the system vendor b.) 'scaleway' found on the kernel command line. c.) the directory /var/run/scaleway exists (this is currently created by the scaleway initramfs module). One interesting bit of this particular datasource is that it requires the source port of the http request to be < 1024.
Diffstat (limited to 'tools/ds-identify')
-rwxr-xr-xtools/ds-identify18
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/ds-identify b/tools/ds-identify
index 7c8b144b..33bd2991 100755
--- a/tools/ds-identify
+++ b/tools/ds-identify
@@ -112,7 +112,7 @@ DI_DSNAME=""
# be searched if there is no setting found in config.
DI_DSLIST_DEFAULT="MAAS ConfigDrive NoCloud AltCloud Azure Bigstep \
CloudSigma CloudStack DigitalOcean AliYun Ec2 GCE OpenNebula OpenStack \
-OVF SmartOS"
+OVF SmartOS Scaleway"
DI_DSLIST=""
DI_MODE=""
DI_ON_FOUND=""
@@ -896,6 +896,22 @@ dscheck_None() {
return ${DS_NOT_FOUND}
}
+dscheck_Scaleway() {
+ if [ "${DI_DMI_SYS_VENDOR}" = "Scaleway" ]; then
+ return $DS_FOUND
+ fi
+
+ case " ${DI_KERNEL_CMDLINE} " in
+ *\ scaleway\ *) return ${DS_FOUND};;
+ esac
+
+ if [ -f ${PATH_ROOT}/var/run/scaleway ]; then
+ return ${DS_FOUND}
+ fi
+
+ return ${DS_NOT_FOUND}
+}
+
collect_info() {
read_virt
read_pid1_product_name