Return-Path: Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by mail.openembedded.org (Postfix) with ESMTP id 1426360EDC for ; Thu, 12 Sep 2013 00:55:34 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail.windriver.com (8.14.5/8.14.3) with ESMTP id r8C0tavj005377 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Wed, 11 Sep 2013 17:55:36 -0700 (PDT) Received: from splat.wrs.com (128.224.60.28) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.2.347.0; Wed, 11 Sep 2013 17:55:35 -0700 From: Jason Wessel To: Date: Wed, 11 Sep 2013 19:55:23 -0500 Message-ID: <1378947323-17715-1-git-send-email-jason.wessel@windriver.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Subject: [PATCH v2] bootimage.bbclass, zisofs-tools-native: add ability to compress ISO images X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2013 00:55:35 -0000 Content-Type: text/plain 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 --- meta/classes/bootimg.bbclass | 21 ++++++++++++++++++-- .../zisofs-tools/zisofs-tools-native_1.0.8.bb | 21 ++++++++++++++++++++ 2 files changed, 40 insertions(+), 2 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 90a241d..b312e0d 100644 --- a/meta/classes/bootimg.bbclass +++ b/meta/classes/bootimg.bbclass @@ -19,19 +19,23 @@ # External variables (also used by syslinux.bbclass) # ${INITRD} - indicates a filesystem image to use as an initrd (optional) +# ${COMPRESSISO} # ${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) +COMPRESSISO ?= "" 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" HDDDIR = "${S}/hddimg" ISODIR = "${S}/iso" +COMPACT_ISODIR = "${S}/iso.z" BOOTIMG_VOLUME_ID ?= "boot" BOOTIMG_EXTRA_SPACE ?= "512" @@ -92,10 +96,23 @@ build_iso() { grubefi_iso_populate 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_opts="-r" + else + mkisofs_opts="-R -z -D -l" + fi + if [ "${PCBIOS}" = "1" ]; then 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_opts \ ${MKISOFS_OPTIONS} ${ISODIR} else bbnote "EFI-only ISO images are untested, please provide feedback." 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..39360a8 --- /dev/null +++ b/meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb @@ -0,0 +1,21 @@ +# 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" +PR = "r0" + +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() { + install -d ${D}${bindir} + make install INSTALLROOT=${D} bindir=${bindir} +} -- 1.7.9.5