LAKITU: Append sudo to commands that read grub.cfg.

These changes are required for the following CL:
https://cos-review.googlesource.com/c/cos/overlays/board-overlays/+/11774

BUG=b/177854826
TEST=presubmit
RELEASE_NOTE=None

Change-Id: I296674b9ef010e194b883e36ff8164c66e07e131
Reviewed-on: https://cos-review.googlesource.com/c/third_party/platform/crosutils/+/11430
Reviewed-by: Robert Kolchmeyer <rkolchmeyer@google.com>
Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
diff --git a/bin/cros_make_image_bootable b/bin/cros_make_image_bootable
index 46a09b2..0f33aa8 100755
--- a/bin/cros_make_image_bootable
+++ b/bin/cros_make_image_bootable
@@ -161,7 +161,7 @@
   local base_pattern="$3"
 
   [ -f "${file}" ] || return ${FLAGS_TRUE}
-  grep -wq "${pattern}" "${file}" && return ${FLAGS_TRUE}
+  sudo grep -wq "${pattern}" "${file}" && return ${FLAGS_TRUE}
   sudo sed -i "s/\b${base_pattern}\b/& ${pattern}/g" "${file}"
 }
 
diff --git a/update_bootloaders.sh b/update_bootloaders.sh
index df4bf22..3c22110 100755
--- a/update_bootloaders.sh
+++ b/update_bootloaders.sh
@@ -97,7 +97,7 @@
     # Rewrite grub table
     grub_dm_table_a=${dm_table//${old_root}/${root_a_uuid}}
     grub_dm_table_b=${dm_table//${old_root}/${root_b_uuid}}
-    sed -e "s|DMTABLEA|${grub_dm_table_a}|g" \
+    sudo sed -e "s|DMTABLEA|${grub_dm_table_a}|g" \
         -e "s|DMTABLEB|${grub_dm_table_b}|g" \
         -e "s|/dev/\\\$linuxpartA|${root_a_uuid}|g" \
         -e "s|/dev/\\\$linuxpartB|${root_b_uuid}|g" \