Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] Use ${S} explicitly for generated config files
@ 2011-12-02  3:20 Darren Hart
  2011-12-02  3:20 ` [PATCH 1/1] bootimage: " Darren Hart
  0 siblings, 1 reply; 3+ messages in thread
From: Darren Hart @ 2011-12-02  3:20 UTC (permalink / raw)
  To: openembedded-core, richard.purdie

The following changes since commit e57935dc18d576feb1003b48e7cdc72a444131b8:

  Revert "classes/buildhistory: add new output history collection class" (2011-12-01 23:00:52 +0000)

are available in the git repository at:
  git://git.yoctoproject.org/user-contrib/dvhart/oe-core efi/cfgpath
  http://git.yoctoproject.org/cgit.cgi/user-contrib/dvhart/oe-core/log/?h=efi/cfgpath

Darren Hart (1):
  bootimage: Use ${S} explicitly for generated config files 

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

-- 
1.7.6.4




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] bootimage: Use ${S} explicitly for generated config files
  2011-12-02  3:20 [PATCH 0/1] Use ${S} explicitly for generated config files Darren Hart
@ 2011-12-02  3:20 ` Darren Hart
  2011-12-02 15:29   ` Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Darren Hart @ 2011-12-02  3:20 UTC (permalink / raw)
  To: openembedded-core, richard.purdie

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@linux.intel.com>
---
 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}"
-- 
1.7.6.4




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] bootimage: Use ${S} explicitly for generated config files
  2011-12-02  3:20 ` [PATCH 1/1] bootimage: " Darren Hart
@ 2011-12-02 15:29   ` Richard Purdie
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2011-12-02 15:29 UTC (permalink / raw)
  To: Darren Hart; +Cc: openembedded-core

On Thu, 2011-12-01 at 19:20 -0800, Darren Hart wrote:
> 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@linux.intel.com>
> ---
>  meta/classes/grub-efi.bbclass |    8 +++-----
>  meta/classes/syslinux.bbclass |    4 ++--
>  2 files changed, 5 insertions(+), 7 deletions(-)

Merged to master, thanks.

Richard




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-02 15:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-02  3:20 [PATCH 0/1] Use ${S} explicitly for generated config files Darren Hart
2011-12-02  3:20 ` [PATCH 1/1] bootimage: " Darren Hart
2011-12-02 15:29   ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox