systemd: add bash to RDEPENDS
cover systemd: add bash to RDEPENDS
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(+)
Signature · 1 line
1.9.1
PATCH 1/1 systemd: add bash to RDEPENDS
This solves the following warning:
systemd-216+gitAUTOINC+5d0ae62c66: systemd-kernel-install requires /bin/bash, but no providers in its RDEPENDS [file-rdeps]
--- meta/recipes-core/systemd/systemd_216.bb | 1 + 1 file changed, 1 insertion(+)
meta/recipes-core/systemd/systemd_216.bb +1 -0
@@ -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 \
Signature · 1 line
1.9.1
Quoted 2 lines · Chong Lu
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
Signature · 2 lines
Anders Darander ChargeStorm AB / eStorm AB
Quoted 12 lines · Anders Darander
Quoted 2 lines · Chong Lu
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
Quoted 8 lines · Chong Lu
Quoted 6 lines · Anders Darander
Quoted 2 lines · Chong Lu
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?
Quoted 7 lines
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...
Quoted 3 lines
possible bashism in
./usr/bin/kernel-installline 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.
Quoted 2 lines
possible bashism in
./usr/bin/kernel-installline 58 (should be 'b = a'):if [ "$i" == "--help" -o "$i" == "-h" ]; then
Dito for these.
Quoted 3 lines
possible bashism in
./usr/bin/kernel-installline 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
Signature · 2 lines
Anders Darander ChargeStorm AB / eStorm AB
Quoted 34 lines · Anders Darander
Quoted 7 lines · Chong Lu
Quoted 6 lines · Anders Darander
Quoted 2 lines · Chong Lu
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?
Quoted 6 lines
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...
Quoted 3 lines
possible bashism in
./usr/bin/kernel-installline 38 (alternative test command ([[ foo ]] should be [ foo ])):if [[ -e "$i" ]]; thenThere's quite a few of these, that are easy to patch and upstream.
Quoted 2 lines
possible bashism in
./usr/bin/kernel-installline 58 (should be 'b = a'):if [ "$i" == "--help" -o "$i" == "-h" ]; thenDito for these.
Quoted 3 lines
possible bashism in
./usr/bin/kernel-installline 113 ('((' should be '$(('):((ret+=$?))Likely dito.
So in summary, a large number of bashisms in kernel-install are easy to fix.
Quoted 6 lines
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
Quoted 6 lines
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
ping
//Chong
Quoted 22 lines · Chong Lu
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 <[email protected]>--- meta/recipes-core/systemd/systemd_216.bb | 1 + 1 file changed, 1 insertion(+)meta/recipes-core/systemd/systemd_216.bb +1
-0@@ -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 \
Quoted 4 lines
Op 11 nov. 2014, om 03:17 heeft Chong Lu <[email protected]> het volgende geschreven:
ping
Anders has 2 questions, you only answered one, maybe you can try answering the second one before pinging?
Quoted 32 lines
//Chong
Quoted 21 lines · Chong Lu
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 <[email protected]>--- meta/recipes-core/systemd/systemd_216.bb | 1 + 1 file changed, 1 insertion(+)meta/recipes-core/systemd/systemd_216.bb +0
-0@@ -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 \Signature · 4 lines
_______________________________________________ Openembedded-core mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-core