2009-06-20 11:17:11     msh don't support call functions

Document created by Aaronwu Employee on Aug 15, 2013
Version 1Show Document
  • View in full screen mode

2009-06-20 11:17:11     msh don't support call functions

 

montassar haj (TUNISIA)

 

Message: 76082  

 

Hi all .

 

  I'm using Blackfin stamp 537,and uClinux-dist-2008R1.5-RC3 .i need to add  some scripts but the problem is that i must use fuctions call .i  tryed  the patch under uclinux-dist/bf-patch/msh-patch  put unfortunatlly the problem don't resolved .it accept the deffines  functions but i can't call them from any place.

 

IS there any patch or a new shell version which can resolve my problem.

 

thinks ..

 

QuoteReplyEditDelete

 

2009-06-20 11:32:42     Re: msh don't support call functions

 

Mike Frysinger (UNITED STATES)

 

Message: 76083  

 

msh isnt supported anymore.  you can try the latest busybox and use hush.

 

QuoteReplyEditDelete

 

2009-06-22 10:08:24     Re: msh don't support call functions

 

montassar haj (TUNISIA)

 

Message: 76130  

 

thinks Mike

 

i hadd th hush shell in the compilation but when i try to execute my script which contains some functions i got those errors belown . could any one help me please to fix this and get shell which can accept functions and call functions.  thinks so much.

 

Data access misaligned address violation

 

- Attempted misaligned data memory or data cache access.

 

Defered Exception context

 

CURRENT PROCESS:

 

COMM=hush PID=155

 

TEXT = 0x03000040-0x03055120        DATA = 0x03055124-0x0306c064

 

BSS = 0x0306c064-0x03074284  USER-STACK = 0x0307bf74

 

return address: [0x03012938]; contents of:

 

0x03012910:  1fe3  0803  51fa  181d  0000  0000  ac51  0c41

 

0x03012920:  1809  0000  0000  9109  3071  520e  6460  0803

 

0x03012930:  1820  3222  0c40  5a94 [bc51] bc90  1818  bc42

 

0x03012940:  0c41  1802  bc8a  324a  9317  2fd3  6800  2fc4

 

SEQUENCER STATUS:               Not tainted

 

SEQSTAT: 00060024  IPEND: 0030  SYSCFG: 0006

 

  HWERRCAUSE: 0x18

 

  EXCAUSE   : 0x24

 

RETE: <0x00000000> /* Maybe null pointer? */

 

RETN: <0x034f2000> [ hush + 0x0 ]

 

RETX: <0x03012938> [ hush + 0x128f8 ]

 

RETS: <0x0301259c> [ hush + 0x1255c ]

 

PC  : <0x03012938> [ hush + 0x128f8 ]

 

DCPLB_FAULT_ADDR: <0x03b7a694> /* unknown address */

 

ICPLB_FAULT_ADDR: <0x03012938> [ hush + 0x128f8 ]

 

PROCESSOR STATE:

 

R0 : 034f339c    R1 : 00000c64    R2 : 0068732f    R3 : 036f2a33

 

R4 : 0306b678    R5 : 00000000    R6 : 034f3ff4    R7 : 0068733b

 

P0 : 00000000    P1 : 034f3ff4    P2 : 03b7a68f    P3 : 0306b674

 

P4 : 0068732f    P5 : 0306b674    FP : 0307bd60    SP : 034f1f24

 

LB0: 0300c4ed    LT0: 0300c4ea    LC0: 00000000

 

LB1: 03043c8f    LT1: 03043c8e    LC1: 00000000

 

B0 : 00000000    L0 : 00000000    M0 : 00000000    I0 : 034f31e8

 

B1 : 00000000    L1 : 00000000    M1 : 00000000    I1 : 03070844

 

B2 : 00000000    L2 : 00000000    M2 : 00000000    I2 : 00000000

 

B3 : 00000000    L3 : 00000000    M3 : 00000000    I3 : 00000000

 

A0.w: 00000000   A0.x: 00000000   A1.w: 00000000   A1.x: 00000000

 

USP : 0307bd60  ASTAT: 02001024

 

Hardware Trace:

 

   0 Target : <0x000048c0> { _trap_c + 0x0 }

 

     Source : <0xffa0077c> { _exception_to_level5 + 0xb4 }

 

   1 Target : <0xffa006c8> { _exception_to_level5 + 0x0 }

 

     Source : <0xffa00624> { _ex_trap_c + 0x5c }

 

   2 Target : <0xffa005c8> { _ex_trap_c + 0x0 }

 

     Source : <0xffa0081c> { _trap + 0x28 }

 

   3 Target : <0xffa007f4> { _trap + 0x0 }

 

     Source : <0x03012936> [ hush + 0x128f6 ]

 

   4 Target : <0x030128fe> [ hush + 0x128be ]

 

     Source : <0x030128c4> [ hush + 0x12884 ]

 

   5 Target : <0x030128be> [ hush + 0x1287e ]

 

     Source : <0x030128ba> [ hush + 0x1287a ]

 

   6 Target : <0x030128a8> [ hush + 0x12868 ]

 

     Source : <0x03012598> [ hush + 0x12558 ]

 

   7 Target : <0x03012592> [ hush + 0x12552 ]

 

     Source : <0x03014bcc> [ hush + 0x14b8c ]

 

   8 Target : <0x03014bc0> [ hush + 0x14b80 ]

 

     Source : <0x0301258e> [ hush + 0x1254e ]

 

   9 Target : <0x0301256c> [ hush + 0x1252c ]

 

     Source : <0x030034d4> [ hush + 0x3494 ]

 

  10 Target : <0x030034b4> [ hush + 0x3474 ]

 

     Source : <0x03042e8c> [ hush + 0x42e4c ]

 

  11 Target : <0x03042e80> [ hush + 0x42e40 ]

 

     Source : <0x03042e86> [ hush + 0x42e46 ]

 

  12 Target : <0x03042e82> [ hush + 0x42e42 ]

 

     Source : <0x03042e7c> [ hush + 0x42e3c ]

 

  13 Target : <0x03042e5e> [ hush + 0x42e1e ]

 

     Source : <0x03042e4c> [ hush + 0x42e0c ]

 

  14 Target : <0x03042e40> [ hush + 0x42e00 ]

 

     Source : <0x03042f1c> [ hush + 0x42edc ]

 

  15 Target : <0x03042f08> [ hush + 0x42ec8 ]

 

     Source : <0x03043cd8> [ hush + 0x43c98 ]

 

Stack from 034f1f04:

 

        00000000 ffa00780 00178570 00178570 00178568 00000000 00000000 03002a46

 

        03012938 00000030 00060024 00000000 034f2000 03012938 03012938 0301259c

 

        034f339c 02001024 03043c8f 0300c4ed 03043c8e 0300c4ea 00000000 00000000

 

        00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

 

        00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

 

        00000000 00000000 03070844 034f31e8 0307bd60 0307bd60 0306b674 0068732f

 

Call Trace:

 

Bus error

 

QuoteReplyEditDelete

 

2009-06-22 10:12:35     Re: msh don't support call functions

 

Mike Frysinger (UNITED STATES)

 

Message: 76131  

 

post the actual script that you're using.  we cant fix issues that we cant reproduce.

 

also, you've already been told what shell to use.  hush is the only one supported.  if you want to use any other shell, you're on your own.

 

QuoteReplyEditDelete

 

2009-06-22 10:44:47     Re: msh don't support call functions

 

montassar haj (TUNISIA)

 

Message: 76134  

 

thinks Mike.

 

i-m trying to add some script from the project openWrt    openwrt.org/

 

my problem is not that  i want to use other shell then hush, but my problem is that i need to use  functions on my stamp.thinks so match

 

the script that i've tryed is:

 

#!/bin/hush

 

# Copyright (C) 2006 OpenWrt.org

 

# Copyright (C) 2006 Fokus Fraunhofer <carsten.tittel@fokus.fraunhofer.de>

 

#alias debug=${DEBUG:-:}

 

# newline

 

N="

 

"

 

_C=0

 

NO_EXPORT=1

 

hotplug_dev() {

 

        env -i ACTION=$1 INTERFACE=$2 /sbin/hotplug-call net

 

}

 

append() {

 

        local var="$1"

 

        local value="$2"

 

        local sep="${3:- }"

 

        eval "export ${NO_EXPORT:+-n} -- \"$var=\${$var:+\${$var}\${value:+\$sep}}\$value\""

 

}

 

reset_cb() {

 

        config_cb() { return 0; }

 

        option_cb() { return 0; }

 

}

 

reset_cb

 

config () {

 

        local cfgtype="$1"

 

        local name="$2"

 

        export ${NO_EXPORT:+-n} CONFIG_NUM_SECTIONS=$(($CONFIG_NUM_SECTIONS + 1))

 

        name="${name:-cfg$CONFIG_NUM_SECTIONS}"

 

        append CONFIG_SECTIONS "$name"

 

        [ -n "$NO_CALLBACK" ] || config_cb "$cfgtype" "$name"

 

        export ${NO_EXPORT:+-n} CONFIG_SECTION="$name"

 

        export ${NO_EXPORT:+-n} "CONFIG_${CONFIG_SECTION}_TYPE=$cfgtype"

 

}

 

option () {

 

        local varname="$1"; shift

 

        local value="$*"

 

        export ${NO_EXPORT:+-n} "CONFIG_${CONFIG_SECTION}_${varname}=$value"

 

        [ -n "$NO_CALLBACK" ] || option_cb "$varname" "$*"

 

}

 

config_rename() {

 

        local OLD="$1"

 

        local NEW="$2"

 

        local oldvar

 

        local newvar

 

        [ "$OLD" -a "$NEW" ] || return

 

        for oldvar in `set | grep ^CONFIG_${OLD}_ | \

 

                sed -e 's/\(.*\)=.*$/\1/'` ; do

 

                newvar="CONFIG_${NEW}_${oldvar##CONFIG_${OLD}_}"

 

                eval "export ${NO_EXPORT:+-n} \"$newvar=\${$oldvar}\""

 

                unset "$oldvar"

 

        done

 

        export ${NO_EXPORT:+-n} CONFIG_SECTIONS="$(echo " $CONFIG_SECTIONS " | sed -e "s, $OLD , $NEW ,")"

 

        [ "$CONFIG_SECTION" = "$OLD" ] && export ${NO_EXPORT:+-n} CONFIG_SECTION="$NEW"

 

}

 

config_unset() {

 

        config_set "$1" "$2" ""

 

}

 

config_clear() {

 

        local SECTION="$1"

 

        local oldvar

 

        export ${NO_EXPORT:+-n} CONFIG_SECTIONS="$(echo " $CONFIG_SECTIONS " | sed -e "s, $OLD , ,")"

 

        export ${NO_EXPORT:+-n} CONFIG_SECTIONS="${SECTION:+$CONFIG_SECTIONS}"

 

        for oldvar in `set | grep ^CONFIG_${SECTION:+${SECTION}_} | \

 

                sed -e 's/\(.*\)=.*$/\1/'` ; do

 

                unset $oldvar

 

        done

 

}

 

config_load() {

 

        local file="$UCI_ROOT/etc/config/$1"

 

        _C=0

 

        export ${NO_EXPORT:+-n} CONFIG_SECTIONS=

 

        export ${NO_EXPORT:+-n} CONFIG_NUM_SECTIONS=0

 

        export ${NO_EXPORT:+-n} CONFIG_SECTION=

 

        [ -e "$file" ] && {

 

                . $file

 

        } || return 1

 

        ${CONFIG_SECTION:+config_cb}

 

}

 

config_get() {

 

        case "$3" in

 

                "") eval "echo \"\${CONFIG_${1}_${2}}\"";;

 

                *)  eval "export ${NO_EXPORT:+-n} -- \"$1=\${CONFIG_${2}_${3}}\"";;

 

        esac

 

}

 

# config_get_bool <variable> <section> <option> [<default>]

 

config_get_bool() {

 

        local _tmp

 

        config_get "_tmp" "$2" "$3"

 

        case "$_tmp" in

 

                1|on|enabled) export ${NO_EXPORT:+-n} "$1=1";;

 

                0|off|disabled) export ${NO_EXPORT:+-n} "$1=0";;

 

                *) eval "$1=${4:-0}";;

 

        esac

 

}

 

config_set() {

 

        local section="$1"

 

        local option="$2"

 

        local value="$3"

 

        local old_section="$CONFIG_SECTION"

 

        CONFIG_SECTION="$section"

 

        option "$option" "$value"

 

        CONFIG_SECTION="$old_section"

 

}

 

config_foreach() {

 

        local function="$1"

 

        local type="$2"

 

        local section cfgtype

 

        [ -z "$CONFIG_SECTIONS" ] && return 0

 

        for section in ${CONFIG_SECTIONS}; do

 

                config_get cfgtype "$section" TYPE

 

                [ -n "$type" -a "$cfgtype" != "$type" ] && continue

 

                eval "$function \"\$section\""

 

        done

 

}

 

load_modules() {

 

        cd /etc/modules.d

 

        sed 's/^[^#]/insmod &/' $* | ash 2>&- || :

 

}

 

