[ostree] deploy: Also honor multiply-specified kernel args with existing config
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] deploy: Also honor multiply-specified kernel args with existing config
- Date: Tue, 5 Aug 2014 14:14:55 +0000 (UTC)
commit 82fb07e4ae756aac2dc32f50ff75ad84dce223c0
Author: Colin Walters <walters verbum org>
Date: Sun Aug 3 14:32:52 2014 -0400
deploy: Also honor multiply-specified kernel args with existing config
If we deployed a new tree inside an existing OS, inheriting kernel
args, we need to use append() instead of replace() to avoid collapsing
multiply specified kernel arguments like console=/dev/foo
console=/dev/bar.
Reported-by: Dusty Mabe <dusty dustymabe com>
src/ostree/ot-admin-builtin-deploy.c | 2 +-
tests/admin-test.sh | 15 +++++++++++++++
2 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/src/ostree/ot-admin-builtin-deploy.c b/src/ostree/ot-admin-builtin-deploy.c
index a99cc89..a209c26 100644
--- a/src/ostree/ot-admin-builtin-deploy.c
+++ b/src/ostree/ot-admin-builtin-deploy.c
@@ -150,7 +150,7 @@ ot_admin_builtin_deploy (int argc, char **argv, OstreeSysroot *sysroot, GCancell
OstreeBootconfigParser *bootconfig = ostree_deployment_get_bootconfig (merge_deployment);
gs_strfreev char **previous_args = g_strsplit (ostree_bootconfig_parser_get (bootconfig, "options"), "
", -1);
- _ostree_kernel_args_replace_argv (kargs, previous_args);
+ _ostree_kernel_args_append_argv (kargs, previous_args);
}
if (opt_kernel_argv)
diff --git a/tests/admin-test.sh b/tests/admin-test.sh
index 8520b88..c77e416 100755
--- a/tests/admin-test.sh
+++ b/tests/admin-test.sh
@@ -154,3 +154,18 @@ if ostree admin --sysroot=sysroot deploy --os=unknown testos:testos/buildmaster/
assert_not_reached "Unexpected successful deploy of unknown OS"
fi
echo "ok deploy with unknown OS"
+
+ostree admin --sysroot=sysroot deploy --os=testos --karg-append=console=/dev/foo
--karg-append=console=/dev/bar testos:testos/buildmaster/x86_64-runtime
+ostree admin --sysroot=sysroot deploy --os=testos testos:testos/buildmaster/x86_64-runtime
+assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'console=/dev/foo.*console=/dev/bar'
+
+echo "ok deploy with multiple kernel args"
+
+origrev=$(ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime)
+os_repository_new_commit 0 "test upgrade multiple kernel args"
+ostree admin --sysroot=sysroot upgrade --os=testos
+newrev=$(ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime)
+assert_not_streq ${origrev} ${newrev}
+assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'console=/dev/foo.*console=/dev/bar'
+
+echo "ok upgrade with multiple kernel args"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]