copy_modules fails in ostadmin, no errors printed



Hi,


While setting up ostree in my box, I hit a problem when dracut ran
because it could not find some modules.

Apparently copy_modules in ot-admin-builtin-deply.c fails for some
reason but the GError is not being printed at all.

The function is returning TRUE despite **error being set.

Worse, when finishing, ot-admin-main.c does not print anything related
to *error (it should, right?).

I suspect the reusage of **error between many functions is causing some
hiccups. Is this a known issue? Or is it just me wrongly reading the
code?

I am attaching a small verbosity addition for that function (proposing),
and a handy debug patch which lead me to this conclusion/suspicion.


Diego

PS: Today's journey https://live.gnome.org/OSTree/CommonIssues
>From 3222262348fba475146a7ac0d1a4088dd07c8158 Mon Sep 17 00:00:00 2001
From: Diego Escalante Urrelo <diegoe igalia com>
Date: Tue, 14 Aug 2012 21:08:50 -0500
Subject: [PATCH 1/2] ostadmin: say that we are copying kernel modules

It takes more than a few seconds in my system, and it is an awkward
silence.
---
 src/ostadmin/ot-admin-builtin-deploy.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/ostadmin/ot-admin-builtin-deploy.c b/src/ostadmin/ot-admin-builtin-deploy.c
index e35eeec..7c54e67 100644
--- a/src/ostadmin/ot-admin-builtin-deploy.c
+++ b/src/ostadmin/ot-admin-builtin-deploy.c
@@ -53,6 +53,8 @@ copy_modules (const char    *release,
   ot_lobj GFile *dest_modules_parent = NULL;
   ot_lobj GFile *dest_modules_file = NULL;
   
+  g_print ("Copying modules for kernel %s\n", release);
+
   src_modules_file = ot_gfile_from_build_path ("/lib/modules", release, NULL);
   dest_modules_file = ot_gfile_from_build_path (opt_ostree_dir, "modules", release, NULL);
   dest_modules_parent = g_file_get_parent (dest_modules_file);
@@ -68,7 +70,10 @@ copy_modules (const char    *release,
   ret = TRUE;
  out:
   if (error)
-    g_prefix_error (error, "Error copying kernel modules: ");
+    {
+      g_prefix_error (error, "Error copying kernel modules: ");
+      g_print ("Error copying modules for kernel %s\n", release);
+    }
   return ret;
 }
 
-- 
1.7.10.4

>From 6d6a65ce2b2f7bf3e5856f46e8d92fab2f1ac254 Mon Sep 17 00:00:00 2001
From: Diego Escalante Urrelo <diegoe igalia com>
Date: Tue, 14 Aug 2012 21:10:02 -0500
Subject: [PATCH 2/2] ostadmin: debugging re: the GError bug

---
 src/ostadmin/ot-admin-builtin-deploy.c |    4 ++++
 src/ostadmin/ot-admin-main.c           |    1 +
 2 files changed, 5 insertions(+)

diff --git a/src/ostadmin/ot-admin-builtin-deploy.c b/src/ostadmin/ot-admin-builtin-deploy.c
index 7c54e67..66c797f 100644
--- a/src/ostadmin/ot-admin-builtin-deploy.c
+++ b/src/ostadmin/ot-admin-builtin-deploy.c
@@ -74,6 +74,8 @@ copy_modules (const char    *release,
       g_prefix_error (error, "Error copying kernel modules: ");
       g_print ("Error copying modules for kernel %s\n", release);
     }
+
+  g_print ("copy_modules return value: %s\n", ret ? "TRUE" : "FALSE");
   return ret;
 }
 
@@ -128,6 +130,8 @@ update_initramfs (const char       *release,
       g_ptr_array_add (mkinitramfs_args, NULL);
           
       g_print ("Generating initramfs using %s...\n", last_deploy_path);
+      g_print ("Calling dracut as %s\n", g_strjoinv (" ", (char**)mkinitramfs_args->pdata));
+
       if (!ot_spawn_sync_checked (NULL, (char**)mkinitramfs_args->pdata, NULL,
                                   G_SPAWN_SEARCH_PATH,
                                   NULL, NULL, NULL, NULL, error))
diff --git a/src/ostadmin/ot-admin-main.c b/src/ostadmin/ot-admin-main.c
index 52b26f6..39e93b7 100644
--- a/src/ostadmin/ot-admin-main.c
+++ b/src/ostadmin/ot-admin-main.c
@@ -132,6 +132,7 @@ ot_admin_main (int    argc,
   g_free (cmd_argv);
   if (error)
     {
+      g_print ("====== %s\n", error->message);
       g_printerr ("%s\n", error->message);
       g_clear_error (&error);
       return 1;
-- 
1.7.10.4



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