#include "global.h"
#include "upd.h"
int Activate(const char *csImg)
{
char szDir[MAXPATHLEN];
getcwd(szDir, MAXPATHLEN);
VERB(3) printf("Activate procedure for %s\n", szDir);
if (access(csImg, R_OK) == -1) {
printf("Error:: Unable to find new image %s #%d - %s\n",
csImg, errno, strerror(errno));
return -1;
} else {
strlcat(szDir, "/", MAXPATHLEN);
strlcat(szDir, csImg, MAXPATHLEN);
}
unlink(FIRMWARE_IMG);
if (symlink(szDir, FIRMWARE_IMG) == -1) {
printf("Error:: Unable to activate new image %s #%d - %s\n",
csImg, errno, strerror(errno));
return -2;
}
syslog(LOG_NOTICE, "Activate new image %s", csImg);
VERB(1) printf("Activate new image %s\n", csImg);
return 0;
}
int Install()
{
VERB(3) printf("Install procedure\n");
return 0;
}
int Rollback()
{
VERB(3) printf("Rollback procedure\n");
return 0;
}
int tFTP()
{
VERB(3) printf("tFTP procedure\n");
return 0;
}
int Backup()
{
VERB(3) printf("Backup procedure\n");
return 0;
}
int Clean()
{
VERB(3) printf("Clean procedure\n");
return 0;
}
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>