[FIX] Change 'echo' by '/bin/echo' 17/44017/1
authorDmitry Kovalenko <d.kovalenko@samsung.com>
Thu, 16 Jul 2015 07:55:09 +0000 (10:55 +0300)
committerDmitry Kovalenko <d.kovalenko@samsung.com>
Thu, 16 Jul 2015 07:55:16 +0000 (10:55 +0300)
This fixes issues on new binaries

Change-Id: If262c6445cd11f5bf4906b15349e4ff58d726432
Signed-off-by: Dmitry Kovalenko <d.kovalenko@samsung.com>
scripts/gen_preload_header.sh [changed mode: 0644->0755]
scripts/start.sh [changed mode: 0644->0755]
scripts/stop.sh

old mode 100644 (file)
new mode 100755 (executable)
index 912c647..6b34605
@@ -24,14 +24,14 @@ function print_loader()
     preload_lib=$(readlink -f $el)
     addr=$(readelf -sW $preload_lib | grep $preload_open_function | head -1 | awk '{print $2}')
 
-    echo -e "echo \"$preload_lib\" > /sys/kernel/debug/swap/preload/loader/loader_path" >> $filename
-    echo -e "echo 0x$addr > /sys/kernel/debug/swap/preload/loader/loader_offset" >> $filename
+    echo -e "/bin/echo \"$preload_lib\" > /sys/kernel/debug/swap/preload/loader/loader_path" >> $filename
+    echo -e "/bin/echo 0x$addr > /sys/kernel/debug/swap/preload/loader/loader_offset" >> $filename
 }
 
 function print_probe_lib()
 {
     filename=$1
-    echo -e "echo \"$handlers_lib\" > /sys/kernel/debug/swap/preload/handlers_path" >> $filename
+    echo -e "/bin/echo \"$handlers_lib\" > /sys/kernel/debug/swap/preload/handlers_path" >> $filename
 }
 
 function print_linker()
@@ -47,8 +47,8 @@ function print_linker()
     linker=$(readlink -f $el)
     r_debug_offset=$(readelf -sW $linker | grep $linker_sym | awk '{print $2}' | uniq)
 
-    echo -e "echo \"$linker\" > /sys/kernel/debug/swap/preload/linker/linker_path" >> $filename
-    echo -e "echo 0x$r_debug_offset > /sys/kernel/debug/swap/preload/linker/r_debug_offset" >> $filename
+    echo -e "/bin/echo \"$linker\" > /sys/kernel/debug/swap/preload/linker/linker_path" >> $filename
+    echo -e "/bin/echo 0x$r_debug_offset > /sys/kernel/debug/swap/preload/linker/r_debug_offset" >> $filename
 }
 
 ##################################
old mode 100644 (file)
new mode 100755 (executable)
index 6665964..15b0f10
@@ -8,7 +8,7 @@ ERR_CONTAINER_NOT_SUPPORTED_ST="SWAP is not supported devices with container fea
 ERR_NO_ST="No errors"
 
 if [ "$1" != "" ];then
-    echo "Error code <$1>. TODO decode it."
+    /bin/echo "Error code <$1>. TODO decode it."
     exit $1
 fi
 
@@ -18,7 +18,7 @@ config_file="/etc/config/model-config.xml"
 if [ -e $config_file ]; then
        grep -i "feature/container[^>]*>[[:blank:]]*false" "$config_file" > /dev/null
        if [ $? -ne 0 ]; then
-               echo $ERR_CONTAINER_NOT_SUPPORTED_ST
+               /bin/echo $ERR_CONTAINER_NOT_SUPPORTED_ST
                exit $ERR_CONTAINER_NOT_SUPPORTED
        fi
 fi
@@ -48,7 +48,7 @@ if [ ! -e /sys/kernel/debug/swap/enable ]; then
 fi
 
 # swap enebling
