summaryrefslogtreecommitdiff
path: root/meta/classes
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2013-09-17 13:32:18 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-26 17:27:23 +0100
commit808d4371939ec48ed62e0c0b6614b96d61b1f7b8 (patch)
tree1a29e6b1e16f101e2a879b16413755777a33a6b8 /meta/classes
parentcf2fba810a8a59cff71bf2c12e516e9080146604 (diff)
downloadopenembedded-core-808d4371939ec48ed62e0c0b6614b96d61b1f7b8.tar.gz
openembedded-core-808d4371939ec48ed62e0c0b6614b96d61b1f7b8.tar.bz2
openembedded-core-808d4371939ec48ed62e0c0b6614b96d61b1f7b8.zip
bootimage.bbclass, zisofs-tools-native: add ability to compress ISO images
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> Reviewed-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/bootimg.bbclass24
1 files changed, 21 insertions, 3 deletions
diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index fdd4ea9561..c61c4e985e 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 ?= "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}