The darkening of the sun (and the other signs) are repeatedly emphasised as heralding the day of judgement, by the prophets and in the New Testament, including by Jesus himself.
Regarding your Genesis 8:22 reference, I think an important part of that verse is the first bit: "As long as the earth endures". All of these prophecies are about the end of the world, so the condition no longer holds. (Admittedly, the Revelation chronology does not have the actual end of the world occurring at this precise moment - but I would tend to see the end of the world as a single "event" regardless of how long it takes to accomplish.)
This section of Revelation draws heavily from Isaiah, who prophesied that on "the Day of the Lord", (13:4, NJB)
The sun will be dark when it rises, and the moon will no longer give its light.
Similarly, Ezekiel 32:7 prophesied against Pharaoh, saying:
When I extinguish you I shall cover the skies and darken the stars. I shall cover the sun with clouds and the moon will not give its light.
Joel (2:10, 4:15) uses language similar to Isaiah above, and specifically (3:4 or 2:31 depending on your Bible) says:
The sun will be turned into darkness, and the moon into blood, before the Day comes, that great and terrible Day.
Peter quotes this passage in Acts 2:20. Most importantly, Jesus himself said (Matthew 24:29, also Mark 13:24):
Immediately after the distress of those days the sun will be darkened, the moon will not give its light, the stars will fall from the sky and the powers of the heavens will be shaken.
These signs demonstrate the sovereignty of God over the heavens, and show that his Day is literally a universe-changing event. It is not confined to any one group of people, but affects the entire world. Here, the reference to sackcloth brings to mind mourning garments, a poignant reference for what is about to happen: the sun itself is in mourning.
After the judgement, there will be no need for the sun and moon in any case. Their transformation or disappearance at this time shows us that the New Jerusalem is on its way.
No more will the sun give you daylight, nor moonlight shine on you, but Yahweh will be your everlasting light, your God will be your splendour. Your sun will set no more, nor will your moon wane, for Yahweh will be your everlasting light and your days of mourning will be over. (Isaiah 60:19-20)
I could not see any temple in the city since the Lord God Almighty and the Lamb were themselves the temple, and the city did not need the sun or the moon for light, since it was lit by the radiant glory of God, and the Lamb was a lighted torch for it. (Revelation 21:22-23)