mirror of https://github.com/apache/cloudstack.git
Occasionally the while loop can exit with no data (Probably recieving an EOF) before receiveing CMDline data from the certial port. Continue looping until cmdline is populated
Signed-off-by: Edison Su <sudison@gmail.com>
This commit is contained in:
parent
7884c750a2
commit
83656a6ea8
|
|
@ -117,16 +117,18 @@ get_boot_params() {
|
|||
if [ ! -e /dev/vport0p1 ]; then
|
||||
log_it "/dev/vport0p1 not loaded, perhaps guest kernel is too old." && exit 2
|
||||
fi
|
||||
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
|
||||
fi
|
||||
done < /dev/vport0p1
|
||||
while [$cmd -eq ""]; 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
|
||||
fi
|
||||
done < /dev/vport0p1
|
||||
done
|
||||
chmod go-rwx /root/.ssh/authorized_keys
|
||||
;;
|
||||
vmware)
|
||||
|
|
|
|||
Loading…
Reference in New Issue