Skip to content

Commit

Permalink
Store un-renamed firmware as firmware-raw.tar.gz
Browse files Browse the repository at this point in the history
  • Loading branch information
sharpenedblade committed Jun 14, 2024
1 parent e987ca4 commit ce61da3
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions docs/tools/firmware.sh
Original file line number Diff line number Diff line change
Expand Up @@ -712,8 +712,8 @@ case "$os" in
EFILABEL=$(diskutil info disk0s1 | grep "Volume Name" | cut -d ":" -f 2 | xargs)
sudo diskutil mount disk0s1
echo "Getting Wi-Fi and Bluetooth firmware"
tar ${verbose} -cf "/Volumes/${EFILABEL}/firmware.tar" -C /usr/share/firmware/ .
gzip ${verbose} --best "/Volumes/${EFILABEL}/firmware.tar"
tar ${verbose} -cf "/Volumes/${EFILABEL}/firmware-raw.tar" -C /usr/share/firmware/ .
gzip ${verbose} --best "/Volumes/${EFILABEL}/firmware-raw.tar"
if [[ (${identifier} = iMac19,1) || (${identifier} = iMac19,2) || (${identifier} = iMacPro1,1) ]]
then
nvramfile=$(ioreg -l | grep RequestedFiles | cut -d "/" -f 5 | rev | cut -c 4- | rev)
Expand Down Expand Up @@ -815,19 +815,11 @@ case "$os" in
workdir=$(mktemp -d)
echo "Installing Wi-Fi and Bluetooth firmware"
sudo mount ${verbose} /dev/nvme0n1p1 "$mountpoint"
sudo tar --warning=no-unknown-keyword ${verbose} -xC "${workdir}" -f "$mountpoint/firmware.tar.gz"
sudo tar --warning=no-unknown-keyword ${verbose} -xC "${workdir}" -f "$mountpoint/firmware-raw.tar.gz"
create_firmware_archive "${workdir}" "${workdir}/firmware-renamed.tar" ${verbose}

sudo tar ${verbose} -xC /lib/firmware/brcm -f "${workdir}/firmware-renamed.tar"

for file in "$mountpoint/brcmfmac4364b2-pcie.txt" \
"$mountpoint/brcmfmac4364b2-pcie.txcap_blob"
do
if [ -f "$file" ]
then
sudo cp ${verbose} "$file" /lib/firmware/brcm
fi
done
reload_kernel_modules
echo "Keeping a copy of the firmware and the script in the EFI partition shall allow you to set up Wi-Fi again in the future by running this script or the commands told in the macOS step in Linux only, without the macOS step."
read -rp "Do you want to keep a copy? (y/N)" input
Expand Down Expand Up @@ -956,5 +948,3 @@ case "$os" in
;;
esac
exit 0


0 comments on commit ce61da3

Please sign in to comment.