All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] grub-efi: Use /EFI/BOOT now that mkdosfs -d works with directories
  2011-12-16  6:12 [PATCH 0/4] Fix grub efi menu, kernel messages, and live image dosfsck Darren Hart
@ 2011-12-16  6:12 ` Darren Hart
  2011-12-16  6:12 ` [PATCH 2/4] grub-efi: Add efi_gop module to payload for physical console support Darren Hart
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Darren Hart @ 2011-12-16  6:12 UTC (permalink / raw)
  To: openembedded-core; +Cc: Darren Hart

[Yocto 1783] prevented us from using a proper /EFI/BOOT path in the live
images due to a bug in the -d patch for mkdosfs in dosfstools. With this
now fixed, we can place the efi payload where it belongs per spec and
the images will autoboot to the grub menu on EFI platforms.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
 meta/classes/grub-efi.bbclass |   18 +++---------------
 1 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/meta/classes/grub-efi.bbclass b/meta/classes/grub-efi.bbclass
index 36b5831..762322b 100644
--- a/meta/classes/grub-efi.bbclass
+++ b/meta/classes/grub-efi.bbclass
@@ -21,10 +21,8 @@ GRUB_TIMEOUT ?= "10"
 #FIXME: build this from the machine config
 GRUB_OPTS ?= "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"
 
-# FIXME: add EFI/BOOT to GRUB_HDDDIR once the mkdosfs subdir bug is resolved
-#        http://bugzilla.yoctoproject.org/show_bug.cgi?id=1783
 EFIDIR = "/EFI/BOOT"
