[PATCH anaconda:rhel7/master v2] Seed the default devicetree value for ARMv8

David Marlin dmarlin at redhat.com
Tue Feb 18 20:52:29 UTC 2014


Brian C. Lane wrote:
> On Mon, Feb 17, 2014 at 10:27:38AM -0600, d.marlin wrote:
>> In order to add a devicetree entry in the grub.cfg file, a valid
>> default value is needed.  This can be provided in the grub default
>> file (GRUB_DEFAULT_DTB in /etc/default/grub).
>>
>> Set the default value to apm-mustang.dtb, since that is the only
>> hardware we currently have.  This value can be changed later
>> (post install), but some valid value must be set in order to seed
>> the variable.
>>
>> Signed-off-by: David A. Marlin <dmarlin at redhat.com>
>> ---
>>  pyanaconda/bootloader.py |   10 ++++++++++
>>  1 files changed, 10 insertions(+), 0 deletions(-)
>>
>> diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
>> index bc0ce8f..fb38ab9 100644
>> --- a/pyanaconda/bootloader.py
>> +++ b/pyanaconda/bootloader.py
>> @@ -1740,6 +1740,16 @@ class Aarch64EFIGRUB(EFIGRUB):
>>  
>>      _serial_consoles = ["ttyAMA", "ttyS"]
>>  
>> +    #
>> +    # In addition to the normal grub configuration variables, 
>> +    # add one more to set the default device-tree filename
>> +    #
>> +    def write_defaults(self):
>> +        super(EFIGRUB, self).write_defaults()
>> +
>> +        defaults_file = os.path.normpath(ROOT_PATH + "/" + self.defaults_file)
> 
> May as well match other uses of defaults_file:
> 
> defaults_file = "%s%s" % (ROOT_PATH, self.defaults_file)
> 

Hmm... the feedback I received on my first version included:

 >> +        defaults_file = "%s%s" % (ROOT_PATH, self.defaults_file)
 >
 > I'd rather see os.path.normpath(ROOT_PATH + "/" + self.defaults_file) 
here.

I can go either way, just please let me know which one to use.


>> +        with open(defaults_file, "a+") as defaults
> 
> And you found the missing :
> 
>> +            defaults.write("GRUB_DEFAULT_DTB=\"apm-mustang.dtb\"\n")
> 
> You can save yourself the escapes with:
> 
> 'GRUB_DEFAULT_DTB="apm-mustang.dtb"\n'

Will do.


Thank you,

d.marlin



More information about the anaconda-patches mailing list