Hi Edison,

On Fri, Nov 21, 2014 at 12:30 AM, <edi...@apache.org> wrote:

> Repository: cloudstack
> Updated Branches:
>   refs/heads/4.5 1d6ca5eac -> 50d756e87
>
>
> 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
>

Should we port/cherry-pick/merge this to master as well?


>
> Signed-off-by: Edison Su <sudi...@gmail.com>
>
>
> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
> Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/50d756e8
> Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/50d756e8
> Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/50d756e8
>
> Branch: refs/heads/4.5
> Commit: 50d756e87d26f0ac86e7897505ad2747735c4d5c
> Parents: 1d6ca5e
> Author: David Bierce <david.bie...@appcore.com>
> Authored: Fri Sep 12 10:52:29 2014 -0500
> Committer: Edison Su <sudi...@gmail.com>
> Committed: Thu Nov 20 10:58:35 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/50d756e8/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)
>
>

Reply via email to