Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] systemd: add bash to RDEPENDS
@ 2014-10-27  7:16 Chong Lu
  2014-10-27  7:16 ` [PATCH 1/1] " Chong Lu
  0 siblings, 1 reply; 8+ messages in thread
From: Chong Lu @ 2014-10-27  7:16 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit dacc4ce59e48129a1a1e5316e10780f7358e29ef:

  nativesdk-cmake: Adjust toolchain paths dynamically (2014-10-24 21:59:46 +0100)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib chonglu/systemd
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=chonglu/systemd

Chong Lu (1):
  systemd: add bash to RDEPENDS

 meta/recipes-core/systemd/systemd_216.bb | 1 +
 1 file changed, 1 insertion(+)

-- 
1.9.1



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

* [PATCH 1/1] systemd: add bash to RDEPENDS
  2014-10-27  7:16 [PATCH 0/1] systemd: add bash to RDEPENDS Chong Lu
@ 2014-10-27  7:16 ` Chong Lu
  2014-10-27  8:59   ` Anders Darander
  2014-11-11  2:17   ` Chong Lu
  0 siblings, 2 replies; 8+ messages in thread
From: Chong Lu @ 2014-10-27  7:16 UTC (permalink / raw)
  To: openembedded-core

This solves the following warning:

systemd-216+gitAUTOINC+5d0ae62c66: systemd-kernel-install requires /bin/bash,
but no providers in its RDEPENDS [file-rdeps]

Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
---
 meta/recipes-core/systemd/systemd_216.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-core/systemd/systemd_216.bb b/meta/recipes-core/systemd/systemd_216.bb
index 6d3e47f..8bc1cc8 100644
--- a/meta/recipes-core/systemd/systemd_216.bb
+++ b/meta/recipes-core/systemd/systemd_216.bb
@@ -202,6 +202,7 @@ FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
                               ${systemd_unitdir}/system/systemd-vconsole-setup.service \
                               ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
 
+RDEPENDS_${PN}-kernel-install += "bash"
 FILES_${PN}-kernel-install = "${bindir}/kernel-install \
                               ${sysconfdir}/kernel/ \
                               ${exec_prefix}/lib/kernel \
-- 
1.9.1



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

* Re: [PATCH 1/1] systemd: add bash to RDEPENDS
  2014-10-27  7:16 ` [PATCH 1/1] " Chong Lu
@ 2014-10-27  8:59   ` Anders Darander
  2014-10-27  9:24     ` Chong Lu
  2014-11-11  2:17   ` Chong Lu
  1 sibling, 1 reply; 8+ messages in thread
From: Anders Darander @ 2014-10-27  8:59 UTC (permalink / raw)
  To: Chong Lu; +Cc: openembedded-core@lists.openembedded.org

* Chong Lu <Chong.Lu@windriver.com> [141027 08:19]:
> systemd-216+gitAUTOINC+5d0ae62c66: systemd-kernel-install requires /bin/bash,
> but no providers in its RDEPENDS [file-rdeps]

How much bashisms are it in the files in systemd-kernel-install?
Would it be possible to to patch the scripts to use standard posixh sh
instead of bash?

It's always good/nice to not force bash to be installed.

Cheers,
Anders

-- 
Anders Darander
ChargeStorm AB / eStorm AB


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

