Skip to content

Commit

Permalink
added helper script and smalle note in README for blacklisting
Browse files Browse the repository at this point in the history
Signed-off-by: hayati ayguen <[email protected]>
  • Loading branch information
hayguen committed Mar 1, 2020
1 parent 859ced2 commit 145144b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ https://osmocom.org/projects/rtl-sdr/wiki
thus can be used without blacklisting dvb_usb_rtl28xxu below /etc/modprobe.d/
- this allows to use a second RTL dongle for use with DVB in parallel
- the IDs can be programmed with 'rtl_eeprom -n' or 'rtl_eeprom -g realtek_sdr'
- for permanent blacklisting you might check/call following from the clone git directory
* ./install-blacklist.sh


# Contributing
Expand Down
26 changes: 26 additions & 0 deletions install-blacklist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

BLACKLIST_FN=""
if [ -f /etc/modprobe.d/rtlsdr-blacklist.conf ]; then
BLACKLIST_FN="rtlsdr-blacklist.conf"
echo "found /etc/modprobe.d/${BLACKLIST_FN}"
elif [ -f /etc/modprobe.d/blacklist-rtl8xxxu.conf ]; then
BLACKLIST_FN="blacklist-rtl8xxxu.conf"
echo "found /etc/modprobe.d/${BLACKLIST_FN}"
elif [ -f /etc/modprobe.d/raspi-blacklist.conf ]; then
BLACKLIST_FN="raspi-blacklist.conf"
echo "found /etc/modprobe.d/${BLACKLIST_FN}"
else
BLACKLIST_FN="rtlsdr-blacklist.conf"
echo "could not find existing blacklist. will use /etc/modprobe.d/${BLACKLIST_FN}"
fi

if [ -f /etc/modprobe.d/${BLACKLIST_FN} ]; then
cat /etc/modprobe.d/${BLACKLIST_FN} rtlsdr-blacklist.conf | sort | uniq >/dev/shm/${BLACKLIST_FN}
cp /dev/shm/${BLACKLIST_FN} /etc/modprobe.d/${BLACKLIST_FN}
echo "updated /etc/modprobe.d/${BLACKLIST_FN} ; reboot to apply"
else
cp rtlsdr-blacklist.conf /etc/modprobe.d/${BLACKLIST_FN}
echo "created /etc/modprobe.d/${BLACKLIST_FN} ; reboot to apply"
fi

6 changes: 6 additions & 0 deletions rtlsdr-blacklist.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
blacklist dvb_usb_rtl28xxu
blacklist dvb_usb_v2
blacklist rtl_2830
blacklist rtl_2832
blacklist r820t
blacklist rtl8xxxu

0 comments on commit 145144b

Please sign in to comment.