All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] base-files: fix handling of resize
@ 2018-08-01  5:25 Chen Qi
  2018-08-01  5:25 ` [PATCH 1/1] " Chen Qi
  0 siblings, 1 reply; 6+ messages in thread
From: Chen Qi @ 2018-08-01  5:25 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 666e0783525a298217787e3d2f1460c57c2f59ca:

  gcc-7.3: Backport fixes for std::pair high memory usage (2018-07-31 22:55:35 +0100)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib ChenQi/base-files-resize
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/base-files-resize

Chen Qi (1):
  base-files: fix handling of resize

 meta/recipes-core/base-files/base-files/profile   | 6 +-----
 meta/recipes-core/base-files/base-files_3.0.14.bb | 1 +
 2 files changed, 2 insertions(+), 5 deletions(-)

-- 
1.9.1



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

* [PATCH 1/1] base-files: fix handling of resize
  2018-08-01  5:25 [PATCH 0/1] base-files: fix handling of resize Chen Qi
@ 2018-08-01  5:25 ` Chen Qi
  2018-08-01  5:31   ` ChenQi
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Chen Qi @ 2018-08-01  5:25 UTC (permalink / raw)
  To: openembedded-core

The current handling of resize is incorrect. Using `resize > /dev/null
2>&1 && resize > /dev/null' will cause the second resize command to not
execute because 'resize > /dev/null 2>&1' will fail for resize utility
from busybox.

What we really should do is just to check whether ${bindir}/resize
is executable and execute it if so. Using '-x' is sufficient.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/base-files/base-files/profile   | 6 +-----
 meta/recipes-core/base-files/base-files_3.0.14.bb | 1 +
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile
index e14cb2d..9e4283e 100644
--- a/meta/recipes-core/base-files/base-files/profile
+++ b/meta/recipes-core/base-files/base-files/profile
@@ -24,11 +24,7 @@ fi
 # /dev/tty[A-z]), otherwise we confuse e.g. the eclipse launcher which tries do
 # use ssh
 case $(tty 2>/dev/null) in
-	# The first invocation of resize verifies that it exists, the second
-	# does the actual resizing. This is due to that resize uses stderr to
-	# determine the size of the tty, which does not work if it is redirected
-	# to /dev/null.
-	/dev/tty[A-z]*) resize >/dev/null 2>&1 && resize >/dev/null;;
+	/dev/tty[A-z]*) [ -x @BINDIR@/resize ] && @BINDIR@/resize >/dev/null;;
 esac
 
 export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
