Skip to contentSkip to conversation

Improved EFI boot support

PATCH In review Jason Wessel 2 participants 18 messages Sep 17, 2013 – Sep 21, 2013

lore
Share & tools
lore
#0 lore raw

v3 cover Improved EFI boot support

V3
- Add comment about isolinux.bin required in EFI only case
- Fix typo of PCIBIOS -> PCBIOS
- Change COMPRESSISO ?= "" -> COMPRESSISO ?= "0" for the default
- Add comment to EFI/ISO syslinux.bbclass to clarify workaround with EFI only case and hybrid boot
- Add patch to fix syslinux serial and menu problems
- Add patch to fix boot-directdisk.bbclass
* Two new patches are 7 & 8, the zisofs patch moved from 7 -> 9

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.

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

#1 lore raw

PATCH v3 1/9 bootimage.bbclass: Move fat image creation into a function

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]

---
 meta/classes/bootimg.bbclass |  110 ++++++++++++++++++++++--------------------
 1 file changed, 58 insertions(+), 52 deletions(-)
meta/classes/bootimg.bbclass +58 -52
index 90a241d..bd211fb 100644
@@ -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
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v3 2/9 cdrtools-native: Update from 3.00 to 3.01a17

In reply to Jason Wessel

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]

---
 ...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%)
meta/recipes-devtools/cdrtools/cdrtools-native_3.01a17.bb renamed from meta/recipes-devtools/cdrtools/cdrtools-native_3.00.bb +8 -14
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
@@ -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}
 }
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH v3 3/9 grub-efi-native: Add support for EFI ISO images

In reply to Jason Wessel

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]

---
 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
meta/recipes-bsp/grub/files/cfg new file +2 -0
new file mode 100644
index 0000000..ffffe47
@@ -0,0 +1,2 @@
+search.file /EFI/BOOT/grub.cfg root
+set prefix=($root)/EFI/BOOT
meta/recipes-bsp/grub/grub-efi-native_2.00.bb +5 -2
index 2d3d68a..04973b5 100644
@@ -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
 
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH v3 4/9 syslinux.bbclass, syslinux: Update to syslinux 6.01

In reply to Jason Wessel

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 a few .c32 libraries require dynamic loading from the created media as of syslinux 5 and up. This was a good time to also fix the duplication of the AUTO_SYSLINUXMENU block.

