In Mishneh Torah-Avodat Kochavim 1:1 Rambam states:
"During the times of Enosh, mankind made a great mistake, and the wise men of that generation gave thoughtless counsel. Enosh himself was one of those who erred. Their mistake was as follows: They said God created stars and spheres with which to control the world. He placed them on high and treated them with honor, making them servants who minister before Him. Accordingly, it is fitting to praise and glorify them and to treat them with honor. [They perceived] this to be the will of God, blessed be He, that they magnify and honor those whom He magnified and honored, just as a king desires that the servants who stand before him be honored. Indeed, doing so is an expression of honor to the king. After conceiving of this notion, they began to construct temples to the stars and offer sacrifices to them. They would praise and glorify them with words, and prostrate themselves before them, because by doing so, they would - according to their false conception - be fulfilling the will of God. This was the essence of the worship of false gods, and this was the rationale of those who worshiped them. They would not say that there is no other god except for this star. This message was conveyed by Jeremiah, who declared (10: 7-8): "Who will not fear You, King of the nations, for to You it is fitting. Among all the wise men of the nations and in all their kingdoms, there is none like You. They have one foolish and senseless [notion. They conceive of their] empty teachings as wood; " i.e., all know that You alone are God. Their foolish error consists of conceiving of this emptiness as Your will"
The following statement from the Talmud Bavli should be a Maimonides's source:
"R. Chiya bar Abba said in R. Yochanan's name: One who observes the Shabbat according to its laws, even if he practices idolatry like the generation of Enosh, he is forgiven "(Shabbat 118b)".
However, I have not been able to identify the other sources from which Rambam draws to affirm that the specific type of idolatry practiced by the generation of Enosh is substantiated in the adoration of the stars , but always recognizing in HaShem the Supreme Power to Which all the other realities of the universe are subjected.
Could you please indicate these sources to me?