mirror of
https://github.com/riptidewave93/UNVR-NAS.git
synced 2025-03-09 15:40:13 +00:00
feat: initial bluetooth support (#9)
* Enable Bluetooth LE radio support * Build our own bccmd which we need to setup/enable this BT chipset sadly * Use our own tool we build to interface with the ubnt eeprom, so we can not rely on their custom kernel module * Also fix HDDs not spinning down on shutdown, doing something similar to how unifi does it but a tad more generic.
This commit is contained in:
parent
fe3b4cd76f
commit
9ef1a72228
15 changed files with 678 additions and 20 deletions
29
overlay/filesystem/usr/lib/systemd/system-shutdown/unifi-shutdown
Executable file
29
overlay/filesystem/usr/lib/systemd/system-shutdown/unifi-shutdown
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash
|
||||
|
||||
# turn off fans for shutdown
|
||||
if [ -d "/sys/class/hwmon/hwmon0/device" ]; then
|
||||
for pwm in `ls /sys/class/hwmon/hwmon0/device/pwm[0-6]`; do
|
||||
echo 0 > ${pwm}
|
||||
done
|
||||
fi
|
||||
|
||||
# Ensure all mounts in /srv from OMV are cleaned up
|
||||
for dir in `ls /srv | grep dev-disk`; do
|
||||
umount -q /srv/${dir};
|
||||
done
|
||||
|
||||
# Now for all disks, delete from bus
|
||||
for dsk in sd{a..z}; do
|
||||
if [ -d "/sys/block/${dsk}/device" ]; then
|
||||
echo 1 > "/sys/block/${dsk}/device/delete"
|
||||
fi
|
||||
done
|
||||
|
||||
# Now for all disks, remove them with ui-hdd-pwrctl-v2 if we have it
|
||||
if [ -d "/sys/bus/platform/drivers/ui-hdd-pwrctl-v2" ]; then
|
||||
for bay in `seq 0 7`; do
|
||||
echo ${bay} > "$(realpath /sys/bus/platform/drivers/ui-hdd-pwrctl-v2/*hdd_pwrctl-v2)/hdd_force_poweroff"
|
||||
done
|
||||
fi
|
||||
# Let the disks spool down a sec...
|
||||
sleep 2
|
Loading…
Add table
Add a link
Reference in a new issue