summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMartin Roth <gaumless@gmail.com>2022-05-22 19:11:04 -0600
committerMartin L Roth <gaumless@tutanota.com>2022-06-07 15:49:56 +0000
commit124c418ccf4d0e786d2a5718920bf9cea79a9097 (patch)
tree379c0a97e5ebcfeb95a730044a038c3107671250 /util
parent56846091f1368365e6136760c9e91e3d95ce1dfb (diff)
util/util_readme: update to give additional information
Add a note to the top of the util.md document saying not to edit it. The Documentation/util.md file had been updated to contain additional information at the bottom. This copies that information into the file after it's been created. Change-Id: I4b08439420ceb706df62e3949406585ea34c1514 Signed-off-by: Martin Roth <gaumless@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64580 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'util')
-rw-r--r--util/util_readme/post_util.md16
-rwxr-xr-xutil/util_readme/util_readme.sh20
2 files changed, 33 insertions, 3 deletions
diff --git a/util/util_readme/post_util.md b/util/util_readme/post_util.md
new file mode 100644
index 0000000000..9533cb192a
--- /dev/null
+++ b/util/util_readme/post_util.md
@@ -0,0 +1,16 @@
+## In depth documentation
+
+* [cbfstool](util/cbfstool/index.md)
+* [ifdtool](util/ifdtool/index.md)
+* [intelp2m](util/intelp2m/index.md)
+
+## Generated documentation
+
+**Please do not edit the markdown file in the documentation directory
+*directly.**
+
+This file was generated by running util_readme.sh. Please make sure it
+is rerun when new tools are added or when documentation is updated.
+
+To update, edit the markdown files in the util directory, then
+re-generate this file by running `util/util_readme/util_readme.sh`
diff --git a/util/util_readme/util_readme.sh b/util/util_readme/util_readme.sh
index af688c4b0d..986c393ca8 100755
--- a/util/util_readme/util_readme.sh
+++ b/util/util_readme/util_readme.sh
@@ -10,13 +10,25 @@ UTIL_README_DIR="$(cd "$(dirname "$0")" || exit; pwd -P)"
UTIL_DIR=$(dirname "$UTIL_README_DIR")
COREBOOT_ROOT_DIR=$(dirname "$UTIL_DIR")
DOCMENTATION_DIR="$COREBOOT_ROOT_DIR/Documentation"
-SUMMARY="_Scripts and programs found in the \`./util\` directory_"
+SUMMARY='
+## List of utils
+
+_Scripts and programs found in the coreboot `./util` directory_
+'
+APPEND_TO_UTIL_MD="${UTIL_README_DIR}/post_util.md"
DESCRIPTION_FILES=$(find "$UTIL_DIR" -name "description.md" | sort)
echo -n "" > "$UTIL_DIR/README.md"
-echo "# Utilities" > "$DOCMENTATION_DIR/util.md"
-echo "$SUMMARY" >> "$DOCMENTATION_DIR/util.md"
+{
+ echo
+ echo "[//]: # ( DO NOT EDIT - AUTOGENERATED FILE )";
+ echo
+ echo "[//]: # ( RUN 'util/util_readme/util_readme.sh' to regenerate )";
+ echo;
+ echo "# Utilities";
+ echo "${SUMMARY}"
+} > "${DOCMENTATION_DIR}/util.md"
for DESC_FILE in $DESCRIPTION_FILES; do
UTIL_NAME=$(echo "$DESC_FILE" | rev | cut -d '/' -f2 | rev)
@@ -40,3 +52,5 @@ for DESC_FILE in $DESCRIPTION_FILES; do
echo "$DESC" >> "$UTIL_DIR/README.md"
echo "$DESC" >> "$DOCMENTATION_DIR/util.md"
done
+
+cat "${APPEND_TO_UTIL_MD}" >> "${DOCMENTATION_DIR}/util.md"