Index: scripts/xeno-config.in =================================================================== --- scripts/xeno-config.in (Revision 1135) +++ scripts/xeno-config.in (Arbeitskopie) @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh staging=${DESTDIR} prefix="@prefix@" Index: scripts/xeno-info =================================================================== --- scripts/xeno-info (Revision 1135) +++ scripts/xeno-info (Arbeitskopie) @@ -1,31 +1,51 @@ -#!/bin/sh +#! /bin/sh # # This file has been lifted 'as is' from linux/scripts/ver_linux. -# +# Adapted to be run also under the BusyBox. If you want to test it under the BusyBox use +# busybox sh xeno-info PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:$PATH echo 'If some fields are empty or look unusual you may have an old version.' echo 'Compare to the current minimal requirements in Documentation/Changes.' echo ' ' +withBusybox=0 +if test -L $SHELL ; then # is sh a logical link to busybox + exeName=`ls -l $SHELL|cut -d\> -f2` + if test "`basename $exeName`" = "busybox"; then + withBusybox=1; else echo 2.3 + fi +elif test -n "$_" -a "`basename $_`" = "busybox"; then + withBusybox=1; +# else running a real /bin/sh (bash) shell +fi + +if test $withBusybox -eq 1; then busybox | grep -i "BusyBox v" ; fi + uname -a echo ' ' +if test -n "`which gcc`" ; then gcc --version 2>&1| head -n 1 | grep -v gcc | awk \ 'NR==1{print "Gnu C ", $1}' gcc --version 2>&1| grep gcc | awk \ 'NR==1{print "Gnu C ", $3}' +fi +if test -n "`which gcc`" ; then make --version 2>&1 | awk -F, '{print $1}' | awk \ '/GNU Make/{print "Gnu make ",$NF}' +fi ld -v 2>&1 | awk -F\) '{print $1}' | awk \ '/BFD/{print "binutils ",$NF}' +if test 0 -eq $withBusybox ; then fdformat --version | awk -F\- '{print "util-linux ", $NF}' mount --version | awk -F\- '{print "mount ", $NF}' +fi depmod -V 2>&1 | awk 'NR==1 {print "module-init-tools ",$NF}' @@ -50,21 +70,26 @@ isdnctrl 2>&1 | grep version | awk \ 'NR==1{print "isdn4k-utils ", $NF}' +if test -n "`which ldd`" ; then ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | sed \ -e 's/\.so$//' | awk -F'[.-]' '{print "Linux C Library " \ $(NF-2)"."$(NF-1)"."$NF}' ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n1 | awk \ 'NR==1{print "Dynamic linker (ldd) ", $NF}' +fi ls -l /usr/lib/lib{g,stdc}++.so 2>/dev/null | awk -F. \ '{print "Linux C++ Library " $4"."$5"."$6}' +if test 0 -eq $withBusybox ; then ps --version 2>&1 | awk 'NR==1{print "Procps ", $NF}' +fi ifconfig --version 2>&1 | grep tools | awk \ 'NR==1{print "Net-tools ", $NF}' +if test 0 -eq $withBusybox ; then # Kbd needs 'loadkeys -h', loadkeys -h 2>&1 | awk \ '(NR==1 && ($3 !~ /option/)) {print "Kbd ", $3}' @@ -74,6 +99,7 @@ '(NR==1 && ($2 ~ /console-tools/)) {print "Console-tools ", $3}' expr --v 2>&1 | awk 'NR==1{print "Sh-utils ", $NF}' +fi if [ -e /proc/modules ]; then X=`cat /proc/modules | sed -e "s/ .*$//"` Index: scripts/xeno-load.in =================================================================== --- scripts/xeno-load.in (Revision 1135) +++ scripts/xeno-load.in (Arbeitskopie) @@ -1,7 +1,9 @@ -#! /bin/bash +#! /bin/sh # Xenomai application loader script. # (Processes the .runinfo files) # June 2004, +# Adapted to be run also under the BusyBox. If you want to test it under the BusyBox use +# busybox sh xeno-info usage='usage: xeno-load [[dir:]target]' prefix="@prefix@" @@ -23,7 +25,7 @@ shift fi -if test "x$1" = x--; then +if test -z "$1" || test "x$1" = x--; then target_dir=`pwd` target_name=default else @@ -80,7 +82,7 @@ eval $user_moddir -if `$sudo $modprobe -nq xeno_nucleus >& /dev/null`; then +if `$sudo $modprobe -nq xeno_nucleus > /dev/null 2>&1`; then target_deps="${target_deps}nucleus+" else target_deps= @@ -92,8 +94,8 @@ test $verbose = 1 && echo "Running $target_name from $run_info_file" -if test \! "x`type -t sudo`" = x; then - sudo=sudo +if test -n "`which sudo`"; then + sudo=`which sudo` fi if test \! "x$target_mesg" = x; then @@ -161,7 +163,7 @@ echo "ERROR: cannot load $xeno_moddir/xeno_$mod$modext" break fi - elif `$sudo $modprobe -n xeno_$mod >& /dev/null`; then + elif `$sudo $modprobe -n xeno_$mod > /dev/null 2>&1`; then test $verbose = 1 && echo "+ $modprobe xeno_$mod" $sudo $modprobe xeno_$mod inslist="xeno_$mod $inslist" Index: scripts/xeno-test.in =================================================================== --- scripts/xeno-test.in (Revision 1135) +++ scripts/xeno-test.in (Arbeitskopie) @@ -1,4 +1,6 @@ -#!/bin/bash +#! /bin/sh +# Adapted to be run also under the BusyBox. If you want to test it under the BusyBox use +# busybox sh xeno-test myusage() { cat >&1 < sends output to given addr - -m sends output to xenotest.output@domain.hid + -m sends output to xenomai-data@domain.hid -U uploads output to given URL # following options are passed thru to latency @@ -40,6 +42,18 @@ set -o notify # see dd's finish immediately.(or not!) +withBusybox=0 +if test -L $SHELL ; then # is sh a logical link to busybox + exeName=`ls -l $SHELL|cut -d\> -f2` + if test "`basename $exeName`" = "busybox"; then + withBusybox=1; else echo 2.3 + fi +elif test -n "$_" -a "`basename $_`" = "busybox"; then + withBusybox=1; +# else running a real /bin/sh (bash) shell +fi +echo withBusybox ist $withBusybox + loudly() { [ "$1" = "" ] && return # run task after announcing it @@ -51,31 +65,39 @@ # defaults for cpu workload device=/dev/zero -typeset -a dd_jobs -dd_jobs=() +dd_jobs= # used in generate-loads mkload() { exec dd if=$device of=/dev/null $* ; } generate_loads() { local jobsct=$1; shift; + if test 0 -eq $withBusybox ; then + reaper() { echo something died a $! or $* ; sleep 1; } + trap reaper CHLD + else + echo "dummy reaper for $!" + reaper() { echo xx >/dev/null ; } + fi + trap cleanup_load EXIT # under all exit conditions - reaper() { echo something died $*; } - trap reaper CHLD - trap cleanup_load EXIT # under all exit conditions - - for (( ; $jobsct ; jobsct-- )) ; do - mkload & - dd_jobs[${#dd_jobs[*]}]=$! + for _j in $jobsct ; do + mkload & + dd_jobs="$dd_jobs $!" + break done; - echo dd workload started, pids ${dd_jobs[*]} + echo dd workload started, pids $dd_jobs } cleanup_load() { # kill the workload - echo killing workload pids ${dd_jobs[*]} - kill ${dd_jobs[*]}; + echo killing workload pids ${dd_jobs} + for _j in ${dd_jobs} + do + kill $_j + done + killall dd unset dd_jobs; } @@ -83,10 +105,9 @@ boxinfo() { # static info, show once + loudly `dirname $0`/xeno-config --verbose + loudly `dirname $0`/xeno-info - loudly ./xeno-config --verbose - loudly ./xeno-info - loudly cat /proc/cpuinfo # bogomips changes under CPU_FREQ # how much of the config do we want ? @@ -114,7 +135,11 @@ for f in /proc/xenomai/*/*; do [ -f $f ] && loudly cat $f; done fi [ -n "$prepost" ] && loudly $prepost - loudly top -bn1c | head -n $(( 12 + $workload )) + if test 0 -eq $withBusybox ; then + loudly top -bn1c | head -n $(( 12 + $workload )) + else + loudly top | head -n $(( 12 + $workload )) + fi } @@ -126,15 +151,15 @@ loudly generate_loads $workload boxstatus ( - cd ../testsuite/latency + cd `dirname $0`/../testsuite/latency loudly ./run -- $opts -t0 loudly ./run -- $opts -t1 loudly ./run -- $opts -t2 ) - ( cd ../testsuite/switch + ( cd `dirname $0`/../testsuite/switch loudly ./run -- '# switch' ) - ( cd ../testsuite/cyclic + ( cd `dirname $0`/../testsuite/cyclic loudly ./run -- -p 10 -n -l 1000 '# cyclictest' ) @@ -167,7 +192,7 @@ logprefix=/tmp/ # someplace usually there prepost= # command to run pre, and post test (ex ntpq -p) -email='xenotest.output@domain.hid' # until formalized +email='xenomai-data@domain.hid' sentby='xenotest.sender@domain.hid' url= sendit= # send it by m-mail, u-url @@ -175,15 +200,15 @@ sendit() { local file=$1 - - if [ "$sendit" == 'm' ]; then + + if test "$sendit" = 'm' ; then echo "mailing $file to $email" - if [ "$file" != '' ]; then + if test -n "$file" ; then mail -s 'xeno-test results' $email -- -F $sentby < $file else cat - | mail -s 'xeno-test results' $email -- -F $sentby fi - elif [ "$sendit" == 'u' ]; then + elif test "$sendit" = 'u' ; then which curl && curl -T $file $url # -x $proxy >/tmp/.submit_result # which wget && curl -T $file $url \ @@ -263,6 +288,8 @@ fi fi +cleanup_load + exit;