All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] image_types: preserve rootfs if mkext234fs() fails
@ 2017-12-19 20:11 Saul Wold
  2017-12-19 20:54 ` Tom Rini
  2017-12-20  1:26 ` Robert Yang
  0 siblings, 2 replies; 10+ messages in thread
From: Saul Wold @ 2017-12-19 20:11 UTC (permalink / raw)
  To: openembedded-core, richard.purdie, ross.burton, liezhi.yang

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
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
+	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 ]
 }
-- 
2.13.6



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] image_types: preserve rootfs if mkext234fs() fails
  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-20  9:51   ` Richard Purdie
  2017-12-20  1:26 ` Robert Yang
  1 sibling, 2 replies; 10+ messages in thread
From: Tom Rini @ 2017-12-19 20:54 UTC (permalink / raw)
  To: Saul Wold; +Cc: openembedded-core

On Tue, Dec 19, 2017 at 12:11:48PM -0800, 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
> 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
> +	fi

Wouldn't it be better to just fail on error here, rather than dump stuff
to /tmp ?

-- 
Tom


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] image_types: preserve rootfs if mkext234fs() fails
  2017-12-19 20:54 ` Tom Rini
@ 2017-12-19 21:19   ` Andre McCurdy
  2017-12-19 21:20     ` Tom Rini
  2017-12-20  9:51   ` Richard Purdie
  1 sibling, 1 reply; 10+ messages in thread
From: Andre McCurdy @ 2017-12-19 21:19 UTC (permalink / raw)
  To: Tom Rini; +Cc: OE Core mailing list

On Tue, Dec 19, 2017 at 12:54 PM, Tom Rini <trini@konsulko.com> wrote:
> On Tue, Dec 19, 2017 at 12:11:48PM -0800, 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
>> 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
>> +     fi
>
> Wouldn't it be better to just fail on error here, rather than dump stuff
> to /tmp ?

It already does fail with an error. Saving the state is temporary
additional debug to help understand why.

https://bugzilla.yoctoproject.org/show_bug.cgi?id=12304


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] image_types: preserve rootfs if mkext234fs() fails
  2017-12-19 21:19   ` Andre McCurdy
@ 2017-12-19 21:20     ` Tom Rini
  2017-12-19 22:04       ` Burton, Ross
  0 siblings, 1 reply; 10+ messages in thread
From: Tom Rini @ 2017-12-19 21:20 UTC (permalink / raw)
  To: Andre McCurdy; +Cc: OE Core mailing list

[-- Attachment #1: Type: text/plain, Size: 2393 bytes --]

On Tue, Dec 19, 2017 at 01:19:09PM -0800, Andre McCurdy wrote:
> On Tue, Dec 19, 2017 at 12:54 PM, Tom Rini <trini@konsulko.com> wrote:
> > On Tue, Dec 19, 2017 at 12:11:48PM -0800, 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
> >> 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
> >> +     fi
> >
> > Wouldn't it be better to just fail on error here, rather than dump stuff
> > to /tmp ?
> 
> It already does fail with an error. Saving the state is temporary
> additional debug to help understand why.
> 
> https://bugzilla.yoctoproject.org/show_bug.cgi?id=12304

So the problem is with the autobuilder where everything else gets blown
away.  That's fine, this is an autobuilder specific work-around, not a
general purpose patch and shouldn't be in mainline, would be my point.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] image_types: preserve rootfs if mkext234fs() fails
  2017-12-19 21:20     ` Tom Rini
@ 2017-12-19 22:04       ` Burton, Ross
  2017-12-19 22:06         ` Tom Rini
  0 siblings, 1 reply; 10+ messages in thread
From: Burton, Ross @ 2017-12-19 22:04 UTC (permalink / raw)
  To: Tom Rini; +Cc: OE Core mailing list