-echo 1 > /sys/kernel/debug/swap/enable
+/bin/echo 1 > /sys/kernel/debug/swap/enable
 
 # Energy coefficients
 # CPU coefficients are divided by 10^6 because
@@ -63,35 +63,35 @@ echo 1 > /sys/kernel/debug/swap/enable
 #  - result should be exposed in uAs
 
 # cpu idle: 62.27 / 1
-echo 62270 > /sys/kernel/debug/swap/energy/cpu_idle/numerator &&
-echo 1000000000 > /sys/kernel/debug/swap/energy/cpu_idle/denominator &&
+/bin/echo 62270 > /sys/kernel/debug/swap/energy/cpu_idle/numerator &&
+/bin/echo 1000000000 > /sys/kernel/debug/swap/energy/cpu_idle/denominator &&
 
 # cpu0 running: 213.21 / 1
-echo 213210 > /sys/kernel/debug/swap/energy/cpu_running/numerator &&
-echo 1000000000 > /sys/kernel/debug/swap/energy/cpu_running/denominator &&
+/bin/echo 213210 > /sys/kernel/debug/swap/energy/cpu_running/numerator &&
+/bin/echo 1000000000 > /sys/kernel/debug/swap/energy/cpu_running/denominator &&
 
 # cpuN running: 97.29 / 1
-echo 97290 > /sys/kernel/debug/swap/energy/cpuN_running/numerator &&
-echo 1000000000 > /sys/kernel/debug/swap/energy/cpuN_running/denominator &&
+/bin/echo 97290 > /sys/kernel/debug/swap/energy/cpuN_running/numerator &&
+/bin/echo 1000000000 > /sys/kernel/debug/swap/energy/cpuN_running/denominator &&
 
 # flash read:  74.32 / 33154239
-echo 74320 > /sys/kernel/debug/swap/energy/flash_read/numerator &&
-echo 33154239 > /sys/kernel/debug/swap/energy/flash_read/denominator &&
+/bin/echo 74320 > /sys/kernel/debug/swap/energy/flash_read/numerator &&
+/bin/echo 33154239 > /sys/kernel/debug/swap/energy/flash_read/denominator &&
 
 # flash write: 141.54 / 27920983
-echo 141540 > /sys/kernel/debug/swap/energy/flash_write/numerator &&
-echo 27920983 > /sys/kernel/debug/swap/energy/flash_write/denominator &&
+/bin/echo 141540 > /sys/kernel/debug/swap/energy/flash_write/numerator &&
+/bin/echo 27920983 > /sys/kernel/debug/swap/energy/flash_write/denominator &&
 
 # LCD:
 if [ -d /sys/kernel/debug/swap/energy/lcd/ ]
 then
        # lcd max (white max - black max) / 2: 255 / 1
-       echo 255 > `ls /sys/kernel/debug/swap/energy/lcd/*/max_num` &&
-       echo 1000000 > `ls /sys/kernel/debug/swap/energy/lcd/*/max_denom` &&
+       /bin/echo 255 > `ls /sys/kernel/debug/swap/energy/lcd/*/max_num` &&
+       /bin/echo 1000000 > `ls /sys/kernel/debug/swap/energy/lcd/*/max_denom` &&
 
        # lcd min (white min - black min) / 2: 179 / 1
-       echo 179 > `ls /sys/kernel/debug/swap/energy/lcd/*/min_num` &&
-       echo 1000000 > `ls /sys/kernel/debug/swap/energy/lcd/*/min_denom`
+       /bin/echo 179 > `ls /sys/kernel/debug/swap/energy/lcd/*/min_num` &&
+       /bin/echo 1000000 > `ls /sys/kernel/debug/swap/energy/lcd/*/min_denom`
 fi
 
 #Preload
index 8a62ef6..9292d68 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 # swap disabling
-echo 0 > /sys/kernel/debug/swap/enable
+/bin/echo 0 > /sys/kernel/debug/swap/enable
 
 rmmod swap_nsp
 rmmod swap_wsp