2 Aug 2005 15:54
Re: Remove bashisms from opcontrol
Philippe Elie <phil.el <at> wanadoo.fr>
2005-08-02 13:54:10 GMT
2005-08-02 13:54:10 GMT
On Mon, 01 Aug 2005 at 22:47 +0000, Richard Purdie wrote: > As things stand there are several bash dependencies in the opcontrol > script. This means it can't run with the likes of busybox which is often > found in embedded systems instead of bash. > > This patch removes some of the simple problems: > http://projects.o-hand.com/oprofile/oprofile_nobash1.patch > > One further cleanup might be to set UID=`id -u` as the script starts and > then just access UID. > > With that applied, the only problem is the CHOSEN_EVENTS array. busybox > can't cope with arrays so this presents a problem. I can't see a way to > fix it just using shell variables. It is possible to use an events file > to get around this though: > > http://projects.o-hand.com/oprofile/oprofile_nobash2.patch > > Some simple functions are added to set and pull entries from the file, > the line number being used as the array index. > > I've tested this with both busybox and bash and it appears to work > although I'm not a regular user of the events syntax so there may be > something I've overlooked. > > I'm open to comments :) I've applied the first patch, perhaps the approach given by Ralf Wildenhues for the second patch is better :(Continue reading)
RSS Feed