Re: understanding firmware loader for speedtouch (kernel 2.6.21.5)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Duncan Sands <duncan.sands@...>
Cc: mikie <mikie.pl@...>, <linux-kernel@...>
Date: Friday, July 6, 2007 - 3:16 pm

On Fri, July 6, 2007 16:20, Duncan Sands wrote:

For information, it generates a hotplug event and the kernel calls the
program written at /proc/sys/kernel/hotplug with certain information.
That used to be /sbin/hotplug, became later udev, but today in general
udev reads the uevents generated by the kernel.



If you really don't want to use udevd, you could use the below script I wrote
(not really tested, it's an bash version of the Udev rules I've have, more or less.)

Echo the script pathname to /proc/sys/kernel/hotplug early at bootup and all
should work, assuming your pppd is setup correctly and the script isn't buggy.

#!/bin/sh
set -e

p()
{
	# For debugging/logging, edit for your needs.
	echo "$*"
	echo "$*" > /dev/vc/1;
	echo "$*" >> /tmp/bla;
}

if [ "$SUBSYSTEM" = "firmware" ]; then
	p "Loading firmware..."
	cd /sys/$DEVPATH
	if [ -f "/lib/firmware/$FIRMWARE" ]; then
		echo 1 > loading
		cat "/lib/firmware/$FIRMWARE" > data
		echo 0 > loading
		p "Done."
	else
		echo -1 > loading
		p "$FIRMWARE not found."
	fi
elif [ "$SUBSYSTEM" = "atm" ]; then
	if [[ "$KERNEL" != speedtch* ]]; then
		exit
	fi
	if [ "$ACTION" = "add" ]; then
		p "Starting pppd."
		pppd call adsl
	elif [ "$ACTION" = "remove" ]; then
		p "Stopping pppd."
		pkill pppd
	fi
fi

Greetings,

Indan


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: understanding firmware loader for speedtouch (kernel 2.6..., Indan Zupancic, (Fri Jul 6, 3:16 pm)