index 1c0863b..05c0562 100644
--- a/meta/recipes-core/base-files/base-files_3.0.14.bb
+++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -121,6 +121,7 @@ do_install () {
 	install -m 0644 ${WORKDIR}/usbd ${D}${sysconfdir}/default/usbd
 	install -m 0644 ${WORKDIR}/profile ${D}${sysconfdir}/profile
 	sed -i 's#ROOTHOME#${ROOT_HOME}#' ${D}${sysconfdir}/profile
+        sed -i 's#@BINDIR@#${bindir}#g' ${D}${sysconfdir}/profile
 	install -m 0644 ${WORKDIR}/shells ${D}${sysconfdir}/shells
 	install -m 0755 ${WORKDIR}/share/dot.profile ${D}${sysconfdir}/skel/.profile
 	install -m 0755 ${WORKDIR}/share/dot.bashrc ${D}${sysconfdir}/skel/.bashrc
-- 
1.9.1



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

* Re: [PATCH 1/1] base-files: fix handling of resize
  2018-08-01  5:25 ` [PATCH 1/1] " Chen Qi
@ 2018-08-01  5:31   ` ChenQi
  2018-08-02 19:29   ` Peter Kjellerstedt
  2018-08-06  3:15   ` ChenQi
  2 siblings, 0 replies; 6+ messages in thread
From: ChenQi @ 2018-08-01  5:31 UTC (permalink / raw)
  To: openembedded-core

On 08/01/2018 01:25 PM, Chen Qi wrote:
> The current handling of resize is incorrect. Using `resize > /dev/null
> 2>&1 && resize > /dev/null' will cause the second resize command to not
> execute because 'resize > /dev/null 2>&1' will fail for resize utility
> from busybox.
>
> What we really should do is just to check whether ${bindir}/resize
> is executable and execute it if so. Using '-x' is sufficient.
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>   meta/recipes-core/base-files/base-files/profile   | 6 +-----
>   meta/recipes-core/base-files/base-files_3.0.14.bb | 1 +
>   2 files changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile
> index e14cb2d..9e4283e 100644
> --- a/meta/recipes-core/base-files/base-files/profile
> +++ b/meta/recipes-core/base-files/base-files/profile
> @@ -24,11 +24,7 @@ fi
>   # /dev/tty[A-z]), otherwise we confuse e.g. the eclipse launcher which tries do
>   # use ssh
>   case $(tty 2>/dev/null) in
> -	# The first invocation of resize verifies that it exists, the second
> -	# does the actual resizing. This is due to that resize uses stderr to
> -	# determine the size of the tty, which does not work if it is redirected
> -	# to /dev/null.
> -	/dev/tty[A-z]*) resize >/dev/null 2>&1 && resize >/dev/null;;
> +	/dev/tty[A-z]*) [ -x @BINDIR@/resize ] && @BINDIR@/resize >/dev/null;;
>   esac
>   
>   export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
> diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
> index 1c0863b..05c0562 100644
> --- a/meta/recipes-core/base-files/base-files_3.0.14.bb
> +++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
> @@ -121,6 +121,7 @@ do_install () {
>   	install -m 0644 ${WORKDIR}/usbd ${D}${sysconfdir}/default/usbd
>   	install -m 0644 ${WORKDIR}/profile ${D}${sysconfdir}/profile
>   	sed -i 's#ROOTHOME#${ROOT_HOME}#' ${D}${sysconfdir}/profile
> +        sed -i 's#@BINDIR@#${bindir}#g' ${D}${sysconfdir}/profile

Just noticed the indent here is not correct.
I've fixed this indentation problem and updated the remote branch.
Sorry for the inconvenience.

Best Regards,
Chen Qi

>   	install -m 0644 ${WORKDIR}/shells ${D}${sysconfdir}/shells
>   	install -m 0755 ${WORKDIR}/share/dot.profile ${D}${sysconfdir}/skel/.profile
>   	install -m 0755 ${WORKDIR}/share/dot.bashrc ${D}${sysconfdir}/skel/.bashrc




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

* Re: [PATCH 1/1] base-files: fix handling of resize
  2018-08-01  5:25 ` [PATCH 1/1] " Chen Qi
  2018-08-01  5:31   ` ChenQi
@ 2018-08-02 19:29   ` Peter Kjellerstedt
  2018-08-03  2:10     ` ChenQi
  2018-08-06  3:15   ` ChenQi
  2 siblings, 1 reply; 6+ messages in thread
From: Peter Kjellerstedt @ 2018-08-02 19:29 UTC (permalink / raw)
  To: Chen Qi, openembedded-core

> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org <openembedded-
> core-bounces@lists.openembedded.org> On Behalf Of Chen Qi
> Sent: den 1 augusti 2018 07:26
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH 1/1] base-files: fix handling of resize
> 
> The current handling of resize is incorrect. Using `resize > /dev/null
> 2>&1 && resize > /dev/null' will cause the second resize command to not
> execute because 'resize > /dev/null 2>&1' will fail for resize utility
> from busybox.

Meh, I was pretty sure I had verified it with resize from busybox, but it 
seems you are correct. However, the current logic can be maintained by 
instead changing the first invocation of resize to call "resize --help 
2>/dev/null".

> What we really should do is just to check whether ${bindir}/resize
> is executable and execute it if so. Using '-x' is sufficient.

Well, the intent of the current code (and the code before it) was to be 
agnostic to where resize happens to be located. That is obviously no 
longer the case after your change. Whether that matters or not, I do not 
know...

> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  meta/recipes-core/base-files/base-files/profile   | 6 +-----
>  meta/recipes-core/base-files/base-files_3.0.14.bb | 1 +
>  2 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile
> index e14cb2d..9e4283e 100644
> --- a/meta/recipes-core/base-files/base-files/profile
> +++ b/meta/recipes-core/base-files/base-files/profile
> @@ -24,11 +24,7 @@ fi
>  # /dev/tty[A-z]), otherwise we confuse e.g. the eclipse launcher which tries do
>  # use ssh
>  case $(tty 2>/dev/null) in
> -	# The first invocation of resize verifies that it exists, the second
> -	# does the actual resizing. This is due to that resize uses stderr to
> -	# determine the size of the tty, which does not work if it is redirected
> -	# to /dev/null.
> -	/dev/tty[A-z]*) resize >/dev/null 2>&1 && resize >/dev/null;;
> +	/dev/tty[A-z]*) [ -x @BINDIR@/resize ] && @BINDIR@/resize >/dev/null;;
>  esac
> 
>  export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
> diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
> index 1c0863b..05c0562 100644
> --- a/meta/recipes-core/base-files/base-files_3.0.14.bb
> +++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
> @@ -121,6 +121,7 @@ do_install () {
>  	install -m 0644 ${WORKDIR}/usbd ${D}${sysconfdir}/default/usbd
>  	install -m 0644 ${WORKDIR}/profile ${D}${sysconfdir}/profile
>  	sed -i 's#ROOTHOME#${ROOT_HOME}#' ${D}${sysconfdir}/profile
> +        sed -i 's#@BINDIR@#${bindir}#g' ${D}${sysconfdir}/profile
>  	install -m 0644 ${WORKDIR}/shells ${D}${sysconfdir}/shells
>  	install -m 0755 ${WORKDIR}/share/dot.profile ${D}${sysconfdir}/skel/.profile
>  	install -m 0755 ${WORKDIR}/share/dot.bashrc ${D}${sysconfdir}/skel/.bashrc
> --
> 1.9.1

//Peter



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

* Re: [PATCH 1/1] base-files: fix handling of resize
  2018-08-02 19:29   ` Peter Kjellerstedt
