diff --git a/systemvm/patches/debian/config/etc/init.d/cloud-early-config b/systemvm/patches/debian/config/etc/init.d/cloud-early-config index d25366e5574..6fbedff77bf 100755 --- a/systemvm/patches/debian/config/etc/init.d/cloud-early-config +++ b/systemvm/patches/debian/config/etc/init.d/cloud-early-config @@ -117,25 +117,31 @@ get_boot_params() { if [ ! -e /dev/vport0p1 ]; then log_it "/dev/vport0p1 not loaded, perhaps guest kernel is too old." && exit 2 fi - while [ -z "$cmd" ]; do - while read line; do - if [[ $line == cmdline:* ]]; then - cmd=${line//cmdline:/} + + local factor=2 + local progress=1 + for i in {1..5} + do + while read line; do + if [[ $line == cmdline:* ]]; then + cmd=${line//cmdline:/} echo $cmd > /var/cache/cloud/cmdline - elif [[ $line == pubkey:* ]]; then - pubkey=${line//pubkey:/} - echo $pubkey > /var/cache/cloud/authorized_keys - echo $pubkey > /root/.ssh/authorized_keys + elif [[ $line == pubkey:* ]]; then + pubkey=${line//pubkey:/} + echo $pubkey > /var/cache/cloud/authorized_keys + echo $pubkey > /root/.ssh/authorized_keys fi - done < /dev/vport0p1 - # In case of reboot we do not send the boot args again. - # so need not wait for them, as the boot args are already set at startup - if [ -s /var/cache/cloud/cmdline ] - then - log_it "found a non empty cmdline file continuing" - break; + done < /dev/vport0p1 + # In case of reboot we do not send the boot args again. + # So, no need to wait for them, as the boot args are already set at startup + if [ -s /var/cache/cloud/cmdline ] + then + log_it "Found a non empty cmdline file. Will now exit the loop and proceed with configuration." + break; fi - done + sleep ${progress}s + progress=$[ progress * factor ] + done chmod go-rwx /root/.ssh/authorized_keys ;; vmware)