Repository: cloudstack Updated Branches: refs/heads/master 7884c750a -> 83656a6ea
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 <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/83656a6e Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/83656a6e Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/83656a6e Branch: refs/heads/master Commit: 83656a6ea81ce9b85c2f480e576fd02d8a58c357 Parents: 7884c75 Author: David Bierce <[email protected]> Authored: Fri Sep 12 10:52:29 2014 -0500 Committer: Edison Su <[email protected]> Committed: Thu Nov 20 11:00:09 2014 -0800 ---------------------------------------------------------------------- .../debian/config/etc/init.d/cloud-early-config | 22 +++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/83656a6e/systemvm/patches/debian/config/etc/init.d/cloud-early-config ---------------------------------------------------------------------- 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 11d0612..294ae5f 100755 --- a/systemvm/patches/debian/config/etc/init.d/cloud-early-config +++ b/systemvm/patches/debian/config/etc/init.d/cloud-early-config @@ -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)