@ 2018-08-03  2:10     ` ChenQi
  0 siblings, 0 replies; 6+ messages in thread
From: ChenQi @ 2018-08-03  2:10 UTC (permalink / raw)
  To: Peter Kjellerstedt, openembedded-core

On 08/03/2018 03:29 AM, Peter Kjellerstedt wrote:
>> -----Original Message-----
>> From: openembedded-core-bounces@lists.openembedded.org <openembedded-
>> core-bounces@lists.openembedded.org> On Behalf Of Chen Qi
>> Sent: den 1 augusti 2018 07:26
>> To: openembedded-core@lists.openembedded.org
>> Subject: [OE-core] [PATCH 1/1] base-files: fix handling of resize
>>
>> The current handling of resize is incorrect. Using `resize > /dev/null
>> 2>&1 && resize > /dev/null' will cause the second resize command to not
>> execute because 'resize > /dev/null 2>&1' will fail for resize utility
>> from busybox.
> Meh, I was pretty sure I had verified it with resize from busybox, but it
> seems you are correct. However, the current logic can be maintained by
> instead changing the first invocation of resize to call "resize --help
> 2>/dev/null".
>
>> What we really should do is just to check whether ${bindir}/resize
>> is executable and execute it if so. Using '-x' is sufficient.
> Well, the intent of the current code (and the code before it) was to be
> agnostic to where resize happens to be located. That is obviously no
> longer the case after your change. Whether that matters or not, I do not
> know...

Thanks for clarifying things.
As both busybox and xterm install resize in ${bindir}, I think we will 
not have any trouble.
Besides, our update-alternatives mechanism does not allow different 
ALTERNATIVE_LINK_NAME for the same entry.

Best Regards,
Chen Qi


