From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) by mail.openembedded.org (Postfix) with ESMTP id 5A14071BA0 for ; Wed, 20 Dec 2017 01:27:14 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id vBK1RE1r006269 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 19 Dec 2017 17:27:15 -0800 (PST) Received: from localhost.corp.ad.wrs.com (128.224.162.229) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.3.361.1; Tue, 19 Dec 2017 17:27:14 -0800 To: Saul Wold , , , References: <20171219201148.19828-1-sgw@linux.intel.com> From: Robert Yang Message-ID: <3e085ad9-c646-fa38-f03c-db46c0dd7354@windriver.com> Date: Wed, 20 Dec 2017 09:26:35 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171219201148.19828-1-sgw@linux.intel.com> Subject: Re: [PATCH] image_types: preserve rootfs if mkext234fs() fails 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: Wed, 20 Dec 2017 01:27:15 -0000 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Hi Saul, On 12/20/2017 04:11 AM, Saul Wold wrote: > We have seen more failures, but have not been able to directly reproduce > it maybe svaing the rootfs and it contains some content that is tripping s/svaing/saving/. > up the e2fsprogs mkfs.ext4 populate_rootfs() function > > Signed-off-by: Saul Wold > --- > meta/classes/image_types.bbclass | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass > index 9188bed4197..6b4f39ed274 100644 > --- a/meta/classes/image_types.bbclass > +++ b/meta/classes/image_types.bbclass > @@ -86,9 +86,14 @@ oe_mkext234fs () { > bbdebug 1 Executing "dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype seek=$ROOTFS_SIZE count=$COUNT bs=1024" > dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype seek=$ROOTFS_SIZE count=$COUNT bs=1024 > bbdebug 1 "Actual Rootfs size: `du -s ${IMAGE_ROOTFS}`" > - bbdebug 1 "Actual Partion size: `ls -s ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype`" > + bbdebug 1 "Actual Partion size: `ls -l ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype`" > bbdebug 1 Executing "mkfs.$fstype -F $extra_imagecmd ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype -d ${IMAGE_ROOTFS}" > mkfs.$fstype -F $extra_imagecmd ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype -d ${IMAGE_ROOTFS} > + if [ $? -ne 0 ]; then > + tmp_saved_rootfs=`mktemp -d -p /tmp saved_rootfs.XXXXX` > + cp -r ${IMAGE_ROOTFS} $tmp_saved_rootfs Maybe save to ${WORKDIR}/tmp rather than /tmp ? // Robert > + fi > + > # Error codes 0-3 indicate successfull operation of fsck (no errors or errors corrected) > fsck.$fstype -pvfD ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype || [ $? -le 3 ] > } >