xbps-uchroot: try to bind mount /proc if a new instance fails.

This should help uchroot to work in the travis-ci containers (hopefully).
This commit is contained in:
Juan RP 2015-04-11 08:47:40 +02:00
parent 3ef9350787
commit f78c2986d4

View File

@ -275,8 +275,10 @@ main(int argc, char **argv)
/* mount /proc */
snprintf(mountdir, sizeof(mountdir), "%s/proc", chrootdir);
if (mount("proc", mountdir, "proc", MS_MGC_VAL|MS_PRIVATE, NULL) == -1)
die("Failed to mount %s", mountdir);
if (mount("proc", mountdir, "proc", MS_MGC_VAL|MS_PRIVATE, NULL) == -1) {
/* try bind mount */
bindmount(ruid, chrootdir, "/proc", NULL);
}
/* bind mount /sys */
bindmount(ruid, chrootdir, "/sys", NULL);