mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Check if valid kernel and/or FS
@ 2012-05-25 10:08 Benoit RAT
  2012-05-25 10:51 ` Eric Bénard
  2012-05-25 11:10 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 2 replies; 6+ messages in thread
From: Benoit RAT @ 2012-05-25 10:08 UTC (permalink / raw)
  To: barebox


[-- Attachment #1.1: Type: text/plain, Size: 763 bytes --]

Hy barebox guy,

I was wondering if there was a good way to check if I have a correct kernel
and/or filesystem in my partition before loading them.
If it is not the case then I will check out for valid images in tftpboot or
prompt the barebox shell.

And another question is how can i know that I am using the barebox
environment from nand flash instead of the one from a scripts?

Regards,

--
 <http://www.sevensols.com/>
*Benoit RAT LAMY*

Engineer (Sw) \ Ingeniero (Sw)

fix. *(+34) 958 285 024*

cel. *(+34) 617 989 123*

e-mail: benoit@sevensols.com

*www.sevensols.com / **www.sevensecurity.es*

_________________________________

*C/ Baza, parcela 19 Nave 3  \ Polígono Ind. Juncaril \*

*18210 - PELIGROS - GRANADA –SPAIN*

[-- Attachment #1.2: Type: text/html, Size: 4173 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Check if valid kernel and/or FS
  2012-05-25 10:08 Check if valid kernel and/or FS Benoit RAT
@ 2012-05-25 10:51 ` Eric Bénard
  2012-05-25 10:58   ` Benoit RAT
  2012-05-25 11:10 ` Jean-Christophe PLAGNIOL-VILLARD
  1 sibling, 1 reply; 6+ messages in thread
From: Eric Bénard @ 2012-05-25 10:51 UTC (permalink / raw)
  To: Benoit RAT; +Cc: barebox

Hi Benoit,

Le Fri, 25 May 2012 12:08:09 +0200,
Benoit RAT <benoit@sevensols.com> a écrit :

> I was wondering if there was a good way to check if I have a correct kernel
> and/or filesystem in my partition before loading them.
> If it is not the case then I will check out for valid images in tftpboot or
> prompt the barebox shell.
> 
first try the boot command, if the kernel is not correct (ie : bad
checksum), the boot command returns and you can then launch a tftpboot
or give a prompt.

Check for example :
http://git.pengutronix.de/?p=barebox.git;a=blob;f=arch/arm/boards/at91sam9m10g45ek/env/bin/menu_boot;h=d0b1396de984e3b00902cfb32598dcf123afc6bf;hb=refs/heads/next

> And another question is how can i know that I am using the barebox
> environment from nand flash instead of the one from a scripts?
> 
what do you mean here ?

Eric

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Check if valid kernel and/or FS
  2012-05-25 10:51 ` Eric Bénard
@ 2012-05-25 10:58   ` Benoit RAT
  2012-05-25 12:35     ` Sascha Hauer
  0 siblings, 1 reply; 6+ messages in thread
From: Benoit RAT @ 2012-05-25 10:58 UTC (permalink / raw)
  To: Eric Bénard; +Cc: barebox


[-- Attachment #1.1: Type: text/plain, Size: 1735 bytes --]

Thanks,

I want to know, if i am using the default environment (the that I am using
from compilation)
barebox> no valid environment found on /dev/env0. Using default environment

Or I am using the one that there is in /dev/env0

It is in the case someone break something in the NAND flash env, I want to
save again the default one.

--
 <http://www.sevensols.com/>  <http://www.sevensecurity.es>

*Benoit RAT LAMY*

Engineer (Sw) \ Ingeniero (Sw)

fix. *(+34) 958 285 024*

cel. *(+34) 617 989 123*

e-mail: benoit@sevensols.com

*www.sevensols.com / **www.sevensecurity.es*

_________________________________

*C/ Baza, parcela 19 Nave 3  \ Polígono Ind. Juncaril \*

*18210 - PELIGROS - GRANADA –SPAIN*



On Fri, May 25, 2012 at 12:51 PM, Eric Bénard <eric@eukrea.com> wrote:

> Hi Benoit,
>
> Le Fri, 25 May 2012 12:08:09 +0200,
> Benoit RAT <benoit@sevensols.com> a écrit :
>
> > I was wondering if there was a good way to check if I have a correct
> kernel
> > and/or filesystem in my partition before loading them.
> > If it is not the case then I will check out for valid images in tftpboot
> or
> > prompt the barebox shell.
> >
> first try the boot command, if the kernel is not correct (ie : bad
> checksum), the boot command returns and you can then launch a tftpboot
> or give a prompt.
>
> Check for example :
>
> http://git.pengutronix.de/?p=barebox.git;a=blob;f=arch/arm/boards/at91sam9m10g45ek/env/bin/menu_boot;h=d0b1396de984e3b00902cfb32598dcf123afc6bf;hb=refs/heads/next
>
> > And another question is how can i know that I am using the barebox
> > environment from nand flash instead of the one from a scripts?
> >
> what do you mean here ?
>
> Eric
>

[-- Attachment #1.2: Type: text/html, Size: 5975 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Check if valid kernel and/or FS
  2012-05-25 10:08 Check if valid kernel and/or FS Benoit RAT
  2012-05-25 10:51 ` Eric Bénard