include() {

 

        local file

 

        for file in $(ls $1/*.sh 2>/dev/null); do

 

                . $file

 

        done

 

}

 

find_mtd_part() {

 

        local PART="$(grep "\"$1\"" /proc/mtd | awk -F: '{print $1}')"

 

        local PREFIX=/dev/mtdblock

 

        PART="${PART##mtd}"

 

        [ -d /dev/mtdblock ] && PREFIX=/dev/mtdblock/

 

        echo "${PART:+$PREFIX$PART}"

 

}

 

strtok() { # <string> { <variable> [<separator>] ... }

 

        local tmp

 

        local val="$1"

 

        local count=0

 

        shift

 

        while [ $# -gt 1 ]; do

 

                tmp="${val%%$2*}"

 

                [ "$tmp" = "$val" ] && break

 

                val="${val#$tmp$2}"

 

                export ${NO_EXPORT:+-n} "$1=$tmp"; count=$((count+1))

 

                shift 2

 

        done

 

        if [ $# -gt 0 -a "$val" ]; then

 

                export ${NO_EXPORT:+-n} "$1=$val"; count=$((count+1))

 

        fi

 

        return $count

 

}

 

jffs2_mark_erase() {

 

        local part="$(find_mtd_part "$1")"

 

        [ -z "$part" ] && {

 

                echo Partition not found.

 

                return 1

 

        }

 

        echo -e "\xde\xad\xc0\xde" | mtd -qq write - "$1"

 

}

 

QuoteReplyEditDelete

 

2009-06-22 11:33:43     Re: msh don't support call functions

 

Mike Frysinger (UNITED STATES)

 

Message: 76135  

 

the script works just fine for me with busybox-1.14.2

 

QuoteReplyEditDelete

 

2009-06-23 10:36:16     Re: msh don't support call functions

 

montassar haj (TUNISIA)

 

Message: 76192  

 

the script works just fine for me with busybox-1.14.2

 

---

 

Thinks too much Mike.

 

I get the bysybox-1.14.2 from the

 

https://blackfin.uclinux.org/gf/project/uclinux-dist/scmsvn/?action=browse&path=%2Ftrunk%2Fuser%2Fbusybox%2F

 

but unfortunately ,when i try to compile again i got those errors:

 

make[3]: Entering directory `/home/monta/opt/uClinux-dist-2008R1.5-RC3/config/scripts'

 

make[3]: `tkparse' is up to date.

 

make[3]: Leaving directory `/home/monta/opt/uClinux-dist-2008R1.5-RC3/config/scripts'

 

ARCH=m68knommu /home/monta/opt/uClinux-dist-2008R1.5-RC3/config/scripts/tkparse < config.in > config.tmp

 

-: 1651: unable to open ../user/busybox/uclinux-configs/Config.in

 

make[2]: *** [config.tk] Error 1

 

make[2]: Leaving directory `/home/monta/opt/uClinux-dist-2008R1.5-RC3/config'

 

make[1]: *** [config_xconfig] Error 2

 

make[1]: Leaving directory `/home/monta/opt/uClinux-dist-2008R1.5-RC3'

 

make: *** [xconfig] Error 2

 

so what should i do to fix up this .

 

thinks

 

QuoteReplyEditDelete

 

2009-06-23 11:22:20     Re: msh don't support call functions

 

Mike Frysinger (UNITED STATES)

 

Message: 76193  

 

backporting to 2008R1.5 directly isnt really supported -- it did not use the kconfig system that trunk uses.  if you want to use busybox-1.14.2 with 2008R1.5, you'll have to build it by hand.

 

QuoteReplyEditDelete

 

2009-06-23 13:58:36     Re: msh don't support call functions

 

montassar haj (TUNISIA)

 

Message: 76204  

 

backporting to 2008R1.5 directly isnt really supported -- it did not use the kconfig system that trunk uses.  if you want to use busybox-1.14.2 with 2008R1.5, you'll have to build it by hand.

 

---

 

Thanks Mike for your help. I tried to compile it for Blackfin using the following commands:

 

make xconfig

 

CROSS_COMPILE=bfin-uclinux- make

 

But I get te following error message:

 

CC      applets/applets.o

 

In file included from include/busybox.h:10,

 

                 from applets/applets.c:11:

 

include/libbb.h:75:21: error: shadow.h: No such file or directory

 

Any idea on what the problem could be or is it wrong the way I'm trying to compile?

 

Thanks.

 

QuoteReplyEditDelete

 

2009-06-23 14:21:15     Re: msh don't support call functions

 

Mike Frysinger (UNITED STATES)

 

Message: 76205  

 

you didnt properly configure busybox.  run menuconfig first to disable options you dont need.  it'd probably be best if you simply disabled everything in there but hush and used the binary only for hush.

Attachments

    Outcomes