@@ -117,25 +117,31 @@ get_boot_params() {
117117 if [ ! -e /dev/vport0p1 ]; then
118118 log_it " /dev/vport0p1 not loaded, perhaps guest kernel is too old." && exit 2
119119 fi
120- while [ -z " $cmd " ]; do
121- while read line; do
122- if [[ $line == cmdline:* ]]; then
123- cmd=${line// cmdline:/ }
120+
121+ local factor=2
122+ local progress=1
123+ for i in {1..5}
124+ do
125+ while read line; do
126+ if [[ $line == cmdline:* ]]; then
127+ cmd=${line// cmdline:/ }
124128 echo $cmd > /var/cache/cloud/cmdline
125- elif [[ $line == pubkey:* ]]; then
126- pubkey=${line// pubkey:/ }
127- echo $pubkey > /var/cache/cloud/authorized_keys
128- echo $pubkey > /root/.ssh/authorized_keys
129+ elif [[ $line == pubkey:* ]]; then
130+ pubkey=${line// pubkey:/ }
131+ echo $pubkey > /var/cache/cloud/authorized_keys
132+ echo $pubkey > /root/.ssh/authorized_keys
129133 fi
130- done < /dev/vport0p1
131- # In case of reboot we do not send the boot args again.
132- # so need not wait for them, as the boot args are already set at startup
133- if [ -s /var/cache/cloud/cmdline ]
134- then
135- log_it " found a non empty cmdline file continuing "
136- break ;
134+ done < /dev/vport0p1
135+ # In case of reboot we do not send the boot args again.
136+ # So, no need to wait for them, as the boot args are already set at startup
137+ if [ -s /var/cache/cloud/cmdline ]
138+ then
139+ log_it " Found a non empty cmdline file. Will now exit the loop and proceed with configuration. "
140+ break ;
137141 fi
138- done
142+ sleep ${progress} s
143+ progress=$[ progress * factor ]
144+ done
139145 chmod go-rwx /root/.ssh/authorized_keys
140146 ;;
141147 vmware)
0 commit comments