[Atrix 4G Android Development] slushy007:
the "bad interpreter" message is caused by ^M (Windoze carriage returns) being embedded in the script file. If you do this

cat beforedebug.sh | tr -d '\r' > beforedebug.sh.new
cp beforedebug.sh.new beforedebug.sh

that should do the trick.

At the risk of jacking phoneixx's thread, I had done something similar for Mac based on Ririal's GladRoot and DesignGears aRoot.

There actually is an SBF flasher for Linux and Mac found on OPTICALDELUSION's blog.

I had originally posted this on AndroidCentral but since XDA is the site of record then I guess it should go here too :)

(I tried to link to the OPTICALDELUSION blog and AndroidCentral article but the XDA spam filter won't let me post a link to an outside site until I have 8 more posts, lol. I may make some more posts elsewhere and edit this post to include the proper links )

_____________

Hello, all of you frustrated Mac users out there!

This method is tested on my MacBook Pro (10.6.6)

Linux users should be able to use this if they replace the copy of adb that is in the zip file with the appropriate executable from Linux version of the SDK. If you know enough to run Linux then you can do that on your own

Warning -- AT&T Atrix only! No Bell!

So you're on 1.5.7 -- let's root it!

Part A -- Revert software back to 1.26

1. Download this file and unzip it (Deposit Files)

2. Make sure your phone is FULLY CHARGED

3. Turn off your phone

4. Remove your SIM card and SD card if you have one

5. Turn your phone ON and hold the Volume UP button

6. It will say “Starting RSD protocol support” at the top of the boot screen

7. Connect your phone to the computer via USB

8. Run the downgrade.sh script. This will reflash your phone to 1.26 so that we can gain root access.

9. it can take up to 5 minutes to flash depending on your computer speed. My MacBook Pro takes just under 4 minutes. If you get any errors that look something like

>> uploading RDL03: 0.0%usb_bulk_write -5

>> uploading RDL03: failed at 00000000/00300000

!! failed

>> rebooting

usb_bulk_write -104

Don't get nervous! That happens occasionally. Just run the script again.

10. Phone will reboot and it takes longer than usual to come up

11. disconnect USB and power down.

12. Put your SIM and SD cards back in

13. Power up and verify that you are running 1.2.6 in Settings -> About Phone. You'll have to reenter your Motoblur account info.

Part B -- Root it!

14. Enable USB debugging (Settings -> Applications -> Development).

15. Connect your phone and set USB Connection to 'None'.

16. cd to the aRoot directory and run aRoot.sh and follow the on-screen directions

If you see this:

…

Getting temporary root access...

mmap() failed. Operation not permitted

…

then the rooting operation failed. Try running the aRoot.sh script again. If it fails manually run this:

./adb kill-server

If it keeps failing you may not have flashed back to 1.26 successfully. Start again.

17. Verify that there are no errors before updating.

18. Go to Settings -> About phone -> System updates

19. Follow the on-screen instructions. First download the update (you will need a Wi-Fi connection for this), then it will prompt you to install.

20. The update will reboot the device and install itself. If this part fails it's because you are not on stock 1.2.6 firmware. Start over and read the directions.

21. When it boots back up, verify USB debugging is still on. Some users report that disabling and re-enabling USB debugging solves a few issues with the script detecting your device (Settings -> Applications -> Development).

22. Run afterupdate.sh

23. Make sure you allow the superuser request on your phone or it WILL fail.

24. All done! Enjoy your rooted Atrix on 4.1.57!

thanks to

OpticalDelusion (OPTICALDELUSION)

DesignGears([SCRIPT] aRoot for Atrix 4G [ root - init.d - sideloading - tethering ] - xda-developers)

Ririal ([SCRIPT] GladRoot v4 (Bell 0.37.4, AT&T 1.26/1.52/1.57 Supported) - xda-developers)

Kennethpenn ([GUIDE] Flash SBF to Motorola Atrix 4G - xda-developers)