summaryrefslogtreecommitdiffstats
path: root/meta/classes/uboot-extlinux-config.bbclass
diff options
context:
space:
mode:
authorJack Mitchell <jack@embed.me.uk>2017-03-11 14:16:03 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-13 09:43:14 +0000
commit3e5f3cfe812dd5787c7420cdbfe47e1b257f567d (patch)
tree7348648700f2d77080dea114007f57f849f15eb8 /meta/classes/uboot-extlinux-config.bbclass
parent156571fad3a2e19b19eba0390ee8ef1045ad0809 (diff)
downloadpoky-3e5f3cfe812dd5787c7420cdbfe47e1b257f567d.tar.gz
u-boot: add option to specify FDT argument in extlinux.conf
Also fixes a use before defined bug with localdata. (From OE-Core rev: 86b09a7ed67a43a45c805f44778bed0bfdf57361) Signed-off-by: Jack Mitchell <jack@embed.me.uk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/uboot-extlinux-config.bbclass')
-rw-r--r--meta/classes/uboot-extlinux-config.bbclass15
1 files changed, 12 insertions, 3 deletions
diff --git a/meta/classes/uboot-extlinux-config.bbclass b/meta/classes/uboot-extlinux-config.bbclass
index aae21713e3..8447a047ee 100644
--- a/meta/classes/uboot-extlinux-config.bbclass
+++ b/meta/classes/uboot-extlinux-config.bbclass
@@ -12,6 +12,7 @@
12# UBOOT_EXTLINUX_KERNEL_ARGS - Add additional kernel arguments. 12# UBOOT_EXTLINUX_KERNEL_ARGS - Add additional kernel arguments.
13# UBOOT_EXTLINUX_KERNEL_IMAGE - Kernel image name. 13# UBOOT_EXTLINUX_KERNEL_IMAGE - Kernel image name.
14# UBOOT_EXTLINUX_FDTDIR - Device tree directory. 14# UBOOT_EXTLINUX_FDTDIR - Device tree directory.
15# UBOOT_EXTLINUX_FDT - Device tree file.
15# UBOOT_EXTLINUX_INITRD - Indicates a list of filesystem images to 16# UBOOT_EXTLINUX_INITRD - Indicates a list of filesystem images to
16# concatenate and use as an initrd (optional). 17# concatenate and use as an initrd (optional).
17# UBOOT_EXTLINUX_MENU_DESCRIPTION - Name to use as description. 18# UBOOT_EXTLINUX_MENU_DESCRIPTION - Name to use as description.
@@ -59,6 +60,7 @@
59# a console=...some_tty... 60# a console=...some_tty...
60UBOOT_EXTLINUX_CONSOLE ??= "console=${console}" 61UBOOT_EXTLINUX_CONSOLE ??= "console=${console}"
61UBOOT_EXTLINUX_LABELS ??= "linux" 62UBOOT_EXTLINUX_LABELS ??= "linux"
63UBOOT_EXTLINUX_FDT ??= ""
62UBOOT_EXTLINUX_FDTDIR ??= "../" 64UBOOT_EXTLINUX_FDTDIR ??= "../"
63UBOOT_EXTLINUX_KERNEL_IMAGE ??= "../${KERNEL_IMAGETYPE}" 65UBOOT_EXTLINUX_KERNEL_IMAGE ??= "../${KERNEL_IMAGETYPE}"
64UBOOT_EXTLINUX_KERNEL_ARGS ??= "rootwait rw" 66UBOOT_EXTLINUX_KERNEL_ARGS ??= "rootwait rw"
@@ -84,6 +86,8 @@ python create_extlinux_config() {
84 if not cfile: 86 if not cfile:
85 bb.fatal('Unable to read UBOOT_EXTLINUX_CONFIG') 87 bb.fatal('Unable to read UBOOT_EXTLINUX_CONFIG')
86 88
89 localdata = bb.data.createCopy(d)
90
87 try: 91 try:
88 with open(cfile, 'w') as cfgfile: 92 with open(cfile, 'w') as cfgfile:
89 cfgfile.write('# Generic Distro Configuration file generated by OpenEmbedded\n') 93 cfgfile.write('# Generic Distro Configuration file generated by OpenEmbedded\n')
@@ -99,9 +103,8 @@ python create_extlinux_config() {
99 default = localdata.getVar('UBOOT_EXTLINUX_DEFAULT_LABEL') 103 default = localdata.getVar('UBOOT_EXTLINUX_DEFAULT_LABEL')
100 if default: 104 if default:
101 cfgfile.write('DEFAULT %s\n' % (default)) 105 cfgfile.write('DEFAULT %s\n' % (default))
102 106
103 for label in labels.split(): 107 for label in labels.split():
104 localdata = bb.data.createCopy(d)
105 108
106 overrides = localdata.getVar('OVERRIDES') 109 overrides = localdata.getVar('OVERRIDES')
107 if not overrides: 110 if not overrides:
@@ -121,7 +124,13 @@ python create_extlinux_config() {
121 124
122 kernel_image = localdata.getVar('UBOOT_EXTLINUX_KERNEL_IMAGE') 125 kernel_image = localdata.getVar('UBOOT_EXTLINUX_KERNEL_IMAGE')
123 fdtdir = localdata.getVar('UBOOT_EXTLINUX_FDTDIR') 126 fdtdir = localdata.getVar('UBOOT_EXTLINUX_FDTDIR')
124 if fdtdir: 127
128 fdt = localdata.getVar('UBOOT_EXTLINUX_FDT')
129
130 if fdt:
131 cfgfile.write('LABEL %s\n\tKERNEL %s\n\tFDT %s\n' %
132 (menu_description, kernel_image, fdt))
133 elif fdtdir:
125 cfgfile.write('LABEL %s\n\tKERNEL %s\n\tFDTDIR %s\n' % 134 cfgfile.write('LABEL %s\n\tKERNEL %s\n\tFDTDIR %s\n' %
126 (menu_description, kernel_image, fdtdir)) 135 (menu_description, kernel_image, fdtdir))
127 else: 136 else: