Openembedded Core Discussions
 help / color / mirror / Atom feed
* [v2 PATCH 0/7] Improved EFI boot support
@ 2013-09-14  0:08 Jason Wessel
  2013-09-14  0:08 ` [v2 PATCH 1/7] bootimage.bbclass: Move fat image creation into a function Jason Wessel
                   ` (6 more replies)
  0 siblings, 7 replies; 21+ messages in thread
From: Jason Wessel @ 2013-09-14  0:08 UTC (permalink / raw)
  To: Openembedded-core; +Cc: dvhart

V2
- Added reference to YOCTO #1913 for per Darren
- Remove PR number from cdrtools uprev
- Added Saul's change to cdrtools to get rid of STAGE_TEMP
- made the builtin grub cfg file copied from a SRC_URI
- upreved syslinux to 6.01
- Use the new isohybrid command from syslinux which can now
  generate EFI enabled ISO's which can boot directly when
  dd'ed to a USB or HDD device.
- Dropped any references to efi or pcbios in the qemu* configs
- Added the zisofs patch to the end of the series instead
  of depending on it, in case it is dropped later.
- git -format-patch -M20% is your friend for seeing the
  delta on recipe upgrades :-)

YAY, with the new version of syslinux it is now possible to
build a single live ISO image which can boot in legacy mode
or EFI on optical media or USB devices.

We still have to create 2 ISO's one for 32bit EFI systems and one for
64bit EFI systems but this is also true of all other Linux
distributions today as well.

Jason.

---

The goal of this patch set is to put the EFI ISO boot method on par
with the ISO PCBIOS boot method.  This also allows for the creation of
a single ISO image which can boot in "legacy boot" mode or EFI boot
mode.

In order to make this possible the cdrtools needed an update to the
very latest and this brings in an license change.  Given that change
it was not entirely clear to me if we needed to leave the older
package around.  I opted to remove the older package recipe since
there was no clean way to fail in the case you wanted to build EFI
boot media.

The bbnote that was previously in the bootimg.bbclass about EFI only
media being untested was a bit of an understatement, as the images
would not even build without errors due to the call to isohybrid.  I
removed any such warnings because that path has been fully vetted now.

Cheers,
Jason.


----------------------------------------------------------------

The following changes since commit b26157a8b575aa7b5c96ffe782fc23ec0920311c:

  libnewt-python: Don't write a whiptail package (2013-09-12 08:23:35 +0100)

are available in the git repository at:

  . master

for you to fetch changes up to a0d1b567277fdf370cc121720c0c4f30839da01b:

  bootimage.bbclass, zisofs-tools-native: add ability to compress ISO images (2013-09-13 19:05:37 -0500)

----------------------------------------------------------------
Jason Wessel (7):
      bootimage.bbclass: Move fat image creation into a function
      cdrtools-native: Update from 3.00 to 3.01a17
      grub-efi-native: Add support for EFI ISO images
      syslinux.bbclass,syslinux: Update to syslinux 6.01
      bootimage.bbclass,grub-efi.bbclass: Improve EFI & PCBIOS+EFI ISO support
      grub-efi.bbclass: Add serial and graphics menu options
      bootimage.bbclass, zisofs-tools-native: add ability to compress ISO images

 meta/classes/bootimg.bbclass                       |  165 ++++++++++++--------
 meta/classes/grub-efi.bbclass                      |   49 ++++--
 meta/classes/syslinux.bbclass                      |    1 +
 meta/recipes-bsp/grub/files/cfg                    |    2 +
 meta/recipes-bsp/grub/grub-efi-native_2.00.bb      |    7 +-
 .../cdrtools/cdrtools-native_3.00.bb               |   30 ----
 .../cdrtools/cdrtools-native_3.01a17.bb            |   24 +++
 .../{syslinux_4.07.bb => syslinux_6.01.bb}         |   26 +--
 .../zisofs-tools/zisofs-tools-native_1.0.8.bb      |   19 +++
 9 files changed, 201 insertions(+), 122 deletions(-)
 create mode 100644 meta/recipes-bsp/grub/files/cfg
 delete mode 100644 meta/recipes-devtools/cdrtools/cdrtools-native_3.00.bb
 create mode 100644 meta/recipes-devtools/cdrtools/cdrtools-native_3.01a17.bb
 rename meta/recipes-devtools/syslinux/{syslinux_4.07.bb => syslinux_6.01.bb} (63%)
 create mode 100644 meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb


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

* [v2 PATCH 1/7] bootimage.bbclass: Move fat image creation into a function
  2013-09-14  0:08 [v2 PATCH 0/7] Improved EFI boot support Jason Wessel
@ 2013-09-14  0:08 ` Jason Wessel
  2013-09-16 17:12   ` Darren Hart
  2013-09-14  0:08 ` [v2 PATCH 2/7] cdrtools-native: Update from 3.00 to 3.01a17 Jason Wessel
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 21+ messages in thread
From: Jason Wessel @ 2013-09-14  0:08 UTC (permalink / raw)
  To: Openembedded-core; +Cc: dvhart

In order to call the fat image creation multiple times it needs to be
in its own function.  A future commit will make use of the new
function to additionally create EFI image files for use with an ISO.

[YOCTO #4100]
[YOCTO #1913]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
 meta/classes/bootimg.bbclass |  110 ++++++++++++++++++++++--------------------
 1 file changed, 58 insertions(+), 52 deletions(-)

diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index 90a241d..bd211fb 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -111,6 +111,63 @@ build_iso() {
 	ln -s ${IMAGE_NAME}.iso ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
 }
 
+build_fat_img() {
+	FATSOURCEDIR=$1
+	FATIMG=$2
+
+	# Calculate the size required for the final image including the
+	# data and filesystem overhead.
+	# Sectors: 512 bytes
+	#  Blocks: 1024 bytes
+
+	# Determine the sector count just for the data
+	SECTORS=$(expr $(du --apparent-size -ks ${FATSOURCEDIR} | cut -f 1) \* 2)
+
+	# Account for the filesystem overhead. This includes directory
+	# entries in the clusters as well as the FAT itself.
+	# Assumptions:
+	#   FAT32 (12 or 16 may be selected by mkdosfs, but the extra
+	#   padding will be minimal on those smaller images and not
+	#   worth the logic here to caclulate the smaller FAT sizes)
+	#   < 16 entries per directory
+	#   8.3 filenames only
+
+	# 32 bytes per dir entry
+	DIR_BYTES=$(expr $(find ${FATSOURCEDIR} | tail -n +2 | wc -l) \* 32)
+	# 32 bytes for every end-of-directory dir entry
+	DIR_BYTES=$(expr $DIR_BYTES + $(expr $(find ${FATSOURCEDIR} -type d | tail -n +2 | wc -l) \* 32))
+	# 4 bytes per FAT entry per sector of data
+	FAT_BYTES=$(expr $SECTORS \* 4)
+	# 4 bytes per FAT entry per end-of-cluster list
+	FAT_BYTES=$(expr $FAT_BYTES + $(expr $(find ${FATSOURCEDIR} -type d | tail -n +2 | wc -l) \* 4))
+
+	# Use a ceiling function to determine FS overhead in sectors
+	DIR_SECTORS=$(expr $(expr $DIR_BYTES + 511) / 512)
+	# There are two FATs on the image
+	FAT_SECTORS=$(expr $(expr $(expr $FAT_BYTES + 511) / 512) \* 2)
+	SECTORS=$(expr $SECTORS + $(expr $DIR_SECTORS + $FAT_SECTORS))
+
+	# Determine the final size in blocks accounting for some padding
+	BLOCKS=$(expr $(expr $SECTORS / 2) + ${BOOTIMG_EXTRA_SPACE})
+
+	# Ensure total sectors is an integral number of sectors per
+	# track or mcopy will complain. Sectors are 512 bytes, and we
+	# generate images with 32 sectors per track. This calculation is
+	# done in blocks, thus the mod by 16 instead of 32.
+	BLOCKS=$(expr $BLOCKS + $(expr 16 - $(expr $BLOCKS % 16)))
+
+	# mkdosfs will sometimes use FAT16 when it is not appropriate,
+	# resulting in a boot failure from SYSLINUX. Use FAT32 for
+	# images larger than 512MB, otherwise let mkdosfs decide.
+	if [ $(expr $BLOCKS / 1024) -gt 512 ]; then
+		FATSIZE="-F 32"
+	fi
+
+	mkdosfs ${FATSIZE} -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${FATIMG} ${BLOCKS}
+	# Copy FATSOURCEDIR recursively into the image file directly
+	mcopy -i ${FATIMG} -s ${FATSOURCEDIR}/* ::/
+}
+
 build_hddimg() {
 	# Create an HDD image
 	if [ "${NOHDD}" != "1" ] ; then
@@ -123,58 +180,7 @@ build_hddimg() {
 			grubefi_hddimg_populate
 		fi
 
-		# Calculate the size required for the final image including the
-		# data and filesystem overhead.
-		# Sectors: 512 bytes
-		#  Blocks: 1024 bytes
-
-		# Determine the sector count just for the data
-		SECTORS=$(expr $(du --apparent-size -ks ${HDDDIR} | cut -f 1) \* 2)
-
-		# Account for the filesystem overhead. This includes directory
-		# entries in the clusters as well as the FAT itself.
-		# Assumptions:
-		#   FAT32 (12 or 16 may be selected by mkdosfs, but the extra
-		#   padding will be minimal on those smaller images and not
-		#   worth the logic here to caclulate the smaller FAT sizes)
-		#   < 16 entries per directory
-		#   8.3 filenames only
-
-		# 32 bytes per dir entry
-		DIR_BYTES=$(expr $(find ${HDDDIR} | tail -n +2 | wc -l) \* 32)
-		# 32 bytes for every end-of-directory dir entry
-		DIR_BYTES=$(expr $DIR_BYTES + $(expr $(find ${HDDDIR} -type d | tail -n +2 | wc -l) \* 32))
-		# 4 bytes per FAT entry per sector of data
-		FAT_BYTES=$(expr $SECTORS \* 4)
-		# 4 bytes per FAT entry per end-of-cluster list
-		FAT_BYTES=$(expr $FAT_BYTES + $(expr $(find ${HDDDIR} -type d | tail -n +2 | wc -l) \* 4))
-
-		# Use a ceiling function to determine FS overhead in sectors
-		DIR_SECTORS=$(expr $(expr $DIR_BYTES + 511) / 512)
-		# There are two FATs on the image
-		FAT_SECTORS=$(expr $(expr $(expr $FAT_BYTES + 511) / 512) \* 2)
-		SECTORS=$(expr $SECTORS + $(expr $DIR_SECTORS + $FAT_SECTORS))
-
-		# Determine the final size in blocks accounting for some padding
-		BLOCKS=$(expr $(expr $SECTORS / 2) + ${BOOTIMG_EXTRA_SPACE})
-
-		# Ensure total sectors is an integral number of sectors per
-		# track or mcopy will complain. Sectors are 512 bytes, and we
-		# generate images with 32 sectors per track. This calculation is
-		# done in blocks, thus the mod by 16 instead of 32.
-		BLOCKS=$(expr $BLOCKS + $(expr 16 - $(expr $BLOCKS % 16)))
-
-		# mkdosfs will sometimes use FAT16 when it is not appropriate,
-		# resulting in a boot failure from SYSLINUX. Use FAT32 for
-		# images larger than 512MB, otherwise let mkdosfs decide.
-		if [ $(expr $BLOCKS / 1024) -gt 512 ]; then
-			FATSIZE="-F 32"
-		fi
-
-		IMG=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
-		mkdosfs ${FATSIZE} -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${IMG} ${BLOCKS}
-		# Copy HDDDIR recursively into the image file directly
-		mcopy -i ${IMG} -s ${HDDDIR}/* ::/
+		build_fat_img ${HDDDIR} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
 
 		if [ "${PCBIOS}" = "1" ]; then
 			syslinux_hddimg_install
-- 
1.7.9.5



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

* [v2 PATCH 2/7] cdrtools-native: Update from 3.00 to 3.01a17
  2013-09-14  0:08 [v2 PATCH 0/7] Improved EFI boot support Jason Wessel
  2013-09-14  0:08 ` [v2 PATCH 1/7] bootimage.bbclass: Move fat image creation into a function Jason Wessel
@ 2013-09-14  0:08 ` Jason Wessel
  2013-09-16 17:21   ` Darren Hart
  2013-09-14  0:08 ` [v2 PATCH 3/7] grub-efi-native: Add support for EFI ISO images Jason Wessel
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 21+ messages in thread
From: Jason Wessel @ 2013-09-14  0:08 UTC (permalink / raw)
  To: Openembedded-core; +Cc: dvhart

The update is needed to support generation of EFI boot images that
work with optical media.  Specifically the "-eltorito-platform efi"
capability for mkisofs is needed.

[YOCTO #4100]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
 ...s-native_3.00.bb => cdrtools-native_3.01a17.bb} |   22 +++++++-------------
 1 file changed, 8 insertions(+), 14 deletions(-)
 rename meta/recipes-devtools/cdrtools/{cdrtools-native_3.00.bb => cdrtools-native_3.01a17.bb} (47%)

diff --git a/meta/recipes-devtools/cdrtools/cdrtools-native_3.00.bb b/meta/recipes-devtools/cdrtools/cdrtools-native_3.01a17.bb
similarity index 47%
rename from meta/recipes-devtools/cdrtools/cdrtools-native_3.00.bb
rename to meta/recipes-devtools/cdrtools/cdrtools-native_3.01a17.bb
index 7e4c381..2ae3f4a 100644
--- a/meta/recipes-devtools/cdrtools/cdrtools-native_3.00.bb
+++ b/meta/recipes-devtools/cdrtools/cdrtools-native_3.01a17.bb
@@ -5,26 +5,20 @@ SUMMARY = "A set of tools for CD recording, including cdrecord"
 DESCRIPTION = "A set of tools for CD recording, including cdrecord"
 HOMEPAGE = "http://cdrecord.berlios.de/private/cdrecord.html"
 SECTION = "console/utils"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=8d16123ffd39e649a5e4a6bc1de60e6d"
-PR = "r0"
+LICENSE = "GPLv2 & CDDL-1.0 & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=32f68170be424c2cd64804337726b312"
 
-SRC_URI = "ftp://ftp.berlios.de/pub/cdrecord/cdrtools-${PV}.tar.bz2 \
-           file://no_usr_src.patch"
+SRC_URI = "ftp://ftp.berlios.de/pub/cdrecord/alpha/cdrtools-${PV}.tar.bz2"
 
-SRC_URI[md5sum] = "f9fbab08fbd458b0d2312976d8c5f558"
-SRC_URI[sha256sum] = "7f9cb64820055573b880f77b2f16662a512518336ba95ab49228a1617973423d"
+SRC_URI[md5sum] = "4cef9db0cf15a770c52d65b00bbee2db"
+SRC_URI[sha256sum] = "3d613965b213ad83e4be0ba2535e784901839ea4d11a20a2beb6765f0eb76dfa"
 
-inherit native
+S = "${WORKDIR}/cdrtools-3.01"
 
-STAGE_TEMP = "${WORKDIR}/image-temp"
+inherit native
 
 FILESPATH = "${FILE_DIRNAME}/cdrtools-native/"
 
 do_install() {
-	install -d ${STAGE_TEMP}
-	make install INS_BASE=${STAGE_TEMP}
-
-	install -d ${D}${bindir}/
-	install ${STAGE_TEMP}/bin/* ${D}${bindir}/
+	make install GMAKE_NOWARN=true INS_BASE=${prefix} DESTDIR=${D}
 }
-- 
1.7.9.5



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

* [v2 PATCH 3/7] grub-efi-native: Add support for EFI ISO images
  2013-09-14  0:08 [v2 PATCH 0/7] Improved EFI boot support Jason Wessel
  2013-09-14  0:08 ` [v2 PATCH 1/7] bootimage.bbclass: Move fat image creation into a function Jason Wessel
  2013-09-14  0:08 ` [v2 PATCH 2/7] cdrtools-native: Update from 3.00 to 3.01a17 Jason Wessel
@ 2013-09-14  0:08 ` Jason Wessel
  2013-09-16 17:24   ` Darren Hart
  2013-09-14  0:09 ` [v2 PATCH 4/7] syslinux.bbclass, syslinux: Update to syslinux 6.01 Jason Wessel
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 21+ messages in thread
From: Jason Wessel @ 2013-09-14  0:08 UTC (permalink / raw)
  To: Openembedded-core; +Cc: dvhart

The iso9660 file system support needs to be added to grub in order to
be able to correctly find the grub.cfg.  The grub commands to locate
the grub.cfg also needs to be encoded into grub's default
configuration.

This change allows the resulting grub binary to work both in the hard
drive / USB boot case or the optical media boot case.

