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