xref: /kernel/linux/linux-5.10/Documentation/firmware_class/hotplug-script
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /kernel/linux/linux-5.10/Documentation/firmware_class/
18c2ecf20Sopenharmony_ci#!/bin/sh
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ci# Simple hotplug script sample:
48c2ecf20Sopenharmony_ci# 
58c2ecf20Sopenharmony_ci# Both $DEVPATH and $FIRMWARE are already provided in the environment.
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ciHOTPLUG_FW_DIR=/usr/lib/hotplug/firmware/
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ciif [ "$SUBSYSTEM" == "firmware" -a "$ACTION" == "add" ]; then
108c2ecf20Sopenharmony_ci  if [ -f $HOTPLUG_FW_DIR/$FIRMWARE ]; then
118c2ecf20Sopenharmony_ci    echo 1 > /sys/$DEVPATH/loading
128c2ecf20Sopenharmony_ci    cat $HOTPLUG_FW_DIR/$FIRMWARE > /sys/$DEVPATH/data
138c2ecf20Sopenharmony_ci    echo 0 > /sys/$DEVPATH/loading
148c2ecf20Sopenharmony_ci  else
158c2ecf20Sopenharmony_ci    echo -1 > /sys/$DEVPATH/loading
168c2ecf20Sopenharmony_ci  fi
178c2ecf20Sopenharmony_cifi
18

Indexes created Thu Nov 07 10:32:03 CST 2024