From b575ea62d6ea87b1d302aecc7bae149481848bb5 Mon Sep 17 00:00:00 2001 From: Aditya Garg <85610623+AdityaGarg8@users.noreply.github.com> Date: Thu, 30 May 2024 16:16:46 +0530 Subject: [PATCH] Use tar to copy firmware and avoid breaking symlinks --- docs/tools/firmware.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/tools/firmware.sh b/docs/tools/firmware.sh index c19adeed6..0d7c2db4e 100755 --- a/docs/tools/firmware.sh +++ b/docs/tools/firmware.sh @@ -535,11 +535,13 @@ case "$os" in sudo umount ${verbose} ${loopdevice} sudo rm -r ${verbose} ${imgdir} sudo losetup -d /dev/loop50 + sudo rm -r ${verbose} ${fwdir} } echo -e "\nDownloading macOS Recovery Image" workdir=$(mktemp -d) imgdir=$(mktemp -d) + fwdir=$(mktemp -d) cd ${workdir} if [[ ${verbose} = -v ]] then @@ -562,7 +564,9 @@ case "$os" in sudo mount ${verbose} ${loopdevice} ${imgdir} echo "Getting firmware" cd - >/dev/null - python3 "$0" ${imgdir}/usr/share/firmware ${workdir}/firmware-renamed.tar ${verbose} || (echo -e "\nCouldn't extract firmware. Try choosing some other macOS version (should be Monterey or later). If error still persists, try restarting your Mac and then run the script again." && cleanup_dmg && exit 1) + tar ${verbose} -cf ${workdir}/firmware.tar -C ${imgdir}/usr/share/firmware . + tar --warning=no-unknown-keyword ${verbose} -xC ${fwdir} -f ${workdir}/firmware.tar + python3 "$0" ${fwdir} ${workdir}/firmware-renamed.tar ${verbose} || (echo -e "\nCouldn't extract firmware. Try choosing some other macOS version (should be Monterey or later). If error still persists, try restarting your Mac and then run the script again." && cleanup_dmg && exit 1) sudo tar ${verbose} -xC /lib/firmware/brcm -f ${workdir}/firmware-renamed.tar echo "Reloading Wi-Fi and Bluetooth drivers" sudo modprobe -r brcmfmac_wcc || true @@ -768,8 +772,6 @@ class WiFiFWCollection(object): for dim in self.DIMS: if dim in props: ident.append(props.pop(dim)) - if props: - log.warning(f"Ignoring unexpected properties in {idpath}: {props}") assert not props node = self.root