Think there'd be a device to help get a fix on Earth's direction? Not sure what the actual fatwa about this would be (can the term fatwa apply to something like that? Not Muslim, so not sure), but I would think that from an astronomical standpoint, Earth's direction is as precise as anyone could get.
A fatwa is a judicial ruling, an opinion issued by an Islamic jurist on the application of Sharia (Islamic law). According to the article in iguana_tonante's link, it was the National Fatwa Council of Malaysia that worked out the guidelines for prayer aboard the ISS, and the article contains a link to the actual document (in .doc format). So yeah, this is a fatwa.
I also think Islam has a tremendous body of astronomical research, and some conclusions could be drawn from the works of those astronomers as well.
No question of the importance of Islamic science to our understanding of astronomy, but knowledge of how the sky looks from Earth isn't particularly helpful to a Muslim on a starship 100 light-years away from Earth.
If you're within maybe 40-50 light-years of Sol and have typical eyesight, then the Sun would be a naked-eye star, but you'd have to know which direction to look and how it would appear against the starscape. You can do that now with the Celestia simulator, so it would be easy to figure out aboard ship, and you could actually see Sol yourself once you'd found it, so it'd be easy enough to focus on it for prayer. (Of course, at that distance, Sol and Earth would be part of the same pinpoint, so as long as you're looking at Sol, you're looking at Mecca.) At a greater distance, the computer could tell you which direction to look, but you probably couldn't see it. Still, that's no different from the situation of Muslims around the world today, who know what direction Mecca is in but can't see it themselves (and strictly speaking they aren't actually facing it, due to the curvature of the Earth -- but then, it's not the literal direction that matters so much as the intent to direct one's prayers toward the Ka'aba).