From 5af8a85df14f61bfbf99a654aeed34c1c4eb3f69 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 16 Oct 2024 17:19:34 +0200 Subject: [PATCH] v9.8 - ROCK 4 SE | Resolved an issue where WiFi did not work if Bluetooth was disabled. Many thanks to @MidG971 and @c00ldchan for reporting this issue: https://github.com/MichaIng/DietPi/issues/6943 - DietPi-Set_hardware | Do not handle hciuart service on ASUS Tinker Board, when disabling Bluetooth, which we do not handle/start when enabling Bluetooth either. --- CHANGELOG.txt | 1 + dietpi/func/dietpi-set_hardware | 42 +++++++++++++-------------------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a9bd0e76f9..2f495f3614 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -11,6 +11,7 @@ Bug fixes: - NanoPi M3/T3 | Resolved an issue where our recent image did not boot because the bootloader did not define a default device tree path anymore. Many thanks to @rozcietrzewiacz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2630#issuecomment-2322085507 - NanoPi R5S/R5C | Resolved an issue where the Ethernet LEDs did not work on systems upgraded from the legacy Linux 5.10 kernel. Many thanks to @innovodev for reporting this issue: https://dietpi.com/forum/t/21026 - ROCK 4 | Resolved an issue where a false APT component was applied for your APT server, leading to errors and missing kernel/firmware upgrades. Many thanks to @cdlenfert for reporting this issue: https://dietpi.com/forum/t/20771 +- ROCK 4 SE | Resolved an issue where WiFi did not work if Bluetooth was disabled. Many thanks to @MidG971 and @c00ldchan for reporting this issue: https://github.com/MichaIng/DietPi/issues/6943 - Orange Pi 3B/Zero 3/Zero 2W | Resolved an issue where enabling Bluetooth via dietpi-config did not work. Many thanks to @ridhoperdana for reporting this issue: https://dietpi.com/forum/t/18808 - Bullseye | Solved an issue with our Bullseye images, where the FAT setup partition was not detected, preventing import of config files from it, as well as proper root filesystem expansion. Many thanks to @rozcietrzewiacz for reporting this issue and detecting the actual underlying reason for it: https://github.com/MichaIng/DietPi/issues/2630 - DietPi-Drive_Manager | Resolved an issue where formatting the internal eMMC in drive mode on some SBCs, like Odroid N2, failed. Many thanks to @ankagar for reporting this issue: https://dietpi.com/forum/t/20689/33 diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 28c37af28e..f7169c85b9 100755 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1148,40 +1148,36 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// # Bluetooth #///////////////////////////////////////////////////////////////////////////////////// - Bluetooth_Main(){ - + Bluetooth_Main() + { local aBLUETOOTH_MODULES=( - 'bluetooth' 'bnep' 'btbcm' # RPi3 Broadcom onboard 'rfcomm' # BPi Pro/M2+ and others 'hidp' # BPi Pro/M2+ and others - 'hci_uart' ) - [[ $G_HW_MODEL =~ ^(83|87|88)$ ]] && aBLUETOOTH_MODULES+=('sprdbt_tty') # Orange Pi 3B/Zero 3/Zero 2W - - if [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then + case $G_HW_MODEL in + [0-9]) (( $G_HW_ONBOARD_WIFI )) && aBLUETOOTH_MODULES+=('hci_uart');; # RPi. This kernel module is used by other SBCs, but e.g. on ROCK 4 SE it is needed as well for WiFi: https://github.com/MichaIng/DietPi/issues/6943 + 83|87|88) aBLUETOOTH_MODULES+=('sprdbt_tty');; # Orange Pi 3B/Zero 3/Zero 2W + *) :;; + esac + if [[ $INPUT_DEVICE_VALUE == 'disable' ]] + then # RPi - if (( $G_HW_MODEL < 10 )) && (( $G_HW_ONBOARD_WIFI )); then - + if (( $G_HW_MODEL < 10 )) && (( $G_HW_ONBOARD_WIFI )) + then # Do not stop the service, otherwise it cannot be started anymore until reboot. Also for this reason the service is not stopped on pi-bluetooth package removal, hence disabling it on "is-active" via "disable --now" fails due to missing service file: https://github.com/RPi-Distro/pi-bluetooth/issues/34, https://github.com/MichaIng/DietPi/issues/5435 systemctl -q is-enabled hciuart 2> /dev/null && G_EXEC systemctl disable hciuart # Disable onboard Bluetooth via device tree overlay G_CONFIG_INJECT 'dtoverlay=disable-bt' 'dtoverlay=disable-bt' /boot/config.txt - # ASUS TB - elif (( $G_HW_MODEL == 52 )) && systemctl list-unit-files 'hciuart.service' > /dev/null; then - - systemctl -q is-enabled hciuart 2> /dev/null || systemctl -q is-active hciuart && G_EXEC systemctl disable --now hciuart - # Broadcom-based models that need brcm_patchram_plus - elif [[ $G_HW_MODEL == 6[12] ]] && systemctl list-unit-files 'brcm_patchram_plus.service' > /dev/null; then - + elif [[ $G_HW_MODEL == 6[12] ]] && systemctl list-unit-files 'brcm_patchram_plus.service' > /dev/null + then systemctl -q is-enabled brcm_patchram_plus 2> /dev/null || systemctl -q is-active brcm_patchram_plus && G_EXEC systemctl disable --now brcm_patchram_plus - fi systemctl -q is-enabled bluetooth 2> /dev/null || systemctl -q is-active bluetooth && G_EXEC systemctl disable --now bluetooth @@ -1190,7 +1186,7 @@ _EOF_ [[ -f '/etc/modules-load.d/dietpi-enable_bluetooth.conf' ]] && G_EXEC rm /etc/modules-load.d/dietpi-enable_bluetooth.conf # Unload and blacklist kernel modules, bluetooth last - [[ -d '/etc/modprobe.d' ]] || G_EXEC mkdir /etc/modprobe.d + G_EXEC mkdir -p /etc/modprobe.d > /etc/modprobe.d/dietpi-disable_bluetooth.conf for ((i=$(( ${#aBLUETOOTH_MODULES[@]} - 1 )); i>=0; i--)) do @@ -1201,12 +1197,12 @@ _EOF_ # Purge packages if (( $G_DIETPI_INSTALL_STAGE >= 0 )) then - G_AGP bluez bluez-firmware pi-bluetooth rtl8723ds-firmware + G_AGP bluez bluez-firmware pi-bluetooth rtl8723ds-firmware sprd-bluetooth G_AGA fi - elif [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then - + elif [[ $INPUT_DEVICE_VALUE == 'enable' ]] + then # Remove kernel module blacklist [[ -f '/etc/modprobe.d/dietpi-disable_bluetooth.conf' ]] && G_EXEC rm /etc/modprobe.d/dietpi-disable_bluetooth.conf @@ -1262,13 +1258,9 @@ Do you want to continue and disable the serial login console?' || return 1 G_EXEC eval 'echo '\''sprdbt_tty'\'' > /etc/modules-load.d/dietpi-enable_bluetooth.conf' G_AG_CHECK_INSTALL_PREREQ sprd-bluetooth fi - else - Unknown_Input_Mode - fi - } #/////////////////////////////////////////////////////////////////////////////////////