update_kernel: Get kernel commandline arguments w/ vbutil

Using the vbutil program 'dump_kernel_config' will give us the
pre-mangled commandline arguments. This helps in cases where we're
updating a vboot kernel and want to use the unmodified commandline
parameters such as 'PARTUUID=%U'. It also helps avoid
https://crbug.com/907772 that had to cut down on the number of
cros_secure that /proc/cmdline had because depthcharge adds it even when
it's already present.

BUG=None
TEST=Update kernel on cheza using remote bootargs, see same commandline
arguments as before

Change-Id: I97f0870252b1abc63104da02b963cf91cb6046a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosutils/+/1933595
Tested-by: Stephen Boyd <swboyd@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/update_kernel.sh b/update_kernel.sh
index 78df51a..73acaf4 100755
--- a/update_kernel.sh
+++ b/update_kernel.sh
@@ -127,9 +127,8 @@
 
   if [ ${FLAGS_remote_bootargs} -eq ${FLAGS_TRUE} ] ; then
     info "Using remote bootargs"
-    remote_sh cat /proc/cmdline
-    # Remove multiple instances of cros_secure, https://crbug.com/907772
-    echo "${REMOTE_OUT}" | sed -E 's/\b(cros_secure )+/cros_secure /g'
+    remote_sh dump_kernel_config "${FLAGS_partition}"
+    printf '%s' "${REMOTE_OUT}"
   else
     if [ -n "${FLAGS_rootoff}" ]; then
       sed "s/PARTNROFF=1/PARTNROFF=${FLAGS_rootoff}/" "${local_config}"