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

Brian C. Lane bcl at redhat.com
Tue Feb 18 03:06:59 UTC 2014


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)

> +        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'

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list