hgmo: handle /boot unmount (
bug 1263973); r?kang
In production, there is a /boot/efi mount. So, skip /boot during
the first pass so we don't try to unmount things with children.
MozReview-Commit-ID: J4xRsxHp08r
--- a/testing/docker/builder-hgweb-chroot/mozbuild-eval.c
+++ b/testing/docker/builder-hgweb-chroot/mozbuild-eval.c
@@ -102,16 +102,19 @@ static int call_mozbuildinfo(void* repo_
if (!fmount) {
fprintf(stderr, "unable to open /proc/mounts\n");
return 1;
}
while ((mnt = getmntent(fmount))) {
/* These can't be deleted during our first pass because there
* are child mounts. */
+ if (strcmp(mnt->mnt_dir, "/boot") == 0) {
+ continue;
+ }
if (strcmp(mnt->mnt_dir, "/dev") == 0) {
continue;
}
if (strcmp(mnt->mnt_dir, "/proc") == 0) {
continue;
}
/* We can't unmount /sys in first pass because cgroups are present. */
if (strcmp(mnt->mnt_dir, "/sys") == 0) {
@@ -141,16 +144,21 @@ static int call_mozbuildinfo(void* repo_
return 1;
}
}
/* Always returns 1. */
endmntent(fmount);
/* Now unmount skips since children should be gone. */
+ if (umount2("/boot", 0)) {
+ fprintf(stderr, "unable to unmount /boot\n");
+ return 1;
+ }
+
if (umount2("/dev", 0)) {
fprintf(stderr, "unable to unmount /dev\n");
return 1;
}
/* It is especially important that proc is unmounted because
* historically there have been a lot of root privilege escalation
* bugs in procfs. */