diff options
Diffstat (limited to 'meta/packages/linux-hotplug/files')
| -rw-r--r-- | meta/packages/linux-hotplug/files/collie/usbd | 1 | ||||
| -rwxr-xr-x | meta/packages/linux-hotplug/files/mmc.agent | 52 | ||||
| -rwxr-xr-x | meta/packages/linux-hotplug/files/sleeve.agent | 120 | ||||
| -rwxr-xr-x | meta/packages/linux-hotplug/files/sleeve.rc | 60 | ||||
| -rw-r--r-- | meta/packages/linux-hotplug/files/soc.agent | 62 | ||||
| -rw-r--r-- | meta/packages/linux-hotplug/files/sysconfig-hotplug | 12 | ||||
| -rw-r--r-- | meta/packages/linux-hotplug/files/sysconfig-usb | 0 | ||||
| -rw-r--r-- | meta/packages/linux-hotplug/files/tosa/sysconfig-usb | 2 | ||||
| -rw-r--r-- | meta/packages/linux-hotplug/files/usbd | 2 | ||||
| -rwxr-xr-x | meta/packages/linux-hotplug/files/usbd.agent | 63 |
10 files changed, 374 insertions, 0 deletions
diff --git a/meta/packages/linux-hotplug/files/collie/usbd b/meta/packages/linux-hotplug/files/collie/usbd new file mode 100644 index 0000000000..38aff0adcb --- /dev/null +++ b/meta/packages/linux-hotplug/files/collie/usbd | |||
| @@ -0,0 +1 @@ | |||
| usbdmodule="sa1100_bi" | |||
diff --git a/meta/packages/linux-hotplug/files/mmc.agent b/meta/packages/linux-hotplug/files/mmc.agent new file mode 100755 index 0000000000..a80daa4603 --- /dev/null +++ b/meta/packages/linux-hotplug/files/mmc.agent | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # H3600 Sleeve hotplug policy agent for Linux 2.4 kernels | ||
| 4 | # | ||
| 5 | # Kernel NET hotplug params include: | ||
| 6 | # | ||
| 7 | # ACTION=%s [add or remove] | ||
| 8 | # MEDIA=%s | ||
| 9 | # SLOT=%d | ||
| 10 | # | ||
| 11 | |||
| 12 | . /etc/hotplug/hotplug.functions | ||
| 13 | #DEBUG=yes export DEBUG | ||
| 14 | |||
| 15 | echo "Executing $0 action=$ACTION, media=$MEDIA ($SLOT)" > /dev/console | ||
| 16 | |||
| 17 | MMC_MOUNT_OPTIONS="-t auto -o sync,noatime" | ||
| 18 | |||
| 19 | if [ -f /etc/sysconfig/hotplug ] ; then | ||
| 20 | . /etc/sysconfig/hotplug | ||
| 21 | fi | ||
| 22 | |||
| 23 | case `uname -r` in | ||
| 24 | 2.4*) | ||
| 25 | devpath=mmc/part | ||
| 26 | ;; | ||
| 27 | *) | ||
| 28 | devpath=mmcblk0p | ||
| 29 | ;; | ||
| 30 | esac | ||
| 31 | |||
| 32 | if [ "$ACTION" = "add" ] ; then | ||
| 33 | sleep 4 | ||
| 34 | echo -n add > /dev/console | ||
| 35 | for n in 1 2 3 4 ; do | ||
| 36 | device=/dev/$devpath$n | ||
| 37 | if [ "$n" = "1" ] ; then | ||
| 38 | card=/mnt/card | ||
| 39 | else | ||
| 40 | card=/mnt/card$n | ||
| 41 | fi | ||
| 42 | [ -b $device ] || break | ||
| 43 | echo " flash on $device" > /dev/console | ||
| 44 | [ -d $card ] || mkdir -p $card | ||
| 45 | mount $MMC_MOUNT_OPTIONS $device $card | ||
| 46 | done | ||
| 47 | |||
| 48 | else | ||
| 49 | for card in /mnt/card*; do | ||
| 50 | umount $card | ||
| 51 | done | ||
| 52 | fi | ||
diff --git a/meta/packages/linux-hotplug/files/sleeve.agent b/meta/packages/linux-hotplug/files/sleeve.agent new file mode 100755 index 0000000000..55befca1b1 --- /dev/null +++ b/meta/packages/linux-hotplug/files/sleeve.agent | |||
| @@ -0,0 +1,120 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # H3600 Sleeve hotplug policy agent for Linux 2.4 kernels | ||
| 4 | # | ||
| 5 | # Kernel NET hotplug params include: | ||
| 6 | # | ||
| 7 | # ACTION=%s [add or remove] | ||
| 8 | # VENDOR_ID=%s | ||
| 9 | # DEVICE_ID=%x | ||
| 10 | # DEVICE_NAME=%s | ||
| 11 | # | ||
| 12 | |||
| 13 | . /etc/hotplug/hotplug.functions | ||
| 14 | #DEBUG=yes export DEBUG | ||
| 15 | |||
| 16 | if [ "$DEBUG" != "" ]; then | ||
| 17 | mesg "Executing $0 action=$ACTION, device=$DEVICE_NAME ($VENDOR_ID,$DEVICE_ID)" | ||
| 18 | fi | ||
| 19 | |||
| 20 | COMPACTFLASH_TIMING_INCREMENT=0 | ||
| 21 | PCMCIA_TIMING_INCREMENT=0 | ||
| 22 | DUAL_PCMCIA_TIMING_INCREMENT=0 | ||
| 23 | NAVMAN_TIMING_INCREMENT=0 | ||
| 24 | BACKPAQ_TIMING_INCREMENT=-100 | ||
| 25 | |||
| 26 | if [ -f /etc/sysconfig/hotplug ] ; then | ||
| 27 | . /etc/sysconfig/hotplug | ||
| 28 | fi | ||
| 29 | |||
| 30 | case $ACTION in | ||
| 31 | add) | ||
| 32 | case $DEVICE_NAME in | ||
| 33 | "Compaq Mercury Backpaq") | ||
| 34 | mkdir -p /backpaq | ||
| 35 | echo $BACKPAQ_TIMING_INCREMENT > /proc/sys/backpaq/pcmcia/timing_increment_ns | ||
| 36 | ## mount -t jffs2 /dev/mtdblock/4 /backpaq | ||
| 37 | modprobe h3600_backpaq_fpga || mesg 'could not load backpaq fpga driver' | ||
| 38 | modprobe h3600_backpaq_camera || mesg 'could not load backpaq camera driver' | ||
| 39 | if [ -c /dev/v4l/video0 ] ; then | ||
| 40 | ln -s /dev/v4l/video0 /dev/video0 | ||
| 41 | ln -s /dev/v4l/video0 /dev/video | ||
| 42 | fi | ||
| 43 | CAMERATYPE=`/bin/grep "CameraType" /proc/backpaq/camera | /bin/sed -e 's/.*: //'` | ||
| 44 | BACKPAQ_NUMBER=`/bin/grep "Major revision" /proc/backpaq/eeprom | /bin/sed -e 's/.*0x//'` | ||
| 45 | FPGA_NUMBER=`/bin/grep "FPGA version" /proc/backpaq/eeprom | /bin/sed -e 's/.*0x//'` | ||
| 46 | CAMERA_NUMBER=`/bin/grep "Camera" /proc/backpaq/eeprom | /bin/sed -e 's/.*0x//'` | ||
| 47 | |||
| 48 | echo "CAMERA_TYPE = $CAMERATYPE" | ||
| 49 | echo "BACKPAQ_NUMBER = $BACKPAQ_NUMBER" | ||
| 50 | echo "FPGA_NUMBER = $FPGA_NUMBER" | ||
| 51 | echo "CAMERA_NUMBER = $CAMERA_NUMBER" | ||
| 52 | echo "looking for file: /etc/fpga_B${BACKPAQ_NUMBER}_F${FPGA_NUMBER}_C${CAMERA_NUMBER}.bin" | ||
| 53 | if [ -e /etc/fpga_B${BACKPAQ_NUMBER}_F${FPGA_NUMBER}_C${CAMERA_NUMBER}.bin ] ; then | ||
| 54 | cat /etc/fpga_B${BACKPAQ_NUMBER}_F${FPGA_NUMBER}_C${CAMERA_NUMBER}.bin > /dev/backpaq/fpga | ||
| 55 | elif [ -e /etc/fpga_$CAMERATYPE.bin ] ; then | ||
| 56 | cat /etc/fpga_$CAMERATYPE.bin > /dev/backpaq/fpga | ||
| 57 | elif [ -e /etc/fpga.bin ] ; then | ||
| 58 | cat /etc/fpga.bin > /dev/backpaq/fpga | ||
| 59 | else | ||
| 60 | mesg 'unable to program the backpaq fpga' | ||
| 61 | fi | ||
| 62 | modprobe h3600_backpaq_accel || mesg 'could not load backpaq accelerometer driver' | ||
| 63 | mesg 'BackPAQ drivers loaded' | ||
| 64 | ;; | ||
| 65 | "Compaq CompactFlash Sleeve") | ||
| 66 | mesg 'CompactFlash drivers loaded' | ||
| 67 | echo $COMPACTFLASH_TIMING_INCREMENT > /proc/sys/bus/pcmcia/timing_increment_ns | ||
| 68 | ;; | ||
| 69 | "Compaq PC Card Sleeve") | ||
| 70 | mesg 'PC card sleeve drivers loaded' | ||
| 71 | echo $PCMCIA_TIMING_INCREMENT > /proc/sys/bus/pcmcia/timing_increment_ns | ||
| 72 | ;; | ||
| 73 | "Compaq Dual PC Card Sleeve") | ||
| 74 | mesg 'Dual PC card sleeve drivers loaded' | ||
| 75 | echo $DUAL_PCMCIA_TIMING_INCREMENT > /proc/sys/bus/pcmcia/timing_increment_ns | ||
| 76 | ;; | ||
| 77 | "Navman GPS/CF Sleeve") | ||
| 78 | mesg 'Navman GPS sleeve drivers loaded' | ||
| 79 | echo $NAVMAN_TIMING_INCREMENT > /proc/sys/bus/pcmcia/timing_increment_ns | ||
| 80 | start-stop-daemon --start --exec /usr/sbin/gpsd.bin -- -p /dev/tts/0 -s 57600 | ||
| 81 | ;; | ||
| 82 | *) | ||
| 83 | mesg "$1 $ACTION event not handled for $DEVICE_NAME" | ||
| 84 | ;; | ||
| 85 | esac | ||
| 86 | ;; | ||
| 87 | |||
| 88 | remove) | ||
| 89 | case $DEVICE_NAME in | ||
| 90 | "Compaq Mercury Backpaq") | ||
| 91 | mesg 'Unloading BackPAQ drivers' | ||
| 92 | ## umount /backpaq | ||
| 93 | rmmod h3600_backpaq_camera | ||
| 94 | rmmod h3600_backpaq_accel | ||
| 95 | rmmod h3600_backpaq_fpga | ||
| 96 | ;; | ||
| 97 | "Compaq CompactFlash Sleeve") | ||
| 98 | mesg 'Unloading CompactFlash sleeve' | ||
| 99 | ;; | ||
| 100 | "Compaq PC Card Sleeve") | ||
| 101 | mesg 'Unloading PC Card sleeve' | ||
| 102 | ;; | ||
| 103 | "Compaq Dual PC Card Sleeve") | ||
| 104 | mesg 'Unloading Dual PC Card sleeve' | ||
| 105 | ;; | ||
| 106 | "Navman GPS/CF Sleeve") | ||
| 107 | mesg 'Unloading Navman GPS sleeve' | ||
| 108 | start-stop-daemon --stop --name gpsd.bin | ||
| 109 | ;; | ||
| 110 | *) | ||
| 111 | mesg $1 $ACTION event not handled for $DEVICE_NAME | ||
| 112 | ;; | ||
| 113 | esac | ||
| 114 | ;; | ||
| 115 | |||
| 116 | *) | ||
| 117 | mesg "$1 $ACTION event not supported" | ||
| 118 | exit 1 ;; | ||
| 119 | |||
| 120 | esac | ||
diff --git a/meta/packages/linux-hotplug/files/sleeve.rc b/meta/packages/linux-hotplug/files/sleeve.rc new file mode 100755 index 0000000000..864a2eb182 --- /dev/null +++ b/meta/packages/linux-hotplug/files/sleeve.rc | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # H3600 Sleeve hotplug *.rc agent. | ||
| 4 | # This script is called by /etc/init.d/hotplug whenever | ||
| 5 | # a run level has changed. | ||
| 6 | # | ||
| 7 | # A single argument is passed - start, restart, status, or stop | ||
| 8 | # | ||
| 9 | # We set up parameters that are equivalent to the ones created | ||
| 10 | # by the Kernel and pass them along to /sbin/hotplug (the | ||
| 11 | # function called by the kernel). | ||
| 12 | # | ||
| 13 | # Kernel NET hotplug params include: | ||
| 14 | # | ||
| 15 | # ACTION=%s [add or remove] | ||
| 16 | # VENDOR_ID=%s | ||
| 17 | # DEVICE_ID=%x | ||
| 18 | # DEVICE_NAME=%s | ||
| 19 | # | ||
| 20 | |||
| 21 | . /etc/hotplug/hotplug.functions | ||
| 22 | # DEBUG=yes export DEBUG | ||
| 23 | |||
| 24 | SLEEVEFILE="/proc/bus/sleeve/device" | ||
| 25 | [ ! -f $SLEEVEFILE ] && exit 0 | ||
| 26 | |||
| 27 | # give the sleeve driver a kick to make sure it recognizes the card -Jamey 6/26/01 | ||
| 28 | # echo > /proc/sys/sleeve/insert | ||
| 29 | |||
| 30 | export DEVICE_NAME=`/bin/grep driver $SLEEVEFILE | /bin/sed -e 's/.*=//'` | ||
| 31 | export DEVICE_ID=`/bin/grep device $SLEEVEFILE | /bin/sed -e 's/.*=//'` | ||
| 32 | export VENDOR_ID=`/bin/grep vendor $SLEEVEFILE | /bin/sed -e 's/.*=//'` | ||
| 33 | |||
| 34 | case "$1" in | ||
| 35 | start) | ||
| 36 | export ACTION="add" | ||
| 37 | /sbin/hotplug sleeve | ||
| 38 | ;; | ||
| 39 | stop) | ||
| 40 | export ACTION="remove" | ||
| 41 | /sbin/hotplug sleeve | ||
| 42 | ;; | ||
| 43 | restart) | ||
| 44 | export ACTION="remove" | ||
| 45 | /sbin/hotplug sleeve | ||
| 46 | export ACTION="add" | ||
| 47 | /sbin/hotplug sleeve | ||
| 48 | ;; | ||
| 49 | status) | ||
| 50 | if [ -f /var/lock/subsys/hotplug ]; then | ||
| 51 | mesg "Hot plug sleeve has been started, current device $DEVICE_NAME" | ||
| 52 | else | ||
| 53 | mesg "Hot plug sleeve has not been started, current device $DEVICE_NAME" | ||
| 54 | fi | ||
| 55 | ;; | ||
| 56 | *) | ||
| 57 | mesg "Usage: $0 {start|stop|status|restart}" | ||
| 58 | ;; | ||
| 59 | esac | ||
| 60 | |||
diff --git a/meta/packages/linux-hotplug/files/soc.agent b/meta/packages/linux-hotplug/files/soc.agent new file mode 100644 index 0000000000..e91246196f --- /dev/null +++ b/meta/packages/linux-hotplug/files/soc.agent | |||
| @@ -0,0 +1,62 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # SoC hotplug agent for 2.6 kernels | ||
| 4 | # | ||
| 5 | # ACTION=add | ||
| 6 | # SOC_ID=1234 | ||
| 7 | # | ||
| 8 | |||
| 9 | cd /etc/hotplug | ||
| 10 | . ./hotplug.functions | ||
| 11 | |||
| 12 | MAP_CURRENT=$MODULE_DIR/modules.socmap | ||
| 13 | |||
| 14 | # | ||
| 15 | # stdin is "modules.socmap" syntax | ||
| 16 | # on return, all matching modules were added to $DRIVERS | ||
| 17 | # | ||
| 18 | soc_map_modules () | ||
| 19 | { | ||
| 20 | while read line | ||
| 21 | do | ||
| 22 | # comments are lines that start with "#" ... | ||
| 23 | # be careful, they still get parsed by bash! | ||
| 24 | case "$line" in | ||
| 25 | \#*) continue ;; | ||
| 26 | esac | ||
| 27 | |||
| 28 | set $line | ||
| 29 | |||
| 30 | module="$1" | ||
| 31 | id="$2" | ||
| 32 | |||
| 33 | if [ "$id" != "0x$SOC_ID" ]; then | ||
| 34 | continue | ||
| 35 | fi | ||
| 36 | |||
| 37 | # It was a match! | ||
| 38 | case " $DRIVERS " in | ||
| 39 | *" $module "* ) | ||
| 40 | : already found | ||
| 41 | ;; | ||
| 42 | * ) | ||
| 43 | DRIVERS="$module $DRIVERS" | ||
| 44 | ;; | ||
| 45 | esac | ||
| 46 | : drivers $DRIVERS | ||
| 47 | done | ||
| 48 | } | ||
| 49 | |||
| 50 | case $ACTION in | ||
| 51 | |||
| 52 | add) | ||
| 53 | |||
| 54 | load_drivers soc $MAP_CURRENT "$SOC_ID" | ||
| 55 | ;; | ||
| 56 | |||
| 57 | *) | ||
| 58 | debug_mesg SoC $ACTION event not supported | ||
| 59 | exit 1 | ||
| 60 | ;; | ||
| 61 | |||
| 62 | esac | ||
diff --git a/meta/packages/linux-hotplug/files/sysconfig-hotplug b/meta/packages/linux-hotplug/files/sysconfig-hotplug new file mode 100644 index 0000000000..7ee5a20c31 --- /dev/null +++ b/meta/packages/linux-hotplug/files/sysconfig-hotplug | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | ## | ||
| 2 | ## Each of these may be assigned to the number of nanoseconds by which to | ||
| 3 | ## increase the timing of pcmcia bus transactions | ||
| 4 | ## | ||
| 5 | # COMPACTFLASH_TIMING_INCREMENT=0 | ||
| 6 | ## the single pcmcia sleeve seems to be a bit slow, but 25ns makes my | ||
| 7 | ## orinoco card detectable. -Jamey 4/2/2002 | ||
| 8 | PCMCIA_TIMING_INCREMENT=25 | ||
| 9 | # DUAL_PCMCIA_TIMING_INCREMENT=0 | ||
| 10 | |||
| 11 | ## mount options used by MMC | ||
| 12 | MMC_MOUNT_OPTIONS="-t auto -o sync,noatime" | ||
diff --git a/meta/packages/linux-hotplug/files/sysconfig-usb b/meta/packages/linux-hotplug/files/sysconfig-usb new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/meta/packages/linux-hotplug/files/sysconfig-usb | |||
diff --git a/meta/packages/linux-hotplug/files/tosa/sysconfig-usb b/meta/packages/linux-hotplug/files/tosa/sysconfig-usb new file mode 100644 index 0000000000..cbd18c6566 --- /dev/null +++ b/meta/packages/linux-hotplug/files/tosa/sysconfig-usb | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | ## Specify the USB host controller driver | ||
| 2 | HCD="usb_ohci_tc6393" | ||
diff --git a/meta/packages/linux-hotplug/files/usbd b/meta/packages/linux-hotplug/files/usbd new file mode 100644 index 0000000000..aa4e6d2de7 --- /dev/null +++ b/meta/packages/linux-hotplug/files/usbd | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | usbdmodule="" | ||
| 2 | |||
diff --git a/meta/packages/linux-hotplug/files/usbd.agent b/meta/packages/linux-hotplug/files/usbd.agent new file mode 100755 index 0000000000..6613b4810a --- /dev/null +++ b/meta/packages/linux-hotplug/files/usbd.agent | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | #!/bin/ash | ||
| 2 | |||
| 3 | # DEBUG=yes export DEBUG | ||
| 4 | #set -x | ||
| 5 | |||
| 6 | . /etc/hotplug/hotplug.functions | ||
| 7 | . /etc/default/usbd | ||
| 8 | cd $HOTPLUG_DIR | ||
| 9 | |||
| 10 | [ -z "$INTERFACE" ] && exit 1 | ||
| 11 | [ -z "$ACTION" ] && exit 1 | ||
| 12 | [ -z "$usbdmodule" ] && exit 0 | ||
| 13 | |||
| 14 | debug_mesg "USBD $ACTION Action Recived" | ||
| 15 | |||
| 16 | case $INTERFACE in | ||
| 17 | |||
| 18 | monitor) | ||
| 19 | case $ACTION in | ||
| 20 | # called to load all usb device modules | ||
| 21 | load) | ||
| 22 | modprobe usbdcore | ||
| 23 | modprobe net_fd | ||
| 24 | modprobe $usbdmodule | ||
| 25 | ;; | ||
| 26 | |||
| 27 | # called to handle suspend power management event | ||
| 28 | suspend) | ||
| 29 | rmmod $usbdmodule | ||
| 30 | ;; | ||
| 31 | |||
| 32 | # called to reload after resume power management event | ||
| 33 | restore-loaded) | ||
| 34 | modprobe $usbdmodule | ||
| 35 | sleep 2 | ||
| 36 | ;; | ||
| 37 | |||
| 38 | # called to unload after resume power management event | ||
| 39 | restore-unloaded) | ||
| 40 | modprobe -r net_fd | ||
| 41 | ;; | ||
| 42 | |||
| 43 | # called to unload all usb device modules | ||
| 44 | unload) | ||
| 45 | modprobe -r $usbdmodule | ||
| 46 | ;; | ||
| 47 | |||
| 48 | *) | ||
| 49 | debug_mesg USBD $ACTION event not handled | ||
| 50 | exit 1 | ||
| 51 | ;; | ||
| 52 | esac | ||
| 53 | ;; | ||
| 54 | *) | ||
| 55 | debug_mesg USBD $INTERFACE-$ACTION event not handled | ||
| 56 | exit 1 | ||
| 57 | ;; | ||
| 58 | esac | ||
| 59 | |||
| 60 | [ -e /proc/usb-monitor ] && echo "Done" > /proc/usb-monitor | ||
| 61 | |||
| 62 | exit 0 | ||
| 63 | |||
