Jump to content

[USB Wifi] Updated Ralink/Mediatek RT2870/ RT2770/ RT3X7X/ RT537X/ RT5572


rodrigocunha
460 posts in this topic

Recommended Posts

I found out a (bad) way to enable r/w on / in Big Sur and be able to make the WIFI-Dlink-Catalina-Panel-V2 work in Big Sur (beta 1 and beta 2).

 

Short story:

During mac os installation, after booting from Preboot, force a shutdown as soon as you read "Forcing CS_RUNTIME for entitlement: com.apple.rootless.restricted-block-devices".

Then reboot to boot from your mac os volume and "sudo mount -uw /" will give no error.

 

I don't know in details what Forcing CS_RUNTIME for entitlement: com.apple.rootless.restricted-block-devices does in details, because csrutil authenticated-root status returns "enabled"; SIP is disabled (ZwAAAA==).

 

Long story:

When I installed the first time Big Sur beta 1, after booting from Preboot it seemed it was hanging at "Forcing CS_RUNTIME for entitlement: com.apple.rootless.restricted-block-devices"; so I forced a shutdown, rebooted and booted from the mac os disk; everything seemed ok; I then tried to manually install the WIFI-Dlink-Catalina-Panel-V2 and the wifi worked (note that the files must be written in /System/Library to work correctly) --> this means mount / with r/w permissions with command "sudo mount -uw /".

I then did a clean install of Big Sur beta 2: this time I waited 10-15+ minutes when it seemed to hang at "Forcing CS_RUNTIME for entitlement: com.apple.rootless.restricted-block-devices"; in fact it wasn't hanging!

Once booted into the os I then tried to install WIFI-Dlink-Catalina-Panel-V2, but this time command "sudo mount -uw /" returned an error: permission denied, failed with 66.

I tried to set csr-active-config in bootloader to /w8AAA== (FF0F0000 <-- Dortania guide updated for Big Sur) with no luck.

Then, I was able to boot into recovery with opencore by setting JumpstartHotPlug to true (thank to Pavo for the tip), however command "csrutil authenticated-root disable" from the recovery returned "csrutil: Failed to disable the authenticated root setting. This tool needs to be executed from the Recovery OS." (??????DAMN!!!I'M IN RECOVERY!!WHAT'S WRONG???).

So dead end...Untill I realized that "permission denied, failed with 66" was there also in beta 1 (I read some comments from users about it) and so I though, let's try to reinstall beta 2 and force a shutdown at "Forcing CS_RUNTIME for entitlement: com.apple.rootless.restricted-block-devices" as I did in beta 1: bingo that worked and "sudo mount -uw /" works as in Catalina.

 

I don't know at all why it works, but at least wifi works again...

Link to comment
Share on other sites

  • 4 weeks later...

@chris1111 Hi,
I'm trying to install https://github.com/chris1111/Wireless-Ralink-Panel-Utility

My hackintosh is running 10.15.4 (which is supported by your program)

USB wifi: Ralink using MT7601U. (Driver succesfully, MAC show up)

SIP and Gatekeeper are disabled.

 

I could install the program successfully, but after the reset, the program could not open. It just starts for some seconds and automatically quits.

It also makes its in 2 icons: Ralink Wireless Utility and Dock Activate.

When I plug the USB Wifi in and turn on Utility, all the system crashed.

 

Is there anything I could do?

Link to comment
Share on other sites

4 hours ago, sh0rtcut said:

@chris1111 Hi,
I'm trying to install https://github.com/chris1111/Wireless-Ralink-Panel-Utility

My hackintosh is running 10.15.4 (which is supported by your program)

USB wifi: Ralink using MT7601U. (Driver succesfully, MAC show up)

SIP and Gatekeeper are disabled.

 

I could install the program successfully, but after the reset, the program could not open. It just starts for some seconds and automatically quits.

It also makes its in 2 icons: Ralink Wireless Utility and Dock Activate.

When I plug the USB Wifi in and turn on Utility, all the system crashed.

 

Is there anything I could do?

MT7601U is support only in Linux

https://www.mediatek.com/products/broadbandWifi/mt7601u

Link to comment
Share on other sites

1 hour ago, sh0rtcut said:

Thank you for your confirm.
But without USB wifi, I could not even start the Ralink Wireless Utility.

How to open that?

Thanks

Of course you need Support device to open it

Link to comment
Share on other sites

On 8/7/2020 at 8:44 PM, chris1111 said:

Of course you need Support device to open it

Hello,
I have installed new driver and the software recognized my USB Wifi.

Wireless Utility could run in the top bar constantly.

But when everytime I click to open Utility, it starts then closes with error

image.png.0a632d761cf20c20435fcf8a22eca3a4.png

 

Any chance to fix this?

Thank you.

Edited by sh0rtcut
Link to comment
Share on other sites

  • 4 weeks later...
On 9/3/2020 at 4:08 PM, adamantinum said:

Is there any news about how make these adapters work on Big Sur?

The only way I found with my mediatek RT2870 is to:

1- break the seal (disable csrutil and authenticated root)

2- delete existing snapshot(s) and tag an empty one to be able to boot

3- inject the kext with opencore (not needed if you are able to load the kext from /S/L/E..I don't know why but from beta 6 I'm not anymore able to load from that path at boot..)

4- mount / in read/write (-uw)

5- copy manually kext in /S/L/E, utility in /S/L/StartupItems, prefpane in /S/L/PreferencePanes and assign proper permissions

6- kextload the kext in /S/L/E so to be able to give permissions to Mediadtek in system pref pane / security and privacy / general

 

NB: copying the kext in /S/L/E is needed otherwise the D-link pane will force exit

NB2: D-link pane is hidden if you start system pref pane, but it is accessible from the top bar menu, once started it will be visible also in system pref pane

 

Spoiler

Files/Settings:

1.thumb.png.d7a8866b7b2f76cb5038aa072c8a3a85.png

 

D-link pref pane in big sur beta 6

2.thumb.png.307a85c8724aeead3415b03c928109c9.png

 

How to start D-link pref pane

3.png.3109f42f75a3d4545d93585434379b32.png

 

D-link pref pane visible after starting from top bar

4.png.4e54912b4d8b4a4140c2ecb9d25ae3ce.png

 

D-link pref pane not visible when starting system pref pane

5.png.d3e77473c1860992f397de183bd9252c.png

 

Edited by ghost8282
Link to comment
Share on other sites

22 hours ago, ghost8282 said:

The only way I found with my mediatek RT2870 is to: 

...

Thank you very much for the answer!
How did you delete the snapshot and tag an empty one? I tried to disable authenticated-root, but then booting the system 

mount -uw /

return 
 

mount: / failed with 66

 

Link to comment
Share on other sites

22 hours ago, adamantinum said:

How did you delete the snapshot and tag an empty one?

 

1- Boot into recovery

2- run a terminal:

csrutil disable

3- reboot and boot into recovery again; check if csrutil is disabled:

csrutil status

Disable authenticathed root:

csrutil authenticated-root disable

4- Reboot and boot into recovery again; check if authenticated-root is disabled:

csrutil authenticated-root status

List your disks:

diskutil list

Take note of your Big Sur volume name (NOT the data one): in this example I'm calling it MacOsVolumeName, position disk5s5.

unmount Big Sur volume name:

diskutil umount /Volumes/MacOsVolumeName

Mount Big Sur disk:

diskutil mount disk5s5

Mount Big Sur volume in read/write:

mount -uw /Volumes/MacOsVolumeName

Tag an empty snapshot:

/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs_systemsnapshot -v /Volumes/MacOsVolumeName -r ""

List snapshots on Big Sur disk:

diskutil apfs listSnapshots disk5s5

Delete ALL the snapshots you have by UUID (Replace UUIDHERE with your real UUID); this command may be run several times, one time for each snapshot you have:

diskutil apfs deleteSnapshot disk5s5 -uuid UUIDHERE

These commands are all run from RECOVERY and need several reboots, follow carefully the instructions, otherwise you may have a not bootable system.

 

Now boot into Mac OS (not recovery).

 

Mount / in read and write:

sudo mount -uw /

--------------------------------------------------

Now you can modify system files from terminal (always use sudo)

Edited by ghost8282
typo
Link to comment
Share on other sites

1 hour ago, adamantinum said:

how can I extract from the Installer the needed kext and panes?

Use pkgutil --expand-full:

pkgutil --expand-full /path/to/pkg/to/expand.pkg /path/to/destination/of/extracted/files/Expanded

Note: do not create before folder "Expanded"

Then navigate to /path/to/destination/of/extracted/files/Expanded/ and you will find packageroot.pkg (this is for WIFI-Dlink Catalina-Panel-V2.pkg.zip available here).

Right click on packageroot.pkg and click show contents:

kext is in Payload/WirelessUtility/Driver/Catalina/

pref pane is in Payload/WirelessUtility/Other

wireless utility is in Payload/WirelessUtility/UI

  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...

Hello. I have an RT2870 adapter and I'm using it with macOS Catalina 10.15.6 through the Ralink Panel Utility, but the adapter keeps dropping. Searching on GitHub I realized that, apparently, he is only optimized until Catalina 10.15.4, as chris1111 did not come up with updates anymore. How can I use the adapter in the latest version of the system without facing these problems?

Link to comment
Share on other sites

On 9/19/2020 at 11:45 PM, JemsIslan said:

Hello. I have an RT2870 adapter and I'm using it with macOS Catalina 10.15.6 through the Ralink Panel Utility, but the adapter keeps dropping. Searching on GitHub I realized that, apparently, he is only optimized until Catalina 10.15.4, as chris1111 did not come up with updates anymore. How can I use the adapter in the latest version of the system without facing these problems?

Are you using this?

https://github.com/chris1111/WIFI-Dlink-Catalina-Panel-V2/files/4242866/WIFI-Dlink.Catalina-Panel-V2.pkg.zip

 

This should be the latest, I have a RT2870 too with Catalina 10.15.6 latest and I'm not experiencing disconnections. The only thing (not only in catalina but also in previous os) is that sometimes (once in 20-30?) as soon after the boot the adapter cannot connect and I must reboot the os.

Link to comment
Share on other sites

23 hours ago, ghost8282 said:

Are you using this?

Yes, this is the version I am using. Do you use your adapter on the USB 2.0 or 3.0 port? I suspect you have some influence on that. Anyway, the drops usually happen when I connect the device's bluetooth with my wireless headset.

Link to comment
Share on other sites

14 hours ago, JemsIslan said:

Do you have problems plugging in 3.0?

Just tried for 6 hours with my adapter connected to usb 3.0 (My macos is a qemu vm connected to a passed through inateck pci usb card): no issues.

7 hours ago, JemsIslan said:

did you need to do any other procedure besides installing .pkg on the system? what's your adapter?

Well, to be honest I don't remember how I installed it..Anyway if the pkg doesn't fail to install that's ok, the pkg is only an automated way to copy the kext, the pref pane and the wireless utility.

If it fails (for any reason), extract the files from the package and copy them manually, as explained in previous posts.

However, I would check that all the files are in their position and that the kext is loaded correctly.

My device is Alfa AWUS036NH.

Link to comment
Share on other sites

8 hours ago, ghost8282 said:

Well, to be honest I don't remember how I installed it..Anyway if the pkg doesn't fail to install that's ok, the pkg is only an automated way to copy the kext, the pref pane and the wireless utility.

If it fails (for any reason), extract the files from the package and copy them manually, as explained in previous posts.

However, I would check that all the files are in their position and that the kext is loaded correctly.

My device is Alfa AWUS036NH.

I have already reinstalled the software several times and even then it keeps giving me some connection drops from time to time. My adapter is an Alfa UW06. I'm suspecting that it's some bad EFI configuration or wrong USB mapping. Could you upload your EFI so I can check what's different from mine in this regard? If not, how did you do your USB mapping?

Link to comment
Share on other sites

On 9/26/2020 at 5:18 PM, JemsIslan said:

how did you do your USB mapping?

I have a virtual machine, so I don't think my efi will be very useful.

Anyway, for usb 2.0 I pass the single device through qemu with the ich9-ehci1 model.

For usb 3.0 I'm passing through the pci card, it's a inatek kt4006 with the fresco fl1100 chipset.

For usb/efi related stuff I'm injecting EC device and usb properties (power properties), check SSDT-EC-USBX.dsl for the source code.

Link to comment
Share on other sites

mmm there's a more simple way to make our RT2870 to work with big sur, without messing up with sealing/unsealing.

 

Pro: no need to unseal the os, so no need to seal the os before performing an os update

Cons: wireless pref pane is not working, but this doesn't mean you are not able to connect to a different ssid, not able to scan for available wifi networks :(

 

This applies to opencore bootloader.

 

Steps:

1- mount opencore EFI partition, copy RT2870USBWirelessDriver.kext in the EFI/OC/kext folder, modify config.plist to inject the kext

2- copy D-LinkUtility to applications folder (not the pref pane, not the kext, only the utility)

3- go to ~/Library/Preferences (this is ok, since it's a folder under the control of the user); you need to create 2 files:

a) ActiveProfileSetting.plist with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
	<dict>
		<key>AC Power CAM</key>
		<string>0</string>
		<key>Active Profile Flag</key>
		<string>YES</string>
		<key>Authentication Type</key>
		<string>3</string>
		<key>BSSID</key>
		<string>INPUT HERE THE MAC ADDRESS OF THE SSID, EXAMPLE 001122AABBCC</string>
		<key>Channel</key>
		<string>1</string>
		<key>Encryption Type</key>
		<string>1</string>
		<key>Fragmentation Threshold</key>
		<string>2346</string>
		<key>Hidden</key>
		<string>0</string>
		<key>Network Type</key>
		<string>1</string>
		<key>Power Save Mode</key>
		<string>0</string>
		<key>Preamble Type</key>
		<string>0</string>
		<key>Profile Name</key>
		<string>INPUT HERE THE PROFILE NAME YOU WANT, IT CAN BE THE SAME OF THE SSID NAME</string>
		<key>RTS Threshold</key>
		<string>2347</string>
		<key>SSID</key>
		<string>INPUT HERE THE SSID NAME YOU WANT TO CONNECT TO</string>
		<key>Tx Power</key>
		<string>0</string>
		<key>WEPKey1</key>
		<string></string>
		<key>WEPKey1 Type</key>
		<string>0</string>
		<key>WEPKey2</key>
		<string></string>
		<key>WEPKey2 Type</key>
		<string>0</string>
		<key>WEPKey3</key>
		<string></string>
		<key>WEPKey3 Type</key>
		<string>0</string>
		<key>WEPKey4</key>
		<string></string>
		<key>WEPKey4 Type</key>
		<string>0</string>
		<key>WEPKeyUse</key>
		<string>0</string>
		<key>WPAPSK</key>
		<string>INPUT HERE THE WIFI PASSWORD WPA2</string>
	</dict>
</array>
</plist>

Change all the strings that start with "INPUT HERE..." with your data (the mac address is not so important I think, because even if I input a wrong one, the device connect to the ssid).

The example above applies to a wpa2 access point, which should be the most common, not sure what you have to change to connect to open access point or wep ones, however you can try, description strings in the xml seem quite clear.

BTW, [Ironic mode: ON] thanks dlink and friends to store password in plain text....[Ironic mode: OFF]

 

b) AdvancedProfileSetting.plist with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
	<dict>
		<key>Ad Hoc Mode</key>
		<string>1</string>
		<key>BG Protection</key>
		<string>0</string>
		<key>Tx Burst</key>
		<string>1</string>
		<key>Tx Rate</key>
		<string>0</string>
		<key>Wireless Mode</key>
		<string>9</string>
	</dict>
</array>
</plist>

4- Go to System preferences, users and groups and add applications/D-LinkUtility/MiniTaskUSB-DLinkUtility to automatically startup the utility.

 

This is all it's needed to make wifi working, the kext, the utility and the files that store preferences.

Now on boot the usb wifi will automatically connect to the SSID you set.

Clicking from the top menu on Wireless Preference will do nothing, no wifi panel is installed and the executable (if not patched) points to prefpane in /System folder.

 

To do:

I'm trying to get a working prefpane installed in ~/Library/..: actually the panel is force closing, the same happened with an unsealed os, without the kext in /System/Library/Extensions/; I tried hex patching the executable to change paths but still doesn't work.

 

BTW: [Ironic mode: ON] thank you Apple for the sealed os [Ironic mode: OFF]

Edited by ghost8282
Link to comment
Share on other sites

THIS IS NO MORE VALID

 

Ok, so ladies and gentlement, my daily updates about the RT2870 device and bug sur (I will name it bug on purpose :D).

 

Goal: have a working device with prefpane with all the files installed in the non /System folder.

 

Unluckily the goal is not reached, no luck in patching the wifi prefpane..but..I found a quite good way to have all working.

The following applies to current master version of opencore and it's working with bug sur beta 9.

I have iMacPro1,1 SMBIOS data.

 

We would want a sealed system, we don't want to delete snapshots, we would want SIP enabled and authenticated-root enabled: however this is not possible at the moment, because the utility needs some files copied to the /System directory.

 

What we will achieve by the following is a sealed system with SIP and authenticated-root enabled with a working device with a not working prefpane and a system not booting from the snapshot, but without breaking the seal; so, we can use the sealed system everyday or a system not booting from the snapshot, and in this last case, we will be able to switch to the sealed system in ?less than 5 minutes? instead of reinstalling MacOS to seal the system again.

 

As I wrote in the above post:

1- mount opencore EFI partition, copy RT2870USBWirelessDriver.kext in the EFI/OC/Kexts folder, modify config.plist to inject the kext on boot

2- copy D-LinkUtility to applications folder (not the pref pane, not the kext, only the utility)

3- go to ~/Library/Preferences (this is ok, since it's a folder under the control of the user); you need to create 2 files:

a) ActiveProfileSetting.plist

b) AdvancedProfileSetting.plist

4- Go to System preferences, users and groups and add applications/D-LinkUtility/MiniTaskUSB-DLinkUtility to automatically startup the utility

5- Verify that in the opencore config.plist SecureBootModel is set to "Disabled"

 

If you boot your system you will see that it will boot from the snapshot, SIP and authenticated-root can be enabled and the wifi will work, but not the prefpane.

 

If you want the prefpane:

6- Verify that in the opencore config.plist SecureBootModel is set to "Default" (by changing this the os will not boot from the snapshot!)

7- boot into recovery and disable SIP (csrutil disable) and reboot

8- mount / in read and write (sudo mount -uw /)

9- terminal: copy D-LinkWirelessUtility.prefPane in /System/Library/PreferencePanes/

10- terminal: copy RT2870USBWirelessDriver.kext in /System/Library/Extensions/

11- Assign proper permissions to D-LinkWirelessUtility.prefPane and RT2870USBWirelessDriver.kext (sudo chmod -R 755 and sudo chown -R root:wheel)

12- End: working wifi and working wifi preference pane

 

Now, let's suppose there's an apple update, to update apple wants a sealed system and booting from snapshot (probably also SIP enabled?)

All you have to do is to delete D-LinkWirelessUtility.prefPane and RT2870USBWirelessDriver.kext (not sure if it's a must, anyway delete them since we don't want a not bootable os), mount opencore efi and set back SecureBootModel to "Disabled"; if SIP must be enable for the os update boot into recovery, enable SIP and reboot; since you are now booting from a snapshot you will be able to update the os through the preference pane, you will have a working wifi, but without the pref pane; if you want to have the pref pane back just change SecureBootModel to Default.

 

Booting back from / (no snapshot, SecureBootModel=Default) and you will have again the working wifi prefpane (obviously after an os update you will have to copy again D-LinkWirelessUtility.prefPane and RT2870USBWirelessDriver.kext)

Edited by ghost8282
Link to comment
Share on other sites

  • 2 weeks later...
On 9/30/2020 at 5:09 PM, ghost8282 said:

6- Verify that in the opencore config.plist SecureBootModel is set to "Default" (by changing this the os will not boot from the snapshot!)

This is not possible anymore with beta 10: booting with SecureBootModel=Default returns kernel panic, "not possible to boot from the live fs on a release build". :(

 

Edited by ghost8282
  • Like 1
  • Sad 1
Link to comment
Share on other sites

×
×
  • Create New...