deploy: With --no-kernel, do copy host kernel modules

This is used by the qemu scripts, and there we *do* need the kernel
modules inside the target system.
This commit is contained in:
Colin Walters 2012-11-21 12:38:29 -05:00
parent 05e7b6d596
commit f2b1be6a1e
2 changed files with 16 additions and 11 deletions

View File

@ -548,6 +548,8 @@ do_update_kernel (OtAdminDeploy *self,
"--ostree-dir", ot_gfile_get_path_cached (self->ostree_dir),
"update-kernel",
ot_gfile_get_path_cached (deploy_path), NULL);
if (opt_no_kernel)
g_ptr_array_add (args, "--modules-only");
g_ptr_array_add (args, NULL);
if (!ot_spawn_sync_checked (ot_gfile_get_path_cached (self->ostree_dir),
@ -606,11 +608,8 @@ ot_admin_builtin_deploy (int argc, char **argv, GFile *ostree_dir, GError **erro
cancellable, error))
goto out;
if (!opt_no_kernel)
{
if (!do_update_kernel (self, deploy_path, cancellable, error))
goto out;
}
if (!do_update_kernel (self, deploy_path, cancellable, error))
goto out;
ret = TRUE;
out:

View File

@ -32,7 +32,10 @@ typedef struct {
GFile *ostree_dir;
} OtAdminUpdateKernel;
static gboolean opt_modules_only;
static GOptionEntry options[] = {
{ "modules-only", 0, 0, G_OPTION_ARG_NONE, &opt_modules_only, "Only copy kernel modules", NULL },
{ NULL }
};
@ -322,12 +325,15 @@ ot_admin_builtin_update_kernel (int argc, char **argv, GFile *ostree_dir, GError
if (!copy_modules (self, release, cancellable, error))
goto out;
if (!update_initramfs (self, release, deploy_path, cancellable, error))
goto out;
if (!update_grub (self, release, cancellable, error))
goto out;
if (!opt_modules_only)
{
if (!update_initramfs (self, release, deploy_path, cancellable, error))
goto out;
if (!update_grub (self, release, cancellable, error))
goto out;
}
ret = TRUE;
out: