From f78c2986d4837952efbc618b0ae66ce5f3a9e59b Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 11 Apr 2015 08:47:40 +0200 Subject: [PATCH] xbps-uchroot: try to bind mount /proc if a new instance fails. This should help uchroot to work in the travis-ci containers (hopefully). --- bin/xbps-uchroot/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/xbps-uchroot/main.c b/bin/xbps-uchroot/main.c index 501e2223..a81a4ba6 100644 --- a/bin/xbps-uchroot/main.c +++ b/bin/xbps-uchroot/main.c @@ -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);