NSLU2-Linux
view · edit · print · history

Openslug complains on bootup that grep is using an unexisting -o option while running hotplug. This is in fact true and thanks to lots of help from Kergoth I replaced the grep -o with a call to sed, which is already part of busybox. Another option would have been to modify busybox to add -o support to grep but I thought it would be better to make hotplug more flexible instead of increasing the size of busybox.

1- I added a patch to the hotplug_20040920.bb file:

SRC_URI = .........

          .......
          file://grep_o_less.patch;patch=1           .......

2- Here's the actual grep_o_less.patch file I dropped in hotplug-20040920/

--- hotplug-2004_09_20/etc/hotplug/usb.rc.old 2004-12-07 17:40:50.000000000 -0500 +++ hotplug-2004_09_20/etc/hotplug/usb.rc 2004-12-07 17:42:17.000000000 -0500 -95,8 +95,8

                        PRODUCT="$(cat $devlink/../idVendor)/$(cat $devlink/../idProduct)/$(cat $devlink/../bcdDevice)"
                        if [ -f $devlink/../../devnum ]
                        then
 -                           devbus=$( ( echo -n 000 ; cat $devlink/../../devnum ) | grep -o ...\$ )
 -                           devdev=$( ( echo -n 000 ; cat $devlink/../devnum ) | grep -o ...\$ )
 +                           devbus=$( ( echo -n 000 ; cat $devlink/../../devnum ) | sed -n -e '/...$/s/.*\(...$\).*/\1/p' )
 +                           devdev=$( ( echo -n 000 ; cat $devlink/../devnum ) | sed -n -e '/...$/s/.*\(...$\).*/\1/p' )
                            DEVICE="/proc/bus/usb/$devbus/$devdev"
                        else
                            DEVICE=

I could have pushed it myself but was worried it might break something else. So please test and push or let me know and I'll try to clean up my mess and push it myself.

Thanks,

view · edit · print · history · Last edited by VoodooZ.
Originally by VoodooZ.
Page last modified on April 14, 2005, at 03:26 PM