mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/1] defaultenv-2: execute init/* before timeout
@ 2013-01-15 20:43 Jean-Christophe PLAGNIOL-VILLARD
  2013-01-16 20:32 ` Sascha Hauer
  0 siblings, 1 reply; 6+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-01-15 20:43 UTC (permalink / raw)
  To: barebox

so we can have splash, usb serial, etc...

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 defaultenv-2/base/bin/init |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/defaultenv-2/base/bin/init b/defaultenv-2/base/bin/init
index 2a1f6a1..b606b63 100644
--- a/defaultenv-2/base/bin/init
+++ b/defaultenv-2/base/bin/init
@@ -21,8 +21,9 @@ else
 	echo -e -n "\nHit any key to stop autoboot: "
 fi
 
-timeout -a $global.autoboot_timeout -v key
-autoboot="$?"
+# allow to stop the boot before execute the /env/init/*
+# but without waiting
+timeout -s -a -v key 0
 
 if [ "${key}" = "q" ]; then
 	exit
@@ -32,6 +33,13 @@ for i in /env/init/*; do
 	. $i
 done
 
+timeout -a $global.autoboot_timeout -v key
+autoboot="$?"
+
+if [ "${key}" = "q" ]; then
+	exit
+fi
+
 if [ "$autoboot" = 0 ]; then
 	boot
 fi
-- 
1.7.10.4


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

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

* Re: [PATCH 1/1] defaultenv-2: execute init/* before timeout
  2013-01-15 20:43 [PATCH 1/1] defaultenv-2: execute init/* before timeout Jean-Christophe PLAGNIOL-VILLARD
@ 2013-01-16 20:32 ` Sascha Hauer
  0 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2013-01-16 20:32 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Tue, Jan 15, 2013 at 09:43:32PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> so we can have splash, usb serial, etc...
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Applied, thanks

Sascha

> ---
>  defaultenv-2/base/bin/init |   12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/defaultenv-2/base/bin/init b/defaultenv-2/base/bin/init
> index 2a1f6a1..b606b63 100644
> --- a/defaultenv-2/base/bin/init
> +++ b/defaultenv-2/base/bin/init
> @@ -21,8 +21,9 @@ else
>  	echo -e -n "\nHit any key to stop autoboot: "
>  fi
>  
> -timeout -a $global.autoboot_timeout -v key
> -autoboot="$?"
> +# allow to stop the boot before execute the /env/init/*
> +# but without waiting
> +timeout -s -a -v key 0
>  
>  if [ "${key}" = "q" ]; then
>  	exit
> @@ -32,6 +33,13 @@ for i in /env/init/*; do
>  	. $i
>  done
>  
> +timeout -a $global.autoboot_timeout -v key
> +autoboot="$?"
> +
> +if [ "${key}" = "q" ]; then
> +	exit
> +fi
> +
>  if [ "$autoboot" = 0 ]; then
>  	boot
>  fi
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

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

* Re: [PATCH 1/1] defaultenv-2: execute init/* before timeout
  2012-09-19 18:57   ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-09-19 21:02     ` Sascha Hauer
  0 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2012-09-19 21:02 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Wed, Sep 19, 2012 at 08:57:21PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 18:53 Wed 19 Sep     , Sascha Hauer wrote:
> > On Wed, Sep 19, 2012 at 11:50:35AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > so we can have splah, usb serial, etc...
> > > 
> > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > > ---
> > >  defaultenv-2/base/bin/init |    8 +++-----
> > >  1 file changed, 3 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/defaultenv-2/base/bin/init b/defaultenv-2/base/bin/init
> > > index 3cac41c..5524710 100644
> > > --- a/defaultenv-2/base/bin/init
> > > +++ b/defaultenv-2/base/bin/init
> > > @@ -12,7 +12,9 @@ global linux.bootargs.dyn.ip
> > >  global linux.bootargs.dyn.root
> > >  global editcmd=sedit
> > >  
> > > -/env/init/general
> > > +for i in /env/init/*; do
> > > +	. $i
> > > +done
> > >  
> > >  if [ -e /env/menu ]; then
> > >  	echo -e -n "\nHit m for menu or any other key to stop autoboot: "
> > > @@ -27,10 +29,6 @@ if [ "${key}" = "q" ]; then
> > >  	exit
> > >  fi
> > >  
> > > -for i in /env/init/*; do
> > > -	. $i
> > > -done
> > > -
> > 
> > This was intentionally done *after* waiting for user intervention to be
> > able to escape in case some init script crashes barebox.
> yeah but we need splash before timeout and I do not what to hack the init
> 
> so can do a pseudo rc.d
> 
> /etc/init/pre
> /etc/init/post
> 
> so we can have some before some after timeout

Don't overengineer. Just do a

timeout -s -a -v key 0
if [ "{$key}" = 'q' ]; then
	exit
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

* Re: [PATCH 1/1] defaultenv-2: execute init/* before timeout
  2012-09-19 16:53 ` Sascha Hauer
@ 2012-09-19 18:57   ` Jean-Christophe PLAGNIOL-VILLARD
  2012-09-19 21:02     ` Sascha Hauer
  0 siblings, 1 reply; 6+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-09-19 18:57 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On 18:53 Wed 19 Sep     , Sascha Hauer wrote:
> On Wed, Sep 19, 2012 at 11:50:35AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > so we can have splah, usb serial, etc...
> > 
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > ---
> >  defaultenv-2/base/bin/init |    8 +++-----
> >  1 file changed, 3 insertions(+), 5 deletions(-)
> > 
> > diff --git a/defaultenv-2/base/bin/init b/defaultenv-2/base/bin/init
> > index 3cac41c..5524710 100644
> > --- a/defaultenv-2/base/bin/init
> > +++ b/defaultenv-2/base/bin/init
> > @@ -12,7 +12,9 @@ global linux.bootargs.dyn.ip
> >  global linux.bootargs.dyn.root
> >  global editcmd=sedit
> >  
> > -/env/init/general
> > +for i in /env/init/*; do
> > +	. $i
> > +done
> >  
> >  if [ -e /env/menu ]; then
> >  	echo -e -n "\nHit m for menu or any other key to stop autoboot: "
> > @@ -27,10 +29,6 @@ if [ "${key}" = "q" ]; then
> >  	exit
> >  fi
> >  
> > -for i in /env/init/*; do
> > -	. $i
> > -done
> > -
> 
> This was intentionally done *after* waiting for user intervention to be
> able to escape in case some init script crashes barebox.
yeah but we need splash before timeout and I do not what to hack the init

so can do a pseudo rc.d

/etc/init/pre
/etc/init/post

so we can have some before some after timeout

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: [PATCH 1/1] defaultenv-2: execute init/* before timeout
  2012-09-19  9:50 Jean-Christophe PLAGNIOL-VILLARD
@ 2012-09-19 16:53 ` Sascha Hauer
  2012-09-19 18:57   ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 6+ messages in thread
From: Sascha Hauer @ 2012-09-19 16:53 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Wed, Sep 19, 2012 at 11:50:35AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> so we can have splah, usb serial, etc...
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  defaultenv-2/base/bin/init |    8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/defaultenv-2/base/bin/init b/defaultenv-2/base/bin/init
> index 3cac41c..5524710 100644
> --- a/defaultenv-2/base/bin/init
> +++ b/defaultenv-2/base/bin/init
> @@ -12,7 +12,9 @@ global linux.bootargs.dyn.ip
>  global linux.bootargs.dyn.root
>  global editcmd=sedit
>  
> -/env/init/general
> +for i in /env/init/*; do
> +	. $i
> +done
>  
>  if [ -e /env/menu ]; then
>  	echo -e -n "\nHit m for menu or any other key to stop autoboot: "
> @@ -27,10 +29,6 @@ if [ "${key}" = "q" ]; then
>  	exit
>  fi
>  
> -for i in /env/init/*; do
> -	. $i
> -done
> -

This was intentionally done *after* waiting for user intervention to be
able to escape in case some init script crashes barebox.

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

* [PATCH 1/1] defaultenv-2: execute init/* before timeout
@ 2012-09-19  9:50 Jean-Christophe PLAGNIOL-VILLARD
  2012-09-19 16:53 ` Sascha Hauer
  0 siblings, 1 reply; 6+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-09-19  9:50 UTC (permalink / raw)
  To: barebox

so we can have splah, usb serial, etc...

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 defaultenv-2/base/bin/init |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/defaultenv-2/base/bin/init b/defaultenv-2/base/bin/init
index 3cac41c..5524710 100644
--- a/defaultenv-2/base/bin/init
+++ b/defaultenv-2/base/bin/init
@@ -12,7 +12,9 @@ global linux.bootargs.dyn.ip
 global linux.bootargs.dyn.root
 global editcmd=sedit
 
-/env/init/general
+for i in /env/init/*; do
+	. $i
+done
 
 if [ -e /env/menu ]; then
 	echo -e -n "\nHit m for menu or any other key to stop autoboot: "
@@ -27,10 +29,6 @@ if [ "${key}" = "q" ]; then
 	exit
 fi
 
-for i in /env/init/*; do
-	. $i
-done
-
 if [ "$autoboot" = 0 ]; then
 	boot
 fi
-- 
1.7.10.4


_______________________________________________
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:[~2013-01-16 20:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-15 20:43 [PATCH 1/1] defaultenv-2: execute init/* before timeout Jean-Christophe PLAGNIOL-VILLARD
2013-01-16 20:32 ` Sascha Hauer
  -- strict thread matches above, loose matches on Subject: below --
2012-09-19  9:50 Jean-Christophe PLAGNIOL-VILLARD
2012-09-19 16:53 ` Sascha Hauer
2012-09-19 18:57   ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-19 21:02     ` Sascha Hauer

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