* Re: [PATCH 1/1] systemd: add bash to RDEPENDS
  2014-10-27  8:59   ` Anders Darander
@ 2014-10-27  9:24     ` Chong Lu
  2014-11-12 11:59       ` Anders Darander
  0 siblings, 1 reply; 8+ messages in thread
From: Chong Lu @ 2014-10-27  9:24 UTC (permalink / raw)
  To: Anders Darander; +Cc: openembedded-core@lists.openembedded.org


On 10/27/2014 04:59 PM, Anders Darander wrote:
> * Chong Lu <Chong.Lu@windriver.com> [141027 08:19]:
>> systemd-216+gitAUTOINC+5d0ae62c66: systemd-kernel-install requires /bin/bash,
>> but no providers in its RDEPENDS [file-rdeps]
> How much bashisms are it in the files in systemd-kernel-install?
> Would it be possible to to patch the scripts to use standard posixh sh
> instead of bash?
>
> It's always good/nice to not force bash to be installed.
>
> Cheers,
> Anders
>

Hi Anders,

It has lots of bashisms:

$ checkbashisms ./usr/bin/kernel-install
possible bashism in ./usr/bin/kernel-install line 32 (local -opt):
     local -a files
possible bashism in ./usr/bin/kernel-install line 35 (readarray):
     readarray -t files < <(
possible bashism in ./usr/bin/kernel-install line 38 (alternative test 
command ([[ foo ]] should be [ foo ])):
                 if [[ -e "$i" ]]; then
possible bashism in ./usr/bin/kernel-install line 45 (bash arrays, 
${name[0|*|@]}):
     for f in "${files[@]}"; do
possible bashism in ./usr/bin/kernel-install line 47 (alternative test 
command ([[ foo ]] should be [ foo ])):
             if [[ -e "$d/$f" ]]; then
possible bashism in ./usr/bin/kernel-install line 58 (should be 'b = a'):
     if [ "$i" == "--help" -o "$i" == "-h" ]; then
possible bashism in ./usr/bin/kernel-install line 58 (should be 'b = a'):
     if [ "$i" == "--help" -o "$i" == "-h" ]; then
possible bashism in ./usr/bin/kernel-install line 64 (alternative test 
command ([[ foo ]] should be [ foo ])):
if [[ "${0##*/}" == 'installkernel' ]]; then
possible bashism in ./usr/bin/kernel-install line 64 (should be 'b = a'):
if [[ "${0##*/}" == 'installkernel' ]]; then
possible bashism in ./usr/bin/kernel-install line 74 (alternative test 
command ([[ foo ]] should be [ foo ])):
if [[ -f /etc/machine-id ]]; then
possible bashism in ./usr/bin/kernel-install line 78 (alternative test 
command ([[ foo ]] should be [ foo ])):
if ! [[ $MACHINE_ID ]]; then
possible bashism in ./usr/bin/kernel-install line 84 (alternative test 
command ([[ foo ]] should be [ foo ])):
if [[ ! $COMMAND ]] || [[ ! $KERNEL_VERSION ]]; then
possible bashism in ./usr/bin/kernel-install line 92 (readarray):
readarray -t PLUGINS < <(
possible bashism in ./usr/bin/kernel-install line 100 (alternative test 
command ([[ foo ]] should be [ foo ])):
         if [[ ! "$KERNEL_IMAGE" ]]; then
possible bashism in ./usr/bin/kernel-install line 110 (bash arrays, 
${name[0|*|@]}):
         for f in "${PLUGINS[@]}"; do
possible bashism in ./usr/bin/kernel-install line 111 (alternative test 
command ([[ foo ]] should be [ foo ])):
             if [[ -x $f ]]; then
possible bashism in ./usr/bin/kernel-install line 113 (should be 
VAR="${VAR}foo"):
                 ((ret+=$?))
possible bashism in ./usr/bin/kernel-install line 113 ('((' should be 
'$(('):
                 ((ret+=$?))
possible bashism in ./usr/bin/kernel-install line 119 (bash arrays, 
${name[0|*|@]}):
         for f in "${PLUGINS[@]}"; do
possible bashism in ./usr/bin/kernel-install line 120 (alternative test 
command ([[ foo ]] should be [ foo ])):
             if [[ -x $f ]]; then
possible bashism in ./usr/bin/kernel-install line 122 (should be 
VAR="${VAR}foo"):
                 ((ret+=$?))
possible bashism in ./usr/bin/kernel-install line 122 ('((' should be 
'$(('):
                 ((ret+=$?))
possible bashism in ./usr/bin/kernel-install line 127 (should be 
VAR="${VAR}foo"):
         ((ret+=$?))
possible bashism in ./usr/bin/kernel-install line 127 ('((' should be 
'$(('):
         ((ret+=$?))

$ checkbashisms ./usr/lib/kernel/install.d/50-depmod.install
possible bashism in ./usr/lib/kernel/install.d/50-depmod.install line 5 
(alternative test command ([[ foo ]] should be [ foo ])):
[[ $1 == "add" ]] || exit 0
possible bashism in ./usr/lib/kernel/install.d/50-depmod.install line 5 
(should be 'b = a'):
[[ $1 == "add" ]] || exit 0
possible bashism in ./usr/lib/kernel/install.d/50-depmod.install line 6 
(alternative test command ([[ foo ]] should be [ foo ])):
[[ $2 ]] || exit 1

$ checkbashisms ./usr/lib/kernel/install.d/90-loaderentry.install
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 10 (alternative test command ([[ foo ]] should be [ foo ])):
if [[ -f /etc/machine-id ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 14 (alternative test command ([[ foo ]] should be [ foo ])):
if ! [[ $MACHINE_ID ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 21 (alternative test command ([[ foo ]] should be [ foo ])):
if [[ $COMMAND == remove ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 21 (should be 'b = a'):
if [[ $COMMAND == remove ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 25 (alternative test command ([[ foo ]] should be [ foo ])):
if ! [[ $COMMAND == add ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 25 (should be 'b = a'):
if ! [[ $COMMAND == add ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 29 (alternative test command ([[ foo ]] should be [ foo ])):
if ! [[ $KERNEL_IMAGE ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 33 (alternative test command ([[ foo ]] should be [ foo ])):
if [[ -f /etc/os-release ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 35 (alternative test command ([[ foo ]] should be [ foo ])):
elif [[ -f /usr/lib/os-release ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 39 (alternative test command ([[ foo ]] should be [ foo ])):
if ! [[ $PRETTY_NAME ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 43 (declare):
declare -a BOOT_OPTIONS
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 45 (alternative test command ([[ foo ]] should be [ foo ])):
if [[ -f /etc/kernel/cmdline ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 46 (readarray):
     readarray -t BOOT_OPTIONS < /etc/kernel/cmdline
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 49 (bash arrays, ${name[0|*|@]}):
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 49 (alternative test command ([[ foo ]] should be [ foo ])):
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 50 (read with option other than -r):
     read -ar line < /proc/cmdline
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 51 (bash arrays, ${name[0|*|@]}):
     for i in "${line[@]}"; do
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 52 (alternative test command ([[ foo ]] should be [ foo ])):
         [[ "${i#initrd=*}" != "$i" ]] && continue
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 53 (bash arrays, ${name[0|*|@]}):
         BOOT_OPTIONS[${#BOOT_OPTIONS[@]}]="$i"
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 57 (bash arrays, ${name[0|*|@]}):
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 57 (alternative test command ([[ foo ]] should be [ foo ])):
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 79 (bash arrays, ${name[0|*|@]}):
     echo "options    ${BOOT_OPTIONS[*]}"
possible bashism in ./usr/lib/kernel/install.d/90-loaderentry.install 
line 82 (alternative test command ([[ foo ]] should be [ foo ])):
     [[ -f $BOOT_DIR_ABS/initrd ]] && \
         echo "initrd     $BOOT_DIR/initrd"

Best Regards
Chong


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

* Re: [PATCH 1/1] systemd: add bash to RDEPENDS
  2014-10-27  7:16 ` [PATCH 1/1] " Chong Lu
  2014-10-27  8:59   ` Anders Darander
@ 2014-11-11  2:17   ` Chong Lu
  2014-11-12 10:28     ` Koen Kooi
  1 sibling, 1 reply; 8+ messages in thread
From: Chong Lu @ 2014-11-11  2:17 UTC (permalink / raw)
  To: openembedded-core

ping

//Chong

On 10/27/2014 03:16 PM, Chong Lu wrote:
> This solves the following warning:
>
> systemd-216+gitAUTOINC+5d0ae62c66: systemd-kernel-install requires /bin/bash,
> but no providers in its RDEPENDS [file-rdeps]
>
> Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
> ---
>   meta/recipes-core/systemd/systemd_216.bb | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/meta/recipes-core/systemd/systemd_216.bb b/meta/recipes-core/systemd/systemd_216.bb
> index 6d3e47f..8bc1cc8 100644
> --- a/meta/recipes-core/systemd/systemd_216.bb
> +++ b/meta/recipes-core/systemd/systemd_216.bb
> @@ -202,6 +202,7 @@ FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
>                                 ${systemd_unitdir}/system/systemd-vconsole-setup.service \
>                                 ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
>   
> +RDEPENDS_${PN}-kernel-install += "bash"
>   FILES_${PN}-kernel-install = "${bindir}/kernel-install \
>                                 ${sysconfdir}/kernel/ \
>                                 ${exec_prefix}/lib/kernel \



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

* Re: [PATCH 1/1] systemd: add bash to RDEPENDS
  2014-11-11  2:17   ` Chong Lu
