-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lime-hwd-usbradio: added documentation for hotplug-hook.sh
- Loading branch information
Showing
1 changed file
with
10 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
#!/bin/sh | ||
|
||
|
||
burstStopFile="/tmp/lime-hotplug-usbradio-burst-check" | ||
|
||
#[Doc] Check if burstStopFile exists to avoid multiple execution due to hotplug call burst | ||
#[Doc] In the case burstStopFile exists the following code will be not executed | ||
[ -e "${burstStopFile}" ] || | ||
{ | ||
#[Doc] Prepare Lua table with the hotplug parameters | ||
lua_hotplug_args="hotplug_hook_args = { action='${ACTION}', devicename='${DEVICENAME}', devname='${DEVNAME}', devpath='${DEVPATH}', product='${PRODUCT}', type='${TYPE}', interface='${INTERFACE}' }" | ||
|
||
#[Doc] Create burstStopFile; Write the date just for debugging | ||
date > "${burstStopFile}" | ||
|
||
#[Doc] Wait for the radio to be ready | ||
#[Doc] Configure the device calling lime-config but first execute lua_hotplug_args to pass hotplug parameters | ||
#[Doc] Finally remove burstStopFile | ||
((sleep 2s ; lua -e"${lua_hotplug_args}" /usr/bin/lime-config ; rm -rf "${burstStopFile}")&) | ||
} |