@ 2012-05-25 11:10 ` Jean-Christophe PLAGNIOL-VILLARD
  2012-05-25 11:12   ` Eric Bénard
  1 sibling, 1 reply; 6+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-05-25 11:10 UTC (permalink / raw)
  To: Benoit RAT; +Cc: barebox

On 12:08 Fri 25 May     , Benoit RAT wrote:
>    Hy barebox guy,
>    I was wondering if there was a good way to check if I have a correct
>    kernel and/or filesystem in my partition before loading them.
>    If it is not the case then I will check out for valid images in tftpboot
>    or prompt the barebox shell.
>    Regards, 
kernel yes rootfs no

but this not really the right way to do

the best wyay is to use bootcounter with a watchdog


so if after x times your boot is failling you can boot the failsafe or anthink
you want


>    And another question is how can i know that I am using the barebox
>    environment from nand flash instead of the one from a scripts?
in the log if see

envfs: wrong magic on 

which mean you load from the builtin

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Check if valid kernel and/or FS
  2012-05-25 11:10 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-05-25 11:12   ` Eric Bénard
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Bénard @ 2012-05-25 11:12 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox, Benoit RAT

Hi Jean Christophe,

Le Fri, 25 May 2012 13:10:20 +0200,
Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> a écrit :
> >    And another question is how can i know that I am using the barebox
> >    environment from nand flash instead of the one from a scripts?
> in the log if see
> 
> envfs: wrong magic on 
> 
> which mean you load from the builtin
> 
how do you check the log from within barebox's scripts ?

Eric

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Check if valid kernel and/or FS
  2012-05-25 10:58   ` Benoit RAT
@ 2012-05-25 12:35     ` Sascha Hauer
  0 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2012-05-25 12:35 UTC (permalink / raw)
  To: Benoit RAT; +Cc: barebox

On Fri, May 25, 2012 at 12:58:48PM +0200, Benoit RAT wrote:
> Thanks,
> 
> I want to know, if i am using the default environment (the that I am using
> from compilation)
> barebox> no valid environment found on /dev/env0. Using default environment
> 
> Or I am using the one that there is in /dev/env0
> 
> It is in the case someone break something in the NAND flash env, I want to
> save again the default one.

Currently there is no way to detect that, but there is a little trick.
Put a this_is_compiled_in file into your default environment. Then
during startup you can do:

if [ -f /env/this_is_compiled_in ]; then
	echo "Sorry man, you lost your environment"
	rm /env/this_is_compiled_in
	saveenv
fi

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2012-05-25 12:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-25 10:08 Check if valid kernel and/or FS Benoit RAT
2012-05-25 10:51 ` Eric Bénard
2012-05-25 10:58   ` Benoit RAT
2012-05-25 12:35     ` Sascha Hauer
2012-05-25 11:10 ` Jean-Christophe PLAGNIOL-VILLARD
2012-05-25 11:12   ` Eric Bénard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox