From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mail.openembedded.org (Postfix) with ESMTP id E2FEA736B6 for ; Fri, 11 Sep 2015 17:26:10 +0000 (UTC) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 11 Sep 2015 10:26:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,512,1437462000"; d="scan'208";a="802570051" Received: from besquive-mobl2.zpn.intel.com ([10.219.17.58]) by orsmga002.jf.intel.com with ESMTP; 11 Sep 2015 10:26:09 -0700 Message-ID: <1441992374.14702.12.camel@linux.intel.com> From: Benjamin Esquivel To: Alex Franco , openembedded-core@lists.openembedded.org In-Reply-To: <1440626255-29614-4-git-send-email-alejandro.franco@linux.intel.com> References: <1440626255-29614-1-git-send-email-alejandro.franco@linux.intel.com> <1440626255-29614-4-git-send-email-alejandro.franco@linux.intel.com> Organization: Intel Corporation Date: Fri, 11 Sep 2015 12:26:14 -0500 Mime-Version: 1.0 X-Mailer: Evolution 3.16.5 (3.16.5-1.fc22) Cc: paul.eggleton@linux.intel.com Subject: Re: [PATCH 3/3] Empty image: filesystem allocation X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: benjamin.esquivel@linux.intel.com List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Sep 2015 17:26:11 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Hi Alejandro, On Wed, 2015-08-26 at 16:57 -0500, Alex Franco wrote: > Increase sparse image block size when ROOTFS_SIZE is smaller than > the minimum needed for ext4 to fit into it. > > [YOCTO #7664] > > Signed-off-by: Alex Franco > --- > meta/classes/image_types.bbclass | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/meta/classes/image_types.bbclass > b/meta/classes/image_types.bbclass > index 35ceb7b..61ce222 100644 > --- a/meta/classes/image_types.bbclass > +++ b/meta/classes/image_types.bbclass > @@ -49,8 +49,16 @@ oe_mkext234fs () { > extra_imagecmd=$@ > fi > > + # If generating an empty image the size of the sparse block > should be large > + # enough to allocate an ext4 filesystem using 4096 bytes per > inode, this is > + # about 60K, so dd needs a minimum count of 60, with bs=1024 > (bytes per IO) > + eval local COUNT=\"0\" > + eval local MIN_COUNT=\"60\" > + if [ $ROOTFS_SIZE -lt $MIN_COUNT ]; then > + eval COUNT=\"$MIN_COUNT\" > + fi > # Create a sparse image block > - dd if=/dev/zero > of=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.$fstype seek=$ROOTFS_SIZE > count=0 bs=1k > + dd if=/dev/zero > of=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.$fstype seek=$ROOTFS_SIZE > count=$COUNT bs=1024 Variable references enclosed in {} are less prone to misinterpretation. > mkfs.$fstype -F $extra_imagecmd > ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.$fstype -d ${IMAGE_ROOTFS} > } > > -- > 2.5.0 >