optimize nandinstall script