diff options
author | Enrico Jorns <ejo@pengutronix.de> | 2016-06-08 20:52:15 +0200 |
---|---|---|
committer | Enrico Joerns <e.joerns@tu-bs.de> | 2016-06-08 21:58:47 +0200 |
commit | 0100679502f682bad43f5a20e4cac571e0ff46df (patch) | |
tree | 8cc84d38a93c01350b96e6afe52b44d6d125bede | |
parent | a2fcf8b6fe524a862ec659b39f0c4d1495042403 (diff) | |
download | meta-ptx-0100679502f682bad43f5a20e4cac571e0ff46df.tar.gz meta-ptx-0100679502f682bad43f5a20e4cac571e0ff46df.tar.xz |
bootspec: add missing expands
Add d.expand() or d.getVar() to string where variables are used.
Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
-rw-r--r-- | classes/bootspec.bbclass | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/classes/bootspec.bbclass b/classes/bootspec.bbclass index 7d24cb6..a539b3c 100644 --- a/classes/bootspec.bbclass +++ b/classes/bootspec.bbclass @@ -16,10 +16,9 @@ python () { for type in (d.getVar('IMAGE_FSTYPES', True) or "").split(): option = d.getVar('BOOTSPEC_OPTIONS_%s' % type, True) - if option: - break; - - d.setVar('BOOTSPEC_OPTIONS_DEFAULT', option) + if option: + d.setVar('BOOTSPEC_OPTIONS_DEFAULT', option) + break; } BOOTSPEC_OPTIONS ?= "${BOOTSPEC_OPTIONS_DEFAULT}" @@ -29,23 +28,23 @@ BOOTSPEC_EXTRALINE ?= "" BOOTSPEC_OPTIONS[doc] = "Allows to add extra content to bootspec entries, lines must be terminated with a newline" python create_bootspec() { - dtb = d.getVar('KERNEL_DEVICETREE', '').replace('.dtb', '').split() - bb.utils.mkdirhier("${IMAGE_ROOTFS}/loader/entries/") + dtb = d.getVar('KERNEL_DEVICETREE', True).replace('.dtb', '').split() + bb.utils.mkdirhier(d.expand("${IMAGE_ROOTFS}/loader/entries/")) for x in dtb: bb.note("Creating boot spec entry /loader/entries/" + x + ".conf ...") try: - bootspecfile = open("${IMAGE_ROOTFS}/loader/entries/" + x + ".conf", 'w') + bootspecfile = open(d.expand("${IMAGE_ROOTFS}/loader/entries/" + x + ".conf"), 'w') except OSError: raise bb.build.FuncFailed('Unable to open boot spec file for writing') - bootspecfile.write('title ${BOOTSPEC_TITLE}\n') - bootspecfile.write('version ${BOOTSPEC_VERSION}\n') - bootspecfile.write('options ${BOOTSPEC_OPTIONS}\n') - bootspecfile.write('${BOOTSPEC_EXTRALINE}') - bootspecfile.write('linux /boot/${KERNEL_IMAGETYPE}\n') - bootspecfile.write('devicetree /boot/devicetree-${KERNEL_IMAGETYPE}-' + x + '.dtb\n') + bootspecfile.write('title %s\n' % d.getVar('BOOTSPEC_TITLE', True)) + bootspecfile.write('version %s\n' % d.getVar('BOOTSPEC_VERSION', True)) + bootspecfile.write('options %s\n' % d.expand('${BOOTSPEC_OPTIONS}')) + bootspecfile.write(d.getVar('BOOTSPEC_EXTRALINE', True)) + bootspecfile.write('linux %s\n' % d.expand('/boot/${KERNEL_IMAGETYPE}')) + bootspecfile.write('devicetree %s\n' % d.expand('/boot/devicetree-${KERNEL_IMAGETYPE}-' + x + '.dtb\n')) bootspecfile.close() } |