Ubuntu Pastebin

Paste from zyga at Thu, 15 Sep 2016 14:32:52 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
diff --git a/src/mount-support.c b/src/mount-support.c
index 51d76d1..6eeef5b 100644
--- a/src/mount-support.c
+++ b/src/mount-support.c
@@ -162,6 +162,7 @@ static void sc_mkdir_hostfs_if_missing()
 	}
 }
 
+#if 0
 static void sc_bind_mount_hostfs(const char *rootfs_dir)
 {
 	// Create a read-only bind mount from "/" to
@@ -178,6 +179,7 @@ static void sc_bind_mount_hostfs(const char *rootfs_dir)
 		}
 	}
 }
+#endif
 
 // Bind mount the snap mount directory. Unlike other directories above the
 // location of the mount directory on the host filesystem may not match the
@@ -223,15 +225,17 @@ static void sc_pivot_to_new_rootfs(const char *rootfs_dir)
 		die("cannot move to new root file system directory");
 	}
 	debug("using pivot_root to move into %s", rootfs_dir);
-	if (syscall(SYS_pivot_root, ".", ".") == -1) {
+	if (syscall(SYS_pivot_root, ".", "var/lib/snapd/hostfs") == -1) {
 		die("cannot pivot_root to the new root filesystem");
 	}
 	if (fchdir(old_rootfs_fd) == -1) {
 		die("cannot move to the old root file system directory");
 	}
+#if 0
 	if (umount2(".", MNT_DETACH) == -1) {
 		die("cannot detach old root file system directory");
 	}
+#endif
 	if (fchdir(new_rootfs_fd) == -1) {
 		die("cannot move to the new root file system directory");
 	}
@@ -320,8 +324,8 @@ static void setup_snappy_os_mounts()
 		}
 	}
 	sc_mkdir_hostfs_if_missing();
-	sc_bind_mount_hostfs(rootfs_dir);
-	sc_mount_nvidia_driver(rootfs_dir);
+	// sc_bind_mount_hostfs(rootfs_dir);
+	// sc_mount_nvidia_driver(rootfs_dir);
 	sc_pivot_to_new_rootfs(rootfs_dir);
 	// Reset path as we cannot rely on the path from the host OS to
 	// make sense. The classic distribution may use any PATH that makes
Download as text