diff --git a/src/ostree/ot-admin-builtin-deploy.c b/src/ostree/ot-admin-builtin-deploy.c index 77a7e21f..f4246943 100644 --- a/src/ostree/ot-admin-builtin-deploy.c +++ b/src/ostree/ot-admin-builtin-deploy.c @@ -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: diff --git a/src/ostree/ot-admin-builtin-update-kernel.c b/src/ostree/ot-admin-builtin-update-kernel.c index 57f23283..699456c5 100644 --- a/src/ostree/ot-admin-builtin-update-kernel.c +++ b/src/ostree/ot-admin-builtin-update-kernel.c @@ -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: