All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Yang <liezhi.yang@windriver.com>
To: Saul Wold <sgw@linux.intel.com>,
	<openembedded-core@lists.openembedded.org>,
	<richard.purdie@linuxfoundation.org>, <ross.burton@intel.com>
Subject: Re: [PATCH] image_types: preserve rootfs if mkext234fs() fails
Date: Wed, 20 Dec 2017 09:26:35 +0800	[thread overview]
Message-ID: <3e085ad9-c646-fa38-f03c-db46c0dd7354@windriver.com> (raw)
In-Reply-To: <20171219201148.19828-1-sgw@linux.intel.com>

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 <sgw@linux.intel.com>
> ---
>   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 ]
>   }
> 


      parent reply	other threads:[~2017-12-20  1:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-19 20:11 [PATCH] image_types: preserve rootfs if mkext234fs() fails Saul Wold
2017-12-19 20:54 ` Tom Rini
2017-12-19 21:19   ` Andre McCurdy
2017-12-19 21:20     ` Tom Rini
2017-12-19 22:04       ` Burton, Ross
2017-12-19 22:06         ` Tom Rini
2017-12-19 22:14           ` Andre McCurdy
2017-12-20  9:51   ` Richard Purdie
2017-12-20  9:55     ` Robert Yang
2017-12-20  1:26 ` Robert Yang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3e085ad9-c646-fa38-f03c-db46c0dd7354@windriver.com \
    --to=liezhi.yang@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    --cc=ross.burton@intel.com \
    --cc=sgw@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.