 +		free(dpath);
 +	}
 +	closedir(dir);
- 	/* Mount tmpfs at new cgroup directory */
- 	if (mount("tmpfs", cgroup_path, "tmpfs", MS_NODEV|MS_NOSUID, options) == -1) {
- 		pr_perror("%s: Failed to mount tmpfs at %s", id, cgroup_path);
+ 	if (remount_readonly(id, cgroup_path, cgroup_path) < 0) {
+ 		return -1;
+ 	}
 -- 
-2.19.1
+2.7.4
 

From f9c640fa1d4c14dfbd2bc40af91cb446ad373075 Mon Sep 17 00:00:00 2001
From: Jason Wessel <jason.wessel@windriver.com>
Date: Tue, 2 Jul 2019 20:51:08 +0000
Subject: [PATCH] Add additional cgroup mounts from root NS automatically

 
 	if (asprintf(&cgroup_path, "%s/%s", rootfs, CGROUP_ROOT) < 0) {
 		pr_perror("%s: Failed to create path for %s", id, CGROUP_ROOT);
@@ -292,6 +297,46 @@ static int mount_cgroup(const char *id, const char *rootfs, const char *options,
 		pr_perror("%s: Failed to mkdir new dest: %s", id, systemd_path);
 		return -1;
 	}
+	/* Create all additional cgroup mounts which are in the root namespace */
