[Feature][R305][task-view-1233][webui] add r305 v2 app

Change-Id: I8c2d738b1cb7f8384bc4f0731986f4f0308d6c67
diff --git a/lynq/R305/ap/app/goahead/server/cgi.c b/lynq/R305/ap/app/goahead/server/cgi.c
index c9286c6..8bf5bb3 100755
--- a/lynq/R305/ap/app/goahead/server/cgi.c
+++ b/lynq/R305/ap/app/goahead/server/cgi.c
@@ -59,10 +59,11 @@
 		}
 	//	fmtAlloc(&cgiPath, FNAMESIZE, T("%s/%s/%s"), websGetDefaultDir(),
 	//		CGI_BIN, cgiName);
-		fmtAlloc(&cgiPath, FNAMESIZE, T("%s/%s"),"/etc_ro/cgi-bin", cgiName);
+		fmtAlloc(&cgiPath, FNAMESIZE, T("%s/%s"),"/sbin", cgiName);
 		{
 			gstat_t 	sbuf;
 			if (gstat(cgiPath, &sbuf) != 0 || (sbuf.st_mode & S_IFREG) == 0) {
+				system("rm -rf /tmp/firmware_tmp_file");
 				websError(wp, 200, T("CGI process file does not exist"));
 				bfree(B_L, cgiPath);
 				return 1;
@@ -162,6 +163,7 @@
 	
 		if ((pHandle = websLaunchCgiProc(cgiPath, argp, envp, stdIn, stdOut)) 
 			== -1) {
+			system("rm -rf /tmp/firmware_tmp_file");
 			websError(wp, 200, T("failed to spawn CGI task"));
 			for (ep = envp; *ep != NULL; ep++) {
 				bfreeSafe(B_L, *ep);
diff --git a/lynq/R305/ap/app/goahead/server/goahead.c b/lynq/R305/ap/app/goahead/server/goahead.c
index 680db6a..3fe84c3 100755
--- a/lynq/R305/ap/app/goahead/server/goahead.c
+++ b/lynq/R305/ap/app/goahead/server/goahead.c
@@ -110,7 +110,7 @@
 	zte_httpshare_init();//httpshare
 	websUrlHandlerDefine(T("/"), NULL, 0, websHomePageHandler, 0); 
 
-	system("rm -rf /firmware_tmp_file");
+	system("rm -rf /tmp/firmware_tmp_file");
 	return 0;
 }
 
diff --git a/lynq/R305/ap/app/goahead/server/webs.c b/lynq/R305/ap/app/goahead/server/webs.c
index b0238e1..93d50e0 100755
--- a/lynq/R305/ap/app/goahead/server/webs.c
+++ b/lynq/R305/ap/app/goahead/server/webs.c
@@ -731,7 +731,7 @@
 		{
 			if(gstrstr(url, CGI_FIRMWARE_UPLOAD) != NULL){
 				wp->flags |= WEBS_CGI_FIRMWARE_UPLOAD;
-				system("rm -rf  /firmware_tmp_file");
+				system("rm -rf /tmp/firmware_tmp_file");
 				zte_mgmt_login_timemark_set();
 				printf("[goahead]set WEBS_CGI_FIRMWARE_UPLOAD \n");
 			}
diff --git a/lynq/R305/ap/app/goahead/server/webs.h b/lynq/R305/ap/app/goahead/server/webs.h
index 9dcb6af..ed80948 100755
--- a/lynq/R305/ap/app/goahead/server/webs.h
+++ b/lynq/R305/ap/app/goahead/server/webs.h
@@ -72,8 +72,8 @@
 #define CGI_FIRMWARE_WRITE      T("upload.write")
 #define CGI_HTTPSHARE_UPLOAD      T("httpshare.up")
 
-//#define FIRMWARE_TMP_FILE                  T("/var/firmware_tmp_file")
-#define FIRMWARE_TMP_FILE                  T("/firmware_tmp_file")
+#define FIRMWARE_TMP_FILE                  T("/tmp/firmware_tmp_file")
+//#define FIRMWARE_TMP_FILE                  T("/firmware_tmp_file")
 
 //added by liuyingnan for PC Client begin, 20120829
 #define WEBS_REST_CLIENT_REQUEST       0x200000