TRIPLEDRAGON: deleted

Origin commit data
------------------
Commit: b4bab59f38
Author: max_10 <max_10@gmx.de>
Date: 2020-10-03 (Sat, 03 Oct 2020)

Origin message was:
------------------
- TRIPLEDRAGON: deleted
This commit is contained in:
max_10
2020-10-03 22:47:34 +02:00
committed by vanhofen
parent 1d416e4660
commit e1e694e6c8
26 changed files with 22 additions and 645 deletions

View File

@@ -1254,39 +1254,6 @@ _remount:
snprintf(cmd, sizeof(cmd), "%s/plugins", dst.c_str());
safe_mkdir(cmd);
// sync();
#if HAVE_TRIPLEDRAGON
/* on the tripledragon, we mount via fstab, so we need to add an
fstab entry for dst */
FILE *g;
char *line = NULL;
unlink("/etc/fstab.new");
g = fopen("/etc/fstab.new", "w");
f = fopen("/etc/fstab", "r");
if (!g)
perror("open /etc/fstab.new");
else {
if (f) {
int ret;
while (true) {
size_t dummy;
ret = getline(&line, &dummy, f);
if (ret < 0)
break;
/* remove lines that start with the same disk we formatted
devname is /dev/xda" */
if (strncmp(line, devname.c_str(), devname.length()) != 0)
fprintf(g, "%s", line);
}
free(line);
fclose(f);
}
/* now add our new entry */
fprintf(g, "%s %s auto defaults 0 0\n", partname.c_str(), dst.c_str());
fclose(g);
rename("/etc/fstab", "/etc/fstab.old");
rename("/etc/fstab.new", "/etc/fstab");
}
#endif
}
}
_return: