NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-arm/55317



On Thu, 15 Dec 2022 09:35:01 +0000 (UTC)
mlelstv%serpens.de@localhost (Michael van Elst) wrote:

>  USB is always "hot-plugging", the kernel doesn't know how long to wait
>  for an USB device to attach.

OK that answers the question and makes sense now. Could I suggest
adding the following script fragment. This would avoid headaches for
people who run Raspberry Pi 3 without other USB devices plugged in.

/etc/rc.d/network:

network_start()
{
	# Workaround for PR#55317
        local hw_model i
        hw_model=`sysctl -n hw.model | grep '^raspberrypi,3'`
        if [ -n "$hw_model" ]
        then
                echo "Detected Raspberry Pi 3 hardware model"
                echo "Waiting for USB ethernet device to attach..."

                # Wait for up to 5 seconds before giving up
                for i in 1 2 3 4 5
                do
                        ifconfig mue0 >/dev/null 2>&1 && break
                        sleep 1
                done
        fi

...
}


Home | Main Index | Thread Index | Old Index