-GRUB_HDDDIR = "${HDDDIR}"
+GRUB_HDDDIR = "${HDDDIR}${EFIDIR}"
 GRUB_ISODIR = "${ISODIR}${EFIDIR}"
 
 grubefi_populate() {
@@ -53,22 +51,12 @@ grubefi_populate() {
 
 grubefi_iso_populate() {
 	grubefi_populate ${GRUB_ISODIR}
-
-	# FIXUP the <EFIDIR> token in the config
-	# FIXME: This can be dropped once mkdosfs is fixed
-	sed -i "s@<EFIDIR>@${EFIDIR}@g" ${GRUB_ISODIR}/$(basename "${GRUBCFG}")
 }
 
 grubefi_hddimg_populate() {
 	grubefi_populate ${GRUB_HDDDIR}
-
-	# FIXUP the <EFIDIR> token in the config
-	# FIXME: This can be dropped once mkdosfs is fixed
-	sed -i "s@<EFIDIR>@@g" ${GRUB_HDDDIR}/$(basename "${GRUBCFG}")
 }
 
-# FIXME: The <EFIDIR> token can be replaced with ${EFIDIR} once the
-#        mkdosfs bug is resolved.
 python build_grub_cfg() {
     import sys
 
@@ -121,7 +109,7 @@ python build_grub_cfg() {
         bb.data.update_data(localdata)
 
         cfgfile.write('\nmenuentry \'%s\'{\n' % (label))
-        cfgfile.write('linux <EFIDIR>/vmlinuz LABEL=%s' % (label))
+        cfgfile.write('linux ${EFIDIR}/vmlinuz LABEL=%s' % (label))
 
         append = localdata.getVar('APPEND', True)
         initrd = localdata.getVar('INITRD', True)
@@ -131,7 +119,7 @@ python build_grub_cfg() {
         cfgfile.write('\n')
    
         if initrd:
-            cfgfile.write('initrd <EFIDIR>/initrd')
+            cfgfile.write('initrd ${EFIDIR}/initrd')
         cfgfile.write('\n}\n')
 
     cfgfile.close()
-- 
1.7.6.4




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

* [PATCH 0/4] Fix grub efi menu, kernel messages, and live image dosfsck
@ 2011-12-16  6:12 Darren Hart
  2011-12-16  6:12 ` [PATCH 1/4] grub-efi: Use /EFI/BOOT now that mkdosfs -d works with directories Darren Hart
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Darren Hart @ 2011-12-16  6:12 UTC (permalink / raw)
  To: openembedded-core; +Cc: Darren Hart

This series moves the live image EFI content to the /EFI/BOOT directory where it
belongs per the specification. It also adds support for the efi_gop framebuffer.
This allows grub to start on boot and the kernel to log messages to the physical
console. Also correct some live image filesystem issues.

The following changes since commit 0eb139619301d0efee330932eba3617dcb39284e:

  Patch Upstream Status Updates (2011-12-15 14:35:27 +0000)

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

Darren Hart (4):
  grub-efi: Use /EFI/BOOT now that mkdosfs -d works with directories
  grub-efi: Add efi_gop module to payload for physical console support
  grub-efi: specify prefix so it can find grub.cfg
  bootimg: Use dosfsck to clean up the generated live image

 meta/classes/bootimg.bbclass                  |    1 +
 meta/classes/grub-efi.bbclass                 |   18 +++---------------
 meta/recipes-bsp/grub/grub-efi-native_1.99.bb |    6 +++---
 3 files changed, 7 insertions(+), 18 deletions(-)

-- 
1.7.6.4




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

* [PATCH 2/4] grub-efi: Add efi_gop module to payload for physical console support
  2011-12-16  6:12 [PATCH 0/4] Fix grub efi menu, kernel messages, and live image dosfsck Darren Hart
  2011-12-16  6:12 ` [PATCH 1/4] grub-efi: Use /EFI/BOOT now that mkdosfs -d works with directories Darren Hart
@ 2011-12-16  6:12 ` Darren Hart
  2011-12-16  6:12 ` [PATCH 3/4] grub-efi: specify prefix so it can find grub.cfg Darren Hart
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Darren Hart @ 2011-12-16  6:12 UTC (permalink / raw)
  To: openembedded-core; +Cc: Darren Hart

Without the efi_gop module, the GRUB menu would work, but the Linux
kernel messages would not be displayed to the physical console. Adding
efi_gop causes grub to pass the proper information in the boot parameters
pointer such that the Linux kernel can detect and use the EFI framebuffer.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
 meta/recipes-bsp/grub/grub-efi-native_1.99.bb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/meta/recipes-bsp/grub/grub-efi-native_1.99.bb b/meta/recipes-bsp/grub/grub-efi-native_1.99.bb
index 40e618c..c86cf50 100644
--- a/meta/recipes-bsp/grub/grub-efi-native_1.99.bb
+++ b/meta/recipes-bsp/grub/grub-efi-native_1.99.bb
@@ -60,7 +60,7 @@ EXTRA_OECONF = "--with-platform=efi --disable-grub-mkfont \
 do_mkimage() {
 	./grub-mkimage -p / -d ./grub-core/ \
 		       -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \
-	               boot linux fat serial part_msdos normal
+	               boot linux fat serial part_msdos normal efi_gop
 }
 addtask mkimage after do_compile before do_install
 
-- 
1.7.6.4




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

* [PATCH 3/4] grub-efi: specify prefix so it can find grub.cfg
  2011-12-16  6:12 [PATCH 0/4] Fix grub efi menu, kernel messages, and live image dosfsck Darren Hart
  2011-12-16  6:12 ` [PATCH 1/4] grub-efi: Use /EFI/BOOT now that mkdosfs -d works with directories Darren Hart
  2011-12-16  6:12 ` [PATCH 2/4] grub-efi: Add efi_gop module to payload for physical console support Darren Hart
@ 2011-12-16  6:12 ` Darren Hart
  2011-12-16  6:12 ` [PATCH 4/4] bootimg: Use dosfsck to clean up the generated live image Darren Hart
  2011-12-16 16:14 ` [PATCH 0/4] Fix grub efi menu, kernel messages, and live image dosfsck Richard Purdie
  4 siblings, 0 replies; 6+ messages in thread
From: Darren Hart @ 2011-12-16  6:12 UTC (permalink / raw)
  To: openembedded-core; +Cc: Darren Hart

Specify /EFI/BOOT as the grub prefix so the grub efi payload can find
the grub.cfg in the same directory. Ultimately, it might make more sense
to install the grub tools and the grub-core modules to sysroot and make the
grub-efi bbclass generate the image in the required format as part of the
bootimg generation. However, bootimg is currently the only user, so make the
correction here to resolve the immediate issue.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
 meta/recipes-bsp/grub/grub-efi-native_1.99.bb |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-bsp/grub/grub-efi-native_1.99.bb b/meta/recipes-bsp/grub/grub-efi-native_1.99.bb
index c86cf50..9183812 100644
--- a/meta/recipes-bsp/grub/grub-efi-native_1.99.bb
+++ b/meta/recipes-bsp/grub/grub-efi-native_1.99.bb
@@ -16,7 +16,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 # FIXME: We should be able to optionally drop freetype as a dependency
 DEPENDS = "help2man-native"
 RDEPENDS_${PN} = "diffutils freetype"
-PR = "r1"
+PR = "r2"
 
 # Native packages do not normally rebuild when the target changes.
 # Ensure this is built once per HOST-TARGET pair.
@@ -58,7 +58,7 @@ EXTRA_OECONF = "--with-platform=efi --disable-grub-mkfont \
                 --target=${GRUB_TARGET} --enable-efiemu=no --program-prefix=''"
 
 do_mkimage() {
-	./grub-mkimage -p / -d ./grub-core/ \
+	./grub-mkimage -p /EFI/BOOT -d ./grub-core/ \
 		       -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \
 	               boot linux fat serial part_msdos normal efi_gop
 }
-- 
1.7.6.4




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

* [PATCH 4/4] bootimg: Use dosfsck to clean up the generated live image
  2011-12-16  6:12 [PATCH 0/4] Fix grub efi menu, kernel messages, and live image dosfsck Darren Hart
                   ` (2 preceding siblings ...)
  2011-12-16  6:12 ` [PATCH 3/4] grub-efi: specify prefix so it can find grub.cfg Darren Hart
@ 2011-12-16  6:12 ` Darren Hart
  2011-12-16 16:14 ` [PATCH 0/4] Fix grub efi menu, kernel messages, and live image dosfsck Richard Purdie
  4 siblings, 0 replies; 6+ messages in thread
From: Darren Hart @ 2011-12-16  6:12 UTC (permalink / raw)
  To: openembedded-core; +Cc: Darren Hart

The generated filesystem has some errors that dosfsck is able to repair:

dosfsck 2.11, 12 Mar 2005, FAT32, LFN
Checking file /ldlinux.sys (LDLINUX.SYS)
Checking file /initrd (INITRD)
Checking file /syslinux.cfg (SYSLINUX.CFG)
Checking file /EFI (EFI)
Checking file /vmlinuz (VMLINUZ)
Checking file /rootfs.img (ROOTFS.IMG)
/vmlinuz
  File size is 4144896 bytes, cluster chain length is > 4145152 bytes.
  Truncating file to 4144896 bytes.
Checking file /EFI/.. (..)
Checking file /EFI/BOOT (BOOT)
Checking file /EFI/. (.)
/EFI/..
  Start (16022) does not point to .. (0)
/EFI/.
  Start (0) does not point to parent (16022)
Checking file /EFI/BOOT/.. (..)
Checking file /EFI/BOOT/. (.)
Checking file /EFI/BOOT/initrd (INITRD)
Checking file /EFI/BOOT/grub.cfg (GRUB.CFG)
Checking file /EFI/BOOT/bootia32.efi (BOOTIA32.EFI)
Checking file /EFI/BOOT/vmlinuz (VMLINUZ)
Checking file /EFI/BOOT/rootfs.img (ROOTFS.IMG)
/EFI/BOOT/..
  Start (16021) does not point to .. (16022)
/EFI/BOOT/.
  Start (0) does not point to parent (16021)
/EFI/BOOT/vmlinuz
  File size is 4144896 bytes, cluster chain length is > 4145152 bytes.
  Truncating file to 4144896 bytes.
Performing changes.
/build/poky/fri2/tmp/deploy/images/core-image-minimal-fri2-noemgd-20111216000605.hddimg:
12 files, 26635/26828 clusters

Add a dosfsck command following the mkdosfs command to correct these.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Nitin A Kamble <nitin.a.kamble@intel.com>
---
 meta/classes/bootimg.bbclass |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index 0d06351..8ec07a0 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -109,6 +109,7 @@ build_hddimg() {
 
 		mkdosfs -n ${BOOTIMG_VOLUME_ID} -d ${HDDDIR} \
 		        -C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE
+		dosfsck -a -l ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg || true
 
 		if [ "${PCBIOS}" = "1" ]; then
 			syslinux_hddimg_install
-- 
1.7.6.4




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

* Re: [PATCH 0/4] Fix grub efi menu, kernel messages, and live image dosfsck
  2011-12-16  6:12 [PATCH 0/4] Fix grub efi menu, kernel messages, and live image dosfsck Darren Hart
                   ` (3 preceding siblings ...)
  2011-12-16  6:12 ` [PATCH 4/4] bootimg: Use dosfsck to clean up the generated live image Darren Hart
@ 2011-12-16 16:14 ` Richard Purdie
  4 siblings, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2011-12-16 16:14 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: Darren Hart

On Thu, 2011-12-15 at 22:12 -0800, Darren Hart wrote:
> This series moves the live image EFI content to the /EFI/BOOT directory where it
> belongs per the specification. It also adds support for the efi_gop framebuffer.
> This allows grub to start on boot and the kernel to log messages to the physical
> console. Also correct some live image filesystem issues.
> 
> The following changes since commit 0eb139619301d0efee330932eba3617dcb39284e:
> 
>   Patch Upstream Status Updates (2011-12-15 14:35:27 +0000)
> 
> are available in the git repository at:
>   git://git.yoctoproject.org/user-contrib/dvhart/oe-core dvhart/efi/dev
>   http://git.yoctoproject.org/cgit.cgi/user-contrib/dvhart/oe-core/log/?h=dvhart/efi/dev
> 
> Darren Hart (4):
>   grub-efi: Use /EFI/BOOT now that mkdosfs -d works with directories
>   grub-efi: Add efi_gop module to payload for physical console support
>   grub-efi: specify prefix so it can find grub.cfg
>   bootimg: Use dosfsck to clean up the generated live image

Merged to master, thanks.

Richard




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

end of thread, other threads:[~2011-12-16 16:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-16  6:12 [PATCH 0/4] Fix grub efi menu, kernel messages, and live image dosfsck Darren Hart
2011-12-16  6:12 ` [PATCH 1/4] grub-efi: Use /EFI/BOOT now that mkdosfs -d works with directories Darren Hart
2011-12-16  6:12 ` [PATCH 2/4] grub-efi: Add efi_gop module to payload for physical console support Darren Hart
2011-12-16  6:12 ` [PATCH 3/4] grub-efi: specify prefix so it can find grub.cfg Darren Hart
2011-12-16  6:12 ` [PATCH 4/4] bootimg: Use dosfsck to clean up the generated live image Darren Hart
2011-12-16 16:14 ` [PATCH 0/4] Fix grub efi menu, kernel messages, and live image dosfsck Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.