@ 2014-11-12 10:28     ` Koen Kooi
  0 siblings, 0 replies; 8+ messages in thread
From: Koen Kooi @ 2014-11-12 10:28 UTC (permalink / raw)
  To: Chong Lu; +Cc: openembedded-core


> Op 11 nov. 2014, om 03:17 heeft Chong Lu <Chong.Lu@windriver.com> het volgende geschreven:
> 
> ping

Anders has 2 questions, you only answered one, maybe you can try answering the second one before pinging?

> 
> //Chong
> 
> On 10/27/2014 03:16 PM, Chong Lu wrote:
>> This solves the following warning:
>> 
>> systemd-216+gitAUTOINC+5d0ae62c66: systemd-kernel-install requires /bin/bash,
>> but no providers in its RDEPENDS [file-rdeps]
>> 
>> Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
>> ---
>>  meta/recipes-core/systemd/systemd_216.bb | 1 +
>>  1 file changed, 1 insertion(+)
>> 
>> diff --git a/meta/recipes-core/systemd/systemd_216.bb b/meta/recipes-core/systemd/systemd_216.bb
>> index 6d3e47f..8bc1cc8 100644
>> --- a/meta/recipes-core/systemd/systemd_216.bb
>> +++ b/meta/recipes-core/systemd/systemd_216.bb
>> @@ -202,6 +202,7 @@ FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
>>                                ${systemd_unitdir}/system/systemd-vconsole-setup.service \
>>                                ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
>>  +RDEPENDS_${PN}-kernel-install += "bash"
>>  FILES_${PN}-kernel-install = "${bindir}/kernel-install \
>>                                ${sysconfdir}/kernel/ \
>>                                ${exec_prefix}/lib/kernel \
> 
> -- 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
> 



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

* Re: [PATCH 1/1] systemd: add bash to RDEPENDS
  2014-10-27  9:24     ` Chong Lu