[YOCTO #4100]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
 meta/recipes-bsp/grub/files/cfg               |    2 ++
 meta/recipes-bsp/grub/grub-efi-native_2.00.bb |    7 +++++--
 2 files changed, 7 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-bsp/grub/files/cfg

diff --git a/meta/recipes-bsp/grub/files/cfg b/meta/recipes-bsp/grub/files/cfg
new file mode 100644
index 0000000..ffffe47
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/cfg
@@ -0,0 +1,2 @@
+search.file /EFI/BOOT/grub.cfg root
+set prefix=($root)/EFI/BOOT
diff --git a/meta/recipes-bsp/grub/grub-efi-native_2.00.bb b/meta/recipes-bsp/grub/grub-efi-native_2.00.bb
index 2d3d68a..04973b5 100644
--- a/meta/recipes-bsp/grub/grub-efi-native_2.00.bb
+++ b/meta/recipes-bsp/grub/grub-efi-native_2.00.bb
@@ -23,6 +23,7 @@ PR = "r2"
 PN := "grub-efi-${TRANSLATED_TARGET_ARCH}-native"
 
 SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \
+           file://cfg \
            file://grub-2.00-fpmath-sse-387-fix.patch \
            file://grub-2.00-fix-enable_execute_stack-check.patch \
            file://grub-2.00-disable-help2man.patch \
@@ -66,9 +67,11 @@ EXTRA_OECONF = "--with-platform=efi --disable-grub-mkfont \
                 --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
 
 do_mkimage() {
-	./grub-mkimage -p /EFI/BOOT -d ./grub-core/ \
+	# Search for the grub.cfg on the local boot media by using the
+	# built in cfg file provided via this recipe
+	./grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
 	               -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \
-	               boot linux ext2 fat serial part_msdos part_gpt normal efi_gop
+	               boot linux ext2 fat serial part_msdos part_gpt normal efi_gop iso9660 search
 }
 addtask mkimage after do_compile before do_install
 
-- 
1.7.9.5



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

* [v2 PATCH 4/7] syslinux.bbclass, syslinux: Update to syslinux 6.01
  2013-09-14  0:08 [v2 PATCH 0/7] Improved EFI boot support Jason Wessel
                   ` (2 preceding siblings ...)
  2013-09-14  0:08 ` [v2 PATCH 3/7] grub-efi-native: Add support for EFI ISO images Jason Wessel
@ 2013-09-14  0:09 ` Jason Wessel
  2013-09-14  8:05   ` Martin Jansa
  2013-09-14  0:09 ` [v2 PATCH 5/7] bootimage.bbclass, grub-efi.bbclass: Improve EFI & PCBIOS+EFI ISO support Jason Wessel
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 21+ messages in thread
From: Jason Wessel @ 2013-09-14  0:09 UTC (permalink / raw)
  To: Openembedded-core; +Cc: dvhart

A newer version of syslinux is required for an EFI enabled isohybrid.
This is used for the the capability to generate 3 types of ISO images,
all of which can be booted off a USB device or HDD if copied with dd.

1) PC BIOS only ISO
2) EFI only ISO
3) EFI + PC BIOS ISO

The syslinux.bbclass required a minor tweak because ldlinux.c32 is
dynamically loaded and needs to be in the created media as of syslinux
5 and up.

[YOCTO #4100]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
 meta/classes/syslinux.bbclass                      |    1 +
 .../{syslinux_4.07.bb => syslinux_6.01.bb}         |   26 ++++++++++++--------
 2 files changed, 17 insertions(+), 10 deletions(-)
 rename meta/recipes-devtools/syslinux/{syslinux_4.07.bb => syslinux_6.01.bb} (63%)

diff --git a/meta/classes/syslinux.bbclass b/meta/classes/syslinux.bbclass
index 501bc6d..da7f716 100644
--- a/meta/classes/syslinux.bbclass
+++ b/meta/classes/syslinux.bbclass
@@ -41,6 +41,7 @@ syslinux_populate() {
 syslinux_iso_populate() {
 	syslinux_populate ${ISODIR} ${ISOLINUXDIR} isolinux.cfg
 	install -m 0644 ${STAGING_DATADIR}/syslinux/isolinux.bin ${ISODIR}${ISOLINUXDIR}
+	install -m 0644 ${STAGING_DATADIR}/syslinux/ldlinux.c32 ${ISODIR}${ISOLINUXDIR}
 	if [ "${AUTO_SYSLINUXMENU}" = 1 ] ; then
 		install -m 0644 ${STAGING_DATADIR}/syslinux/vesamenu.c32 ${ISODIR}${ISOLINUXDIR}/vesamenu.c32
 		if [ "${SYSLINUX_SPLASH}" != "" ] ; then
diff --git a/meta/recipes-devtools/syslinux/syslinux_4.07.bb b/meta/recipes-devtools/syslinux/syslinux_6.01.bb
similarity index 63%
rename from meta/recipes-devtools/syslinux/syslinux_4.07.bb
rename to meta/recipes-devtools/syslinux/syslinux_6.01.bb
index bba5dda..4438ea8 100644
--- a/meta/recipes-devtools/syslinux/syslinux_4.07.bb
+++ b/meta/recipes-devtools/syslinux/syslinux_6.01.bb
@@ -2,19 +2,21 @@ DESCRIPTION = "A multi-purpose linux bootloader"
 HOMEPAGE = "http://syslinux.zytor.com/"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
-                    file://README;beginline=35;endline=41;md5=f7249a750bc692d1048b2626752aa415"
+                    file://README;beginline=35;endline=41;md5=558f2c71cb1fb9ba511ccd4858e48e8a"
 
 # If you really want to run syslinux, you need mtools.  We just want the
 # ldlinux.* stuff for now, so skip mtools-native
 DEPENDS = "nasm-native util-linux"
-PR = "r0"
 
-SRC_URI = "${KERNELORG_MIRROR}/linux/utils/boot/syslinux/4.xx/syslinux-${PV}.tar.bz2"
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/boot/syslinux/6.xx/syslinux-${PV}.tar.bz2"
 
-SRC_URI[md5sum] = "9ff6e1b94efab931fb4717b600d88779"
-SRC_URI[sha256sum] = "1240a4e4219b518bdaef78931b6e901befeff35e6894ac6db785115848a7a05a"
+SRC_URI[md5sum] = "6945ee89e29119d459baed4937bbc534"
+SRC_URI[sha256sum] = "83a04cf81e6a46b80ee5a321926eea095af3498b04317e3674b46c125c7a5b43"
 
 COMPATIBLE_HOST = '(x86_64|i.86).*-(linux|freebsd.*)'
+# Don't let the sanity checker trip on the 32 bit real mode BIOS binaries
+INSANE_SKIP_${PN}-misc = "arch"
+INSANE_SKIP_${PN}-chain = "arch"
 
 EXTRA_OEMAKE = " \
 	BINDIR=${bindir} SBINDIR=${sbindir} LIBDIR=${libdir} \
@@ -28,21 +30,25 @@ do_configure() {
 	sed -e 's,win32/\S*,,g' -i Makefile
 
 	# clean installer executables included in source tarball
-	oe_runmake clean
+	oe_runmake clean firmware="efi32" EFIINC="${includedir}"
+	# NOTE: There is a temporary work around above to specify
+	#	the efi32 as the firmware else the pre-built bios
+	#	files get erased contrary to the doc/distib.txt
+	#	In the future this should be "bios" and not "efi32".
 }
 
 do_compile() {
 	# Rebuild only the installer; keep precompiled bootloaders
 	# as per author's request (doc/distrib.txt)
-	oe_runmake CC="${CC} ${CFLAGS}" LDFLAGS="${LDFLAGS}" installer
+	oe_runmake CC="${CC} ${CFLAGS}" LDFLAGS="${LDFLAGS}" firmware="bios" installer
 }
 
 do_install() {
-	oe_runmake install INSTALLROOT="${D}"
+	oe_runmake install INSTALLROOT="${D}" firmware="bios"
 
 	install -d ${D}${datadir}/syslinux/
-	install -m 644 ${S}/core/ldlinux.sys ${D}${datadir}/syslinux/
-	install -m 644 ${S}/core/ldlinux.bss ${D}${datadir}/syslinux/
+	install -m 644 ${S}/bios/core/ldlinux.sys ${D}${datadir}/syslinux/
+	install -m 644 ${S}/bios/core/ldlinux.bss ${D}${datadir}/syslinux/
 }
 
 PACKAGES += "${PN}-extlinux ${PN}-mbr ${PN}-chain ${PN}-pxelinux ${PN}-isolinux ${PN}-misc"
-- 
1.7.9.5



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

* [v2 PATCH 5/7] bootimage.bbclass, grub-efi.bbclass: Improve EFI & PCBIOS+EFI ISO support
  2013-09-14  0:08 [v2 PATCH 0/7] Improved EFI boot support Jason Wessel
                   ` (3 preceding siblings ...)
  2013-09-14  0:09 ` [v2 PATCH 4/7] syslinux.bbclass, syslinux: Update to syslinux 6.01 Jason Wessel
@ 2013-09-14  0:09 ` Jason Wessel
  2013-09-16 17:30   ` Darren Hart
  2013-09-14  0:09 ` [v2 PATCH 6/7] grub-efi.bbclass: Add serial and graphics menu options Jason Wessel
  2013-09-14  0:09 ` [v2 PATCH 7/7] bootimage.bbclass, zisofs-tools-native: add ability to compress ISO images Jason Wessel
  6 siblings, 1 reply; 21+ messages in thread
From: Jason Wessel @ 2013-09-14  0:09 UTC (permalink / raw)
  To: Openembedded-core; +Cc: dvhart

Using the latest mkisofs it is possible to generate 3 different types
of ISO images, which can be used in various scenarios.

1) PCBIOS Only ISO
   - This option remains unchanged by this commit
   - Uses syslinux menus
   - Can be directly copied with dd to a USB device
   - Can be burned to optical media

2) EFI Only ISO
   - Uses grub 2 menus
   - Can be burned to optical media
   - If you want to use this image on a USB device
     extra steps must be taken in order to format the USB
     device with fat32, and copy an EFI loader which will
     in turn load the iso image

3) PCBIOS / EFI ISO
   - This is a hybrid image ISO that will work for case 1 or 2
     as above with the same restrictions and boot menu types
     depending on what type of firmware is installed on
     the hardware or depending on if EFI or "Legacy Boot" is
     enabled on some UEFI firmwares.

The syslinux.bbclass is now always required because that is where the
isohybrid dependencies come from as well as the configuration data for
the isohybrid.  The isohybrid is the secret sauce which allows the ISO
to work as optical media or as a disk image on USB or a HDD/SSD.

[YOCTO #4100]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
 meta/classes/bootimg.bbclass  |   33 +++++++++++++++++++++------------
 meta/classes/grub-efi.bbclass |    8 ++++++++
 2 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index bd211fb..756a287 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -32,6 +32,7 @@ EXCLUDE_FROM_WORLD = "1"
 
 HDDDIR = "${S}/hddimg"
 ISODIR = "${S}/iso"
+EFIIMGDIR = "${S}/efi_img"
 
 BOOTIMG_VOLUME_ID   ?= "boot"
 BOOTIMG_EXTRA_SPACE ?= "512"
@@ -48,15 +49,10 @@ def pcbios(d):
         pcbios = base_contains("MACHINE_FEATURES", "efi", "0", "1", d)
     return pcbios
 
-def pcbios_class(d):
-    if d.getVar("PCBIOS", True) == "1":
-        return "syslinux"
-    return ""
-
 PCBIOS = "${@pcbios(d)}"
-PCBIOS_CLASS = "${@pcbios_class(d)}"
 
-inherit ${PCBIOS_CLASS}
+# The syslinux is required for the isohybrid command and boot catalog
+inherit syslinux
 inherit ${EFI_CLASS}
 
 populate() {
@@ -90,21 +86,34 @@ build_iso() {
 	fi
 	if [ "${EFI}" = "1" ]; then
 		grubefi_iso_populate
+		build_fat_img ${EFIIMGDIR} ${ISODIR}/efi.img
 	fi
 
-	if [ "${PCBIOS}" = "1" ]; then
+	# EFI only
+	if [ "${PCBIOS}" != "1" ] && [ "${EFI}" = "1" ] ; then
+		mkdir -p ${ISODIR}/${ISOLINUXDIR}
+		install -m 0644 ${STAGING_DATADIR}/syslinux/isolinux.bin ${ISODIR}${ISOLINUXDIR}
+	fi
+
+	if [ "${PCBIOS}" = "1" ] && [ "${EFI}" != "1" ] ; then
+		# PCBIOS only media
 		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} \
+		# EFI only OR EFI+PCIBIOS
+		mkisofs -A ${BOOTIMG_VOLUME_ID} -V ${BOOTIMG_VOLUME_ID} \
 		        -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
-			-r ${ISODIR}
+			-b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} \
+			-r ${MKISOFS_OPTIONS} \
+			-eltorito-alt-boot -eltorito-platform efi \
+			-b efi.img -no-emul-boot \
+			${ISODIR}
+		isohybrid_args="-u"
 	fi
 
-	isohybrid ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso
+	isohybrid $isohybrid_args ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso
 
 	cd ${DEPLOY_DIR_IMAGE}
 	rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
diff --git a/meta/classes/grub-efi.bbclass b/meta/classes/grub-efi.bbclass
index c6f5d4e..c21babb 100644
--- a/meta/classes/grub-efi.bbclass
+++ b/meta/classes/grub-efi.bbclass
@@ -41,6 +41,14 @@ grubefi_populate() {
 
 grubefi_iso_populate() {
 	grubefi_populate ${ISODIR}
+	# Build a EFI directory to create efi.img
+	mkdir -p ${EFIIMGDIR}/${EFIDIR}
+	cp ${ISODIR}/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR}
+	cp ${ISODIR}/vmlinuz ${EFIIMGDIR}
+	echo "EFI\\BOOT\\${GRUB_IMAGE}" > ${EFIIMGDIR}/startup.nsh
+	if [ -f "${ISODIR}/initrd" ] ; then
+		cp ${ISODIR}/initrd ${EFIIMGDIR}
+	fi
 }
 
 grubefi_hddimg_populate() {
-- 
1.7.9.5



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

* [v2 PATCH 6/7] grub-efi.bbclass: Add serial and graphics menu options
  2013-09-14  0:08 [v2 PATCH 0/7] Improved EFI boot support Jason Wessel
                   ` (4 preceding siblings ...)
  2013-09-14  0:09 ` [v2 PATCH 5/7] bootimage.bbclass, grub-efi.bbclass: Improve EFI & PCBIOS+EFI ISO support Jason Wessel
@ 2013-09-14  0:09 ` Jason Wessel
  2013-09-16 17:50   ` Darren Hart
  2013-09-14  0:09 ` [v2 PATCH 7/7] bootimage.bbclass, zisofs-tools-native: add ability to compress ISO images Jason Wessel
  6 siblings, 1 reply; 21+ messages in thread
From: Jason Wessel @ 2013-09-14  0:09 UTC (permalink / raw)
  To: Openembedded-core; +Cc: dvhart

The syslinux.bbclass already has support for automatically generated
serial and graphics menu choices.  This patch adds the same concept to
the grub-efi menu.  That makes it possible to generate a single image
which can boot on a PCBIOS or EFI firmware with consistent looking
boot options.

[YOCTO #4100]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
 meta/classes/grub-efi.bbclass |   41 +++++++++++++++++++++++++++--------------
 1 file changed, 27 insertions(+), 14 deletions(-)

diff --git a/meta/classes/grub-efi.bbclass b/meta/classes/grub-efi.bbclass
index c21babb..ffbcf4c 100644
--- a/meta/classes/grub-efi.bbclass
+++ b/meta/classes/grub-efi.bbclass
@@ -9,6 +9,7 @@
 # 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)
+# ${GRUB_GFXSERIAL} - set this to 1 to have graphics and serial in the boot menu
 # ${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)
@@ -16,6 +17,7 @@
 
 do_bootimg[depends] += "grub-efi-${TRANSLATED_TARGET_ARCH}-native:do_deploy"
 
+GRUB_SERIAL ?= "console=ttyS0,115200"
 GRUBCFG = "${S}/grub.cfg"
 GRUB_TIMEOUT ?= "10"
 #FIXME: build this from the machine config
@@ -63,6 +65,8 @@ python build_grub_cfg() {
         bb.error("WORKDIR not defined, unable to package")
         return
 
+    gfxserial = d.getVar('GRUB_GFXSERIAL', True) or ""
+
     labels = d.getVar('LABELS', True)
     if not labels:
         bb.debug(1, "LABELS not defined, nothing to do")
@@ -96,6 +100,12 @@ python build_grub_cfg() {
     else:
         cfgfile.write('timeout=50\n')
 
+    if gfxserial == "1":
+        btypes = [ [ " graphics console", "console=tty0" ],
+            [ " serial console", d.getVar('GRUB_SERIAL', True) or "" ] ]
+    else:
+        btypes = [ [ "", "" ] ]
+
     for label in labels.split():
         localdata = d.createCopy()
 
@@ -103,24 +113,27 @@ python build_grub_cfg() {
         if not overrides:
             raise bb.build.FuncFailed('OVERRIDES not defined')
 
-        localdata.setVar('OVERRIDES', label + ':' + overrides)
-        bb.data.update_data(localdata)
+        for btype in btypes:
+            localdata.setVar('OVERRIDES', label + ':' + overrides)
+            bb.data.update_data(localdata)
 
-        cfgfile.write('\nmenuentry \'%s\'{\n' % (label))
-        if label == "install":
-            label = "install-efi"
-        cfgfile.write('linux /vmlinuz LABEL=%s' % (label))
+            cfgfile.write('\nmenuentry \'%s%s\'{\n' % (label, btype[0]))
+            lb = label
+            if label == "install":
+                lb = "install-efi"
+            cfgfile.write('linux /vmlinuz LABEL=%s' % (lb))
 
-        append = localdata.getVar('APPEND', True)
-        initrd = localdata.getVar('INITRD', True)
+            append = localdata.getVar('APPEND', True)
+            initrd = localdata.getVar('INITRD', True)
 
-        if append:
-            cfgfile.write('%s' % (append))
-        cfgfile.write('\n')
+            if append:
+                cfgfile.write('%s' % (append))
+            cfgfile.write(' %s' % btype[1])
+            cfgfile.write('\n')
 
-        if initrd:
-            cfgfile.write('initrd /initrd')
-        cfgfile.write('\n}\n')
+            if initrd:
+                cfgfile.write('initrd /initrd')
+            cfgfile.write('\n}\n')
 
     cfgfile.close()
 }
-- 
1.7.9.5



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

* [v2 PATCH 7/7] bootimage.bbclass, zisofs-tools-native: add ability to compress ISO images
  2013-09-14  0:08 [v2 PATCH 0/7] Improved EFI boot support Jason Wessel
                   ` (5 preceding siblings ...)
  2013-09-14  0:09 ` [v2 PATCH 6/7] grub-efi.bbclass: Add serial and graphics menu options Jason Wessel
@ 2013-09-14  0:09 ` Jason Wessel
  2013-09-16 17:57   ` Darren Hart
  6 siblings, 1 reply; 21+ messages in thread
From: Jason Wessel @ 2013-09-14  0:09 UTC (permalink / raw)
  To: Openembedded-core; +Cc: dvhart

The mkzftree is needed to allow ISO images to be compressed with
minimal runtime overhead.  Below is an example of the savings on a
core-image-minimal.

Before ls -l:
24117248 core-image-minimal-qemux86-64.iso

Using the mkzftree ls -l:
16777216 core-image-minimal-qemux86-64.iso

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
 meta/classes/bootimg.bbclass                       |   24 +++++++++++++++++---
 .../zisofs-tools/zisofs-tools-native_1.0.8.bb      |   19 ++++++++++++++++
 2 files changed, 40 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb

diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index 756a287..e9e4e8d 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -19,13 +19,15 @@
 
 # External variables (also used by syslinux.bbclass)
 # ${INITRD} - indicates a filesystem image to use as an initrd (optional)
+# ${COMPRESSISO} - Transparent compress ISO, reduce size ~40% if set to 1
 # ${NOISO}  - skip building the ISO image if set to 1
 # ${NOHDD}  - skip building the HDD image if set to 1
 # ${ROOTFS} - indicates a filesystem image to include as the root filesystem (optional)
 
 do_bootimg[depends] += "dosfstools-native:do_populate_sysroot \
                         mtools-native:do_populate_sysroot \
-                        cdrtools-native:do_populate_sysroot"
+                        cdrtools-native:do_populate_sysroot \
+                        ${@oe.utils.ifelse(d.getVar('COMPRESSISO'),'zisofs-tools-native:do_populate_sysroot','')}"
 
 PACKAGES = " "
 EXCLUDE_FROM_WORLD = "1"
@@ -33,6 +35,8 @@ EXCLUDE_FROM_WORLD = "1"
 HDDDIR = "${S}/hddimg"
 ISODIR = "${S}/iso"
 EFIIMGDIR = "${S}/efi_img"
+COMPACT_ISODIR = "${S}/iso.z"
+COMPRESSISO ?= ""
 
 BOOTIMG_VOLUME_ID   ?= "boot"
 BOOTIMG_EXTRA_SPACE ?= "512"
@@ -95,18 +99,32 @@ build_iso() {
 		install -m 0644 ${STAGING_DATADIR}/syslinux/isolinux.bin ${ISODIR}${ISOLINUXDIR}
 	fi
 
+	if [ "${COMPRESSISO}" = "1" ] ; then
+		# create compact directory, compress iso
+		mkdir -p ${COMPACT_ISODIR}
+		mkzftree -z 9 -p 4 -F ${ISODIR}/rootfs.img ${COMPACT_ISODIR}/rootfs.img
+
+		# move compact iso to iso, then remove compact directory
+		mv ${COMPACT_ISODIR}/rootfs.img ${ISODIR}/rootfs.img
+		rm -Rf ${COMPACT_ISODIR}
+		mkisofs_compress_opts="-R -z -D -l"
+	else
+		mkisofs_compress_opts="-r"
+	fi
+
 	if [ "${PCBIOS}" = "1" ] && [ "${EFI}" != "1" ] ; then
 		# PCBIOS only media
 		mkisofs -V ${BOOTIMG_VOLUME_ID} \
 		        -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
-			-b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} -r \
+			-b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} \
+			$mkisofs_compress_opts \
 			${MKISOFS_OPTIONS} ${ISODIR}
 	else
 		# EFI only OR EFI+PCIBIOS
 		mkisofs -A ${BOOTIMG_VOLUME_ID} -V ${BOOTIMG_VOLUME_ID} \
 		        -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
 			-b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} \
-			-r ${MKISOFS_OPTIONS} \
+			$mkisofs_compress_opts ${MKISOFS_OPTIONS} \
 			-eltorito-alt-boot -eltorito-platform efi \
 			-b efi.img -no-emul-boot \
 			${ISODIR}
diff --git a/meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb b/meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb
new file mode 100644
index 0000000..1501307
--- /dev/null
+++ b/meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb
@@ -0,0 +1,19 @@
+# zisofs-tools-native OE build file
+# Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+SUMMARY = "A set of tools for iso file compression"
+DESCRIPTION = "A set of tools for iso file compression"
+HOMEPAGE = "http://http://freecode.com/projects/zisofs-tools"
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/zisofs-tools/zisofs-tools-${PV}.tar.bz2/2d0ed8c9a1f60b45f949b136f9be1f6c/zisofs-tools-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "2d0ed8c9a1f60b45f949b136f9be1f6c"
+SRC_URI[sha256sum] = "ae4e53e4914934d41660248fb59d3c8761f1f1fd180d5ec993c17ddb3afd04f3"
+
+inherit native
+
+do_install() {
+	oe_runmake install INSTALLROOT=${D} bindir=${bindir}
+}
-- 
1.7.9.5



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

* Re: [v2 PATCH 4/7] syslinux.bbclass, syslinux: Update to syslinux 6.01
  2013-09-14  0:09 ` [v2 PATCH 4/7] syslinux.bbclass, syslinux: Update to syslinux 6.01 Jason Wessel
@ 2013-09-14  8:05   ` Martin Jansa
  2013-09-14 12:19     ` Jason Wessel
  0 siblings, 1 reply; 21+ messages in thread
From: Martin Jansa @ 2013-09-14  8:05 UTC (permalink / raw)
  To: Jason Wessel; +Cc: dvhart, Openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1062 bytes --]

On Fri, Sep 13, 2013 at 07:09:00PM -0500, Jason Wessel wrote:
> A newer version of syslinux is required for an EFI enabled isohybrid.
> This is used for the the capability to generate 3 types of ISO images,
> all of which can be booted off a USB device or HDD if copied with dd.
> 
> 1) PC BIOS only ISO
> 2) EFI only ISO
> 3) EFI + PC BIOS ISO
> 
> The syslinux.bbclass required a minor tweak because ldlinux.c32 is
> dynamically loaded and needs to be in the created media as of syslinux
> 5 and up.

Hi Jason,

can you please look at
https://bugzilla.yoctoproject.org/show_bug.cgi?id=3944
?

> 
> [YOCTO #4100]
> 
> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
> ---
>  meta/classes/syslinux.bbclass                      |    1 +
>  .../{syslinux_4.07.bb => syslinux_6.01.bb}         |   26 ++++++++++++--------
>  2 files changed, 17 insertions(+), 10 deletions(-)
>  rename meta/recipes-devtools/syslinux/{syslinux_4.07.bb => syslinux_6.01.bb} (63%)
> 

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

* Re: [v2 PATCH 4/7] syslinux.bbclass, syslinux: Update to syslinux 6.01
  2013-09-14  8:05   ` Martin Jansa
@ 2013-09-14 12:19     ` Jason Wessel
  2013-09-14 13:16       ` Martin Jansa
  0 siblings, 1 reply; 21+ messages in thread
From: Jason Wessel @ 2013-09-14 12:19 UTC (permalink / raw)
  To: Martin Jansa; +Cc: dvhart, Openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1410 bytes --]

On 09/14/2013 03:05 AM, Martin Jansa wrote:
> On Fri, Sep 13, 2013 at 07:09:00PM -0500, Jason Wessel wrote:
>> A newer version of syslinux is required for an EFI enabled isohybrid.
>> This is used for the the capability to generate 3 types of ISO images,
>> all of which can be booted off a USB device or HDD if copied with dd.
>>
>> 1) PC BIOS only ISO
>> 2) EFI only ISO
>> 3) EFI + PC BIOS ISO
>>
>> The syslinux.bbclass required a minor tweak because ldlinux.c32 is
>> dynamically loaded and needs to be in the created media as of syslinux
>> 5 and up.
>
> Hi Jason,
>
> can you please look at
> https://bugzilla.yoctoproject.org/show_bug.cgi?id=3944
> ?


