In Middle Earth lore, we know Tolkien's dragons didn't have to have wings necessarily to be considered dragons. While Jackson may not be allowed to use material from the Silmarillion, Glaurung was the precursor to the 'Modern' dragons with wings. (http://lotr.wikia.com/wiki/Glaurung)
In the Appendix A-II of the Lord of the Rings, a dragon named Scatha is described as a long worm, who was killed by Fram, an early chieftain of the Rohirrim ancestors. The passage goes on to say the land was then free from long worms afterwards. This may or may not mean that Scatha belonged to a sub species of dragons without wings, since Tolkien said there was peace from 'long worms' specifically and not dragons. The problem is that Scatha was found on Ered Mithrin, and so it was mountain terrain and not really the kind of flat topography we'd expect the burrowing worms the movie depicted to prefer. (http://lotr.wikia.com/wiki/Long-worms)
(http://tolkiengateway.net/wiki/Scatha)
However, in the Hobbit itself, Bilbo does makes a reference to a creature called a were worm, which supposedly lives in a desert in the east. So that would probably be closer to the version in the movie, and most likely where the earth-eaters as I think they were called originated from. The ability to chew through rock and compacted earth however, is not at all specifically mentioned within either LotR or The Hobbit to my knowledge.(http://lotr.wikia.com/wiki/Were-worms)
This ability to carve passageways underground could be more inspired from the 2003 video game based on and named The Hobbit, where were-worms are depicted as blind, subterranean dwelling caterpillar like critters. Who knows. Either way, wingless worms are mentioned in the books, not so much earth eating ones.(http://lotr.wikia.com/wiki/The_Hobbit_(2003_video_game))