Skip to contentSkip to conversation

dash echo does not support -e option

PATCH In review Harald Hoyer 2 participants 2 messages May 15, 2009 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 7/11 dash echo does not support -e option

use /bin/echo, instead of dash builtin echo
do not use "sh -c"

---
 modules.d/95rootfs-block-udev/genrules.sh |    9 ++++-----
 modules.d/95rootfs-block-udev/install     |    1 +
 2 files changed, 5 insertions(+), 5 deletions(-)
modules.d/95rootfs-block-udev/genrules.sh +4 -5
index d4e226c..0b42483 100755
@@ -1,15 +1,14 @@
 
 resume=$(getarg resume=) && ! getarg noresume && [ -b "$resume" ] && {
-    # parsing the output of ls is Bad, but until there is a better way...
     (
-    	echo -e 'KERNEL=="'${resume#/dev/}'", RUN+="/bin/sh -c \047 echo %M:%m > /sys/power/resume \047 "'
-    	echo -e 'SYMLINK=="'${resume#/dev/}'", RUN+="/bin/sh -c \047 echo %M:%m > /sys/power/resume \047 "'
+    	/bin/echo -e 'KERNEL=="'${resume#/dev/}'", RUN+="/bin/echo %M:%m > /sys/power/resume"'
+    	/bin/echo -e 'SYMLINK=="'${resume#/dev/}'", RUN+="/bin/echo %M:%m > /sys/power/resume"'
     ) >> /etc/udev/rules.d/99-resume.rules
 }
 
 (
- echo -e 'KERNEL=="'${root#/dev/}'", RUN+="/bin/sh -c \047 mount '$fstype' -o '$rflags' '$root' '$NEWROOT' \047 " '
- echo -e 'SYMLINK=="'${root#/dev/}'", RUN+="/bin/sh -c \047 mount '$fstype' -o '$rflags' '$root' '$NEWROOT' \047 " '
+ echo 'KERNEL=="'${root#/dev/}'", RUN+="/bin/mount '$fstype' -o '$rflags' '$root' '$NEWROOT'" '
+ echo 'SYMLINK=="'${root#/dev/}'", RUN+="/bin/mount '$fstype' -o '$rflags' '$root' '$NEWROOT'" '
 ) >> /etc/udev/rules.d/99-mount.rules
 
 
modules.d/95rootfs-block-udev/install +1 -0
index 641e7df..3b02232 100755
@@ -1,3 +1,4 @@
 #!/bin/sh
+dracut_install echo
 inst_hook pre-udev 10 "$moddir/parse-root-opts.sh"
 inst_hook pre-udev 20 "$moddir/genrules.sh"
#2 lore raw
In reply to a message not in the archive

If you use printf (which is built in to dash), you do not have to include the actual echo binary.

Quoted 10 lines · Harald Hoyer

use /bin/echo, instead of dash builtin echo
do not use "sh -c"
---

modules.d/95rootfs-block-udev/genrules.sh |    9 ++++-----
modules.d/95rootfs-block-udev/install     |    1 +
2 files changed, 5 insertions(+), 5 deletions(-)

<e419faf652b7323963df00046b0fa6109ea6d12e.diff>

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html