[YOCTO #4100]

---
 meta/classes/syslinux.bbclass                      |   21 +++++++---------
 .../{syslinux_4.07.bb => syslinux_6.01.bb}         |   26 ++++++++++++--------
 2 files changed, 25 insertions(+), 22 deletions(-)
 rename meta/recipes-devtools/syslinux/{syslinux_4.07.bb => syslinux_6.01.bb} (63%)
meta/classes/syslinux.bbclass +9 -12
index dae6609..223e4dc 100644
@@ -36,28 +36,25 @@ syslinux_populate() {
 
 	# Install the config files
 	install -m 0644 ${SYSLINUXCFG} ${DEST}${BOOTDIR}/${CFGNAME}
+	if [ "${AUTO_SYSLINUXMENU}" = 1 ] ; then
+		install -m 0644 ${STAGING_DATADIR}/syslinux/vesamenu.c32 ${DEST}${BOOTDIR}/vesamenu.c32
+		install -m 0444 ${STAGING_DATADIR}/syslinux/libcom32.c32 ${DEST}${BOOTDIR}/libcom32.c32
+		install -m 0444 ${STAGING_DATADIR}/syslinux/libutil.c32 ${DEST}${BOOTDIR}/libutil.c32
+		if [ "${SYSLINUX_SPLASH}" != "" ] ; then
+			install -m 0644 ${SYSLINUX_SPLASH} ${DEST}${BOOTDIR}/splash.lss
+		fi
+	fi
 }
 
 syslinux_iso_populate() {
 	syslinux_populate ${ISODIR} ${ISOLINUXDIR} isolinux.cfg
 	install -m 0644 ${STAGING_DATADIR}/syslinux/isolinux.bin ${ISODIR}${ISOLINUXDIR}
-	if [ "${AUTO_SYSLINUXMENU}" = 1 ] ; then
-		install -m 0644 ${STAGING_DATADIR}/syslinux/vesamenu.c32 ${ISODIR}${ISOLINUXDIR}/vesamenu.c32
-		if [ "${SYSLINUX_SPLASH}" != "" ] ; then
-			install -m 0644 ${SYSLINUX_SPLASH} ${ISODIR}${ISOLINUXDIR}/splash.lss
-		fi
-	fi
+	install -m 0644 ${STAGING_DATADIR}/syslinux/ldlinux.c32 ${ISODIR}${ISOLINUXDIR}
 }
 
 syslinux_hddimg_populate() {
 	syslinux_populate ${HDDDIR} ${SYSLINUXDIR} syslinux.cfg
 	install -m 0444 ${STAGING_DATADIR}/syslinux/ldlinux.sys ${HDDDIR}${SYSLINUXDIR}/ldlinux.sys
-	if [ "${AUTO_SYSLINUXMENU}" = 1 ] ; then
-		install -m 0644 ${STAGING_DATADIR}/syslinux/vesamenu.c32 ${HDDDIR}${SYSLINUXDIR}/vesamenu.c32
-		if [ "${SYSLINUX_SPLASH}" != "" ] ; then
-			install -m 0644 ${SYSLINUX_SPLASH} ${HDDDIR}${SYSLINUXDIR}/splash.lss
-		fi
-	fi
 }
 
 syslinux_hddimg_install() {
meta/recipes-devtools/syslinux/syslinux_6.01.bb renamed from meta/recipes-devtools/syslinux/syslinux_4.07.bb +16 -10
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
@@ -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"
Signature · 1 line
1.7.9.5
Reviewed-by on v3 4/9
#5 lore raw

Re: [v3 PATCH 4/9] syslinux.bbclass, syslinux: Update to syslinux 6.01

Quoted 8 lines · Jason Wessel

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

Quoted 8 lines

The syslinux.bbclass required a minor tweak because a few .c32 libraries require dynamic loading from the created media as of syslinux 5 and up. This was a good time to also fix the duplication of the AUTO_SYSLINUXMENU block.

[YOCTO #4100]

Quoted 113 lines
---
 meta/classes/syslinux.bbclass                      |   21 +++++++---------
 .../{syslinux_4.07.bb => syslinux_6.01.bb}         |   26 ++++++++++++--------
 2 files changed, 25 insertions(+), 22 deletions(-)
 rename meta/recipes-devtools/syslinux/{syslinux_4.07.bb => syslinux_6.01.bb} (63%)
meta/classes/syslinux.bbclass +9 -12
index dae6609..223e4dc 100644
@@ -36,28 +36,25 @@ syslinux_populate() {
 
 	# Install the config files
 	install -m 0644 ${SYSLINUXCFG} ${DEST}${BOOTDIR}/${CFGNAME}
+	if [ "${AUTO_SYSLINUXMENU}" = 1 ] ; then
+		install -m 0644 ${STAGING_DATADIR}/syslinux/vesamenu.c32 ${DEST}${BOOTDIR}/vesamenu.c32
+		install -m 0444 ${STAGING_DATADIR}/syslinux/libcom32.c32 ${DEST}${BOOTDIR}/libcom32.c32
+		install -m 0444 ${STAGING_DATADIR}/syslinux/libutil.c32 ${DEST}${BOOTDIR}/libutil.c32
+		if [ "${SYSLINUX_SPLASH}" != "" ] ; then
+			install -m 0644 ${SYSLINUX_SPLASH} ${DEST}${BOOTDIR}/splash.lss
+		fi
+	fi
 }
 
 syslinux_iso_populate() {
 	syslinux_populate ${ISODIR} ${ISOLINUXDIR} isolinux.cfg
 	install -m 0644 ${STAGING_DATADIR}/syslinux/isolinux.bin ${ISODIR}${ISOLINUXDIR}
-	if [ "${AUTO_SYSLINUXMENU}" = 1 ] ; then
-		install -m 0644 ${STAGING_DATADIR}/syslinux/vesamenu.c32 ${ISODIR}${ISOLINUXDIR}/vesamenu.c32
-		if [ "${SYSLINUX_SPLASH}" != "" ] ; then
-			install -m 0644 ${SYSLINUX_SPLASH} ${ISODIR}${ISOLINUXDIR}/splash.lss
-		fi
-	fi
+	install -m 0644 ${STAGING_DATADIR}/syslinux/ldlinux.c32 ${ISODIR}${ISOLINUXDIR}
 }
 
 syslinux_hddimg_populate() {
 	syslinux_populate ${HDDDIR} ${SYSLINUXDIR} syslinux.cfg
 	install -m 0444 ${STAGING_DATADIR}/syslinux/ldlinux.sys ${HDDDIR}${SYSLINUXDIR}/ldlinux.sys
-	if [ "${AUTO_SYSLINUXMENU}" = 1 ] ; then
-		install -m 0644 ${STAGING_DATADIR}/syslinux/vesamenu.c32 ${HDDDIR}${SYSLINUXDIR}/vesamenu.c32
-		if [ "${SYSLINUX_SPLASH}" != "" ] ; then
-			install -m 0644 ${SYSLINUX_SPLASH} ${HDDDIR}${SYSLINUXDIR}/splash.lss
-		fi
-	fi
 }
 
 syslinux_hddimg_install() {
meta/recipes-devtools/syslinux/syslinux_6.01.bb renamed from meta/recipes-devtools/syslinux/syslinux_4.07.bb +16 -10
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
@@ -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"
Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#6 lore raw

PATCH v3 5/9 bootimage.bbclass, grub-efi.bbclass: Improve EFI & PCBIOS+EFI ISO support

In reply to Jason Wessel

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]

---
 meta/classes/bootimg.bbclass  |   35 +++++++++++++++++++++++------------
 meta/classes/grub-efi.bbclass |    8 ++++++++
 2 files changed, 31 insertions(+), 12 deletions(-)
meta/classes/bootimg.bbclass +23 -12
index bd211fb..fdd4ea9 100644
@@ -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,36 @@ 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
+		# Work around bug in isohybrid where it requires isolinux.bin
+		# In the boot catalog, even though it is not used
+		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+PCBIOS
+		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
meta/classes/grub-efi.bbclass +8 -0
index c6f5d4e..c21babb 100644
@@ -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() {
Signature · 1 line
1.7.9.5
Reviewed-by on v3 5/9
#7 lore raw

Re: [v3 PATCH 5/9] bootimage.bbclass, grub-efi.bbclass: Improve EFI & PCBIOS+EFI ISO support

Quoted 24 lines · Jason Wessel

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.

Quoted 8 lines

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]

Quoted 96 lines
---
 meta/classes/bootimg.bbclass  |   35 +++++++++++++++++++++++------------
 meta/classes/grub-efi.bbclass |    8 ++++++++
 2 files changed, 31 insertions(+), 12 deletions(-)
meta/classes/bootimg.bbclass +23 -12
index bd211fb..fdd4ea9 100644
@@ -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,36 @@ 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
+		# Work around bug in isohybrid where it requires isolinux.bin
+		# In the boot catalog, even though it is not used
+		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+PCBIOS
+		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
meta/classes/grub-efi.bbclass +8 -0
index c6f5d4e..c21babb 100644
@@ -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() {
Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#8 lore raw

PATCH v3 6/9 grub-efi.bbclass: Add serial and graphics menu options

In reply to Jason Wessel

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]

---
 meta/classes/grub-efi.bbclass |   41 +++++++++++++++++++++++++++--------------
 1 file changed, 27 insertions(+), 14 deletions(-)
meta/classes/grub-efi.bbclass +27 -14
index c21babb..ffbcf4c 100644
@@ -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", "" ],
+            [ " 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()
 }
Signature · 1 line
1.7.9.5
Reviewed-by on v3 6/9
#9 lore raw

Re: [v3 PATCH 6/9] grub-efi.bbclass: Add serial and graphics menu options

Quoted 9 lines · Jason Wessel

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]

I think I finally get GRUB_SERIAL. GRUB_SERIAL is intended to be bootloader menu specific secondary console parameter passed to the Linux kernel if it's set. The BSP console= options are still used from the APPEND variable.

GRUB_SERIAL needs to be documented in the glossary, Scott R. on Cc.

Quoted 88 lines
---
 meta/classes/grub-efi.bbclass |   41 +++++++++++++++++++++++++++--------------
 1 file changed, 27 insertions(+), 14 deletions(-)
meta/classes/grub-efi.bbclass +27 -14
index c21babb..ffbcf4c 100644
@@ -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", "" ],
+            [ " 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()
 }
Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#10 lore raw

PATCH v3 7/9 syslinux.bbclass: Fix hard coding of console=tty*

In reply to Jason Wessel

The SYSLINUX_SERIAL variable was hard coded and occasionally needs to be different for the kernel argument vs the syslinux argument.

In the auto-generated boot mode console=tty0 was hard coded, and this is not needed at all, and causes problems in some cases if a end user wanted to change the console=... via the kernel boot argument APPEND mechanism. The default can be forced with SYSLINUX_DEFAULT_CONSOLE for systems that need a special specification to enable the frame buffer instead of a serial port.

[YOCTO #3944]

---
 meta/classes/syslinux.bbclass |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
meta/classes/syslinux.bbclass +11 -3
index 223e4dc..91b9731 100644
@@ -12,7 +12,9 @@
 # ${APPEND} - an override list of append strings for each label
 # ${SYSLINUX_OPTS} - additional options to add to the syslinux file ';' delimited
 # ${SYSLINUX_SPLASH} - A background for the vga boot menu if using the boot menu
+# ${SYSLINUX_DEFAULT_CONSOLE} - set to "console=ttyX" to change kernel boot default console
 # ${SYSLINUX_SERIAL} - Set an alternate serial port or turn off serial with empty string
+# ${SYSLINUX_SERIAL_TTY} - Set alternate console=tty... kernel boot argument
 
 do_bootimg[depends] += "syslinux:do_populate_sysroot \
                         syslinux-native:do_populate_sysroot"
@@ -21,7 +23,11 @@ SYSLINUXCFG  = "${S}/syslinux.cfg"
 
 ISOLINUXDIR = "/isolinux"
 SYSLINUXDIR = "/"
+# The kernel has an internal default console, which you can override with
+# a console=...some_tty...
+SYSLINUX_DEFAULT_CONSOLE ?= ""
 SYSLINUX_SERIAL ?= "0 115200"
+SYSLINUX_SERIAL_TTY ?= "ttyS0,115200"
 ISO_BOOTIMG = "isolinux/isolinux.bin"
 ISO_BOOTCAT = "isolinux/boot.cat"
 MKISOFS_OPTIONS = "-no-emul-boot -boot-load-size 4 -boot-info-table"
@@ -102,6 +108,8 @@ python build_syslinux_cfg () {
             cfgfile.write('%s\n' % opt)
 
     cfgfile.write('ALLOWOPTIONS 1\n');
+    syslinux_default_console = d.getVar('SYSLINUX_DEFAULT_CONSOLE', True)
+    syslinux_serial_tty = d.getVar('SYSLINUX_SERIAL_TTY', True)
     syslinux_serial = d.getVar('SYSLINUX_SERIAL', True)
     if syslinux_serial:
         cfgfile.write('SERIAL %s\n' % syslinux_serial)
@@ -144,10 +152,10 @@ python build_syslinux_cfg () {
         localdata.setVar('OVERRIDES', label + ':' + overrides)
         bb.data.update_data(localdata)
     
-        btypes = [ [ "", "console=tty0" ] ]
+        btypes = [ [ "", syslinux_default_console ] ]
         if menu and syslinux_serial:
-            btypes = [ [ "Graphics console ", " console=tty0" ],
-                [ "Serial console ",  " console=ttyS0,115200" ] ]
+            btypes = [ [ "Graphics console ", syslinux_default_console  ],
+                [ "Serial console ", syslinux_serial_tty ] ]
 
         for btype in btypes:
             cfgfile.write('LABEL %s%s\nKERNEL /vmlinuz\n' % (btype[0], label))
Signature · 1 line
1.7.9.5
Reviewed-by on v3 7/9
#11 lore raw

Re: [v3 PATCH 7/9] syslinux.bbclass: Fix hard coding of console=tty*

Quoted 10 lines · Jason Wessel

The SYSLINUX_SERIAL variable was hard coded and occasionally needs to be different for the kernel argument vs the syslinux argument.

In the auto-generated boot mode console=tty0 was hard coded, and this is not needed at all, and causes problems in some cases if a end user wanted to change the console=... via the kernel boot argument APPEND mechanism. The default can be forced with SYSLINUX_DEFAULT_CONSOLE for systems that need a special specification to enable the frame buffer instead of a serial port.

Quoted 3 lines

[YOCTO #3944]

The two new variables need to be documented in the glossary, Scott R on Cc.

One question below, not blocking this though.

Quoted 43 lines
---
 meta/classes/syslinux.bbclass |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
meta/classes/syslinux.bbclass +8 -0
index 223e4dc..91b9731 100644
@@ -12,7 +12,9 @@
 # ${APPEND} - an override list of append strings for each label
 # ${SYSLINUX_OPTS} - additional options to add to the syslinux file ';' delimited
 # ${SYSLINUX_SPLASH} - A background for the vga boot menu if using the boot menu
+# ${SYSLINUX_DEFAULT_CONSOLE} - set to "console=ttyX" to change kernel boot default console
 # ${SYSLINUX_SERIAL} - Set an alternate serial port or turn off serial with empty string
+# ${SYSLINUX_SERIAL_TTY} - Set alternate console=tty... kernel boot argument
 
 do_bootimg[depends] += "syslinux:do_populate_sysroot \
                         syslinux-native:do_populate_sysroot"
@@ -21,7 +23,11 @@ SYSLINUXCFG  = "${S}/syslinux.cfg"
 
 ISOLINUXDIR = "/isolinux"
 SYSLINUXDIR = "/"
+# The kernel has an internal default console, which you can override with
+# a console=...some_tty...
+SYSLINUX_DEFAULT_CONSOLE ?= ""
 SYSLINUX_SERIAL ?= "0 115200"
+SYSLINUX_SERIAL_TTY ?= "ttyS0,115200"
 ISO_BOOTIMG = "isolinux/isolinux.bin"
 ISO_BOOTCAT = "isolinux/boot.cat"
 MKISOFS_OPTIONS = "-no-emul-boot -boot-load-size 4 -boot-info-table"
@@ -102,6 +108,8 @@ python build_syslinux_cfg () {
             cfgfile.write('%s\n' % opt)
 
     cfgfile.write('ALLOWOPTIONS 1\n');
+    syslinux_default_console = d.getVar('SYSLINUX_DEFAULT_CONSOLE', True)
+    syslinux_serial_tty = d.getVar('SYSLINUX_SERIAL_TTY', True)
     syslinux_serial = d.getVar('SYSLINUX_SERIAL', True)
     if syslinux_serial:
         cfgfile.write('SERIAL %s\n' % syslinux_serial)
@@ -144,10 +152,10 @@ python build_syslinux_cfg () {
         localdata.setVar('OVERRIDES', label + ':' + overrides)
         bb.data.update_data(localdata)
 

meta/classes/syslinux.bbclass python build_syslinux_cfg () { · line 161

Quoted 10 lines
meta/classes/syslinux.bbclass +3 -3
-        btypes = [ [ "", "console=tty0" ] ]
+        btypes = [ [ "", syslinux_default_console ] ]
         if menu and syslinux_serial:
-            btypes = [ [ "Graphics console ", " console=tty0" ],
-                [ "Serial console ",  " console=ttyS0,115200" ] ]
+            btypes = [ [ "Graphics console ", syslinux_default_console  ],
+                [ "Serial console ", syslinux_serial_tty ] ]
 
         for btype in btypes:
             cfgfile.write('LABEL %s%s\nKERNEL /vmlinuz\n' % (btype[0], label))

Is no space between the to string "%s%s" correct?

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#12 lore raw

PATCH v3 8/9 boot-directdisk.bbclass: Fix media generation problems with vmdk

In reply to Jason Wessel

The various populate methods need to accept a path as an argument vs using hard expanded variables. In the case of the boot-directdisk class it uses a different path for HDDDIR but it gets eclipsed by the the class definition at the point in time ${HDDDIR} gets expanded.

The logical fix is to pass the arguments to the functions as opposed to using globally expanded variables from the class definitions.

This patch changes 3 things:
1) syslinux_hddimg_populate takes an argument for the destination
2) syslinux_iso_populate takes an argument for the destination
3) populate is changed to boot_direct_populate because there was a conflict with it overriding the populate in bootimg.bbclass

[YOCTO #3994]

---
 meta/classes/boot-directdisk.bbclass |   16 ++++++++--------
 meta/classes/bootimg.bbclass         |    8 ++++----
 meta/classes/grub-efi.bbclass        |   13 +++++++------
 meta/classes/syslinux.bbclass        |   12 +++++++-----
 4 files changed, 26 insertions(+), 23 deletions(-)
meta/classes/boot-directdisk.bbclass +8 -8
index 4b9d7bd..c58c6f0 100644
@@ -61,15 +61,15 @@ DISK_SIGNATURE ?= "${DISK_SIGNATURE_GENERATED}"
 SYSLINUX_ROOT ?= "root=/dev/sda2"
 SYSLINUX_TIMEOUT ?= "10"
 
-populate() {
-	DEST=$1
-	install -d ${DEST}
+boot_direct_populate() {
+	dest=$1
+	install -d $dest
 
 	# Install bzImage, initrd, and rootfs.img in DEST for all loaders to use.
-	install -m 0644 ${STAGING_KERNEL_DIR}/bzImage ${DEST}/vmlinuz
+	install -m 0644 ${STAGING_KERNEL_DIR}/bzImage $dest/vmlinuz
 
 	if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then
-		install -m 0644 ${INITRD} ${DEST}/initrd
+		install -m 0644 ${INITRD} $dest/initrd
 	fi
 
 }
@@ -79,13 +79,13 @@ build_boot_dd() {
 	HDDIMG="${S}/hdd.image"
 	IMAGE=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hdddirect
 
-	populate ${HDDDIR}
+	boot_direct_populate $HDDDIR
 
 	if [ "${PCBIOS}" = "1" ]; then
-		syslinux_hddimg_populate
+		syslinux_hddimg_populate $HDDDIR
 	fi
 	if [ "${EFI}" = "1" ]; then
-		grubefi_hddimg_populate
+		grubefi_hddimg_populate $HDDDIR
 	fi
 
 	BLOCKS=`du -bks $HDDDIR | cut -f 1`
meta/classes/bootimg.bbclass +4 -4
index fdd4ea9..ede6e21 100644
@@ -82,10 +82,10 @@ build_iso() {
 	populate ${ISODIR}
 
 	if [ "${PCBIOS}" = "1" ]; then
-		syslinux_iso_populate
+		syslinux_iso_populate ${ISODIR}
 	fi
 	if [ "${EFI}" = "1" ]; then
-		grubefi_iso_populate
+		grubefi_iso_populate ${ISODIR}
 		build_fat_img ${EFIIMGDIR} ${ISODIR}/efi.img
 	fi
 
@@ -185,10 +185,10 @@ build_hddimg() {
 		populate ${HDDDIR}
 
 		if [ "${PCBIOS}" = "1" ]; then
-			syslinux_hddimg_populate
+			syslinux_hddimg_populate ${HDDDIR}
 		fi
 		if [ "${EFI}" = "1" ]; then
-			grubefi_hddimg_populate
+			grubefi_hddimg_populate ${HDDDIR}
 		fi
 
 		build_fat_img ${HDDDIR} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
meta/classes/grub-efi.bbclass +7 -6
index ffbcf4c..cd6651e 100644
@@ -42,19 +42,20 @@ grubefi_populate() {
 }
 
 grubefi_iso_populate() {
-	grubefi_populate ${ISODIR}
+	iso_dir=$1
+	grubefi_populate $iso_dir
 	# Build a EFI directory to create efi.img
 	mkdir -p ${EFIIMGDIR}/${EFIDIR}
-	cp ${ISODIR}/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR}
-	cp ${ISODIR}/vmlinuz ${EFIIMGDIR}
+	cp $iso_dir/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR}
+	cp $iso_dir/vmlinuz ${EFIIMGDIR}
 	echo "EFI\\BOOT\\${GRUB_IMAGE}" > ${EFIIMGDIR}/startup.nsh
-	if [ -f "${ISODIR}/initrd" ] ; then
-		cp ${ISODIR}/initrd ${EFIIMGDIR}
+	if [ -f "$iso_dir/initrd" ] ; then
+		cp $iso_dir/initrd ${EFIIMGDIR}
 	fi
 }
 
 grubefi_hddimg_populate() {
-	grubefi_populate ${HDDDIR}
+	grubefi_populate $1
 }
 
 python build_grub_cfg() {
meta/classes/syslinux.bbclass +7 -5
index 91b9731..944bd92 100644
@@ -53,14 +53,16 @@ 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}
+	iso_dir=$1
+	syslinux_populate $iso_dir ${ISOLINUXDIR} isolinux.cfg
+	install -m 0644 ${STAGING_DATADIR}/syslinux/isolinux.bin $iso_dir${ISOLINUXDIR}
+	install -m 0644 ${STAGING_DATADIR}/syslinux/ldlinux.c32 $iso_dir${ISOLINUXDIR}
 }
 
 syslinux_hddimg_populate() {
-	syslinux_populate ${HDDDIR} ${SYSLINUXDIR} syslinux.cfg
-	install -m 0444 ${STAGING_DATADIR}/syslinux/ldlinux.sys ${HDDDIR}${SYSLINUXDIR}/ldlinux.sys
+	hdd_dir=$1
+	syslinux_populate $hdd_dir ${SYSLINUXDIR} syslinux.cfg
+	install -m 0444 ${STAGING_DATADIR}/syslinux/ldlinux.sys $hdd_dir${SYSLINUXDIR}/ldlinux.sys
 }
 
 syslinux_hddimg_install() {
Signature · 1 line
1.7.9.5
Reviewed-by on v3 8/9
#13 lore raw

Re: [v3 PATCH 8/9] boot-directdisk.bbclass: Fix media generation problems with vmdk

Quoted 14 lines · Jason Wessel

The various populate methods need to accept a path as an argument vs using hard expanded variables. In the case of the boot-directdisk class it uses a different path for HDDDIR but it gets eclipsed by the the class definition at the point in time ${HDDDIR} gets expanded.

The logical fix is to pass the arguments to the functions as opposed to using globally expanded variables from the class definitions.

This patch changes 3 things:
1) syslinux_hddimg_populate takes an argument for the destination
2) syslinux_iso_populate takes an argument for the destination
3) populate is changed to boot_direct_populate because there was a conflict with it overriding the populate in bootimg.bbclass

Quoted 3 lines

[YOCTO #3994]

We definitely want Martin and Saul to review.

Quoted 136 lines
---
 meta/classes/boot-directdisk.bbclass |   16 ++++++++--------
 meta/classes/bootimg.bbclass         |    8 ++++----
 meta/classes/grub-efi.bbclass        |   13 +++++++------
 meta/classes/syslinux.bbclass        |   12 +++++++-----
 4 files changed, 26 insertions(+), 23 deletions(-)
meta/classes/boot-directdisk.bbclass +8 -8
index 4b9d7bd..c58c6f0 100644
@@ -61,15 +61,15 @@ DISK_SIGNATURE ?= "${DISK_SIGNATURE_GENERATED}"
 SYSLINUX_ROOT ?= "root=/dev/sda2"
 SYSLINUX_TIMEOUT ?= "10"
 
-populate() {
-	DEST=$1
-	install -d ${DEST}
+boot_direct_populate() {
+	dest=$1
+	install -d $dest
 
 	# Install bzImage, initrd, and rootfs.img in DEST for all loaders to use.
-	install -m 0644 ${STAGING_KERNEL_DIR}/bzImage ${DEST}/vmlinuz
+	install -m 0644 ${STAGING_KERNEL_DIR}/bzImage $dest/vmlinuz
 
 	if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then
-		install -m 0644 ${INITRD} ${DEST}/initrd
+		install -m 0644 ${INITRD} $dest/initrd
 	fi
 
 }
@@ -79,13 +79,13 @@ build_boot_dd() {
 	HDDIMG="${S}/hdd.image"
 	IMAGE=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hdddirect
 
-	populate ${HDDDIR}
+	boot_direct_populate $HDDDIR
 
 	if [ "${PCBIOS}" = "1" ]; then
-		syslinux_hddimg_populate
+		syslinux_hddimg_populate $HDDDIR
 	fi
 	if [ "${EFI}" = "1" ]; then
-		grubefi_hddimg_populate
+		grubefi_hddimg_populate $HDDDIR
 	fi
 
 	BLOCKS=`du -bks $HDDDIR | cut -f 1`
meta/classes/bootimg.bbclass +4 -4
index fdd4ea9..ede6e21 100644
@@ -82,10 +82,10 @@ build_iso() {
 	populate ${ISODIR}
 
 	if [ "${PCBIOS}" = "1" ]; then
-		syslinux_iso_populate
+		syslinux_iso_populate ${ISODIR}
 	fi
 	if [ "${EFI}" = "1" ]; then
-		grubefi_iso_populate
+		grubefi_iso_populate ${ISODIR}
 		build_fat_img ${EFIIMGDIR} ${ISODIR}/efi.img
 	fi
 
@@ -185,10 +185,10 @@ build_hddimg() {
 		populate ${HDDDIR}
 
 		if [ "${PCBIOS}" = "1" ]; then
-			syslinux_hddimg_populate
+			syslinux_hddimg_populate ${HDDDIR}
 		fi
 		if [ "${EFI}" = "1" ]; then
-			grubefi_hddimg_populate
+			grubefi_hddimg_populate ${HDDDIR}
 		fi
 
 		build_fat_img ${HDDDIR} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
meta/classes/grub-efi.bbclass +7 -6
index ffbcf4c..cd6651e 100644
@@ -42,19 +42,20 @@ grubefi_populate() {
 }
 
 grubefi_iso_populate() {
-	grubefi_populate ${ISODIR}
+	iso_dir=$1
+	grubefi_populate $iso_dir
 	# Build a EFI directory to create efi.img
 	mkdir -p ${EFIIMGDIR}/${EFIDIR}
-	cp ${ISODIR}/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR}
-	cp ${ISODIR}/vmlinuz ${EFIIMGDIR}
+	cp $iso_dir/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR}
+	cp $iso_dir/vmlinuz ${EFIIMGDIR}
 	echo "EFI\\BOOT\\${GRUB_IMAGE}" > ${EFIIMGDIR}/startup.nsh
-	if [ -f "${ISODIR}/initrd" ] ; then
-		cp ${ISODIR}/initrd ${EFIIMGDIR}
+	if [ -f "$iso_dir/initrd" ] ; then
+		cp $iso_dir/initrd ${EFIIMGDIR}
 	fi
 }
 
 grubefi_hddimg_populate() {
-	grubefi_populate ${HDDDIR}
+	grubefi_populate $1
 }
 
 python build_grub_cfg() {
meta/classes/syslinux.bbclass +7 -5
index 91b9731..944bd92 100644
@@ -53,14 +53,16 @@ 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}
+	iso_dir=$1
+	syslinux_populate $iso_dir ${ISOLINUXDIR} isolinux.cfg
+	install -m 0644 ${STAGING_DATADIR}/syslinux/isolinux.bin $iso_dir${ISOLINUXDIR}
+	install -m 0644 ${STAGING_DATADIR}/syslinux/ldlinux.c32 $iso_dir${ISOLINUXDIR}
 }
 
 syslinux_hddimg_populate() {
-	syslinux_populate ${HDDDIR} ${SYSLINUXDIR} syslinux.cfg
-	install -m 0444 ${STAGING_DATADIR}/syslinux/ldlinux.sys ${HDDDIR}${SYSLINUXDIR}/ldlinux.sys
+	hdd_dir=$1
+	syslinux_populate $hdd_dir ${SYSLINUXDIR} syslinux.cfg
+	install -m 0444 ${STAGING_DATADIR}/syslinux/ldlinux.sys $hdd_dir${SYSLINUXDIR}/ldlinux.sys
 }
 
 syslinux_hddimg_install() {
Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#14 lore raw

PATCH v3 9/9 bootimage.bbclass, zisofs-tools-native: add ability to compress ISO images

In reply to Jason Wessel

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

---
 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
meta/classes/bootimg.bbclass +21 -3
index ede6e21..395085d 100644
@@ -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 ?= "0"
 
 BOOTIMG_VOLUME_ID   ?= "boot"
 BOOTIMG_EXTRA_SPACE ?= "512"
@@ -97,18 +101,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+PCBIOS
 		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}
meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb new file +19 -0
new file mode 100644
index 0000000..1501307
@@ -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}
+}
Signature · 1 line
1.7.9.5
Reviewed-by on the v3 series
#15 lore raw
In reply to Jason Wessel
Quoted 10 lines · Jason Wessel

V3
- Add comment about isolinux.bin required in EFI only case
- Fix typo of PCIBIOS -> PCBIOS
- Change COMPRESSISO ?= "" -> COMPRESSISO ?= "0" for the default
- Add comment to EFI/ISO syslinux.bbclass to clarify workaround with EFI only case and hybrid boot
- Add patch to fix syslinux serial and menu problems
- Add patch to fix boot-directdisk.bbclass
* Two new patches are 7 & 8, the zisofs patch moved from 7 -> 9

It looks good to me, but I would like to see Saul and Martin review the direct disk modifications.

--
Darren

Quoted 50 lines

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.

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

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#16 lore raw
In reply to Jason Wessel
Quoted 59 lines · Jason Wessel

V3
- Add comment about isolinux.bin required in EFI only case
- Fix typo of PCIBIOS -> PCBIOS
- Change COMPRESSISO ?= "" -> COMPRESSISO ?= "0" for the default
- Add comment to EFI/ISO syslinux.bbclass to clarify workaround with EFI only case and hybrid boot
- Add patch to fix syslinux serial and menu problems
- Add patch to fix boot-directdisk.bbclass
* Two new patches are 7 & 8, the zisofs patch moved from 7 -> 9

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.

Quoted 5 lines

----------------------------------------------------------------
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

So with these now upstream, I'm hitting the following after removing NO_ISO="1" from the MinnowBoard machine config. Is anything missing? Have you validated this is working for you after the merge?

ERROR: Function failed: build_iso (log file is located
at /build/yocto/master/minnow_20130223110941/build/tmp/work/minnow-poky-linux/core-image-sato/1.0-r0/temp/log.do_bootimg.26036) ERROR: Logfile of failure stored in: /build/yocto/master/minnow_20130223110941/build/tmp/work/minnow-poky-linux/core-image-sato/1.0-r0/temp/log.do_bootimg.26036 Log data follows: | DEBUG: Executing python function do_bootimg

| DEBUG: Executing python function build_grub_cfg
| DEBUG: Python function build_grub_cfg finished
| DEBUG: Executing shell function build_hddimg
| mkdosfs 2.11 (12 Mar 2005)
| DEBUG: Shell function build_hddimg finished
| DEBUG: Executing shell function build_iso
| NOTE: EFI-only ISO images are untested, please provide feedback.
|   4.89% done, estimate finish Fri Sep 20 09:36:57 2013
|   9.76% done, estimate finish Fri Sep 20 09:36:57 2013
|  14.65% done, estimate finish Fri Sep 20 09:36:57 2013
|  19.52% done, estimate finish Fri Sep 20 09:36:57 2013
|  24.40% done, estimate finish Fri Sep 20 09:36:57 2013
|  29.27% done, estimate finish Fri Sep 20 09:36:57 2013
|  34.16% done, estimate finish Fri Sep 20 09:36:57 2013
|  39.03% done, estimate finish Fri Sep 20 09:36:57 2013
|  43.92% done, estimate finish Fri Sep 20 09:36:57 2013
|  48.79% done, estimate finish Fri Sep 20 09:36:57 2013
|  53.67% done, estimate finish Fri Sep 20 09:36:57 2013
|  58.55% done, estimate finish Fri Sep 20 09:36:57 2013
|  63.43% done, estimate finish Fri Sep 20 09:36:57 2013
|  68.30% done, estimate finish Fri Sep 20 09:36:57 2013
|  73.19% done, estimate finish Fri Sep 20 09:36:57 2013
|  78.06% done, estimate finish Fri Sep 20 09:36:57 2013
|  82.95% done, estimate finish Fri Sep 20 09:36:57 2013
|  87.82% done, estimate finish Fri Sep 20 09:36:57 2013
|  92.70% done, estimate finish Fri Sep 20 09:36:57 2013
|  97.57% done, estimate finish Fri Sep 20 09:36:57 2013
| Total translation table size: 0
| Total rockridge attributes bytes: 1095
| Total directory bytes: 4096
| Path table size(bytes): 34
| Max brk space used 0
| 102490 extents written (200 MB)
|

isohybrid: /build/yocto/master/minnow_20130223110941/build/tmp/deploy/images/minnow/core-image-sato-minnow-20130920155947.iso: could not find boot record |
WARNING: /build/yocto/master/minnow_20130223110941/build/tmp/work/minnow-poky-linux/core-image-sato/1.0-r0/temp/run.build_iso.26036:1 exit 1 from |
isohybrid /build/yocto/master/minnow_20130223110941/build/tmp/deploy/images/minnow/core-image-sato-minnow-20130920155947.iso
| DEBUG: Python function do_bootimg finished
| ERROR: Function failed: build_iso (log file is located
at /build/yocto/master/minnow_20130223110941/build/tmp/work/minnow-poky-linux/core-image-sato/1.0-r0/temp/log.do_bootimg.26036)
ERROR: Task 8
(/build/yocto/master/minnow_20130223110941/poky/meta/recipes-sato/images/core-image-sato.bb, do_bootimg) failed with exit code '1'

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#17 lore raw
Quoted 4 lines · Darren Hart

So with these now upstream, I'm hitting the following after removing NO_ISO="1" from the MinnowBoard machine config. Is anything missing? Have you validated this is working for you after the merge?

Only the first 2 patches in the series were actually merged, and the patches that provide the functionality you are looking for are not yet merged.

Does that mean that I should post the remaining 7 patches again? I don't know if it was the intent to only partially merge things or not. Perhaps Saul is still doing some testing because 2 of the 9 patches (the 2 that were merged) came from his unified pull to Richard.

Cheers,
Jason.