]> code.ossystems Code Review - openembedded-core.git/commitdiff
eudev: remove bashism to be compatible with dash
authorFedor Ross <fedor.ross@ifm.com>
Wed, 18 Nov 2020 17:13:13 +0000 (18:13 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 24 Nov 2020 10:27:38 +0000 (10:27 +0000)
Remove 'echo -e' and replace it with 'printf'. In bash the builtin
'echo' has an option for interpreting backslash escapes. In a shell like
dash the builtin 'echo' interprets backslash escapes by default.
Therefor the 'echo' in dash doesn't have the '-e' option. When using
'printf' instead it is safe to use it either with bash or dash.

Signed-off-by: Fedor Ross <fedor.ross@ifm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/udev/eudev/init

index 0455ade258c4612bb4db27ab5869fc56107dac5c..c60dbbf6d512b6bbf4bc5cd1403e335aaa2750de 100644 (file)
@@ -52,7 +52,7 @@ case "$1" in
     kill_udevd > "/dev/null" 2>&1
 
     # trigger the sorted events
-    [ -e /proc/sys/kernel/hotplug ] && echo -e '\000' >/proc/sys/kernel/hotplug
+    [ -e /proc/sys/kernel/hotplug ] && printf '\0\n' >/proc/sys/kernel/hotplug
     @UDEVD@ -d
 
     udevadm control --env=STARTUP=1