enter_chroot: add a note for users to ssh_config import
Make it clear to devs that edits to the copy inside the SDK will be
lost, and provided tips for how to change behavior dynamically.
BUG=None
TEST=`cros_sdk` has the updated file & comment block
Change-Id: Ib5e7818a72069c5160eb5ad069b68519be3ef531
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosutils/+/3244430
Tested-by: Mike Frysinger <vapier@chromium.org>
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Chris McDonald <cjmcdonald@chromium.org>
Reviewed-by: Chris McDonald <cjmcdonald@chromium.org>
diff --git a/sdk_lib/enter_chroot.sh b/sdk_lib/enter_chroot.sh
index 4a1fdd9..8842922 100755
--- a/sdk_lib/enter_chroot.sh
+++ b/sdk_lib/enter_chroot.sh
@@ -205,8 +205,18 @@
fi
done
- sed "/^.*\(${filter}\).*$/d" "${chroot_ssh_dir}/config.orig" | \
- user_clobber "${chroot_ssh_dir}/config"
+ (
+ cat <<EOF
+### DO NOT EDIT ###
+# File is imported & synced from the copy outside of the SDK.
+# Modifications to this version will be lost!
+#
+# If you want directives to change behavior between inside & outside of the SDK:
+# Match Exec "test -f /etc/cros_chroot_version"
+
+EOF
+ sed "/^.*\(${filter}\).*$/d" "${chroot_ssh_dir}/config.orig"
+ ) | user_clobber "${chroot_ssh_dir}/config"
}
copy_into_chroot_if_exists() {