Annotation of embedtools/src/upd.c, revision 1.1.2.2
1.1.2.1 misho 1: #include "global.h"
2: #include "upd.h"
3:
4:
1.1.2.2 ! misho 5: int Activate(const char *csImg)
1.1.2.1 misho 6: {
1.1.2.2 ! misho 7: char szDir[MAXPATHLEN];
1.1.2.1 misho 8:
1.1.2.2 ! misho 9: getcwd(szDir, MAXPATHLEN);
! 10: VERB(3) printf("Activate procedure for %s\n", szDir);
! 11:
! 12: if (access(csImg, R_OK) == -1) {
! 13: printf("Error:: Unable to find new image %s #%d - %s\n",
! 14: csImg, errno, strerror(errno));
! 15: return -1;
! 16: } else {
! 17: strlcat(szDir, "/", MAXPATHLEN);
! 18: strlcat(szDir, csImg, MAXPATHLEN);
! 19: }
! 20:
! 21: unlink(FIRMWARE_IMG);
! 22: if (symlink(szDir, FIRMWARE_IMG) == -1) {
! 23: printf("Error:: Unable to activate new image %s #%d - %s\n",
! 24: csImg, errno, strerror(errno));
! 25: return -2;
! 26: }
! 27:
! 28: syslog(LOG_NOTICE, "Activate new image %s", csImg);
! 29: VERB(1) printf("Activate new image %s\n", csImg);
1.1.2.1 misho 30: return 0;
31: }
32:
33: int Install()
34: {
35: VERB(3) printf("Install procedure\n");
36:
37: return 0;
38: }
39:
40: int Rollback()
41: {
42: VERB(3) printf("Rollback procedure\n");
43:
44: return 0;
45: }
46:
47: int tFTP()
48: {
49: VERB(3) printf("tFTP procedure\n");
50:
51: return 0;
52: }
53:
54: int Backup()
55: {
56: VERB(3) printf("Backup procedure\n");
57:
58: return 0;
59: }
60:
61: int Clean()
62: {
63: VERB(3) printf("Clean procedure\n");
64:
65: return 0;
66: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>