[PATCH anaconda/master] Add support to determine the ARM processor variety and select the correct kernel to install.

David A. Marlin dmarlin at redhat.com
Fri Jul 20 18:49:17 UTC 2012


David Cantrell wrote:
> Comments below.
>
> On Fri, Jul 13, 2012 at 12:46:40PM -0500, d.marlin wrote:
>   
>> From: "d.marlin" <dmarlin at redhat.com>
>>
>> Signed-off-by: David A. Marlin <dmarlin at redhat.com>
>> -----
>> diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
>> index 8fe818d..1c88d30 100644
>> --- a/pyanaconda/iutil.py
>> +++ b/pyanaconda/iutil.py
>> @@ -621,6 +621,20 @@ def getPPCMacBook():
>>          return 1
>>      return 0
>>  
>> +## Get the ARM processor variety.
>> +# @return The ARM processor variety type, or 0 if not ARM.
>> +def getARMMachine():
>> +    if not isARM():
>> +        return 0
>> +
>> +    armMachine = os.uname()[2].rpartition('.' )[2]
>>     
>
> So the kernel release contains the machine name information?  Just trying to
> understand.  I think this is what I'm seeing kernel.spec, but I just want to
> make sure.
>   
Yes, you are correct. Some examples include:

# uname -r
--------------
3.4.4-5.0.arm1.fc17.armv7hl.highbank
3.3.2-2.fc17.armv7hl.tegra
2.6.42.9-1.fc15.armv7l.omap
2.6.42.12-1.0.arm1.fc15.armv7hl.mvebu

The only exception is VExpress (the 'base' kernel), which has no 
'.flavor' appended. For that, the armMachine expression returns the last 
dotted field (i.e., armv7hl, armv7l, armv5tel), so the check for 'arm' 
(below) handles it.

>   
>> +
>> +    if armMachine.startswith('arm'):
>> +        return None
>> +    else:
>> +        return armMachine
>> +
>> +
>>  cell = None
>>  ## Determine if the hardware is the Cell platform.
>>  # @return True if so, False otherwise.
>> diff --git a/pyanaconda/platform.py b/pyanaconda/platform.py
>> index 8870374..1611797 100644
>> --- a/pyanaconda/platform.py
>> +++ b/pyanaconda/platform.py
>> @@ -335,6 +335,7 @@ class Sparc(Platform):
>>          return start+1
>>  
>>  class ARM(Platform):
>> +    _armMachine = iutil.getARMMachine()
>>      _bootloaderClass = bootloader.GRUB2
>>      _boot_stage1_device_types = ["disk"]
>>      _boot_mbr_description = N_("Master Boot Record")
>> @@ -343,6 +344,10 @@ class ARM(Platform):
>>  
>>      _disklabel_types = ["msdos"]
>>  
>> +    @property
>> +    def armMachine(self):
>> +        return self._armMachine
>> +
>>  def getPlatform(anaconda):
>>      """Check the architecture of the system and return an instance of a
>>         Platform subclass to match.  If the architecture could not be determined,
>> diff --git a/pyanaconda/yuminstall.py b/pyanaconda/yuminstall.py
>> index 0ca534b..63d077d 100644
>> --- a/pyanaconda/yuminstall.py
>> +++ b/pyanaconda/yuminstall.py
>> @@ -1465,6 +1465,11 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
>>              if selectKernel("kernel-PAE"):
>>                  foundkernel = True
>>  
>> +        if not foundkernel and iutil.isARM():
>> +            if anaconda.platform.armMachine is not None:
>> +                selectKernel("kernel-" + anaconda.platform.armMachine)
>> +                foundkernel = True
>> +
>>          if not foundkernel:
>>              selectKernel("kernel")
>>     
>
> Otherwise this looks good.
>   

Thank you for taking time to review this.


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



More information about the anaconda-patches mailing list