summaryrefslogtreecommitdiffstats
path: root/recipes/ostree/ostree/deploy-add-karg-none-argument.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/ostree/ostree/deploy-add-karg-none-argument.patch')
-rw-r--r--recipes/ostree/ostree/deploy-add-karg-none-argument.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/recipes/ostree/ostree/deploy-add-karg-none-argument.patch b/recipes/ostree/ostree/deploy-add-karg-none-argument.patch
new file mode 100644
index 0000000..5eaf68f
--- /dev/null
+++ b/recipes/ostree/ostree/deploy-add-karg-none-argument.patch
@@ -0,0 +1,62 @@
1From 9ca3a2cc64bc709649d0d756fa715aaef807dca8 Mon Sep 17 00:00:00 2001
2From: Gatis Paeglis <gatis.paeglis@qt.io>
3Date: Fri, 12 Aug 2016 11:51:04 +0200
4Subject: [PATCH 2/4] deploy: add --karg-none argument
5
6If the current deployment has "rootwait root=/dev/sda2",
7but the new deployment does not need "rootwait" anymore,
8there is no way to clear this arg at the moment (as opposed
9to "karg=root=", which overrides any earlier argument with
10the same name). With "--karg-none" users can now clear all
11the previous args and set new "root=":
12
13ostree admin deploy --karg-none --karg=root=LABEL=rootfs
14---
15 src/ostree/ot-admin-builtin-deploy.c | 10 +++++++++-
16 1 file changed, 9 insertions(+), 1 deletion(-)
17
18diff --git a/src/ostree/ot-admin-builtin-deploy.c b/src/ostree/ot-admin-builtin-deploy.c
19index c66c9b3..420efa3 100644
20--- a/src/ostree/ot-admin-builtin-deploy.c
21+++ b/src/ostree/ot-admin-builtin-deploy.c
22@@ -38,6 +38,7 @@ static char **opt_kernel_argv_append;
23 static gboolean opt_kernel_proc_cmdline;
24 static char *opt_osname;
25 static char *opt_origin_path;
26+static gboolean opt_kernel_arg_none;
27
28 static GOptionEntry options[] = {
29 { "os", 0, 0, G_OPTION_ARG_STRING, &opt_osname, "Use a different operating system root than the current one", "OSNAME" },
30@@ -46,6 +47,7 @@ static GOptionEntry options[] = {
31 { "karg-proc-cmdline", 0, 0, G_OPTION_ARG_NONE, &opt_kernel_proc_cmdline, "Import current /proc/cmdline", NULL },
32 { "karg", 0, 0, G_OPTION_ARG_STRING_ARRAY, &opt_kernel_argv, "Set kernel argument, like root=/dev/sda1; this overrides any earlier argument with the same name", "NAME=VALUE" },
33 { "karg-append", 0, 0, G_OPTION_ARG_STRING_ARRAY, &opt_kernel_argv_append, "Append kernel argument; useful with e.g. console= that can be used multiple times", "NAME=VALUE" },
34+ { "karg-none", 0, 0, G_OPTION_ARG_NONE, &opt_kernel_arg_none, "Do not import kernel arguments", NULL },
35 { NULL }
36 };
37
38@@ -77,6 +79,12 @@ ot_admin_builtin_deploy (int argc, char **argv, GCancellable *cancellable, GErro
39 goto out;
40 }
41
42+ if (opt_kernel_proc_cmdline && opt_kernel_arg_none)
43+ {
44+ ot_util_usage_error (context, "Can't specify both --karg-proc-cmdline and --karg-none", error);
45+ goto out;
46+ }
47+
48 refspec = argv[1];
49
50 if (!ostree_sysroot_load (sysroot, cancellable, error))
51@@ -135,7 +143,7 @@ ot_admin_builtin_deploy (int argc, char **argv, GCancellable *cancellable, GErro
52 if (!_ostree_kernel_args_append_proc_cmdline (kargs, cancellable, error))
53 goto out;
54 }
55- else if (merge_deployment)
56+ else if (merge_deployment && !opt_kernel_arg_none)
57 {
58 OstreeBootconfigParser *bootconfig = ostree_deployment_get_bootconfig (merge_deployment);
59 g_auto(GStrv) previous_args = g_strsplit (ostree_bootconfig_parser_get (bootconfig, "options"), " ", -1);
60--
612.7.4
62