From 7cdcf997a62bad5dbd7a1a1c4b54cfb861876368 Mon Sep 17 00:00:00 2001 From: Aditya Garg Date: Sun, 2 Jun 2024 21:56:03 +0530 Subject: [PATCH 01/15] Firmware: Add icons --- docs/guides/wifi-bluetooth.md | 16 ++++++++-------- mkdocs.yml | 4 ++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/guides/wifi-bluetooth.md b/docs/guides/wifi-bluetooth.md index dce83361..45f73150 100644 --- a/docs/guides/wifi-bluetooth.md +++ b/docs/guides/wifi-bluetooth.md @@ -35,7 +35,7 @@ There are 4 methods supported by this script to get firmware for Linux, named as Run the script on the macOS terminal. After you run the script, it will ask you to choose between 3 methods to move firmware to Linux: -=== "Method 1" +=== ":simple-apple: Method 1" **Method 1: Run the same script on Linux** If you choose this method, unlike **Method 2** and **Method 3**, you need not have any specific dependency already installed on your Mac. So if you don't want to install any additional software on macOS, this method is the only option for you. @@ -44,7 +44,7 @@ Run the script on the macOS terminal. After you run the script, it will ask you To retrieve the firmware from **EFI** partition in Linux, you shall have to run the same script on Linux. You have 2 options do so, described in detail in [On Linux](#on-linux) section. -=== "Method 2" +=== ":simple-apple: Method 2" **Method 2: Create a tarball of the firmware and extract it to Linux** If you choose this method, the script will install the following dependencies, if missing, on macOS: @@ -57,7 +57,7 @@ Run the script on the macOS terminal. After you run the script, it will ask you Now you have to extract the firmware in the tarball to Linux. The procedure has been described in detail in [On Linux](#on-linux) section. -=== "Method 3" +=== ":simple-apple: Method 3" **Method 3: Create a Linux specific package which can be installed using a package manager** If you choose this method, the script will install the following dependencies, if missing, on macOS: @@ -74,7 +74,7 @@ Run the script on the macOS terminal. After you run the script, it will ask you Now you have to install the package in Linux using your package manager. The procedure has been described in detail in [On Linux](#on-linux) section. -=== "Method 4" +=== ":simple-apple: Method 4" **Method 4: Download a macOS Recovery Image from Apple and extract the firmware from there** This method does not have any steps to be followed on macOS. See [On Linux](#on-linux) section. @@ -83,7 +83,7 @@ Run the script on the macOS terminal. After you run the script, it will ask you Once you have run the script on macOS, depending on the method you chose, the steps to be followed on Linux are described below: -=== "Method 1" +=== ":simple-linux: Method 1" **Method 1: Run the same script on Linux** Now we need to retrieve the firmware from the **EFI** partition. You further have 2 options to do so: @@ -117,7 +117,7 @@ Once you have run the script on macOS, depending on the method you chose, the st This option shall be useful if you are unable to copy the script to Linux. -=== "Method 2" +=== ":simple-linux: Method 2" **Method 2: Create a tarball of the firmware and extract it to Linux** Now we shall extract the tarball of the firmware which was saved in the **Downloads** folder in macOS as `firmware.tar`. In order to do so, copy `firmware.tar` to Linux and extract the firmware to `/lib/firmware/brcm` by running: @@ -140,7 +140,7 @@ Once you have run the script on macOS, depending on the method you chose, the st sudo modprobe hci_bcm4377 ``` -=== "Method 3" +=== ":simple-linux: Method 3" **Method 3: Create a Linux specific package which can be installed using a package manager** Now we have to install the firmware package which was saved in the **Downloads** folder in macOS. Copy the package to Linux and follow the instructions below, depending on whether you use `apt`, `dnf` or `rpm`: @@ -187,7 +187,7 @@ Once you have run the script on macOS, depending on the method you chose, the st Replace `/path/to/firmware_package.pkg.tar.zst` with the actual path of the package. For example, if `apple-firmware-14.5-1-any.pkg.tar.zst` was created in macOS and has been copied to the Downloads folder in Linux, command to be run would be `sudo pacman -U $HOME/Downloads/apple-firmware-14.5-1-any.pkg.tar.zst` -=== "Method 4" +=== ":simple-linux: Method 4" **Method 4: Download a macOS Recovery Image from Apple and extract the firmware from there** !!! warning "Internet connection is required for **Method 4**" diff --git a/mkdocs.yml b/mkdocs.yml index 71cedb59..8f015bb7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -35,6 +35,10 @@ markdown_extensions: permalink: true - admonition - pymdownx.details + - attr_list + - pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg plugins: - redirects: From 3ab33c445830e95663b263669c2a6ed53ad58324 Mon Sep 17 00:00:00 2001 From: Aditya Garg <85610623+AdityaGarg8@users.noreply.github.com> Date: Sun, 2 Jun 2024 21:59:10 +0530 Subject: [PATCH 02/15] Add files via upload --- docs/guides/wifi-bluetooth.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/guides/wifi-bluetooth.md b/docs/guides/wifi-bluetooth.md index 45f73150..ef73fed0 100644 --- a/docs/guides/wifi-bluetooth.md +++ b/docs/guides/wifi-bluetooth.md @@ -35,7 +35,7 @@ There are 4 methods supported by this script to get firmware for Linux, named as Run the script on the macOS terminal. After you run the script, it will ask you to choose between 3 methods to move firmware to Linux: -=== ":simple-apple: Method 1" +=== ":fontawesome-brands-apple: Method 1" **Method 1: Run the same script on Linux** If you choose this method, unlike **Method 2** and **Method 3**, you need not have any specific dependency already installed on your Mac. So if you don't want to install any additional software on macOS, this method is the only option for you. @@ -44,7 +44,7 @@ Run the script on the macOS terminal. After you run the script, it will ask you To retrieve the firmware from **EFI** partition in Linux, you shall have to run the same script on Linux. You have 2 options do so, described in detail in [On Linux](#on-linux) section. -=== ":simple-apple: Method 2" +=== ":fontawesome-brands-apple: Method 2" **Method 2: Create a tarball of the firmware and extract it to Linux** If you choose this method, the script will install the following dependencies, if missing, on macOS: @@ -57,7 +57,7 @@ Run the script on the macOS terminal. After you run the script, it will ask you Now you have to extract the firmware in the tarball to Linux. The procedure has been described in detail in [On Linux](#on-linux) section. -=== ":simple-apple: Method 3" +=== ":fontawesome-brands-apple: Method 3" **Method 3: Create a Linux specific package which can be installed using a package manager** If you choose this method, the script will install the following dependencies, if missing, on macOS: @@ -74,7 +74,7 @@ Run the script on the macOS terminal. After you run the script, it will ask you Now you have to install the package in Linux using your package manager. The procedure has been described in detail in [On Linux](#on-linux) section. -=== ":simple-apple: Method 4" +=== ":fontawesome-brands-apple: Method 4" **Method 4: Download a macOS Recovery Image from Apple and extract the firmware from there** This method does not have any steps to be followed on macOS. See [On Linux](#on-linux) section. @@ -83,7 +83,7 @@ Run the script on the macOS terminal. After you run the script, it will ask you Once you have run the script on macOS, depending on the method you chose, the steps to be followed on Linux are described below: -=== ":simple-linux: Method 1" +=== ":fontawesome-brands-linux: Method 1" **Method 1: Run the same script on Linux** Now we need to retrieve the firmware from the **EFI** partition. You further have 2 options to do so: @@ -117,7 +117,7 @@ Once you have run the script on macOS, depending on the method you chose, the st This option shall be useful if you are unable to copy the script to Linux. -=== ":simple-linux: Method 2" +=== ":fontawesome-brands-linux: Method 2" **Method 2: Create a tarball of the firmware and extract it to Linux** Now we shall extract the tarball of the firmware which was saved in the **Downloads** folder in macOS as `firmware.tar`. In order to do so, copy `firmware.tar` to Linux and extract the firmware to `/lib/firmware/brcm` by running: @@ -140,7 +140,7 @@ Once you have run the script on macOS, depending on the method you chose, the st sudo modprobe hci_bcm4377 ``` -=== ":simple-linux: Method 3" +=== ":fontawesome-brands-linux: Method 3" **Method 3: Create a Linux specific package which can be installed using a package manager** Now we have to install the firmware package which was saved in the **Downloads** folder in macOS. Copy the package to Linux and follow the instructions below, depending on whether you use `apt`, `dnf` or `rpm`: @@ -187,7 +187,7 @@ Once you have run the script on macOS, depending on the method you chose, the st Replace `/path/to/firmware_package.pkg.tar.zst` with the actual path of the package. For example, if `apple-firmware-14.5-1-any.pkg.tar.zst` was created in macOS and has been copied to the Downloads folder in Linux, command to be run would be `sudo pacman -U $HOME/Downloads/apple-firmware-14.5-1-any.pkg.tar.zst` -=== ":simple-linux: Method 4" +=== ":fontawesome-brands-linux: Method 4" **Method 4: Download a macOS Recovery Image from Apple and extract the firmware from there** !!! warning "Internet connection is required for **Method 4**" From 093fbb11e8d9d456fceb6a6a6866efbb7c19814d Mon Sep 17 00:00:00 2001 From: Aditya Garg <85610623+AdityaGarg8@users.noreply.github.com> Date: Sun, 2 Jun 2024 23:19:50 +0530 Subject: [PATCH 03/15] Update wifi-bluetooth.md --- docs/guides/wifi-bluetooth.md | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/docs/guides/wifi-bluetooth.md b/docs/guides/wifi-bluetooth.md index ef73fed0..8262cbd1 100644 --- a/docs/guides/wifi-bluetooth.md +++ b/docs/guides/wifi-bluetooth.md @@ -222,27 +222,3 @@ Dec 24 22:34:20 hostname kernel: brcmfmac: brcmf_c_process_txcap_blob: TxCap blo Dec 24 22:34:20 hostname kernel: brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4377/4 wl0: Jul 16 2021 18:25:13 version 16.20.328.0.3.6.105 FWID 01-30be2b3a Dec 24 22:34:20 hostname kernel: brcmfmac 0000:01:00.0 wlp1s0f0: renamed from wlan0 ``` - -## Fixing unstable WPA2 using iwd - -Using iwd is technically not needed for using Wi-Fi. But if you are facing unstable WPA2 issues and have to reload the Wi-Fi driver every time you connect to a WPA2 network, you will have to follow this section. If your connection is stable, you needn't follow this section. - -Instructions in this section might be different for the distribution that you are trying to install. - -1. To get WPA2 to work stably, install the `iwd` package (for example `sudo apt install iwd` on Ubuntu). - -2. Edit `/etc/NetworkManager/NetworkManager.conf` to look like the following: - - ```ini - [device] - wifi.backend=iwd - ``` - -3. Set iwd to run on boot with the following commands (assuming that you are using systemd). - - ```sh - sudo systemctl enable --now iwd - sudo systemctl restart NetworkManager - ``` - -If you Wi-Fi disconnects or has issues otherwise its advised to restart iwd: `sudo systemctl restart iwd`, or reprobe the Wi-Fi kernel module: `sudo modprobe -r brcmfmac_wcc && sudo modprobe -r brcmfmac && sudo modprobe brcmfmac`. From 8c23b09ea279ba6a200a113f5ad4a159f695f74e Mon Sep 17 00:00:00 2001 From: Aditya Garg <85610623+AdityaGarg8@users.noreply.github.com> Date: Tue, 4 Jun 2024 20:34:59 +0530 Subject: [PATCH 04/15] Add ability to extract firmware directly from macOS --- docs/tools/firmware.sh | 90 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 89 insertions(+), 1 deletion(-) diff --git a/docs/tools/firmware.sh b/docs/tools/firmware.sh index 13922eb5..7682f629 100755 --- a/docs/tools/firmware.sh +++ b/docs/tools/firmware.sh @@ -363,6 +363,47 @@ dmg2img_check () { fi } +apfs_install () { + echo -e "\nAPFS driver missing!" + detect_package_manager + echo + apfs_driver_link=https://github.com/linux-apfs/linux-apfs-rw.git + if [[ ${PACKAGE_MANAGER} = "NONE" ]] + then + read -p "The script could not detect your package manager. Please install the APFS driver manually from ${apfs_driver_link} and press enter once you have it installed." + else + read -p "Press enter to install the APFS driver via ${PACKAGE_MANAGER}. Alternatively you can terminate this script by pressing Control+C and install it yourself from ${apfs_driver_link}." + echo -e "\nInstalling the APFS driver" + case ${PACKAGE_MANAGER} in + (apt) + sudo apt update + sudo apt install -y apfs-dkms + ;; + (dnf) + sudo dnf install -y dnf-plugins-core + sudo dnf -y copr enable sharpenedblade/t2linux + sudo dnf install -y linux-apfs-rw-kmod + echo -e "\nStarting akmods\n" + sudo akmods + ;; + (pacman) + apfsdir=$(mktemp -d) + cd ${apfsdir} + sudo pacman -Sy --noconfirm git base-devel + git clone https://aur.archlinux.org/linux-apfs-rw-dkms-git.git ${apfsdir} + makepkg -si --noconfirm + cd - >/dev/null + sudo rm -r ${apfsdir} + ;; + (*) + echo -e "\nUnknown error" + exit 1 + ;; + esac + fi + sudo modprobe apfs && echo "APFS driver loaded successfully!" || (echo "APFS driver could not be loaded. Try again after restarting your Mac, or use some other method to get the firmware" && exit 1) +} + os=$(uname -s) case "$os" in (Darwin) @@ -485,7 +526,8 @@ case "$os" in fi echo -e "\nHow do you want to copy the firmware to Linux?" echo -e "\n1. Retrieve the firmware from EFI." - echo "2. Download a macOS Recovery Image from Apple and extract the firmware from there." + echo "2. Retrieve the firmware directly from macOS." + echo "3. Download a macOS Recovery Image from Apple and extract the firmware from there." echo -e "\nNote: If you are choosing Option 1, then make sure you have run the same script on macOS before and chose Option 1 (Run the same script on Linux) there." read choice case ${choice} in @@ -536,6 +578,52 @@ case "$os" in echo -e "\nDone!" ;; (2) + # Detect whether dmg2img are installed + dmg2img_check + # Load the apfs driver, and install if missing + sudo modprobe apfs >/dev/null 2>&1 || apfs_install + unmount_macos_and_cleanup () { + sudo rm -r ${verbose} ${workdir} || true + sudo umount ${verbose} ${loopdevice} || true + sudo umount ${verbose} ${macosvol} || true + sudo rm -r ${verbose} ${imgdir} || true + sudo rm -r ${verbose} ${macosdir} || true + sudo losetup -d /dev/loop50 || true + } + + echo -e "\nMounting the macOS volume" + workdir=$(mktemp -d) + imgdir=$(mktemp -d) + macosdir=$(mktemp -d) + macosvol=/dev/$(lsblk -o NAME,FSTYPE | grep nvme0n1 | grep apfs | head -1 | awk '{print $1'} | rev | cut -c -9 | rev) + sudo mount ${verbose} -o vol=2 ${macosvol} ${macosdir} + echo "Converting macOS Recovery Image from .dmg to .img" + cd ${workdir} + if [[ ${verbose} = -v ]] + then + dmg2img -v ${macosdir}/*/BaseSystem.dmg fw.img || unmount_macos_and_cleanup + else + dmg2img -s ${macosdir}/*/BaseSystem.dmg fw.img || unmount_macos_and_cleanup + fi + echo "Mounting image" + sudo losetup -P loop50 fw.img + loopdevice=/dev/$(lsblk -o KNAME,TYPE,MOUNTPOINT -n | grep loop50 | tail -1 | awk '{print $1}') + sudo mount ${verbose} ${loopdevice} ${imgdir} || unmount_macos_and_cleanup + cd - >/dev/null + echo "Getting firmware" + python3 "$0" ${imgdir}/usr/share/firmware ${workdir}/firmware-renamed.tar ${verbose} || (echo -e "\nCouldn't extract firmware. Try running the script again. If error still persists, try restarting your Mac and then run the script again, or choose some other method." && unmount_macos_and_cleanup && 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 + sudo modprobe -r brcmfmac || true + sudo modprobe brcmfmac || true + sudo modprobe -r hci_bcm4377 || true + sudo modprobe hci_bcm4377 || true + echo "Cleaning up" + unmount_macos_and_cleanup + echo "Done!" + ;; + (3) # Detect whether curl and dmg2img are installed curl_check dmg2img_check From d1b9f70066dfd11ce48377c9c12eb3e26d1c0467 Mon Sep 17 00:00:00 2001 From: Aditya Garg <85610623+AdityaGarg8@users.noreply.github.com> Date: Tue, 4 Jun 2024 21:44:54 +0530 Subject: [PATCH 05/15] Update firmware.sh --- docs/tools/firmware.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tools/firmware.sh b/docs/tools/firmware.sh index 7682f629..f199b14f 100755 --- a/docs/tools/firmware.sh +++ b/docs/tools/firmware.sh @@ -351,7 +351,7 @@ dmg2img_check () { git clone https://aur.archlinux.org/dmg2img.git ${dmg2imgdir} makepkg -si --noconfirm cd - >/dev/null - sudo rm -r ${dmg2imgdir} + sudo rm -r ${verbose} ${dmg2imgdir} ;; (*) echo -e "\nUnknown error" @@ -393,7 +393,7 @@ apfs_install () { git clone https://aur.archlinux.org/linux-apfs-rw-dkms-git.git ${apfsdir} makepkg -si --noconfirm cd - >/dev/null - sudo rm -r ${apfsdir} + sudo rm -r ${verbose} ${apfsdir} ;; (*) echo -e "\nUnknown error" From ae39fce9ee6634cac936d87739fd4c90725e85fc Mon Sep 17 00:00:00 2001 From: Aditya Garg <85610623+AdityaGarg8@users.noreply.github.com> Date: Tue, 4 Jun 2024 22:46:15 +0530 Subject: [PATCH 06/15] Add files via upload --- docs/tools/firmware.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tools/firmware.sh b/docs/tools/firmware.sh index f199b14f..7885c004 100755 --- a/docs/tools/firmware.sh +++ b/docs/tools/firmware.sh @@ -401,7 +401,7 @@ apfs_install () { ;; esac fi - sudo modprobe apfs && echo "APFS driver loaded successfully!" || (echo "APFS driver could not be loaded. Try again after restarting your Mac, or use some other method to get the firmware" && exit 1) + sudo modprobe apfs && echo "APFS driver loaded successfully!" || (echo -e "\nAPFS driver could not be loaded. Make sure you have the kernel headers installed. If you are still facing the issue, try again after restarting your Mac, or use some other method to get the firmware" && exit 1) } os=$(uname -s) From b95be27265e3b81c5a26da2bc0dfc50c2e6b8f71 Mon Sep 17 00:00:00 2001 From: Aditya Garg <85610623+AdityaGarg8@users.noreply.github.com> Date: Wed, 5 Jun 2024 17:18:29 +0530 Subject: [PATCH 07/15] Do the requested changes --- docs/tools/firmware.sh | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/docs/tools/firmware.sh b/docs/tools/firmware.sh index 7885c004..7398a6f7 100755 --- a/docs/tools/firmware.sh +++ b/docs/tools/firmware.sh @@ -380,10 +380,9 @@ apfs_install () { sudo apt install -y apfs-dkms ;; (dnf) - sudo dnf install -y dnf-plugins-core sudo dnf -y copr enable sharpenedblade/t2linux - sudo dnf install -y linux-apfs-rw-kmod - echo -e "\nStarting akmods\n" + sudo dnf install -y linux-apfs-rw + echo -e "\nRunning akmods\n" sudo akmods ;; (pacman) @@ -401,7 +400,7 @@ apfs_install () { ;; esac fi - sudo modprobe apfs && echo "APFS driver loaded successfully!" || (echo -e "\nAPFS driver could not be loaded. Make sure you have the kernel headers installed. If you are still facing the issue, try again after restarting your Mac, or use some other method to get the firmware" && exit 1) + sudo modprobe apfs && echo -e "\nAPFS driver loaded successfully!" || (echo -e "\nAPFS driver could not be loaded. Make sure you have the kernel headers installed. If you are still facing the issue, try again after restarting your Mac, or use some other method to get the firmware" && exit 1) } os=$(uname -s) @@ -426,7 +425,7 @@ case "$os" in EOF fi echo -e "\nHow do you want to copy the firmware to Linux?" - echo -e "\n1. Run the same script on Linux." + echo -e "\n1. Copy the firmware to the EFI partition and run the same script on Linux to retrieve it." echo "2. Create a tarball of the firmware and extract it to Linux." echo "3. Create a Linux specific package which can be installed using a package manager." echo -e "\nNote: Option 2 and 3 require additional software like python3 and tools specific for your package manager. Requirements will be told as you proceed further." @@ -525,7 +524,7 @@ case "$os" in exit 1 fi echo -e "\nHow do you want to copy the firmware to Linux?" - echo -e "\n1. Retrieve the firmware from EFI." + echo -e "\n1. Retrieve the firmware from the EFI partition." echo "2. Retrieve the firmware directly from macOS." echo "3. Download a macOS Recovery Image from Apple and extract the firmware from there." echo -e "\nNote: If you are choosing Option 1, then make sure you have run the same script on macOS before and chose Option 1 (Run the same script on Linux) there." @@ -579,6 +578,7 @@ case "$os" in ;; (2) # Detect whether dmg2img are installed + echo -e "\nChecking for missing dependencies" dmg2img_check # Load the apfs driver, and install if missing sudo modprobe apfs >/dev/null 2>&1 || apfs_install @@ -588,7 +588,7 @@ case "$os" in sudo umount ${verbose} ${macosvol} || true sudo rm -r ${verbose} ${imgdir} || true sudo rm -r ${verbose} ${macosdir} || true - sudo losetup -d /dev/loop50 || true + sudo losetup -d /dev/${loopdev} || true } echo -e "\nMounting the macOS volume" @@ -606,8 +606,9 @@ case "$os" in dmg2img -s ${macosdir}/*/BaseSystem.dmg fw.img || unmount_macos_and_cleanup fi echo "Mounting image" - sudo losetup -P loop50 fw.img - loopdevice=/dev/$(lsblk -o KNAME,TYPE,MOUNTPOINT -n | grep loop50 | tail -1 | awk '{print $1}') + loopdev=$(losetup -f | cut -d "/" -f 3) + sudo losetup -P ${loopdev} fw.img + loopdevice=/dev/$(lsblk -o KNAME,TYPE,MOUNTPOINT -n | grep ${loopdev} | tail -1 | awk '{print $1}') sudo mount ${verbose} ${loopdevice} ${imgdir} || unmount_macos_and_cleanup cd - >/dev/null echo "Getting firmware" @@ -625,13 +626,14 @@ case "$os" in ;; (3) # Detect whether curl and dmg2img are installed + echo -e "\nChecking for missing dependencies" curl_check dmg2img_check cleanup_dmg () { sudo rm -r ${verbose} ${workdir} sudo umount ${verbose} ${loopdevice} sudo rm -r ${verbose} ${imgdir} - sudo losetup -d /dev/loop50 + sudo losetup -d /dev/${loopdev} } echo -e "\nDownloading macOS Recovery Image" @@ -654,8 +656,9 @@ case "$os" in dmg2img -s BaseSystem.dmg fw.img fi echo "Mounting image" - sudo losetup -P loop50 fw.img - loopdevice=/dev/$(lsblk -o KNAME,TYPE,MOUNTPOINT -n | grep loop50 | tail -1 | awk '{print $1}') + loopdev=$(losetup -f | cut -d "/" -f 3) + sudo losetup -P ${loopdev} fw.img + loopdevice=/dev/$(lsblk -o KNAME,TYPE,MOUNTPOINT -n | grep ${loopdev} | tail -1 | awk '{print $1}') sudo mount ${verbose} ${loopdevice} ${imgdir} echo "Getting firmware" cd - >/dev/null From 3607fa45a5362f038c07c9d6503a22349bf916ae Mon Sep 17 00:00:00 2001 From: Aditya Garg <85610623+AdityaGarg8@users.noreply.github.com> Date: Wed, 5 Jun 2024 17:20:05 +0530 Subject: [PATCH 08/15] Update wifi-bluetooth.md --- docs/guides/wifi-bluetooth.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides/wifi-bluetooth.md b/docs/guides/wifi-bluetooth.md index 8262cbd1..f5ea795b 100644 --- a/docs/guides/wifi-bluetooth.md +++ b/docs/guides/wifi-bluetooth.md @@ -36,7 +36,7 @@ There are 4 methods supported by this script to get firmware for Linux, named as Run the script on the macOS terminal. After you run the script, it will ask you to choose between 3 methods to move firmware to Linux: === ":fontawesome-brands-apple: Method 1" - **Method 1: Run the same script on Linux** + **Method 1: Copy the firmware to the EFI partition and run the same script on Linux to retrieve it** If you choose this method, unlike **Method 2** and **Method 3**, you need not have any specific dependency already installed on your Mac. So if you don't want to install any additional software on macOS, this method is the only option for you. @@ -84,7 +84,7 @@ Run the script on the macOS terminal. After you run the script, it will ask you Once you have run the script on macOS, depending on the method you chose, the steps to be followed on Linux are described below: === ":fontawesome-brands-linux: Method 1" - **Method 1: Run the same script on Linux** + **Method 1: Copy the firmware to the EFI partition and run the same script on Linux to retrieve it** Now we need to retrieve the firmware from the **EFI** partition. You further have 2 options to do so: From aec5df20754f57ed8451599eb3405b8931f665f6 Mon Sep 17 00:00:00 2001 From: Aditya Garg <85610623+AdityaGarg8@users.noreply.github.com> Date: Thu, 6 Jun 2024 13:30:34 +0530 Subject: [PATCH 09/15] Wiki updates --- docs/guides/wifi-bluetooth.md | 37 ++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/docs/guides/wifi-bluetooth.md b/docs/guides/wifi-bluetooth.md index f5ea795b..27b37668 100644 --- a/docs/guides/wifi-bluetooth.md +++ b/docs/guides/wifi-bluetooth.md @@ -26,7 +26,7 @@ There are 4 methods supported by this script to get firmware for Linux, named as **Method 1-3** require macOS installed on your Mac. The initial steps of these methods are to be followed on macOS, and later steps have to be followed on Linux. Thus, if you choose one of these methods, you first need to follow the [On macOS](#on-macos) section and then proceed to the [On Linux](#on-linux) section. -**Method 4** does not require macOS, so you can directly follow the [On Linux](#on-linux) section if you choose it. +**Method 4-5** do not require macOS, so you can directly follow the [On Linux](#on-linux) section if you choose them. !!! Tip "macOS Removed after installing Linux" In case you have removed macOS after installing Linux, and need the firmware, **Method 4** is the only option for you. @@ -75,7 +75,12 @@ Run the script on the macOS terminal. After you run the script, it will ask you Now you have to install the package in Linux using your package manager. The procedure has been described in detail in [On Linux](#on-linux) section. === ":fontawesome-brands-apple: Method 4" - **Method 4: Download a macOS Recovery Image from Apple and extract the firmware from there** + **Method 4: Retrieve the firmware directly from macOS** + + This method does not have any steps to be followed on macOS. See [On Linux](#on-linux) section. + +=== ":fontawesome-brands-apple: Method 5" + **Method 5: Download a macOS Recovery Image from Apple and extract the firmware from there** This method does not have any steps to be followed on macOS. See [On Linux](#on-linux) section. @@ -96,7 +101,7 @@ Once you have run the script on macOS, depending on the method you chose, the st bash /path/to/firmware.sh ``` - After you run the script, you have to choose the **"Retrieve the firmware from EFI"** option. After choosing that option, the script will install the firmware on Linux. + After you run the script, you have to choose the **"Retrieve the firmware from the EFI partition"** option. After choosing that option, the script will install the firmware on Linux. !!! note @@ -113,7 +118,7 @@ Once you have run the script on macOS, depending on the method you chose, the st sudo umount /tmp/apple-wifi-efi ``` - After you run the above commands, you have to choose the **"Retrieve the firmware from EFI"** option. After choosing that option, the script will install the firmware on Linux. + After you run the above commands, you have to choose the **"Retrieve the firmware from the EFI partition"** option. After choosing that option, the script will install the firmware on Linux. This option shall be useful if you are unable to copy the script to Linux. @@ -188,11 +193,29 @@ Once you have run the script on macOS, depending on the method you chose, the st Replace `/path/to/firmware_package.pkg.tar.zst` with the actual path of the package. For example, if `apple-firmware-14.5-1-any.pkg.tar.zst` was created in macOS and has been copied to the Downloads folder in Linux, command to be run would be `sudo pacman -U $HOME/Downloads/apple-firmware-14.5-1-any.pkg.tar.zst` === ":fontawesome-brands-linux: Method 4" - **Method 4: Download a macOS Recovery Image from Apple and extract the firmware from there** + **Method 4: Retrieve the firmware directly from macOS** + + !!! warning "Internet connection may be required for **Method 4**" + + **Method 4** needs certain dependencies to work. If they are missing, you need to have an active internet connection on Linux to download and install them. You can use Ethernet, USB tethering or an external Wi-Fi adapter to get internet. If you are using an customised ISO made for T2 Macs, then most likely those dependencies shall be shipped alongwith the ISO, so in that case internet shall not be required. + + This method does not have any steps to be followed on macOS. So, you have to run the script directly on Linux. After you run the script on Linux, you have to choose the **"Retrieve the firmware directly from macOS**" option. + + If you choose this method, the script will install the following dependencies, if missing, on Linux: + + 1. **APFS driver for Linux** - Enables mounting and reading of the macOS Recovery volume, which has the firmware. You can get the source code from [here](https://github.com/linux-apfs/linux-apfs-rw). + 2. **dmg2img** - Converts the macOS Recovery Image obtained to a Linux readable format. + + The script shall automatically detect if any dependency is missing, and if required, will give you the option of installing it. So you need not worry about having missing dependencies. + + Once the script confirms that you have the necessary dependencies installed, it shall automatically install the firmware. + +=== ":fontawesome-brands-linux: Method 5" + **Method 5: Download a macOS Recovery Image from Apple and extract the firmware from there** - !!! warning "Internet connection is required for **Method 4**" + !!! warning "Internet connection is required for **Method 5**" - **Method 4** downloads a macOS Recovery image from Apple. So you need to have an active internet connection on Linux. You can use Ethernet, USB tethering or an external Wi-Fi adapter to get internet. + **Method 5** downloads a macOS Recovery image from Apple. So you need to have an active internet connection on Linux. You can use Ethernet, USB tethering or an external Wi-Fi adapter to get internet. This method does not have any steps to be followed on macOS. So, you have to run the script directly on Linux. After you run the script on Linux, you have to choose the **"Download a macOS Recovery Image from Apple and extract the firmware from there**" option. From 810839da4931a50e42845cfda548f7a6b8bfe912 Mon Sep 17 00:00:00 2001 From: Aditya Garg <85610623+AdityaGarg8@users.noreply.github.com> Date: Thu, 6 Jun 2024 13:32:00 +0530 Subject: [PATCH 10/15] Fix grammar --- docs/guides/wifi-bluetooth.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/wifi-bluetooth.md b/docs/guides/wifi-bluetooth.md index 27b37668..ebf5db59 100644 --- a/docs/guides/wifi-bluetooth.md +++ b/docs/guides/wifi-bluetooth.md @@ -197,7 +197,7 @@ Once you have run the script on macOS, depending on the method you chose, the st !!! warning "Internet connection may be required for **Method 4**" - **Method 4** needs certain dependencies to work. If they are missing, you need to have an active internet connection on Linux to download and install them. You can use Ethernet, USB tethering or an external Wi-Fi adapter to get internet. If you are using an customised ISO made for T2 Macs, then most likely those dependencies shall be shipped alongwith the ISO, so in that case internet shall not be required. + **Method 4** needs certain dependencies to work. If they are missing, you need to have an active internet connection on Linux to download and install them. You can use Ethernet, USB tethering or an external Wi-Fi adapter to get internet. If you are using a customised ISO made for T2 Macs, then most likely those dependencies shall be shipped alongwith the ISO, so in that case internet shall not be required. This method does not have any steps to be followed on macOS. So, you have to run the script directly on Linux. After you run the script on Linux, you have to choose the **"Retrieve the firmware directly from macOS**" option. From 5a12ee2abedbc83dacc18aa795baef8d4a348cab Mon Sep 17 00:00:00 2001 From: Aditya Garg <85610623+AdityaGarg8@users.noreply.github.com> Date: Thu, 6 Jun 2024 13:35:13 +0530 Subject: [PATCH 11/15] Update wifi-bluetooth.md --- docs/guides/wifi-bluetooth.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides/wifi-bluetooth.md b/docs/guides/wifi-bluetooth.md index ebf5db59..81987ce8 100644 --- a/docs/guides/wifi-bluetooth.md +++ b/docs/guides/wifi-bluetooth.md @@ -203,7 +203,7 @@ Once you have run the script on macOS, depending on the method you chose, the st If you choose this method, the script will install the following dependencies, if missing, on Linux: - 1. **APFS driver for Linux** - Enables mounting and reading of the macOS Recovery volume, which has the firmware. You can get the source code from [here](https://github.com/linux-apfs/linux-apfs-rw). + 1. **APFS driver for Linux** - Enables mounting and reading of the macOS Recovery volume, which has the firmware. The source code of the driver which shall be installed by the script is obtained from [here](https://github.com/linux-apfs/linux-apfs-rw). 2. **dmg2img** - Converts the macOS Recovery Image obtained to a Linux readable format. The script shall automatically detect if any dependency is missing, and if required, will give you the option of installing it. So you need not worry about having missing dependencies. @@ -219,7 +219,7 @@ Once you have run the script on macOS, depending on the method you chose, the st This method does not have any steps to be followed on macOS. So, you have to run the script directly on Linux. After you run the script on Linux, you have to choose the **"Download a macOS Recovery Image from Apple and extract the firmware from there**" option. - If you choose this method, the script will install the following dependencies, if missing, on Linux: + If you choose this method, the script will install the following dependencies, if missing, on Linux: 1. **curl** - Downloads a [python script](https://github.com/kholia/OSX-KVM/blob/master/fetch-macOS-v2.py) which is used to download the macOS Recovery image from Apple. 2. **dmg2img** - Converts the downloaded macOS Recovery Image to a Linux readable format. From 4591fb91dd72df2113a51410239672159b4662b2 Mon Sep 17 00:00:00 2001 From: Aditya Garg <85610623+AdityaGarg8@users.noreply.github.com> Date: Thu, 6 Jun 2024 13:42:44 +0530 Subject: [PATCH 12/15] Update wifi-bluetooth.md --- docs/guides/wifi-bluetooth.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/wifi-bluetooth.md b/docs/guides/wifi-bluetooth.md index 81987ce8..7e8d7bcf 100644 --- a/docs/guides/wifi-bluetooth.md +++ b/docs/guides/wifi-bluetooth.md @@ -22,7 +22,7 @@ Refer to the "Updating Kernel" section on your distro's FAQ for instructions if We now use a script which can help you set up Wi-Fi and Bluetooth. Click [here](../tools/firmware.sh) to download the script. -There are 4 methods supported by this script to get firmware for Linux, named as **Method 1-4** in this guide. Details of each method are given in the [On macOS](#on-macos) and [On Linux](#on-linux) section. +There are 5 methods supported by this script to get firmware for Linux, named as **Method 1-5** in this guide. Details of each method are given in the [On macOS](#on-macos) and [On Linux](#on-linux) section. **You have to choose any one of the five methods to get firmware as per your choice.** **Method 1-3** require macOS installed on your Mac. The initial steps of these methods are to be followed on macOS, and later steps have to be followed on Linux. Thus, if you choose one of these methods, you first need to follow the [On macOS](#on-macos) section and then proceed to the [On Linux](#on-linux) section. From 0244e8cae9a9d80a35f8aa74faacc412f30be3b2 Mon Sep 17 00:00:00 2001 From: Aditya Garg <85610623+AdityaGarg8@users.noreply.github.com> Date: Thu, 6 Jun 2024 14:54:48 +0530 Subject: [PATCH 13/15] Update wifi-bluetooth.md --- docs/guides/wifi-bluetooth.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/guides/wifi-bluetooth.md b/docs/guides/wifi-bluetooth.md index 7e8d7bcf..df620b3a 100644 --- a/docs/guides/wifi-bluetooth.md +++ b/docs/guides/wifi-bluetooth.md @@ -26,10 +26,12 @@ There are 5 methods supported by this script to get firmware for Linux, named as **Method 1-3** require macOS installed on your Mac. The initial steps of these methods are to be followed on macOS, and later steps have to be followed on Linux. Thus, if you choose one of these methods, you first need to follow the [On macOS](#on-macos) section and then proceed to the [On Linux](#on-linux) section. -**Method 4-5** do not require macOS, so you can directly follow the [On Linux](#on-linux) section if you choose them. +**Method 4** also requires macOS, but doesn't have any step to be followed on macOS. So you can directly follow the [On Linux](#on-linux) section if you choose it. + +**Method 5** does not require macOS, so you can directly follow the [On Linux](#on-linux) section if you choose it. !!! Tip "macOS Removed after installing Linux" - In case you have removed macOS after installing Linux, and need the firmware, **Method 4** is the only option for you. + In case you have removed macOS after installing Linux, and need the firmware, **Method 5** is the only option for you. ### On macOS From 8d744ee9d40a729d05461c5fe5f7f8717f729f5b Mon Sep 17 00:00:00 2001 From: Aditya Garg <85610623+AdityaGarg8@users.noreply.github.com> Date: Thu, 6 Jun 2024 17:02:45 +0530 Subject: [PATCH 14/15] Update wifi-bluetooth.md --- docs/guides/wifi-bluetooth.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/docs/guides/wifi-bluetooth.md b/docs/guides/wifi-bluetooth.md index df620b3a..e0fbc45c 100644 --- a/docs/guides/wifi-bluetooth.md +++ b/docs/guides/wifi-bluetooth.md @@ -76,16 +76,6 @@ Run the script on the macOS terminal. After you run the script, it will ask you Now you have to install the package in Linux using your package manager. The procedure has been described in detail in [On Linux](#on-linux) section. -=== ":fontawesome-brands-apple: Method 4" - **Method 4: Retrieve the firmware directly from macOS** - - This method does not have any steps to be followed on macOS. See [On Linux](#on-linux) section. - -=== ":fontawesome-brands-apple: Method 5" - **Method 5: Download a macOS Recovery Image from Apple and extract the firmware from there** - - This method does not have any steps to be followed on macOS. See [On Linux](#on-linux) section. - ### On Linux Once you have run the script on macOS, depending on the method you chose, the steps to be followed on Linux are described below: From 158c7ffb99c1c91decaf7ba0627e14954b53a7cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 11:57:21 +0000 Subject: [PATCH 15/15] Dependencies: Bump mkdocs-material from 9.5.25 to 9.5.26 Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.25 to 9.5.26. - [Release notes](https://github.com/squidfunk/mkdocs-material/releases) - [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG) - [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.5.25...9.5.26) --- updated-dependencies: - dependency-name: mkdocs-material dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 735cdb19..7c30342b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,5 +2,5 @@ # To install them all run 'pip install -r requirements.txt' in the same directory mkdocs == 1.6.0 -mkdocs-material == 9.5.25 +mkdocs-material == 9.5.26 mkdocs-redirects == 1.2.1