summaryrefslogtreecommitdiff
path: root/systemd/cloud-init-generator
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2016-03-03 16:53:49 -0500
committerScott Moser <smoser@ubuntu.com>2016-03-03 16:53:49 -0500
commitf4c25ab96c572e0a503bb211a11cd2641ac321a3 (patch)
tree566a69898c8eed3276114e10089255d419745db6 /systemd/cloud-init-generator
parentaf3653032704f79f418e976d02994c273e25f87f (diff)
downloadvyos-cloud-init-f4c25ab96c572e0a503bb211a11cd2641ac321a3.tar.gz
vyos-cloud-init-f4c25ab96c572e0a503bb211a11cd2641ac321a3.zip
consume KERNEL_CMDLINE even if set to "". explain 'container'
Diffstat (limited to 'systemd/cloud-init-generator')
-rwxr-xr-xsystemd/cloud-init-generator7
1 files changed, 5 insertions, 2 deletions
diff --git a/systemd/cloud-init-generator b/systemd/cloud-init-generator
index d976ae0b..b09924ac 100755
--- a/systemd/cloud-init-generator
+++ b/systemd/cloud-init-generator
@@ -8,6 +8,8 @@ ENABLE="enabled"
DISABLE="disabled"
CLOUD_SYSTEM_TARGET="/lib/systemd/system/cloud-init.target"
CLOUD_TARGET_NAME="cloud-init.target"
+# lxc sets 'container', but lets make that explicitly a global
+CONTAINER="${container}"
debug() {
local lvl="$1"
@@ -30,7 +32,7 @@ etc_file() {
}
read_proc_cmdline() {
- if [ "$container" = "lxc" ]; then
+ if [ "$CONTAINER" = "lxc" ]; then
_RET=""
return 0
fi
@@ -45,7 +47,8 @@ read_proc_cmdline() {
kernel_cmdline() {
local cmdline="" tok=""
- if [ -n "${KERNEL_CMDLINE+$KERNEL_CMDLINE}" ]; then
+ if [ -n "${KERNEL_CMDLINE+x}" ]; then
+ # use KERNEL_CMDLINE if present in environment even if empty
cmdline=${KERNEL_CMDLINE}
debug 1 "kernel command line from env KERNEL_CMDLINE: $cmdline"
elif read_proc_cmdline; then