summaryrefslogtreecommitdiff
path: root/tools/ds-identify
diff options
context:
space:
mode:
authorBrett Holman <brett.holman@canonical.com>2023-04-10 21:57:09 -0600
committerGitHub <noreply@github.com>2023-04-10 21:57:09 -0600
commit250280ada67995a8449b64027b879d01939d2729 (patch)
tree3136d898cc4d7f6a2053f0cab0ab957e39ea7f6b /tools/ds-identify
parentd9844fa8af60175afdb88eab826a86f07e8e7e29 (diff)
downloadcloud-init-git-250280ada67995a8449b64027b879d01939d2729.tar.gz
Fix NoCloud kernel commandline semi-colon args
Truncate any trailing semi-colon delimited kernel commandline parameters when trying to match the designated datasource from /proc/cmdline. This was broken in 612b4de892d on systemd systems. Add an integration test for this codepath.
Diffstat (limited to 'tools/ds-identify')
-rwxr-xr-xtools/ds-identify3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/ds-identify b/tools/ds-identify
index 1a94c9ab..bac385dc 100755
--- a/tools/ds-identify
+++ b/tools/ds-identify
@@ -1739,6 +1739,9 @@ read_config() {
for tok in ${DI_KERNEL_CMDLINE}; do
key=${tok%%=*}
val=${tok#*=}
+
+ # discard anything after delimiter
+ val=${val%;*}
case "$key" in
ds) _rc_dsname="$val";;
ci.ds) _rc_dsname="$val";;