>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>> ---
>>   meta/recipes-core/base-files/base-files/profile   | 6 +-----
>>   meta/recipes-core/base-files/base-files_3.0.14.bb | 1 +
>>   2 files changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile
>> index e14cb2d..9e4283e 100644
>> --- a/meta/recipes-core/base-files/base-files/profile
>> +++ b/meta/recipes-core/base-files/base-files/profile
>> @@ -24,11 +24,7 @@ fi
>>   # /dev/tty[A-z]), otherwise we confuse e.g. the eclipse launcher which tries do
>>   # use ssh
>>   case $(tty 2>/dev/null) in
>> -	# The first invocation of resize verifies that it exists, the second
>> -	# does the actual resizing. This is due to that resize uses stderr to
>> -	# determine the size of the tty, which does not work if it is redirected
>> -	# to /dev/null.
>> -	/dev/tty[A-z]*) resize >/dev/null 2>&1 && resize >/dev/null;;
>> +	/dev/tty[A-z]*) [ -x @BINDIR@/resize ] && @BINDIR@/resize >/dev/null;;
>>   esac
>>
>>   export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
>> diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
>> index 1c0863b..05c0562 100644
>> --- a/meta/recipes-core/base-files/base-files_3.0.14.bb
>> +++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
>> @@ -121,6 +121,7 @@ do_install () {
>>   	install -m 0644 ${WORKDIR}/usbd ${D}${sysconfdir}/default/usbd
>>   	install -m 0644 ${WORKDIR}/profile ${D}${sysconfdir}/profile
>>   	sed -i 's#ROOTHOME#${ROOT_HOME}#' ${D}${sysconfdir}/profile
>> +        sed -i 's#@BINDIR@#${bindir}#g' ${D}${sysconfdir}/profile
>>   	install -m 0644 ${WORKDIR}/shells ${D}${sysconfdir}/shells
>>   	install -m 0755 ${WORKDIR}/share/dot.profile ${D}${sysconfdir}/skel/.profile
>>   	install -m 0755 ${WORKDIR}/share/dot.bashrc ${D}${sysconfdir}/skel/.bashrc
>> --
>> 1.9.1
> //Peter
>
>



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

* Re: [PATCH 1/1] base-files: fix handling of resize
  2018-08-01  5:25 ` [PATCH 1/1] " Chen Qi
  2018-08-01  5:31   ` ChenQi
  2018-08-02 19:29   ` Peter Kjellerstedt
@ 2018-08-06  3:15   ` ChenQi
  2 siblings, 0 replies; 6+ messages in thread
From: ChenQi @ 2018-08-06  3:15 UTC (permalink / raw)
  To: openembedded-core

ping

On 08/01/2018 01:25 PM, Chen Qi wrote:
> The current handling of resize is incorrect. Using `resize > /dev/null
> 2>&1 && resize > /dev/null' will cause the second resize command to not
> execute because 'resize > /dev/null 2>&1' will fail for resize utility
> from busybox.
>
> What we really should do is just to check whether ${bindir}/resize
> is executable and execute it if so. Using '-x' is sufficient.
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>   meta/recipes-core/base-files/base-files/profile   | 6 +-----
>   meta/recipes-core/base-files/base-files_3.0.14.bb | 1 +
>   2 files changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile
> index e14cb2d..9e4283e 100644
> --- a/meta/recipes-core/base-files/base-files/profile
> +++ b/meta/recipes-core/base-files/base-files/profile
> @@ -24,11 +24,7 @@ fi
>   # /dev/tty[A-z]), otherwise we confuse e.g. the eclipse launcher which tries do
>   # use ssh
>   case $(tty 2>/dev/null) in
> -	# The first invocation of resize verifies that it exists, the second
> -	# does the actual resizing. This is due to that resize uses stderr to
> -	# determine the size of the tty, which does not work if it is redirected
> -	# to /dev/null.
> -	/dev/tty[A-z]*) resize >/dev/null 2>&1 && resize >/dev/null;;
> +	/dev/tty[A-z]*) [ -x @BINDIR@/resize ] && @BINDIR@/resize >/dev/null;;
>   esac
>   
>   export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
> diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
> index 1c0863b..05c0562 100644
> --- a/meta/recipes-core/base-files/base-files_3.0.14.bb
> +++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
> @@ -121,6 +121,7 @@ do_install () {
>   	install -m 0644 ${WORKDIR}/usbd ${D}${sysconfdir}/default/usbd
>   	install -m 0644 ${WORKDIR}/profile ${D}${sysconfdir}/profile
>   	sed -i 's#ROOTHOME#${ROOT_HOME}#' ${D}${sysconfdir}/profile
> +        sed -i 's#@BINDIR@#${bindir}#g' ${D}${sysconfdir}/profile
>   	install -m 0644 ${WORKDIR}/shells ${D}${sysconfdir}/shells
>   	install -m 0755 ${WORKDIR}/share/dot.profile ${D}${sysconfdir}/skel/.profile
>   	install -m 0755 ${WORKDIR}/share/dot.bashrc ${D}${sysconfdir}/skel/.bashrc




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

end of thread, other threads:[~2018-08-06  3:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-01  5:25 [PATCH 0/1] base-files: fix handling of resize Chen Qi
2018-08-01  5:25 ` [PATCH 1/1] " Chen Qi
2018-08-01  5:31   ` ChenQi
2018-08-02 19:29   ` Peter Kjellerstedt
2018-08-03  2:10     ` ChenQi
2018-08-06  3:15   ` ChenQi

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.