@ 2014-11-12 11:59       ` Anders Darander
  2014-11-24  8:50         ` Chong Lu
  0 siblings, 1 reply; 8+ messages in thread
From: Anders Darander @ 2014-11-12 11:59 UTC (permalink / raw)
  To: Chong Lu; +Cc: openembedded-core@lists.openembedded.org

* Chong Lu <Chong.Lu@windriver.com> [141027 10:24]:
> On 10/27/2014 04:59 PM, Anders Darander wrote:
> > * Chong Lu <Chong.Lu@windriver.com> [141027 08:19]:
> >> systemd-216+gitAUTOINC+5d0ae62c66: systemd-kernel-install requires /bin/bash,
> >> but no providers in its RDEPENDS [file-rdeps]
> > How much bashisms are it in the files in systemd-kernel-install?
> > Would it be possible to to patch the scripts to use standard posixh sh
> > instead of bash?

> It has lots of bashisms:

> $ checkbashisms ./usr/bin/kernel-install
> possible bashism in ./usr/bin/kernel-install line 32 (local -opt):
>      local -a files
> possible bashism in ./usr/bin/kernel-install line 35 (readarray):
>      readarray -t files < <(

This one, readarray, might require some thought on how to make it
standard posix sh compatible...

> possible bashism in ./usr/bin/kernel-install line 38 (alternative test 
> command ([[ foo ]] should be [ foo ])):
>                  if [[ -e "$i" ]]; then

There's quite a few of these, that are easy to patch and upstream.

> possible bashism in ./usr/bin/kernel-install line 58 (should be 'b = a'):
>      if [ "$i" == "--help" -o "$i" == "-h" ]; then

Dito for these.

> possible bashism in ./usr/bin/kernel-install line 113 ('((' should be 
> '$(('):
>                  ((ret+=$?))

Likely dito.

So in summary, a large number of bashisms in kernel-install are easy to
fix.

Then there's a few that's a lot harder, all of these are using arrays
and readarray.

It would have been nice to see such a summary instead of only the rather
long report. If we can find another way to implement the code using
arrays, the complete patch should be upstreamable.

I'm currently not using kernel-install in any system, thus, due to
workload, I'm not going to be able to look into this at the moment.

Cheers,
Anders
-- 
Anders Darander
ChargeStorm AB / eStorm AB


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

* Re: [PATCH 1/1] systemd: add bash to RDEPENDS
  2014-11-12 11:59       ` Anders Darander
@ 2014-11-24  8:50         ` Chong Lu
  0 siblings, 0 replies; 8+ messages in thread
From: Chong Lu @ 2014-11-24  8:50 UTC (permalink / raw)
  To: openembedded-core@lists.openembedded.org


On 11/12/2014 07:59 PM, Anders Darander wrote:
> * Chong Lu <Chong.Lu@windriver.com> [141027 10:24]:
>> On 10/27/2014 04:59 PM, Anders Darander wrote:
>>> * Chong Lu <Chong.Lu@windriver.com> [141027 08:19]:
>>>> systemd-216+gitAUTOINC+5d0ae62c66: systemd-kernel-install requires /bin/bash,
>>>> but no providers in its RDEPENDS [file-rdeps]
>>> How much bashisms are it in the files in systemd-kernel-install?
>>> Would it be possible to to patch the scripts to use standard posixh sh
>>> instead of bash?
>> It has lots of bashisms:
>> $ checkbashisms ./usr/bin/kernel-install
>> possible bashism in ./usr/bin/kernel-install line 32 (local -opt):
>>       local -a files
>> possible bashism in ./usr/bin/kernel-install line 35 (readarray):
>>       readarray -t files < <(
> This one, readarray, might require some thought on how to make it
> standard posix sh compatible...
>
>> possible bashism in ./usr/bin/kernel-install line 38 (alternative test
>> command ([[ foo ]] should be [ foo ])):
>>                   if [[ -e "$i" ]]; then
> There's quite a few of these, that are easy to patch and upstream.
>
>> possible bashism in ./usr/bin/kernel-install line 58 (should be 'b = a'):
>>       if [ "$i" == "--help" -o "$i" == "-h" ]; then
> Dito for these.
>
>> possible bashism in ./usr/bin/kernel-install line 113 ('((' should be
>> '$(('):
>>                   ((ret+=$?))
> Likely dito.
>
> So in summary, a large number of bashisms in kernel-install are easy to
> fix.
>
> Then there's a few that's a lot harder, all of these are using arrays
> and readarray.
>
> It would have been nice to see such a summary instead of only the rather
> long report. If we can find another way to implement the code using
> arrays, the complete patch should be upstreamable.

Yes, some bashisms about array in kernel-install and 
90-loaderentry.install script.
But it is painful to fix them. The systemd-kernel-install is a sub 
package and it isn't installed by default.
It doesn't impact image size when we add bash dependency to 
systemd-kernel-install.
If you don't agree add bash dependency, we just get a warning about 
file-rdeps.

Best Regards
Chong

>
> I'm currently not using kernel-install in any system, thus, due to
> workload, I'm not going to be able to look into this at the moment.
>
> Cheers,
> Anders



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

end of thread, other threads:[~2014-11-24  8:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-27  7:16 [PATCH 0/1] systemd: add bash to RDEPENDS Chong Lu
2014-10-27  7:16 ` [PATCH 1/1] " Chong Lu
2014-10-27  8:59   ` Anders Darander
2014-10-27  9:24     ` Chong Lu
2014-11-12 11:59       ` Anders Darander
2014-11-24  8:50         ` Chong Lu
2014-11-11  2:17   ` Chong Lu
2014-11-12 10:28     ` Koen Kooi

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