summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorGaurav Minocha <gaurav.minocha.os@gmail.com>2015-04-26 01:53:08 -0400
committerRob Herring <robh@kernel.org>2015-04-29 17:08:05 -0400
commit695e9fdd20d3f75705bd89633ad3d3276450bce6 (patch)
tree6f7fac0abb9bb7d42686bc374366da8acc5a4cb2 /scripts
parentb787f68c36d49bb1d9236f403813641efa74a031 (diff)
scripts/dtc: add missing libfdt and fixups to import script
The following script is used to import dtc upstream into kernel. It was missing import of dtc/libfdt, with this commit it will include the same. Also, currently in arch and driver code that needs early access to the flattened device tree it is necessary to add specific CFLAGS so that when scripts/dtc/libfdt/libfdt.h is included the C preprocessor is able to locate the libfdt versions of libfdt_env.h and fdt.h without generating an error. So, this script replaces angular brackets with quotation used to include header files fdt.h and libfdt_env.h Signed-off-by: Gaurav Minocha <gaurav.minocha.os@gmail.com> [robh: reword commit headline and add 'git add'] Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/dtc/update-dtc-source.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/dtc/update-dtc-source.sh b/scripts/dtc/update-dtc-source.sh
index feb01ef26be4..f5cde799db03 100755
--- a/scripts/dtc/update-dtc-source.sh
+++ b/scripts/dtc/update-dtc-source.sh
@@ -34,6 +34,7 @@ DTC_SOURCE="checks.c data.c dtc.c dtc.h flattree.c fstree.c livetree.c srcpos.c
34 srcpos.h treesource.c util.c util.h version_gen.h Makefile.dtc \ 34 srcpos.h treesource.c util.c util.h version_gen.h Makefile.dtc \
35 dtc-lexer.l dtc-parser.y" 35 dtc-lexer.l dtc-parser.y"
36DTC_GENERATED="dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h" 36DTC_GENERATED="dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h"
37LIBFDT_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 38
38# Build DTC 39# Build DTC
39cd $DTC_UPSTREAM_PATH 40cd $DTC_UPSTREAM_PATH
@@ -50,5 +51,13 @@ for f in $DTC_GENERATED; do
50 cp ${DTC_UPSTREAM_PATH}/$f ${f}_shipped 51 cp ${DTC_UPSTREAM_PATH}/$f ${f}_shipped
51 git add ${f}_shipped 52 git add ${f}_shipped
52done 53done
54for f in $LIBFDT_SOURCE; do
55 cp ${DTC_UPSTREAM_PATH}/libfdt/${f} libfdt/${f}
56 git add libfdt/${f}
57done
58
59sed -i -- 's/#include <libfdt_env.h>/#include "libfdt_env.h"/g' ./libfdt/libfdt.h
60sed -i -- 's/#include <fdt.h>/#include "fdt.h"/g' ./libfdt/libfdt.h
61git add ./libfdt/libfdt.h
53 62
54git commit -e -v -m "scripts/dtc: Update to upstream version [CHANGEME]" 63git commit -e -v -m "scripts/dtc: Update to upstream version [CHANGEME]"