[-- Attachment #1: Type: text/plain, Size: 2651 bytes --]

On 19 December 2017 at 21:20, Tom Rini <trini@konsulko.com> wrote:

> On Tue, Dec 19, 2017 at 01:19:09PM -0800, Andre McCurdy wrote:
> > On Tue, Dec 19, 2017 at 12:54 PM, Tom Rini <trini@konsulko.com> wrote:
> > > On Tue, Dec 19, 2017 at 12:11:48PM -0800, 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
> > >> 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
> > >> +     fi
> > >
> > > Wouldn't it be better to just fail on error here, rather than dump
> stuff
> > > to /tmp ?
> >
> > It already does fail with an error. Saving the state is temporary
> > additional debug to help understand why.
> >
> > https://bugzilla.yoctoproject.org/show_bug.cgi?id=12304
>
> So the problem is with the autobuilder where everything else gets blown
> away.  That's fine, this is an autobuilder specific work-around, not a
> general purpose patch and shouldn't be in mainline, would be my point.
>

I suspect this will just hang in master-next and never merge into master.

Ross

[-- Attachment #2: Type: text/html, Size: 3716 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] image_types: preserve rootfs if mkext234fs() fails
  2017-12-19 22:04       ` Burton, Ross
@ 2017-12-19 22:06         ` Tom Rini
  2017-12-19 22:14           ` Andre McCurdy
  0 siblings, 1 reply; 10+ messages in thread
From: Tom Rini @ 2017-12-19 22:06 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE Core mailing list

On Tue, Dec 19, 2017 at 10:04:29PM +0000, Burton, Ross wrote:
> On 19 December 2017 at 21:20, Tom Rini <trini@konsulko.com> wrote:
> 
> > On Tue, Dec 19, 2017 at 01:19:09PM -0800, Andre McCurdy wrote:
> > > On Tue, Dec 19, 2017 at 12:54 PM, Tom Rini <trini@konsulko.com> wrote:
> > > > On Tue, Dec 19, 2017 at 12:11:48PM -0800, 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
> > > >> 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
> > > >> +     fi
> > > >
> > > > Wouldn't it be better to just fail on error here, rather than dump
> > stuff
> > > > to /tmp ?
> > >
> > > It already does fail with an error. Saving the state is temporary
> > > additional debug to help understand why.
> > >
> > > https://bugzilla.yoctoproject.org/show_bug.cgi?id=12304
> >
> > So the problem is with the autobuilder where everything else gets blown
> > away.  That's fine, this is an autobuilder specific work-around, not a
> > general purpose patch and shouldn't be in mainline, would be my point.
> 
> I suspect this will just hang in master-next and never merge into master.

That sounds good.  And I suppose at this point, it would be pretty
likely to not, too.  Maybe in the future we want a tag in the commit
message or something to make it clear it's not for merging to master
itself?

-- 
Tom


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] image_types: preserve rootfs if mkext234fs() fails
  2017-12-19 22:06         ` Tom Rini
@ 2017-12-19 22:14           ` Andre McCurdy
  0 siblings, 0 replies; 10+ messages in thread
From: Andre McCurdy @ 2017-12-19 22:14 UTC (permalink / raw)
  To: Tom Rini; +Cc: OE Core mailing list

On Tue, Dec 19, 2017 at 2:06 PM, Tom Rini <trini@konsulko.com> wrote:
> On Tue, Dec 19, 2017 at 10:04:29PM +0000, Burton, Ross wrote:
>>
>> I suspect this will just hang in master-next and never merge into master.
>
> That sounds good.  And I suppose at this point, it would be pretty
> likely to not, too.  Maybe in the future we want a tag in the commit
> message or something to make it clear it's not for merging to master
> itself?

The previous two rounds of debug for this issue are already in master,
so I expect this will get merged to master too... and then all be
reverted once the underlying bug is resolved.

Personally I think occasionally adding some debug to the master branch
between releases is OK.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] image_types: preserve rootfs if mkext234fs() fails
  2017-12-19 20:11 [PATCH] image_types: preserve rootfs if mkext234fs() fails Saul Wold
  2017-12-19 20:54 ` Tom Rini
@ 2017-12-20  1:26 ` Robert Yang
  1 sibling, 0 replies; 10+ messages in thread
From: Robert Yang @ 2017-12-20  1:26 UTC (permalink / raw)
  To: Saul Wold, openembedded-core, richard.purdie, ross.burton

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 ]
>   }
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] image_types: preserve rootfs if mkext234fs() fails
  2017-12-19 20:54 ` Tom Rini
  2017-12-19 21:19   ` Andre McCurdy
@ 2017-12-20  9:51   ` Richard Purdie
  2017-12-20  9:55     ` Robert Yang
  1 sibling, 1 reply; 10+ messages in thread
From: Richard Purdie @ 2017-12-20  9:51 UTC (permalink / raw)
  To: Tom Rini, Saul Wold; +Cc: openembedded-core

On Tue, 2017-12-19 at 15:54 -0500, Tom Rini wrote:
> On Tue, Dec 19, 2017 at 12:11:48PM -0800, 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
> > 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
> > +	fi
> Wouldn't it be better to just fail on error here, rather than dump
> stuff to /tmp ?

We have a problem with a recurring issue where the image generation
code is failing in the eSDK selftests. The eSDK selftests run a
completely separate build which then gets cleaned up. I'm not entirely
sure the best way to handle this but that is why Saul is proposing
this.

It may be an idea to detect the failing selftest and then stop the
cleanup in that case. That is going to be fairly invasive on the
selftest code though.

I may just pull this into master-next (but not master) so at least if
it fails there we have better debugging. We are struggling to get to
the bottom of the issue :(.

Cheers,

Richard



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] image_types: preserve rootfs if mkext234fs() fails
  2017-12-20  9:51   ` Richard Purdie
@ 2017-12-20  9:55     ` Robert Yang
  0 siblings, 0 replies; 10+ messages in thread
From: Robert Yang @ 2017-12-20  9:55 UTC (permalink / raw)
  To: Richard Purdie, Tom Rini, Saul Wold; +Cc: openembedded-core



On 12/20/2017 05:51 PM, Richard Purdie wrote:
> On Tue, 2017-12-19 at 15:54 -0500, Tom Rini wrote:
>> On Tue, Dec 19, 2017 at 12:11:48PM -0800, 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
>>> 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
>>> +	fi
>> Wouldn't it be better to just fail on error here, rather than dump
>> stuff to /tmp ?
> 
> We have a problem with a recurring issue where the image generation
> code is failing in the eSDK selftests. The eSDK selftests run a
> completely separate build which then gets cleaned up. I'm not entirely
> sure the best way to handle this but that is why Saul is proposing
> this.
> 
> It may be an idea to detect the failing selftest and then stop the
> cleanup in that case. That is going to be fairly invasive on the

+1 on this, the cleanup makes the debug very hard when error happens.

// Robert

> selftest code though
> 
> I may just pull this into master-next (but not master) so at least if
> it fails there we have better debugging. We are struggling to get to
> the bottom of the issue :(.
> 
> Cheers,
> 
> Richard
> 
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-12-20  9:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.