Updated build script for stage2 and component.