Skip to content
Snippets Groups Projects
Commit b418ca48 authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

Do not attempt to unmount SS_LIVE

parent e3fa5ba9
No related branches found
No related tags found
No related merge requests found
......@@ -23,10 +23,13 @@
#include <sys/mount.h>
#include <oblibs/log.h>
#include <oblibs/string.h>
#include <skalibs/stralloc.h>
#include <skalibs/skamisc.h>
#include <66/config.h>
#define MAXLINES 99
#define EXCLUDEN 3
......@@ -35,16 +38,20 @@ static char const *exclude_type[EXCLUDEN] = { "devtmpfs", "proc", "sysfs" } ;
int main (int argc, char const *const *argv)
{
size_t mountpoints[MAXLINES] ;
size_t mountpoints[MAXLINES], tmplen = strlen(SS_LIVE), len = 0 ;
char tmpdir[tmplen + 1] ;
dirname(tmpdir,SS_LIVE) ;
len = strlen(tmpdir) ;
if (tmpdir[len-1] == '/')
tmpdir[len-1] = 0 ;
unsigned int got[EXCLUDEN] = { 0, 0, 0 } ;
stralloc sa = STRALLOC_ZERO ;
unsigned int line = 0 ;
FILE *fp ;
FILE *fp = setmntent("/proc/mounts", "r") ;
int e = 0 ;
PROG = "s6-linux-init-umountall" ;
PROG = "66-umountall" ;
fp = setmntent("/proc/mounts", "r") ;
if (!fp) log_dieusys(LOG_EXIT_SYS, "open /proc/mounts") ;
for (;;)
......@@ -62,7 +69,8 @@ int main (int argc, char const *const *argv)
break ;
}
}
if (i < EXCLUDEN && got[i] == 1) continue ;
if ((i < EXCLUDEN && got[i] == 1) || !strcmp(p->mnt_dir,tmpdir))
continue ;
if (line >= MAXLINES)
log_die(100, "too many mount points") ;
mountpoints[line++] = sa.len ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment