ソースを参照

Remove bluetooth

Bob Mottram 8 年 前
コミット
cb87c06f90
共有1 個のファイルを変更した26 個の追加0 個の削除を含む
  1. 26
    0
      src/freedombone-utils-setup

+ 26
- 0
src/freedombone-utils-setup ファイルの表示

113
     write_config_param USB_DRIVE "$USB_DRIVE"
113
     write_config_param USB_DRIVE "$USB_DRIVE"
114
 }
114
 }
115
 
115
 
116
+function remove_bluetooth {
117
+    rmmod -f bnep
118
+    rmmod -f bluetooth
119
+    if [ -f /etc/default/bluetooth ]; then
120
+        if grep "BLUETOOTH_ENABLED=" /etc/default/bluetooth; then
121
+            sed -i 's|BLUETOOTH_ENABLED=.*|BLUETOOTH_ENABLED=0|g' /etc/default/bluetooth
122
+        else
123
+            echo "BLUETOOTH_ENABLED=0" >> /etc/default/bluetooth
124
+        fi
125
+    fi
126
+    if ! grep 'blacklist bnep' /etc/modprobe.d/bluetooth.conf; then
127
+        echo 'blacklist bnep' >> /etc/modprobe.d/bluetooth.conf
128
+    fi
129
+    if ! grep 'blacklist btusb' /etc/modprobe.d/bluetooth.conf; then
130
+        echo 'blacklist btusb' >> /etc/modprobe.d/bluetooth.conf
131
+    fi
132
+    if ! grep 'blacklist bluetooth' /etc/modprobe.d/bluetooth.conf; then
133
+        echo 'blacklist bluetooth' >> /etc/modprobe.d/bluetooth.conf
134
+    fi
135
+    update-initramfs -u -k `uname -r` -v
136
+    update-rc.d bluetooth remove
137
+}
138
+
116
 function running_as_root {
139
 function running_as_root {
117
     if [[ $EUID != 0 ]] ; then
140
     if [[ $EUID != 0 ]] ; then
118
         echo "0"
141
         echo "0"
353
     read_config_param "PROJECT_REPO"
376
     read_config_param "PROJECT_REPO"
354
     write_config_param "PROJECT_REPO" "$PROJECT_REPO"
377
     write_config_param "PROJECT_REPO" "$PROJECT_REPO"
355
 
378
 
379
+    function_check remove_bluetooth
380
+    remove_bluetooth
381
+
356
     function_check turn_off_rsys_logging
382
     function_check turn_off_rsys_logging
357
     turn_off_rsys_logging
383
     turn_off_rsys_logging
358
 
384