I can look at fixing the defect, but there is no description of how to use the directdisk to see the problem.  Could you provide an example?

I added the directdisk to IMAGE_FSTYPES, but didn't get a .directdisk in the deploy directory so that is not how it works.   Also I think the right solution is to simply call syslinux_hddimg_populate() from the directdisk class vs having copied code for the install of the syslinux specific files (that is how 1/2 the problem occurred in the first place).

Back to this particular patch, the ldlinux.c32 change does not affect the bootdirect class.  The ldlinux.c32 is only required for isolinux and the copy is contained with in the inherited syslinux class.

Cheers,
Jason.


[-- Attachment #2: Type: text/html, Size: 2198 bytes --]

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

* Re: [v2 PATCH 4/7] syslinux.bbclass, syslinux: Update to syslinux 6.01
  2013-09-14 12:19     ` Jason Wessel
@ 2013-09-14 13:16       ` Martin Jansa
  2013-09-16 18:10         ` Darren Hart
  0 siblings, 1 reply; 21+ messages in thread
From: Martin Jansa @ 2013-09-14 13:16 UTC (permalink / raw)
  To: Jason Wessel; +Cc: dvhart, Openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1840 bytes --]

On Sat, Sep 14, 2013 at 07:19:43AM -0500, Jason Wessel wrote:
> On 09/14/2013 03:05 AM, Martin Jansa wrote:
> > On Fri, Sep 13, 2013 at 07:09:00PM -0500, Jason Wessel wrote:
> >> A newer version of syslinux is required for an EFI enabled isohybrid.
> >> This is used for the the capability to generate 3 types of ISO images,
> >> all of which can be booted off a USB device or HDD if copied with dd.
> >>
> >> 1) PC BIOS only ISO
> >> 2) EFI only ISO
> >> 3) EFI + PC BIOS ISO
> >>
> >> The syslinux.bbclass required a minor tweak because ldlinux.c32 is
> >> dynamically loaded and needs to be in the created media as of syslinux
> >> 5 and up.
> >
> > Hi Jason,
> >
> > can you please look at
> > https://bugzilla.yoctoproject.org/show_bug.cgi?id=3944
> > ?
> 
> 
> I can look at fixing the defect, but there is no description of how to use the directdisk to see the problem.  Could you provide an example?
> 
> I added the directdisk to IMAGE_FSTYPES, but didn't get a .directdisk in the deploy directory so that is not how it works.   Also I think the right solution is to simply call syslinux_hddimg_populate() from the directdisk class vs having copied code for the install of the syslinux specific files (that is how 1/2 the problem occurred in the first place).
> 
> Back to this particular patch, the ldlinux.c32 change does not affect the bootdirect class.  The ldlinux.c32 is only required for isolinux and the copy is contained with in the inherited syslinux class.

You can reproduce it by adding vmdk to IMAGE_FSTYPES and building e.g.
qemux86 and trying to boot it in VirtualBox.

It will always enable tty0 and only way to disable it now is to enable
menu, but that doesn't work with vmdk images because of missing
vesamenu.c32

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

* Re: [v2 PATCH 1/7] bootimage.bbclass: Move fat image creation into a function
  2013-09-14  0:08 ` [v2 PATCH 1/7] bootimage.bbclass: Move fat image creation into a function Jason Wessel
@ 2013-09-16 17:12   ` Darren Hart
  0 siblings, 0 replies; 21+ messages in thread
From: Darren Hart @ 2013-09-16 17:12 UTC (permalink / raw)
  To: Jason Wessel; +Cc: Openembedded-core

On Fri, 2013-09-13 at 19:08 -0500, Jason Wessel wrote:
> In order to call the fat image creation multiple times it needs to be
> in its own function.  A future commit will make use of the new
> function to additionally create EFI image files for use with an ISO.
> 
> [YOCTO #4100]
> [YOCTO #1913]
> 
> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>

Looks good, thanks Jason!

Reviewed-by: Darren Hart <dvhart@linux.intel.com>

> ---
>  meta/classes/bootimg.bbclass |  110 ++++++++++++++++++++++--------------------
>  1 file changed, 58 insertions(+), 52 deletions(-)
> 
> diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
> index 90a241d..bd211fb 100644
> --- a/meta/classes/bootimg.bbclass
> +++ b/meta/classes/bootimg.bbclass
> @@ -111,6 +111,63 @@ build_iso() {
>  	ln -s ${IMAGE_NAME}.iso ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
>  }
>  
> +build_fat_img() {
> +	FATSOURCEDIR=$1
> +	FATIMG=$2
> +
> +	# Calculate the size required for the final image including the
> +	# data and filesystem overhead.
> +	# Sectors: 512 bytes
> +	#  Blocks: 1024 bytes
> +
> +	# Determine the sector count just for the data
> +	SECTORS=$(expr $(du --apparent-size -ks ${FATSOURCEDIR} | cut -f 1) \* 2)
> +
> +	# Account for the filesystem overhead. This includes directory
> +	# entries in the clusters as well as the FAT itself.
> +	# Assumptions:
> +	#   FAT32 (12 or 16 may be selected by mkdosfs, but the extra
> +	#   padding will be minimal on those smaller images and not
> +	#   worth the logic here to caclulate the smaller FAT sizes)
> +	#   < 16 entries per directory
> +	#   8.3 filenames only
> +
> +	# 32 bytes per dir entry
> +	DIR_BYTES=$(expr $(find ${FATSOURCEDIR} | tail -n +2 | wc -l) \* 32)
> +	# 32 bytes for every end-of-directory dir entry
> +	DIR_BYTES=$(expr $DIR_BYTES + $(expr $(find ${FATSOURCEDIR} -type d | tail -n +2 | wc -l) \* 32))
> +	# 4 bytes per FAT entry per sector of data
> +	FAT_BYTES=$(expr $SECTORS \* 4)
> +	# 4 bytes per FAT entry per end-of-cluster list
> +	FAT_BYTES=$(expr $FAT_BYTES + $(expr $(find ${FATSOURCEDIR} -type d | tail -n +2 | wc -l) \* 4))
> +
> +	# Use a ceiling function to determine FS overhead in sectors
> +	DIR_SECTORS=$(expr $(expr $DIR_BYTES + 511) / 512)
> +	# There are two FATs on the image
> +	FAT_SECTORS=$(expr $(expr $(expr $FAT_BYTES + 511) / 512) \* 2)
> +	SECTORS=$(expr $SECTORS + $(expr $DIR_SECTORS + $FAT_SECTORS))
> +
> +	# Determine the final size in blocks accounting for some padding
> +	BLOCKS=$(expr $(expr $SECTORS / 2) + ${BOOTIMG_EXTRA_SPACE})
> +
> +	# Ensure total sectors is an integral number of sectors per
> +	# track or mcopy will complain. Sectors are 512 bytes, and we
> +	# generate images with 32 sectors per track. This calculation is
> +	# done in blocks, thus the mod by 16 instead of 32.
> +	BLOCKS=$(expr $BLOCKS + $(expr 16 - $(expr $BLOCKS % 16)))
> +
> +	# mkdosfs will sometimes use FAT16 when it is not appropriate,
> +	# resulting in a boot failure from SYSLINUX. Use FAT32 for
> +	# images larger than 512MB, otherwise let mkdosfs decide.
> +	if [ $(expr $BLOCKS / 1024) -gt 512 ]; then
> +		FATSIZE="-F 32"
> +	fi
> +
> +	mkdosfs ${FATSIZE} -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${FATIMG} ${BLOCKS}
> +	# Copy FATSOURCEDIR recursively into the image file directly
> +	mcopy -i ${FATIMG} -s ${FATSOURCEDIR}/* ::/
> +}
> +
>  build_hddimg() {
>  	# Create an HDD image
>  	if [ "${NOHDD}" != "1" ] ; then
> @@ -123,58 +180,7 @@ build_hddimg() {
>  			grubefi_hddimg_populate
>  		fi
>  
> -		# Calculate the size required for the final image including the
> -		# data and filesystem overhead.
> -		# Sectors: 512 bytes
> -		#  Blocks: 1024 bytes
> -
> -		# Determine the sector count just for the data
> -		SECTORS=$(expr $(du --apparent-size -ks ${HDDDIR} | cut -f 1) \* 2)
> -
> -		# Account for the filesystem overhead. This includes directory
> -		# entries in the clusters as well as the FAT itself.
> -		# Assumptions:
> -		#   FAT32 (12 or 16 may be selected by mkdosfs, but the extra
> -		#   padding will be minimal on those smaller images and not
> -		#   worth the logic here to caclulate the smaller FAT sizes)
> -		#   < 16 entries per directory
> -		#   8.3 filenames only
> -
> -		# 32 bytes per dir entry
> -		DIR_BYTES=$(expr $(find ${HDDDIR} | tail -n +2 | wc -l) \* 32)
> -		# 32 bytes for every end-of-directory dir entry
> -		DIR_BYTES=$(expr $DIR_BYTES + $(expr $(find ${HDDDIR} -type d | tail -n +2 | wc -l) \* 32))
> -		# 4 bytes per FAT entry per sector of data
> -		FAT_BYTES=$(expr $SECTORS \* 4)
> -		# 4 bytes per FAT entry per end-of-cluster list
> -		FAT_BYTES=$(expr $FAT_BYTES + $(expr $(find ${HDDDIR} -type d | tail -n +2 | wc -l) \* 4))
> -
> -		# Use a ceiling function to determine FS overhead in sectors
> -		DIR_SECTORS=$(expr $(expr $DIR_BYTES + 511) / 512)
> -		# There are two FATs on the image
> -		FAT_SECTORS=$(expr $(expr $(expr $FAT_BYTES + 511) / 512) \* 2)
> -		SECTORS=$(expr $SECTORS + $(expr $DIR_SECTORS + $FAT_SECTORS))
> -
> -		# Determine the final size in blocks accounting for some padding
> -		BLOCKS=$(expr $(expr $SECTORS / 2) + ${BOOTIMG_EXTRA_SPACE})
> -
> -		# Ensure total sectors is an integral number of sectors per
> -		# track or mcopy will complain. Sectors are 512 bytes, and we
> -		# generate images with 32 sectors per track. This calculation is
> -		# done in blocks, thus the mod by 16 instead of 32.
> -		BLOCKS=$(expr $BLOCKS + $(expr 16 - $(expr $BLOCKS % 16)))
> -
> -		# mkdosfs will sometimes use FAT16 when it is not appropriate,
> -		# resulting in a boot failure from SYSLINUX. Use FAT32 for
> -		# images larger than 512MB, otherwise let mkdosfs decide.
> -		if [ $(expr $BLOCKS / 1024) -gt 512 ]; then
> -			FATSIZE="-F 32"
> -		fi
> -
> -		IMG=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
> -		mkdosfs ${FATSIZE} -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${IMG} ${BLOCKS}
> -		# Copy HDDDIR recursively into the image file directly
> -		mcopy -i ${IMG} -s ${HDDDIR}/* ::/
> +		build_fat_img ${HDDDIR} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
>  
>  		if [ "${PCBIOS}" = "1" ]; then
>  			syslinux_hddimg_install

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel




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

* Re: [v2 PATCH 2/7] cdrtools-native: Update from 3.00 to 3.01a17
  2013-09-14  0:08 ` [v2 PATCH 2/7] cdrtools-native: Update from 3.00 to 3.01a17 Jason Wessel
@ 2013-09-16 17:21   ` Darren Hart
  0 siblings, 0 replies; 21+ messages in thread
From: Darren Hart @ 2013-09-16 17:21 UTC (permalink / raw)
  To: Jason Wessel; +Cc: Openembedded-core

On Fri, 2013-09-13 at 19:08 -0500, Jason Wessel wrote:
> The update is needed to support generation of EFI boot images that
> work with optical media.  Specifically the "-eltorito-platform efi"
> capability for mkisofs is needed.
> 
> [YOCTO #4100]
> 
> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>

Reviewed-by: Darren Hart <dvhart@linux.intel.com>

> ---
>  ...s-native_3.00.bb => cdrtools-native_3.01a17.bb} |   22 +++++++-------------
>  1 file changed, 8 insertions(+), 14 deletions(-)
>  rename meta/recipes-devtools/cdrtools/{cdrtools-native_3.00.bb => cdrtools-native_3.01a17.bb} (47%)
> 
> diff --git a/meta/recipes-devtools/cdrtools/cdrtools-native_3.00.bb b/meta/recipes-devtools/cdrtools/cdrtools-native_3.01a17.bb
> similarity index 47%
> rename from meta/recipes-devtools/cdrtools/cdrtools-native_3.00.bb
> rename to meta/recipes-devtools/cdrtools/cdrtools-native_3.01a17.bb
> index 7e4c381..2ae3f4a 100644
> --- a/meta/recipes-devtools/cdrtools/cdrtools-native_3.00.bb
> +++ b/meta/recipes-devtools/cdrtools/cdrtools-native_3.01a17.bb
> @@ -5,26 +5,20 @@ SUMMARY = "A set of tools for CD recording, including cdrecord"
>  DESCRIPTION = "A set of tools for CD recording, including cdrecord"
>  HOMEPAGE = "http://cdrecord.berlios.de/private/cdrecord.html"
>  SECTION = "console/utils"
> -LICENSE = "GPLv2"
> -LIC_FILES_CHKSUM = "file://COPYING;md5=8d16123ffd39e649a5e4a6bc1de60e6d"
> -PR = "r0"
> +LICENSE = "GPLv2 & CDDL-1.0 & LGPLv2.1+"
> +LIC_FILES_CHKSUM = "file://COPYING;md5=32f68170be424c2cd64804337726b312"
>  
> -SRC_URI = "ftp://ftp.berlios.de/pub/cdrecord/cdrtools-${PV}.tar.bz2 \
> -           file://no_usr_src.patch"
> +SRC_URI = "ftp://ftp.berlios.de/pub/cdrecord/alpha/cdrtools-${PV}.tar.bz2"
>  
> -SRC_URI[md5sum] = "f9fbab08fbd458b0d2312976d8c5f558"
> -SRC_URI[sha256sum] = "7f9cb64820055573b880f77b2f16662a512518336ba95ab49228a1617973423d"
> +SRC_URI[md5sum] = "4cef9db0cf15a770c52d65b00bbee2db"
> +SRC_URI[sha256sum] = "3d613965b213ad83e4be0ba2535e784901839ea4d11a20a2beb6765f0eb76dfa"
>  
> -inherit native
> +S = "${WORKDIR}/cdrtools-3.01"
>  
> -STAGE_TEMP = "${WORKDIR}/image-temp"
> +inherit native
>  
>  FILESPATH = "${FILE_DIRNAME}/cdrtools-native/"
>  
>  do_install() {
> -	install -d ${STAGE_TEMP}
> -	make install INS_BASE=${STAGE_TEMP}
> -
> -	install -d ${D}${bindir}/
> -	install ${STAGE_TEMP}/bin/* ${D}${bindir}/
> +	make install GMAKE_NOWARN=true INS_BASE=${prefix} DESTDIR=${D}
>  }

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel




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

* Re: [v2 PATCH 3/7] grub-efi-native: Add support for EFI ISO images
  2013-09-14  0:08 ` [v2 PATCH 3/7] grub-efi-native: Add support for EFI ISO images Jason Wessel
@ 2013-09-16 17:24   ` Darren Hart
  0 siblings, 0 replies; 21+ messages in thread
From: Darren Hart @ 2013-09-16 17:24 UTC (permalink / raw)
  To: Jason Wessel; +Cc: Openembedded-core

On Fri, 2013-09-13 at 19:08 -0500, Jason Wessel wrote:
> The iso9660 file system support needs to be added to grub in order to
> be able to correctly find the grub.cfg.  The grub commands to locate
> the grub.cfg also needs to be encoded into grub's default
> configuration.
> 
> This change allows the resulting grub binary to work both in the hard
> drive / USB boot case or the optical media boot case.
> 
> [YOCTO #4100]
> 
> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>


Reviewed-by: Darren Hart <dvhart@linux.intel.com>

> ---
>  meta/recipes-bsp/grub/files/cfg               |    2 ++
>  meta/recipes-bsp/grub/grub-efi-native_2.00.bb |    7 +++++--
>  2 files changed, 7 insertions(+), 2 deletions(-)
>  create mode 100644 meta/recipes-bsp/grub/files/cfg
> 
> diff --git a/meta/recipes-bsp/grub/files/cfg b/meta/recipes-bsp/grub/files/cfg
> new file mode 100644
> index 0000000..ffffe47
> --- /dev/null
> +++ b/meta/recipes-bsp/grub/files/cfg
> @@ -0,0 +1,2 @@
> +search.file /EFI/BOOT/grub.cfg root
> +set prefix=($root)/EFI/BOOT
> diff --git a/meta/recipes-bsp/grub/grub-efi-native_2.00.bb b/meta/recipes-bsp/grub/grub-efi-native_2.00.bb
> index 2d3d68a..04973b5 100644
> --- a/meta/recipes-bsp/grub/grub-efi-native_2.00.bb
> +++ b/meta/recipes-bsp/grub/grub-efi-native_2.00.bb
> @@ -23,6 +23,7 @@ PR = "r2"
>  PN := "grub-efi-${TRANSLATED_TARGET_ARCH}-native"
>  
>  SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \
> +           file://cfg \
>             file://grub-2.00-fpmath-sse-387-fix.patch \
>             file://grub-2.00-fix-enable_execute_stack-check.patch \
>             file://grub-2.00-disable-help2man.patch \
> @@ -66,9 +67,11 @@ EXTRA_OECONF = "--with-platform=efi --disable-grub-mkfont \
>                  --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
>  
>  do_mkimage() {
> -	./grub-mkimage -p /EFI/BOOT -d ./grub-core/ \
> +	# Search for the grub.cfg on the local boot media by using the
> +	# built in cfg file provided via this recipe
> +	./grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
>  	               -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \
> -	               boot linux ext2 fat serial part_msdos part_gpt normal efi_gop
> +	               boot linux ext2 fat serial part_msdos part_gpt normal efi_gop iso9660 search
>  }
>  addtask mkimage after do_compile before do_install
>  

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel




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

* Re: [v2 PATCH 5/7] bootimage.bbclass, grub-efi.bbclass: Improve EFI & PCBIOS+EFI ISO support
  2013-09-14  0:09 ` [v2 PATCH 5/7] bootimage.bbclass, grub-efi.bbclass: Improve EFI & PCBIOS+EFI ISO support Jason Wessel
@ 2013-09-16 17:30   ` Darren Hart
  2013-09-17 11:08     ` Jason Wessel
  0 siblings, 1 reply; 21+ messages in thread
From: Darren Hart @ 2013-09-16 17:30 UTC (permalink / raw)
  To: Jason Wessel; +Cc: Openembedded-core

On Fri, 2013-09-13 at 19:09 -0500, Jason Wessel wrote:
> Using the latest mkisofs it is possible to generate 3 different types
> of ISO images, which can be used in various scenarios.
> 
> 1) PCBIOS Only ISO
>    - This option remains unchanged by this commit
>    - Uses syslinux menus
>    - Can be directly copied with dd to a USB device
>    - Can be burned to optical media
> 
> 2) EFI Only ISO
>    - Uses grub 2 menus
>    - Can be burned to optical media
>    - If you want to use this image on a USB device
>      extra steps must be taken in order to format the USB
>      device with fat32, and copy an EFI loader which will
>      in turn load the iso image
> 
> 3) PCBIOS / EFI ISO
>    - This is a hybrid image ISO that will work for case 1 or 2
>      as above with the same restrictions and boot menu types
>      depending on what type of firmware is installed on
>      the hardware or depending on if EFI or "Legacy Boot" is
>      enabled on some UEFI firmwares.
> 
> The syslinux.bbclass is now always required because that is where the
> isohybrid dependencies come from as well as the configuration data for
> the isohybrid.  The isohybrid is the secret sauce which allows the ISO
> to work as optical media or as a disk image on USB or a HDD/SSD.
> 
> [YOCTO #4100]
> 
> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
> ---
>  meta/classes/bootimg.bbclass  |   33 +++++++++++++++++++++------------
>  meta/classes/grub-efi.bbclass |    8 ++++++++
>  2 files changed, 29 insertions(+), 12 deletions(-)
> 
> diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
> index bd211fb..756a287 100644
> --- a/meta/classes/bootimg.bbclass
> +++ b/meta/classes/bootimg.bbclass
> @@ -32,6 +32,7 @@ EXCLUDE_FROM_WORLD = "1"
>  
>  HDDDIR = "${S}/hddimg"
>  ISODIR = "${S}/iso"
> +EFIIMGDIR = "${S}/efi_img"
>  
>  BOOTIMG_VOLUME_ID   ?= "boot"
>  BOOTIMG_EXTRA_SPACE ?= "512"
> @@ -48,15 +49,10 @@ def pcbios(d):
>          pcbios = base_contains("MACHINE_FEATURES", "efi", "0", "1", d)
>      return pcbios
>  
> -def pcbios_class(d):
> -    if d.getVar("PCBIOS", True) == "1":
> -        return "syslinux"
> -    return ""
> -
>  PCBIOS = "${@pcbios(d)}"
> -PCBIOS_CLASS = "${@pcbios_class(d)}"
>  
> -inherit ${PCBIOS_CLASS}
> +# The syslinux is required for the isohybrid command and boot catalog
> +inherit syslinux
>  inherit ${EFI_CLASS}
>  
>  populate() {
> @@ -90,21 +86,34 @@ build_iso() {
>  	fi
>  	if [ "${EFI}" = "1" ]; then
>  		grubefi_iso_populate
> +		build_fat_img ${EFIIMGDIR} ${ISODIR}/efi.img
>  	fi
>  
> -	if [ "${PCBIOS}" = "1" ]; then
> +	# EFI only
> +	if [ "${PCBIOS}" != "1" ] && [ "${EFI}" = "1" ] ; then
> +		mkdir -p ${ISODIR}/${ISOLINUXDIR}
> +		install -m 0644 ${STAGING_DATADIR}/syslinux/isolinux.bin ${ISODIR}${ISOLINUXDIR}

If it's EFI-only, we copy isolinux.bin over? I was under the impression
isolinux.bin was a PCBIOS thing (specifically an executable that
wouldn't even work in an EFI environment). How is this used with an
EFI-only image? What am I missing?

> +	fi
> +
> +	if [ "${PCBIOS}" = "1" ] && [ "${EFI}" != "1" ] ; then
> +		# PCBIOS only media
>  		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} \
> +		# EFI only OR EFI+PCIBIOS

Nit: s/PCIBIOS/PCBIOS/

...

Thanks,

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel




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

* Re: [v2 PATCH 6/7] grub-efi.bbclass: Add serial and graphics menu options
  2013-09-14  0:09 ` [v2 PATCH 6/7] grub-efi.bbclass: Add serial and graphics menu options Jason Wessel
@ 2013-09-16 17:50   ` Darren Hart
  0 siblings, 0 replies; 21+ messages in thread
From: Darren Hart @ 2013-09-16 17:50 UTC (permalink / raw)
  To: Jason Wessel; +Cc: Openembedded-core

On Fri, 2013-09-13 at 19:09 -0500, Jason Wessel wrote:
> The syslinux.bbclass already has support for automatically generated
> serial and graphics menu choices.  This patch adds the same concept to
> the grub-efi menu.  That makes it possible to generate a single image
> which can boot on a PCBIOS or EFI firmware with consistent looking
> boot options.
> 
> [YOCTO #4100]
> 
> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>

Ongoing discussion in previous series on the use of GRUB_SERIAL. I think
I'm missing something, but I want to be sure... see V1 thread...

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel




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

* Re: [v2 PATCH 7/7] bootimage.bbclass, zisofs-tools-native: add ability to compress ISO images
  2013-09-14  0:09 ` [v2 PATCH 7/7] bootimage.bbclass, zisofs-tools-native: add ability to compress ISO images Jason Wessel
@ 2013-09-16 17:57   ` Darren Hart
  2013-09-17 11:13     ` Jason Wessel
  0 siblings, 1 reply; 21+ messages in thread
From: Darren Hart @ 2013-09-16 17:57 UTC (permalink / raw)
  To: Jason Wessel; +Cc: Openembedded-core

On Fri, 2013-09-13 at 19:09 -0500, Jason Wessel wrote:
> The mkzftree is needed to allow ISO images to be compressed with
> minimal runtime overhead.  Below is an example of the savings on a
> core-image-minimal.
> 
> Before ls -l:
> 24117248 core-image-minimal-qemux86-64.iso
> 
> Using the mkzftree ls -l:
> 16777216 core-image-minimal-qemux86-64.iso
> 
> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
> ---
>  meta/classes/bootimg.bbclass                       |   24 +++++++++++++++++---
>  .../zisofs-tools/zisofs-tools-native_1.0.8.bb      |   19 ++++++++++++++++
>  2 files changed, 40 insertions(+), 3 deletions(-)
>  create mode 100644 meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb
> 
> diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
> index 756a287..e9e4e8d 100644
> --- a/meta/classes/bootimg.bbclass
> +++ b/meta/classes/bootimg.bbclass
> @@ -19,13 +19,15 @@
>  
>  # External variables (also used by syslinux.bbclass)
>  # ${INITRD} - indicates a filesystem image to use as an initrd (optional)
> +# ${COMPRESSISO} - Transparent compress ISO, reduce size ~40% if set to 1
>  # ${NOISO}  - skip building the ISO image if set to 1
>  # ${NOHDD}  - skip building the HDD image if set to 1
>  # ${ROOTFS} - indicates a filesystem image to include as the root filesystem (optional)
>  
>  do_bootimg[depends] += "dosfstools-native:do_populate_sysroot \
>                          mtools-native:do_populate_sysroot \
> -                        cdrtools-native:do_populate_sysroot"
> +                        cdrtools-native:do_populate_sysroot \
> +                        ${@oe.utils.ifelse(d.getVar('COMPRESSISO'),'zisofs-tools-native:do_populate_sysroot','')}"
>  
>  PACKAGES = " "
>  EXCLUDE_FROM_WORLD = "1"
> @@ -33,6 +35,8 @@ EXCLUDE_FROM_WORLD = "1"
>  HDDDIR = "${S}/hddimg"
>  ISODIR = "${S}/iso"
>  EFIIMGDIR = "${S}/efi_img"
> +COMPACT_ISODIR = "${S}/iso.z"
> +COMPRESSISO ?= ""


Would an explicit '0' here be better?


>  
>  BOOTIMG_VOLUME_ID   ?= "boot"
>  BOOTIMG_EXTRA_SPACE ?= "512"
> @@ -95,18 +99,32 @@ build_iso() {
>  		install -m 0644 ${STAGING_DATADIR}/syslinux/isolinux.bin ${ISODIR}${ISOLINUXDIR}
>  	fi
>  
> +	if [ "${COMPRESSISO}" = "1" ] ; then
> +		# create compact directory, compress iso
> +		mkdir -p ${COMPACT_ISODIR}
> +		mkzftree -z 9 -p 4 -F ${ISODIR}/rootfs.img ${COMPACT_ISODIR}/rootfs.img
> +
> +		# move compact iso to iso, then remove compact directory
> +		mv ${COMPACT_ISODIR}/rootfs.img ${ISODIR}/rootfs.img
> +		rm -Rf ${COMPACT_ISODIR}
> +		mkisofs_compress_opts="-R -z -D -l"
> +	else
> +		mkisofs_compress_opts="-r"
> +	fi
> +
>  	if [ "${PCBIOS}" = "1" ] && [ "${EFI}" != "1" ] ; then
>  		# PCBIOS only media
>  		mkisofs -V ${BOOTIMG_VOLUME_ID} \
>  		        -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
> -			-b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} -r \
> +			-b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} \
> +			$mkisofs_compress_opts \
>  			${MKISOFS_OPTIONS} ${ISODIR}
>  	else
>  		# EFI only OR EFI+PCIBIOS
>  		mkisofs -A ${BOOTIMG_VOLUME_ID} -V ${BOOTIMG_VOLUME_ID} \
>  		        -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
>  			-b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} \
> -			-r ${MKISOFS_OPTIONS} \
> +			$mkisofs_compress_opts ${MKISOFS_OPTIONS} \
>  			-eltorito-alt-boot -eltorito-platform efi \
>  			-b efi.img -no-emul-boot \
>  			${ISODIR}


OK...


> diff --git a/meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb b/meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb
> new file mode 100644
> index 0000000..1501307
> --- /dev/null
> +++ b/meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb
> @@ -0,0 +1,19 @@
> +# zisofs-tools-native OE build file
> +# Copyright (C) 1989, 1991 Free Software Foundation, Inc.
> +SUMMARY = "A set of tools for iso file compression"
> +DESCRIPTION = "A set of tools for iso file compression"
> +HOMEPAGE = "http://http://freecode.com/projects/zisofs-tools"
> +SECTION = "console/utils"
> +LICENSE = "GPLv2"
> +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
> +
> +SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/zisofs-tools/zisofs-tools-${PV}.tar.bz2/2d0ed8c9a1f60b45f949b136f9be1f6c/zisofs-tools-${PV}.tar.bz2"
> +
> +SRC_URI[md5sum] = "2d0ed8c9a1f60b45f949b136f9be1f6c"
> +SRC_URI[sha256sum] = "ae4e53e4914934d41660248fb59d3c8761f1f1fd180d5ec993c17ddb3afd04f3"
> +
> +inherit native
> +
> +do_install() {
> +	oe_runmake install INSTALLROOT=${D} bindir=${bindir}
> +}

Does EXTRA_OEMAKE not work here? I see it isn't listed in the reference
manual for the install step (just the compile step), so perhaps not.
Just wanted to check.

Generally speaking, I think this looks fine though and I don't object to
it going in as-is.

Reviewed-by: Darren Hart <dvhart@linux.intel.com>


-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel




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

* Re: [v2 PATCH 4/7] syslinux.bbclass, syslinux: Update to syslinux 6.01
  2013-09-14 13:16       ` Martin Jansa
@ 2013-09-16 18:10         ` Darren Hart
  2013-09-16 19:31           ` Martin Jansa
  0 siblings, 1 reply; 21+ messages in thread
From: Darren Hart @ 2013-09-16 18:10 UTC (permalink / raw)
  To: Martin Jansa; +Cc: Openembedded-core

[-- Attachment #1: Type: text/plain, Size: 2311 bytes --]

On Sat, 2013-09-14 at 15:16 +0200, Martin Jansa wrote:
> On Sat, Sep 14, 2013 at 07:19:43AM -0500, Jason Wessel wrote:
> > On 09/14/2013 03:05 AM, Martin Jansa wrote:
> > > On Fri, Sep 13, 2013 at 07:09:00PM -0500, Jason Wessel wrote:
> > >> A newer version of syslinux is required for an EFI enabled isohybrid.
> > >> This is used for the the capability to generate 3 types of ISO images,
> > >> all of which can be booted off a USB device or HDD if copied with dd.
> > >>
> > >> 1) PC BIOS only ISO
> > >> 2) EFI only ISO
> > >> 3) EFI + PC BIOS ISO
> > >>
> > >> The syslinux.bbclass required a minor tweak because ldlinux.c32 is
> > >> dynamically loaded and needs to be in the created media as of syslinux
> > >> 5 and up.
> > >
> > > Hi Jason,
> > >
> > > can you please look at
> > > https://bugzilla.yoctoproject.org/show_bug.cgi?id=3944
> > > ?
> > 
> > 
> > I can look at fixing the defect, but there is no description of how to use the directdisk to see the problem.  Could you provide an example?
> > 
> > I added the directdisk to IMAGE_FSTYPES, but didn't get a .directdisk in the deploy directory so that is not how it works.   Also I think the right solution is to simply call syslinux_hddimg_populate() from the directdisk class vs having copied code for the install of the syslinux specific files (that is how 1/2 the problem occurred in the first place).
> > 
> > Back to this particular patch, the ldlinux.c32 change does not affect the bootdirect class.  The ldlinux.c32 is only required for isolinux and the copy is contained with in the inherited syslinux class.
> 
> You can reproduce it by adding vmdk to IMAGE_FSTYPES and building e.g.
> qemux86 and trying to boot it in VirtualBox.
> 
> It will always enable tty0 and only way to disable it now is to enable
> menu, but that doesn't work with vmdk images because of missing
> vesamenu.c32
> 

Thanks for catching that Martin.

I agree that the SYSLINUX_SERIAL needs to be respected regardless of if
menu is set.

It should be acceptable to install vesamenu.c32 I would think, although
it sounds as though there is some work to perform to make sure
bootdirect uses all the new infrastructure as well.

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 501 bytes --]

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

* Re: [v2 PATCH 4/7] syslinux.bbclass, syslinux: Update to syslinux 6.01
  2013-09-16 18:10         ` Darren Hart
@ 2013-09-16 19:31           ` Martin Jansa
  0 siblings, 0 replies; 21+ messages in thread
From: Martin Jansa @ 2013-09-16 19:31 UTC (permalink / raw)
  To: Darren Hart; +Cc: Openembedded-core

[-- Attachment #1: Type: text/plain, Size: 2682 bytes --]

On Mon, Sep 16, 2013 at 11:10:17AM -0700, Darren Hart wrote:
> On Sat, 2013-09-14 at 15:16 +0200, Martin Jansa wrote:
> > On Sat, Sep 14, 2013 at 07:19:43AM -0500, Jason Wessel wrote:
> > > On 09/14/2013 03:05 AM, Martin Jansa wrote:
> > > > On Fri, Sep 13, 2013 at 07:09:00PM -0500, Jason Wessel wrote:
> > > >> A newer version of syslinux is required for an EFI enabled isohybrid.
> > > >> This is used for the the capability to generate 3 types of ISO images,
> > > >> all of which can be booted off a USB device or HDD if copied with dd.
> > > >>
> > > >> 1) PC BIOS only ISO
> > > >> 2) EFI only ISO
> > > >> 3) EFI + PC BIOS ISO
> > > >>
> > > >> The syslinux.bbclass required a minor tweak because ldlinux.c32 is
> > > >> dynamically loaded and needs to be in the created media as of syslinux
> > > >> 5 and up.
> > > >
> > > > Hi Jason,
> > > >
> > > > can you please look at
> > > > https://bugzilla.yoctoproject.org/show_bug.cgi?id=3944
> > > > ?
> > > 
> > > 
> > > I can look at fixing the defect, but there is no description of how to use the directdisk to see the problem.  Could you provide an example?
> > > 
> > > I added the directdisk to IMAGE_FSTYPES, but didn't get a .directdisk in the deploy directory so that is not how it works.   Also I think the right solution is to simply call syslinux_hddimg_populate() from the directdisk class vs having copied code for the install of the syslinux specific files (that is how 1/2 the problem occurred in the first place).
> > > 
> > > Back to this particular patch, the ldlinux.c32 change does not affect the bootdirect class.  The ldlinux.c32 is only required for isolinux and the copy is contained with in the inherited syslinux class.
> > 
> > You can reproduce it by adding vmdk to IMAGE_FSTYPES and building e.g.
> > qemux86 and trying to boot it in VirtualBox.
> > 
> > It will always enable tty0 and only way to disable it now is to enable
> > menu, but that doesn't work with vmdk images because of missing
> > vesamenu.c32
> > 
> 
> Thanks for catching that Martin.
> 
> I agree that the SYSLINUX_SERIAL needs to be respected regardless of if
> menu is set.

