From eeaa52fd62df83ed6795e2139308a0de18afcb03 Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Mon, 12 Dec 2022 01:06:12 +0100 Subject: [PATCH] be less aggrassive on the wifi driver, it is fragile --- bootstrap.sh | 1 + files/rc.local | 8 +------- files/wifi.pl | 9 +-------- files/wifi.sh | 21 --------------------- 4 files changed, 3 insertions(+), 36 deletions(-) delete mode 100755 files/wifi.sh diff --git a/bootstrap.sh b/bootstrap.sh index fa1edec..f3511a8 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -39,6 +39,7 @@ build_rootfs() sudo cp ../../files/wpa.conf etc/wpa_supplicant/wpa_supplicant.conf sudo cp ../../files/rc.local etc/rc.local sudo cp ../../files/30-modeset.conf etc/X11/xorg.conf.d/30-modeset.conf + sudo cp ../../files/blacklist.conf etc/modprobe.d/ sudo bash -c 'chroot . apt update' sudo bash -c 'chroot . apt install -y firmware-linux' diff --git a/files/rc.local b/files/rc.local index 74780d4..cb4e021 100755 --- a/files/rc.local +++ b/files/rc.local @@ -107,13 +107,7 @@ update_wifi_firmware_if_necessary system("sha256sum $firmware_tarball > $firmware_manifest"); system("tar -C /lib/firmware/ -xf $firmware_tarball"); - system('rmmod brcmfmac'); - system('rmmod brcmutil'); - sleep(1); - system('modprobe brcmfmac'); - sleep(1); - system('rmmod brcmfmac'); - sleep(1); + unlink('/etc/modprobe.d/blacklist.conf'); system('modprobe brcmfmac'); } diff --git a/files/wifi.pl b/files/wifi.pl index b914c60..a8cb6c3 100755 --- a/files/wifi.pl +++ b/files/wifi.pl @@ -16,15 +16,8 @@ for my $dev (@vfat_devices) { system("mount -o ro $dev /mnt"); if (-f $firmware_tarball) { system("tar -C /lib/firmware/ -xf $firmware_tarball"); - system('rmmod brcmfmac'); - system('rmmod brcmutil'); - sleep(1); - system('modprobe brcmfmac'); - sleep(1); - system('rmmod brcmfmac'); - sleep(1); + unlink('/etc/modprobe.d/blacklist.conf'); system('modprobe brcmfmac'); } system('umount /mnt'); - } diff --git a/files/wifi.sh b/files/wifi.sh deleted file mode 100755 index 2459de9..0000000 --- a/files/wifi.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -FIRMWARE=/mnt/vendorfw/firmware.tar - -for DEVICE in /dev/nvme0n1p4 /dev/nvme0n1p5 /dev/nvme0n1p6; do - mount -o ro -t vfat $DEVICE /mnt; - if test -f ${FIRMWARE}; then - tar -C /lib/firmware -xf ${FIRMWARE} - rmmod brcmfmac - rmmod brcmutil - sleep 1 - modprobe brcmfmac - sleep 1 - rmmod brcmfmac - sleep 1 - modprobe brcmfmac - umount /mnt - exit - fi - umount /mnt -done -- 2.39.5