diff --git a/confluent_osdeploy/debian/profiles/default/scripts/post.sh b/confluent_osdeploy/debian/profiles/default/scripts/post.sh index f30d980f..2c8c6923 100755 --- a/confluent_osdeploy/debian/profiles/default/scripts/post.sh +++ b/confluent_osdeploy/debian/profiles/default/scripts/post.sh @@ -41,9 +41,11 @@ if [ "$textcons" = "true" ] && ! grep console= /proc/cmdline > /dev/null; then updategrub=1 fi fi -kargs=$(python3 /opt/confluent/bin/apiclient /confluent-public/os/$confluent_profile/profile.yaml | grep ^installedargs: | sed -e 's/#.*//') +kargs=$(python3 /opt/confluent/bin/apiclient /confluent-public/os/$confluent_profile/profile.yaml | grep ^installedargs: | sed -e 's/^installedargs:[[:space:]]*//' -e 's/#.*//') if [ ! -z "$kargs" ]; then + kargs=$(printf '%s' "$kargs" | sed -e 's/[\/&]/\\&/g') sed -i 's/GRUB_CMDLINE_LINUX="\([^"]*\)"/GRUB_CMDLINE_LINUX="\1 '"${kargs}"'"/' /etc/default/grub + updategrub=1 fi if [ 1 = $updategrub ]; then diff --git a/confluent_osdeploy/suse15/initramfs/opt/confluent/bin/suseagent b/confluent_osdeploy/suse15/initramfs/opt/confluent/bin/suseagent index 9b26dfdf..48b0672f 100755 --- a/confluent_osdeploy/suse15/initramfs/opt/confluent/bin/suseagent +++ b/confluent_osdeploy/suse15/initramfs/opt/confluent/bin/suseagent @@ -229,6 +229,7 @@ append=$(grep ^installedargs: /tmp/profile.yaml | sed -e 's/^installedargs: //' if grep console= /etc/fakecmdline >& /dev/null && [[ "$append" != *console=* ]]; then append="$append console=${autocons#*/dev/}" fi +append=$(printf '%s' "$append" | sed -e 's/&/\&/g' -e 's//\>/g') if [ -z "$append" ]; then echo "" > /tmp/bootloader.xml else diff --git a/confluent_osdeploy/suse16/profiles/server/scripts/pre.sh b/confluent_osdeploy/suse16/profiles/server/scripts/pre.sh index db23ef73..102a78e4 100644 --- a/confluent_osdeploy/suse16/profiles/server/scripts/pre.sh +++ b/confluent_osdeploy/suse16/profiles/server/scripts/pre.sh @@ -46,6 +46,7 @@ sed -i 's@%%ROOTPASSWORD%%@'"$rootpw"'@g' /tmp/autoinstall.json sed -i s!%%NODENAME%%!$(hostname)!g /tmp/autoinstall.json python3 /opt/confluent/bin/apiclient /confluent-public/os/$profile/profile.yaml > /tmp/instprofile.yaml blargs=$(grep ^installedargs: /tmp/instprofile.yaml | sed -e 's/#.*//' -e 's/^installedargs: //') +blargs=$(printf '%s' "$blargs" | sed -e 's/[\\"]/\\&/g' -e 's/[\\&!]/\\&/g') sed -i 's!%%INSTALLEDARGS%%!'"$blargs"'!g' /tmp/autoinstall.json python3 /opt/confluent/bin/apiclient /confluent-public/os/$profile/scripts/getinstalldisk > /tmp/getinstalldisk locale=$(grep ^locale: /etc/confluent/confluent.deploycfg) diff --git a/confluent_osdeploy/ubuntu18.04/profiles/default/scripts/post.sh b/confluent_osdeploy/ubuntu18.04/profiles/default/scripts/post.sh index f30d980f..2c8c6923 100755 --- a/confluent_osdeploy/ubuntu18.04/profiles/default/scripts/post.sh +++ b/confluent_osdeploy/ubuntu18.04/profiles/default/scripts/post.sh @@ -41,9 +41,11 @@ if [ "$textcons" = "true" ] && ! grep console= /proc/cmdline > /dev/null; then updategrub=1 fi fi -kargs=$(python3 /opt/confluent/bin/apiclient /confluent-public/os/$confluent_profile/profile.yaml | grep ^installedargs: | sed -e 's/#.*//') +kargs=$(python3 /opt/confluent/bin/apiclient /confluent-public/os/$confluent_profile/profile.yaml | grep ^installedargs: | sed -e 's/^installedargs:[[:space:]]*//' -e 's/#.*//') if [ ! -z "$kargs" ]; then + kargs=$(printf '%s' "$kargs" | sed -e 's/[\/&]/\\&/g') sed -i 's/GRUB_CMDLINE_LINUX="\([^"]*\)"/GRUB_CMDLINE_LINUX="\1 '"${kargs}"'"/' /etc/default/grub + updategrub=1 fi if [ 1 = $updategrub ]; then diff --git a/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh b/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh index 7f234737..4ec66bdd 100755 --- a/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh +++ b/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh @@ -48,6 +48,7 @@ if [ "$textcons" = "true" ] && ! grep console= /proc/cmdline > /dev/null; then fi kargs=$(curl https://$confluent_mgr/confluent-public/os/$confluent_profile/profile.yaml | grep ^installedargs: | sed -e 's/^installedargs:[[:space:]]*//' -e 's/#.*//') if [ ! -z "$kargs" ]; then + kargs=$(printf '%s' "$kargs" | sed -e 's/[\/&]/\\&/g') sed -i 's/GRUB_CMDLINE_LINUX="\([^"]*\)"/GRUB_CMDLINE_LINUX="\1 '"${kargs}"'"/' /target/etc/default/grub updategrub=1 fi diff --git a/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/post.sh b/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/post.sh index 9c07cd14..e30bf732 100755 --- a/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/post.sh +++ b/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/post.sh @@ -48,6 +48,7 @@ if [ "$textcons" = "true" ] && ! grep console= /proc/cmdline > /dev/null; then fi kargs=$(curl https://$confluent_mgr/confluent-public/os/$confluent_profile/profile.yaml | grep ^installedargs: | sed -e 's/^installedargs:[[:space:]]*//' -e 's/#.*//') if [ ! -z "$kargs" ]; then + kargs=$(printf '%s' "$kargs" | sed -e 's/[\/&]/\\&/g') sed -i 's/GRUB_CMDLINE_LINUX="\([^"]*\)"/GRUB_CMDLINE_LINUX="\1 '"${kargs}"'"/' /target/etc/default/grub updategrub=1 fi