mailarchive of the pengutronix oss-tools mailing list
 help / color / mirror / Atom feed
* [OSS-Tools] [PATCH dt-utils] barebox-mark-successful-boot: adopt naming from barebox
@ 2019-11-16 12:44 Christoph Fritz
  2019-12-11 11:25 ` Enrico Joerns
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Fritz @ 2019-11-16 12:44 UTC (permalink / raw)
  To: oss-tools

This patch is adopting current barebox default naming scheme.

Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
---
 scripts/barebox-mark-successful-boot.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/barebox-mark-successful-boot.sh b/scripts/barebox-mark-successful-boot.sh
index 3120f57..9286a63 100644
--- a/scripts/barebox-mark-successful-boot.sh
+++ b/scripts/barebox-mark-successful-boot.sh
@@ -3,12 +3,12 @@
 DEFAULT_REMAINING_ATTEMPTS=3
 DEFAULT_PRIORITY=20
 
-system=$(sed /proc/cmdline -ne "s/\(^\|.* \)bootstate.active=\([^ ]*\).*/\2/p")
+system=$(sed /proc/cmdline -ne "s/\(^\|.* \)bootchooser.active=\([^ ]*\).*/\2/p")
 if [ -z "${system}" ]; then
 	echo "unable to detect system partition" >&2
 	exit 1
 fi
 
-barebox-state -n /state \
+barebox-state -n state \
 	-s "bootstate.${system}.remaining_attempts=${DEFAULT_REMAINING_ATTEMPTS}" \
 	-s "bootstate.${system}.priority=${DEFAULT_PRIORITY}"
-- 
2.20.1




_______________________________________________
OSS-Tools mailing list
OSS-Tools@pengutronix.de

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

* Re: [OSS-Tools] [PATCH dt-utils] barebox-mark-successful-boot: adopt naming from barebox
  2019-11-16 12:44 [OSS-Tools] [PATCH dt-utils] barebox-mark-successful-boot: adopt naming from barebox Christoph Fritz
@ 2019-12-11 11:25 ` Enrico Joerns
  2019-12-12 11:50   ` Roland Hieber
  0 siblings, 1 reply; 6+ messages in thread
From: Enrico Joerns @ 2019-12-11 11:25 UTC (permalink / raw)
  To: chf.fritz, Roland Hieber; +Cc: oss-tools, entwicklung

On 11/16/19 1:44 PM, Christoph Fritz wrote:
> This patch is adopting current barebox default naming scheme.
> 
> Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
> ---
>   scripts/barebox-mark-successful-boot.sh | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/barebox-mark-successful-boot.sh b/scripts/barebox-mark-successful-boot.sh
> index 3120f57..9286a63 100644
> --- a/scripts/barebox-mark-successful-boot.sh
> +++ b/scripts/barebox-mark-successful-boot.sh
> @@ -3,12 +3,12 @@
>   DEFAULT_REMAINING_ATTEMPTS=3
>   DEFAULT_PRIORITY=20
>   
> -system=$(sed /proc/cmdline -ne "s/\(^\|.* \)bootstate.active=\([^ ]*\).*/\2/p")
> +system=$(sed /proc/cmdline -ne "s/\(^\|.* \)bootchooser.active=\([^ ]*\).*/\2/p")
>   if [ -z "${system}" ]; then
>   	echo "unable to detect system partition" >&2
>   	exit 1
>   fi
>   
> -barebox-state -n /state \
> +barebox-state -n state \
>   	-s "bootstate.${system}.remaining_attempts=${DEFAULT_REMAINING_ATTEMPTS}" \
>   	-s "bootstate.${system}.priority=${DEFAULT_PRIORITY}"
> 

Thanks for your patch, I didn't even remember that we have a script for this ;)

For me, the changes look reasonable. Any concerns? Roland?


Enrico

-- 
Pengutronix e.K.                    | Enrico Jörns                |
Embedded Linux Consulting & Support | Teamleiter Integration      |
Steuerwalder Str. 21                | http://www.pengutronix.de/  |
31137 Hildesheim, Germany           | Phone: +49-5121-206917-5080 |
Amtsgericht Hildesheim, HRA 2686    | Fax:   +49-5121-206917-5555 |


_______________________________________________
OSS-Tools mailing list
OSS-Tools@pengutronix.de

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

* Re: [OSS-Tools] [PATCH dt-utils] barebox-mark-successful-boot: adopt naming from barebox
  2019-12-11 11:25 ` Enrico Joerns
@ 2019-12-12 11:50   ` Roland Hieber
  2019-12-12 12:07     ` Roland Hieber
  0 siblings, 1 reply; 6+ messages in thread
From: Roland Hieber @ 2019-12-12 11:50 UTC (permalink / raw)
  To: chf.fritz; +Cc: oss-tools

On Wed, Dec 11, 2019 at 12:25:11PM +0100, Enrico Joerns wrote:
> On 11/16/19 1:44 PM, Christoph Fritz wrote:
> > This patch is adopting current barebox default naming scheme.
> > 
> > Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
> > ---
> >   scripts/barebox-mark-successful-boot.sh | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/scripts/barebox-mark-successful-boot.sh b/scripts/barebox-mark-successful-boot.sh
> > index 3120f57..9286a63 100644
> > --- a/scripts/barebox-mark-successful-boot.sh
> > +++ b/scripts/barebox-mark-successful-boot.sh
> > @@ -3,12 +3,12 @@
> >   DEFAULT_REMAINING_ATTEMPTS=3
> >   DEFAULT_PRIORITY=20
> > -system=$(sed /proc/cmdline -ne "s/\(^\|.* \)bootstate.active=\([^ ]*\).*/\2/p")
> > +system=$(sed /proc/cmdline -ne "s/\(^\|.* \)bootchooser.active=\([^ ]*\).*/\2/p")
> >   if [ -z "${system}" ]; then
> >   	echo "unable to detect system partition" >&2
> >   	exit 1
> >   fi
> > -barebox-state -n /state \
> > +barebox-state -n state \
> >   	-s "bootstate.${system}.remaining_attempts=${DEFAULT_REMAINING_ATTEMPTS}" \
> >   	-s "bootstate.${system}.priority=${DEFAULT_PRIORITY}"
> > 
> 
> Thanks for your patch, I didn't even remember that we have a script for this ;)
> 
> For me, the changes look reasonable. Any concerns? Roland?

Hmm. My barebox 2019.06.0 here still passes the parameter as
"bootstate.active=system0", and I cannot find any commit in barebox
since then that changes this. Can you point me to a commit?

In any case, we should be compatible to old barebox versions, so both
versions of the parameter name should be accepted.

 - Roland

-- 
Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |

_______________________________________________
OSS-Tools mailing list
OSS-Tools@pengutronix.de

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

* Re: [OSS-Tools] [PATCH dt-utils] barebox-mark-successful-boot: adopt naming from barebox
  2019-12-12 11:50   ` Roland Hieber
@ 2019-12-12 12:07     ` Roland Hieber
  2019-12-13 12:23       ` Christoph Fritz
  0 siblings, 1 reply; 6+ messages in thread
From: Roland Hieber @ 2019-12-12 12:07 UTC (permalink / raw)
  To: chf.fritz; +Cc: oss-tools

On Thu, Dec 12, 2019 at 12:50:19PM +0100, Roland Hieber wrote:
> On Wed, Dec 11, 2019 at 12:25:11PM +0100, Enrico Joerns wrote:
> > On 11/16/19 1:44 PM, Christoph Fritz wrote:
> > > This patch is adopting current barebox default naming scheme.
> > > 
> > > Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
> > > ---
> > >   scripts/barebox-mark-successful-boot.sh | 4 ++--
> > >   1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/scripts/barebox-mark-successful-boot.sh b/scripts/barebox-mark-successful-boot.sh
> > > index 3120f57..9286a63 100644
> > > --- a/scripts/barebox-mark-successful-boot.sh
> > > +++ b/scripts/barebox-mark-successful-boot.sh
> > > @@ -3,12 +3,12 @@
> > >   DEFAULT_REMAINING_ATTEMPTS=3
> > >   DEFAULT_PRIORITY=20
> > > -system=$(sed /proc/cmdline -ne "s/\(^\|.* \)bootstate.active=\([^ ]*\).*/\2/p")
> > > +system=$(sed /proc/cmdline -ne "s/\(^\|.* \)bootchooser.active=\([^ ]*\).*/\2/p")
> > >   if [ -z "${system}" ]; then
> > >   	echo "unable to detect system partition" >&2
> > >   	exit 1
> > >   fi
> > > -barebox-state -n /state \
> > > +barebox-state -n state \
> > >   	-s "bootstate.${system}.remaining_attempts=${DEFAULT_REMAINING_ATTEMPTS}" \
> > >   	-s "bootstate.${system}.priority=${DEFAULT_PRIORITY}"
> > > 
> > 
> > Thanks for your patch, I didn't even remember that we have a script for this ;)
> > 
> > For me, the changes look reasonable. Any concerns? Roland?
> 
> Hmm. My barebox 2019.06.0 here still passes the parameter as
> "bootstate.active=system0", and I cannot find any commit in barebox
> since then that changes this. Can you point me to a commit?

Sorry, that was a barebox version which was heavily patched for
backwards compatibility with old kernels and userlands :-/ 

> In any case, we should be compatible to old barebox versions, so both
> versions of the parameter name should be accepted.

However this is still the best option I think.

 - Roland
 
-- 
Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |

_______________________________________________
OSS-Tools mailing list
OSS-Tools@pengutronix.de

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

* Re: [OSS-Tools] [PATCH dt-utils] barebox-mark-successful-boot: adopt naming from barebox
  2019-12-12 12:07     ` Roland Hieber
@ 2019-12-13 12:23       ` Christoph Fritz
  2020-01-19 23:19         ` Roland Hieber
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Fritz @ 2019-12-13 12:23 UTC (permalink / raw)
  To: Roland Hieber; +Cc: oss-tools

On Thu, 2019-12-12 at 13:07 +0100, Roland Hieber wrote:
> On Thu, Dec 12, 2019 at 12:50:19PM +0100, Roland Hieber wrote:
> > On Wed, Dec 11, 2019 at 12:25:11PM +0100, Enrico Joerns wrote:
> > > On 11/16/19 1:44 PM, Christoph Fritz wrote:
> > > > This patch is adopting current barebox default naming scheme.
> > > > 
> > > > Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
> > > > ---
> > > >   scripts/barebox-mark-successful-boot.sh | 4 ++--
> > > >   1 file changed, 2 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/scripts/barebox-mark-successful-boot.sh b/scripts/barebox-mark-successful-boot.sh
> > > > index 3120f57..9286a63 100644
> > > > --- a/scripts/barebox-mark-successful-boot.sh
> > > > +++ b/scripts/barebox-mark-successful-boot.sh
> > > > @@ -3,12 +3,12 @@
> > > >   DEFAULT_REMAINING_ATTEMPTS=3
> > > >   DEFAULT_PRIORITY=20
> > > > -system=$(sed /proc/cmdline -ne "s/\(^\|.* \)bootstate.active=\([^ ]*\).*/\2/p")
> > > > +system=$(sed /proc/cmdline -ne "s/\(^\|.* \)bootchooser.active=\([^ ]*\).*/\2/p")
> > > >   if [ -z "${system}" ]; then
> > > >   	echo "unable to detect system partition" >&2
> > > >   	exit 1
> > > >   fi
> > > > -barebox-state -n /state \
> > > > +barebox-state -n state \
> > > >   	-s "bootstate.${system}.remaining_attempts=${DEFAULT_REMAINING_ATTEMPTS}" \
> > > >   	-s "bootstate.${system}.priority=${DEFAULT_PRIORITY}"
> > > > 
> > > 
> > > Thanks for your patch, I didn't even remember that we have a script for this ;)
> > > 
> > > For me, the changes look reasonable. Any concerns? Roland?
> > 
> > Hmm. My barebox 2019.06.0 here still passes the parameter as
> > "bootstate.active=system0", and I cannot find any commit in barebox
> > since then that changes this. Can you point me to a commit?
> 
> Sorry, that was a barebox version which was heavily patched for
> backwards compatibility with old kernels and userlands :-/ 
> 
> > In any case, we should be compatible to old barebox versions, so both
> > versions of the parameter name should be accepted.
> 
> However this is still the best option I think.

So in the script you want to check the return value of barebox-state and
call it with the old parameters to be backward compatible?

bye
 -- Christoph


_______________________________________________
OSS-Tools mailing list
OSS-Tools@pengutronix.de

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

* Re: [OSS-Tools] [PATCH dt-utils] barebox-mark-successful-boot: adopt naming from barebox
  2019-12-13 12:23       ` Christoph Fritz
@ 2020-01-19 23:19         ` Roland Hieber
  0 siblings, 0 replies; 6+ messages in thread
From: Roland Hieber @ 2020-01-19 23:19 UTC (permalink / raw)
  To: Christoph Fritz; +Cc: oss-tools

On Fri, Dec 13, 2019 at 01:23:55PM +0100, Christoph Fritz wrote:
> On Thu, 2019-12-12 at 13:07 +0100, Roland Hieber wrote:
> > On Thu, Dec 12, 2019 at 12:50:19PM +0100, Roland Hieber wrote:
> > > On Wed, Dec 11, 2019 at 12:25:11PM +0100, Enrico Joerns wrote:
> > > > On 11/16/19 1:44 PM, Christoph Fritz wrote:
> > > > > This patch is adopting current barebox default naming scheme.
> > > > > 
> > > > > Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
> > > > > ---
> > > > >   scripts/barebox-mark-successful-boot.sh | 4 ++--
> > > > >   1 file changed, 2 insertions(+), 2 deletions(-)
> > > > > 
> > > > > diff --git a/scripts/barebox-mark-successful-boot.sh b/scripts/barebox-mark-successful-boot.sh
> > > > > index 3120f57..9286a63 100644
> > > > > --- a/scripts/barebox-mark-successful-boot.sh
> > > > > +++ b/scripts/barebox-mark-successful-boot.sh
> > > > > @@ -3,12 +3,12 @@
> > > > >   DEFAULT_REMAINING_ATTEMPTS=3
> > > > >   DEFAULT_PRIORITY=20
> > > > > -system=$(sed /proc/cmdline -ne "s/\(^\|.* \)bootstate.active=\([^ ]*\).*/\2/p")
> > > > > +system=$(sed /proc/cmdline -ne "s/\(^\|.* \)bootchooser.active=\([^ ]*\).*/\2/p")
> > > > >   if [ -z "${system}" ]; then
> > > > >   	echo "unable to detect system partition" >&2
> > > > >   	exit 1
> > > > >   fi
> > > > > -barebox-state -n /state \
> > > > > +barebox-state -n state \
> > > > >   	-s "bootstate.${system}.remaining_attempts=${DEFAULT_REMAINING_ATTEMPTS}" \
> > > > >   	-s "bootstate.${system}.priority=${DEFAULT_PRIORITY}"
> > > > > 
> > > > 
> > > > Thanks for your patch, I didn't even remember that we have a script for this ;)
> > > > 
> > > > For me, the changes look reasonable. Any concerns? Roland?
> > > 
> > > Hmm. My barebox 2019.06.0 here still passes the parameter as
> > > "bootstate.active=system0", and I cannot find any commit in barebox
> > > since then that changes this. Can you point me to a commit?
> > 
> > Sorry, that was a barebox version which was heavily patched for
> > backwards compatibility with old kernels and userlands :-/ 
> > 
> > > In any case, we should be compatible to old barebox versions, so both
> > > versions of the parameter name should be accepted.
> > 
> > However this is still the best option I think.
> 
> So in the script you want to check the return value of barebox-state and
> call it with the old parameters to be backward compatible?

Sorry, this one got lost during christmas holidays… Yes, right, that's
what I was thinking of:

-barebox-state -n /state \                                     
-     -s "bootstate.${system}.remaining_attempts=${DEFAULT_REMAINING_ATTEMPTS}" \
-     -s "bootstate.${system}.priority=${DEFAULT_PRIORITY}"
+ if ! barebox-state -n state \                                      
+      -s "bootchooser.${system}.remaining_attempts=${DEFAULT_REMAINING_ATTEMPTS}" \
+      -s "bootchooser.${system}.priority=${DEFAULT_PRIORITY}"
+ then
+     barebox-state -n state \
+         -s "bootstate.${system}.remaining_attempts=${DEFAULT_REMAINING_ATTEMPTS}" \
+         -s "bootstate.${system}.priority=${DEFAULT_PRIORITY}"
+ fi

(Also I cannot remember right now whether '-s /state' or '-s state'
makes a difference...)

 - Roland

-- 
Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |

_______________________________________________
OSS-Tools mailing list
OSS-Tools@pengutronix.de

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

end of thread, other threads:[~2020-01-19 23:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-16 12:44 [OSS-Tools] [PATCH dt-utils] barebox-mark-successful-boot: adopt naming from barebox Christoph Fritz
2019-12-11 11:25 ` Enrico Joerns
2019-12-12 11:50   ` Roland Hieber
2019-12-12 12:07     ` Roland Hieber
2019-12-13 12:23       ` Christoph Fritz
2020-01-19 23:19         ` Roland Hieber

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