Yes, that would preserve existing behavior, not everybody wants to
have menu.

> It should be acceptable to install vesamenu.c32 I would think, although
> it sounds as though there is some work to perform to make sure
> bootdirect uses all the new infrastructure as well.

Yes it would be nice to have the possibility to enable menu, it can even
be enabled by default once it's working properly and there is an option
to disable it.

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

* Re: [v2 PATCH 5/7] bootimage.bbclass, grub-efi.bbclass: Improve EFI & PCBIOS+EFI ISO support
  2013-09-16 17:30   ` Darren Hart
@ 2013-09-17 11:08     ` Jason Wessel
  0 siblings, 0 replies; 21+ messages in thread
From: Jason Wessel @ 2013-09-17 11:08 UTC (permalink / raw)
  To: Darren Hart; +Cc: Openembedded-core

On 09/16/2013 12:30 PM, Darren Hart wrote:
> On Fri, 2013-09-13 at 19:09 -0500, Jason Wessel wrote:
>> -	if [ "${PCBIOS}" = "1" ]; then
>> +	# EFI only
>> +	if [ "${PCBIOS}" != "1" ] && [ "${EFI}" = "1" ] ; then
>> +		mkdir -p ${ISODIR}/${ISOLINUXDIR}
>> +		install -m 0644 ${STAGING_DATADIR}/syslinux/isolinux.bin ${ISODIR}${ISOLINUXDIR}
> 
> If it's EFI-only, we copy isolinux.bin over? I was under the impression
> isolinux.bin was a PCBIOS thing (specifically an executable that
> wouldn't even work in an EFI environment). How is this used with an
> EFI-only image? What am I missing?


There is a bug/feature in the isohybrid that requires it to be in the catalog.  I couldn't figure out how to work around it, so I left it in there.  The EFI firmware skips right over it anyway.  I can add a comment to the bbclass to this effect.



> 
>> +	fi
>> +
>> +	if [ "${PCBIOS}" = "1" ] && [ "${EFI}" != "1" ] ; then
>> +		# PCBIOS only media
>>  		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} \
>> +		# EFI only OR EFI+PCIBIOS
> 
> Nit: s/PCIBIOS/PCBIOS/


