[glick2] Move bundle contents from /opt/bundle to /opt/bundle/data



commit 85aa83de7ef0971f654b4aea1a508fdcee540ff7
Author: Alexander Larsson <alexl redhat com>
Date:   Tue Nov 22 14:36:23 2011 +0100

    Move bundle contents from /opt/bundle to /opt/bundle/data
    
    This way we can work around a problem with older kernels where we can't
    bind mount into a fuse mount.

 fs.c     |   10 ++++++++--
 helper.c |    6 +++---
 2 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/fs.c b/fs.c
index 1e53848..777c426 100644
--- a/fs.c
+++ b/fs.c
@@ -93,6 +93,7 @@ typedef struct {
   ino_t fd_ino;
   guint64 fd_size;
 
+  GlickInodeDir *top_dir;
   GlickInodeDir *dir;
   GList *slices;
   GList *triggers;
@@ -2061,9 +2062,10 @@ glick_mount_unref (GlickMount *mount)
 	  glick_slice_unref (slice);
 	}
 
-      glick_inode_dir_remove_all_children (mount->dir);
+      glick_inode_dir_remove_all_children (mount->top_dir);
       glick_inode_dir_remove_child (glick_root, mount->name, TRUE);
       glick_inode_unref ((GlickInode *)mount->dir);
+      glick_inode_unref ((GlickInode *)mount->top_dir);
 
       glick_mounts = g_list_remove (glick_mounts, mount);
 
@@ -2092,8 +2094,12 @@ glick_mount_new (const char *name)
 
   glick_mounts = g_list_prepend (glick_mounts, mount);
 
+  mount->top_dir = glick_inode_new_dir ();
+  glick_inode_dir_add_child (glick_root, mount->name, (GlickInode *)mount->top_dir);
+  glick_inode_own ((GlickInode *)mount->top_dir);
+  glick_inode_set_immutable ((GlickInode *)mount->top_dir, TRUE);
   mount->dir = glick_inode_new_dir ();
-  glick_inode_dir_add_child (glick_root, mount->name, (GlickInode *)mount->dir);
+  glick_inode_dir_add_child (mount->top_dir, "data", (GlickInode *)mount->dir);
   glick_inode_own ((GlickInode *)mount->dir);
   glick_inode_set_immutable ((GlickInode *)mount->dir, TRUE);
   mount->dir->mount = mount;
diff --git a/helper.c b/helper.c
index fda42c6..67e28db 100644
--- a/helper.c
+++ b/helper.c
@@ -185,10 +185,10 @@ main (int argc,
     executable = executable_relative;
   else
     {
-      executable = malloc (strlen (BUNDLE_PREFIX) + strlen (executable_relative) + 1);
+      executable = malloc (strlen (BUNDLE_PREFIX "/data") + strlen (executable_relative) + 1);
       if (executable != NULL)
 	{
-	  strcpy (executable, BUNDLE_PREFIX);
+	  strcpy (executable, BUNDLE_PREFIX "/data");
 	  strcat (executable, executable_relative);
 	}
     }
@@ -205,7 +205,7 @@ main (int argc,
     child_argv[j++] = argv[i];
   child_argv[j++] = NULL;
 
-  update_env_var_list ("LD_LIBRARY_PATH", BUNDLE_PREFIX "/lib");
+  update_env_var_list ("LD_LIBRARY_PATH", BUNDLE_PREFIX "/data/lib");
 
   __debug__(("launch executable\n"));
   return execv (executable, child_argv);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]