OK, how about this? I want a certain network volume mounted as soon as I boot, and there's no reason you can't use the same technique to do this screen-rotation trick. First create the file /Library/LaunchDaemons/localboot.plist, and put this in:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd >
<plist version="1.0">
<dict>
<key>Label</key>
<string>localboot</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/boot.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>LaunchOnlyOnce</key>
<true/>
</dict>
</plist>
That tells your Mac that when it boots, it should run the shell script "/usr/local/bin/boot.sh". Once that's done, create /usr/local/bin if it doesn't exist, and make the shell script containing your fb-rotate command. Note that this script will execute as root, not as any user, so you probably want fb-rotate to go in /usr/local/bin as well, and you should invoke it using a complete path. So, you'd make it look like this:
Code:
#!/bin/sh
# rotate screen twice to overcome white screen startup bug.
# If things aren't working out, you'll need to redirect output to someplace you can
# actually see it, by uncommenting the next line
# exec 2>&1 >/tmp/boot.sh.output.txt
/usr/local/bin/fb-rotate -d 0 -r 90
/usr/local/bin/fb-rotate -d 0 -r 0
# Any other startup code can be placed here
Lastly, do "chmod 700 /usr/local/bin/boot.sh" and "chown root:wheel /usr/local/bin/boot.sh" in case you ever decide to put anything there that you don't want prying eyes to see (like low-security passwords). If you created /usr/local/bin, make sure local and bin are owned by root and mode 755.
Let me know how this goes. I can imagine a slight possibility of this not working: fb-rotate might want to execute in a user session. But as long as it works OK when nobody is logged in on the GUI, it should work fine this way. (You can test before doing all this stuff by logging out all users, and then sshing in from somewhere else.)