...but he had to be circumcised in the flesh, and all males in his household.
When Abram was ninety-nine years old, the Lord appeared to Abram and said to him, “I am Almighty God; walk before Me and be blameless.And I will make My covenant between Me and you, and will multiply you exceedingly.”Then Abram fell on his face, and God talked with him, saying:“As for Me, behold, My covenant is with you, and you shall be a father of many nations.No longer shall your name be called Abram, but your name shall be Abraham; for I have made you a father of many nations.I will make you exceedingly fruitful; and I will make nations of you, and kings shall come from you.And I will establish My covenant between Me and you and your descendants after you in their generations, for an everlasting covenant, to be God to you and your descendants after you.Also I give to you and your descendants after you the land in which you are a stranger, all the land of Canaan, as an everlasting possession; and I will be their God.”And God said to Abraham: “As for you, you shall keep My covenant, you and your descendants after you throughout their generations.This is My covenant which you shall keep, between Me and you and your descendants after you: Every male child among you shall be circumcised;and you shall be circumcised in the flesh of your foreskins, and it shall be a sign of the covenant between Me and you.He who is eight days old among you shall be circumcised, every male child in your generations, he who is born in your house or bought with money from any foreigner who is not your descendant.He who is born in your house and he who is bought with your money must be circumcised, and My covenant shall be in your flesh for an everlasting covenant.And the uncircumcised male child, who is not circumcised in the flesh of his foreskin, that person shall be cut off from his people; he has broken My covenant.”Then God said to Abraham, “As for Sarai your wife, you shall not call her name Sarai, but Sarah shall be her name.And I will bless her and also give you a son by her; then I will bless her, and she shall be a mother of nations; kings of peoples shall be from her.”Then Abraham fell on his face and laughed, and said in his heart, “Shall a child be born to a man who is one hundred years old? And shall Sarah, who is ninety years old, bear a child? ”And Abraham said to God, “Oh, that Ishmael might live before You!”Then God said: “No, Sarah your wife shall bear you a son, and you shall call his name Isaac; I will establish My covenant with him for an everlasting covenant, and with his descendants after him.And as for Ishmael, I have heard you. Behold, I have blessed him, and will make him fruitful, and will multiply him exceedingly. He shall beget twelve princes, and I will make him a great nation.But My covenant I will establish with Isaac, whom Sarah shall bear to you at this set time next year.”Then He finished talking with him, and God went up from Abraham.So Abraham took Ishmael his son, all who were born in his house and all who were bought with his money, every male among the men of Abraham’s house, and circumcised the flesh of their foreskins that very same day, as God had said to him.Abraham was ninety-nine years old when he was circumcised in the flesh of his foreskin.And Ishmael his son was thirteen years old when he was circumcised in the flesh of his foreskin.That very same day Abraham was circumcised, and his son Ishmael;and all the men of his house, born in the house or bought with money from a foreigner, were circumcised with him. - Genesis 17:1-27
http://www.biblegateway.com/passage/?search=Genesis17:1-27&version=NKJV
Nowhere in that entire chapter does it say anything about doing it for righteousness sake.
Only in chapter 15 is the word righteousness used. Abram believed, and it was accounted to him for righteousness.
Abram DID NOTHING, as is illustrated in the next verses.
After these things the word of the Lord came to Abram in a vision, saying, “Do not be afraid, Abram. I am your shield, your exceedingly great reward.”But Abram said, “Lord God, what will You give me, seeing I go childless, and the heir of my house is Eliezer of Damascus?”Then Abram said, “Look, You have given me no offspring; indeed one born in my house is my heir!”And behold, the word of the Lord came to him, saying, “This one shall not be your heir, but one who will come from your own body shall be your heir.”Then He brought him outside and said, “Look now toward heaven, and count the stars if you are able to number them.” And He said to him, “So shall your descendants be.”And he believed in the Lord, and He accounted it to him for righteousness.Then He said to him, “I am the Lord, who brought you out of Ur of the Chaldeans, to give you this land to inherit it.”And he said, “Lord God, how shall I know that I will inherit it?”So He said to him, “Bring Me a three-year-old heifer, a three-year-old female goat, a three-year-old ram, a turtledove, and a young pigeon.”Then he brought all these to Him and cut them in two, down the middle, and placed each piece opposite the other; but he did not cut the birds in two.And when the vultures came down on the carcasses, Abram drove them away.Now when the sun was going down, a deep sleep fell upon Abram; and behold, horror and great darkness fell upon him.Then He said to Abram: “Know certainly that your descendants will be strangers in a land that is not theirs, and will serve them, and they will afflict them four hundred years.And also the nation whom they serve I will judge; afterward they shall come out with great possessions.Now as for you, you shall go to your fathers in peace; you shall be buried at a good old age.But in the fourth generation they shall return here, for the iniquity of the Amorites is not yet complete.”And it came to pass, when the sun went down and it was dark, that behold, there appeared a smoking oven and a burning torch that passed between those pieces.On the same day the Lord made a covenant with Abram, saying: “To your descendants I have given this land, from the river of Egypt to the great river, the River Euphrates—the Kenites, the Kenezzites, the Kadmonites,the Hittites, the Perizzites, the Rephaim,the Amorites, the Canaanites, the Girgashites, and the Jebusites.” - Genesis 15:1-21
http://www.biblegateway.com/passage/?search=Genesis15:1-21&version=NKJV
If someone is asleep at the time a covenant is made, then there is nothing that is expected of them to keep that covenant. Gad alone passed through the two halves of the animals, and Abram was asleep. Therefore, Abram has no obligation to do anything to keep that covenant. It all rests on God. But abraham was VERY MUCH awake in Genesis 17, and he was therefore expected to keep that covenant with God.
(Side note: Genesis 15 describes the process from which we get the phrase "to cut a deal".)
Oh, and this covenant God made with Abram? Has nothing to do with Abram being righteous. Abram was counted as righteous BEFORE God told him to cut this covenant, and before God told him to circumcise. Why? Because he BELIEVED! That's it! Simply because he believed God.