When adding a new kernel to bootload we want the arguments of
the default entry to be kept in the new entry, otherwise that
entry might not boot (example, if we disregard LVM parameters
and the root is on an LVM volume, the entry won't boot).

So, instead of setting the arguments while the kernel entry
is being created (doing this with boottool will completely
disregard any arguments of the default entry), create the
new entry *then* add the additional arguments, one by one.
In every new addition, if the arg is already on the arg list,
the arg won't be added, therefore avoiding duplicate args.

Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
---
 client/bin/kernel.py |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/client/bin/kernel.py b/client/bin/kernel.py
index 4b333ea..c71efc2 100644
--- a/client/bin/kernel.py
+++ b/client/bin/kernel.py
@@ -59,9 +59,13 @@ def _add_kernel_to_bootloader(bootloader, base_args, tag, 
args, image, initrd):
         else:
             arglist.append(arg)
 
-    # add the kernel entry
-    bootloader.add_kernel(image, tag, initrd=initrd, args=' '.join(arglist),
-                          root=root)
+    # add the kernel entry. it will keep all arguments from the default entry
+    bootloader.add_kernel(image, tag, initrd=initrd, root=root)
+    # Now, for each argument in arglist, try to add it to the kernel that was
+    # just added. In each step, if the arg already existed on the args string,
+    # that particular arg will be skipped
+    for a in arglist:
+        bootloader.add_args(kernel=tag, args=a)
 
 
 class BootableKernel(object):
-- 
1.7.2.3

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to