* [RFC PATCH 0/5] EFI live image support
@ 2011-11-24 8:04 Darren Hart
2011-11-24 8:05 ` [RFC PATCH 1/5] grub-efi-native: New recipe to build GRUB EFI images Darren Hart
` (5 more replies)
0 siblings, 6 replies; 18+ messages in thread
From: Darren Hart @ 2011-11-24 8:04 UTC (permalink / raw)
To: Richard Purdie, Koen Kooi, Chris Larson, Josef Ahmad,
openembedded-core
Cc: Darren Hart
This series provides optional support for EFI boot for live images, both hddimg
and ISO, on ia32 platforms. It creates a new grub-efi-native recipe to create
the boot image. bootimg.bbclass has been refactored and syslinux support has
been made optional. The new live images can be built as PCBIOS-legacy (the
original type), EFI, or both. The MACHINE_FEATURES values "pcbios" and "efi"
dictate this behavior, if neither are specified, it defaults to PCBIOS-legacy
only to maintain current behavior.
It is careful not to add unecessary dependencies to the build by dynamically
including only the necessary bootloader classes (syslinux and/or grub-efi).
EFI hddimg's do not install into /EFI/BOOT as is proper due to a bug in the
dosfstools: http://bugzilla.yoctoproject.org/show_bug.cgi?id=1783. For now, the
files are installe in the root directory and users will need to update their
firmware or use a startup.nsh script for pure EFI booting.
Testing performed includes verification of the images built for the n450 BSP
with all combinations of the MACHINE_FEATURES. The syslinux and grub-efi boot
methods were validated on the n450 hardware as well. EFI-only ISO images are
untested, help here would be appreciated.
While the "install" target is preserved for the EFI boot, it will perform the
same install as it does currently - namely a GRUB legacy boot mechanism. Support
for EFI boot post install will follow in another patch series.
Thanks to Koen Kooi, Chris Larson, Richard Purdie, and Josef Ahmad for their
contributions of expertise, code, and testing.
NOTE: This is an RFC and not intended for inclusion. I would appreciate at least
one round of reviews from the OE experts and some additional testing
before this is pulled.
The following changes since commit c5bdef56175c0b6863e3d588a5a2c23cbea7b568:
documentation/adt-manual/adt-prepare.xml: Fixed broken link (2011-11-08 21:49:45 +0000)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib dvhart/efi
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=dvhart/efi
Darren Hart (5):
grub-efi-native: New recipe to build GRUB EFI images
bootimg: Refactor build_hddimg and build_iso routines
bootimg: Pull syslinux specific bits into syslinux.bbclass
bootimg: Add grub-efi support
bootimg: Allow for EFI-only boot images
meta/classes/bootimg.bbclass | 148 +++++++++++++------------
meta/classes/dummy.bbclass | 2 +
meta/classes/grub-efi.bbclass | 140 +++++++++++++++++++++++
meta/classes/syslinux.bbclass | 84 +++++++++++---
meta/recipes-bsp/grub/grub-efi-native_1.99.bb | 74 ++++++++++++
5 files changed, 362 insertions(+), 86 deletions(-)
create mode 100644 meta/classes/dummy.bbclass
create mode 100644 meta/classes/grub-efi.bbclass
create mode 100644 meta/recipes-bsp/grub/grub-efi-native_1.99.bb
--
1.7.6.4
^ permalink raw reply [flat|nested] 18+ messages in thread
* [RFC PATCH 1/5] grub-efi-native: New recipe to build GRUB EFI images
2011-11-24 8:04 [RFC PATCH 0/5] EFI live image support Darren Hart
@ 2011-11-24 8:05 ` Darren Hart
2011-11-24 8:59 ` Koen Kooi
2011-11-25 22:57 ` Darren Hart
2011-11-24 8:05 ` [RFC PATCH 2/5] bootimg: Refactor build_hddimg and build_iso routines Darren Hart
` (4 subsequent siblings)
5 siblings, 2 replies; 18+ messages in thread
From: Darren Hart @ 2011-11-24 8:05 UTC (permalink / raw)
To: Richard Purdie, Koen Kooi, Chris Larson, Josef Ahmad,
openembedded-core
Cc: Darren Hart
Add a recipe to build the GRUB efi images. This recipe is written as
a native recipe as the resulting GRUB utils are required to assemble
the final image. Rather than build a native and a target recipe (and
increase build times), this recipe builds the utils for the host and
passes an appropriate --target argument to the GRUB configure script
to build the modules for the target arch. The only output of this
recipe is an EFI image in the deploy directory.
Care is taken to ensure changing targets will force a rebuild of this
native recipe by including the target arch in the PN.
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
meta/recipes-bsp/grub/grub-efi-native_1.99.bb | 74 +++++++++++++++++++++++++
1 files changed, 74 insertions(+), 0 deletions(-)
create mode 100644 meta/recipes-bsp/grub/grub-efi-native_1.99.bb
diff --git a/meta/recipes-bsp/grub/grub-efi-native_1.99.bb b/meta/recipes-bsp/grub/grub-efi-native_1.99.bb
new file mode 100644
index 0000000..3c52ec9
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-efi-native_1.99.bb
@@ -0,0 +1,74 @@
+SUMMARY = "GRUB2 is the next-generation GRand Unified Bootloader"
+
+DESCRIPTION = "GRUB2 is the next generaion of a GPLed bootloader \
+intended to unify bootloading across x86 operating systems. In \
+addition to loading the Linux kernel, it implements the Multiboot \
+standard, which allows for flexible loading of multiple boot images. \
+This recipe builds an EFI binary for the target. It does not install \
+or package anything, it only deploys a target-arch GRUB EFI image."
+
+HOMEPAGE = "http://www.gnu.org/software/grub/"
+SECTION = "bootloaders"
+PRIORITY = "optional"
+
+LICENSE = "GPLv3"
+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"
+
+# Native packages do not normally rebuild when the target changes.
+# Ensure this is built once per HOST-TARGET pair.
+PN := "grub-efi-${TRANSLATED_TARGET_ARCH}-native"
+
+SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "ca9f2a2d571b57fc5c53212d1d22e2b5"
+SRC_URI[sha256sum] = "b91f420f2c51f6155e088e34ff99bea09cc1fb89585cf7c0179644e57abd28ff"
+
+COMPATIBLE_HOST = '(x86_64.*|i.86.*)-(linux|freebsd.*)'
+
+S = "${WORKDIR}/grub-${PV}"
+
+# Determine the target arch for the grub modules before the native class
+# clobbers TARGET_ARCH.
+ORIG_TARGET_ARCH := ${TARGET_ARCH}
+python __anonymous () {
+ import re
+ target = d.getVar('ORIG_TARGET_ARCH', True)
+ if target == "x86_64":
+ grubtarget = 'x86_64'
+ grubimage = "bootx64.efi"
+ elif re.match('i.86', target):
+ grubtarget = 'i386'
+ grubimage = "bootia32.efi"
+ else:
+ raise bb.parse.SkipPackage("grub-efi is incompatible with target %s" % target)
+ d.setVar("GRUB_TARGET", grubtarget)
+ d.setVar("GRUB_IMAGE", grubimage)
+}
+
+inherit autotools
+inherit gettext
+inherit native
+inherit deploy
+
+EXTRA_OECONF = "--with-platform=efi --disable-grub-mkfont \
+ --target=${GRUB_TARGET} --enable-efiemu=no --program-prefix=''"
+
+do_mkimage() {
+ ./grub-mkimage -p / -d ./grub-core/ \
+ -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \
+ boot linux fat serial part_msdos normal
+}
+addtask mkimage after do_compile before do_install
+
+do_deploy() {
+ install -m 644 ${S}/${GRUB_IMAGE} ${DEPLOYDIR}
+}
+addtask deploy after do_install before do_build
+
+do_install[noexec] = "1"
+do_populate_sysroot[noexec] = "1"
--
1.7.6.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [RFC PATCH 2/5] bootimg: Refactor build_hddimg and build_iso routines
2011-11-24 8:04 [RFC PATCH 0/5] EFI live image support Darren Hart
2011-11-24 8:05 ` [RFC PATCH 1/5] grub-efi-native: New recipe to build GRUB EFI images Darren Hart
@ 2011-11-24 8:05 ` Darren Hart
2011-11-24 8:05 ` [RFC PATCH 3/5] bootimg: Pull syslinux specific bits into syslinux.bbclass Darren Hart
` (3 subsequent siblings)
5 siblings, 0 replies; 18+ messages in thread
From: Darren Hart @ 2011-11-24 8:05 UTC (permalink / raw)
To: Richard Purdie, Koen Kooi, Chris Larson, Josef Ahmad,
openembedded-core
Cc: Darren Hart
Separate the construction of the ISO image from that of the hddimg.
This is part of the groundwork for creating a much more flexible
live image builder.
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
meta/classes/bootimg.bbclass | 82 ++++++++++++++++++++++--------------------
1 files changed, 43 insertions(+), 39 deletions(-)
diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index 49ee85e..26d2fae 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -47,7 +47,47 @@ SYSLINUXMENU = "${HDDDIR}/menu"
inherit syslinux
-build_boot_bin() {
+build_iso() {
+ # Only create an ISO if we have an INITRD and NOISO was not set
+ if [ -z "${INITRD}" ] || [ ! -s "${INITRD}" ] || [ "${NOISO}" = "1" ]; then
+ bbnote "ISO image will not be created."
+ return
+ fi
+
+ install -d ${ISODIR}
+
+ # Install the kernel
+ install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \
+ ${ISODIR}/vmlinuz
+
+ # Install the configuration files
+ cp ${HDDDIR}/syslinux.cfg ${ISODIR}/isolinux.cfg
+
+ if [ -f ${SYSLINUXMENU} ]; then
+ cp ${SYSLINUXMENU} ${ISODIR}
+ fi
+
+ install -m 0644 ${INITRD} ${ISODIR}/initrd
+
+ if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
+ install -m 0644 ${ROOTFS} ${ISODIR}/rootfs.img
+ fi
+
+ # And install the syslinux stuff
+ cp ${STAGING_LIBDIR}/syslinux/isolinux.bin ${ISODIR}
+
+ mkisofs -V ${BOOTIMG_VOLUME_ID} \
+ -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
+ -b isolinux/isolinux.bin -c isolinux/boot.cat -r \
+ -no-emul-boot -boot-load-size 4 -boot-info-table \
+ ${S}/cd/
+
+ cd ${DEPLOY_DIR_IMAGE}
+ rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
+ ln -s ${IMAGE_NAME}.iso ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
+}
+
+build_hddimg() {
install -d ${HDDDIR}
install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \
${HDDDIR}/vmlinuz
@@ -77,48 +117,12 @@ build_boot_bin() {
rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
ln -s ${IMAGE_NAME}.hddimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
- #Create an ISO if we have an INITRD
- if [ -n "${INITRD}" ] && [ -s "${INITRD}" ] && [ "${NOISO}" != "1" ] ; then
- install -d ${ISODIR}
-
- # Install the kernel
-
- install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \
- ${ISODIR}/vmlinuz
-
- # Install the configuration files
-
- cp ${HDDDIR}/syslinux.cfg ${ISODIR}/isolinux.cfg
-
- if [ -f ${SYSLINUXMENU} ]; then
- cp ${SYSLINUXMENU} ${ISODIR}
- fi
-
- install -m 0644 ${INITRD} ${ISODIR}/initrd
-
- if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
- install -m 0644 ${ROOTFS} ${ISODIR}/rootfs.img
- fi
-
- # And install the syslinux stuff
- cp ${STAGING_LIBDIR}/syslinux/isolinux.bin ${ISODIR}
-
- mkisofs -V ${BOOTIMG_VOLUME_ID} \
- -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
- -b isolinux/isolinux.bin -c isolinux/boot.cat -r \
- -no-emul-boot -boot-load-size 4 -boot-info-table \
- ${S}/cd/
-
- cd ${DEPLOY_DIR_IMAGE}
- rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
- ln -s ${IMAGE_NAME}.iso ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
-
- fi
}
python do_bootimg() {
bb.build.exec_func('build_syslinux_cfg', d)
- bb.build.exec_func('build_boot_bin', d)
+ bb.build.exec_func('build_hddimg', d)
+ bb.build.exec_func('build_iso', d)
}
addtask bootimg before do_build
--
1.7.6.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [RFC PATCH 3/5] bootimg: Pull syslinux specific bits into syslinux.bbclass
2011-11-24 8:04 [RFC PATCH 0/5] EFI live image support Darren Hart
2011-11-24 8:05 ` [RFC PATCH 1/5] grub-efi-native: New recipe to build GRUB EFI images Darren Hart
2011-11-24 8:05 ` [RFC PATCH 2/5] bootimg: Refactor build_hddimg and build_iso routines Darren Hart
@ 2011-11-24 8:05 ` Darren Hart
2011-11-24 8:05 ` [RFC PATCH 4/5] bootimg: Add grub-efi support Darren Hart
` (2 subsequent siblings)
5 siblings, 0 replies; 18+ messages in thread
From: Darren Hart @ 2011-11-24 8:05 UTC (permalink / raw)
To: Richard Purdie, Koen Kooi, Chris Larson, Josef Ahmad,
openembedded-core
Cc: Darren Hart
Working towards a more generic bootimg.bbclass, pull out all
syslinux specific bits and let syslinux.bbclass manage them
directly. This introduces no functional changes to the images
constructed and the behavior remains unchanged.
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
meta/classes/bootimg.bbclass | 74 ++++++++---------------------------
meta/classes/syslinux.bbclass | 84 +++++++++++++++++++++++++++++++++--------
2 files changed, 85 insertions(+), 73 deletions(-)
diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index 26d2fae..d4da95b 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -17,36 +17,26 @@
# in syslinux. Actions based on the label are then performed (e.g. installing to
# an hdd)
-# External variables
+# External variables (also used by syslinux.bbclass)
# ${INITRD} - indicates a filesystem image to use as an initrd (optional)
+# ${NOISO} - skip building the ISO image if set to 1
# ${ROOTFS} - indicates a filesystem image to include as the root filesystem (optional)
-# ${AUTO_SYSLINUXCFG} - set this to 1 to enable creating an automatic config
-# ${LABELS} - a list of targets for the automatic config
-# ${APPEND} - an override list of append strings for each label
-# ${SYSLINUX_OPTS} - additional options to add to the syslinux file ';' delimited
do_bootimg[depends] += "dosfstools-native:do_populate_sysroot \
- syslinux:do_populate_sysroot \
- syslinux-native:do_populate_sysroot \
- mtools-native:do_populate_sysroot \
- cdrtools-native:do_populate_sysroot"
+ mtools-native:do_populate_sysroot \
+ cdrtools-native:do_populate_sysroot"
PACKAGES = " "
EXCLUDE_FROM_WORLD = "1"
HDDDIR = "${S}/hdd/boot"
-ISODIR = "${S}/cd/isolinux"
+ISODIR = "${S}/cd"
BOOTIMG_VOLUME_ID ?= "boot"
BOOTIMG_EXTRA_SPACE ?= "512"
-# Get the build_syslinux_cfg() function from the syslinux class
-
-SYSLINUXCFG = "${HDDDIR}/syslinux.cfg"
-SYSLINUXMENU = "${HDDDIR}/menu"
-
inherit syslinux
-
+
build_iso() {
# Only create an ISO if we have an INITRD and NOISO was not set
if [ -z "${INITRD}" ] || [ ! -s "${INITRD}" ] || [ "${NOISO}" = "1" ]; then
@@ -56,31 +46,12 @@ build_iso() {
install -d ${ISODIR}
- # Install the kernel
- install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \
- ${ISODIR}/vmlinuz
-
- # Install the configuration files
- cp ${HDDDIR}/syslinux.cfg ${ISODIR}/isolinux.cfg
-
- if [ -f ${SYSLINUXMENU} ]; then
- cp ${SYSLINUXMENU} ${ISODIR}
- fi
-
- install -m 0644 ${INITRD} ${ISODIR}/initrd
-
- if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
- install -m 0644 ${ROOTFS} ${ISODIR}/rootfs.img
- fi
-
- # And install the syslinux stuff
- cp ${STAGING_LIBDIR}/syslinux/isolinux.bin ${ISODIR}
+ syslinux_iso_populate
mkisofs -V ${BOOTIMG_VOLUME_ID} \
- -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
- -b isolinux/isolinux.bin -c isolinux/boot.cat -r \
- -no-emul-boot -boot-load-size 4 -boot-info-table \
- ${S}/cd/
+ -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
+ -b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} -r \
+ ${MKISOFS_OPTIONS} ${ISODIR}
cd ${DEPLOY_DIR_IMAGE}
rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
@@ -89,35 +60,24 @@ build_iso() {
build_hddimg() {
install -d ${HDDDIR}
- install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \
- ${HDDDIR}/vmlinuz
-
- if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then
- install -m 0644 ${INITRD} ${HDDDIR}/initrd
- fi
- if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
- install -m 0644 ${ROOTFS} ${HDDDIR}/rootfs.img
- fi
-
- install -m 444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}/ldlinux.sys
+ syslinux_hddimg_populate
- # Do a little math, bash style
- #BLOCKS=`du -s ${HDDDIR} | cut -f 1`
+ # Determine the block count for the final image
BLOCKS=`du -bks ${HDDDIR} | cut -f 1`
- SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}`
+ SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}`
mkdosfs -n ${BOOTIMG_VOLUME_ID} -d ${HDDDIR} \
- -C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE
+ -C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE
+
+ syslinux_hddimg_install
- syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
cd ${DEPLOY_DIR_IMAGE}
rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
ln -s ${IMAGE_NAME}.hddimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
-
-}
+}
python do_bootimg() {
bb.build.exec_func('build_syslinux_cfg', d)
diff --git a/meta/classes/syslinux.bbclass b/meta/classes/syslinux.bbclass
index fb75974..4acb272 100644
--- a/meta/classes/syslinux.bbclass
+++ b/meta/classes/syslinux.bbclass
@@ -2,7 +2,63 @@
# Copyright (C) 2004-2006, Advanced Micro Devices, Inc. All Rights Reserved
# Released under the MIT license (see packages/COPYING)
-# This creates a configuration file suitable for use with syslinux.
+# Provide syslinux specific functions for building bootable images.
+
+# External variables
+# ${INITRD} - indicates a filesystem image to use as an initrd (optional)
+# ${ROOTFS} - indicates a filesystem image to include as the root filesystem (optional)
+# ${AUTO_SYSLINUXMENU} - set this to 1 to enable creating an automatic menu
+# ${LABELS} - a list of targets for the automatic config
+# ${APPEND} - an override list of append strings for each label
+# ${SYSLINUX_OPTS} - additional options to add to the syslinux file ';' delimited
+
+do_bootimg[depends] += "syslinux:do_populate_sysroot \
+ syslinux-native:do_populate_sysroot"
+
+SYSLINUXCFG = "syslinux.cfg"
+SYSLINUXMENU = "menu"
+
+SYSLINUX_ISODIR = "${ISODIR}/isolinux"
+SYSLINUX_HDDDIR = "${HDDDIR}"
+ISO_BOOTIMG = "isolinux/isolinux.bin"
+ISO_BOOTCAT = "isolinux/boot.cat"
+MKISOFS_OPTIONS = "-no-emul-boot -boot-load-size 4 -boot-info-table"
+
+syslinux_populate() {
+ DEST=$1
+ CFGNAME=$2
+
+ install -d ${DEST}
+
+ # Install the kernel, initrd, and rootfs
+ install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage ${DEST}/vmlinuz
+ if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then
+ install -m 0644 ${INITRD} ${DEST}/initrd
+ fi
+ if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
+ install -m 0644 ${ROOTFS} ${DEST}/rootfs.img
+ fi
+
+ # Install the config files
+ install -m 0644 ${SYSLINUXCFG} ${DEST}/${CFGNAME}
+ if [ -f ${SYSLINUXMENU} ]; then
+ install -m 0644 ${SYSLINUXMENU} ${DEST}
+ fi
+}
+
+syslinux_iso_populate() {
+ syslinux_populate ${SYSLINUX_ISODIR} isolinux.cfg
+ install -m 0644 ${STAGING_LIBDIR}/syslinux/isolinux.bin ${SYSLINUX_ISODIR}
+}
+
+syslinux_hddimg_populate() {
+ syslinux_populate ${SYSLINUX_HDDDIR} syslinux.cfg
+ install -m 0444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${SYSLINUX_HDDDIR}/ldlinux.sys
+}
+
+syslinux_hddimg_install() {
+ syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
+}
python build_syslinux_menu () {
import copy
@@ -12,12 +68,12 @@ python build_syslinux_menu () {
if not workdir:
bb.error("WORKDIR is not defined")
return
-
+
labels = bb.data.getVar('LABELS', d, 1)
if not labels:
bb.debug(1, "LABELS not defined, nothing to do")
return
-
+
if labels == []:
bb.debug(1, "No labels, nothing to do")
return
@@ -26,10 +82,8 @@ python build_syslinux_menu () {
if not cfile:
raise bb.build.FuncFailed('Unable to read SYSLINUXMENU')
- bb.mkdirhier(os.path.dirname(cfile))
-
try:
- cfgfile = file(cfile, 'w')
+ cfgfile = file(cfile, 'w')
except OSError:
raise bb.build.funcFailed('Unable to open %s' % (cfile))
@@ -49,7 +103,7 @@ python build_syslinux_menu () {
if not overrides:
raise bb.build.FuncFailed('OVERRIDES not defined')
overrides = bb.data.expand(overrides, localdata)
-
+
bb.data.setVar('OVERRIDES', label + ':' + overrides, localdata)
bb.data.update_data(localdata)
@@ -71,12 +125,12 @@ python build_syslinux_cfg () {
if not workdir:
bb.error("WORKDIR not defined, unable to package")
return
-
+
labels = bb.data.getVar('LABELS', d, 1)
if not labels:
bb.debug(1, "LABELS not defined, nothing to do")
return
-
+
if labels == []:
bb.debug(1, "No labels, nothing to do")
return
@@ -85,10 +139,8 @@ python build_syslinux_cfg () {
if not cfile:
raise bb.build.FuncFailed('Unable to read SYSLINUXCFG')
- bb.mkdirhier(os.path.dirname(cfile))
-
try:
- cfgfile = file(cfile, 'w')
+ cfgfile = file(cfile, 'w')
except OSError:
raise bb.build.funcFailed('Unable to open %s' % (cfile))
@@ -103,7 +155,7 @@ python build_syslinux_cfg () {
if opts:
for opt in opts.split(';'):
cfgfile.write('%s\n' % opt)
-
+
cfgfile.write('ALLOWOPTIONS 1\n');
cfgfile.write('DEFAULT %s\n' % (labels.split()[0]))
@@ -124,17 +176,17 @@ python build_syslinux_cfg () {
bb.build.exec_func('build_syslinux_menu', d)
mfile = bb.data.getVar('SYSLINUXMENU', d, 1)
cfgfile.write('DISPLAY %s\n' % (mfile.split('/')[-1]) )
-
+
for label in labels.split():
localdata = bb.data.createCopy(d)
overrides = bb.data.getVar('OVERRIDES', localdata, True)
if not overrides:
raise bb.build.FuncFailed('OVERRIDES not defined')
-
+
bb.data.setVar('OVERRIDES', label + ':' + overrides, localdata)
bb.data.update_data(localdata)
-
+
cfgfile.write('LABEL %s\nKERNEL vmlinuz\n' % (label))
append = bb.data.getVar('APPEND', localdata, 1)
--
1.7.6.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [RFC PATCH 4/5] bootimg: Add grub-efi support
2011-11-24 8:04 [RFC PATCH 0/5] EFI live image support Darren Hart
` (2 preceding siblings ...)
2011-11-24 8:05 ` [RFC PATCH 3/5] bootimg: Pull syslinux specific bits into syslinux.bbclass Darren Hart
@ 2011-11-24 8:05 ` Darren Hart
2011-11-24 8:05 ` [RFC PATCH 5/5] bootimg: Allow for EFI-only boot images Darren Hart
2011-11-24 8:14 ` [RFC PATCH 0/5] EFI live image support Darren Hart
5 siblings, 0 replies; 18+ messages in thread
From: Darren Hart @ 2011-11-24 8:05 UTC (permalink / raw)
To: Richard Purdie, Koen Kooi, Chris Larson, Josef Ahmad,
openembedded-core
Cc: Darren Hart
Create a new grub-efi.bbclass and integrate it into bootimg alongside the
syslinux support. This new class uses the output from the grub-efi-native
recipe. Thanks goes to Josef Ahmad <josef.ahmad@intel.com> for the original
build_grub_cfg() routine.
The EFI features are only added to the image if MACHINE_FEATURES contains
"efi". The resulting images are therefor either legacy boot only (like they
were originally) or legacy boot and EFI boot.
A new "dummy.bbclass" was added to allow for the conditional include
of grub-efi. This makes it so if efi support is not to be built in, we
don't spend time building grub-efi-native just because the include adds
the dependency.
There is a bug in the mkdosfs tool from the dosfstools package which causes
it to crash when the directory passed with the -d parameter contains
sub-directories. An /EFI/BOOT directory is required for a proper EFI
installation. Until it is fixed, we install to the top level directory
for the hddimg.
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Josef Ahmad <josef.ahmad@intel.com>
---
meta/classes/bootimg.bbclass | 13 ++++
meta/classes/dummy.bbclass | 2 +
meta/classes/grub-efi.bbclass | 140 +++++++++++++++++++++++++++++++++++++++++
3 files changed, 155 insertions(+), 0 deletions(-)
create mode 100644 meta/classes/dummy.bbclass
create mode 100644 meta/classes/grub-efi.bbclass
diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index d4da95b..44bb61e 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -35,7 +35,12 @@ ISODIR = "${S}/cd"
BOOTIMG_VOLUME_ID ?= "boot"
BOOTIMG_EXTRA_SPACE ?= "512"
+EFI = ${@base_contains("MACHINE_FEATURES", "efi", "1", "0", d)}
+EFI_CLASS = ${@base_contains("MACHINE_FEATURES", "efi", "grub-efi", "dummy", d)}
+
inherit syslinux
+inherit ${EFI_CLASS}
+
build_iso() {
# Only create an ISO if we have an INITRD and NOISO was not set
@@ -47,6 +52,9 @@ build_iso() {
install -d ${ISODIR}
syslinux_iso_populate
+ if [ "${EFI}" = "1" ]; then
+ grubefi_iso_populate
+ fi
mkisofs -V ${BOOTIMG_VOLUME_ID} \
-o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
@@ -62,6 +70,9 @@ build_hddimg() {
install -d ${HDDDIR}
syslinux_hddimg_populate
+ if [ "${EFI}" = "1" ]; then
+ grubefi_hddimg_populate
+ fi
# Determine the block count for the final image
BLOCKS=`du -bks ${HDDDIR} | cut -f 1`
@@ -81,6 +92,8 @@ build_hddimg() {
python do_bootimg() {
bb.build.exec_func('build_syslinux_cfg', d)
+ if d.getVar("EFI", True) == "1":
+ bb.build.exec_func('build_grub_cfg', d)
bb.build.exec_func('build_hddimg', d)
bb.build.exec_func('build_iso', d)
}
diff --git a/meta/classes/dummy.bbclass b/meta/classes/dummy.bbclass
new file mode 100644
index 0000000..8c30071
--- /dev/null
+++ b/meta/classes/dummy.bbclass
@@ -0,0 +1,2 @@
+# An empty bbclass to facilitate dynamic inherit, include,
+# and require statements.
diff --git a/meta/classes/grub-efi.bbclass b/meta/classes/grub-efi.bbclass
new file mode 100644
index 0000000..333e6c5
--- /dev/null
+++ b/meta/classes/grub-efi.bbclass
@@ -0,0 +1,140 @@
+# grub-efi.bbclass
+# Copyright (c) 2011, Intel Corporation.
+# All rights reserved.
+#
+# Released under the MIT license (see packages/COPYING)
+
+# Provide grub-efi specific functions for building bootable images.
+
+# External variables
+# ${INITRD} - indicates a filesystem image to use as an initrd (optional)
+# ${ROOTFS} - indicates a filesystem image to include as the root filesystem (optional)
+# ${LABELS} - a list of targets for the automatic config
+# ${APPEND} - an override list of append strings for each label
+# ${GRUB_OPTS} - additional options to add to the config, ';' delimited # (optional)
+# ${GRUB_TIMEOUT} - timeout before executing the deault label (optional)
+
+do_bootimg[depends] += "grub-efi-${TARGET_ARCH}-native:do_deploy"
+
+GRUBCFG = "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"
+
+# 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_ISODIR = "${ISODIR}${EFIDIR}"
+
+grubefi_populate() {
+ DEST=$1
+
+ install -d ${DEST}
+
+ install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage ${DEST}/vmlinuz
+
+ if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then
+ install -m 0644 ${INITRD} ${DEST}/initrd
+ fi
+
+ if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
+ install -m 0644 ${ROOTFS} ${DEST}/rootfs.img
+ fi
+
+ GRUB_IMAGE="bootia32.efi"
+ if [ "${TARGET_ARCH}" = "x86_64" ]; then
+ GRUB_IMAGE="bootx64.efi"
+ fi
+ install -m 0644 ${DEPLOY_DIR_IMAGE}/${GRUB_IMAGE} ${DEST}
+
+ install -m 0644 ${GRUBCFG} ${DEST}
+}
+
+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}/${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}/${GRUBCFG}
+}
+
+# FIXME: The <EFIDIR> token can be replaced with ${EFIDIR} once the
+# mkdosfs bug is resolved.
+python build_grub_cfg() {
+ import sys
+
+ workdir = d.getVar('WORKDIR', True)
+ if not workdir:
+ bb.error("WORKDIR not defined, unable to package")
+ return
+
+ labels = d.getVar('LABELS', True)
+ if not labels:
+ bb.debug(1, "LABELS not defined, nothing to do")
+ return
+
+ if labels == []:
+ bb.debug(1, "No labels, nothing to do")
+ return
+
+ cfile = d.getVar('GRUBCFG', True)
+ if not cfile:
+ raise bb.build.FuncFailed('Unable to read GRUBCFG')
+
+ #bb.mkdirhier(os.path.dirname(cfile))
+
+ try:
+ cfgfile = file(cfile, 'w')
+ except OSError:
+ raise bb.build.funcFailed('Unable to open %s' % (cfile))
+
+ cfgfile.write('# Automatically created by OE\n')
+
+ opts = d.getVar('GRUB_OPTS', True)
+ if opts:
+ for opt in opts.split(';'):
+ cfgfile.write('%s\n' % opt)
+
+ cfgfile.write('default=%s\n' % (labels.split()[0]))
+
+ timeout = d.getVar('GRUB_TIMEOUT', True)
+ if timeout:
+ cfgfile.write('timeout=%s\n' % timeout)
+ else:
+ cfgfile.write('timeout=50\n')
+
+ for label in labels.split():
+ localdata = d.createCopy()
+
+ overrides = localdata.getVar('OVERRIDES', True)
+ if not overrides:
+ raise bb.build.FuncFailed('OVERRIDES not defined')
+
+ localdata.setVar('OVERRIDES', label + ':' + overrides)
+ bb.data.update_data(localdata)
+
+ cfgfile.write('\nmenuentry \'%s\'{\n' % (label))
+ cfgfile.write('linux <EFIDIR>/vmlinuz LABEL=%s' % (label))
+
+ append = localdata.getVar('APPEND', True)
+ initrd = localdata.getVar('INITRD', True)
+
+ if append:
+ cfgfile.write('%s' % (append))
+ cfgfile.write('\n')
+
+ if initrd:
+ cfgfile.write('initrd <EFIDIR>/initrd')
+ cfgfile.write('\n}\n')
+
+ cfgfile.close()
+}
--
1.7.6.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [RFC PATCH 5/5] bootimg: Allow for EFI-only boot images
2011-11-24 8:04 [RFC PATCH 0/5] EFI live image support Darren Hart
` (3 preceding siblings ...)
2011-11-24 8:05 ` [RFC PATCH 4/5] bootimg: Add grub-efi support Darren Hart
@ 2011-11-24 8:05 ` Darren Hart
2011-11-24 8:14 ` [RFC PATCH 0/5] EFI live image support Darren Hart
5 siblings, 0 replies; 18+ messages in thread
From: Darren Hart @ 2011-11-24 8:05 UTC (permalink / raw)
To: Richard Purdie, Koen Kooi, Chris Larson, Josef Ahmad,
openembedded-core
Cc: Darren Hart
Condition building PCBIOS legacy images on MACHINE_FEATURES containing "pcbios"
or not containing "efi". This ensures existing BSPs will continue to get the
old PCBIOS legacy-only images. New BSPs can add "efi", "pcbios", or both. The
images created likewise support one or the other or both.
EFI-only ISO images are untested.
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
meta/classes/bootimg.bbclass | 49 ++++++++++++++++++++++++++++++++++-------
1 files changed, 40 insertions(+), 9 deletions(-)
diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index 44bb61e..d2088fe 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -38,7 +38,24 @@ BOOTIMG_EXTRA_SPACE ?= "512"
EFI = ${@base_contains("MACHINE_FEATURES", "efi", "1", "0", d)}
EFI_CLASS = ${@base_contains("MACHINE_FEATURES", "efi", "grub-efi", "dummy", d)}
-inherit syslinux
+# Include legacy boot if MACHINE_FEATURES includes "pcbios" or if it does not
+# contain "efi". This way legacy is supported by default if neither is
+# specified, maintaining the original behavior.
+def pcbios(d):
+ pcbios = base_contains("MACHINE_FEATURES", "pcbios", "1", "0", d)
+ if pcbios == "0":
+ pcbios = base_contains("MACHINE_FEATURES", "efi", "0", "1", d)
+ return pcbios
+
+def pcbios_class(d):
+ if d.getVar("PCBIOS", True) == "1":
+ return "syslinux"
+ return "dummy"
+
+PCBIOS = ${@pcbios(d)}
+PCBIOS_CLASS = ${@pcbios_class(d)}
+
+inherit ${PCBIOS_CLASS}
inherit ${EFI_CLASS}
@@ -51,15 +68,24 @@ build_iso() {
install -d ${ISODIR}
- syslinux_iso_populate
+ if [ "${PCBIOS}" = "1" ]; then
+ syslinux_iso_populate
+ fi
if [ "${EFI}" = "1" ]; then
grubefi_iso_populate
fi
- mkisofs -V ${BOOTIMG_VOLUME_ID} \
- -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
- -b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} -r \
- ${MKISOFS_OPTIONS} ${ISODIR}
+ if [ "${PCBIOS}" = "1" ]; then
+ mkisofs -V ${BOOTIMG_VOLUME_ID} \
+ -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
+ -b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} -r \
+ ${MKISOFS_OPTIONS} ${ISODIR}
+ else
+ bbnote "EFI-only ISO images are untested, please provide feedback."
+ mkisofs -V ${BOOTIMG_VOLUME_ID} \
+ -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
+ -r ${ISODIR}
+ fi
cd ${DEPLOY_DIR_IMAGE}
rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
@@ -69,7 +95,9 @@ build_iso() {
build_hddimg() {
install -d ${HDDDIR}
- syslinux_hddimg_populate
+ if [ "${PCBIOS}" = "1" ]; then
+ syslinux_hddimg_populate
+ fi
if [ "${EFI}" = "1" ]; then
grubefi_hddimg_populate
fi
@@ -81,7 +109,9 @@ build_hddimg() {
mkdosfs -n ${BOOTIMG_VOLUME_ID} -d ${HDDDIR} \
-C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE
- syslinux_hddimg_install
+ if [ "${PCBIOS}" = "1" ]; then
+ syslinux_hddimg_install
+ fi
chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
@@ -91,7 +121,8 @@ build_hddimg() {
}
python do_bootimg() {
- bb.build.exec_func('build_syslinux_cfg', d)
+ if d.getVar("PCBIOS", True) == "1":
+ bb.build.exec_func('build_syslinux_cfg', d)
if d.getVar("EFI", True) == "1":
bb.build.exec_func('build_grub_cfg', d)
bb.build.exec_func('build_hddimg', d)
--
1.7.6.4
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [RFC PATCH 0/5] EFI live image support
2011-11-24 8:04 [RFC PATCH 0/5] EFI live image support Darren Hart
` (4 preceding siblings ...)
2011-11-24 8:05 ` [RFC PATCH 5/5] bootimg: Allow for EFI-only boot images Darren Hart
@ 2011-11-24 8:14 ` Darren Hart
5 siblings, 0 replies; 18+ messages in thread
From: Darren Hart @ 2011-11-24 8:14 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
Cc: Josh Lock, Koen Kooi, Chris Larson, Josef Ahmad, Wold, Saul
On 11/24/2011 12:04 AM, Darren Hart wrote:
>
> Thanks to Koen Kooi, Chris Larson, Richard Purdie, and Josef Ahmad for their
> contributions of expertise, code, and testing.
>
The problem of course with listing people, is that you are likely to
miss some. Especially at midnight prior to a major holiday. My apologies
to Saul Wold and Joshua Lock who also provided valuable assistance, as
well as the others whom I shall predictably recall promptly upon
pressing "Send".
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [RFC PATCH 1/5] grub-efi-native: New recipe to build GRUB EFI images
2011-11-24 8:05 ` [RFC PATCH 1/5] grub-efi-native: New recipe to build GRUB EFI images Darren Hart
@ 2011-11-24 8:59 ` Koen Kooi
2011-11-24 11:26 ` Richard Purdie
2011-11-25 22:57 ` Darren Hart
1 sibling, 1 reply; 18+ messages in thread
From: Koen Kooi @ 2011-11-24 8:59 UTC (permalink / raw)
To: Darren Hart; +Cc: Josef Ahmad, Chris Larson, openembedded-core
[-- Attachment #1: Type: text/plain, Size: 541 bytes --]
Op 24 nov. 2011, om 09:05 heeft Darren Hart het volgende geschreven:
> Add a recipe to build the GRUB efi images. This recipe is written as
> a native recipe as the resulting GRUB utils are required to assemble
> the final image. Rather than build a native and a target recipe (and
> increase build times),
That's a false dilemma. If you write it as a regular recipe with BBCLASSEXTEND=native your buildtime doesn't increase and you leave open the option of adding more BBCLASSEXTENDS if someone wants to ship it in an SDK.
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 169 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [RFC PATCH 1/5] grub-efi-native: New recipe to build GRUB EFI images
2011-11-24 8:59 ` Koen Kooi
@ 2011-11-24 11:26 ` Richard Purdie
2011-11-24 16:21 ` Darren Hart
2011-11-24 16:51 ` Koen Kooi
0 siblings, 2 replies; 18+ messages in thread
From: Richard Purdie @ 2011-11-24 11:26 UTC (permalink / raw)
To: Koen Kooi; +Cc: Josef Ahmad, Darren Hart, Chris Larson, openembedded-core
On Thu, 2011-11-24 at 09:59 +0100, Koen Kooi wrote:
> Op 24 nov. 2011, om 09:05 heeft Darren Hart het volgende geschreven:
>
> > Add a recipe to build the GRUB efi images. This recipe is written as
> > a native recipe as the resulting GRUB utils are required to assemble
> > the final image. Rather than build a native and a target recipe (and
> > increase build times),
>
> That's a false dilemma. If you write it as a regular recipe with
> BBCLASSEXTEND=native your buildtime doesn't increase
That isn't true, if you build a target and a native version your build
time does increase. Using BBCLASSEXTEND does improve parsing time over
having two separate recipes though.
> and you leave open the option of adding more BBCLASSEXTENDS if
> someone wants to ship it in an SDK.
I did talk with Darren about why the recipe is the way it is and there
are some pretty nasty issues with the way grub builds itself. I'm
therefore ok with this as a version 1 and we can see whether there are
any issues that result which need us to rethink the way the recipe is
constructed.
Its currently behaving very like the way the binutils/gcc cross recipes
will end up (see the separate thread with Matthew) Perhaps it should be
called grub-efi-cross even if it uses native.bbclass.
Cheers,
Richard
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [RFC PATCH 1/5] grub-efi-native: New recipe to build GRUB EFI images
2011-11-24 11:26 ` Richard Purdie
@ 2011-11-24 16:21 ` Darren Hart
2011-11-24 16:51 ` Koen Kooi
1 sibling, 0 replies; 18+ messages in thread
From: Darren Hart @ 2011-11-24 16:21 UTC (permalink / raw)
To: Richard Purdie; +Cc: Josef Ahmad, Koen Kooi, Chris Larson, openembedded-core
On 11/24/2011 03:26 AM, Richard Purdie wrote:
> On Thu, 2011-11-24 at 09:59 +0100, Koen Kooi wrote:
>> Op 24 nov. 2011, om 09:05 heeft Darren Hart het volgende geschreven:
>>
>>> Add a recipe to build the GRUB efi images. This recipe is written as
>>> a native recipe as the resulting GRUB utils are required to assemble
>>> the final image. Rather than build a native and a target recipe (and
>>> increase build times),
>>
>> That's a false dilemma. If you write it as a regular recipe with
>> BBCLASSEXTEND=native your buildtime doesn't increase
>
> That isn't true, if you build a target and a native version your build
> time does increase. Using BBCLASSEXTEND does improve parsing time over
> having two separate recipes though.
Right, while it isn't a huge project to build, I didn't want to
contribute to the expanding build time unnecessarily.
>
>> and you leave open the option of adding more BBCLASSEXTENDS if
>> someone wants to ship it in an SDK.
I think the right thing to do here is to modify the origin grub recipe
to build with the efi platform enabled if we want to ship the binaries
on the TARGET. This recipe doesn't build the grub tools for deployment,
it builds the target bootloader binary image for the boot media. That's
the distinction I'm going with anyway.
>
> I did talk with Darren about why the recipe is the way it is and there
> are some pretty nasty issues with the way grub builds itself. I'm
> therefore ok with this as a version 1 and we can see whether there are
> any issues that result which need us to rethink the way the recipe is
> constructed.
>
> Its currently behaving very like the way the binutils/gcc cross recipes
> will end up (see the separate thread with Matthew) Perhaps it should be
> called grub-efi-cross even if it uses native.bbclass.
If you prefer I can change it, I don't have a strong preference for the
name. That would end up as "grub-efi-${TRANSLATED_TARGET_ARCH}-cross"
after the PN adjustment then?
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [RFC PATCH 1/5] grub-efi-native: New recipe to build GRUB EFI images
2011-11-24 11:26 ` Richard Purdie
2011-11-24 16:21 ` Darren Hart
@ 2011-11-24 16:51 ` Koen Kooi
2011-11-24 17:14 ` Darren Hart
1 sibling, 1 reply; 18+ messages in thread
From: Koen Kooi @ 2011-11-24 16:51 UTC (permalink / raw)
To: Richard Purdie; +Cc: Josef Ahmad, Darren Hart, Chris Larson, openembedded-core
[-- Attachment #1: Type: text/plain, Size: 930 bytes --]
Op 24 nov. 2011, om 12:26 heeft Richard Purdie het volgende geschreven:
> On Thu, 2011-11-24 at 09:59 +0100, Koen Kooi wrote:
>> Op 24 nov. 2011, om 09:05 heeft Darren Hart het volgende geschreven:
>>
>>> Add a recipe to build the GRUB efi images. This recipe is written as
>>> a native recipe as the resulting GRUB utils are required to assemble
>>> the final image. Rather than build a native and a target recipe (and
>>> increase build times),
>>
>> That's a false dilemma. If you write it as a regular recipe with
>> BBCLASSEXTEND=native your buildtime doesn't increase
>
> That isn't true, if you build a target and a native version your build
> time does increase. Using BBCLASSEXTEND does improve parsing time over
> having two separate recipes though.
Are you really saying that 'bitbake grub-native' will build both versions if you use BBCLASSEXTEND!?!?! If not, it remains a false dilemma.
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 169 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [RFC PATCH 1/5] grub-efi-native: New recipe to build GRUB EFI images
2011-11-24 16:51 ` Koen Kooi
@ 2011-11-24 17:14 ` Darren Hart
0 siblings, 0 replies; 18+ messages in thread
From: Darren Hart @ 2011-11-24 17:14 UTC (permalink / raw)
To: Koen Kooi; +Cc: Josef Ahmad, Chris Larson, openembedded-core
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 11/24/2011 08:51 AM, Koen Kooi wrote:
>
> Op 24 nov. 2011, om 12:26 heeft Richard Purdie het volgende
> geschreven:
>
>> On Thu, 2011-11-24 at 09:59 +0100, Koen Kooi wrote:
>>> Op 24 nov. 2011, om 09:05 heeft Darren Hart het volgende
>>> geschreven:
>>>
>>>> Add a recipe to build the GRUB efi images. This recipe is
>>>> written as a native recipe as the resulting GRUB utils are
>>>> required to assemble the final image. Rather than build a
>>>> native and a target recipe (and increase build times),
>>>
>>> That's a false dilemma. If you write it as a regular recipe
>>> with BBCLASSEXTEND=native your buildtime doesn't increase
>>
>> That isn't true, if you build a target and a native version your
>> build time does increase. Using BBCLASSEXTEND does improve
>> parsing time over having two separate recipes though.
>
> Are you really saying that 'bitbake grub-native' will build both
> versions if you use BBCLASSEXTEND!?!?! If not, it remains a false
> dilemma.
No, that isn't it. Because of the way grub builds, you need the utils
in HOST_ARCH and the grub modules in TARGET_ARCH. Grub has a
monolithic build system, so in order to do this with BBCLASSEXTEND, we
would need to have grub-efi depend on grub-efi-native so that the
final do_mkimage task could use the -native version of grub-mkimage to
assemble the target-built modules into a final binary.
This approach builds grub natively and sets the --target to the
TARGET_ARCH so the modules are built for the target. This is why I'm
making the distinction between build the grub tools for deployment and
building the grub efi boot image. The approach to each is different,
and this recipe generates the boot image for the target.
- --
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJOznttAAoJEKbMaAwKp364dG0H/0tScwNt0pc9gHDXDELdhCvp
JGJ8soO+yWgksG9o/p077oysd7HMm24Tq//m7FuRzgm0D2JymYwPwdLe06mA1ARs
BpwtvltUW5SLaWzJVeamxeNn5cDpdIcyaa904BdS2Ink/alZgTdoV60qh9LvElIh
P70Pb/GeV/Po5OLALmnYuEV39JPnRxz7RfaXr7qU/0e0JVGKxXa/hrBp8ZgzpYI4
WvGns2LrZRPi/Fp93Vc312NfZYa2y/s9H8ji+B2Nvdza99Zo9y4xtWSf9bDRn+4J
04Kw/CFUe4GqXrIoBATLvm8LmcS/fLaqtVY5Ewz5bSnPFRvXyYApmmNvWpy5hGs=
=LaXk
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [RFC PATCH 1/5] grub-efi-native: New recipe to build GRUB EFI images
2011-11-24 8:05 ` [RFC PATCH 1/5] grub-efi-native: New recipe to build GRUB EFI images Darren Hart
2011-11-24 8:59 ` Koen Kooi
@ 2011-11-25 22:57 ` Darren Hart
2011-11-29 8:03 ` Darren Hart
1 sibling, 1 reply; 18+ messages in thread
From: Darren Hart @ 2011-11-25 22:57 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
Cc: Josef Ahmad, Koen Kooi, Chris Larson
On 11/24/2011 12:05 AM, Darren Hart wrote:
> Add a recipe to build the GRUB efi images. This recipe is written as
> a native recipe as the resulting GRUB utils are required to assemble
> the final image. Rather than build a native and a target recipe (and
> increase build times), this recipe builds the utils for the host and
> passes an appropriate --target argument to the GRUB configure script
> to build the modules for the target arch. The only output of this
> recipe is an EFI image in the deploy directory.
The grub-help list came through with an alternative approach:
"./configure CC=powerpc-linux-gcc --host=ppc-linux-gnu --target=i386
--with-platform=pc TARGET_CC=i386-linux-gcc"
This would allow for building on a host of arch ppc for a target of arch
i386.
Would it be preferable then to build this as a target package and
manipuate the configure flags to use the BUILD_CC ? I presume a similar
PN rename would be desirable to account for the HOST component of the
build as I used here for the TARGET on the -native version?
--
Darren
>
> Care is taken to ensure changing targets will force a rebuild of this
> native recipe by including the target arch in the PN.
>
> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
> ---
> meta/recipes-bsp/grub/grub-efi-native_1.99.bb | 74 +++++++++++++++++++++++++
> 1 files changed, 74 insertions(+), 0 deletions(-)
> create mode 100644 meta/recipes-bsp/grub/grub-efi-native_1.99.bb
>
> diff --git a/meta/recipes-bsp/grub/grub-efi-native_1.99.bb b/meta/recipes-bsp/grub/grub-efi-native_1.99.bb
> new file mode 100644
> index 0000000..3c52ec9
> --- /dev/null
> +++ b/meta/recipes-bsp/grub/grub-efi-native_1.99.bb
> @@ -0,0 +1,74 @@
> +SUMMARY = "GRUB2 is the next-generation GRand Unified Bootloader"
> +
> +DESCRIPTION = "GRUB2 is the next generaion of a GPLed bootloader \
> +intended to unify bootloading across x86 operating systems. In \
> +addition to loading the Linux kernel, it implements the Multiboot \
> +standard, which allows for flexible loading of multiple boot images. \
> +This recipe builds an EFI binary for the target. It does not install \
> +or package anything, it only deploys a target-arch GRUB EFI image."
> +
> +HOMEPAGE = "http://www.gnu.org/software/grub/"
> +SECTION = "bootloaders"
> +PRIORITY = "optional"
> +
> +LICENSE = "GPLv3"
> +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"
> +
> +# Native packages do not normally rebuild when the target changes.
> +# Ensure this is built once per HOST-TARGET pair.
> +PN := "grub-efi-${TRANSLATED_TARGET_ARCH}-native"
> +
> +SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz"
> +
> +SRC_URI[md5sum] = "ca9f2a2d571b57fc5c53212d1d22e2b5"
> +SRC_URI[sha256sum] = "b91f420f2c51f6155e088e34ff99bea09cc1fb89585cf7c0179644e57abd28ff"
> +
> +COMPATIBLE_HOST = '(x86_64.*|i.86.*)-(linux|freebsd.*)'
> +
> +S = "${WORKDIR}/grub-${PV}"
> +
> +# Determine the target arch for the grub modules before the native class
> +# clobbers TARGET_ARCH.
> +ORIG_TARGET_ARCH := ${TARGET_ARCH}
> +python __anonymous () {
> + import re
> + target = d.getVar('ORIG_TARGET_ARCH', True)
> + if target == "x86_64":
> + grubtarget = 'x86_64'
> + grubimage = "bootx64.efi"
> + elif re.match('i.86', target):
> + grubtarget = 'i386'
> + grubimage = "bootia32.efi"
> + else:
> + raise bb.parse.SkipPackage("grub-efi is incompatible with target %s" % target)
> + d.setVar("GRUB_TARGET", grubtarget)
> + d.setVar("GRUB_IMAGE", grubimage)
> +}
> +
> +inherit autotools
> +inherit gettext
> +inherit native
> +inherit deploy
> +
> +EXTRA_OECONF = "--with-platform=efi --disable-grub-mkfont \
> + --target=${GRUB_TARGET} --enable-efiemu=no --program-prefix=''"
> +
> +do_mkimage() {
> + ./grub-mkimage -p / -d ./grub-core/ \
> + -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \
> + boot linux fat serial part_msdos normal
> +}
> +addtask mkimage after do_compile before do_install
> +
> +do_deploy() {
> + install -m 644 ${S}/${GRUB_IMAGE} ${DEPLOYDIR}
> +}
> +addtask deploy after do_install before do_build
> +
> +do_install[noexec] = "1"
> +do_populate_sysroot[noexec] = "1"
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [RFC PATCH 1/5] grub-efi-native: New recipe to build GRUB EFI images
2011-11-25 22:57 ` Darren Hart
@ 2011-11-29 8:03 ` Darren Hart
2011-11-29 8:22 ` Koen Kooi
0 siblings, 1 reply; 18+ messages in thread
From: Darren Hart @ 2011-11-29 8:03 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
Cc: Josef Ahmad, Koen Kooi, Chris Larson
On 11/25/2011 02:57 PM, Darren Hart wrote:
>
>
> On 11/24/2011 12:05 AM, Darren Hart wrote:
>> Add a recipe to build the GRUB efi images. This recipe is written as
>> a native recipe as the resulting GRUB utils are required to assemble
>> the final image. Rather than build a native and a target recipe (and
>> increase build times), this recipe builds the utils for the host and
>> passes an appropriate --target argument to the GRUB configure script
>> to build the modules for the target arch. The only output of this
>> recipe is an EFI image in the deploy directory.
>
> The grub-help list came through with an alternative approach:
>
> "./configure CC=powerpc-linux-gcc --host=ppc-linux-gnu --target=i386
> --with-platform=pc TARGET_CC=i386-linux-gcc"
>
> This would allow for building on a host of arch ppc for a target of arch
> i386.
>
> Would it be preferable then to build this as a target package and
> manipuate the configure flags to use the BUILD_CC ? I presume a similar
> PN rename would be desirable to account for the HOST component of the
> build as I used here for the TARGET on the -native version?
I have been working on trying to get this working as a target recipe. I've
resolved a number of issues, but something is still biting me and I haven't been
able to sort out what. I would really appreciate a few more sets of eyes on
this.
I have pushed my dvhart/efi/dev branch to poky-contrib for reference:
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/?h=dvhart/efi/dev
When building this recipe, the mkimage task fails with the grub-mkimage command
segfaulting. I can build with the same ./configure command and using the Yocto
1.1 x86_64-i586 toolchain for the TARGET_CC and the mkimage succeeds. The
configure command is:
./configure --build=x86_64-linux --host=x86_64-linux --target=i586-poky-linux --prefix=/usr --exec_prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec --datadir=/usr/share --sysconfdir=/etc --sharedstatedir=/com --localstatedir=/var --libdir=/usr/lib --includedir=/usr/include --oldincludedir=/usr/include --infodir=/usr/share/info --mandir=/usr/share/man --disable-silent-rules --with-libtool-sysroot=/build/poky/n450/tmp/sysroots/n450 CC=gcc TARGET_CC=i586-poky-linux-gcc --with-platform=efi --enable-efiemu=no --disable-grub-mkfont --program-prefix='' --enable-nls
The make output from building manually vs. within bitbake is nearly identical
with a couple minor path changes for the cross toolchain. The bitbake make also
prints more errors, including the following for the grub-mkimage target (which
is the one that segfaults).
gcc -DHAVE_CONFIG_H -I. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EFI=1 -DGRUB_MACHINE=I386_EFI -DGRUB_FILE=\"util/grub-mkimage.c\" -I. -I. -I. -I. -I./include -I./include -I./grub-core/gnulib -I./grub-core/gnulib -DGRUB_PKGLIBROOTDIR=\"/usr/lib/''grub\" -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -MT util/grub_mkimage-grub-mkimage.o -MD -MP -MF util/.deps-util/grub_mkimage-grub-mkimage.Tpo -c -o util/grub_mkimage-grub-mkimage.o `test -f 'util/grub-mkimage.c' || echo './'`util/grub-mkimage.c
util/grub-mkimage.c: In function 'generate_image':
util/grub-mkimage.c:665:11: warning: passing argument 2 of 'load_image32' from incompatible pointer type [enabled by default]
util/grub-mkimagexx.c:601:1: note: expected 'grub_size_t *' but argument is of type 'size_t *'
util/grub-mkimage.c:665:11: warning: passing argument 3 of 'load_image32' from incompatible pointer type [enabled by default]
util/grub-mkimagexx.c:601:1: note: expected 'grub_size_t *' but argument is of type 'size_t *'
util/grub-mkimage.c:669:11: warning: passing argument 2 of 'load_image64' from incompatible pointer type [enabled by default]
util/grub-mkimagexx.c:601:1: note: expected 'grub_size_t *' but argument is of type 'size_t *'
util/grub-mkimage.c:669:11: warning: passing argument 3 of 'load_image64' from incompatible pointer type [enabled by default]
util/grub-mkimagexx.c:601:1: note: expected 'grub_size_t *' but argument is of type 'size_t *'
The recipe follows for your reference and for inline comments. Any thoughts on
why this might be failing? Is there are better way to go about trying to build
this as a target recipe?
grub-efi_1.99.bb
----------------
SUMMARY = "GRUB2 is the next-generation GRand Unified Bootloader"
DESCRIPTION = "GRUB2 is the next generaion of a GPLed bootloader \
intended to unify bootloading across x86 operating systems. In \
addition to loading the Linux kernel, it implements the Multiboot \
standard, which allows for flexible loading of multiple boot images. \
This recipe builds an EFI binary for the target. It does not install \
or package anything, it only deploys a target-arch GRUB EFI image."
HOMEPAGE = "http://www.gnu.org/software/grub/"
SECTION = "bootloaders"
PRIORITY = "optional"
LICENSE = "GPLv3"
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"
# FIXME: make this use build arch too?
# Native packages do not normally rebuild when the target changes.
# Ensure this is built once per HOST-TARGET pair.
PN := "grub-efi"
SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz"
SRC_URI[md5sum] = "ca9f2a2d571b57fc5c53212d1d22e2b5"
SRC_URI[sha256sum] = "b91f420f2c51f6155e088e34ff99bea09cc1fb89585cf7c0179644e57abd28ff"
COMPATIBLE_HOST = '(x86_64.*|i.86.*)-(linux|freebsd.*)'
S = "${WORKDIR}/grub-${PV}"
inherit autotools
inherit gettext
inherit deploy
#inherit cross
# Translate machine arches to grub arch values
python __anonymous () {
import re
target = d.getVar("TARGET_ARCH", True)
if target == "x86_64":
grubtarget = "x86_64"
grubimage = "bootx64.efi"
elif re.match("i.86", target):
grubtarget = "i386"
grubimage = "bootia32.efi"
else:
raise bb.parse.SkipPackage("grub-efi is incompatible with target %s" % target)
d.setVar("GRUB_TARGET", grubtarget)
d.setVar("GRUB_IMAGE", grubimage)
host = d.getVar("BUILD_ARCH", True)
if re.match("x86_64", host):
hostarch = "x86_64"
elif re.match("i.86", host):
hostarch = "i386"
else:
# This should have been caught by COMPATIBLE_HOST above
bb.error("grub-efi is incompatible with host %s" % host)
d.setVar("GRUB_HOST", host)
}
# Build utils for the host and modules and images for the target:
# ./configure CC=powerpc-linux-gcc --host=ppc-linux-gnu --target=i386 \
# --with-platform=efi TARGET_CC=i386-linux-gcc
#EXTRA_OECONF = "CC=${BUILD_PREFIX}gcc --host=${GRUB_HOST} RANLIB=${BUILD_RANLIB} \
# TARGET_CC=${TARGET_PREFIX}gcc --target=${GRUB_TARGET} \
# --with-platform=efi --enable-efiemu=no \
# --disable-grub-mkfont --program-prefix=''"
#HOST_ARCH = "${BUILD_ARCH}"
#HOST_VENDOR = "${BUILD_VENDOR}"
#HOST_OS = "${BUILD_OS}"
#HOST_PREFIX = "${BUILD_PREFIX}"
#HOST_CC_ARCH = "${BUILD_CC_ARCH}"
#HOST_LD_ARCH = "${BUILD_LD_ARCH}"
#HOST_AS_ARCH = "${BUILD_AS_ARCH}"
SELECTED_OPTIMIZATION=""
FULL_OPTIMIZATION=""
CPP="${BUILD_PREFIX}gcc -E"
HOST_SYS="${BUILD_SYS}"
RANLIB="${BUILD_PREFIX}ranlib"
#LDFLAGS=""
ASNEEDED=""
TARGET_LINK_HASH_STYLE=""
TARGET_LDFLAGS=""
EXTRA_OECONF = "CC=${BUILD_PREFIX}gcc \
TARGET_CC=${TARGET_PREFIX}gcc \
--with-platform=efi --enable-efiemu=no \
--disable-grub-mkfont --program-prefix=''"
do_mkimage() {
./grub-mkimage -p / -d ./grub-core/ \
-O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \
boot linux fat serial part_msdos normal
}
do_compile(){
# export CFLAGS="-Os"
# export TARGET_CFLAGS="-Os"
# export CC="${BUILD_PREFIX}gcc"
bbnote "CC=${CC}"
bbnote "CFLAGS=${CFLAGS}"
bbnote "TARGET_CFLAGS=${TARGET_CFLAGS}"
bbnote "RANLIB=${RANLIB}"
bbnote "gcc=$(which gcc)"
oe_runmake
}
addtask mkimage after do_compile before do_install
do_deploy() {
install -m 644 ${S}/${GRUB_IMAGE} ${DEPLOYDIR}
}
addtask deploy after do_install before do_build
do_install[noexec] = "1"
do_populate_sysroot[noexec] = "1"
--
Thanks,
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [RFC PATCH 1/5] grub-efi-native: New recipe to build GRUB EFI images
2011-11-29 8:03 ` Darren Hart
@ 2011-11-29 8:22 ` Koen Kooi
2011-11-29 8:58 ` Darren Hart
0 siblings, 1 reply; 18+ messages in thread
From: Koen Kooi @ 2011-11-29 8:22 UTC (permalink / raw)
To: Darren Hart
Cc: Josef Ahmad, Chris Larson,
Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 1835 bytes --]
Op 29 nov. 2011, om 09:03 heeft Darren Hart het volgende geschreven:
> On 11/25/2011 02:57 PM, Darren Hart wrote:
>>
>>
>> On 11/24/2011 12:05 AM, Darren Hart wrote:
>>> Add a recipe to build the GRUB efi images. This recipe is written as
>>> a native recipe as the resulting GRUB utils are required to assemble
>>> the final image. Rather than build a native and a target recipe (and
>>> increase build times), this recipe builds the utils for the host and
>>> passes an appropriate --target argument to the GRUB configure script
>>> to build the modules for the target arch. The only output of this
>>> recipe is an EFI image in the deploy directory.
>>
>> The grub-help list came through with an alternative approach:
>>
>> "./configure CC=powerpc-linux-gcc --host=ppc-linux-gnu --target=i386
>> --with-platform=pc TARGET_CC=i386-linux-gcc"
>>
>> This would allow for building on a host of arch ppc for a target of arch
>> i386.
>>
>> Would it be preferable then to build this as a target package and
>> manipuate the configure flags to use the BUILD_CC ? I presume a similar
>> PN rename would be desirable to account for the HOST component of the
>> build as I used here for the TARGET on the -native version?
>
> I have been working on trying to get this working as a target recipe. I've
> resolved a number of issues, but something is still biting me and I haven't been
> able to sort out what. I would really appreciate a few more sets of eyes on
> this.
>
> I have pushed my dvhart/efi/dev branch to poky-contrib for reference:
>
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/?h=dvhart/efi/dev
>
> When building this recipe
This is against poky, so I can't build it. If it was against OE-core, like one would expect on the OE-core mailing list, I could build it.
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 169 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [RFC PATCH 1/5] grub-efi-native: New recipe to build GRUB EFI images
2011-11-29 8:22 ` Koen Kooi
@ 2011-11-29 8:58 ` Darren Hart
2011-11-29 9:16 ` Koen Kooi
0 siblings, 1 reply; 18+ messages in thread
From: Darren Hart @ 2011-11-29 8:58 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
Cc: Josef Ahmad, Koen Kooi, Chris Larson
On 11/29/2011 12:22 AM, Koen Kooi wrote:
>
> Op 29 nov. 2011, om 09:03 heeft Darren Hart het volgende geschreven:
>
>> On 11/25/2011 02:57 PM, Darren Hart wrote:
>>>
>>>
>>> On 11/24/2011 12:05 AM, Darren Hart wrote:
>>>> Add a recipe to build the GRUB efi images. This recipe is written as
>>>> a native recipe as the resulting GRUB utils are required to assemble
>>>> the final image. Rather than build a native and a target recipe (and
>>>> increase build times), this recipe builds the utils for the host and
>>>> passes an appropriate --target argument to the GRUB configure script
>>>> to build the modules for the target arch. The only output of this
>>>> recipe is an EFI image in the deploy directory.
>>>
>>> The grub-help list came through with an alternative approach:
>>>
>>> "./configure CC=powerpc-linux-gcc --host=ppc-linux-gnu --target=i386
>>> --with-platform=pc TARGET_CC=i386-linux-gcc"
>>>
>>> This would allow for building on a host of arch ppc for a target of arch
>>> i386.
>>>
>>> Would it be preferable then to build this as a target package and
>>> manipuate the configure flags to use the BUILD_CC ? I presume a similar
>>> PN rename would be desirable to account for the HOST component of the
>>> build as I used here for the TARGET on the -native version?
>>
>> I have been working on trying to get this working as a target recipe. I've
>> resolved a number of issues, but something is still biting me and I haven't been
>> able to sort out what. I would really appreciate a few more sets of eyes on
>> this.
>>
>> I have pushed my dvhart/efi/dev branch to poky-contrib for reference:
>>
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/?h=dvhart/efi/dev
>>
>> When building this recipe
>
> This is against poky, so I can't build it. If it was against
> OE-core, like one would expect on the OE-core mailing list,
> I could build it.
OK, fair enough.
git://git.infradead.org/srv/git/users/dvhart/oe-core.git dvhart/efi/dev
I just fixed up the patch series - untested.
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [RFC PATCH 1/5] grub-efi-native: New recipe to build GRUB EFI images
2011-11-29 8:58 ` Darren Hart
@ 2011-11-29 9:16 ` Koen Kooi
2011-11-29 9:19 ` Darren Hart
0 siblings, 1 reply; 18+ messages in thread
From: Koen Kooi @ 2011-11-29 9:16 UTC (permalink / raw)
To: Darren Hart
Cc: Josef Ahmad, Chris Larson,
Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 2303 bytes --]
Op 29 nov. 2011, om 09:58 heeft Darren Hart het volgende geschreven:
>
>
> On 11/29/2011 12:22 AM, Koen Kooi wrote:
>>
>> Op 29 nov. 2011, om 09:03 heeft Darren Hart het volgende geschreven:
>>
>>> On 11/25/2011 02:57 PM, Darren Hart wrote:
>>>>
>>>>
>>>> On 11/24/2011 12:05 AM, Darren Hart wrote:
>>>>> Add a recipe to build the GRUB efi images. This recipe is written as
>>>>> a native recipe as the resulting GRUB utils are required to assemble
>>>>> the final image. Rather than build a native and a target recipe (and
>>>>> increase build times), this recipe builds the utils for the host and
>>>>> passes an appropriate --target argument to the GRUB configure script
>>>>> to build the modules for the target arch. The only output of this
>>>>> recipe is an EFI image in the deploy directory.
>>>>
>>>> The grub-help list came through with an alternative approach:
>>>>
>>>> "./configure CC=powerpc-linux-gcc --host=ppc-linux-gnu --target=i386
>>>> --with-platform=pc TARGET_CC=i386-linux-gcc"
>>>>
>>>> This would allow for building on a host of arch ppc for a target of arch
>>>> i386.
>>>>
>>>> Would it be preferable then to build this as a target package and
>>>> manipuate the configure flags to use the BUILD_CC ? I presume a similar
>>>> PN rename would be desirable to account for the HOST component of the
>>>> build as I used here for the TARGET on the -native version?
>>>
>>> I have been working on trying to get this working as a target recipe. I've
>>> resolved a number of issues, but something is still biting me and I haven't been
>>> able to sort out what. I would really appreciate a few more sets of eyes on
>>> this.
>>>
>>> I have pushed my dvhart/efi/dev branch to poky-contrib for reference:
>>>
>>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/?h=dvhart/efi/dev
>>>
>>> When building this recipe
>>
>> This is against poky, so I can't build it. If it was against
>> OE-core, like one would expect on the OE-core mailing list,
>> I could build it.
>
> OK, fair enough.
>
> git://git.infradead.org/srv/git/users/dvhart/oe-core.git dvhart/efi/dev
I get:
$ git fetch git://git.infradead.org/srv/git/users/dvhart/oe-core.git
fatal: The remote end hung up unexpectedly
regards,
Koen
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 169 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [RFC PATCH 1/5] grub-efi-native: New recipe to build GRUB EFI images
2011-11-29 9:16 ` Koen Kooi
@ 2011-11-29 9:19 ` Darren Hart
0 siblings, 0 replies; 18+ messages in thread
From: Darren Hart @ 2011-11-29 9:19 UTC (permalink / raw)
To: Koen Kooi
Cc: Josef Ahmad, Chris Larson,
Patches and discussions about the oe-core layer
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 11/29/2011 01:16 AM, Koen Kooi wrote:
>
> Op 29 nov. 2011, om 09:58 heeft Darren Hart het volgende
> geschreven:
>
>>
>>
>> On 11/29/2011 12:22 AM, Koen Kooi wrote:
>>>
>>> Op 29 nov. 2011, om 09:03 heeft Darren Hart het volgende
>>> geschreven:
>>>
>>>> On 11/25/2011 02:57 PM, Darren Hart wrote:
>>>>>
>>>>>
>>>>> On 11/24/2011 12:05 AM, Darren Hart wrote:
>>>>>> Add a recipe to build the GRUB efi images. This recipe is
>>>>>> written as a native recipe as the resulting GRUB utils
>>>>>> are required to assemble the final image. Rather than
>>>>>> build a native and a target recipe (and increase build
>>>>>> times), this recipe builds the utils for the host and
>>>>>> passes an appropriate --target argument to the GRUB
>>>>>> configure script to build the modules for the target
>>>>>> arch. The only output of this recipe is an EFI image in
>>>>>> the deploy directory.
>>>>>
>>>>> The grub-help list came through with an alternative
>>>>> approach:
>>>>>
>>>>> "./configure CC=powerpc-linux-gcc --host=ppc-linux-gnu
>>>>> --target=i386 --with-platform=pc TARGET_CC=i386-linux-gcc"
>>>>>
>>>>> This would allow for building on a host of arch ppc for a
>>>>> target of arch i386.
>>>>>
>>>>> Would it be preferable then to build this as a target
>>>>> package and manipuate the configure flags to use the
>>>>> BUILD_CC ? I presume a similar PN rename would be desirable
>>>>> to account for the HOST component of the build as I used
>>>>> here for the TARGET on the -native version?
>>>>
>>>> I have been working on trying to get this working as a target
>>>> recipe. I've resolved a number of issues, but something is
>>>> still biting me and I haven't been able to sort out what. I
>>>> would really appreciate a few more sets of eyes on this.
>>>>
>>>> I have pushed my dvhart/efi/dev branch to poky-contrib for
>>>> reference:
>>>>
>>>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/?h=dvhart/efi/dev
>>>>
>>>>
>>>>
When building this recipe
>>>
>>> This is against poky, so I can't build it. If it was against
>>> OE-core, like one would expect on the OE-core mailing list, I
>>> could build it.
>>
>> OK, fair enough.
>>
>> git://git.infradead.org/srv/git/users/dvhart/oe-core.git
>> dvhart/efi/dev
>
> I get:
>
> $ git fetch
> git://git.infradead.org/srv/git/users/dvhart/oe-core.git fatal: The
> remote end hung up unexpectedly
>
Grmble... too late... too rushed... too many copy buffers. Sorry about
that:
git://git.infradead.org/users/dvhart/oe-core.git dvhart/efi/dev
- --
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJO1KO/AAoJEKbMaAwKp364F3QH/iwqj6yfAuMfX1XNWFmvC+Pr
yreEjQMz6n7LjN47svDZb0vTjiUTufdE6peIez1j2WZV5riXA4qePwXHa562zN1e
bsBYH3pjJ87CYZ9Hyg2jdGX7VSeJGpX+dkKggucg0VwzU5MJOM1E0cwKIhfyG3Ja
ytqDhQQXlTQfwHqFkKI1yp7usXDjLZc/OS/nOgNan5x2RVBnfXug33E02Y7yhldW
yRIa0aoCk8LdKGj+PdOVAiHMjXA67KxO16P0Moqk4K3lSV34GBZmSNYT9Mmpk9AV
nFoaxIKYZdaBqLg7i6wyM/g8U0qVajdE3koAj2Hy/KPHXaU/nhiUx9vYg09yyw8=
=e2h9
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2011-11-29 9:26 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-24 8:04 [RFC PATCH 0/5] EFI live image support Darren Hart
2011-11-24 8:05 ` [RFC PATCH 1/5] grub-efi-native: New recipe to build GRUB EFI images Darren Hart
2011-11-24 8:59 ` Koen Kooi
2011-11-24 11:26 ` Richard Purdie
2011-11-24 16:21 ` Darren Hart
2011-11-24 16:51 ` Koen Kooi
2011-11-24 17:14 ` Darren Hart
2011-11-25 22:57 ` Darren Hart
2011-11-29 8:03 ` Darren Hart
2011-11-29 8:22 ` Koen Kooi
2011-11-29 8:58 ` Darren Hart
2011-11-29 9:16 ` Koen Kooi
2011-11-29 9:19 ` Darren Hart
2011-11-24 8:05 ` [RFC PATCH 2/5] bootimg: Refactor build_hddimg and build_iso routines Darren Hart
2011-11-24 8:05 ` [RFC PATCH 3/5] bootimg: Pull syslinux specific bits into syslinux.bbclass Darren Hart
2011-11-24 8:05 ` [RFC PATCH 4/5] bootimg: Add grub-efi support Darren Hart
2011-11-24 8:05 ` [RFC PATCH 5/5] bootimg: Allow for EFI-only boot images Darren Hart
2011-11-24 8:14 ` [RFC PATCH 0/5] EFI live image support Darren Hart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox