install-wifi-firlwares: stop using haiku-files.org

- Move the firmwares to github
- Move broadcom fwcutter to a package

Fixes #11841
This commit is contained in:
Adrien Destugues 2020-08-04 10:45:18 +02:00
parent b4b9e2089f
commit daf10ef340

View File

@ -31,7 +31,7 @@ VIEW='View licenses'
ABORT='Abort installation'
OK='I agree to the licenses. Install firmwares.'
baseURL='http://www.haiku-files.org/files/wifi-firmwares'
baseURL='https://raw.githubusercontent.com/haiku/firmware/master/wifi/'
firmwareDir=`finddir B_SYSTEM_DATA_DIRECTORY`/firmware
tempDir=`finddir B_SYSTEM_TEMP_DIRECTORY`/wifi-firmwares
driversDir=`finddir B_SYSTEM_ADDONS_DIRECTORY`/kernel/drivers
@ -195,7 +195,7 @@ function InstallBroadcom43xx()
driver='broadcom43xx'
PreFirmwareInstallation
BuildBroadcomFWCutter
pkgman install -y cmd:b43_fwcutter
returnCode=$?
if [ $returnCode -gt 0 ] ; then
echo "...failed. ${driver}'s firmware will not be installed."
@ -242,64 +242,6 @@ function InstallMarvell88w8335()
}
function BuildBroadcomFWCutter()
{
# Download & extract b43-fwcutter.
local file="b43-fwcutter-012.tar.bz2"
local dir="${tempFirmwareDir}/${driver}/b43-fwcutter"
local url="${baseURL}/b43/fwcutter/${file}"
DownloadFileIfNotCached $url $file $dir
if [ $result -gt 0 ]; then
return $result
fi
# Extract archive.
cd "$tempDir"
tar xjf "$dir/$file"
# Download additonal files for building b43-fwcutter.
cd b43-fwcutter-012
local baseURL='https://git.haiku-os.org/haiku/plain/src/system/libroot/posix/glibc'
DownloadFileIfNotCached ${baseURL}/string/byteswap.h?id=c039c51d778367e9aa15db18d185e9d627706b46 byteswap.h $dir
if [ $result -gt 0 ]; then
return $result
fi
DownloadFileIfNotCached ${baseURL}/include/arch/x86/bits/byteswap.h?id=c039c51d778367e9aa15db18d185e9d627706b46 byteswap.h $dir/bits
if [ $result -gt 0 ]; then
return $result
fi
# Copy those files to working directory.
mkdir -p bits
cp $dir/byteswap.h .
cp $dir/bits/byteswap.h bits/
# Build b43-fwcutter.
echo "Compiling b43-fwcutter for installing Broadcom's firmware ..."
make PREFIX=/boot/system CFLAGS="-I. -Wall" >/dev/null 2>&1
result=$?
if [ $result -gt 0 ]; then
echo "... failed to compile b43-fwcutter."
else
echo "... successfully compiled b43-fwcutter."
fi
if [ ! -e b43-fwcutter ] ; then
return 1
fi
mv b43-fwcutter "$tempDir"
cd "${tempFirmwareDir}/${driver}/b43-fwcutter"
rm b43-fwcutter-012.tar.bz2
rm byteswap.h
rm bits/byteswap.h
rmdir bits
cd ..
rmdir b43-fwcutter
return 0
}
function CutAndInstallBroadcomFirmware()
{
# Download firmware.