Oops, all fixed in v3. :-)

Jason.



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

* Re: [v2 PATCH 7/7] bootimage.bbclass, zisofs-tools-native: add ability to compress ISO images
  2013-09-16 17:57   ` Darren Hart
@ 2013-09-17 11:13     ` Jason Wessel
  0 siblings, 0 replies; 21+ messages in thread
From: Jason Wessel @ 2013-09-17 11:13 UTC (permalink / raw)
  To: Darren Hart; +Cc: Openembedded-core

On 09/16/2013 12:57 PM, Darren Hart wrote:
> On Fri, 2013-09-13 at 19:09 -0500, Jason Wessel wrote:
>> +COMPRESSISO ?= ""
> 
> 
> Would an explicit '0' here be better?


That is fine by me.

>> +
>> +do_install() {
>> +	oe_runmake install INSTALLROOT=${D} bindir=${bindir}
>> +}
> 
> Does EXTRA_OEMAKE not work here? I see it isn't listed in the reference
> manual for the install step (just the compile step), so perhaps not.
> Just wanted to check.



It does not work.  I could patch the Makefile to make it work but I don't think it is worth it, vs just leaving things unchanged for future uprev ease.


Cheers,
Jason.


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

end of thread, other threads:[~2013-09-17 11:13 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-14  0:08 [v2 PATCH 0/7] Improved EFI boot support Jason Wessel
2013-09-14  0:08 ` [v2 PATCH 1/7] bootimage.bbclass: Move fat image creation into a function Jason Wessel
2013-09-16 17:12   ` Darren Hart
2013-09-14  0:08 ` [v2 PATCH 2/7] cdrtools-native: Update from 3.00 to 3.01a17 Jason Wessel
2013-09-16 17:21   ` Darren Hart
2013-09-14  0:08 ` [v2 PATCH 3/7] grub-efi-native: Add support for EFI ISO images Jason Wessel
2013-09-16 17:24   ` Darren Hart
2013-09-14  0:09 ` [v2 PATCH 4/7] syslinux.bbclass, syslinux: Update to syslinux 6.01 Jason Wessel
2013-09-14  8:05   ` Martin Jansa
2013-09-14 12:19     ` Jason Wessel
2013-09-14 13:16       ` Martin Jansa
2013-09-16 18:10         ` Darren Hart
2013-09-16 19:31           ` Martin Jansa
2013-09-14  0:09 ` [v2 PATCH 5/7] bootimage.bbclass, grub-efi.bbclass: Improve EFI & PCBIOS+EFI ISO support Jason Wessel
2013-09-16 17:30   ` Darren Hart
2013-09-17 11:08     ` Jason Wessel
2013-09-14  0:09 ` [v2 PATCH 6/7] grub-efi.bbclass: Add serial and graphics menu options Jason Wessel
2013-09-16 17:50   ` Darren Hart
2013-09-14  0:09 ` [v2 PATCH 7/7] bootimage.bbclass, zisofs-tools-native: add ability to compress ISO images Jason Wessel
2013-09-16 17:57   ` Darren Hart
2013-09-17 11:13     ` Jason Wessel

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