Porting xeno-{info|load|test} to a busybox system
Hi
For my embedded target system I installed BusyBox as it was the easiest way to get a small GNU/Linux system to boot into a working shell. (But it takes less than 16 seconds from power on till the the familiar "login: " prompt.)
But I ran into the problem, that the xeno-*-applications did not run under the busybox environment. Here are some comment on my proposed changes.
1) To make a shell work under the busybox I had to specify #! /bin/sh instead of #! /bin/bash.
2) To make the run I run the xeno-*-applications on my Debian GNU/Linux PowerBook
either as:
$ xeno-info or as $ busybox sh xeno-info
3) Once all tests passed on my PowerBook, I switched to the embedded PPC405GPr board using a recent busybox (version 1.1.3).
This exposed some more not supported errors, eg.
fdformat: unrecognized option `--version'
Also on an embedded system a lot of the usual utilites like gcc, make, etc are not present. Therefore I checked for their existence with expressions like which make
4) As the BSD utility script is not present on my embedded system, xeno-test -L does not work.
5) The busybox shell does not know arrays. Also for unknown reasons the dd_jobs variable got not updated outside of the function generate_loads. Therefore I added a "killall dd" in the cleanup.
6) "trap CHLD" did not work under the BusyBox. Also (to be sure) called cleanup_load manually before exit.
7) Id did not ident the not busybox parts in xeno-info. This makes the patch smaller and more readable, but should probably be corrected before applying it.
8) Using dirname $0 relative paths to make xeno-test work also if not called in /usr/xenomai/bin
9) Changing the e-mail address to [email protected] is also included.
Checking the changes between running xeno-test (as bash or as busybox) and the old one did not reveal any significant changes. On my PPC405 system I could not complete this test as there segmentation faults running the invidual tests.
I would appreciate if these changes (or similar) could go -- after a review -- into the trunk (not necessarily before 2.2). I am specially interested in Jim Cromie's opinion.
If anybody has a working target with a Xenomai + BusyBox combination and would be willing to test drive my changes, I would appreciate a feedback enormously.
These changes are a precondition to make the buildbot run xeno-test on the only board where I can easily and automatically switch the power off and on, without risking a family crisis.
Best regards
Signature · 1 line
Niklaus Giger
xeno-config.in +1 -1
@@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh staging=${DESTDIR} prefix="@prefix@"
xeno-info +28 -2
@@ -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/ .*$//"`
xeno-load.in +8 -6
@@ -1,7 +1,9 @@ -#! /bin/bash +#! /bin/sh # Xenomai application loader script. # (Processes the .runinfo files) # June 2004, <[email protected]> +# 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"
xeno-test.in +53 -26
161 lines not on this page · raw message
Quoted 4 lines · Niklaus Giger
...
If anybody has a working target with a Xenomai + BusyBox combination and would be willing to test drive my changes, I would appreciate a feedback enormously.
Did so, and here comes the result: :)
Quoted 18 lines
Index:
scripts/xeno-info
===================================================================xeno-info +3
-2@@ -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 ' '
xeno-info line 21
Quoted 10 lines
xeno-info +10
-0+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
This may become fragile (and it already is on my hacked system). The
reason: plans exist to allow compiling bb into multiple binaries again, thus sh will not be linked to busybox, but to ash e.g.
What about this:
withBusybox=0
if sh --help 2>&1| grep -q BusyBox; then
withBusybox=1; # else running a real /bin/sh (bash) shell fi echo withBusybox is $withBusybox
When using this variant, I get the following messages:
Quoted 1 line
/bin/xeno-test:/bin/xeno-test: 177: zgrep: not found
What about zcat | grep instead? Moreover, I failed to find a zgrep bb applet. Did you copy that stuff on your box?
Quoted 1 line
/bin/xeno-test:/bin/xeno-test: 264: getopts: not found
getopts is off by default in bb. Is this essential for xeno-test? Then you should state this requirement somewhere.
Quoted 1 line
/bin/xeno-test: shift: 267: Illegal number: -1
I guess this comes from the missing getopts...
Regarding workload: I typically run the cache calibrator [1] in a look, together with some I/O load (hard disk where available, flood ping). The loop looks like
while true; do calibrator <box-MHz> 8M /tmp/; done
<box-MHz> should be derivable from /proc/cpuinfo with some scripting. We may just check if an inclusion of the calibrator source code is possible (license terms...).
Lacking time right now, otherwise I would have hacked further to make the test run. This test could be quite interesting for us here to quickly check our processing boxes' hardware and to test new Xenomai versions for elementary regressions when upgrading production systems (fortunately only their CF-cards). Looking forward!
Jan
Am Freitag, 26. Mai 2006 15:52 schrieb Jan Kiszka:
Quoted 7 lines
Quoted 4 lines · Niklaus Giger
...
If anybody has a working target with a Xenomai + BusyBox combination and would be willing to test drive my changes, I would appreciate a feedback enormously.Did so, and here comes the result: :)
Thanks a lot for your prompt feedback.
<..>
Quoted 3 lines
This may become fragile (and it already is on my hacked system). The
reason: plans exist to allow compiling bb into multiple binaries again, thus sh will not be linked to busybox, but to ash e.g.
Sure. It was just my first idea. But your proposed solution is better and already
<..>
Quoted 4 lines
When using this variant, I get the following messages:
Quoted 1 line
/bin/xeno-test:/bin/xeno-test: 177: zgrep: not foundWhat about zcat | grep instead? Moreover, I failed to find a zgrep bb applet. Did you copy that stuff on your box?
Sorry. As I had segmentation faults, my run did not get so far/or I missed this error. Running it manually I confirmed your bug and the proposed solution works for me, too. Integrated in the new version (attached) of the patch.
Quoted 4 lines
Quoted 1 line
/bin/xeno-test:/bin/xeno-test: 264: getopts: not foundgetopts is off by default in bb. Is this essential for xeno-test? Then you should state this requirement somewhere.
I checked out BusyBox 1.13, run "make defconfig", changed the cross-compiler and install path. But I verified that a "make defconfig" on the 1.00 version had "# CONFIG_ASH_GETOPTS is not set".
Could you try the attached patch using busybox with "CONFIG_ASH_GETOPTS=y"?
Quoted 5 lines
Quoted 1 line
/bin/xeno-test: shift: 267: Illegal number: -1I guess this comes from the missing getopts...
Quoted 8 lines
Regarding workload: I typically run the cache calibrator [1] in a look, together with some I/O load (hard disk where available, flood ping). The loop looks like
while true; do calibrator <box-MHz> 8M
/tmp/; done
<box-MHz> should be derivable from/proc/cpuinfowith some scripting. We may just check if an inclusion of the calibrator source code is possible (license terms...).
Didn't know this tool. But I think this is another suggestion to improve xeno-test.
Quoted 6 lines
Lacking time right now, otherwise I would have hacked further to make the test run. This test could be quite interesting for us here to quickly check our processing boxes' hardware and to test new Xenomai versions for elementary regressions when upgrading production systems (fortunately only their CF-cards). Looking forward!
Nice to hear that. So could you please give my patch a second try with a modified busybox?
Signature · 1 line
Niklaus Giger
xeno-config.in +1 -1
@@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh staging=${DESTDIR} prefix="@prefix@"
xeno-info +23 -2
@@ -1,31 +1,46 @@ -#!/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 sh --help 2>&1| grep -q 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 +65,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 +94,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/ .*$//"`
xeno-load.in +8 -6
@@ -1,7 +1,9 @@ -#! /bin/bash +#! /bin/sh # Xenomai application loader script. # (Processes the .runinfo files) # June 2004, <[email protected]> +# 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"
xeno-test.in +50 -28
169 lines not on this page · raw message
Quoted 8 lines · Niklaus Giger
Quoted 4 lines
When using this variant, I get the following messages:
Quoted 1 line
/bin/xeno-test:/bin/xeno-test: 177: zgrep: not foundWhat about zcat | grep instead? Moreover, I failed to find a zgrep bb applet. Did you copy that stuff on your box?
Sorry. As I had segmentation faults, my run did not get so far/or I missed this error. Running it manually I confirmed your bug and the proposed solution works for me, too. Integrated in the new version (attached) of the patch.
Still broken:
Quoted 4 lines
boxinfo(){ # static info, show once
loudlydirname $0/xeno-config --verbose
loudlydirname $0/xeno-info
Quoted 8 lines
loudly cat
/proc/cpuinfo# bogomips changes underCPU_FREQ# how much of the config do we want ?
local cmd="zcat | grep -E '$whatconf'"
[ "$verbose" = 1 ] && cmd=catif [ -f
/proc/config.gz]; then # get the config
loudly $cmd/proc/config.gz
Resolves to "zcat | grep -E '...' /proc/config.gz" or to "cat /proc/config.gz". Both doesn't work. I would suggest this:
local filter="| grep -E '$whatconf'"
[ "$verbose" = 1 ] && filter=
if [ -f /proc/config.gz ]; then # get the config
loudly zcat /proc/config.gz $filter
Quoted 2 lines
elif [ -f
/lib/modules/uname -r/build/.config ]; then
loudly $cmd/lib/modules/uname -r/build/.config
And here we need
loudly cat /lib/modules/uname -r/build/.config $filter
Quoted 2 lines
fi
There is another occurrence of "zcat | grep" which needs fixing.
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
/bin/xeno-test:/bin/xeno-test: 264: getopts: not foundgetopts is off by default in bb. Is this essential for xeno-test? Then you should state this requirement somewhere.
I checked out BusyBox 1.13, run "make defconfig", changed the cross-compiler and install path. But I verified that a "make defconfig" on the 1.00 version had "#
CONFIG_ASH_GETOPTSis not set".Could you try the attached patch using busybox with "
CONFIG_ASH_GETOPTS=y"?
Did so, and also awk need to be switched on. What about testing for those features when bb was detected? Anyway, the latency tests work now (in my qemu box). But I do not find the workload (dd?) in the process list:
[email protected] :/root# ps
PID Uid VmSize Stat Command
1 root 664 S init
2 root SWN [ksoftirqd/0]
3 root SW [watchdog/0]
4 root SW< [events/0]
5 root SW< [khelper]
6 root SW< [kthread]
8 root SW< [kblockd/0]
41 root SW< [gatekeeper/0] 76 root SW [pdflush] 77 root SW [pdflush] 79 root SW< [aio/0] 78 root SW [kswapd0] 663 root SW< [kseriod] 700 root SW< [kpsmoused] 787 root 212 S dhcpcd eth0 -t 5 -h LIRE_home -I LIRE_home 844 root 1020 S /usr/sbin/sshd -f /etc/ssh/sshd_config 874 root 648 S /sbin/getty 38400 tty1 877 root 644 S /sbin/getty 38400 tty2 880 root 648 S /sbin/getty 38400 tty3 883 root 640 S /sbin/getty 38400 tty4 886 root 644 S /sbin/getty 38400 tty5 889 root 648 S /sbin/getty 38400 tty6 890 root 644 S /sbin/getty 38400 tty7 891 root 636 S /sbin/getty 38400 tty8 898 root 2004 S sshd: [email protected] 902 root 820 S -sh 905 root 708 S /bin/sh /bin/xeno-test 1182 root 436 S /bin/sh /bin/xeno-test 1296 root 2004 S sshd: [email protected] 1300 root 884 S -sh 1321 root 272 S /bin/sh /bin/xeno-test 1322 root 632 S /bin/sh ./run -- -q -s -T 120 -t1 1323 root 680 S /bin/sh //bin/xeno-load -- -q -s -T 120 -t1 1364 root 436 S /bin/sh //bin/xeno-load -- -q -s -T 120 -t1 1426 root 1732 S ./latency -q -s -T 120 -t1 1430 root 744 R ps
Instead I have this in the log:
[...]
Sat May 27 16:29:26 UTC 2006
running: cat /proc/ipipe/version
1.3-04
Sat May 27 16:29:26 UTC 2006
running: generate_loads 1
dummy reaper for 1039
dd workload started, pids 1048
killing workload pids 1048
killall: dd: no process killed
Sat May 27 16:29:27 UTC 2006
running: cat /proc/interrupts
[...]
Or do I have to invoke xeno-test with some parameter (I did not pass any)?
Jan
Am Samstag, 27. Mai 2006 18:42 schrieb Jan Kiszka:
Quoted 1 line
Niklaus Giger wrote:
<..>
Quoted 1 line
Still broken:
<..>
Sorry for not catching this part, but my kernel config did not set CONFIG_IKCONFIG. Fixed now.
Quoted 9 lines
Resolves to "zcat | grep -E '...'
/proc/config.gz" or to "cat/proc/config.gz". Both doesn't work. I would suggest this:local filter="| grep -E '$whatconf'"
[ "$verbose" = 1 ] && filter=if [ -f
/proc/config.gz]; then # get the config
loudly zcat/proc/config.gz$filter
Quoted 8 lines
Quoted 2 lines
elif [ -f
/lib/modules/uname -r/build/.config ]; then
loudly $cmd/lib/modules/uname -r/build/.configAnd here we need
loudly cat
/lib/modules/uname -r/build/.config $filterQuoted 1 line
fi
Should be fixed with the attached patch
Quoted 1 line
There is another occurrence of "zcat | grep" which needs fixing.
This one too.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
/bin/xeno-test:/bin/xeno-test: 264: getopts: not found
<..>
Quoted 3 lines
Did so, and also awk need to be switched on. What about testing for those features when bb was detected? Anyway, the latency tests work now (in my qemu box). But I do not find the workload (dd?) in the process list:
Added to procedure checkUtilities and checkHelpers (after having parsed the options). Added them unconditionally as there might be even *nix systems around which are lacking coreutilities like awk, cut, curl, mail, script.
Added a "ps | grep $_j" to show whether a dd job is still running before killing it. Now, at least running under the busybox. the dd jobs get killed as they should. Therefore I added a "killall dd" for the case the dd_jobs variable is empty.
You should be able to xeno-test under the BusyBox without any parameter, I added however often a "-T 1" to make them run faster.
Could you give this patch another try? Thanks for your patience, but the variability is very high as both the kernel and the busybox have a lot of config options.
Best regards
Signature · 1 line
Niklaus Giger
xeno-config.in +1 -1
@@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh staging=${DESTDIR} prefix="@prefix@"
xeno-info +23 -2
@@ -1,31 +1,46 @@ -#!/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 sh --help 2>&1| grep -q 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 +65,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 +94,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/ .*$//"`
xeno-load.in +8 -6
@@ -1,7 +1,9 @@ -#! /bin/bash +#! /bin/sh # Xenomai application loader script. # (Processes the .runinfo files) # June 2004, <[email protected]> +# 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"
xeno-test.in +109 -42
273 lines not on this page · raw message
Quoted 31 lines · Niklaus Giger
Am Samstag, 27. Mai 2006 18:42 schrieb Jan Kiszka:
Quoted 1 line
Niklaus Giger wrote:
<..>
Quoted 1 line
Still broken:
<..>
Sorry for not catching this part, but my kernel config did not setCONFIG_IKCONFIG. Fixed now.Quoted 6 lines
Resolves to "zcat | grep -E '...'
/proc/config.gz" or to "cat/proc/config.gz". Both doesn't work. I would suggest this:local filter="| grep -E '$whatconf'"
[ "$verbose" = 1 ] && filter=Quoted 10 lines
if [ -f
/proc/config.gz]; then # get the config
loudly zcat/proc/config.gz$filterQuoted 2 lines
elif [ -f
/lib/modules/uname -r/build/.config ]; then
loudly $cmd/lib/modules/uname -r/build/.configAnd here we need
loudly cat
/lib/modules/uname -r/build/.config $filterQuoted 1 line
fi
Should be fixed with the attached patch
Quoted 1 line
There is another occurrence of "zcat | grep" which needs fixing.
This one too.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
/bin/xeno-test:/bin/xeno-test: 264: getopts: not found<..>
Quoted 3 lines
Did so, and also awk need to be switched on. What about testing for those features when bb was detected? Anyway, the latency tests work now (in my qemu box). But I do not find the workload (dd?) in the process list:
Quoted 8 lines
Added to procedure checkUtilities and checkHelpers (after having parsed the options). Added them unconditionally as there might be even *nix systems around which are lacking coreutilities like awk, cut, curl, mail, script.
Added a "ps | grep $_j" to show whether a dd job is still running before killing it. Now, at least running under the busybox. the dd jobs get killed as they should. Therefore I added a "killall dd" for the case the
dd_jobsvariable is empty.
But there is still no load during the tests, correct?
Quoted 7 lines
You should be able to xeno-test under the BusyBox without any parameter, I added however often a "-T 1" to make them run faster.
Could you give this patch another try? Thanks for your patience, but the variability is very high as both the kernel and the busybox have a lot of config options.
Yeah, I know. Therefore it takes someone looking at it from different perspectives. :)
Basically works now, but I found two oddities:
- special characters in line 152 of xeno-test:
Quoted 13 lines
xeno-test.in +2
-3@@ -83,20 +141,19 @@ 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 ?
xeno-test.in line 152
Quoted 10 lines
xeno-test.in +3
-7- local cmd="zgrep -E '$whatconf'" - [ "$verbose" = 1 ] && cmd=cat - - if [ -f /proc/config.gz ]; then # get the config - loudly $cmd /proc/config.gz - elif [ -f /lib/modules/`uname -r`/build/.config ]; then - loudly $cmd /lib/modules/`uname -r`/build/.config + local filter=" grep -E '$whatconf'" + [ "$verbose" = 1 ] && filter= + if test -f /proc/config.gz; then   # get the config
^^^^
- the output of xeno-test contains this error:
running: cat /proc/cpuinfo
processor : 0
[...]
bogomips : 2628.76
/bin/xeno-test: /bin/xeno-test: 325: : not found
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not setCONFIG_PREEMPT=yCONFIG_PREEMPT_BKL=yCONFIG_IPIPE=y
???
Jan
Am Sonntag, 28. Mai 2006 12:45 schrieb Jan Kiszka:
Quoted 2 lines
Quoted 1 line · Niklaus Giger
Am Samstag, 27. Mai 2006 18:42 schrieb Jan Kiszka:
<..>
Quoted 6 lines
Quoted 4 lines
Added a "ps | grep $_j" to show whether a dd job is still running before killing it. Now, at least running under the busybox. the dd jobs get killed as they should. Therefore I added a "killall dd" for the case the
dd_jobsvariable is empty.But there is still no load during the tests, correct?
Yes. But now it should. The dd_jobs got killed too early, as under the BusyBox the trap exit handler got called too early. I think there are some subtle differences between the trap of the BusyBox- and the Bash-shell.
Now I store the pids in a file under /var/lock. Tested it under bash and busybox, works okay for me.
Options like "-4-W 'dd if=/dev/hda1 of=/dev/null'" should also be handled correctly.
Options -L -m -M not tested under the BusyBox PPC405 target, as there I do not have access to curl, script and mail.
<..>
Quoted 1 line
- special characters in line 152 of xeno-test:
Sorry. Corrected. I think kate did not handle a paste from your e-mail message correctly
<..>
Quoted 1 line
- the output of xeno-test contains this error:
<..>
Quoted 1 line
/bin/xeno-test:/bin/xeno-test: 325: : not found
May be the result of above error? Could not reproduce it here. Could try again the attached patch?
Thanks a lot again.
Best regards
Signature · 1 line
Niklaus Giger
xeno-config.in +1 -1
@@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh staging=${DESTDIR} prefix="@prefix@"
xeno-info +23 -2
@@ -1,31 +1,46 @@ -#!/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 sh --help 2>&1| grep -q 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 +65,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 +94,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/ .*$//"`
xeno-load.in +8 -6
@@ -1,7 +1,9 @@ -#! /bin/bash +#! /bin/sh # Xenomai application loader script. # (Processes the .runinfo files) # June 2004, <[email protected]> +# 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"
xeno-test.in +113 -45
278 lines not on this page · raw message
Quoted 13 lines · Niklaus Giger
Am Sonntag, 28. Mai 2006 12:45 schrieb Jan Kiszka:
Quoted 2 lines
Quoted 1 line · Niklaus Giger
Am Samstag, 27. Mai 2006 18:42 schrieb Jan Kiszka:
<..>
Quoted 5 lines
Quoted 4 lines
Added a "ps | grep $_j" to show whether a dd job is still running before killing it. Now, at least running under the busybox. the dd jobs get killed as they should. Therefore I added a "killall dd" for the case the
dd_jobsvariable is empty.But there is still no load during the tests, correct?
Yes. But now it should. The
dd_jobsgot killed too early, as under the BusyBox the trap exit handler got called too early. I think there are some subtle differences between the trap of the BusyBox- and the Bash-shell.
Quoted 5 lines
Now I store the pids in a file under
/var/lock. Tested it under bash and busybox, works okay for me.Options like "-4-W 'dd if=/dev/hda1 of=/dev/null'" should also be handled correctly.
Default workload behaves as expected now, but specifying something different here via -W let the script hang on the workload startup.
Quoted 6 lines
Options -L -m -M not tested under the BusyBox PPC405 target, as there I do not have access to curl, script and mail.
<..>
Quoted 1 line
- special characters in line 152 of xeno-test:
Quoted 8 lines
Sorry. Corrected. I think kate did not handle a paste from your e-mail message correctly
<..>Quoted 1 line
- the output of xeno-test contains this error:
<..>
Quoted 1 line
/bin/xeno-test:/bin/xeno-test: 325: : not foundMay be the result of above error? Could not reproduce it here. Could try again the attached patch?
Basically, it runs fine. But I have two further suggestions:
o some kind of summary of the completed rt-tests on script termination. I know what to lock for in the logs, but will the newbie do so?
o a switch to control the test periods. I'm playing with a patch to control the aperiodic timer resolution. When I tune it to 1 ms e.g., having an option to push the test tool periods at this level as well would be nice.
Thanks a lot for your effort!
Jan
Quoted 7 lines · Niklaus Giger
Am Freitag, 26. Mai 2006 15:52 schrieb Jan Kiszka:
Quoted 5 lines
Niklaus Giger wrote: ...
If anybody has a working target with a Xenomai + BusyBox combination and would be willing to test drive my changes, I would appreciate a feedback enormously.
I hope this isnt waiting on my 'approval'.
I think its a great idea, and has been on my (way too stagnant) list for a while. Your work has at least urged me to install busybox on my xeno-box. ;-)
My only concern is whether we've sufficiently distinguished the issues:
1 - ash vs bash
Its not entirely clear to me which flavors of sh busybox has:
ash / dash / not-bash
I gather u worked with ash, and it seems most valuable sh features work there just fine ( shell-functions, even 'job-control' of a fashion)
2 - busybox 'executables' only
I coded in a lot of 'full linux' gimme's, like zgrep, script, etc.
Niklaus has repaired many of these. I think a more thorough cleanup is possible, esp if things like 'script' are jettisoned for a simpler shell-functions or helper scripts. This all implies a re-write, which is on my list...
(esp the job-control testing and repair)
Quoted 25 lines · Jim Cromie
Quoted 7 lines · Niklaus Giger
Am Freitag, 26. Mai 2006 15:52 schrieb Jan Kiszka:
Quoted 5 lines
Niklaus Giger wrote: ...
If anybody has a working target with a Xenomai + BusyBox combination and would be willing to test drive my changes, I would appreciate a feedback enormously.I hope this isnt waiting on my 'approval'.
I think its a great idea, and has been on my (way too stagnant) list for a while.
Your work has at least urged me to install busybox on my xeno-box. ;-)My only concern is whether we've sufficiently distinguished the issues:
1 - ash vs bash
Its not entirely clear to me which flavors of sh busybox has:
ash / dash / not-bash
I gather u worked with ash, and it seems most valuable sh features work there just fine ( shell-functions, even 'job-control' of a fashion)2 - busybox 'executables' only
Quoted 7 lines
I coded in a lot of 'full linux' gimme's, like zgrep, script, etc. Niklaus has repaired many of these. I think a more thorough cleanup is possible,
esp if things like 'script' are jettisoned for a simpler shell-functions or helper scripts.
This all implies a re-write, which is on my list...
(esp the job-control testing and repair)
Just stumbled over this again while cleaning up my mailbox. What's the status? Waiting for improvements, or waiting for /someone/ to type svn ci (and improve the topics above later)?
Jan
Jan Kiszka wrote:
<..>
Quoted 3 lines
Just stumbled over this again while cleaning up my mailbox. What's the status? Waiting for improvements, or waiting for /someone/ to type svn ci (and improve the topics above later)?
Yes and no. As I told there is no urgent need to apply this before 2.2. And improvement/more insight into the whole busybox would be a great idea.
I am busy preparing the next step for the whole xeno-test/buildbot infrastructure, which will feature:
- Small additions to my patch for xeno-test (done)
- Buildbot will run automatically xeno-test on my PPC405 board as the last build step (done). But it will at the moment only show, that there are problems with my PPC405 target (see a separat thread).
- Documentation rework (mostly done)
- Adding a test script to test xeno-test (may be a overkill, but xeno-test accumulated a lot of options, and I like unit test).
As nobody committed my patch, I will be much more confident to propose a patch as soon as the unit tests for xeno-test work.
Best regards
---
Niklaus Giger
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 39 lines · Philippe Gerum
Quoted 38 lines · Jan Kiszka
Quoted 34 lines · Jim Cromie
Quoted 8 lines · Niklaus Giger
Am Freitag, 26. Mai 2006 15:52 schrieb Jan Kiszka:
Quoted 5 lines
Niklaus Giger wrote: ...
If anybody has a working target with a Xenomai + BusyBox combination and would be willing to test drive my changes, I would appreciate a feedback enormously.I hope this isnt waiting on my 'approval'.
I think its a great idea, and has been on my (way too stagnant) list for a while.
Your work has at least urged me to install busybox on my xeno-box. ;-)My only concern is whether we've sufficiently distinguished the issues:
1 - ash vs bash
Its not entirely clear to me which flavors of sh busybox has:
ash / dash / not-bash
I gather u worked with ash, and it seems most valuable sh features work there just fine ( shell-functions, even 'job-control' of a fashion)2 - busybox 'executables' only
I coded in a lot of 'full linux' gimme's, like zgrep, script, etc. Niklaus has repaired many of these. I think a more thorough cleanup is possible,
esp if things like 'script' are jettisoned for a simpler shell-functions or helper scripts.
This all implies a re-write, which is on my list...
(esp the job-control testing and repair)
Quoted 7 lines
Quoted 4 lines
Just stumbled over this again while cleaning up my mailbox. What's the status? Waiting for improvements, or waiting for /someone/ to type svn ci (and improve the topics above later)?
It's queued for now, waiting for a combined ack to merge the current patch from JimC and Niklaus.
AFAIC, Niklaus is in the lead atm.
Im trying to get some GPIO stuff ready for -mm.
( I'll post separately on this ..)
I ran his changes once, I dont even remember what it did. (which suggests that it didnt explode ;-)
IMO, take it when Niklaus says its ready.
I have some local changes here, but Ill work them into shape after Niks changes go in (maybe much later :-(
We should probly confer on the longer-term issues too.
- a rational option-pass-thru, or a means to avoid doing so. if we assume OPTS_${TOOLNAME} exists, we could
grab it out of env, and pass it into the benchmark prog.
- would require no prog mods, but gives us complete control
- would play nicer than assuming -T <secs> has meaning for all progs.
Quoted 62 lines · Jim Cromie
Quoted 42 lines · Philippe Gerum
Quoted 40 lines · Jan Kiszka
Quoted 35 lines · Jim Cromie
Quoted 8 lines · Niklaus Giger
Am Freitag, 26. Mai 2006 15:52 schrieb Jan Kiszka:
Quoted 5 lines
Niklaus Giger wrote: ...
If anybody has a working target with a Xenomai + BusyBox combination and would be willing to test drive my changes, I would appreciate a feedback enormously.I hope this isnt waiting on my 'approval'.
I think its a great idea, and has been on my (way too stagnant) list for a while.
Your work has at least urged me to install busybox on my xeno-box. ;-)My only concern is whether we've sufficiently distinguished the issues:
1 - ash vs bash
Its not entirely clear to me which flavors of sh busybox has:
ash / dash / not-bash
I gather u worked with ash, and it seems most valuable sh features work there just fine ( shell-functions, even 'job-control' of a fashion)2 - busybox 'executables' only
I coded in a lot of 'full linux' gimme's, like zgrep, script, etc. Niklaus has repaired many of these. I think a more thorough cleanup is possible,
esp if things like 'script' are jettisoned for a simpler shell-functions or helper scripts.
This all implies a re-write, which is on my list...
(esp the job-control testing and repair)Quoted 7 lines
Quoted 4 lines
Just stumbled over this again while cleaning up my mailbox. What's the status? Waiting for improvements, or waiting for /someone/ to type svn ci (and improve the topics above later)?
It's queued for now, waiting for a combined ack to merge the current patch from JimC and Niklaus.
AFAIC, Niklaus is in the lead atm.
Im trying to get some GPIO stuff ready for -mm.
( I'll post separately on this ..)I ran his changes once, I dont even remember what it did. (which suggests that it didnt explode ;-)
IMO, take it when Niklaus says its ready.
I have some local changes here, but Ill work them into shape after Niks changes go in (maybe much later :-(
Quoted 9 lines
We should probly confer on the longer-term issues too.
- a rational option-pass-thru, or a means to avoid doing so. if we assume OPTS_${TOOLNAME} exists, we could
grab it out of env, and pass it into the benchmark prog.
- would require no prog mods, but gives us complete control
- would play nicer than assuming -T <secs> has meaning for all progs.
Would this fit with an automated test 'bot? Niklaus?
Signature · 1 line
Philippe.