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>
This commit is contained in:
parent
156571fad3
commit
3e5f3cfe81
|
@ -12,6 +12,7 @@
|
||||||
# UBOOT_EXTLINUX_KERNEL_ARGS - Add additional kernel arguments.
|
# UBOOT_EXTLINUX_KERNEL_ARGS - Add additional kernel arguments.
|
||||||
# UBOOT_EXTLINUX_KERNEL_IMAGE - Kernel image name.
|
# UBOOT_EXTLINUX_KERNEL_IMAGE - Kernel image name.
|
||||||
# UBOOT_EXTLINUX_FDTDIR - Device tree directory.
|
# UBOOT_EXTLINUX_FDTDIR - Device tree directory.
|
||||||
|
# UBOOT_EXTLINUX_FDT - Device tree file.
|
||||||
# UBOOT_EXTLINUX_INITRD - Indicates a list of filesystem images to
|
# UBOOT_EXTLINUX_INITRD - Indicates a list of filesystem images to
|
||||||
# concatenate and use as an initrd (optional).
|
# concatenate and use as an initrd (optional).
|
||||||
# UBOOT_EXTLINUX_MENU_DESCRIPTION - Name to use as description.
|
# UBOOT_EXTLINUX_MENU_DESCRIPTION - Name to use as description.
|
||||||
|
@ -59,6 +60,7 @@
|
||||||
# a console=...some_tty...
|
# a console=...some_tty...
|
||||||
UBOOT_EXTLINUX_CONSOLE ??= "console=${console}"
|
UBOOT_EXTLINUX_CONSOLE ??= "console=${console}"
|
||||||
UBOOT_EXTLINUX_LABELS ??= "linux"
|
UBOOT_EXTLINUX_LABELS ??= "linux"
|
||||||
|
UBOOT_EXTLINUX_FDT ??= ""
|
||||||
UBOOT_EXTLINUX_FDTDIR ??= "../"
|
UBOOT_EXTLINUX_FDTDIR ??= "../"
|
||||||
UBOOT_EXTLINUX_KERNEL_IMAGE ??= "../${KERNEL_IMAGETYPE}"
|
UBOOT_EXTLINUX_KERNEL_IMAGE ??= "../${KERNEL_IMAGETYPE}"
|
||||||
UBOOT_EXTLINUX_KERNEL_ARGS ??= "rootwait rw"
|
UBOOT_EXTLINUX_KERNEL_ARGS ??= "rootwait rw"
|
||||||
|
@ -84,6 +86,8 @@ python create_extlinux_config() {
|
||||||
if not cfile:
|
if not cfile:
|
||||||
bb.fatal('Unable to read UBOOT_EXTLINUX_CONFIG')
|
bb.fatal('Unable to read UBOOT_EXTLINUX_CONFIG')
|
||||||
|
|
||||||
|
localdata = bb.data.createCopy(d)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(cfile, 'w') as cfgfile:
|
with open(cfile, 'w') as cfgfile:
|
||||||
cfgfile.write('# Generic Distro Configuration file generated by OpenEmbedded\n')
|
cfgfile.write('# Generic Distro Configuration file generated by OpenEmbedded\n')
|
||||||
|
@ -99,9 +103,8 @@ python create_extlinux_config() {
|
||||||
default = localdata.getVar('UBOOT_EXTLINUX_DEFAULT_LABEL')
|
default = localdata.getVar('UBOOT_EXTLINUX_DEFAULT_LABEL')
|
||||||
if default:
|
if default:
|
||||||
cfgfile.write('DEFAULT %s\n' % (default))
|
cfgfile.write('DEFAULT %s\n' % (default))
|
||||||
|
|
||||||
for label in labels.split():
|
for label in labels.split():
|
||||||
localdata = bb.data.createCopy(d)
|
|
||||||
|
|
||||||
overrides = localdata.getVar('OVERRIDES')
|
overrides = localdata.getVar('OVERRIDES')
|
||||||
if not overrides:
|
if not overrides:
|
||||||
|
@ -121,7 +124,13 @@ python create_extlinux_config() {
|
||||||
|
|
||||||
kernel_image = localdata.getVar('UBOOT_EXTLINUX_KERNEL_IMAGE')
|
kernel_image = localdata.getVar('UBOOT_EXTLINUX_KERNEL_IMAGE')
|
||||||
fdtdir = localdata.getVar('UBOOT_EXTLINUX_FDTDIR')
|
fdtdir = localdata.getVar('UBOOT_EXTLINUX_FDTDIR')
|
||||||
if fdtdir:
|
|
||||||
|
fdt = localdata.getVar('UBOOT_EXTLINUX_FDT')
|
||||||
|
|
||||||
|
if fdt:
|
||||||
|
cfgfile.write('LABEL %s\n\tKERNEL %s\n\tFDT %s\n' %
|
||||||
|
(menu_description, kernel_image, fdt))
|
||||||
|
elif fdtdir:
|
||||||
cfgfile.write('LABEL %s\n\tKERNEL %s\n\tFDTDIR %s\n' %
|
cfgfile.write('LABEL %s\n\tKERNEL %s\n\tFDTDIR %s\n' %
|
||||||
(menu_description, kernel_image, fdtdir))
|
(menu_description, kernel_image, fdtdir))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue