mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] barebox: fix CONFIG_DEFAULT_ENVIRONMENT_PATH on oldconfig/nconfig/menuconfig
@ 2017-07-28 10:31 Bastian Stender
  2017-09-11  9:10 ` Bastian Stender
  0 siblings, 1 reply; 4+ messages in thread
From: Bastian Stender @ 2017-07-28 10:31 UTC (permalink / raw)
  To: ptxdist; +Cc: Bastian Stender

ptxdist adds ".ptxdist-defaultenv" if PTXCONF_BAREBOX_EXTRA_ENV is
enabled. If barebox oldconfig/nconfig/menuconfig do not modify the
configuration the barebox config from the BSP is copied without
executing the prepare stage responsible for amending
".ptxdist-defaultenv".

Steps to reproduce:

  ptxdist targetinstall barebox
  ptxdist menuconfig barebox (without modification)
  ptxdist drop barebox.compile
  ptxdist targetinstall barebox

Now CONFIG_DEFAULT_ENVIRONMENT_PATH is missing ".ptxdist-defaultenv"
leading to an unexpected environment.

Fix this by amending ".ptxdist-defaultenv" after
oldconfig/nconfig/menuconfig.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
---
 rules/barebox.make | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/rules/barebox.make b/rules/barebox.make
index bdfefe8c6..d391ec9eb 100644
--- a/rules/barebox.make
+++ b/rules/barebox.make
@@ -208,4 +208,11 @@ barebox_oldconfig barebox_menuconfig barebox_nconfig: $(STATEDIR)/barebox.extrac
 		cp $(BAREBOX_DIR)/.config $(BAREBOX_CONFIG); \
 	fi
 
+ifdef PTXCONF_BAREBOX_EXTRA_ENV
+	@if test -e $(BAREBOX_CONFIG); then \
+		@sed -i -e "s,^\(CONFIG_DEFAULT_ENVIRONMENT_PATH=.*\)\"$$,\1 .ptxdist-defaultenv\"," \
+			$(BAREBOX_DIR)/.config
+	fi
+endif
+
 # vim: syntax=make
-- 
2.11.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] barebox: fix CONFIG_DEFAULT_ENVIRONMENT_PATH on oldconfig/nconfig/menuconfig
  2017-07-28 10:31 [ptxdist] [PATCH] barebox: fix CONFIG_DEFAULT_ENVIRONMENT_PATH on oldconfig/nconfig/menuconfig Bastian Stender
@ 2017-09-11  9:10 ` Bastian Stender
  2017-09-13 15:12   ` Michael Olbrich
  0 siblings, 1 reply; 4+ messages in thread
From: Bastian Stender @ 2017-09-11  9:10 UTC (permalink / raw)
  To: ptxdist

On 07/28/2017 12:31 PM, Bastian Stender wrote:
> ptxdist adds ".ptxdist-defaultenv" if PTXCONF_BAREBOX_EXTRA_ENV is
> enabled. If barebox oldconfig/nconfig/menuconfig do not modify the
> configuration the barebox config from the BSP is copied without
> executing the prepare stage responsible for amending
> ".ptxdist-defaultenv".
> 
> Steps to reproduce:
> 
>    ptxdist targetinstall barebox
>    ptxdist menuconfig barebox (without modification)
>    ptxdist drop barebox.compile
>    ptxdist targetinstall barebox
> 
> Now CONFIG_DEFAULT_ENVIRONMENT_PATH is missing ".ptxdist-defaultenv"
> leading to an unexpected environment.
> 
> Fix this by amending ".ptxdist-defaultenv" after
> oldconfig/nconfig/menuconfig.
> 
> Signed-off-by: Bastian Stender <bst@pengutronix.de>
> ---
>   rules/barebox.make | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/rules/barebox.make b/rules/barebox.make
> index bdfefe8c6..d391ec9eb 100644
> --- a/rules/barebox.make
> +++ b/rules/barebox.make
> @@ -208,4 +208,11 @@ barebox_oldconfig barebox_menuconfig barebox_nconfig: $(STATEDIR)/barebox.extrac
>   		cp $(BAREBOX_DIR)/.config $(BAREBOX_CONFIG); \
>   	fi
>   
> +ifdef PTXCONF_BAREBOX_EXTRA_ENV
> +	@if test -e $(BAREBOX_CONFIG); then \
> +		@sed -i -e "s,^\(CONFIG_DEFAULT_ENVIRONMENT_PATH=.*\)\"$$,\1 .ptxdist-defaultenv\"," \
> +			$(BAREBOX_DIR)/.config
> +	fi
> +endif
> +
>   # vim: syntax=make
> 

Any thoughts on this patch?

Bastian

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] barebox: fix CONFIG_DEFAULT_ENVIRONMENT_PATH on oldconfig/nconfig/menuconfig
  2017-09-11  9:10 ` Bastian Stender
@ 2017-09-13 15:12   ` Michael Olbrich
  2017-09-13 15:51     ` Bastian Stender
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Olbrich @ 2017-09-13 15:12 UTC (permalink / raw)
  To: ptxdist

On Mon, Sep 11, 2017 at 11:10:10AM +0200, Bastian Stender wrote:
> On 07/28/2017 12:31 PM, Bastian Stender wrote:
> > ptxdist adds ".ptxdist-defaultenv" if PTXCONF_BAREBOX_EXTRA_ENV is
> > enabled. If barebox oldconfig/nconfig/menuconfig do not modify the
> > configuration the barebox config from the BSP is copied without
> > executing the prepare stage responsible for amending
> > ".ptxdist-defaultenv".
> > 
> > Steps to reproduce:
> > 
> >    ptxdist targetinstall barebox
> >    ptxdist menuconfig barebox (without modification)
> >    ptxdist drop barebox.compile
> >    ptxdist targetinstall barebox
> > 
> > Now CONFIG_DEFAULT_ENVIRONMENT_PATH is missing ".ptxdist-defaultenv"
> > leading to an unexpected environment.
> > 
> > Fix this by amending ".ptxdist-defaultenv" after
> > oldconfig/nconfig/menuconfig.
> > 
> > Signed-off-by: Bastian Stender <bst@pengutronix.de>
> > ---
> >   rules/barebox.make | 7 +++++++
> >   1 file changed, 7 insertions(+)
> > 
> > diff --git a/rules/barebox.make b/rules/barebox.make
> > index bdfefe8c6..d391ec9eb 100644
> > --- a/rules/barebox.make
> > +++ b/rules/barebox.make
> > @@ -208,4 +208,11 @@ barebox_oldconfig barebox_menuconfig barebox_nconfig: $(STATEDIR)/barebox.extrac
> >   		cp $(BAREBOX_DIR)/.config $(BAREBOX_CONFIG); \
> >   	fi
> > +ifdef PTXCONF_BAREBOX_EXTRA_ENV
> > +	@if test -e $(BAREBOX_CONFIG); then \
> > +		@sed -i -e "s,^\(CONFIG_DEFAULT_ENVIRONMENT_PATH=.*\)\"$$,\1 .ptxdist-defaultenv\"," \

no @ here

> > +			$(BAREBOX_DIR)/.config

missing '; \' at the end of the line.

> > +	fi
> > +endif
> > +
> >   # vim: syntax=make
> > 
> 
> Any thoughts on this patch?

Even with the fixes above, it only works in some cases. If *config is
aborted with ctrl-c then the problem still exists.

Maybe move the sed magic to compile and only do it if it's not there
already?

Michael

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

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] barebox: fix CONFIG_DEFAULT_ENVIRONMENT_PATH on oldconfig/nconfig/menuconfig
  2017-09-13 15:12   ` Michael Olbrich
@ 2017-09-13 15:51     ` Bastian Stender
  0 siblings, 0 replies; 4+ messages in thread
From: Bastian Stender @ 2017-09-13 15:51 UTC (permalink / raw)
  To: ptxdist

On 09/13/2017 05:12 PM, Michael Olbrich wrote:
> On Mon, Sep 11, 2017 at 11:10:10AM +0200, Bastian Stender wrote:
>> On 07/28/2017 12:31 PM, Bastian Stender wrote:
>>> ptxdist adds ".ptxdist-defaultenv" if PTXCONF_BAREBOX_EXTRA_ENV is
>>> enabled. If barebox oldconfig/nconfig/menuconfig do not modify the
>>> configuration the barebox config from the BSP is copied without
>>> executing the prepare stage responsible for amending
>>> ".ptxdist-defaultenv".
>>>
>>> Steps to reproduce:
>>>
>>>     ptxdist targetinstall barebox
>>>     ptxdist menuconfig barebox (without modification)
>>>     ptxdist drop barebox.compile
>>>     ptxdist targetinstall barebox
>>>
>>> Now CONFIG_DEFAULT_ENVIRONMENT_PATH is missing ".ptxdist-defaultenv"
>>> leading to an unexpected environment.
>>>
>>> Fix this by amending ".ptxdist-defaultenv" after
>>> oldconfig/nconfig/menuconfig.
>>>
>>> Signed-off-by: Bastian Stender <bst@pengutronix.de>
>>> ---
>>>    rules/barebox.make | 7 +++++++
>>>    1 file changed, 7 insertions(+)
>>>
>>> diff --git a/rules/barebox.make b/rules/barebox.make
>>> index bdfefe8c6..d391ec9eb 100644
>>> --- a/rules/barebox.make
>>> +++ b/rules/barebox.make
>>> @@ -208,4 +208,11 @@ barebox_oldconfig barebox_menuconfig barebox_nconfig: $(STATEDIR)/barebox.extrac
>>>    		cp $(BAREBOX_DIR)/.config $(BAREBOX_CONFIG); \
>>>    	fi
>>> +ifdef PTXCONF_BAREBOX_EXTRA_ENV
>>> +	@if test -e $(BAREBOX_CONFIG); then \
>>> +		@sed -i -e "s,^\(CONFIG_DEFAULT_ENVIRONMENT_PATH=.*\)\"$$,\1 .ptxdist-defaultenv\"," \
> 
> no @ here
> 
>>> +			$(BAREBOX_DIR)/.config
> 
> missing '; \' at the end of the line.
> 
>>> +	fi
>>> +endif
>>> +
>>>    # vim: syntax=make
>>>
>>
>> Any thoughts on this patch?
> 
> Even with the fixes above, it only works in some cases. If *config is
> aborted with ctrl-c then the problem still exists.
> 
> Maybe move the sed magic to compile and only do it if it's not there
> already?

Sounds good, I'll send a patch.

Bastian

-- 
Pengutronix e.K.
Industrial Linux Solutions
http://www.pengutronix.de/
Peiner Str. 6-8, 31137 Hildesheim, Germany
Amtsgericht Hildesheim, HRA 2686

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2017-09-13 15:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-28 10:31 [ptxdist] [PATCH] barebox: fix CONFIG_DEFAULT_ENVIRONMENT_PATH on oldconfig/nconfig/menuconfig Bastian Stender
2017-09-11  9:10 ` Bastian Stender
2017-09-13 15:12   ` Michael Olbrich
2017-09-13 15:51     ` Bastian Stender

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