[oe-commits] Darren Hart : bootimage: Use ${S} explicitly for generated config files

git at git.openembedded.org git at git.openembedded.org
Fri Dec 2 15:32:02 UTC 2011


Module: openembedded-core.git
Branch: master
Commit: 2c4b1675eb3c8c599e3b7f33e459aa608c2b93f2
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=2c4b1675eb3c8c599e3b7f33e459aa608c2b93f2

Author: Darren Hart <dvhart at linux.intel.com>
Date:   Thu Dec  1 19:20:15 2011 -0800

bootimage: Use ${S} explicitly for generated config files

The syslinux and grub-efi classes were generating config files in the current
working directory. This caused a failure due to a race in the creation of the
directories leading to cwd changing and the build failing to find the config
files. While this has been addressed in bitbake, it is better to use an
explicit path.

While ${WORKDIR} may seem a more appropriate place, the recipe
already uses ${S} for the "hdd" and "cd" construction, so we use ${S}
here to keep things consolidated and consistent and address the issue
with minimal change.

Signed-off-by: Darren Hart <dvhart at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/grub-efi.bbclass |    8 +++-----
 meta/classes/syslinux.bbclass |    4 ++--
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/meta/classes/grub-efi.bbclass b/meta/classes/grub-efi.bbclass
index 333e6c5..36b5831 100644
--- a/meta/classes/grub-efi.bbclass
+++ b/meta/classes/grub-efi.bbclass
@@ -16,7 +16,7 @@
 
 do_bootimg[depends] += "grub-efi-${TARGET_ARCH}-native:do_deploy"
 
-GRUBCFG = "grub.cfg"
+GRUBCFG = "${S}/grub.cfg"
 GRUB_TIMEOUT ?= "10"
 #FIXME: build this from the machine config
 GRUB_OPTS ?= "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"
@@ -56,7 +56,7 @@ grubefi_iso_populate() {
 
 	# FIXUP the <EFIDIR> token in the config
 	# FIXME: This can be dropped once mkdosfs is fixed
-	sed -i "s@<EFIDIR>@${EFIDIR}@g" ${GRUB_ISODIR}/${GRUBCFG}
+	sed -i "s@<EFIDIR>@${EFIDIR}@g" ${GRUB_ISODIR}/$(basename "${GRUBCFG}")
 }
 
 grubefi_hddimg_populate() {
@@ -64,7 +64,7 @@ grubefi_hddimg_populate() {
 
 	# FIXUP the <EFIDIR> token in the config
 	# FIXME: This can be dropped once mkdosfs is fixed
-	sed -i "s@<EFIDIR>@@g" ${GRUB_HDDDIR}/${GRUBCFG}
+	sed -i "s@<EFIDIR>@@g" ${GRUB_HDDDIR}/$(basename "${GRUBCFG}")
 }
 
 # FIXME: The <EFIDIR> token can be replaced with ${EFIDIR} once the
@@ -90,8 +90,6 @@ python build_grub_cfg() {
     if not cfile:
         raise bb.build.FuncFailed('Unable to read GRUBCFG')
 
-    #bb.mkdirhier(os.path.dirname(cfile))
-
     try:
          cfgfile = file(cfile, 'w')
     except OSError:
diff --git a/meta/classes/syslinux.bbclass b/meta/classes/syslinux.bbclass
index 6eb804b..91c4275 100644
--- a/meta/classes/syslinux.bbclass
+++ b/meta/classes/syslinux.bbclass
@@ -15,8 +15,8 @@
 do_bootimg[depends] += "syslinux:do_populate_sysroot \
                         syslinux-native:do_populate_sysroot"
 
-SYSLINUXCFG  = "syslinux.cfg"
-SYSLINUXMENU = "menu"
+SYSLINUXCFG  = "${S}/syslinux.cfg"
+SYSLINUXMENU = "${S}/menu"
 
 SYSLINUX_ISODIR = "${ISODIR}/isolinux"
 SYSLINUX_HDDDIR = "${HDDDIR}"





More information about the Openembedded-commits mailing list