[PATCH] check the armPlatform flag before we initialise the anaconda object otherwise the running system is used
David Marlin
dmarlin at redhat.com
Wed Aug 15 18:42:29 UTC 2012
Brian C. Lane wrote:
> On Wed, Aug 15, 2012 at 08:16:04AM -0500, David A. Marlin wrote:
>> 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?
>
> The problem is that the ARM Platform class is setting _armMachine as a
> class variable. This gets evaluated when the class is created, not each
> time it is instantiated. This works fine when you're setting things from
> a source that doesn't change (eg. PPC based on /proc/cpuinfo).
Thank you for finding the problem.
> See the patch I just sent for a fix, and please test it out :)
I built anaconda with this patch and tested on a Trim Slice using
livemedia-creator. It works as expected. Please apply.
Thank you,
d.marlin
==========
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
More information about the anaconda-patches
mailing list