[PATCH] check the armPlatform flag before we initialise the anaconda object otherwise the running system is used

David A. Marlin dmarlin at redhat.com
Wed Aug 15 13:16:04 UTC 2012


Dennis Gilmore wrote:
> ---
>  anaconda | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/anaconda b/anaconda
> index a6bb720..a4baa53 100755
> --- a/anaconda
> +++ b/anaconda
> @@ -703,6 +703,11 @@ if __name__ == "__main__":
>      import gettext
>      _ = lambda x: gettext.ldgettext("anaconda", x)
>  
> +    # we need to ensure that we set the flag for overriding the arm platform
> +    # before we initialise Anaconda and detect the running system
> +    if opts.armPlatform:
> +        flags.armPlatform = opts.armPlatform
> +
>      from pyanaconda import Anaconda
>      anaconda = Anaconda()
>      iutil.setup_translations(gettext)
> @@ -781,9 +786,6 @@ if __name__ == "__main__":
>      if opts.targetArch:
>          flags.targetarch = opts.targetArch
>  
> -    if opts.armPlatform:
> -        flags.armPlatform = opts.armPlatform
> -
>      # set flags
>      flags.dmraid = opts.dmraid
>      flags.mpath = opts.mpath
>   
I ran a test with this by running livemedia-creator on a Trim Slice and 
it still appears to reference flags.armPlatform before it is set.  Some 
debugging log messages I added show ("armPlatform flag == %s", where it 
is set):

20:26:43,082 INFO anaconda:  * * *  getARMMachine()  * * *
20:26:43,083 INFO anaconda: flags.armPlatform None
20:26:49,005 INFO anaconda: armPlatform flag == omap

I tried moving it even earlier in the process, immediately after:

    from pyanaconda import iutil

and it works:

23:26:07,248 INFO anaconda: armPlatform flag == omap
23:26:09,046 INFO anaconda:  * * *  getARMMachine()  * * *
23:26:09,049 INFO anaconda: flags.armPlatform omap

but I don't understand why (both are before we initialize Anaconda).  
Why would moving this up a little further make a difference?  Could 
there be some optimization that would reorder or parallelize 
instructions such that Anaconda was initialized before flags.armPlatform 
was set?


d.marlin
=========



More information about the anaconda-patches mailing list