diff options
author | Rob Herring <robh@kernel.org> | 2017-03-21 09:28:11 -0400 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2017-03-22 15:56:13 -0400 |
commit | 86cef6144d273404d8cb5c0b215ada8d23e5dbeb (patch) | |
tree | 83887de117820f5beb0dc438a8cece9b2091a673 /scripts/dtc | |
parent | 0634c2958927198797bf9e55d26fb51cce4c22b4 (diff) |
scripts/dtc: automate getting dtc version and log in update script
Further automate the dtc update script to fill in the dtc version and
commit log.
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'scripts/dtc')
-rwxr-xr-x | scripts/dtc/update-dtc-source.sh | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/scripts/dtc/update-dtc-source.sh b/scripts/dtc/update-dtc-source.sh index f5cde799db03..c92e6bd9458d 100755 --- a/scripts/dtc/update-dtc-source.sh +++ b/scripts/dtc/update-dtc-source.sh | |||
@@ -36,10 +36,19 @@ DTC_SOURCE="checks.c data.c dtc.c dtc.h flattree.c fstree.c livetree.c srcpos.c | |||
36 | DTC_GENERATED="dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h" | 36 | DTC_GENERATED="dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h" |
37 | LIBFDT_SOURCE="Makefile.libfdt fdt.c fdt.h fdt_empty_tree.c fdt_ro.c fdt_rw.c fdt_strerror.c fdt_sw.c fdt_wip.c libfdt.h libfdt_env.h libfdt_internal.h" | 37 | LIBFDT_SOURCE="Makefile.libfdt fdt.c fdt.h fdt_empty_tree.c fdt_ro.c fdt_rw.c fdt_strerror.c fdt_sw.c fdt_wip.c libfdt.h libfdt_env.h libfdt_internal.h" |
38 | 38 | ||
39 | get_last_dtc_version() { | ||
40 | git log --oneline scripts/dtc/ | grep 'upstream' | head -1 | sed -e 's/^.* \(.*\)/\1/' | ||
41 | } | ||
42 | |||
43 | last_dtc_ver=$(get_last_dtc_version) | ||
44 | |||
39 | # Build DTC | 45 | # Build DTC |
40 | cd $DTC_UPSTREAM_PATH | 46 | cd $DTC_UPSTREAM_PATH |
41 | make clean | 47 | make clean |
42 | make check | 48 | make check |
49 | dtc_version=$(git describe HEAD) | ||
50 | dtc_log=$(git log --oneline ${last_dtc_ver}..) | ||
51 | |||
43 | 52 | ||
44 | # Copy the files into the Linux tree | 53 | # Copy the files into the Linux tree |
45 | cd $DTC_LINUX_PATH | 54 | cd $DTC_LINUX_PATH |
@@ -60,4 +69,12 @@ sed -i -- 's/#include <libfdt_env.h>/#include "libfdt_env.h"/g' ./libfdt/libfdt. | |||
60 | sed -i -- 's/#include <fdt.h>/#include "fdt.h"/g' ./libfdt/libfdt.h | 69 | sed -i -- 's/#include <fdt.h>/#include "fdt.h"/g' ./libfdt/libfdt.h |
61 | git add ./libfdt/libfdt.h | 70 | git add ./libfdt/libfdt.h |
62 | 71 | ||
63 | git commit -e -v -m "scripts/dtc: Update to upstream version [CHANGEME]" | 72 | commit_msg=$(cat << EOF |
73 | scripts/dtc: Update to upstream version ${dtc_version} | ||
74 | |||
75 | This adds the following commits from upstream: | ||
76 | |||
77 | ${dtc_log} | ||
78 | EOF | ||
79 | ) | ||
80 | git commit -e -v -s -m "${commit_msg}" | ||